diff --git a/DEPS b/DEPS index be4a6af2..ed6f6061 100644 --- a/DEPS +++ b/DEPS
@@ -44,7 +44,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. - 'v8_revision': '7fb6b9426d6970cde5c338a2bf2189800db0b775', + 'v8_revision': '61b1669a0db16bebcf71a61013441682ce57918c', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling swarming_client # and whatever else without interference from each other.
diff --git a/WATCHLISTS b/WATCHLISTS index 35c7f0d..72076941 100644 --- a/WATCHLISTS +++ b/WATCHLISTS
@@ -1505,12 +1505,12 @@ '|third_party/WebKit/public/platform/modules/screen_orientation', }, 'blink_script': { - 'filepath': '|third_party/WebKit/Source/bindings/core/v8/.*Module.*' \ + 'filepath': 'third_party/WebKit/Source/bindings/core/v8/.*Module.*' \ '|third_party/WebKit/Source/bindings/core/v8/ScriptController.*' \ '|third_party/WebKit/Source/bindings/core/v8/ScriptSourceCode.*' \ '|third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.*' '|third_party/WebKit/Source/core/dom/.*Modul.*' \ - '!third_party/WebKit/Source/core/dom/.*Script.*' \ + '|third_party/WebKit/Source/core/dom/.*Script.*' \ '|third_party/WebKit/Source/core/html/HTMLScriptElement.*' \ '|third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.*' \ '|third_party/WebKit/Source/core/loader/modulescript/' \
diff --git a/build/config/nacl/rules.gni b/build/config/nacl/rules.gni index c8956b4..1c1a912 100644 --- a/build/config/nacl/rules.gni +++ b/build/config/nacl/rules.gni
@@ -74,14 +74,16 @@ # Starts empty so the code below can use += everywhere. data = [] - nmfflags += [ "--library-path=" + rebase_path(root_out_dir) ] + nmfflags += + [ "--library-path=" + rebase_path(root_out_dir, root_build_dir) ] # NOTE: There is no explicit dependency for the lib directory # (lib32 and lib64 for x86/x64) created in the product directory. # They are created as a side-effect of nmf creation. if (current_cpu != "x86" && current_cpu != "x64") { nmfflags += - [ "--library-path=" + rebase_path("${nacl_toolchain_tooldir}/lib") ] + [ "--library-path=" + + rebase_path("${nacl_toolchain_tooldir}/lib", root_build_dir) ] if (current_cpu == "arm") { data += [ "${lib_path}/libarm/" ] } else { @@ -90,8 +92,9 @@ } else { # For x86-32, the lib/ directory is called lib32/ instead. if (current_cpu == "x86") { - nmfflags += [ "--library-path=" + - rebase_path("${nacl_toolchain_tooldir}/lib32") ] + nmfflags += + [ "--library-path=" + + rebase_path("${nacl_toolchain_tooldir}/lib32", root_build_dir) ] data += [ "${lib_path}/lib32/" ] } @@ -112,8 +115,9 @@ "root_out_dir") } nmfflags += [ - "--library-path=" + rebase_path(x64_out_dir), - "--library-path=" + rebase_path("${nacl_toolchain_tooldir}/lib"), + "--library-path=" + rebase_path(x64_out_dir, root_build_dir), + "--library-path=" + + rebase_path("${nacl_toolchain_tooldir}/lib", root_build_dir), ] data += [ "${lib_path}/lib64/" ] } @@ -121,7 +125,7 @@ } args = [ "--no-default-libpath", - "--objdump=" + objdump, + "--objdump=" + rebase_path(objdump, root_build_dir), "--output=" + rebase_path(nmf, root_build_dir), ] + nmfflags + rebase_path(sources, root_build_dir) if (is_nacl_glibc && current_cpu == "arm") {
diff --git a/build/toolchain/gcc_toolchain.gni b/build/toolchain/gcc_toolchain.gni index d7286635..60aee31 100644 --- a/build/toolchain/gcc_toolchain.gni +++ b/build/toolchain/gcc_toolchain.gni
@@ -387,7 +387,8 @@ # This needs a Python script to avoid using a complex shell command # requiring sh control structures, pipelines, and POSIX utilities. # The host might not have a POSIX shell and utilities (e.g. Windows). - solink_wrapper = rebase_path("//build/toolchain/gcc_solink_wrapper.py") + solink_wrapper = + rebase_path("//build/toolchain/gcc_solink_wrapper.py", root_build_dir) command = "$python_path \"$solink_wrapper\" --readelf=\"$readelf\" --nm=\"$nm\" $strip_switch--sofile=\"$unstripped_sofile\" --tocfile=\"$tocfile\"$map_switch --output=\"$sofile\"$whitelist_flag -- $link_command" rspfile_content = "-Wl,--whole-archive {{inputs}} {{solibs}} -Wl,--no-whole-archive $solink_libs_section_prefix {{libs}} $solink_libs_section_postfix"
diff --git a/cc/output/direct_renderer.cc b/cc/output/direct_renderer.cc index 18259fe7..5339f82 100644 --- a/cc/output/direct_renderer.cc +++ b/cc/output/direct_renderer.cc
@@ -97,6 +97,10 @@ allow_empty_swap_ = true; if (context_provider->ContextCapabilities().dc_layers) supports_dc_layers_ = true; + if (context_provider->ContextCapabilities() + .disable_non_empty_post_sub_buffers) { + use_partial_swap_ = false; + } } initialized_ = true;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/photo_picker/PickerCategoryView.java b/chrome/android/java/src/org/chromium/chrome/browser/photo_picker/PickerCategoryView.java index 3f7a03c..24bdc22 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/photo_picker/PickerCategoryView.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/photo_picker/PickerCategoryView.java
@@ -6,6 +6,7 @@ import android.app.Activity; import android.content.Context; +import android.content.DialogInterface; import android.content.res.Configuration; import android.graphics.Bitmap; import android.graphics.Rect; @@ -190,6 +191,13 @@ mDialog = dialog; mMultiSelectionAllowed = multiSelectionAllowed; mListener = listener; + + mDialog.setOnCancelListener(new DialogInterface.OnCancelListener() { + @Override + public void onCancel(DialogInterface dialog) { + mListener.onPickerUserAction(PhotoPickerListener.Action.CANCEL, null); + } + }); } // FileEnumWorkerTask.FilesEnumeratedCallback:
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/firstrun/FirstRunIntegrationTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/firstrun/FirstRunIntegrationTest.java index ffbdd52e..9add290d4d 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/firstrun/FirstRunIntegrationTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/firstrun/FirstRunIntegrationTest.java
@@ -26,6 +26,7 @@ import org.chromium.base.ThreadUtils; import org.chromium.base.annotations.SuppressFBWarnings; +import org.chromium.base.test.util.DisabledTest; import org.chromium.chrome.R; import org.chromium.chrome.browser.ChromeTabbedActivity; import org.chromium.chrome.browser.customtabs.CustomTabActivity; @@ -240,6 +241,7 @@ @Test @MediumTest + @DisabledTest(message = "crbug.com/718461") public void testDefaultSearchEngine_ShowExisting() throws Exception { runSearchEnginePromptTest(LocaleManager.SEARCH_ENGINE_PROMO_SHOW_EXISTING); }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestMetricsTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestMetricsTest.java index 0061599..c452ed2 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestMetricsTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestMetricsTest.java
@@ -21,6 +21,7 @@ import org.chromium.base.ThreadUtils; import org.chromium.base.metrics.RecordHistogram; import org.chromium.base.test.util.CommandLineFlags; +import org.chromium.base.test.util.DisabledTest; import org.chromium.base.test.util.Feature; import org.chromium.chrome.R; import org.chromium.chrome.browser.ChromeFeatureList; @@ -379,6 +380,7 @@ @Test @MediumTest @Feature({"Payments"}) + @DisabledTest(message = "Flaky. See crbug.com/727558") public void testShownLoggedOnlyOnce() throws InterruptedException, ExecutionException, TimeoutException { // Initiate a payment request.
diff --git a/chrome/browser/browsing_data/browsing_data_counter_utils_unittest.cc b/chrome/browser/browsing_data/browsing_data_counter_utils_unittest.cc index 16eeece..8406b65 100644 --- a/chrome/browser/browsing_data/browsing_data_counter_utils_unittest.cc +++ b/chrome/browser/browsing_data/browsing_data_counter_utils_unittest.cc
@@ -46,12 +46,12 @@ std::string apps_list; std::string expected_output; } kTestCases[] = { - { "", "none" }, - { "App1", "1 app (App1)" }, - { "App1, App2", "2 apps (App1, App2)" }, - { "App1, App2, App3", "3 apps (App1, App2, and 1 more)" }, - { "App1, App2, App3, App4", "4 apps (App1, App2, and 2 more)" }, - { "App1, App2, App3, App4, App5", "5 apps (App1, App2, and 3 more)" }, + {"", "None"}, + {"App1", "1 app (App1)"}, + {"App1, App2", "2 apps (App1, App2)"}, + {"App1, App2, App3", "3 apps (App1, App2, and 1 more)"}, + {"App1, App2, App3, App4", "4 apps (App1, App2, and 2 more)"}, + {"App1, App2, App3, App4, App5", "5 apps (App1, App2, and 3 more)"}, }; for (const TestCase& test_case : kTestCases) {
diff --git a/chrome/browser/chromeos/settings/cros_settings.cc b/chrome/browser/chromeos/settings/cros_settings.cc index b49a02e4..d00b71b 100644 --- a/chrome/browser/chromeos/settings/cros_settings.cc +++ b/chrome/browser/chromeos/settings/cros_settings.cc
@@ -83,6 +83,7 @@ } CrosSettings::~CrosSettings() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); } bool CrosSettings::IsCrosSettings(const std::string& path) { @@ -91,7 +92,7 @@ } void CrosSettings::Set(const std::string& path, const base::Value& in_value) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); CrosSettingsProvider* provider; provider = GetProvider(path); if (provider) @@ -99,7 +100,7 @@ } const base::Value* CrosSettings::GetPref(const std::string& path) const { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); CrosSettingsProvider* provider = GetProvider(path); if (provider) return provider->Get(path); @@ -109,7 +110,7 @@ CrosSettingsProvider::TrustedStatus CrosSettings::PrepareTrustedValues( const base::Closure& callback) const { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); for (size_t i = 0; i < providers_.size(); ++i) { CrosSettingsProvider::TrustedStatus status = providers_[i]->PrepareTrustedValues(callback); @@ -120,33 +121,33 @@ } void CrosSettings::SetBoolean(const std::string& path, bool in_value) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); base::Value value(in_value); Set(path, value); } void CrosSettings::SetInteger(const std::string& path, int in_value) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); base::Value value(in_value); Set(path, value); } void CrosSettings::SetDouble(const std::string& path, double in_value) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); base::Value value(in_value); Set(path, value); } void CrosSettings::SetString(const std::string& path, const std::string& in_value) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); base::Value value(in_value); Set(path, value); } void CrosSettings::AppendToList(const std::string& path, const base::Value* value) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); const base::Value* old_value = GetPref(path); std::unique_ptr<base::Value> new_value(old_value ? old_value->DeepCopy() : new base::ListValue()); @@ -157,7 +158,7 @@ void CrosSettings::RemoveFromList(const std::string& path, const base::Value* value) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); const base::Value* old_value = GetPref(path); std::unique_ptr<base::Value> new_value(old_value ? old_value->DeepCopy() : new base::ListValue()); @@ -167,7 +168,7 @@ bool CrosSettings::GetBoolean(const std::string& path, bool* bool_value) const { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); const base::Value* value = GetPref(path); if (value) return value->GetAsBoolean(bool_value); @@ -176,7 +177,7 @@ bool CrosSettings::GetInteger(const std::string& path, int* out_value) const { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); const base::Value* value = GetPref(path); if (value) return value->GetAsInteger(out_value); @@ -185,7 +186,7 @@ bool CrosSettings::GetDouble(const std::string& path, double* out_value) const { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); const base::Value* value = GetPref(path); if (value) return value->GetAsDouble(out_value); @@ -194,7 +195,7 @@ bool CrosSettings::GetString(const std::string& path, std::string* out_value) const { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); const base::Value* value = GetPref(path); if (value) return value->GetAsString(out_value); @@ -203,7 +204,7 @@ bool CrosSettings::GetList(const std::string& path, const base::ListValue** out_value) const { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); const base::Value* value = GetPref(path); if (value) return value->GetAsList(out_value); @@ -213,7 +214,7 @@ bool CrosSettings::GetDictionary( const std::string& path, const base::DictionaryValue** out_value) const { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); const base::Value* value = GetPref(path); if (value) return value->GetAsDictionary(out_value); @@ -223,7 +224,7 @@ bool CrosSettings::FindEmailInList(const std::string& path, const std::string& email, bool* wildcard_match) const { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); std::string canonicalized_email( gaia::CanonicalizeEmail(gaia::SanitizeEmail(email))); std::string wildcard_email; @@ -271,7 +272,7 @@ bool CrosSettings::AddSettingsProvider( std::unique_ptr<CrosSettingsProvider> provider) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); CrosSettingsProvider* provider_ptr = provider.get(); providers_.push_back(std::move(provider)); @@ -287,7 +288,7 @@ std::unique_ptr<CrosSettingsProvider> CrosSettings::RemoveSettingsProvider( CrosSettingsProvider* provider) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); auto it = std::find_if( providers_.begin(), providers_.end(), [provider](const std::unique_ptr<CrosSettingsProvider>& ptr) { @@ -306,7 +307,7 @@ const base::Closure& callback) { DCHECK(!path.empty()); DCHECK(!callback.is_null()); - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (!GetProvider(path)) { NOTREACHED() << "Trying to add an observer for an unregistered setting: " @@ -338,7 +339,7 @@ } void CrosSettings::FireObservers(const std::string& path) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); auto observer_iterator = settings_observers_.find(path); if (observer_iterator == settings_observers_.end()) return;
diff --git a/chrome/browser/chromeos/settings/cros_settings.h b/chrome/browser/chromeos/settings/cros_settings.h index adeb416..77d5c1d 100644 --- a/chrome/browser/chromeos/settings/cros_settings.h +++ b/chrome/browser/chromeos/settings/cros_settings.h
@@ -13,7 +13,7 @@ #include "base/callback_list.h" #include "base/containers/hash_tables.h" #include "base/macros.h" -#include "base/threading/non_thread_safe.h" +#include "base/sequence_checker.h" #include "chromeos/settings/cros_settings_names.h" #include "chromeos/settings/cros_settings_provider.h" @@ -28,7 +28,7 @@ class DeviceSettingsService; // This class manages per-device/global settings. -class CrosSettings : public base::NonThreadSafe { +class CrosSettings { public: // Manage singleton instance. static void Initialize(); @@ -134,6 +134,8 @@ base::hash_map<std::string, std::unique_ptr<base::CallbackList<void(void)>>> settings_observers_; + SEQUENCE_CHECKER(sequence_checker_); + DISALLOW_COPY_AND_ASSIGN(CrosSettings); };
diff --git a/chrome/browser/media/router/discovery/dial/safe_dial_device_description_parser.h b/chrome/browser/media/router/discovery/dial/safe_dial_device_description_parser.h index 172d89d0..0065288 100644 --- a/chrome/browser/media/router/discovery/dial/safe_dial_device_description_parser.h +++ b/chrome/browser/media/router/discovery/dial/safe_dial_device_description_parser.h
@@ -26,8 +26,8 @@ // device description XML. // |success|: returns false if parsing fails. // |device_description|: device description object. Empty if parsing fails. - using DeviceDescriptionCallback = chrome::mojom::DialDeviceDescriptionParser:: - ParseDialDeviceDescriptionCallback; + using DeviceDescriptionCallback = + base::Callback<void(chrome::mojom::DialDeviceDescriptionPtr)>; SafeDialDeviceDescriptionParser(); virtual ~SafeDialDeviceDescriptionParser();
diff --git a/chrome/browser/media/router/mojo/media_router_mojo_impl.cc b/chrome/browser/media/router/mojo/media_router_mojo_impl.cc index a397a7f..aaaa426 100644 --- a/chrome/browser/media/router/mojo/media_router_mojo_impl.cc +++ b/chrome/browser/media/router/mojo/media_router_mojo_impl.cc
@@ -134,8 +134,7 @@ void MediaRouterMojoImpl::RegisterMediaRouteProvider( mojom::MediaRouteProviderPtr media_route_provider_ptr, - const mojom::MediaRouter::RegisterMediaRouteProviderCallback& - callback) { + mojom::MediaRouter::RegisterMediaRouteProviderCallback callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); #if defined(OS_WIN) // The MRPM may have been upgraded or otherwise reload such that we could be @@ -166,7 +165,7 @@ // Media Router (crbug.com/687383), so we need to disable it in the provider. config->enable_dial_discovery = !media_router::DialLocalDiscoveryEnabled(); config->enable_cast_discovery = !media_router::CastDiscoveryEnabled(); - callback.Run(instance_id_, std::move(config)); + std::move(callback).Run(instance_id_, std::move(config)); ExecutePendingRequests(); SyncStateToMediaRouteProvider();
diff --git a/chrome/browser/media/router/mojo/media_router_mojo_impl.h b/chrome/browser/media/router/mojo/media_router_mojo_impl.h index c54abca..a6f1c3f 100644 --- a/chrome/browser/media/router/mojo/media_router_mojo_impl.h +++ b/chrome/browser/media/router/mojo/media_router_mojo_impl.h
@@ -325,8 +325,7 @@ // mojom::MediaRouter implementation. void RegisterMediaRouteProvider( mojom::MediaRouteProviderPtr media_route_provider_ptr, - const mojom::MediaRouter::RegisterMediaRouteProviderCallback& - callback) override; + mojom::MediaRouter::RegisterMediaRouteProviderCallback callback) override; void OnIssue(const IssueInfo& issue) override; void OnSinksReceived(const std::string& media_source, const std::vector<MediaSinkInternal>& internal_sinks,
diff --git a/chrome/browser/media/router/mojo/media_router_mojo_impl_unittest.cc b/chrome/browser/media/router/mojo/media_router_mojo_impl_unittest.cc index 3a7adfb..a86c6b6 100644 --- a/chrome/browser/media/router/mojo/media_router_mojo_impl_unittest.cc +++ b/chrome/browser/media/router/mojo/media_router_mojo_impl_unittest.cc
@@ -105,8 +105,8 @@ Unused, Unused, Unused, - const mojom::MediaRouteProvider::CreateMediaRouteControllerCallback& cb) { - cb.Run(true); + mojom::MediaRouteProvider::CreateMediaRouteControllerCallback& cb) { + std::move(cb).Run(true); } } // namespace @@ -192,16 +192,18 @@ // Use a lambda function as an invocation target here to work around // a limitation with GMock::Invoke that prevents it from using move-only types // in runnable parameter lists. - EXPECT_CALL(mock_media_route_provider_, - CreateRoute(kSource, kSinkId, _, url::Origin(GURL(kOrigin)), + EXPECT_CALL( + mock_media_route_provider_, + CreateRouteInternal(kSource, kSinkId, _, url::Origin(GURL(kOrigin)), kInvalidTabId, _, _, _)) - .WillOnce(Invoke( - [](const std::string& source, const std::string& sink, - const std::string& presentation_id, const url::Origin& origin, - int tab_id, base::TimeDelta timeout, bool incognito, - const mojom::MediaRouteProvider::CreateRouteCallback& cb) { - cb.Run(CreateMediaRoute(), std::string(), RouteRequestResult::OK); - })); + .WillOnce(Invoke([](const std::string& source, const std::string& sink, + const std::string& presentation_id, + const url::Origin& origin, int tab_id, + base::TimeDelta timeout, bool incognito, + mojom::MediaRouteProvider::CreateRouteCallback& cb) { + std::move(cb).Run(CreateMediaRoute(), std::string(), + RouteRequestResult::OK); + })); base::RunLoop run_loop; RouteResponseCallbackHandler handler; @@ -228,15 +230,18 @@ // Use a lambda function as an invocation target here to work around // a limitation with GMock::Invoke that prevents it from using move-only types // in runnable parameter lists. - EXPECT_CALL(mock_media_route_provider_, - CreateRoute(kSource, kSinkId, _, url::Origin(GURL(kOrigin)), + EXPECT_CALL( + mock_media_route_provider_, + CreateRouteInternal(kSource, kSinkId, _, url::Origin(GURL(kOrigin)), kInvalidTabId, _, _, _)) .WillOnce(Invoke([&expected_route]( - const std::string& source, const std::string& sink, - const std::string& presentation_id, const url::Origin& origin, - int tab_id, base::TimeDelta timeout, bool incognito, - const mojom::MediaRouteProvider::CreateRouteCallback& cb) { - cb.Run(expected_route, std::string(), RouteRequestResult::OK); + const std::string& source, const std::string& sink, + const std::string& presentation_id, + const url::Origin& origin, int tab_id, + base::TimeDelta timeout, bool incognito, + mojom::MediaRouteProvider::CreateRouteCallback& cb) { + std::move(cb).Run(expected_route, std::string(), + RouteRequestResult::OK); })); base::RunLoop run_loop; @@ -258,17 +263,17 @@ TEST_F(MediaRouterMojoImplTest, CreateRouteFails) { EXPECT_CALL( mock_media_route_provider_, - CreateRoute(kSource, kSinkId, _, url::Origin(GURL(kOrigin)), - kInvalidTabId, - base::TimeDelta::FromMilliseconds(kTimeoutMillis), _, _)) - .WillOnce(Invoke( - [](const std::string& source, const std::string& sink, - const std::string& presentation_id, const url::Origin& origin, - int tab_id, base::TimeDelta timeout, bool incognito, - const mojom::MediaRouteProvider::CreateRouteCallback& cb) { - cb.Run(base::nullopt, std::string(kError), - RouteRequestResult::TIMED_OUT); - })); + CreateRouteInternal( + kSource, kSinkId, _, url::Origin(GURL(kOrigin)), kInvalidTabId, + base::TimeDelta::FromMilliseconds(kTimeoutMillis), _, _)) + .WillOnce(Invoke([](const std::string& source, const std::string& sink, + const std::string& presentation_id, + const url::Origin& origin, int tab_id, + base::TimeDelta timeout, bool incognito, + mojom::MediaRouteProvider::CreateRouteCallback& cb) { + std::move(cb).Run(base::nullopt, std::string(kError), + RouteRequestResult::TIMED_OUT); + })); RouteResponseCallbackHandler handler; base::RunLoop run_loop; @@ -289,16 +294,17 @@ TEST_F(MediaRouterMojoImplTest, CreateRouteIncognitoMismatchFails) { EXPECT_CALL( mock_media_route_provider_, - CreateRoute(kSource, kSinkId, _, url::Origin(GURL(kOrigin)), - kInvalidTabId, - base::TimeDelta::FromMilliseconds(kTimeoutMillis), true, _)) - .WillOnce(Invoke( - [](const std::string& source, const std::string& sink, - const std::string& presentation_id, const url::Origin& origin, - int tab_id, base::TimeDelta timeout, bool incognito, - const mojom::MediaRouteProvider::CreateRouteCallback& cb) { - cb.Run(CreateMediaRoute(), std::string(), RouteRequestResult::OK); - })); + CreateRouteInternal( + kSource, kSinkId, _, url::Origin(GURL(kOrigin)), kInvalidTabId, + base::TimeDelta::FromMilliseconds(kTimeoutMillis), true, _)) + .WillOnce(Invoke([](const std::string& source, const std::string& sink, + const std::string& presentation_id, + const url::Origin& origin, int tab_id, + base::TimeDelta timeout, bool incognito, + mojom::MediaRouteProvider::CreateRouteCallback& cb) { + std::move(cb).Run(CreateMediaRoute(), std::string(), + RouteRequestResult::OK); + })); RouteResponseCallbackHandler handler; base::RunLoop run_loop; @@ -324,16 +330,17 @@ EXPECT_CALL( mock_media_route_provider_, - CreateRoute(kSource, kSinkId, _, url::Origin(GURL(kOrigin)), - kInvalidTabId, - base::TimeDelta::FromMilliseconds(kTimeoutMillis), true, _)) - .WillOnce(Invoke([&route]( - const std::string& source, const std::string& sink, - const std::string& presentation_id, const url::Origin& origin, - int tab_id, base::TimeDelta timeout, bool incognito, - const mojom::MediaRouteProvider::CreateRouteCallback& cb) { - cb.Run(route, std::string(), RouteRequestResult::OK); - })); + CreateRouteInternal( + kSource, kSinkId, _, url::Origin(GURL(kOrigin)), kInvalidTabId, + base::TimeDelta::FromMilliseconds(kTimeoutMillis), true, _)) + .WillOnce( + Invoke([&route](const std::string& source, const std::string& sink, + const std::string& presentation_id, + const url::Origin& origin, int tab_id, + base::TimeDelta timeout, bool incognito, + mojom::MediaRouteProvider::CreateRouteCallback& cb) { + std::move(cb).Run(route, std::string(), RouteRequestResult::OK); + })); base::RunLoop run_loop; router()->CreateRoute(kSource, kSinkId, url::Origin(GURL(kOrigin)), nullptr, std::vector<MediaRouteResponseCallback>(), @@ -347,11 +354,11 @@ // instead of manually calling Run/Quit on the run loop. run_loop.RunUntilIdle(); - EXPECT_CALL(mock_media_route_provider_, TerminateRoute(kRouteId, _)) - .WillOnce(Invoke( - [](const std::string& route_id, - const mojom::MediaRouteProvider::TerminateRouteCallback& cb) { - cb.Run(base::nullopt, RouteRequestResult::OK); + EXPECT_CALL(mock_media_route_provider_, TerminateRouteInternal(kRouteId, _)) + .WillOnce( + Invoke([](const std::string& route_id, + mojom::MediaRouteProvider::TerminateRouteCallback& cb) { + std::move(cb).Run(base::nullopt, RouteRequestResult::OK); })); base::RunLoop run_loop2; @@ -377,16 +384,17 @@ // in runnable parameter lists. EXPECT_CALL( mock_media_route_provider_, - JoinRoute(kSource, kPresentationId, url::Origin(GURL(kOrigin)), - kInvalidTabId, - base::TimeDelta::FromMilliseconds(kTimeoutMillis), _, _)) - .WillOnce(Invoke([&route]( - const std::string& source, const std::string& presentation_id, - const url::Origin& origin, int tab_id, base::TimeDelta timeout, - bool incognito, - const mojom::MediaRouteProvider::JoinRouteCallback& cb) { - cb.Run(route, std::string(), RouteRequestResult::OK); - })); + JoinRouteInternal( + kSource, kPresentationId, url::Origin(GURL(kOrigin)), kInvalidTabId, + base::TimeDelta::FromMilliseconds(kTimeoutMillis), _, _)) + .WillOnce( + Invoke([&route](const std::string& source, + const std::string& presentation_id, + const url::Origin& origin, int tab_id, + base::TimeDelta timeout, bool incognito, + mojom::MediaRouteProvider::JoinRouteCallback& cb) { + std::move(cb).Run(route, std::string(), RouteRequestResult::OK); + })); RouteResponseCallbackHandler handler; base::RunLoop run_loop; @@ -429,16 +437,15 @@ EXPECT_CALL( mock_media_route_provider_, - JoinRoute(kSource, kPresentationId, url::Origin(GURL(kOrigin)), - kInvalidTabId, - base::TimeDelta::FromMilliseconds(kTimeoutMillis), _, _)) + JoinRouteInternal( + kSource, kPresentationId, url::Origin(GURL(kOrigin)), kInvalidTabId, + base::TimeDelta::FromMilliseconds(kTimeoutMillis), _, _)) .WillOnce(Invoke( [](const std::string& source, const std::string& presentation_id, const url::Origin& origin, int tab_id, base::TimeDelta timeout, - bool incognito, - const mojom::MediaRouteProvider::JoinRouteCallback& cb) { - cb.Run(base::nullopt, std::string(kError), - RouteRequestResult::TIMED_OUT); + bool incognito, mojom::MediaRouteProvider::JoinRouteCallback& cb) { + std::move(cb).Run(base::nullopt, std::string(kError), + RouteRequestResult::TIMED_OUT); })); RouteResponseCallbackHandler handler; @@ -471,16 +478,17 @@ // in runnable parameter lists. EXPECT_CALL( mock_media_route_provider_, - JoinRoute(kSource, kPresentationId, url::Origin(GURL(kOrigin)), - kInvalidTabId, - base::TimeDelta::FromMilliseconds(kTimeoutMillis), true, _)) - .WillOnce(Invoke([&route]( - const std::string& source, const std::string& presentation_id, - const url::Origin& origin, int tab_id, base::TimeDelta timeout, - bool incognito, - const mojom::MediaRouteProvider::JoinRouteCallback& cb) { - cb.Run(route, std::string(), RouteRequestResult::OK); - })); + JoinRouteInternal( + kSource, kPresentationId, url::Origin(GURL(kOrigin)), kInvalidTabId, + base::TimeDelta::FromMilliseconds(kTimeoutMillis), true, _)) + .WillOnce( + Invoke([&route](const std::string& source, + const std::string& presentation_id, + const url::Origin& origin, int tab_id, + base::TimeDelta timeout, bool incognito, + mojom::MediaRouteProvider::JoinRouteCallback& cb) { + std::move(cb).Run(route, std::string(), RouteRequestResult::OK); + })); RouteResponseCallbackHandler handler; base::RunLoop run_loop; @@ -511,16 +519,17 @@ // in runnable parameter lists. EXPECT_CALL( mock_media_route_provider_, - ConnectRouteByRouteId( + ConnectRouteByRouteIdInternal( kSource, kRouteId, _, url::Origin(GURL(kOrigin)), kInvalidTabId, base::TimeDelta::FromMilliseconds(kTimeoutMillis), false, _)) - .WillOnce(Invoke([&route]( - const std::string& source, const std::string& route_id, - const std::string& presentation_id, const url::Origin& origin, - int tab_id, base::TimeDelta timeout, bool incognito, - const mojom::MediaRouteProvider::JoinRouteCallback& cb) { - cb.Run(route, std::string(), RouteRequestResult::OK); - })); + .WillOnce(Invoke( + [&route](const std::string& source, const std::string& route_id, + const std::string& presentation_id, + const url::Origin& origin, int tab_id, + base::TimeDelta timeout, bool incognito, + mojom::MediaRouteProvider::JoinRouteCallback& cb) { + std::move(cb).Run(route, std::string(), RouteRequestResult::OK); + })); RouteResponseCallbackHandler handler; base::RunLoop run_loop; @@ -541,16 +550,16 @@ TEST_F(MediaRouterMojoImplTest, ConnectRouteByRouteIdFails) { EXPECT_CALL( mock_media_route_provider_, - ConnectRouteByRouteId( + ConnectRouteByRouteIdInternal( kSource, kRouteId, _, url::Origin(GURL(kOrigin)), kInvalidTabId, base::TimeDelta::FromMilliseconds(kTimeoutMillis), true, _)) .WillOnce(Invoke( [](const std::string& source, const std::string& route_id, const std::string& presentation_id, const url::Origin& origin, int tab_id, base::TimeDelta timeout, bool incognito, - const mojom::MediaRouteProvider::JoinRouteCallback& cb) { - cb.Run(base::nullopt, std::string(kError), - RouteRequestResult::TIMED_OUT); + mojom::MediaRouteProvider::JoinRouteCallback& cb) { + std::move(cb).Run(base::nullopt, std::string(kError), + RouteRequestResult::TIMED_OUT); })); RouteResponseCallbackHandler handler; @@ -577,16 +586,17 @@ // in runnable parameter lists. EXPECT_CALL( mock_media_route_provider_, - ConnectRouteByRouteId( + ConnectRouteByRouteIdInternal( kSource, kRouteId, _, url::Origin(GURL(kOrigin)), kInvalidTabId, base::TimeDelta::FromMilliseconds(kTimeoutMillis), true, _)) - .WillOnce(Invoke([&route]( - const std::string& source, const std::string& route_id, - const std::string& presentation_id, const url::Origin& origin, - int tab_id, base::TimeDelta timeout, bool incognito, - const mojom::MediaRouteProvider::JoinRouteCallback& cb) { - cb.Run(route, std::string(), RouteRequestResult::OK); - })); + .WillOnce(Invoke( + [&route](const std::string& source, const std::string& route_id, + const std::string& presentation_id, + const url::Origin& origin, int tab_id, + base::TimeDelta timeout, bool incognito, + mojom::MediaRouteProvider::JoinRouteCallback& cb) { + std::move(cb).Run(route, std::string(), RouteRequestResult::OK); + })); RouteResponseCallbackHandler handler; base::RunLoop run_loop; @@ -616,11 +626,11 @@ TEST_F(MediaRouterMojoImplTest, TerminateRoute) { base::RunLoop run_loop; - EXPECT_CALL(mock_media_route_provider_, TerminateRoute(kRouteId, _)) - .WillOnce(Invoke( - [](const std::string& route_id, - const mojom::MediaRouteProvider::TerminateRouteCallback& cb) { - cb.Run(base::nullopt, RouteRequestResult::OK); + EXPECT_CALL(mock_media_route_provider_, TerminateRouteInternal(kRouteId, _)) + .WillOnce( + Invoke([](const std::string& route_id, + mojom::MediaRouteProvider::TerminateRouteCallback& cb) { + std::move(cb).Run(base::nullopt, RouteRequestResult::OK); })); router()->TerminateRoute(kRouteId); run_loop.RunUntilIdle(); @@ -629,11 +639,12 @@ TEST_F(MediaRouterMojoImplTest, TerminateRouteFails) { base::RunLoop run_loop; - EXPECT_CALL(mock_media_route_provider_, TerminateRoute(kRouteId, _)) - .WillOnce(Invoke( - [](const std::string& route_id, - const mojom::MediaRouteProvider::TerminateRouteCallback& cb) { - cb.Run(std::string("timed out"), RouteRequestResult::TIMED_OUT); + EXPECT_CALL(mock_media_route_provider_, TerminateRouteInternal(kRouteId, _)) + .WillOnce( + Invoke([](const std::string& route_id, + mojom::MediaRouteProvider::TerminateRouteCallback& cb) { + std::move(cb).Run(std::string("timed out"), + RouteRequestResult::TIMED_OUT); })); router()->TerminateRoute(kRouteId); run_loop.RunUntilIdle(); @@ -942,13 +953,13 @@ } TEST_F(MediaRouterMojoImplTest, SendRouteMessage) { - EXPECT_CALL( - mock_media_route_provider_, SendRouteMessage(kRouteId, kMessage, _)) - .WillOnce(Invoke([]( - const MediaRoute::Id& route_id, const std::string& message, - const mojom::MediaRouteProvider::SendRouteMessageCallback& cb) { - cb.Run(true); - })); + EXPECT_CALL(mock_media_route_provider_, + SendRouteMessageInternal(kRouteId, kMessage, _)) + .WillOnce( + Invoke([](const MediaRoute::Id& route_id, const std::string& message, + mojom::MediaRouteProvider::SendRouteMessageCallback& cb) { + std::move(cb).Run(true); + })); base::RunLoop run_loop; SendMessageCallbackHandler handler; @@ -967,13 +978,13 @@ EXPECT_CALL(mock_media_route_provider_, SendRouteBinaryMessageInternal(kRouteId, _, _)) - .WillOnce(Invoke([]( - const MediaRoute::Id& route_id, const std::vector<uint8_t>& data, - const mojom::MediaRouteProvider::SendRouteMessageCallback& cb) { - EXPECT_EQ( - 0, memcmp(kBinaryMessage, &(data[0]), arraysize(kBinaryMessage))); - cb.Run(true); - })); + .WillOnce(Invoke( + [](const MediaRoute::Id& route_id, const std::vector<uint8_t>& data, + mojom::MediaRouteProvider::SendRouteMessageCallback& cb) { + EXPECT_EQ(0, memcmp(kBinaryMessage, &(data[0]), + arraysize(kBinaryMessage))); + std::move(cb).Run(true); + })); base::RunLoop run_loop; SendMessageCallbackHandler handler; @@ -1205,10 +1216,10 @@ Invoke([&search_input, &domain]( const std::string& sink_id, const std::string& source, const mojom::SinkSearchCriteriaPtr& search_criteria, - const mojom::MediaRouteProvider::SearchSinksCallback& cb) { + mojom::MediaRouteProvider::SearchSinksCallback& cb) { EXPECT_EQ(search_input, search_criteria->input); EXPECT_EQ(domain, search_criteria->domain); - cb.Run(kSinkId2); + std::move(cb).Run(kSinkId2); })); SinkResponseCallbackHandler sink_handler; @@ -1252,16 +1263,17 @@ EXPECT_CALL(mock_media_route_provider_, CreateMediaRouteControllerInternal(kRouteId, _, _, _)) - .WillOnce(Invoke([&media_controller, &route_controller_as_observer]( - const std::string& route_id, - mojom::MediaControllerRequest& request, - mojom::MediaStatusObserverPtr& observer, - const mojom::MediaRouteProvider:: - CreateMediaRouteControllerCallback& cb) { - media_controller.Bind(std::move(request)); - route_controller_as_observer = std::move(observer); - cb.Run(true); - })); + .WillOnce(Invoke( + [&media_controller, &route_controller_as_observer]( + const std::string& route_id, + mojom::MediaControllerRequest& request, + mojom::MediaStatusObserverPtr& observer, + mojom::MediaRouteProvider::CreateMediaRouteControllerCallback& + cb) { + media_controller.Bind(std::move(request)); + route_controller_as_observer = std::move(observer); + std::move(cb).Run(true); + })); // GetRouteController() should return a MediaRouteController that is connected // to the MediaController provided by the MediaRouteProvider, and will also be // subscribed to MediaStatus updates. @@ -1377,8 +1389,8 @@ CreateMediaRouteControllerInternal(kRouteId, _, _, _)) .WillOnce(Invoke( [](Unused, Unused, Unused, - const mojom::MediaRouteProvider:: - CreateMediaRouteControllerCallback& cb) { cb.Run(false); })); + mojom::MediaRouteProvider::CreateMediaRouteControllerCallback& + cb) { std::move(cb).Run(false); })); MockMediaRouteControllerObserver observer( router()->GetRouteController(kRouteId));
diff --git a/chrome/browser/media/router/mojo/media_router_mojo_test.h b/chrome/browser/media/router/mojo/media_router_mojo_test.h index 9f6eeb45..cd221596 100644 --- a/chrome/browser/media/router/mojo/media_router_mojo_test.h +++ b/chrome/browser/media/router/mojo/media_router_mojo_test.h
@@ -30,7 +30,18 @@ MockMediaRouteProvider(); ~MockMediaRouteProvider() override; - MOCK_METHOD8(CreateRoute, + void CreateRoute(const std::string& source_urn, + const std::string& sink_id, + const std::string& presentation_id, + const url::Origin& origin, + int tab_id, + base::TimeDelta timeout, + bool incognito, + CreateRouteCallback callback) { + CreateRouteInternal(source_urn, sink_id, presentation_id, origin, tab_id, + timeout, incognito, callback); + } + MOCK_METHOD8(CreateRouteInternal, void(const std::string& source_urn, const std::string& sink_id, const std::string& presentation_id, @@ -38,16 +49,37 @@ int tab_id, base::TimeDelta timeout, bool incognito, - const CreateRouteCallback& callback)); - MOCK_METHOD7(JoinRoute, + CreateRouteCallback& callback)); + void JoinRoute(const std::string& source_urn, + const std::string& presentation_id, + const url::Origin& origin, + int tab_id, + base::TimeDelta timeout, + bool incognito, + JoinRouteCallback callback) { + JoinRouteInternal(source_urn, presentation_id, origin, tab_id, timeout, + incognito, callback); + } + MOCK_METHOD7(JoinRouteInternal, void(const std::string& source_urn, const std::string& presentation_id, const url::Origin& origin, int tab_id, base::TimeDelta timeout, bool incognito, - const JoinRouteCallback& callback)); - MOCK_METHOD8(ConnectRouteByRouteId, + JoinRouteCallback& callback)); + void ConnectRouteByRouteId(const std::string& source_urn, + const std::string& route_id, + const std::string& presentation_id, + const url::Origin& origin, + int tab_id, + base::TimeDelta timeout, + bool incognito, + JoinRouteCallback callback) { + ConnectRouteByRouteIdInternal(source_urn, route_id, presentation_id, origin, + tab_id, timeout, incognito, callback); + } + MOCK_METHOD8(ConnectRouteByRouteIdInternal, void(const std::string& source_urn, const std::string& route_id, const std::string& presentation_id, @@ -55,26 +87,35 @@ int tab_id, base::TimeDelta timeout, bool incognito, - const JoinRouteCallback& callback)); + JoinRouteCallback& callback)); MOCK_METHOD1(DetachRoute, void(const std::string& route_id)); - MOCK_METHOD2(TerminateRoute, void(const std::string& route_id, - const TerminateRouteCallback& callback)); + void TerminateRoute(const std::string& route_id, + TerminateRouteCallback callback) { + TerminateRouteInternal(route_id, callback); + } + MOCK_METHOD2(TerminateRouteInternal, + void(const std::string& route_id, + TerminateRouteCallback& callback)); MOCK_METHOD1(StartObservingMediaSinks, void(const std::string& source)); MOCK_METHOD1(StopObservingMediaSinks, void(const std::string& source)); - MOCK_METHOD3(SendRouteMessage, + void SendRouteMessage(const std::string& media_route_id, + const std::string& message, + SendRouteMessageCallback callback) { + SendRouteMessageInternal(media_route_id, message, callback); + } + MOCK_METHOD3(SendRouteMessageInternal, void(const std::string& media_route_id, const std::string& message, - const SendRouteMessageCallback& callback)); - void SendRouteBinaryMessage( - const std::string& media_route_id, - const std::vector<uint8_t>& data, - const SendRouteMessageCallback& callback) override { + SendRouteMessageCallback& callback)); + void SendRouteBinaryMessage(const std::string& media_route_id, + const std::vector<uint8_t>& data, + SendRouteMessageCallback callback) override { SendRouteBinaryMessageInternal(media_route_id, data, callback); } MOCK_METHOD3(SendRouteBinaryMessageInternal, void(const std::string& media_route_id, const std::vector<uint8_t>& data, - const SendRouteMessageCallback& callback)); + SendRouteMessageCallback& callback)); MOCK_METHOD1(StartListeningForRouteMessages, void(const std::string& route_id)); MOCK_METHOD1(StopListeningForRouteMessages, @@ -85,25 +126,24 @@ MOCK_METHOD1(StopObservingMediaRoutes, void(const std::string& source)); MOCK_METHOD0(EnableMdnsDiscovery, void()); MOCK_METHOD1(UpdateMediaSinks, void(const std::string& source)); - void SearchSinks( - const std::string& sink_id, - const std::string& media_source, - mojom::SinkSearchCriteriaPtr search_criteria, - const SearchSinksCallback& callback) override { + void SearchSinks(const std::string& sink_id, + const std::string& media_source, + mojom::SinkSearchCriteriaPtr search_criteria, + SearchSinksCallback callback) override { SearchSinksInternal(sink_id, media_source, search_criteria, callback); } MOCK_METHOD4(SearchSinksInternal, void(const std::string& sink_id, const std::string& media_source, mojom::SinkSearchCriteriaPtr& search_criteria, - const SearchSinksCallback& callback)); + SearchSinksCallback& callback)); MOCK_METHOD2(ProvideSinks, void(const std::string&, const std::vector<MediaSinkInternal>&)); void CreateMediaRouteController( const std::string& route_id, mojom::MediaControllerRequest media_controller, mojom::MediaStatusObserverPtr observer, - const CreateMediaRouteControllerCallback& callback) override { + CreateMediaRouteControllerCallback callback) override { CreateMediaRouteControllerInternal(route_id, media_controller, observer, callback); } @@ -111,7 +151,7 @@ void(const std::string& route_id, mojom::MediaControllerRequest& media_controller, mojom::MediaStatusObserverPtr& observer, - const CreateMediaRouteControllerCallback& callback)); + CreateMediaRouteControllerCallback& callback)); private: DISALLOW_COPY_AND_ASSIGN(MockMediaRouteProvider);
diff --git a/chrome/browser/profile_resetter/profile_resetter.cc b/chrome/browser/profile_resetter/profile_resetter.cc index 9b78bbba4..b22b7b0d 100644 --- a/chrome/browser/profile_resetter/profile_resetter.cc +++ b/chrome/browser/profile_resetter/profile_resetter.cc
@@ -79,11 +79,12 @@ pending_reset_flags_(0), cookies_remover_(nullptr), weak_ptr_factory_(this) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(profile_); } ProfileResetter::~ProfileResetter() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (cookies_remover_) cookies_remover_->RemoveObserver(this); } @@ -92,7 +93,7 @@ ProfileResetter::ResettableFlags resettable_flags, std::unique_ptr<BrandcodedDefaultSettings> master_settings, const base::Closure& callback) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(master_settings); // We should never be called with unknown flags. @@ -144,7 +145,7 @@ } void ProfileResetter::MarkAsDone(Resettable resettable) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); // Check that we are never called twice or unexpectedly. CHECK(pending_reset_flags_ & resettable); @@ -161,7 +162,7 @@ } void ProfileResetter::ResetDefaultSearchEngine() { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(template_url_service_); // If TemplateURLServiceFactory is ready we can clean it right now. // Otherwise, load it and continue from ProfileResetter::Observe. @@ -192,7 +193,7 @@ } void ProfileResetter::ResetHomepage() { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); PrefService* prefs = profile_->GetPrefs(); DCHECK(prefs); std::string homepage; @@ -214,7 +215,7 @@ } void ProfileResetter::ResetContentSettings() { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); HostContentSettingsMap* map = HostContentSettingsMapFactory::GetForProfile(profile_); @@ -234,7 +235,7 @@ } void ProfileResetter::ResetCookiesAndSiteData() { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(!cookies_remover_); cookies_remover_ = content::BrowserContext::GetBrowsingDataRemover(profile_); @@ -253,7 +254,7 @@ } void ProfileResetter::ResetExtensions() { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); std::vector<std::string> brandcode_extensions; master_settings_->GetExtensions(&brandcode_extensions); @@ -285,7 +286,7 @@ } void ProfileResetter::ResetStartupPages() { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); PrefService* prefs = profile_->GetPrefs(); DCHECK(prefs); std::unique_ptr<base::ListValue> url_list( @@ -336,7 +337,7 @@ void ProfileResetter::OnTemplateURLServiceLoaded() { // TemplateURLService has loaded. If we need to clean search engines, it's // time to go on. - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); template_url_service_sub_.reset(); if (pending_reset_flags_ & DEFAULT_SEARCH_ENGINE) ResetDefaultSearchEngine();
diff --git a/chrome/browser/profile_resetter/profile_resetter.h b/chrome/browser/profile_resetter/profile_resetter.h index 68eeae6..c59273d 100644 --- a/chrome/browser/profile_resetter/profile_resetter.h +++ b/chrome/browser/profile_resetter/profile_resetter.h
@@ -16,8 +16,8 @@ #include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" +#include "base/sequence_checker.h" #include "base/strings/string16.h" -#include "base/threading/non_thread_safe.h" #include "chrome/browser/profile_resetter/brandcoded_default_settings.h" #include "components/search_engines/template_url_service.h" #include "content/public/browser/browsing_data_remover.h" @@ -31,8 +31,7 @@ // This class allows resetting certain aspects of a profile to default values. // It is used in case the profile has been damaged due to malware or bad user // settings. -class ProfileResetter : public base::NonThreadSafe, - public content::BrowsingDataRemover::Observer { +class ProfileResetter : public content::BrowsingDataRemover::Observer { public: // Flags indicating what aspects of a profile shall be reset. enum Resettable { @@ -106,6 +105,8 @@ std::unique_ptr<TemplateURLService::Subscription> template_url_service_sub_; + SEQUENCE_CHECKER(sequence_checker_); + base::WeakPtrFactory<ProfileResetter> weak_ptr_factory_; DISALLOW_COPY_AND_ASSIGN(ProfileResetter);
diff --git a/chrome/browser/ui/webui/settings/md_settings_ui_browsertest.cc b/chrome/browser/ui/webui/settings/md_settings_ui_browsertest.cc index a6da5edc..056310a2 100644 --- a/chrome/browser/ui/webui/settings/md_settings_ui_browsertest.cc +++ b/chrome/browser/ui/webui/settings/md_settings_ui_browsertest.cc
@@ -32,7 +32,10 @@ // May not complete on memory and Windows debug bots. TODO(dbeam): investigate // and fix. See https://crbug.com/558434, https://crbug.com/620370 and // https://crbug.com/651296. -#if defined(MEMORY_SANITIZER) || defined(OS_WIN) || defined(OS_CHROMEOS) +// +// Disabled for ASan. See http://crbug.com/727449. +#if defined(MEMORY_SANITIZER) || defined(OS_WIN) || defined(OS_CHROMEOS) || \ + defined(ADDRESS_SANITIZER) #define MAYBE_BackForwardDoesntCrash DISABLED_BackForwardDoesntCrash #else #define MAYBE_BackForwardDoesntCrash BackForwardDoesntCrash
diff --git a/chrome/browser/win/jumplist.cc b/chrome/browser/win/jumplist.cc index f019dab..f8da8be 100644 --- a/chrome/browser/win/jumplist.cc +++ b/chrome/browser/win/jumplist.cc
@@ -244,7 +244,7 @@ } JumpList::~JumpList() { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); Terminate(); } @@ -254,7 +254,7 @@ } void JumpList::CancelPendingUpdate() { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (task_id_ != base::CancelableTaskTracker::kBadTaskId) { cancelable_task_tracker_.TryCancel(task_id_); task_id_ = base::CancelableTaskTracker::kBadTaskId; @@ -262,7 +262,7 @@ } void JumpList::Terminate() { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); timer_most_visited_.Stop(); timer_recently_closed_.Stop(); CancelPendingUpdate(); @@ -281,13 +281,13 @@ } void JumpList::ShutdownOnUIThread() { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); Terminate(); } void JumpList::OnMostVisitedURLsAvailable( const history::MostVisitedURLList& urls) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); { JumpListData* data = &jumplist_data_->data; @@ -315,7 +315,7 @@ } void JumpList::TabRestoreServiceChanged(sessions::TabRestoreService* service) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); // if we have a pending favicon request, cancel it here (it is out of date). CancelPendingUpdate(); @@ -341,7 +341,7 @@ bool JumpList::AddTab(const sessions::TabRestoreService::Tab& tab, size_t max_items, JumpListData* data) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); data->list_lock_.AssertAcquired(); // This code adds the URL and the title strings of the given tab to |data|. @@ -366,7 +366,7 @@ void JumpList::AddWindow(const sessions::TabRestoreService::Window& window, size_t max_items, JumpListData* data) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); data->list_lock_.AssertAcquired(); // This code enumerates all the tabs in the given window object and add their @@ -380,7 +380,7 @@ } void JumpList::StartLoadingFavicon() { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); base::ElapsedTimer timer; @@ -419,7 +419,7 @@ void JumpList::OnFaviconDataAvailable( const favicon_base::FaviconImageResult& image_result) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); base::ElapsedTimer timer; @@ -454,7 +454,7 @@ } void JumpList::OnIncognitoAvailabilityChanged() { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); bool waiting_for_icons = true; { @@ -471,7 +471,7 @@ } void JumpList::PostRunUpdate() { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); TRACE_EVENT0("browser", "JumpList::PostRunUpdate"); if (!profile_) @@ -532,7 +532,7 @@ } void JumpList::DeferredTopSitesChanged() { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (updates_to_skip_ > 0) { --updates_to_skip_; @@ -556,7 +556,7 @@ } void JumpList::DeferredTabRestoreServiceChanged() { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (updates_to_skip_ > 0) { --updates_to_skip_;
diff --git a/chrome/browser/win/jumplist.h b/chrome/browser/win/jumplist.h index a0fb0bf..42473cf 100644 --- a/chrome/browser/win/jumplist.h +++ b/chrome/browser/win/jumplist.h
@@ -17,6 +17,7 @@ #include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" +#include "base/sequence_checker.h" #include "base/strings/string16.h" #include "base/synchronization/lock.h" #include "base/task/cancelable_task_tracker.h" @@ -64,8 +65,7 @@ // always delete JumpList on UI thread (the same thread it got constructed on). class JumpList : public sessions::TabRestoreServiceObserver, public history::TopSitesObserver, - public RefcountedKeyedService, - public base::NonThreadSafe { + public RefcountedKeyedService { public: struct JumpListData { JumpListData(); @@ -272,6 +272,8 @@ // JumpListIconsOld directory. scoped_refptr<base::SequencedTaskRunner> delete_jumplisticons_task_runner_; + SEQUENCE_CHECKER(sequence_checker_); + // For callbacks may be run after destruction. base::WeakPtrFactory<JumpList> weak_ptr_factory_;
diff --git a/chrome/common/chrome_features.cc b/chrome/common/chrome_features.cc index d341329..4181b412 100644 --- a/chrome/common/chrome_features.cc +++ b/chrome/common/chrome_features.cc
@@ -284,7 +284,7 @@ // Enables the pref service. See https://crbug.com/654988. const base::Feature kPrefService{"PrefService", - base::FEATURE_ENABLED_BY_DEFAULT}; + base::FEATURE_DISABLED_BY_DEFAULT}; #if defined(OS_CHROMEOS) // The lock screen will be preloaded so it is instantly available when the user
diff --git a/chrome/common/media_router/mojo/BUILD.gn b/chrome/common/media_router/mojo/BUILD.gn index 8b1e6114..3a24977 100644 --- a/chrome/common/media_router/mojo/BUILD.gn +++ b/chrome/common/media_router/mojo/BUILD.gn
@@ -12,9 +12,6 @@ public_deps = [ "//mojo/common:common_custom_types", ] - - # TODO(crbug.com/714018): Convert the implementation to use OnceCallback. - use_once_callback = false } mojom("media_controller") { @@ -44,9 +41,6 @@ "//url/mojo:url_mojom_origin", ] - # TODO(crbug.com/714018): Convert the implementation to use OnceCallback. - use_once_callback = false - # TODO(crbug.com/699569): Convert to use the new JS bindings. use_new_js_bindings = false } @@ -59,7 +53,4 @@ public_deps = [ ":media_router", ] - - # TODO(crbug.com/714018): Convert the implementation to use OnceCallback. - use_once_callback = false }
diff --git a/chrome/common/media_router/mojo/media_router_struct_traits_unittest.cc b/chrome/common/media_router/mojo/media_router_struct_traits_unittest.cc index 676db6f54..232bb3c 100644 --- a/chrome/common/media_router/mojo/media_router_struct_traits_unittest.cc +++ b/chrome/common/media_router/mojo/media_router_struct_traits_unittest.cc
@@ -4,6 +4,8 @@ #include "chrome/common/media_router/mojo/media_router_struct_traits.h" +#include <utility> + #include "base/message_loop/message_loop.h" #include "chrome/common/media_router/discovery/media_sink_internal.h" #include "chrome/common/media_router/mojo/media_router.mojom.h" @@ -27,8 +29,8 @@ private: // MediaRouterTraitsTestService Impl void EchoMediaSink(const MediaSinkInternal& sink, - const EchoMediaSinkCallback& callback) override { - callback.Run(sink); + EchoMediaSinkCallback callback) override { + std::move(callback).Run(sink); } base::MessageLoop loop_;
diff --git a/chrome/renderer/BUILD.gn b/chrome/renderer/BUILD.gn index bed32f4..ab4a350 100644 --- a/chrome/renderer/BUILD.gn +++ b/chrome/renderer/BUILD.gn
@@ -23,7 +23,7 @@ ] grit_flags = [ "-E", - "mojom_root=" + rebase_path(root_gen_dir), + "mojom_root=" + rebase_path(root_gen_dir, root_build_dir), ] deps = [ "//chrome/common/media_router/mojo:media_controller__generator",
diff --git a/chrome/renderer/autofill/password_autofill_agent_browsertest.cc b/chrome/renderer/autofill/password_autofill_agent_browsertest.cc index 4ecc55c..15619b6 100644 --- a/chrome/renderer/autofill/password_autofill_agent_browsertest.cc +++ b/chrome/renderer/autofill/password_autofill_agent_browsertest.cc
@@ -373,17 +373,26 @@ WebElement element = document.GetElementById(WebString::FromUTF8(kUsernameName)); ASSERT_FALSE(element.IsNull()); - username_element_ = element.To<blink::WebInputElement>(); + username_element_ = element.To<WebInputElement>(); element = document.GetElementById(WebString::FromUTF8(kPasswordName)); ASSERT_FALSE(element.IsNull()); - password_element_ = element.To<blink::WebInputElement>(); + password_element_ = element.To<WebInputElement>(); } - blink::WebInputElement GetInputElementByID(const std::string& id) { + void UpdateOnlyPasswordElement() { + WebDocument document = GetMainFrame()->GetDocument(); + WebElement element = + document.GetElementById(WebString::FromUTF8(kPasswordName)); + ASSERT_FALSE(element.IsNull()); + password_element_ = element.To<WebInputElement>(); + username_element_.Reset(); + } + + WebInputElement GetInputElementByID(const std::string& id) { WebDocument document = GetMainFrame()->GetDocument(); WebElement element = document.GetElementById(WebString::FromUTF8(id.c_str())); - return element.To<blink::WebInputElement>(); + return element.To<WebInputElement>(); } void ClearUsernameAndPasswordFields() { @@ -669,14 +678,7 @@ LoadHTML(kEmptyActionFormHTML); // Retrieve the input elements so the test can access them. - WebDocument document = GetMainFrame()->GetDocument(); - WebElement element = - document.GetElementById(WebString::FromUTF8(kUsernameName)); - ASSERT_FALSE(element.IsNull()); - username_element_ = element.To<blink::WebInputElement>(); - element = document.GetElementById(WebString::FromUTF8(kPasswordName)); - ASSERT_FALSE(element.IsNull()); - password_element_ = element.To<blink::WebInputElement>(); + UpdateUsernameAndPasswordElements(); // Set the expected form origin and action URLs. UpdateOriginForHTML(kEmptyActionFormHTML); @@ -769,14 +771,7 @@ LoadHTML(kTextFieldPasswordFormHTML); // Retrieve the input elements so the test can access them. - WebDocument document = GetMainFrame()->GetDocument(); - WebElement element = - document.GetElementById(WebString::FromUTF8(kUsernameName)); - ASSERT_FALSE(element.IsNull()); - username_element_ = element.To<blink::WebInputElement>(); - element = document.GetElementById(WebString::FromUTF8(kPasswordName)); - ASSERT_FALSE(element.IsNull()); - password_element_ = element.To<blink::WebInputElement>(); + UpdateUsernameAndPasswordElements(); // Set the expected form origin URL. UpdateOriginForHTML(kTextFieldPasswordFormHTML); @@ -797,14 +792,7 @@ LoadHTML(kPasswordFieldUsernameFormHTML); // Retrieve the input elements so the test can access them. - WebDocument document = GetMainFrame()->GetDocument(); - WebElement element = - document.GetElementById(WebString::FromUTF8(kUsernameName)); - ASSERT_FALSE(element.IsNull()); - username_element_ = element.To<blink::WebInputElement>(); - element = document.GetElementById(WebString::FromUTF8(kPasswordName)); - ASSERT_FALSE(element.IsNull()); - password_element_ = element.To<blink::WebInputElement>(); + UpdateUsernameAndPasswordElements(); // Set the expected form origin URL. UpdateOriginForHTML(kPasswordFieldUsernameFormHTML); @@ -1182,6 +1170,35 @@ } } +// Tests that |FillSuggestion| properly fills the username and password when the +// username field is created dynamically in JavaScript. +TEST_F(PasswordAutofillAgentTest, FillSuggestionWithDynamicUsernameField) { + LoadHTML(kVisibleFormWithNoUsernameHTML); + UpdateOnlyPasswordElement(); + + // Simulate the browser sending the login info, but set |wait_for_username| + // to prevent the form from being immediately filled. + fill_data_.wait_for_username = true; + SimulateOnFillPasswordForm(fill_data_); + + constexpr const char* kAddUsernameToFormScript = + "var new_input = document.createElement('input');" + "new_input.setAttribute('type', 'text');" + "new_input.setAttribute('id', 'username');" + "password_field = document.getElementById('password');" + "password_field.parentNode.insertBefore(new_input, password_field);"; + ExecuteJavaScriptForTests(kAddUsernameToFormScript); + UpdateUsernameAndPasswordElements(); + CheckTextFieldsDOMState(std::string(), false, std::string(), false); + + // After filling with the suggestion, both fields should be autocompleted. + EXPECT_TRUE(password_autofill_agent_->FillSuggestion( + password_element_, ASCIIToUTF16(kAliceUsername), + ASCIIToUTF16(kAlicePassword))); + + CheckTextFieldsDOMState(kAliceUsername, true, kAlicePassword, true); +} + // Tests that |FillSuggestion| doesn't change non-empty non-autofilled username // when interacting with the password field. TEST_F(PasswordAutofillAgentTest, @@ -1923,12 +1940,7 @@ // Load a form with no username and update test data. LoadHTML(kVisibleFormWithNoUsernameHTML); - username_element_.Reset(); - WebDocument document = GetMainFrame()->GetDocument(); - WebElement element = - document.GetElementById(WebString::FromUTF8(kPasswordName)); - ASSERT_FALSE(element.IsNull()); - password_element_ = element.To<blink::WebInputElement>(); + UpdateOnlyPasswordElement(); fill_data_.username_field = FormFieldData(); UpdateOriginForHTML(kVisibleFormWithNoUsernameHTML); fill_data_.additional_logins.clear(); @@ -1948,12 +1960,7 @@ TEST_F(PasswordAutofillAgentTest, ShowPopupOnEmptyPasswordField) { // Load a form with no username and update test data. LoadHTML(kVisibleFormWithNoUsernameHTML); - username_element_.Reset(); - WebDocument document = GetMainFrame()->GetDocument(); - WebElement element = - document.GetElementById(WebString::FromUTF8(kPasswordName)); - ASSERT_FALSE(element.IsNull()); - password_element_ = element.To<blink::WebInputElement>(); + UpdateOnlyPasswordElement(); fill_data_.username_field = FormFieldData(); UpdateOriginForHTML(kVisibleFormWithNoUsernameHTML); fill_data_.additional_logins.clear(); @@ -1979,12 +1986,7 @@ TEST_F(PasswordAutofillAgentTest, ShowPopupOnAutofilledPasswordField) { // Load a form with no username and update test data. LoadHTML(kVisibleFormWithNoUsernameHTML); - username_element_.Reset(); - WebDocument document = GetMainFrame()->GetDocument(); - WebElement element = - document.GetElementById(WebString::FromUTF8(kPasswordName)); - ASSERT_FALSE(element.IsNull()); - password_element_ = element.To<blink::WebInputElement>(); + UpdateOnlyPasswordElement(); fill_data_.username_field = FormFieldData(); UpdateOriginForHTML(kVisibleFormWithNoUsernameHTML); fill_data_.additional_logins.clear(); @@ -2010,12 +2012,7 @@ TEST_F(PasswordAutofillAgentTest, NotShowPopupPasswordField) { // Load a form with no username and update test data. LoadHTML(kVisibleFormWithNoUsernameHTML); - username_element_.Reset(); - WebDocument document = GetMainFrame()->GetDocument(); - WebElement element = - document.GetElementById(WebString::FromUTF8(kPasswordName)); - ASSERT_FALSE(element.IsNull()); - password_element_ = element.To<blink::WebInputElement>(); + UpdateOnlyPasswordElement(); fill_data_.username_field = FormFieldData(); UpdateOriginForHTML(kVisibleFormWithNoUsernameHTML); fill_data_.additional_logins.clear(); @@ -2057,7 +2054,7 @@ TEST_F(PasswordAutofillAgentTest, FindingUsernameWithoutAutofillPredictions) { LoadHTML(kFormHTMLWithTwoTextFields); UpdateUsernameAndPasswordElements(); - blink::WebInputElement email_element = GetInputElementByID(kEmailName); + WebInputElement email_element = GetInputElementByID(kEmailName); SimulateUsernameChange("temp"); SimulateUserInputChangeForElement(&email_element, "temp@google.com"); SimulatePasswordChange("random"); @@ -2076,7 +2073,7 @@ TEST_F(PasswordAutofillAgentTest, FindingFieldsWithAutofillPredictions) { LoadHTML(kFormHTMLWithTwoTextFields); UpdateUsernameAndPasswordElements(); - blink::WebInputElement email_element = GetInputElementByID(kEmailName); + WebInputElement email_element = GetInputElementByID(kEmailName); SimulateUsernameChange("temp"); SimulateUserInputChangeForElement(&email_element, "temp@google.com"); SimulatePasswordChange("random"); @@ -2184,7 +2181,7 @@ WebElement element = document.GetElementById(WebString::FromUTF8("new_password")); ASSERT_FALSE(element.IsNull()); - password_element_ = element.To<blink::WebInputElement>(); + password_element_ = element.To<WebInputElement>(); // Update fill_data_ for the new form and simulate filling. Pretend as if // the password manager didn't detect a username field so it will try to @@ -2276,11 +2273,11 @@ // form is submitted. TEST_F(PasswordAutofillAgentTest, IgnoreNotPasswordFields) { LoadHTML(kCreditCardFormHTML); - blink::WebInputElement credit_card_owner_element = + WebInputElement credit_card_owner_element = GetInputElementByID(kCreditCardOwnerName); - blink::WebInputElement credit_card_number_element = + WebInputElement credit_card_number_element = GetInputElementByID(kCreditCardNumberName); - blink::WebInputElement credit_card_verification_element = + WebInputElement credit_card_verification_element = GetInputElementByID(kCreditCardVerificationName); SimulateUserInputChangeForElement(&credit_card_owner_element, "JohnSmith"); SimulateUserInputChangeForElement(&credit_card_number_element, @@ -2636,10 +2633,10 @@ bool has_fillable_username = (kEmpty != test_case.fill_data_username_field_name); if (has_fillable_username) { - username_element_ = control_elements[0].To<blink::WebInputElement>(); - password_element_ = control_elements[1].To<blink::WebInputElement>(); + username_element_ = control_elements[0].To<WebInputElement>(); + password_element_ = control_elements[1].To<WebInputElement>(); } else { - password_element_ = control_elements[0].To<blink::WebInputElement>(); + password_element_ = control_elements[0].To<WebInputElement>(); } UpdateOriginForHTML(test_case.html_form);
diff --git a/chrome/utility/media_router/dial_device_description_parser_impl.cc b/chrome/utility/media_router/dial_device_description_parser_impl.cc index 060f2590..8950aaa 100644 --- a/chrome/utility/media_router/dial_device_description_parser_impl.cc +++ b/chrome/utility/media_router/dial_device_description_parser_impl.cc
@@ -63,13 +63,13 @@ void DialDeviceDescriptionParserImpl::ParseDialDeviceDescription( const std::string& device_description_xml_data, - const ParseDialDeviceDescriptionCallback& callback) { + ParseDialDeviceDescriptionCallback callback) { DCHECK(thread_checker_.CalledOnValidThread()); DCHECK(!callback.is_null()); chrome::mojom::DialDeviceDescriptionPtr device_description = Parse(device_description_xml_data); - callback.Run(std::move(device_description)); + std::move(callback).Run(std::move(device_description)); } chrome::mojom::DialDeviceDescriptionPtr DialDeviceDescriptionParserImpl::Parse(
diff --git a/chrome/utility/media_router/dial_device_description_parser_impl.h b/chrome/utility/media_router/dial_device_description_parser_impl.h index 874bf59..9f3eb3ae 100644 --- a/chrome/utility/media_router/dial_device_description_parser_impl.h +++ b/chrome/utility/media_router/dial_device_description_parser_impl.h
@@ -29,7 +29,7 @@ // extensions::mojom::DialDeviceDescriptionParser: void ParseDialDeviceDescription( const std::string& device_description_xml_data, - const ParseDialDeviceDescriptionCallback& callback) override; + ParseDialDeviceDescriptionCallback callback) override; // Processes the result of getting device description. Returns valid // DialDeviceDescriptionPtr if processing succeeds; otherwise returns nullptr.
diff --git a/components/autofill/content/renderer/password_autofill_agent.cc b/components/autofill/content/renderer/password_autofill_agent.cc index 952ba4f5..0d2a312 100644 --- a/components/autofill/content/renderer/password_autofill_agent.cc +++ b/components/autofill/content/renderer/password_autofill_agent.cc
@@ -6,6 +6,7 @@ #include <stddef.h> +#include <algorithm> #include <memory> #include <string> #include <utility> @@ -276,7 +277,7 @@ true); } -// Returns |true| if the given element is editable. Otherwise, returns |false|. +// Returns whether the given |element| is editable. bool IsElementAutocompletable(const blink::WebInputElement& element) { return IsElementEditable(element); } @@ -607,6 +608,41 @@ return false; } +// Returns the closest visible autocompletable non-password text element +// preceding the |password_element| either in a form, if it belongs to one, or +// in the |frame|. +blink::WebInputElement FindUsernameElementPrecedingPasswordElement( + blink::WebFrame* frame, + const blink::WebInputElement& password_element) { + DCHECK(!password_element.IsNull()); + + std::vector<blink::WebFormControlElement> elements; + if (password_element.Form().IsNull()) { + elements = form_util::GetUnownedAutofillableFormFieldElements( + frame->GetDocument().All(), nullptr); + } else { + blink::WebVector<blink::WebFormControlElement> web_control_elements; + password_element.Form().GetFormControlElements(web_control_elements); + elements.assign(web_control_elements.begin(), web_control_elements.end()); + } + + auto iter = std::find(elements.begin(), elements.end(), password_element); + if (iter == elements.end()) + return blink::WebInputElement(); + + for (auto begin = elements.begin(); iter != begin;) { + --iter; + const blink::WebInputElement* input = blink::ToWebInputElement(&*iter); + if (input && input->IsTextField() && !input->IsPasswordField() && + IsElementAutocompletable(*input) && + form_util::IsWebElementVisible(*input)) { + return *input; + } + } + + return blink::WebInputElement(); +} + } // namespace class PasswordAutofillAgent::FormElementObserverCallback @@ -775,7 +811,7 @@ blink::WebInputElement username_element; blink::WebInputElement password_element; - PasswordInfo* password_info; + PasswordInfo* password_info = nullptr; if (!FindPasswordInfoForElement(*element, &username_element, &password_element, &password_info) || @@ -883,33 +919,37 @@ return false; } + *password_element = element; + WebInputToPasswordInfoMap::iterator iter = web_input_to_password_info_.find(element); + if (iter == web_input_to_password_info_.end()) { + PasswordToLoginMap::const_iterator password_iter = + password_to_username_.find(element); + if (password_iter == password_to_username_.end()) { + if (web_input_to_password_info_.empty()) + return false; + // Now all PasswordInfo items refer to the same set of credentials for + // fill, so it is ok to take any of them. + iter = web_input_to_password_info_.begin(); + } else { + *username_element = password_iter->second; + } + } + if (iter != web_input_to_password_info_.end()) { - // It's a password field without corresponding username field. - *password_element = element; + // It's a password field without corresponding username field. Try to find + // the username field based on visibility. + *username_element = FindUsernameElementPrecedingPasswordElement( + render_frame()->GetWebFrame(), *password_element); *password_info = &iter->second; return true; } - PasswordToLoginMap::const_iterator password_iter = - password_to_username_.find(element); - if (password_iter == password_to_username_.end()) { - if (web_input_to_password_info_.empty()) - return false; - - *password_element = element; - // Now all PasswordInfo items refer to the same set of credentials for - // fill, so it is ok to take any of them. - *password_info = &web_input_to_password_info_.begin()->second; - return true; - } - *username_element = password_iter->second; - *password_element = element; + // Otherwise |username_element| has been set above. } WebInputToPasswordInfoMap::iterator iter = web_input_to_password_info_.find(*username_element); - if (iter == web_input_to_password_info_.end()) return false;
diff --git a/components/autofill/content/renderer/password_autofill_agent.h b/components/autofill/content/renderer/password_autofill_agent.h index 0b846e0..b1ea392 100644 --- a/components/autofill/content/renderer/password_autofill_agent.h +++ b/components/autofill/content/renderer/password_autofill_agent.h
@@ -229,12 +229,12 @@ bool show_all, bool show_on_password_field); - // Finds the PasswordInfo, username and password fields that corresponds to - // the passed in |element|. |element| can refer either to a username element - // or a password element. If a PasswordInfo was found, returns |true| and also - // assigns the corresponding username, password elements and PasswordInfo into + // Finds the PasswordInfo, username and password fields corresponding to the + // passed in |element|, which can refer to either a username or a password + // element. If a PasswordInfo was found, returns |true| and assigns the + // corresponding username, password elements and PasswordInfo into // |username_element|, |password_element| and |pasword_info|, respectively. - // Note, that |username_element->isNull()| can be true if |element| is a + // Note, that |username_element->IsNull()| can be true if |element| is a // password. bool FindPasswordInfoForElement(const blink::WebInputElement& element, blink::WebInputElement* username_element, @@ -268,7 +268,7 @@ // The logins we have filled so far with their associated info. WebInputToPasswordInfoMap web_input_to_password_info_; - // A (sort-of) reverse map to |login_to_password_info_|. + // A (sort-of) reverse map to |web_input_to_password_info_|. PasswordToLoginMap password_to_username_; // Set if the user might be submitting a password form on the current page,
diff --git a/components/browsing_data/core/browsing_data_utils_unittest.cc b/components/browsing_data/core/browsing_data_utils_unittest.cc index a39dbbd7..12a870e 100644 --- a/components/browsing_data/core/browsing_data_utils_unittest.cc +++ b/components/browsing_data/core/browsing_data_utils_unittest.cc
@@ -63,8 +63,8 @@ bool sync_enabled; std::string expected_output; } kTestCases[] = { - {0, 0, 0, false, "none"}, - {0, 0, 0, true, "none"}, + {0, 0, 0, false, "None"}, + {0, 0, 0, true, "None"}, {1, 0, 0, false, "1 credit card"}, {0, 5, 0, false, "5 addresses"}, {0, 0, 1, false, "1 suggestion"}, @@ -107,7 +107,7 @@ int is_synced; std::string expected_output; } kTestCases[] = { - {0, false, "none"}, {0, true, "none"}, + {0, false, "None"}, {0, true, "None"}, {1, false, "1 password"}, {1, true, "1 password (synced)"}, {5, false, "5 passwords"}, {5, true, "5 passwords (synced)"}, };
diff --git a/components/browsing_data_strings.grdp b/components/browsing_data_strings.grdp index 67110ee..35075eb 100644 --- a/components/browsing_data_strings.grdp +++ b/components/browsing_data_strings.grdp
@@ -6,34 +6,34 @@ </message> <message name="IDS_DEL_BROWSING_HISTORY_COUNTER" desc="A counter showing how many items of browsing history the user has."> {COUNT, plural, - =0 {none} + =0 {None} =1 {1 item} other {# items}} </message> <message name="IDS_DEL_BROWSING_HISTORY_COUNTER_SYNCED" desc="A counter showing the user how many local items of browsing history they have, and informing them that more items might be synced. In the case when COUNT is zero, the counter only mentions existence of synced items."> {COUNT, plural, - =0 {at least 1 item on synced devices} + =0 {At least 1 item on synced devices} =1 {1 item (and more on synced devices)} other {# items (and more on synced devices)}} </message> <message name="IDS_DEL_CACHE_COUNTER_UPPER_ESTIMATE" desc="A counter showing that the user has less than X megabytes of cache. The value X will be substituted."> - less than <ph name="UPPER_ESTIMATE">$1<ex>328 MB</ex></ph> + Less than <ph name="UPPER_ESTIMATE">$1<ex>328 MB</ex></ph> </message> <message name="IDS_DEL_CACHE_COUNTER_ALMOST_EMPTY" desc="A counter showing that the user's cache is almost empty, having less than 1 MB of data."> - less than 1 MB + Less than 1 MB </message> <message name="IDS_DEL_CACHE_COUNTER_BASIC" desc="A counter showing the size of the users's cache including either 'x MB' or 'less than x MB' as $1 and explaining that the cache is used to speed up the loading of websites."> Frees up <ph name="SIZE">$1<ex>328 MB</ex></ph>. Some sites may load more slowly on your next visit. </message> <message name="IDS_DEL_PASSWORDS_COUNTER" desc="A counter showing how many passwords the user has."> {COUNT, plural, - =0 {none} + =0 {None} =1 {1 password} other {# passwords}} </message> <message name="IDS_DEL_PASSWORDS_COUNTER_SYNCED" desc="A counter showing how many passwords the user has and that they are synced."> {COUNT, plural, - =0 {none} + =0 {None} =1 {1 password (synced)} other {# passwords (synced)}} </message> @@ -44,7 +44,7 @@ other {# sites}} </message> <message name="IDS_DEL_AUTOFILL_COUNTER_EMPTY" desc="A counter showing that the user has no form data stored."> - none + None </message> <message name="IDS_DEL_AUTOFILL_COUNTER_CREDIT_CARDS" desc="A counter showing how many credit cards the user has."> {COUNT, plural, @@ -91,19 +91,19 @@ </message> <message name="IDS_DEL_COOKIES_COUNTER_ADVANCED" desc="A counter showing the number of sites that use cookies."> {COUNT, plural, - =0 {No cookies} - =1 {1 site uses cookies. } - other {# sites use cookies. }} + =0 {None} + =1 {From 1 site } + other {From # sites }} </message> <message name="IDS_DEL_DOWNLOADS_COUNTER" desc="A counter showing how many items of downloads history the user has."> {COUNT, plural, - =0 {none} + =0 {None} =1 {1 item} other {# items}} </message> <message name="IDS_DEL_HOSTED_APPS_COUNTER" desc="A counter showing how many hosted apps the user has. We show the number of apps, and in the cases where there is one or two apps, we will also give two example app names, denoted as placeholders $1 and $2. If there are more than two apps, we will give two examples and say 'and X more'. The 'and X more' string, denoted by the placeholder $3, will be supplied from another message."> {COUNT, plural, - =0 {none} + =0 {None} =1 {1 app ($1)} =2 {2 apps ($1, $2)} other {# apps ($1, $2, $3)}}
diff --git a/components/exo/wayland/clients/client_base.cc b/components/exo/wayland/clients/client_base.cc index 137bfb17..e6043678 100644 --- a/components/exo/wayland/clients/client_base.cc +++ b/components/exo/wayland/clients/client_base.cc
@@ -288,11 +288,12 @@ make_current_.reset( new ui::ScopedMakeCurrent(gl_context_.get(), gl_surface_.get())); - DCHECK(gl::GLSurfaceEGL::HasEGLExtension("EGL_KHR_fence_sync")); + if (gl::GLSurfaceEGL::HasEGLExtension("EGL_EXT_image_flush_external") || + gl::GLSurfaceEGL::HasEGLExtension("EGL_ARM_implicit_external_sync")) { + egl_sync_type_ = EGL_SYNC_FENCE_KHR; + } if (gl::GLSurfaceEGL::HasEGLExtension("EGL_ANDROID_native_fence_sync")) { egl_sync_type_ = EGL_SYNC_NATIVE_FENCE_ANDROID; - } else { - egl_sync_type_ = EGL_SYNC_FENCE_KHR; } native_interface = sk_sp<const GrGLInterface>(GrGLCreateNativeInterface());
diff --git a/components/password_manager/core/browser/password_syncable_service.cc b/components/password_manager/core/browser/password_syncable_service.cc index 03746ff..4a8832d 100644 --- a/components/password_manager/core/browser/password_syncable_service.cc +++ b/components/password_manager/core/browser/password_syncable_service.cc
@@ -141,6 +141,7 @@ } PasswordSyncableService::~PasswordSyncableService() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); } syncer::SyncMergeResult PasswordSyncableService::MergeDataAndStartSyncing( @@ -148,7 +149,7 @@ const syncer::SyncDataList& initial_sync_data, std::unique_ptr<syncer::SyncChangeProcessor> sync_processor, std::unique_ptr<syncer::SyncErrorFactory> sync_error_factory) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_EQ(syncer::PASSWORDS, type); base::AutoReset<bool> processing_changes(&is_processing_sync_changes_, true); syncer::SyncMergeResult merge_result(type); @@ -229,7 +230,7 @@ } void PasswordSyncableService::StopSyncing(syncer::ModelType type) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_EQ(syncer::PASSWORDS, type); sync_processor_.reset(); @@ -238,7 +239,7 @@ syncer::SyncDataList PasswordSyncableService::GetAllSyncData( syncer::ModelType type) const { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_EQ(syncer::PASSWORDS, type); std::vector<std::unique_ptr<autofill::PasswordForm>> password_entries; ReadFromPasswordStore(&password_entries, nullptr); @@ -256,7 +257,7 @@ syncer::SyncError PasswordSyncableService::ProcessSyncChanges( const tracked_objects::Location& from_here, const syncer::SyncChangeList& change_list) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); base::AutoReset<bool> processing_changes(&is_processing_sync_changes_, true); SyncEntries sync_entries; base::Time time_now = base::Time::Now(); @@ -280,7 +281,7 @@ void PasswordSyncableService::ActOnPasswordStoreChanges( const PasswordStoreChangeList& local_changes) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (!sync_processor_) { if (!flare_.is_null()) { @@ -309,7 +310,7 @@ void PasswordSyncableService::InjectStartSyncFlare( const syncer::SyncableService::StartSyncFlare& flare) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); flare_ = flare; }
diff --git a/components/password_manager/core/browser/password_syncable_service.h b/components/password_manager/core/browser/password_syncable_service.h index 6eb2107..50ab358 100644 --- a/components/password_manager/core/browser/password_syncable_service.h +++ b/components/password_manager/core/browser/password_syncable_service.h
@@ -10,7 +10,7 @@ #include <vector> #include "base/macros.h" -#include "base/threading/non_thread_safe.h" +#include "base/sequence_checker.h" #include "components/password_manager/core/browser/password_store_change.h" #include "components/sync/model/sync_change.h" #include "components/sync/model/sync_data.h" @@ -32,8 +32,7 @@ class PasswordStoreSync; // The implementation of the SyncableService API for passwords. -class PasswordSyncableService : public syncer::SyncableService, - public base::NonThreadSafe { +class PasswordSyncableService : public syncer::SyncableService { public: // Since the constructed |PasswordSyncableService| is typically owned by the // |password_store|, the constructor doesn't take ownership of the @@ -113,6 +112,8 @@ // True if processing sync changes is in progress. bool is_processing_sync_changes_; + SEQUENCE_CHECKER(sequence_checker_); + DISALLOW_COPY_AND_ASSIGN(PasswordSyncableService); };
diff --git a/components/reading_list/core/reading_list_model.cc b/components/reading_list/core/reading_list_model.cc index d3d2829..04252bc 100644 --- a/components/reading_list/core/reading_list_model.cc +++ b/components/reading_list/core/reading_list_model.cc
@@ -10,6 +10,7 @@ ReadingListModel::ReadingListModel() : current_batch_updates_count_(0) {} ReadingListModel::~ReadingListModel() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); for (auto& observer : observers_) { observer.ReadingListModelBeingDeleted(this); } @@ -17,7 +18,7 @@ // Observer methods. void ReadingListModel::AddObserver(ReadingListModelObserver* observer) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(observer); observers_.AddObserver(observer); if (loaded()) { @@ -26,13 +27,13 @@ } void ReadingListModel::RemoveObserver(ReadingListModelObserver* observer) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); observers_.RemoveObserver(observer); } // Batch update methods. bool ReadingListModel::IsPerformingBatchUpdates() const { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); return current_batch_updates_count_ > 0; } @@ -43,7 +44,7 @@ std::unique_ptr<ReadingListModel::ScopedReadingListBatchUpdate> ReadingListModel::BeginBatchUpdates() { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); auto token = CreateBatchToken(); ++current_batch_updates_count_; @@ -54,13 +55,13 @@ } void ReadingListModel::EnteringBatchUpdates() { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); for (auto& observer : observers_) observer.ReadingListModelBeganBatchUpdates(this); } void ReadingListModel::EndBatchUpdates() { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(IsPerformingBatchUpdates()); DCHECK(current_batch_updates_count_ > 0); --current_batch_updates_count_; @@ -70,7 +71,7 @@ } void ReadingListModel::LeavingBatchUpdates() { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); for (auto& observer : observers_) observer.ReadingListModelCompletedBatchUpdates(this); }
diff --git a/components/reading_list/core/reading_list_model.h b/components/reading_list/core/reading_list_model.h index d003158..c51e016 100644 --- a/components/reading_list/core/reading_list_model.h +++ b/components/reading_list/core/reading_list_model.h
@@ -11,7 +11,7 @@ #include "base/callback.h" #include "base/observer_list.h" -#include "base/threading/non_thread_safe.h" +#include "base/sequence_checker.h" #include "components/reading_list/core/reading_list_entry.h" #include "components/reading_list/core/reading_list_model_observer.h" @@ -27,7 +27,7 @@ // other of read ones. This object should only be accessed from one thread // (Usually the main thread). The observers callbacks are also sent on the main // thread. -class ReadingListModel : public base::NonThreadSafe { +class ReadingListModel { public: class ScopedReadingListBatchUpdate; @@ -170,6 +170,8 @@ // Called when model is leaving batch update mode. virtual void LeavingBatchUpdates(); + SEQUENCE_CHECKER(sequence_checker_); + private: unsigned int current_batch_updates_count_;
diff --git a/components/reading_list/core/reading_list_model_impl.cc b/components/reading_list/core/reading_list_model_impl.cc index 92713db..8a0b440 100644 --- a/components/reading_list/core/reading_list_model_impl.cc +++ b/components/reading_list/core/reading_list_model_impl.cc
@@ -27,7 +27,7 @@ has_unseen_(false), loaded_(false), weak_ptr_factory_(this) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(clock_); if (storage) { storage_layer_ = std::move(storage); @@ -42,7 +42,7 @@ void ReadingListModelImpl::StoreLoaded( std::unique_ptr<ReadingListEntries> entries) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(entries); entries_ = std::move(entries); for (auto& iterator : *entries_) { @@ -55,19 +55,19 @@ } void ReadingListModelImpl::Shutdown() { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); for (auto& observer : observers_) observer.ReadingListModelBeingShutdown(this); loaded_ = false; } bool ReadingListModelImpl::loaded() const { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); return loaded_; } size_t ReadingListModelImpl::size() const { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(read_entry_count_ + unread_entry_count_ == entries_->size()); if (!loaded()) return 0; @@ -75,7 +75,7 @@ } size_t ReadingListModelImpl::unread_size() const { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(read_entry_count_ + unread_entry_count_ == entries_->size()); if (!loaded()) return 0; @@ -83,7 +83,7 @@ } size_t ReadingListModelImpl::unseen_size() const { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (!loaded()) return 0; return unseen_entry_count_; @@ -99,7 +99,7 @@ } bool ReadingListModelImpl::GetLocalUnseenFlag() const { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (!loaded()) return false; // If there are currently no unseen entries, return false even if has_unseen_ @@ -109,7 +109,7 @@ } void ReadingListModelImpl::ResetLocalUnseenFlag() { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (!loaded()) { return; } @@ -119,7 +119,7 @@ } void ReadingListModelImpl::MarkAllSeen() { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(loaded()); if (unseen_entry_count_ == 0) { return; @@ -148,7 +148,7 @@ } bool ReadingListModelImpl::DeleteAllEntries() { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (!loaded()) { return false; } @@ -193,14 +193,14 @@ const ReadingListEntry* ReadingListModelImpl::GetEntryByURL( const GURL& gurl) const { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(loaded()); return GetMutableEntryFromURL(gurl); } const ReadingListEntry* ReadingListModelImpl::GetFirstUnreadEntry( bool distilled) const { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(loaded()); if (unread_entry_count_ == 0) { return nullptr; @@ -234,7 +234,7 @@ ReadingListEntry* ReadingListModelImpl::GetMutableEntryFromURL( const GURL& url) const { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(loaded()); auto iterator = entries_->find(url); if (iterator == entries_->end()) { @@ -245,7 +245,7 @@ void ReadingListModelImpl::SyncAddEntry( std::unique_ptr<ReadingListEntry> entry) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(loaded()); // entry must not already exist. DCHECK(GetMutableEntryFromURL(entry->URL()) == nullptr); @@ -265,7 +265,7 @@ ReadingListEntry* ReadingListModelImpl::SyncMergeEntry( std::unique_ptr<ReadingListEntry> entry) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(loaded()); ReadingListEntry* existing_entry = GetMutableEntryFromURL(entry->URL()); DCHECK(existing_entry); @@ -301,7 +301,7 @@ void ReadingListModelImpl::RemoveEntryByURLImpl(const GURL& url, bool from_sync) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(loaded()); const ReadingListEntry* entry = GetEntryByURL(url); if (!entry) @@ -324,7 +324,7 @@ const GURL& url, const std::string& title, reading_list::EntrySource source) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(loaded()); DCHECK(url.SchemeIsHTTPOrHTTPS()); RemoveEntryByURL(url); @@ -351,7 +351,7 @@ } void ReadingListModelImpl::SetReadStatus(const GURL& url, bool read) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(loaded()); auto iterator = entries_->find(url); if (iterator == entries_->end()) { @@ -380,7 +380,7 @@ void ReadingListModelImpl::SetEntryTitle(const GURL& url, const std::string& title) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(loaded()); auto iterator = entries_->find(url); if (iterator == entries_->end()) { @@ -410,7 +410,7 @@ const GURL& distilled_url, int64_t distillation_size, const base::Time& distillation_date) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(loaded()); auto iterator = entries_->find(url); if (iterator == entries_->end()) { @@ -438,7 +438,7 @@ void ReadingListModelImpl::SetEntryDistilledState( const GURL& url, ReadingListEntry::DistillationState state) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(loaded()); auto iterator = entries_->find(url); if (iterator == entries_->end()) { @@ -464,7 +464,7 @@ void ReadingListModelImpl::SetContentSuggestionsExtra( const GURL& url, const reading_list::ContentSuggestionsExtra& extra) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(loaded()); ReadingListEntry* entry = GetMutableEntryFromURL(url); if (!entry) { @@ -504,7 +504,7 @@ } void ReadingListModelImpl::LeavingBatchUpdates() { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (storage_layer_) { SetPersistentHasUnseen(has_unseen_); } @@ -512,12 +512,12 @@ } void ReadingListModelImpl::EnteringBatchUpdates() { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); ReadingListModel::EnteringBatchUpdates(); } void ReadingListModelImpl::SetPersistentHasUnseen(bool has_unseen) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (!pref_service_) { return; } @@ -526,7 +526,7 @@ } bool ReadingListModelImpl::GetPersistentHasUnseen() { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (!pref_service_) { return false; }
diff --git a/components/reading_list/core/reading_list_store.cc b/components/reading_list/core/reading_list_store.cc index a9af371a..8d0f3559 100644 --- a/components/reading_list/core/reading_list_store.cc +++ b/components/reading_list/core/reading_list_store.cc
@@ -29,13 +29,14 @@ pending_transaction_count_(0) {} ReadingListStore::~ReadingListStore() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_EQ(0, pending_transaction_count_); } void ReadingListStore::SetReadingListModel(ReadingListModel* model, ReadingListStoreDelegate* delegate, base::Clock* clock) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); model_ = model; delegate_ = delegate; clock_ = clock; @@ -59,7 +60,7 @@ } void ReadingListStore::BeginTransaction() { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); pending_transaction_count_++; if (pending_transaction_count_ == 1) { batch_ = store_->CreateWriteBatch(); @@ -67,7 +68,7 @@ } void ReadingListStore::CommitTransaction() { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); pending_transaction_count_--; if (pending_transaction_count_ == 0) { store_->CommitWriteBatch( @@ -78,7 +79,7 @@ } void ReadingListStore::SaveEntry(const ReadingListEntry& entry) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); auto token = EnsureBatchCreated(); std::unique_ptr<reading_list::ReadingListLocal> pb_entry = @@ -105,7 +106,7 @@ } void ReadingListStore::RemoveEntry(const ReadingListEntry& entry) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); auto token = EnsureBatchCreated(); batch_->DeleteData(entry.URL().spec()); @@ -122,7 +123,7 @@ void ReadingListStore::OnDatabaseLoad( syncer::ModelTypeStore::Result result, std::unique_ptr<syncer::ModelTypeStore::RecordList> entries) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (result != syncer::ModelTypeStore::Result::SUCCESS) { change_processor()->ReportError(FROM_HERE, "Cannot load Reading List Database."); @@ -158,7 +159,7 @@ void ReadingListStore::OnReadAllMetadata( base::Optional<syncer::ModelError> error, std::unique_ptr<syncer::MetadataBatch> metadata_batch) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (error) { change_processor()->ReportError(FROM_HERE, "Failed to read metadata."); } else { @@ -173,7 +174,7 @@ void ReadingListStore::OnStoreCreated( syncer::ModelTypeStore::Result result, std::unique_ptr<syncer::ModelTypeStore> store) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (result != syncer::ModelTypeStore::Result::SUCCESS) { // TODO(crbug.com/664926): handle store creation error. return; @@ -207,7 +208,7 @@ base::Optional<syncer::ModelError> ReadingListStore::MergeSyncData( std::unique_ptr<syncer::MetadataChangeList> metadata_change_list, syncer::EntityDataMap entity_data_map) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); auto token = EnsureBatchCreated(); // Keep track of the last update of each item. std::set<std::string> synced_entries; @@ -293,7 +294,7 @@ base::Optional<syncer::ModelError> ReadingListStore::ApplySyncChanges( std::unique_ptr<syncer::MetadataChangeList> metadata_change_list, syncer::EntityChangeList entity_changes) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); std::unique_ptr<ReadingListModel::ScopedReadingListBatchUpdate> batch = model_->BeginBatchUpdates(); auto token = EnsureBatchCreated(); @@ -356,7 +357,7 @@ void ReadingListStore::GetData(StorageKeyList storage_keys, DataCallback callback) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); auto batch = base::MakeUnique<syncer::MutableDataBatch>(); for (const std::string& url_string : storage_keys) { const ReadingListEntry* entry = model_->GetEntryByURL(GURL(url_string)); @@ -369,7 +370,7 @@ } void ReadingListStore::GetAllData(DataCallback callback) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); auto batch = base::MakeUnique<syncer::MutableDataBatch>(); for (const auto& url : model_->Keys()) { @@ -382,7 +383,7 @@ void ReadingListStore::AddEntryToBatch(syncer::MutableDataBatch* batch, const ReadingListEntry& entry) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); std::unique_ptr<sync_pb::ReadingListSpecifics> entry_pb = entry.AsReadingListSpecifics(); @@ -402,7 +403,7 @@ // GetStorageKey(). std::string ReadingListStore::GetClientTag( const syncer::EntityData& entity_data) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); return GetStorageKey(entity_data); } @@ -414,7 +415,7 @@ // should be. std::string ReadingListStore::GetStorageKey( const syncer::EntityData& entity_data) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); return entity_data.specifics.reading_list().entry_id(); }
diff --git a/components/reading_list/core/reading_list_store.h b/components/reading_list/core/reading_list_store.h index 9f6eef8..eca26da 100644 --- a/components/reading_list/core/reading_list_store.h +++ b/components/reading_list/core/reading_list_store.h
@@ -8,7 +8,7 @@ #include <memory> #include <string> -#include "base/threading/non_thread_safe.h" +#include "base/sequence_checker.h" #include "components/reading_list/core/reading_list_model_storage.h" #include "components/reading_list/core/reading_list_store_delegate.h" #include "components/sync/model/model_error.h" @@ -21,8 +21,7 @@ class ReadingListModel; // A ReadingListModelStorage storing and syncing data in protobufs. -class ReadingListStore : public ReadingListModelStorage, - public base::NonThreadSafe { +class ReadingListStore : public ReadingListModelStorage { using StoreFactoryFunction = base::Callback<void( const syncer::ModelTypeStore::InitCallback& callback)>; @@ -168,6 +167,8 @@ base::Clock* clock_; + SEQUENCE_CHECKER(sequence_checker_); + DISALLOW_COPY_AND_ASSIGN(ReadingListStore); };
diff --git a/components/sync_preferences/pref_model_associator.cc b/components/sync_preferences/pref_model_associator.cc index 49bd331..3175208 100644 --- a/components/sync_preferences/pref_model_associator.cc +++ b/components/sync_preferences/pref_model_associator.cc
@@ -63,12 +63,12 @@ pref_service_(NULL), type_(type), client_(client) { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(type_ == PREFERENCES || type_ == PRIORITY_PREFERENCES); } PrefModelAssociator::~PrefModelAssociator() { - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); pref_service_ = NULL; synced_pref_observers_.clear(); @@ -166,7 +166,7 @@ std::unique_ptr<syncer::SyncChangeProcessor> sync_processor, std::unique_ptr<syncer::SyncErrorFactory> sync_error_factory) { DCHECK_EQ(type_, type); - DCHECK(CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(pref_service_); DCHECK(!sync_processor_.get()); DCHECK(sync_processor.get());
diff --git a/components/sync_preferences/pref_model_associator.h b/components/sync_preferences/pref_model_associator.h index 2afbef01..257f0f5 100644 --- a/components/sync_preferences/pref_model_associator.h +++ b/components/sync_preferences/pref_model_associator.h
@@ -16,7 +16,7 @@ #include "base/containers/hash_tables.h" #include "base/macros.h" #include "base/observer_list.h" -#include "base/threading/non_thread_safe.h" +#include "base/sequence_checker.h" #include "components/sync/model/sync_data.h" #include "components/sync/model/syncable_service.h" #include "components/sync_preferences/synced_pref_observer.h" @@ -37,8 +37,7 @@ // Contains all preference sync related logic. // TODO(sync): Merge this into PrefService once we separate the profile // PrefService from the local state PrefService. -class PrefModelAssociator : public syncer::SyncableService, - public base::NonThreadSafe { +class PrefModelAssociator : public syncer::SyncableService { public: // Constructs a PrefModelAssociator initializing the |client_| and |type_| // instance variable. The |client| is not owned by this object and the caller @@ -201,6 +200,8 @@ std::vector<base::Closure> callback_list_; + SEQUENCE_CHECKER(sequence_checker_); + DISALLOW_COPY_AND_ASSIGN(PrefModelAssociator); };
diff --git a/content/browser/webrtc/webrtc_getusermedia_browsertest.cc b/content/browser/webrtc/webrtc_getusermedia_browsertest.cc index d22b6dd..84be043 100644 --- a/content/browser/webrtc/webrtc_getusermedia_browsertest.cc +++ b/content/browser/webrtc/webrtc_getusermedia_browsertest.cc
@@ -1370,8 +1370,9 @@ // This test calls getUserMedia in an iframe and immediately close the iframe // in the scope of the success callback. +// TODO(mattcary): disabled for flakes, see crbug.com/727601. IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaOldConstraintsBrowserTest, - AudioInIFrameAndCloseInSuccessCb) { + DISABLED_AudioInIFrameAndCloseInSuccessCb) { ASSERT_TRUE(embedded_test_server()->Start()); GURL url(embedded_test_server()->GetURL("/media/getusermedia.html"));
diff --git a/extensions/BUILD.gn b/extensions/BUILD.gn index 6e6bb797..2c715643 100644 --- a/extensions/BUILD.gn +++ b/extensions/BUILD.gn
@@ -35,7 +35,7 @@ ] grit_flags = [ "-E", - "mojom_root=" + rebase_path(root_gen_dir), + "mojom_root=" + rebase_path(root_gen_dir, root_build_dir), ] } @@ -47,7 +47,7 @@ ] grit_flags = [ "-E", - "mojom_root=" + rebase_path(root_gen_dir), + "mojom_root=" + rebase_path(root_gen_dir, root_build_dir), ] deps = [
diff --git a/gpu/command_buffer/common/capabilities.h b/gpu/command_buffer/common/capabilities.h index ab7a077..7950779 100644 --- a/gpu/command_buffer/common/capabilities.h +++ b/gpu/command_buffer/common/capabilities.h
@@ -174,6 +174,9 @@ // See https://crbug.com/710029. bool software_to_accelerated_canvas_upgrade = true; + // When true, non-empty post sub buffer calls are unsupported. + bool disable_non_empty_post_sub_buffers = false; + int major_version = 2; int minor_version = 0; };
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc index 11dbc45c..5dbc207 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -3845,6 +3845,10 @@ !workarounds().disable_software_to_accelerated_canvas_upgrade; caps.emulate_rgb_buffer_with_rgba = workarounds().disable_gl_rgb_format; + if (workarounds().disable_non_empty_post_sub_buffers_for_onscreen_surfaces && + !surface_->IsOffscreen()) { + caps.disable_non_empty_post_sub_buffers = true; + } return caps; }
diff --git a/gpu/config/gpu_driver_bug_list.json b/gpu/config/gpu_driver_bug_list.json index b2493264..15aa3aa3 100644 --- a/gpu/config/gpu_driver_bug_list.json +++ b/gpu/config/gpu_driver_bug_list.json
@@ -845,6 +845,19 @@ ] }, { + "id": 101, + "description": "The Mali-Txxx driver hangs when reading from currently displayed buffer", + "cr_bugs": [457511], + "os": { + "type": "chromeos" + }, + "gl_vendor": "ARM.*", + "gl_renderer": "Mali-T.*", + "features": [ + "disable_non_empty_post_sub_buffers_for_onscreen_surfaces" + ] + }, + { "id": 102, "description": "Adreno 420 driver loses FBO attachment contents on bound FBO deletion", "cr_bugs": [457027],
diff --git a/gpu/config/gpu_driver_bug_workaround_type.h b/gpu/config/gpu_driver_bug_workaround_type.h index ef50548..bcf07fc 100644 --- a/gpu/config/gpu_driver_bug_workaround_type.h +++ b/gpu/config/gpu_driver_bug_workaround_type.h
@@ -217,6 +217,8 @@ disallow_large_instanced_draw) \ GPU_OP(DISABLE_SOFTWARE_TO_ACCELERATED_CANVAS_UPGRADE, \ disable_software_to_accelerated_canvas_upgrade) \ + GPU_OP(DISABLE_NON_EMPTY_POST_SUB_BUFFERS_FOR_ONSCREEN_SURFACES, \ + disable_non_empty_post_sub_buffers_for_onscreen_surfaces) \ GPU_OP(AVOID_STENCIL_BUFFERS, \ avoid_stencil_buffers) \ // clang-format on
diff --git a/gpu/ipc/common/gpu_command_buffer_traits_multi.h b/gpu/ipc/common/gpu_command_buffer_traits_multi.h index 2fff38d..9c0b46e 100644 --- a/gpu/ipc/common/gpu_command_buffer_traits_multi.h +++ b/gpu/ipc/common/gpu_command_buffer_traits_multi.h
@@ -133,6 +133,7 @@ IPC_STRUCT_TRAITS_MEMBER(emulate_rgb_buffer_with_rgba) IPC_STRUCT_TRAITS_MEMBER(software_to_accelerated_canvas_upgrade) IPC_STRUCT_TRAITS_MEMBER(dc_layers) + IPC_STRUCT_TRAITS_MEMBER(disable_non_empty_post_sub_buffers) IPC_STRUCT_TRAITS_MEMBER(avoid_stencil_buffers) IPC_STRUCT_TRAITS_MEMBER(major_version)
diff --git a/headless/BUILD.gn b/headless/BUILD.gn index 63e8cfd..a038ce3 100644 --- a/headless/BUILD.gn +++ b/headless/BUILD.gn
@@ -84,9 +84,9 @@ args = [ "--data_file", - rebase_path("$root_out_dir/headless_lib.pak"), + rebase_path("$root_out_dir/headless_lib.pak", root_build_dir), "--gendir", - rebase_path("$root_gen_dir"), + rebase_path("$root_gen_dir", root_build_dir), "--header_file", "headless/embedded_resource_pak.h", "--source_file", @@ -119,7 +119,7 @@ ] grit_flags = [ "-E", - "mojom_root=" + rebase_path(root_gen_dir), + "mojom_root=" + rebase_path(root_gen_dir, root_build_dir), ] deps = [ ":tab_socket__generator", @@ -197,7 +197,7 @@ "--protocol", rebase_path(inputs[0], root_build_dir), "--output_dir", - rebase_path(target_gen_dir) + "/public", + rebase_path(target_gen_dir, root_build_dir) + "/public", ] }
diff --git a/media/capture/video/linux/v4l2_capture_delegate.cc b/media/capture/video/linux/v4l2_capture_delegate.cc index a732c234..118d9976 100644 --- a/media/capture/video/linux/v4l2_capture_delegate.cc +++ b/media/capture/video/linux/v4l2_capture_delegate.cc
@@ -192,6 +192,9 @@ case V4L2_CID_TILT_RESET: case V4L2_CID_PAN_ABSOLUTE: case V4L2_CID_TILT_ABSOLUTE: + case V4L2_CID_ZOOM_ABSOLUTE: + case V4L2_CID_ZOOM_RELATIVE: + case V4L2_CID_ZOOM_CONTINUOUS: case V4L2_CID_PAN_SPEED: case V4L2_CID_TILT_SPEED: case V4L2_CID_PANTILT_CMD:
diff --git a/media/capture/video/linux/v4l2_capture_delegate_unittest.cc b/media/capture/video/linux/v4l2_capture_delegate_unittest.cc index d4a77ac..916a383 100644 --- a/media/capture/video/linux/v4l2_capture_delegate_unittest.cc +++ b/media/capture/video/linux/v4l2_capture_delegate_unittest.cc
@@ -57,6 +57,9 @@ case V4L2_CID_TILT_RESET: case V4L2_CID_PAN_ABSOLUTE: case V4L2_CID_TILT_ABSOLUTE: + case V4L2_CID_ZOOM_ABSOLUTE: + case V4L2_CID_ZOOM_RELATIVE: + case V4L2_CID_ZOOM_CONTINUOUS: case V4L2_CID_PAN_SPEED: case V4L2_CID_TILT_SPEED: case V4L2_CID_PANTILT_CMD:
diff --git a/mojo/public/js/BUILD.gn b/mojo/public/js/BUILD.gn index 0bec9e2..21cc4ed 100644 --- a/mojo/public/js/BUILD.gn +++ b/mojo/public/js/BUILD.gn
@@ -77,8 +77,8 @@ compiled_file, ] - args = rebase_path(new_bindings_js_files) - args += [ rebase_path(compiled_file) ] + args = rebase_path(new_bindings_js_files, root_build_dir) + args += [ rebase_path(compiled_file, root_build_dir) ] deps = [ "//mojo/public/interfaces/bindings:new_bindings__generator",
diff --git a/mojo/public/tools/bindings/BUILD.gn b/mojo/public/tools/bindings/BUILD.gn index 153d110..5be5586e 100644 --- a/mojo/public/tools/bindings/BUILD.gn +++ b/mojo/public/tools/bindings/BUILD.gn
@@ -72,6 +72,6 @@ "--use_bundled_pylibs", "precompile", "-o", - rebase_path(target_gen_dir), + rebase_path(target_gen_dir, root_build_dir), ] }
diff --git a/mojo/public/tools/bindings/mojom.gni b/mojo/public/tools/bindings/mojom.gni index 8708e7a..05d1f52 100644 --- a/mojo/public/tools/bindings/mojom.gni +++ b/mojo/public/tools/bindings/mojom.gni
@@ -270,9 +270,9 @@ "-I", rebase_path("//", root_build_dir), "-o", - rebase_path(root_gen_dir), + rebase_path(root_gen_dir, root_build_dir), "--bytecode_path", - rebase_path("$root_gen_dir/mojo/public/tools/bindings"), + rebase_path("$root_gen_dir/mojo/public/tools/bindings", root_build_dir), ] if (defined(invoker.import_dirs)) { @@ -378,7 +378,7 @@ "--impl_macro", shared_component_impl_macro, "--output_file", - generated_shared_export_header, + rebase_path(generated_shared_export_header, root_build_dir), "--relative_path", rebase_path(generated_shared_export_header, root_gen_dir), ] @@ -532,7 +532,7 @@ "--impl_macro", "${invoker.component_macro_prefix}${bindings_configuration.component_macro_suffix}_IMPL", "--output_file", - generated_export_header, + rebase_path(generated_export_header, root_build_dir), "--relative_path", rebase_path(generated_export_header, root_gen_dir), ]
diff --git a/net/extras/sqlite/sqlite_persistent_cookie_store_unittest.cc b/net/extras/sqlite/sqlite_persistent_cookie_store_unittest.cc index 212b523..4b3c0c1a 100644 --- a/net/extras/sqlite/sqlite_persistent_cookie_store_unittest.cc +++ b/net/extras/sqlite/sqlite_persistent_cookie_store_unittest.cc
@@ -662,7 +662,8 @@ cookies.clear(); } -TEST_F(SQLitePersistentCookieStoreTest, UpdateToEncryption) { +// TODO(mattcary): disabled for breaking cronet K build: crbug.com/727566. +TEST_F(SQLitePersistentCookieStoreTest, DISABLED_UpdateToEncryption) { CanonicalCookieVector cookies; // Create unencrypted cookie store and write something to it.
diff --git a/ppapi/native_client/BUILD.gn b/ppapi/native_client/BUILD.gn index eef25a2..e06e4fa 100644 --- a/ppapi/native_client/BUILD.gn +++ b/ppapi/native_client/BUILD.gn
@@ -95,10 +95,10 @@ script = "irt_debuglink.py" args = [ - rebase_path(objcopy), - rebase_path(irt_debug), - rebase_path(irt_stripped), - rebase_path(irt_final), + rebase_path(objcopy, root_build_dir), + rebase_path(irt_debug, root_build_dir), + rebase_path(irt_stripped, root_build_dir), + rebase_path(irt_final, root_build_dir), ] } }
diff --git a/ppapi/native_client/nacl_test_data.gni b/ppapi/native_client/nacl_test_data.gni index 67b8041f..823b732 100644 --- a/ppapi/native_client/nacl_test_data.gni +++ b/ppapi/native_client/nacl_test_data.gni
@@ -251,7 +251,8 @@ "-arch", arch, "-Wl,-L" + - rebase_path(get_label_info(pnacl_irt_shim, "target_out_dir")), + rebase_path(get_label_info(pnacl_irt_shim, "target_out_dir"), + root_build_dir), ] deps = [ ":$nexe_target_name(//build/toolchain/nacl:newlib_pnacl)",
diff --git a/remoting/host/BUILD.gn b/remoting/host/BUILD.gn index a699cc7..adc33f4 100644 --- a/remoting/host/BUILD.gn +++ b/remoting/host/BUILD.gn
@@ -626,7 +626,7 @@ "--define", "IT2ME_HOST_PATH=$it2me_host_path", "--variables", - rebase_path(branding_path), + rebase_path(branding_path, root_build_dir), "--template", "{{source}}", "--output", @@ -649,7 +649,7 @@ "--locale_dir", rebase_path(webapp_locale_dir, root_build_dir), "--variables", - rebase_path(branding_path), + rebase_path(branding_path, root_build_dir), "--template", "{{source}}", "--locale_output",
diff --git a/remoting/tools/build/remoting_localize.gni b/remoting/tools/build/remoting_localize.gni index 54ff46e2..53e80238 100644 --- a/remoting/tools/build/remoting_localize.gni +++ b/remoting/tools/build/remoting_localize.gni
@@ -76,7 +76,7 @@ foreach(i, invoker.variables) { args += [ "--variables", - i, + rebase_path(i, root_build_dir), ] } }
diff --git a/services/catalog/public/tools/catalog.gni b/services/catalog/public/tools/catalog.gni index 4aeaa2a..33fd505 100644 --- a/services/catalog/public/tools/catalog.gni +++ b/services/catalog/public/tools/catalog.gni
@@ -70,7 +70,7 @@ output_filename, ] - args = [ "--output=" + rebase_path(output_filename) ] + args = [ "--output=" + rebase_path(output_filename, root_build_dir) ] if (is_debug || dcheck_always_on) { args += [ "--pretty" ]
diff --git a/testing/libfuzzer/fuzzer_test.gni b/testing/libfuzzer/fuzzer_test.gni index 014bb8f1..1ab6835 100644 --- a/testing/libfuzzer/fuzzer_test.gni +++ b/testing/libfuzzer/fuzzer_test.gni
@@ -48,16 +48,16 @@ args = [ "--output", - rebase_path(out), + rebase_path(out, root_build_dir), ] if (defined(invoker.seed_corpus)) { - args += [ rebase_path(invoker.seed_corpus) ] + args += [ rebase_path(invoker.seed_corpus, root_build_dir) ] } if (defined(invoker.seed_corpuses)) { foreach(seed_corpus_path, invoker.seed_corpuses) { - args += [ rebase_path(seed_corpus_path) ] + args += [ rebase_path(seed_corpus_path, root_build_dir) ] } } @@ -93,13 +93,14 @@ script = "//testing/libfuzzer/gen_fuzzer_config.py" args = [ "--config", - rebase_path("$root_build_dir/" + config_name), + rebase_path("$root_build_dir/" + config_name, root_build_dir), ] if (defined(invoker.dict)) { args += [ "--dict", - rebase_path("$root_build_dir/" + invoker.target_name + ".dict"), + rebase_path("$root_build_dir/" + invoker.target_name + ".dict", + root_build_dir), ] }
diff --git a/third_party/WebKit/LayoutTests/LeakExpectations b/third_party/WebKit/LayoutTests/LeakExpectations index 073f458..91eebb6 100644 --- a/third_party/WebKit/LayoutTests/LeakExpectations +++ b/third_party/WebKit/LayoutTests/LeakExpectations
@@ -9,22 +9,6 @@ # ask hajimehoshi@. # ########################################################################### -# view-source:// tests are not supported by the leak detector -crbug.com/364398 fast/frames/viewsource/viewsource-1.html [ Leak ] -crbug.com/364398 fast/frames/viewsource/viewsource-2.html [ Leak ] -crbug.com/364398 fast/frames/viewsource/viewsource-3.html [ Leak ] -crbug.com/364398 fast/frames/viewsource/viewsource-4.html [ Leak ] -crbug.com/364398 fast/frames/viewsource/viewsource-5.html [ Leak ] -crbug.com/364398 fast/frames/viewsource/viewsource-6.html [ Leak ] -crbug.com/364398 fast/frames/viewsource/viewsource-7.html [ Leak ] -crbug.com/364398 fast/frames/viewsource/viewsource-incomplete-token.html [ Leak ] -crbug.com/364398 fast/frames/viewsource/viewsource-unfinished-script.html [ Leak ] -crbug.com/364398 fast/frames/viewsource/viewsource-unfinished-textarea.html [ Leak ] -crbug.com/364398 http/tests/security/xssAuditor/viewsource-onmouseover.html [ Leak ] -crbug.com/364398 virtual/mojo-loading/http/tests/security/xssAuditor/viewsource-onmouseover.html [ Leak ] -crbug.com/364398 http/tests/security/xssAuditor/viewsource-script-tag.html [ Leak ] -crbug.com/364398 virtual/mojo-loading/http/tests/security/xssAuditor/viewsource-script-tag.html [ Leak ] - # FIXME: The below tests fails when the leak detector is disabled. crbug.com/366029 compositing/fixed-body-background-positioned.html [ Failure Pass ] crbug.com/366029 virtual/disable-spinvalidation/compositing/fixed-body-background-positioned.html [ Failure Pass ] @@ -32,9 +16,6 @@ # FIXME: The below tests crashes when the leak detector is run on debug builds crbug.com/366043 [ Debug ] fast/history/history-traversal-is-asynchronous.html [ Crash ] -# The leak detector doesn't wait for worker threads to completely clean up, so leaks are expected. -crbug.com/301515 fast/workers/worker-terminate.html [ Leak ] - # FIXME: scroll customization leaks memory. See # codereview.chromium.org/1236913004/ for context. crbug.com/410974 virtual/scroll_customization/fast/scroll-behavior/scroll-customization/touch-scroll-customization.html [ Leak ] @@ -45,10 +26,7 @@ # ----------------------------------------------------------------- crbug.com/327574 permissionclient/image-permissions.html [ Leak ] -crbug.com/327574 http/tests/permissionclient/image-permissions.html [ Leak ] -crbug.com/327574 virtual/mojo-loading/http/tests/permissionclient/image-permissions.html [ Leak ] crbug.com/327574 fast/loader/data-images-with-images-disabled.html [ Leak ] -crbug.com/629058 plugins/fullscreen-plugins-dont-reload.html [ Leak ] # ----------------------------------------------------------------- # Untriaged but known leaks which may be false positives. @@ -70,9 +48,6 @@ # ----------------------------------------------------------------- # Untriaged but known leaks of ActiveDOMObject (fast). # ----------------------------------------------------------------- -crbug.com/506529 fast/mediastream/MediaStreamConstructor.html [ Leak ] -crbug.com/506529 fast/events/constructors/media-stream-event-constructor.html [ Leak ] -crbug.com/506529 fast/files/workers/worker-read-blob-async-crash.html [ Leak ] crbug.com/661182 fast/loader/open-in-srcdoc-unload.html [ Leak ] # ----------------------------------------------------------------- @@ -87,14 +62,8 @@ # ----------------------------------------------------------------- # Untriaged but known leaks of ActiveDOMObject (http). # ----------------------------------------------------------------- -crbug.com/506754 http/tests/cachestorage/window/cache-put.html [ Leak ] -crbug.com/506754 virtual/mojo-loading/http/tests/cachestorage/window/cache-put.html [ Leak ] -crbug.com/506754 http/tests/inspector/network/network-xhr-replay.html [ Leak ] -crbug.com/506754 virtual/mojo-loading/http/tests/inspector/network/network-xhr-replay.html [ Leak ] crbug.com/506754 http/tests/inspector/service-workers/service-worker-agents.html [ Crash Leak ] crbug.com/506754 virtual/mojo-loading/http/tests/inspector/service-workers/service-worker-agents.html [ Crash Leak ] -crbug.com/506754 http/tests/security/cross-origin-indexeddb-allowed.html [ Leak ] -crbug.com/506754 virtual/mojo-loading/http/tests/security/cross-origin-indexeddb-allowed.html [ Leak ] crbug.com/506754 http/tests/serviceworker/chromium/resolve-after-window-close.html [ Leak ] crbug.com/506754 virtual/mojo-loading/http/tests/serviceworker/chromium/resolve-after-window-close.html [ Leak ] crbug.com/506754 virtual/off-main-thread-fetch/http/tests/serviceworker/chromium/resolve-after-window-close.html [ Leak ] @@ -124,8 +93,6 @@ crbug.com/594309 [ Linux ] external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-baseline-empty-001a.html [ Leak ] crbug.com/594309 [ Linux ] external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-baseline-empty-001b.html [ Leak ] crbug.com/594309 [ Linux ] external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-baseline-multi-item-vert-001.html [ Leak ] -crbug.com/594309 [ Linux ] external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-whitespace-handling-002.xhtml [ Leak ] -crbug.com/594309 [ Linux ] external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/writing-modes-3/text-combine-upright-compression-007.html [ Leak ] crbug.com/664874 http/tests/xmlhttprequest/workers/xmlhttprequest-allowed-with-disabled-web-security.html [ Leak ] crbug.com/664874 virtual/mojo-loading/http/tests/xmlhttprequest/workers/xmlhttprequest-allowed-with-disabled-web-security.html [ Leak ]
diff --git a/third_party/WebKit/Source/bindings/scripts/v8_callback_function.py b/third_party/WebKit/Source/bindings/scripts/v8_callback_function.py index 1641d10b..3e105285 100644 --- a/third_party/WebKit/Source/bindings/scripts/v8_callback_function.py +++ b/third_party/WebKit/Source/bindings/scripts/v8_callback_function.py
@@ -66,16 +66,16 @@ def forward_declarations(callback_function): - def find_interface_name(idl_type): - if idl_type.is_interface_type: + def find_forward_declaration(idl_type): + if idl_type.is_interface_type or idl_type.is_dictionary: return idl_type.implemented_as elif idl_type.is_array_or_sequence_type: - return find_interface_name(idl_type.element_type) + return find_forward_declaration(idl_type.element_type) return None declarations = [] for argument in callback_function.arguments: - name = find_interface_name(argument.idl_type) + name = find_forward_declaration(argument.idl_type) if name: declarations.append(name) return declarations
diff --git a/third_party/WebKit/Source/bindings/tests/idls/core/TestCallbackFunctions.idl b/third_party/WebKit/Source/bindings/tests/idls/core/TestCallbackFunctions.idl index 4045d19..1dfc9b4 100644 --- a/third_party/WebKit/Source/bindings/tests/idls/core/TestCallbackFunctions.idl +++ b/third_party/WebKit/Source/bindings/tests/idls/core/TestCallbackFunctions.idl
@@ -8,6 +8,7 @@ // Following callback functions are to be generated as expected. callback VoidCallbackFunctionInterfaceArg = void (HTMLDivElement divElement); +callback VoidCallbackFunctionDictionaryArg = void (TestDictionary arg); callback VoidCallbackFunctionTestInterfaceSequenceArg = void (sequence<TestInterface> arg); callback StringSequenceCallbackFunctionLongSequenceArg = sequence<DOMString> (sequence<long> arg); callback VoidCallbackFunctionTypedef = void (String arg);
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/VoidCallbackFunctionDictionaryArg.cpp b/third_party/WebKit/Source/bindings/tests/results/core/VoidCallbackFunctionDictionaryArg.cpp new file mode 100644 index 0000000..10a812f0 --- /dev/null +++ b/third_party/WebKit/Source/bindings/tests/results/core/VoidCallbackFunctionDictionaryArg.cpp
@@ -0,0 +1,93 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// This file has been auto-generated by code_generator_v8.py. +// DO NOT MODIFY! + +// This file has been generated from the Jinja2 template in +// third_party/WebKit/Source/bindings/templates/callback_function.cpp.tmpl + +// clang-format off + +#include "VoidCallbackFunctionDictionaryArg.h" + +#include "bindings/core/v8/ExceptionState.h" +#include "bindings/core/v8/NativeValueTraitsImpl.h" +#include "bindings/core/v8/ToV8ForCore.h" +#include "bindings/core/v8/V8BindingForCore.h" +#include "bindings/core/v8/V8TestDictionary.h" +#include "core/dom/ExecutionContext.h" +#include "platform/bindings/ScriptState.h" +#include "platform/wtf/Assertions.h" + +namespace blink { + +// static +VoidCallbackFunctionDictionaryArg* VoidCallbackFunctionDictionaryArg::Create(ScriptState* scriptState, v8::Local<v8::Value> callback) { + if (IsUndefinedOrNull(callback)) + return nullptr; + return new VoidCallbackFunctionDictionaryArg(scriptState, v8::Local<v8::Function>::Cast(callback)); +} + +VoidCallbackFunctionDictionaryArg::VoidCallbackFunctionDictionaryArg(ScriptState* scriptState, v8::Local<v8::Function> callback) + : script_state_(scriptState), + callback_(scriptState->GetIsolate(), this, callback) { + DCHECK(!callback_.IsEmpty()); +} + +DEFINE_TRACE_WRAPPERS(VoidCallbackFunctionDictionaryArg) { + visitor->TraceWrappers(callback_.Cast<v8::Value>()); +} + +bool VoidCallbackFunctionDictionaryArg::call(ScriptWrappable* scriptWrappable, const TestDictionary& arg) { + if (callback_.IsEmpty()) + return false; + + if (!script_state_->ContextIsValid()) + return false; + + ExecutionContext* context = ExecutionContext::From(script_state_.Get()); + DCHECK(context); + if (context->IsContextSuspended() || context->IsContextDestroyed()) + return false; + + // TODO(bashi): Make sure that using DummyExceptionStateForTesting is OK. + // crbug.com/653769 + DummyExceptionStateForTesting exceptionState; + ScriptState::Scope scope(script_state_.Get()); + v8::Isolate* isolate = script_state_->GetIsolate(); + + v8::Local<v8::Value> thisValue = ToV8( + scriptWrappable, + script_state_->GetContext()->Global(), + isolate); + + v8::Local<v8::Value> argArgument = ToV8(arg, script_state_->GetContext()->Global(), script_state_->GetIsolate()); + v8::Local<v8::Value> argv[] = { argArgument }; + v8::TryCatch exceptionCatcher(isolate); + exceptionCatcher.SetVerbose(true); + + v8::Local<v8::Value> v8ReturnValue; + if (!V8ScriptRunner::CallFunction(callback_.NewLocal(isolate), + context, + thisValue, + 1, + argv, + isolate).ToLocal(&v8ReturnValue)) { + return false; + } + + return true; +} + +VoidCallbackFunctionDictionaryArg* NativeValueTraits<VoidCallbackFunctionDictionaryArg>::NativeValue(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exceptionState) { + VoidCallbackFunctionDictionaryArg* nativeValue = VoidCallbackFunctionDictionaryArg::Create(ScriptState::Current(isolate), value); + if (!nativeValue) { + exceptionState.ThrowTypeError(ExceptionMessages::FailedToConvertJSValue( + "VoidCallbackFunctionDictionaryArg")); + } + return nativeValue; +} + +} // namespace blink
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/VoidCallbackFunctionDictionaryArg.h b/third_party/WebKit/Source/bindings/tests/results/core/VoidCallbackFunctionDictionaryArg.h new file mode 100644 index 0000000..f22ceab --- /dev/null +++ b/third_party/WebKit/Source/bindings/tests/results/core/VoidCallbackFunctionDictionaryArg.h
@@ -0,0 +1,57 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// This file has been auto-generated by code_generator_v8.py. +// DO NOT MODIFY! + +// This file has been generated from the Jinja2 template in +// third_party/WebKit/Source/bindings/templates/callback_function.h.tmpl + +// clang-format off + +#ifndef VoidCallbackFunctionDictionaryArg_h +#define VoidCallbackFunctionDictionaryArg_h + +#include "bindings/core/v8/NativeValueTraits.h" +#include "core/CoreExport.h" +#include "platform/bindings/ScriptWrappable.h" +#include "platform/bindings/TraceWrapperV8Reference.h" +#include "platform/heap/Handle.h" +#include "platform/wtf/text/WTFString.h" + +namespace blink { + +class ScriptState; +class TestDictionary; + +class CORE_EXPORT VoidCallbackFunctionDictionaryArg final : public GarbageCollectedFinalized<VoidCallbackFunctionDictionaryArg>, public TraceWrapperBase { + public: + static VoidCallbackFunctionDictionaryArg* Create(ScriptState*, v8::Local<v8::Value> callback); + + ~VoidCallbackFunctionDictionaryArg() = default; + + DEFINE_INLINE_TRACE() {} + DECLARE_TRACE_WRAPPERS(); + + bool call(ScriptWrappable* scriptWrappable, const TestDictionary& arg); + + v8::Local<v8::Function> v8Value(v8::Isolate* isolate) { + return callback_.NewLocal(isolate); + } + + private: + VoidCallbackFunctionDictionaryArg(ScriptState*, v8::Local<v8::Function>); + + RefPtr<ScriptState> script_state_; + TraceWrapperV8Reference<v8::Function> callback_; +}; + +template <> +struct NativeValueTraits<VoidCallbackFunctionDictionaryArg> : public NativeValueTraitsBase<VoidCallbackFunctionDictionaryArg> { + CORE_EXPORT static VoidCallbackFunctionDictionaryArg* NativeValue(v8::Isolate*, v8::Local<v8::Value>, ExceptionState&); +}; + +} // namespace blink + +#endif // VoidCallbackFunctionDictionaryArg_h
diff --git a/third_party/WebKit/Source/core/css/CSSPrimitiveValueMappings.h b/third_party/WebKit/Source/core/css/CSSPrimitiveValueMappings.h index 2fee1825..c831514 100644 --- a/third_party/WebKit/Source/core/css/CSSPrimitiveValueMappings.h +++ b/third_party/WebKit/Source/core/css/CSSPrimitiveValueMappings.h
@@ -1606,13 +1606,13 @@ inline CSSIdentifierValue::CSSIdentifierValue(TextOrientation e) : CSSValue(kIdentifierClass) { switch (e) { - case kTextOrientationSideways: + case TextOrientation::kSideways: value_id_ = CSSValueSideways; break; - case kTextOrientationMixed: + case TextOrientation::kMixed: value_id_ = CSSValueMixed; break; - case kTextOrientationUpright: + case TextOrientation::kUpright: value_id_ = CSSValueUpright; break; } @@ -1623,18 +1623,18 @@ switch (value_id_) { case CSSValueSideways: case CSSValueSidewaysRight: - return kTextOrientationSideways; + return TextOrientation::kSideways; case CSSValueMixed: case CSSValueVerticalRight: // -webkit-text-orientation - return kTextOrientationMixed; + return TextOrientation::kMixed; case CSSValueUpright: - return kTextOrientationUpright; + return TextOrientation::kUpright; default: break; } NOTREACHED(); - return kTextOrientationMixed; + return TextOrientation::kMixed; } template <>
diff --git a/third_party/WebKit/Source/core/css/CSSProperties.json5 b/third_party/WebKit/Source/core/css/CSSProperties.json5 index 8c2b6e3..01adce3 100644 --- a/third_party/WebKit/Source/core/css/CSSProperties.json5 +++ b/third_party/WebKit/Source/core/css/CSSProperties.json5
@@ -526,7 +526,7 @@ priority: "High", field_template: "storage_only", type_name: "TextOrientation", - default_value: "kTextOrientationMixed", + default_value: "TextOrientation::kMixed", field_size: 2, field_group: "rare-inherited", }, @@ -2583,7 +2583,7 @@ api_methods: ["parseSingleValue"], converter: "ConvertColor", inherited: true, - field_template: "storage_only", + field_template: "external", type_name: "Color", include_paths: ["platform/graphics/Color.h"], default_value: "LayoutTheme::TapHighlightColor()", @@ -2658,7 +2658,7 @@ api_methods: ["parseSingleValue"], converter: "ConvertTextStrokeWidth", inherited: true, - field_template: "storage_only", + field_template: "primitive", type_name: "float", default_value: "0", field_group: "rare-inherited",
diff --git a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp index 6da185f..10ac4cd 100644 --- a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp +++ b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
@@ -3306,7 +3306,7 @@ case CSSPropertyTextCombineUpright: return CSSIdentifierValue::Create(style.GetTextCombine()); case CSSPropertyWebkitTextOrientation: - if (style.GetTextOrientation() == kTextOrientationMixed) + if (style.GetTextOrientation() == TextOrientation::kMixed) return CSSIdentifierValue::Create(CSSValueVerticalRight); case CSSPropertyTextOrientation: return CSSIdentifierValue::Create(style.GetTextOrientation());
diff --git a/third_party/WebKit/Source/core/css/resolver/FontBuilder.cpp b/third_party/WebKit/Source/core/css/resolver/FontBuilder.cpp index d62baaf..56601c2e 100644 --- a/third_party/WebKit/Source/core/css/resolver/FontBuilder.cpp +++ b/third_party/WebKit/Source/core/css/resolver/FontBuilder.cpp
@@ -242,11 +242,11 @@ return FontOrientation::kHorizontal; switch (style.GetTextOrientation()) { - case kTextOrientationMixed: + case TextOrientation::kMixed: return FontOrientation::kVerticalMixed; - case kTextOrientationUpright: + case TextOrientation::kUpright: return FontOrientation::kVerticalUpright; - case kTextOrientationSideways: + case TextOrientation::kSideways: return FontOrientation::kVerticalRotated; default: NOTREACHED();
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp b/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp index c465e29..909904e 100644 --- a/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp +++ b/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp
@@ -372,7 +372,7 @@ const CSSValue& value) { state.Style()->ResetPageSizeType(); FloatSize size; - PageSizeType page_size_type = PAGE_SIZE_AUTO; + PageSizeType page_size_type = PageSizeType::kAuto; const CSSValueList& list = ToCSSValueList(value); if (list.length() == 2) { // <length>{2} | <page-size> <orientation> @@ -394,14 +394,14 @@ if (ToCSSIdentifierValue(second).GetValueID() == CSSValueLandscape) size = size.TransposedSize(); } - page_size_type = PAGE_SIZE_RESOLVED; + page_size_type = PageSizeType::kResolved; } else { DCHECK_EQ(list.length(), 1U); // <length> | auto | <page-size> | [ portrait | landscape] const CSSValue& first = list.Item(0); if (first.IsPrimitiveValue() && ToCSSPrimitiveValue(first).IsLength()) { // <length> - page_size_type = PAGE_SIZE_RESOLVED; + page_size_type = PageSizeType::kResolved; float width = ToCSSPrimitiveValue(first).ComputeLength<float>( state.CssToLengthConversionData().CopyWithAdjustedZoom(1.0)); size = FloatSize(width, width); @@ -409,17 +409,17 @@ const CSSIdentifierValue& ident = ToCSSIdentifierValue(first); switch (ident.GetValueID()) { case CSSValueAuto: - page_size_type = PAGE_SIZE_AUTO; + page_size_type = PageSizeType::kAuto; break; case CSSValuePortrait: - page_size_type = PAGE_SIZE_AUTO_PORTRAIT; + page_size_type = PageSizeType::kPortrait; break; case CSSValueLandscape: - page_size_type = PAGE_SIZE_AUTO_LANDSCAPE; + page_size_type = PageSizeType::kLandscape; break; default: // <page-size> - page_size_type = PAGE_SIZE_RESOLVED; + page_size_type = PageSizeType::kResolved; size = GetPageSizeFromName(ident); } }
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp index fb19b475..065dbf2 100644 --- a/third_party/WebKit/Source/core/dom/Document.cpp +++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -2428,17 +2428,17 @@ double width = page_size.Width(); double height = page_size.Height(); switch (style->GetPageSizeType()) { - case PAGE_SIZE_AUTO: + case PageSizeType::kAuto: break; - case PAGE_SIZE_AUTO_LANDSCAPE: + case PageSizeType::kLandscape: if (width < height) std::swap(width, height); break; - case PAGE_SIZE_AUTO_PORTRAIT: + case PageSizeType::kPortrait: if (width > height) std::swap(width, height); break; - case PAGE_SIZE_RESOLVED: { + case PageSizeType::kResolved: { FloatSize size = style->PageSize(); width = size.Width(); height = size.Height();
diff --git a/third_party/WebKit/Source/core/editing/LayoutSelection.cpp b/third_party/WebKit/Source/core/editing/LayoutSelection.cpp index 81174f1e..01db0ad0 100644 --- a/third_party/WebKit/Source/core/editing/LayoutSelection.cpp +++ b/third_party/WebKit/Source/core/editing/LayoutSelection.cpp
@@ -162,10 +162,13 @@ DISALLOW_COPY_AND_ASSIGN(SelectedMap); }; -static SelectedMap CollectSelectedMap( - const SelectionPaintRange& range, - LayoutSelection::SelectionPaintInvalidationMode - block_paint_invalidation_mode) { +enum class CollectSelectedMapOption { + kCollectBlock, + kNotCollectBlock, +}; + +static SelectedMap CollectSelectedMap(const SelectionPaintRange& range, + CollectSelectedMapOption option) { if (range.IsNull()) return SelectedMap(); @@ -184,8 +187,7 @@ // Blocks are responsible for painting line gaps and margin gaps. They // must be examined as well. selected_map.object_map.Set(runner, runner->GetSelectionState()); - if (block_paint_invalidation_mode == - LayoutSelection::kPaintInvalidationNewXOROld) { + if (option == CollectSelectedMapOption::kCollectBlock) { LayoutBlock* containing_block = runner->ContainingBlock(); while (containing_block && !containing_block->IsLayoutView()) { SelectedBlockMap::AddResult result = selected_map.block_map.insert( @@ -221,20 +223,12 @@ } } -void LayoutSelection::SetSelection( - const SelectionPaintRange& new_range, - SelectionPaintInvalidationMode block_paint_invalidation_mode) { - DCHECK(!new_range.IsNull()); - - // Just return if the selection hasn't changed. - if (paint_range_ == new_range) - return; - - DCHECK(frame_selection_->GetDocument().GetLayoutView()->GetFrameView()); - DCHECK(!frame_selection_->GetDocument().NeedsLayoutTreeUpdate()); - +// Set SetSelectionState and ShouldInvalidateSelection flag of LayoutObjects +// comparing them in |new_range| and |old_range|. +static void UpdateLayoutObjectState(const SelectionPaintRange& new_range, + const SelectionPaintRange& old_range) { SelectedMap old_selected_map = - CollectSelectedMap(paint_range_, block_paint_invalidation_mode); + CollectSelectedMap(old_range, CollectSelectedMapOption::kCollectBlock); // Now clear the selection. for (auto layout_object : old_selected_map.object_map.Keys()) @@ -248,7 +242,7 @@ // SelectionState, it's just more convenient to have it use the same data // structure as |old_selected_map|. SelectedMap new_selected_map = - CollectSelectedMap(new_range, kPaintInvalidationNewXOROld); + CollectSelectedMap(new_range, CollectSelectedMapOption::kCollectBlock); // Have any of the old selected objects changed compared to the new selection? for (const auto& pair : old_selected_map.object_map) { @@ -257,9 +251,9 @@ SelectionState old_selection_state = pair.value; if (new_selection_state != old_selection_state || (new_range.StartLayoutObject() == obj && - new_range.StartOffset() != paint_range_.StartOffset()) || + new_range.StartOffset() != old_range.StartOffset()) || (new_range.EndLayoutObject() == obj && - new_range.EndOffset() != paint_range_.EndOffset())) { + new_range.EndOffset() != old_range.EndOffset())) { obj->SetShouldInvalidateSelection(); new_selected_map.object_map.erase(obj); } @@ -285,8 +279,6 @@ // they need to be updated. for (auto layout_object : new_selected_map.block_map.Keys()) layout_object->SetShouldInvalidateSelection(); - - paint_range_ = new_range; } std::pair<int, int> LayoutSelection::SelectionStartEnd() { @@ -306,8 +298,8 @@ if (paint_range_.IsNull()) return; - const SelectedMap& old_selected_map = - CollectSelectedMap(paint_range_, kPaintInvalidationNewMinusOld); + const SelectedMap& old_selected_map = CollectSelectedMap( + paint_range_, CollectSelectedMapOption::kNotCollectBlock); // Clear SelectionState and invalidation. for (auto layout_object : old_selected_map.object_map.Keys()) { const SelectionState old_state = layout_object->GetSelectionState(); @@ -369,9 +361,18 @@ if (!start_layout_object || !end_layout_object) return; DCHECK(start_layout_object->View() == end_layout_object->View()); - SetSelection( - SelectionPaintRange(start_layout_object, start_pos.ComputeEditingOffset(), - end_layout_object, end_pos.ComputeEditingOffset())); + + const SelectionPaintRange new_range( + start_layout_object, start_pos.ComputeEditingOffset(), end_layout_object, + end_pos.ComputeEditingOffset()); + // Just return if the selection hasn't changed. + if (paint_range_ == new_range) + return; + + DCHECK(frame_selection_->GetDocument().GetLayoutView()->GetFrameView()); + DCHECK(!frame_selection_->GetDocument().NeedsLayoutTreeUpdate()); + UpdateLayoutObjectState(new_range, paint_range_); + paint_range_ = new_range; } void LayoutSelection::OnDocumentShutdown() {
diff --git a/third_party/WebKit/Source/core/editing/LayoutSelection.h b/third_party/WebKit/Source/core/editing/LayoutSelection.h index 7005099..2532756 100644 --- a/third_party/WebKit/Source/core/editing/LayoutSelection.h +++ b/third_party/WebKit/Source/core/editing/LayoutSelection.h
@@ -78,13 +78,7 @@ IntRect SelectionBounds(); void InvalidatePaintForSelection(); - enum SelectionPaintInvalidationMode { - kPaintInvalidationNewXOROld, - kPaintInvalidationNewMinusOld - }; - void SetSelection( - const SelectionPaintRange&, - SelectionPaintInvalidationMode = kPaintInvalidationNewXOROld); + void ClearSelection(); std::pair<int, int> SelectionStartEnd(); void OnDocumentShutdown();
diff --git a/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp b/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp index 2fe453e..2368499c4 100644 --- a/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp +++ b/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp
@@ -28,7 +28,7 @@ #include "core/editing/iterators/TextIterator.h" #include <unicode/utf16.h> -#include "bindings/core/v8/ExceptionState.h" +//#include "bindings/core/v8/ExceptionState.h" #include "core/HTMLNames.h" #include "core/InputTypeNames.h" #include "core/dom/Document.h" @@ -38,7 +38,6 @@ #include "core/editing/Position.h" #include "core/editing/VisiblePosition.h" #include "core/editing/VisibleUnits.h" -#include "core/editing/iterators/CharacterIterator.h" #include "core/frame/LocalFrameView.h" #include "core/frame/UseCounter.h" #include "core/html/HTMLElement.h" @@ -48,7 +47,6 @@ #include "core/layout/LayoutTableCell.h" #include "core/layout/LayoutTableRow.h" #include "platform/fonts/Font.h" -#include "platform/wtf/text/CString.h" #include "platform/wtf/text/StringBuilder.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/exported/BUILD.gn b/third_party/WebKit/Source/core/exported/BUILD.gn index fdc5c0ee..7d9563e5 100644 --- a/third_party/WebKit/Source/core/exported/BUILD.gn +++ b/third_party/WebKit/Source/core/exported/BUILD.gn
@@ -21,6 +21,8 @@ "WebDataSourceImpl.cpp", "WebDataSourceImpl.h", "WebDateTimeSuggestion.cpp", + "WebFactory.cpp", + "WebFactory.h", "WebFileChooserCompletionImpl.cpp", "WebFileChooserCompletionImpl.h", "WebHeap.cpp",
diff --git a/third_party/WebKit/Source/core/exported/WebFactory.cpp b/third_party/WebKit/Source/core/exported/WebFactory.cpp new file mode 100644 index 0000000..5b0df7f --- /dev/null +++ b/third_party/WebKit/Source/core/exported/WebFactory.cpp
@@ -0,0 +1,22 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "core/exported/WebFactory.h" +#include "platform/wtf/Assertions.h" + +namespace blink { + +WebFactory* WebFactory::factory_instance_ = nullptr; + +WebFactory& WebFactory::GetInstance() { + DCHECK(factory_instance_); + return *factory_instance_; +} + +void WebFactory::SetInstance(WebFactory& factory) { + DCHECK_EQ(nullptr, factory_instance_); + factory_instance_ = &factory; +} + +} // namespace blink
diff --git a/third_party/WebKit/Source/core/exported/WebFactory.h b/third_party/WebKit/Source/core/exported/WebFactory.h new file mode 100644 index 0000000..49a4385 --- /dev/null +++ b/third_party/WebKit/Source/core/exported/WebFactory.h
@@ -0,0 +1,37 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WebFactory_h +#define WebFactory_h + +#include "core/CoreExport.h" +#include "public/platform/WebPageVisibilityState.h" + +namespace blink { + +class ChromeClient; +class WebViewBase; +class WebViewClient; + +// WebFactory is a temporary class implemented in web/ that allows classes to +// construct interfaces that are being moved out of web/. +// This class will be removed once all implementations are in core/ or modules/. +class CORE_EXPORT WebFactory { + public: + // Takes ownership of |factory|. + // TODO(sashab): Make this method private to WebKit.cpp. + static void SetInstance(WebFactory&); + static WebFactory& GetInstance(); + + virtual ChromeClient* CreateChromeClient(WebViewBase*) const = 0; + virtual WebViewBase* CreateWebViewBase(WebViewClient*, + WebPageVisibilityState) const = 0; + + private: + static WebFactory* factory_instance_; +}; + +} // namespace blink + +#endif
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.cpp b/third_party/WebKit/Source/core/style/ComputedStyle.cpp index ded0880d..3e9803db 100644 --- a/third_party/WebKit/Source/core/style/ComputedStyle.cpp +++ b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
@@ -2198,10 +2198,6 @@ return TextEmphasisMark::kSesame; } -Color ComputedStyle::InitialTapHighlightColor() { - return LayoutTheme::TapHighlightColor(); -} - const FilterOperations& ComputedStyle::InitialFilter() { DEFINE_STATIC_LOCAL(FilterOperationsWrapper, ops, (FilterOperationsWrapper::Create()));
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.h b/third_party/WebKit/Source/core/style/ComputedStyle.h index 0f044fd..5c025eb3 100644 --- a/third_party/WebKit/Source/core/style/ComputedStyle.h +++ b/third_party/WebKit/Source/core/style/ComputedStyle.h
@@ -1442,7 +1442,8 @@ SET_VAR(rare_non_inherited_data_, page_size_, s); } void SetPageSizeType(PageSizeType t) { - SET_VAR(rare_non_inherited_data_, page_size_type_, t); + SET_VAR(rare_non_inherited_data_, page_size_type_, + static_cast<unsigned>(t)); } // Text decoration properties. @@ -1723,7 +1724,7 @@ // text-orientation (aka -webkit-text-orientation, -epub-text-orientation) static TextOrientation InitialTextOrientation() { - return kTextOrientationMixed; + return TextOrientation::kMixed; } TextOrientation GetTextOrientation() const { return static_cast<TextOrientation>( @@ -1751,15 +1752,6 @@ SET_VAR(rare_inherited_data_, text_size_adjust_, size_adjust); } - // word-break inherited (aka -epub-word-break) - static EWordBreak InitialWordBreak() { return EWordBreak::kNormal; } - EWordBreak WordBreak() const { - return static_cast<EWordBreak>(rare_inherited_data_->word_break_); - } - void SetWordBreak(EWordBreak b) { - SET_VAR(rare_inherited_data_, word_break_, static_cast<unsigned>(b)); - } - // -webkit-line-break static LineBreak InitialLineBreak() { return LineBreak::kAuto; } LineBreak GetLineBreak() const { @@ -1839,15 +1831,6 @@ static_cast<unsigned>(position)); } - // -webkit-tap-highlight-color - static Color InitialTapHighlightColor(); - Color TapHighlightColor() const { - return rare_inherited_data_->tap_highlight_color_; - } - void SetTapHighlightColor(const Color& c) { - SET_VAR(rare_inherited_data_, tap_highlight_color_, c); - } - // -webkit-text-fill-color void SetTextFillColor(const StyleColor& color) { SET_VAR(rare_inherited_data_, text_fill_color_, color.Resolve(Color())); @@ -1855,16 +1838,6 @@ color.IsCurrentColor()); } - // -webkit-text-security - static ETextSecurity InitialTextSecurity() { return ETextSecurity::kNone; } - ETextSecurity TextSecurity() const { - return static_cast<ETextSecurity>(rare_inherited_data_->text_security_); - } - void SetTextSecurity(ETextSecurity a_text_security) { - SET_VAR(rare_inherited_data_, text_security_, - static_cast<unsigned>(a_text_security)); - } - // -webkit-text-stroke-color void SetTextStrokeColor(const StyleColor& color) { SET_VAR(rare_inherited_data_, text_stroke_color_, color.Resolve(Color())); @@ -1872,15 +1845,6 @@ color.IsCurrentColor()); } - // -webkit-text-stroke-width - static float InitialTextStrokeWidth() { return 0; } - float TextStrokeWidth() const { - return rare_inherited_data_->text_stroke_width_; - } - void SetTextStrokeWidth(float w) { - SET_VAR(rare_inherited_data_, text_stroke_width_, w); - } - // -webkit-user-drag static EUserDrag InitialUserDrag() { return DRAG_AUTO; } EUserDrag UserDrag() const { @@ -3009,7 +2973,8 @@ // Page size utility functions. void ResetPageSizeType() { - SET_VAR(rare_non_inherited_data_, page_size_type_, PAGE_SIZE_AUTO); + SET_VAR(rare_non_inherited_data_, page_size_type_, + static_cast<unsigned>(PageSizeType::kAuto)); } // Outline utility functions. @@ -3738,10 +3703,12 @@ inline bool ComputedStyle::SetTextOrientation( TextOrientation text_orientation) { - if (compareEqual(rare_inherited_data_->text_orientation_, text_orientation)) + if (compareEqual(rare_inherited_data_->text_orientation_, + static_cast<unsigned>(text_orientation))) return false; - rare_inherited_data_.Access()->text_orientation_ = text_orientation; + rare_inherited_data_.Access()->text_orientation_ = + static_cast<unsigned>(text_orientation); return true; }
diff --git a/third_party/WebKit/Source/core/style/ComputedStyleConstants.h b/third_party/WebKit/Source/core/style/ComputedStyleConstants.h index 8558fe23..b4c83ff 100644 --- a/third_party/WebKit/Source/core/style/ComputedStyleConstants.h +++ b/third_party/WebKit/Source/core/style/ComputedStyleConstants.h
@@ -290,11 +290,7 @@ enum class TextEmphasisPosition { kOver, kUnder }; -enum TextOrientation { - kTextOrientationMixed, - kTextOrientationUpright, - kTextOrientationSideways -}; +enum class TextOrientation { kMixed, kUpright, kSideways }; enum TextOverflow { kTextOverflowClip = 0, kTextOverflowEllipsis };
diff --git a/third_party/WebKit/Source/core/style/StyleRareNonInheritedData.cpp b/third_party/WebKit/Source/core/style/StyleRareNonInheritedData.cpp index b35cf74..5a43faa 100644 --- a/third_party/WebKit/Source/core/style/StyleRareNonInheritedData.cpp +++ b/third_party/WebKit/Source/core/style/StyleRareNonInheritedData.cpp
@@ -100,7 +100,7 @@ justify_content_(ComputedStyle::InitialContentAlignment()), justify_items_(ComputedStyle::InitialSelfAlignment()), justify_self_(ComputedStyle::InitialSelfAlignment()), - page_size_type_(PAGE_SIZE_AUTO), + page_size_type_(static_cast<unsigned>(PageSizeType::kAuto)), transform_style3d_(ComputedStyle::InitialTransformStyle3D()), backface_visibility_(ComputedStyle::InitialBackfaceVisibility()), user_drag(ComputedStyle::InitialUserDrag()),
diff --git a/third_party/WebKit/Source/core/style/StyleRareNonInheritedData.h b/third_party/WebKit/Source/core/style/StyleRareNonInheritedData.h index 03c4febe..a2663e0d 100644 --- a/third_party/WebKit/Source/core/style/StyleRareNonInheritedData.h +++ b/third_party/WebKit/Source/core/style/StyleRareNonInheritedData.h
@@ -66,12 +66,12 @@ // Page size type. // StyleRareNonInheritedData::page_size_ is meaningful only when -// StyleRareNonInheritedData::page_size_type_ is PAGE_SIZE_RESOLVED. -enum PageSizeType { - PAGE_SIZE_AUTO, // size: auto - PAGE_SIZE_AUTO_LANDSCAPE, // size: landscape - PAGE_SIZE_AUTO_PORTRAIT, // size: portrait - PAGE_SIZE_RESOLVED // Size is fully resolved. +// StyleRareNonInheritedData::page_size_type_ is kResolved. +enum class PageSizeType { + kAuto, // size: auto + kLandscape, // size: landscape + kPortrait, // size: portrait + kResolved // Size is fully resolved. }; // This struct is for rarely used non-inherited CSS3, CSS2, and WebKit-specific
diff --git a/third_party/WebKit/Source/core/workers/MainThreadWorklet.cpp b/third_party/WebKit/Source/core/workers/MainThreadWorklet.cpp index cdec9960..3f5a977 100644 --- a/third_party/WebKit/Source/core/workers/MainThreadWorklet.cpp +++ b/third_party/WebKit/Source/core/workers/MainThreadWorklet.cpp
@@ -7,9 +7,11 @@ #include "bindings/core/v8/ScriptPromiseResolver.h" #include "bindings/core/v8/ScriptSourceCode.h" #include "bindings/core/v8/V8BindingForCore.h" +#include "core/dom/TaskRunnerHelper.h" #include "core/frame/LocalFrame.h" #include "core/workers/WorkletGlobalScopeProxy.h" #include "core/workers/WorkletPendingTasks.h" +#include "platform/WebTaskRunner.h" #include "platform/wtf/WTF.h" #include "public/platform/WebURLRequest.h" @@ -56,9 +58,12 @@ ParseCredentialsOption(options.credentials()); // Step 7: "Let outsideSettings be the relevant settings object of this." - // TODO(nhiroki): outsideSettings will be used for posting a task to the - // document's responsible event loop. We could use a task runner for the - // purpose. + // In the specification, outsideSettings is used for posting a task to the + // document's responsible event loop. In our implementation, we use the + // document's UnspecedLoading task runner as that is what we commonly use for + // module loading. + RefPtr<WebTaskRunner> outside_settings_task_runner = + TaskRunnerHelper::Get(TaskType::kUnspecedLoading, GetExecutionContext()); // Step 8: "Let moduleResponsesMap be worklet's module responses map." // TODO(nhiroki): Implement moduleResponsesMap (https://crbug.com/627945). @@ -91,7 +96,7 @@ // TODO(nhiroki): Queue a task instead of executing this here. for (const auto& proxy : proxies_) { proxy->FetchAndInvokeScript(module_url_record, credentials_mode, - pending_tasks); + outside_settings_task_runner, pending_tasks); } }
diff --git a/third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.cpp b/third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.cpp index 0ab17599..d2e7baf 100644 --- a/third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.cpp +++ b/third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.cpp
@@ -56,6 +56,7 @@ void MainThreadWorkletGlobalScope::FetchAndInvokeScript( const KURL& module_url_record, WebURLRequest::FetchCredentialsMode credentials_mode, + RefPtr<WebTaskRunner> outside_settings_task_runner, WorkletPendingTasks* pending_tasks) { DCHECK(IsMainThread()); // Step 1: "Let insideSettings be the workletGlobalScope's associated @@ -71,8 +72,8 @@ // Step 3 to 5 are implemented in // WorkletModuleTreeClient::NotifyModuleTreeLoadFinished. - WorkletModuleTreeClient* client = - new WorkletModuleTreeClient(modulator, pending_tasks); + WorkletModuleTreeClient* client = new WorkletModuleTreeClient( + modulator, std::move(outside_settings_task_runner), pending_tasks); modulator->FetchTree(module_request, client); }
diff --git a/third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.h b/third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.h index 7c5ffaeb..0401d387 100644 --- a/third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.h +++ b/third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.h
@@ -10,6 +10,7 @@ #include "core/dom/ExecutionContext.h" #include "core/workers/WorkletGlobalScope.h" #include "core/workers/WorkletPendingTasks.h" +#include "platform/WebTaskRunner.h" #include "public/platform/WebURLRequest.h" namespace blink { @@ -36,9 +37,16 @@ void ReportDeprecation(UseCounter::Feature) override; WorkerThread* GetThread() const final; + // Implementation of the "fetch and invoke a worklet script" algorithm: + // https://drafts.css-houdini.org/worklets/#fetch-and-invoke-a-worklet-script + // When script evaluation is done or any exception happens, it's notified to + // the given WorkletPendingTasks via |outside_settings_task_runner| (i.e., the + // parent frame's task runner). void FetchAndInvokeScript(const KURL& module_url_record, WebURLRequest::FetchCredentialsMode, + RefPtr<WebTaskRunner> outside_settings_task_runner, WorkletPendingTasks*); + void Terminate(); // ExecutionContext
diff --git a/third_party/WebKit/Source/core/workers/ThreadedWorklet.cpp b/third_party/WebKit/Source/core/workers/ThreadedWorklet.cpp index 7ebd858..06b37398 100644 --- a/third_party/WebKit/Source/core/workers/ThreadedWorklet.cpp +++ b/third_party/WebKit/Source/core/workers/ThreadedWorklet.cpp
@@ -15,8 +15,7 @@ namespace blink { -ThreadedWorklet::ThreadedWorklet(LocalFrame* frame) - : Worklet(frame), frame_(frame) {} +ThreadedWorklet::ThreadedWorklet(LocalFrame* frame) : Worklet(frame) {} void ThreadedWorklet::FetchAndInvokeScript(const KURL& module_url_record, const WorkletOptions&, @@ -28,8 +27,8 @@ if (!IsInitialized()) Initialize(); - WorkletScriptLoader* script_loader = - WorkletScriptLoader::Create(frame_->GetDocument()->Fetcher(), this); + WorkletScriptLoader* script_loader = WorkletScriptLoader::Create( + ToDocument(GetExecutionContext())->Fetcher(), this); loader_to_resolver_map_.Set(script_loader, resolver); script_loader->FetchScript(module_url_record); } @@ -57,11 +56,9 @@ loader_to_resolver_map_.clear(); if (IsInitialized()) GetWorkletGlobalScopeProxy()->TerminateWorkletGlobalScope(); - frame_ = nullptr; } DEFINE_TRACE(ThreadedWorklet) { - visitor->Trace(frame_); visitor->Trace(loader_to_resolver_map_); Worklet::Trace(visitor); }
diff --git a/third_party/WebKit/Source/core/workers/ThreadedWorklet.h b/third_party/WebKit/Source/core/workers/ThreadedWorklet.h index b41a955..e7a2921 100644 --- a/third_party/WebKit/Source/core/workers/ThreadedWorklet.h +++ b/third_party/WebKit/Source/core/workers/ThreadedWorklet.h
@@ -55,8 +55,6 @@ virtual void Initialize() = 0; virtual bool IsInitialized() const = 0; - Member<LocalFrame> frame_; - HeapHashMap<Member<WorkletScriptLoader>, Member<ScriptPromiseResolver>> loader_to_resolver_map_; };
diff --git a/third_party/WebKit/Source/core/workers/WorkletGlobalScopeProxy.h b/third_party/WebKit/Source/core/workers/WorkletGlobalScopeProxy.h index e651dda..5fd7dec77 100644 --- a/third_party/WebKit/Source/core/workers/WorkletGlobalScopeProxy.h +++ b/third_party/WebKit/Source/core/workers/WorkletGlobalScopeProxy.h
@@ -6,6 +6,7 @@ #define WorkletGlobalScopeProxy_h #include "core/CoreExport.h" +#include "platform/WebTaskRunner.h" #include "platform/weborigin/KURL.h" #include "public/platform/WebURLRequest.h" @@ -23,9 +24,11 @@ // Runs the "fetch and invoke a worklet script" algorithm: // https://drafts.css-houdini.org/worklets/#fetch-and-invoke-a-worklet-script - virtual void FetchAndInvokeScript(const KURL& module_url_record, - WebURLRequest::FetchCredentialsMode, - WorkletPendingTasks*) {} + virtual void FetchAndInvokeScript( + const KURL& module_url_record, + WebURLRequest::FetchCredentialsMode, + RefPtr<WebTaskRunner> outside_settings_task_runner, + WorkletPendingTasks*) {} // Evaluates the given script source code. This should be called only for // threaded worklets that still use classic script loading.
diff --git a/third_party/WebKit/Source/core/workers/WorkletModuleTreeClient.cpp b/third_party/WebKit/Source/core/workers/WorkletModuleTreeClient.cpp index 829ecd5..36be131 100644 --- a/third_party/WebKit/Source/core/workers/WorkletModuleTreeClient.cpp +++ b/third_party/WebKit/Source/core/workers/WorkletModuleTreeClient.cpp
@@ -5,26 +5,32 @@ #include "core/workers/WorkletModuleTreeClient.h" #include "core/dom/ModuleScript.h" +#include "core/dom/TaskRunnerHelper.h" +#include "platform/CrossThreadFunctional.h" namespace blink { WorkletModuleTreeClient::WorkletModuleTreeClient( Modulator* modulator, + RefPtr<WebTaskRunner> outside_settings_task_runner, WorkletPendingTasks* pending_tasks) - : modulator_(modulator), pending_tasks_(pending_tasks) {} + : modulator_(modulator), + outside_settings_task_runner_(std::move(outside_settings_task_runner)), + pending_tasks_(pending_tasks) {} // Implementation of the second half of the "fetch and invoke a worklet script" // algorithm: // https://drafts.css-houdini.org/worklets/#fetch-and-invoke-a-worklet-script void WorkletModuleTreeClient::NotifyModuleTreeLoadFinished( ModuleScript* module_script) { - DCHECK(IsMainThread()); if (!module_script) { // Step 3: "If script is null, then queue a task on outsideSettings's // responsible event loop to run these steps:" // The steps are implemented in WorkletPendingTasks::Abort(). - // TODO(nhiroki): Queue a task instead of executing this here. - pending_tasks_->Abort(); + outside_settings_task_runner_->PostTask( + BLINK_FROM_HERE, + CrossThreadBind(&WorkletPendingTasks::Abort, + WrapCrossThreadPersistent(pending_tasks_.Get()))); return; } @@ -34,13 +40,14 @@ // Step 5: "Queue a task on outsideSettings's responsible event loop to run // these steps:" // The steps are implemented in WorkletPendingTasks::DecrementCounter(). - // TODO(nhiroki): Queue a task instead of executing this here. - pending_tasks_->DecrementCounter(); + outside_settings_task_runner_->PostTask( + BLINK_FROM_HERE, + CrossThreadBind(&WorkletPendingTasks::DecrementCounter, + WrapCrossThreadPersistent(pending_tasks_.Get()))); }; DEFINE_TRACE(WorkletModuleTreeClient) { visitor->Trace(modulator_); - visitor->Trace(pending_tasks_); ModuleTreeClient::Trace(visitor); }
diff --git a/third_party/WebKit/Source/core/workers/WorkletModuleTreeClient.h b/third_party/WebKit/Source/core/workers/WorkletModuleTreeClient.h index 0329ee87..64c1076 100644 --- a/third_party/WebKit/Source/core/workers/WorkletModuleTreeClient.h +++ b/third_party/WebKit/Source/core/workers/WorkletModuleTreeClient.h
@@ -4,19 +4,23 @@ #include "core/dom/Modulator.h" #include "core/workers/WorkletPendingTasks.h" +#include "platform/WebTaskRunner.h" #include "platform/heap/GarbageCollected.h" namespace blink { class ModuleScript; +// A ModuleTreeClient that lives on the worklet context's thread. class WorkletModuleTreeClient final : public GarbageCollectedFinalized<WorkletModuleTreeClient>, public ModuleTreeClient { USING_GARBAGE_COLLECTED_MIXIN(WorkletModuleTreeClient); public: - WorkletModuleTreeClient(Modulator*, WorkletPendingTasks*); + WorkletModuleTreeClient(Modulator*, + RefPtr<WebTaskRunner> outside_settings_task_runner, + WorkletPendingTasks*); // Implements ModuleTreeClient. void NotifyModuleTreeLoadFinished(ModuleScript*) final; @@ -25,7 +29,8 @@ private: Member<Modulator> modulator_; - Member<WorkletPendingTasks> pending_tasks_; + RefPtr<WebTaskRunner> outside_settings_task_runner_; + CrossThreadPersistent<WorkletPendingTasks> pending_tasks_; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScopeProxy.cpp b/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScopeProxy.cpp index 39c89dd..5a047fb 100644 --- a/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScopeProxy.cpp +++ b/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScopeProxy.cpp
@@ -32,9 +32,11 @@ void PaintWorkletGlobalScopeProxy::FetchAndInvokeScript( const KURL& module_url_record, WebURLRequest::FetchCredentialsMode credentials_mode, + RefPtr<WebTaskRunner> outside_settings_task_runner, WorkletPendingTasks* pending_tasks) { DCHECK(IsMainThread()); global_scope_->FetchAndInvokeScript(module_url_record, credentials_mode, + std::move(outside_settings_task_runner), pending_tasks); }
diff --git a/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScopeProxy.h b/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScopeProxy.h index 486c9369..f79293f 100644 --- a/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScopeProxy.h +++ b/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScopeProxy.h
@@ -28,6 +28,7 @@ // Implements WorkletGlobalScopeProxy. void FetchAndInvokeScript(const KURL& module_url_record, WebURLRequest::FetchCredentialsMode, + RefPtr<WebTaskRunner> outside_settings_task_runner, WorkletPendingTasks*) override; void EvaluateScript(const ScriptSourceCode&) override; void TerminateWorkletGlobalScope() override;
diff --git a/third_party/WebKit/Source/platform/bindings/ActiveScriptWrappable.h b/third_party/WebKit/Source/platform/bindings/ActiveScriptWrappable.h index fc724191..a64104af 100644 --- a/third_party/WebKit/Source/platform/bindings/ActiveScriptWrappable.h +++ b/third_party/WebKit/Source/platform/bindings/ActiveScriptWrappable.h
@@ -55,7 +55,7 @@ bool DispatchHasPendingActivity( ActiveScriptWrappableBase* object) const final { - return static_cast<T*>(object)->T::HasPendingActivity(); + return static_cast<T*>(object)->HasPendingActivity(); } ScriptWrappable* ToScriptWrappable(
diff --git a/third_party/WebKit/Source/web/BUILD.gn b/third_party/WebKit/Source/web/BUILD.gn index 674a8a04..c990fde 100644 --- a/third_party/WebKit/Source/web/BUILD.gn +++ b/third_party/WebKit/Source/web/BUILD.gn
@@ -124,6 +124,8 @@ "WebEmbeddedWorkerImpl.cpp", "WebEmbeddedWorkerImpl.h", "WebExport.h", + "WebFactoryImpl.cpp", + "WebFactoryImpl.h", "WebFormControlElement.cpp", "WebFormElement.cpp", "WebFormElementObserverImpl.cpp",
diff --git a/third_party/WebKit/Source/web/WebFactoryImpl.cpp b/third_party/WebKit/Source/web/WebFactoryImpl.cpp new file mode 100644 index 0000000..5d76ce5a --- /dev/null +++ b/third_party/WebKit/Source/web/WebFactoryImpl.cpp
@@ -0,0 +1,20 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "web/WebFactoryImpl.h" +#include "web/ChromeClientImpl.h" +#include "web/WebViewImpl.h" + +namespace blink { + +ChromeClient* WebFactoryImpl::CreateChromeClient(WebViewBase* view) const { + return ChromeClientImpl::Create(view); +} + +WebViewBase* WebFactoryImpl::CreateWebViewBase( + WebViewClient* client, + WebPageVisibilityState state) const { + return WebViewImpl::Create(client, state); +} +}
diff --git a/third_party/WebKit/Source/web/WebFactoryImpl.h b/third_party/WebKit/Source/web/WebFactoryImpl.h new file mode 100644 index 0000000..a341ce83 --- /dev/null +++ b/third_party/WebKit/Source/web/WebFactoryImpl.h
@@ -0,0 +1,24 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WebFactoryImpl_h +#define WebFactoryImpl_h + +#include "core/exported/WebFactory.h" + +namespace blink { + +class WebFactoryImpl : public WebFactory { + public: + WebFactoryImpl() {} + ~WebFactoryImpl() {} + + ChromeClient* CreateChromeClient(WebViewBase*) const override; + WebViewBase* CreateWebViewBase(WebViewClient*, + WebPageVisibilityState) const override; +}; + +} // namespace blink + +#endif
diff --git a/third_party/WebKit/Source/web/WebKit.cpp b/third_party/WebKit/Source/web/WebKit.cpp index e87484f4..b988a098 100644 --- a/third_party/WebKit/Source/web/WebKit.cpp +++ b/third_party/WebKit/Source/web/WebKit.cpp
@@ -53,6 +53,7 @@ #include "public/platform/Platform.h" #include "public/platform/WebThread.h" #include "v8/include/v8.h" +#include "web/WebFactoryImpl.h" namespace blink { @@ -84,6 +85,8 @@ GetModulesInitializer().Initialize(); + WebFactory::SetInstance(*(new WebFactoryImpl())); + // currentThread is null if we are running on a thread without a message loop. if (WebThread* current_thread = platform->CurrentThread()) { DCHECK(!g_end_of_task_runner);
diff --git a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp index 799dfe4..351cab7 100644 --- a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp +++ b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
@@ -1173,17 +1173,22 @@ bool WebLocalFrameImpl::SelectWordAroundCaret() { TRACE_EVENT0("blink", "WebLocalFrameImpl::selectWordAroundCaret"); + FrameSelection& selection = GetFrame()->Selection(); - if (selection.ComputeVisibleSelectionInDOMTreeDeprecated().IsNone() || - selection.ComputeVisibleSelectionInDOMTreeDeprecated().IsRange()) - return false; // TODO(editing-dev): The use of updateStyleAndLayoutIgnorePendingStylesheets // needs to be audited. see http://crbug.com/590369 for more details. GetFrame()->GetDocument()->UpdateStyleAndLayoutIgnorePendingStylesheets(); + // TODO(editing-dev): The use of VisibleSelection needs to be audited. See + // http://crbug.com/657237 for more details. + if (selection.ComputeVisibleSelectionInDOMTree().IsNone() || + selection.ComputeVisibleSelectionInDOMTree().IsRange()) { + return false; + } + return GetFrame()->Selection().SelectWordAroundPosition( - selection.ComputeVisibleSelectionInDOMTreeDeprecated().VisibleStart()); + selection.ComputeVisibleSelectionInDOMTree().VisibleStart()); } void WebLocalFrameImpl::SelectRange(const WebPoint& base_in_viewport, @@ -1445,7 +1450,7 @@ return GetFrame() ->GetDocument() ->StyleForPage(page_index) - ->GetPageSizeType() != PAGE_SIZE_AUTO; + ->GetPageSizeType() != PageSizeType::kAuto; } bool WebLocalFrameImpl::IsPageBoxVisible(int page_index) {
diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp index f7feb39e..ef1f8a5 100644 --- a/third_party/WebKit/Source/web/WebViewImpl.cpp +++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
@@ -52,6 +52,7 @@ #include "core/events/UIEventWithKeyState.h" #include "core/events/WebInputEventConversion.h" #include "core/events/WheelEvent.h" +#include "core/exported/WebFactory.h" #include "core/exported/WebPluginContainerBase.h" #include "core/frame/BrowserControls.h" #include "core/frame/EventHandlerRegistry.h" @@ -337,7 +338,7 @@ WebPageVisibilityState visibility_state) : client_(client), spell_check_client_(nullptr), - chrome_client_impl_(ChromeClientImpl::Create(this)), + chrome_client_(WebFactory::GetInstance().CreateChromeClient(this)), context_menu_client_impl_(this), editor_client_impl_(this), spell_checker_client_impl_(this), @@ -386,7 +387,7 @@ last_frame_time_monotonic_(0), override_compositor_visibility_(false) { Page::PageClients page_clients; - page_clients.chrome_client = chrome_client_impl_.Get(); + page_clients.chrome_client = chrome_client_.Get(); page_clients.context_menu_client = &context_menu_client_impl_; page_clients.editor_client = &editor_client_impl_; page_clients.spell_checker_client = &spell_checker_client_impl_;
diff --git a/third_party/WebKit/Source/web/WebViewImpl.h b/third_party/WebKit/Source/web/WebViewImpl.h index b3cfc49..0d2ef17 100644 --- a/third_party/WebKit/Source/web/WebViewImpl.h +++ b/third_party/WebKit/Source/web/WebViewImpl.h
@@ -34,6 +34,7 @@ #include <memory> #include "core/exported/WebViewBase.h" #include "core/frame/ResizeViewportAnchor.h" +#include "core/page/ChromeClient.h" #include "core/page/ContextMenuProvider.h" #include "core/page/EventWithHitTestResults.h" #include "platform/animation/CompositorAnimationTimeline.h" @@ -60,7 +61,6 @@ #include "public/platform/WebVector.h" #include "public/web/WebNavigationPolicy.h" #include "public/web/WebPageImportanceSignals.h" -#include "web/ChromeClientImpl.h" #include "web/ContextMenuClientImpl.h" #include "web/EditorClientImpl.h" #include "web/MediaKeysClientImpl.h" @@ -497,7 +497,7 @@ } class ChromeClient& ChromeClient() const override { - return *chrome_client_impl_.Get(); + return *chrome_client_.Get(); } // Returns the currently active WebInputMethodController which is the one @@ -603,7 +603,9 @@ WebViewClient* client_; // Can be 0 (e.g. unittests, shared workers, etc.) WebSpellCheckClient* spell_check_client_; - Persistent<ChromeClientImpl> chrome_client_impl_; + // ChromeClient needs blink:: qualifier so it doesn't clash with ChromeClient + // method. TODO(sashab): Rename getter to GetChromeClient to fix this. + Persistent<blink::ChromeClient> chrome_client_; ContextMenuClientImpl context_menu_client_impl_; EditorClientImpl editor_client_impl_; SpellCheckerClientImpl spell_checker_client_impl_;
diff --git a/tools/generate_library_loader/generate_library_loader.gni b/tools/generate_library_loader/generate_library_loader.gni index 1e1d5d77..8d025a1 100644 --- a/tools/generate_library_loader/generate_library_loader.gni +++ b/tools/generate_library_loader/generate_library_loader.gni
@@ -30,9 +30,9 @@ "--name", invoker.name, "--output-h", - rebase_path(output_h), + rebase_path(output_h, root_build_dir), "--output-cc", - rebase_path(output_cc), + rebase_path(output_cc, root_build_dir), "--header", invoker.header,
diff --git a/ui/android/java/src/org/chromium/ui/UiUtils.java b/ui/android/java/src/org/chromium/ui/UiUtils.java index cfe14ed..279ff70 100644 --- a/ui/android/java/src/org/chromium/ui/UiUtils.java +++ b/ui/android/java/src/org/chromium/ui/UiUtils.java
@@ -103,6 +103,13 @@ } /** + * Returns whether a photo picker should be called. + */ + public static boolean shouldShowPhotoPicker() { + return sPhotoPickerDelegate != null; + } + + /** * Called to display the photo picker. * @param context The context to use. * @param listener The listener that will be notified of the action the user took in the
diff --git a/ui/android/java/src/org/chromium/ui/base/SelectFileDialog.java b/ui/android/java/src/org/chromium/ui/base/SelectFileDialog.java index 29f9e99..33f99ea 100644 --- a/ui/android/java/src/org/chromium/ui/base/SelectFileDialog.java +++ b/ui/android/java/src/org/chromium/ui/base/SelectFileDialog.java
@@ -156,6 +156,10 @@ && !window.hasPermission(Manifest.permission.RECORD_AUDIO)) { missingPermissions.add(Manifest.permission.RECORD_AUDIO); } + if (UiUtils.shouldShowPhotoPicker() + && !window.hasPermission(Manifest.permission.READ_EXTERNAL_STORAGE)) { + missingPermissions.add(Manifest.permission.READ_EXTERNAL_STORAGE); + } if (missingPermissions.isEmpty()) { launchSelectFileIntent();
diff --git a/ui/ozone/platform/drm/gpu/gbm_surfaceless.cc b/ui/ozone/platform/drm/gpu/gbm_surfaceless.cc index cacd16f..4b4913b 100644 --- a/ui/ozone/platform/drm/gpu/gbm_surfaceless.cc +++ b/ui/ozone/platform/drm/gpu/gbm_surfaceless.cc
@@ -35,7 +35,8 @@ surface_factory_(surface_factory), window_(std::move(window)), widget_(widget), - has_native_fence_sync_(HasEGLExtension("EGL_ANDROID_native_fence_sync")), + has_implicit_external_sync_( + HasEGLExtension("EGL_ARM_implicit_external_sync")), weak_factory_(this) { surface_factory_->RegisterSurface(window_->widget(), this); unsubmitted_frames_.push_back(base::MakeUnique<PendingFrame>()); @@ -113,7 +114,7 @@ // TODO: the following should be replaced by a per surface flush as it gets // implemented in GL drivers. - EGLSyncKHR fence = InsertFence(has_native_fence_sync_); + EGLSyncKHR fence = InsertFence(has_implicit_external_sync_); if (!fence) { callback.Run(gfx::SwapResult::SWAP_FAILED); return; @@ -205,10 +206,12 @@ } } -EGLSyncKHR GbmSurfaceless::InsertFence(bool native) { - return eglCreateSyncKHR( - GetDisplay(), native ? EGL_SYNC_NATIVE_FENCE_ANDROID : EGL_SYNC_FENCE_KHR, - nullptr); +EGLSyncKHR GbmSurfaceless::InsertFence(bool implicit) { + const EGLint attrib_list[] = {EGL_SYNC_CONDITION_KHR, + EGL_SYNC_PRIOR_COMMANDS_IMPLICIT_EXTERNAL_ARM, + EGL_NONE}; + return eglCreateSyncKHR(GetDisplay(), EGL_SYNC_FENCE_KHR, + implicit ? attrib_list : NULL); } void GbmSurfaceless::FenceRetired(EGLSyncKHR fence, PendingFrame* frame) {
diff --git a/ui/ozone/platform/drm/gpu/gbm_surfaceless.h b/ui/ozone/platform/drm/gpu/gbm_surfaceless.h index 1513672..1ec916ca 100644 --- a/ui/ozone/platform/drm/gpu/gbm_surfaceless.h +++ b/ui/ozone/platform/drm/gpu/gbm_surfaceless.h
@@ -76,7 +76,7 @@ void SubmitFrame(); - EGLSyncKHR InsertFence(bool native); + EGLSyncKHR InsertFence(bool implicit); void FenceRetired(EGLSyncKHR fence, PendingFrame* frame); void SwapCompleted(const SwapCompletionCallback& callback, @@ -90,7 +90,7 @@ gfx::AcceleratedWidget widget_; std::unique_ptr<gfx::VSyncProvider> vsync_provider_; std::vector<std::unique_ptr<PendingFrame>> unsubmitted_frames_; - bool has_native_fence_sync_; + bool has_implicit_external_sync_; bool last_swap_buffers_result_ = true; bool swap_buffers_pending_ = false;
diff --git a/ui/vector_icons/vector_icons.gni b/ui/vector_icons/vector_icons.gni index ab5df1aa..f52f7d6 100644 --- a/ui/vector_icons/vector_icons.gni +++ b/ui/vector_icons/vector_icons.gni
@@ -51,7 +51,8 @@ rebase_path(invoker.icons, root_build_dir, invoker.icon_directory) args = [ - "--working_directory=" + rebase_path(invoker.icon_directory), + "--working_directory=" + + rebase_path(invoker.icon_directory, root_build_dir), "--file_list={{response_file_name}}", "--output_cc=" + rebase_path(output_cc, root_build_dir), "--output_h=" + rebase_path(output_h, root_build_dir),