diff --git a/DEPS b/DEPS index 4c628d2..a49600d 100644 --- a/DEPS +++ b/DEPS
@@ -96,7 +96,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling catapult # and whatever else without interference from each other. - 'catapult_revision': '4d4343808af0ecf365e4a789add07c30d17f6b0e', + 'catapult_revision': '20f7e5a41b447908da41782e283038fedb721013', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libFuzzer # and whatever else without interference from each other.
diff --git a/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java b/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java index 490a83f..2cc39b9 100644 --- a/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java +++ b/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java
@@ -329,7 +329,7 @@ private void doNetworkInitializations(Context applicationContext) { if (applicationContext.checkPermission(Manifest.permission.ACCESS_NETWORK_STATE, Process.myPid(), Process.myUid()) == PackageManager.PERMISSION_GRANTED) { - NetworkChangeNotifier.init(applicationContext); + NetworkChangeNotifier.init(); NetworkChangeNotifier.setAutoDetectConnectivityState( new AwNetworkChangeNotifierRegistrationPolicy()); } @@ -645,7 +645,7 @@ } public TokenBindingService getTokenBindingService() { - synchronized (mLock) { + synchronized (mLock) { if (mTokenBindingManager == null) { mTokenBindingManager = new TokenBindingManagerAdapter(this); }
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/ContentViewMiscTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/ContentViewMiscTest.java index afec3f40..926a818d 100644 --- a/android_webview/javatests/src/org/chromium/android_webview/test/ContentViewMiscTest.java +++ b/android_webview/javatests/src/org/chromium/android_webview/test/ContentViewMiscTest.java
@@ -5,16 +5,16 @@ package org.chromium.android_webview.test; import android.content.BroadcastReceiver; -import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.net.Proxy; import android.support.test.filters.SmallTest; -import android.test.mock.MockContext; import org.chromium.android_webview.AwContents; import org.chromium.android_webview.AwContentsStatics; +import org.chromium.base.ContextUtils; import org.chromium.base.annotations.SuppressFBWarnings; +import org.chromium.base.test.util.AdvancedMockContext; import org.chromium.base.test.util.Feature; import org.chromium.content.browser.ContentViewCore; import org.chromium.content.browser.ContentViewStatics; @@ -60,19 +60,15 @@ // Set up mock contexts to use with the listener final AtomicReference<BroadcastReceiver> receiverRef = new AtomicReference<BroadcastReceiver>(); - final MockContext appContext = new MockContext() { + final AdvancedMockContext appContext = new AdvancedMockContext( + getInstrumentation().getTargetContext().getApplicationContext()) { @Override public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter) { receiverRef.set(receiver); return null; } }; - final MockContext context = new MockContext() { - @Override - public Context getApplicationContext() { - return appContext; - } - }; + ContextUtils.initApplicationContextForTests(appContext); // Set up a delegate so we know when native code is about to get // informed of a proxy change. @@ -87,7 +83,7 @@ intent.setAction(Proxy.PROXY_CHANGE_ACTION); // Create the listener that's going to be used for the test - ProxyChangeListener listener = ProxyChangeListener.create(context); + ProxyChangeListener listener = ProxyChangeListener.create(); listener.setDelegateForTesting(delegate); listener.start(0); @@ -95,19 +91,19 @@ // Make sure everything works by default proxyChanged.set(false); - receiverRef.get().onReceive(context, intent); + receiverRef.get().onReceive(appContext, intent); assertEquals(true, proxyChanged.get()); // Now disable platform notifications and make sure we don't notify // native code. proxyChanged.set(false); ContentViewStatics.disablePlatformNotifications(); - receiverRef.get().onReceive(context, intent); + receiverRef.get().onReceive(appContext, intent); assertEquals(false, proxyChanged.get()); // Now re-enable notifications to make sure they work again. ContentViewStatics.enablePlatformNotifications(); - receiverRef.get().onReceive(context, intent); + receiverRef.get().onReceive(appContext, intent); assertEquals(true, proxyChanged.get()); } }
diff --git a/chrome/android/java/res/layout-sw360dp/preference_spinner_single_line.xml b/chrome/android/java/res/layout-sw360dp/preference_spinner_single_line.xml index 56b9db8..3793a52 100644 --- a/chrome/android/java/res/layout-sw360dp/preference_spinner_single_line.xml +++ b/chrome/android/java/res/layout-sw360dp/preference_spinner_single_line.xml
@@ -10,8 +10,9 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" - android:paddingEnd="8dp" - android:paddingTop="22dp"> + android:paddingEnd="@dimen/pref_spinner_padding_end" + android:paddingTop="12dp" + android:paddingBottom="6dp"> <TextView android:id="@+id/title" @@ -26,5 +27,7 @@ android:id="@+id/spinner" android:layout_height="wrap_content" android:layout_width="wrap_content" - android:gravity="end"/> + android:gravity="end" + android:paddingTop="12dp" + android:paddingBottom="12dp"/> </LinearLayout>
diff --git a/chrome/android/java/res/layout/clear_browsing_data_tab_content.xml b/chrome/android/java/res/layout/clear_browsing_data_tab_content.xml index 4da49fd..0c86a45f 100644 --- a/chrome/android/java/res/layout/clear_browsing_data_tab_content.xml +++ b/chrome/android/java/res/layout/clear_browsing_data_tab_content.xml
@@ -27,7 +27,7 @@ android:layout_height="wrap_content" android:padding="8dp" android:minHeight="48dp" - android:layout_marginEnd="8dp" + android:layout_marginEnd="@dimen/clear_browsing_data_button_margin" android:focusable="true" android:text="@string/clear_data_delete" />
diff --git a/chrome/android/java/res/values-sw600dp/dimens.xml b/chrome/android/java/res/values-sw600dp/dimens.xml index 2cb609b..157576b 100644 --- a/chrome/android/java/res/values-sw600dp/dimens.xml +++ b/chrome/android/java/res/values-sw600dp/dimens.xml
@@ -54,4 +54,10 @@ <!-- Search widget dimensions --> <dimen name="search_activity_location_bar_margin_start">0dp</dimen> <dimen name="search_activity_location_bar_margin_end">4dp</dimen> + + <!-- Clear browsing data preferences dimensions --> + <dimen name="clear_browsing_data_button_margin">16dp</dimen> + + <!-- Preferences dimensions --> + <dimen name="pref_spinner_padding_end">16dp</dimen> </resources>
diff --git a/chrome/android/java/res/values/dimens.xml b/chrome/android/java/res/values/dimens.xml index ecd7cd5..abd014c 100644 --- a/chrome/android/java/res/values/dimens.xml +++ b/chrome/android/java/res/values/dimens.xml
@@ -384,6 +384,7 @@ <!-- Clear browsing data preferences dimensions --> <dimen name="clear_browsing_data_checkbox_height">56dp</dimen> + <dimen name="clear_browsing_data_button_margin">8dp</dimen> <!-- Payments UI * payments_section_checking_spacing: @@ -419,6 +420,7 @@ <dimen name="pref_child_account_reduced_padding">4dp</dimen> <dimen name="pref_icon_padding">4.6dp</dimen> + <dimen name="pref_spinner_padding_end">8dp</dimen> <!-- Dialog dimensions. https://www.google.com/design/spec/components/dialogs.html#dialogs-simple-dialogs -->
diff --git a/chrome/android/java/res/xml/clear_browsing_data_preferences_tab.xml b/chrome/android/java/res/xml/clear_browsing_data_preferences_tab.xml index 936298de..62a72a60 100644 --- a/chrome/android/java/res/xml/clear_browsing_data_preferences_tab.xml +++ b/chrome/android/java/res/xml/clear_browsing_data_preferences_tab.xml
@@ -13,7 +13,9 @@ android:title="@string/clear_browsing_data_tab_period_title" chrome:singleLine="true" /> - <Preference android:layout="@layout/divider_preference_with_bottom_padding" /> + <Preference + android:layout="@layout/divider_preference_with_bottom_padding" + android:selectable="false"/> <org.chromium.chrome.browser.preferences.ClearBrowsingDataTabCheckBoxPreference android:key="clear_history_checkbox"
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java index 90534f19..5fe243de 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java
@@ -263,6 +263,7 @@ @VisibleForTesting protected DownloadManagerService(Context context, DownloadNotifier downloadNotifier, Handler handler, long updateDelayInMillis) { + // TODO(wnwen): Remove mContext since it is always the application context. mContext = context; mSharedPrefs = ContextUtils.getAppSharedPreferences(); // Clean up unused shared prefs. TODO(qinmin): remove this after M61. @@ -1478,8 +1479,8 @@ */ private void addAutoResumableDownload(String guid) { if (mAutoResumableDownloadIds.isEmpty() && !sIsNetworkListenerDisabled) { - mNetworkChangeNotifier = new NetworkChangeNotifierAutoDetect(this, mContext, - new RegistrationPolicyAlwaysRegister()); + mNetworkChangeNotifier = new NetworkChangeNotifierAutoDetect( + this, new RegistrationPolicyAlwaysRegister()); } if (!mAutoResumableDownloadIds.contains(guid)) { mAutoResumableDownloadIds.add(guid);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeBrowserInitializer.java b/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeBrowserInitializer.java index e7dc6c8c..c83111b 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeBrowserInitializer.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeBrowserInitializer.java
@@ -385,7 +385,7 @@ ThreadUtils.assertOnUiThread(); TraceEvent.begin("NetworkChangeNotifier.init"); // Enable auto-detection of network connectivity state changes. - NetworkChangeNotifier.init(context); + NetworkChangeNotifier.init(); NetworkChangeNotifier.setAutoDetectConnectivityState(true); TraceEvent.end("NetworkChangeNotifier.init"); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/ChildNode.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/ChildNode.java index c563034..83c4d21 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/ChildNode.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/ChildNode.java
@@ -66,6 +66,12 @@ notifyItemRangeChanged(index, 1, callback); } + /** + * @deprecated Change notifications without payload recreate the view holder. Is that on + * purpose? Use {@link #notifyItemChanged(int, PartialBindCallback)} if the item to be notified + * should not be entirely replaced. (see https://crbug.com/704130) + */ + @Deprecated // Can be valid in specific cases, but marked as deprecated to provide the warning. protected void notifyItemChanged(int index) { notifyItemRangeChanged(index, 1); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/TileGrid.java b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/TileGrid.java index 170b98c..d82f3133 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/TileGrid.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/TileGrid.java
@@ -55,13 +55,13 @@ @Override protected void onBindViewHolder(NewTabPageViewHolder holder) { assert holder instanceof ViewHolder; - ((ViewHolder) holder).onBindViewHolder(mTileGroup); + ((ViewHolder) holder).updateTiles(mTileGroup); } @Override public void onTileDataChanged() { setVisible(mTileGroup.getTiles().length != 0); - if (isVisible()) notifyItemChanged(0); + if (isVisible()) notifyItemChanged(0, new ViewHolder.UpdateTilesCallback(mTileGroup)); } @Override @@ -115,7 +115,7 @@ mLayout.setMaxColumns(MAX_TILE_COLUMNS); } - public void onBindViewHolder(TileGroup tileGroup) { + public void updateTiles(TileGroup tileGroup) { tileGroup.renderTileViews(mLayout, /* trackLoadTasks = */ false, /* condensed = */ false); } @@ -129,6 +129,23 @@ } /** + * Callback to update all the tiles in the view holder. + */ + public static class UpdateTilesCallback extends PartialBindCallback { + private final TileGroup mTileGroup; + + public UpdateTilesCallback(TileGroup tileGroup) { + mTileGroup = tileGroup; + } + + @Override + public void onResult(NewTabPageViewHolder holder) { + assert holder instanceof ViewHolder; + ((ViewHolder) holder).updateTiles(mTileGroup); + } + } + + /** * Callback to update the icon view for the view holder. */ public static class UpdateIconViewCallback extends PartialBindCallback {
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/crash/MinidumpUploadServiceTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/crash/MinidumpUploadServiceTest.java index 3d6d876..a0b6167 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/crash/MinidumpUploadServiceTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/crash/MinidumpUploadServiceTest.java
@@ -4,8 +4,6 @@ package org.chromium.chrome.browser.crash; -import static android.support.test.InstrumentationRegistry.getInstrumentation; - import static org.chromium.chrome.browser.crash.MinidumpUploadService.BROWSER; import static org.chromium.chrome.browser.crash.MinidumpUploadService.GPU; import static org.chromium.chrome.browser.crash.MinidumpUploadService.OTHER; @@ -207,7 +205,7 @@ public void run() { // Set up basically a fake. if (!NetworkChangeNotifier.isInitialized()) { - NetworkChangeNotifier.init(getApplicationContext()); + NetworkChangeNotifier.init(); } } });
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridgeTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridgeTest.java index 711975f..9140668 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridgeTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridgeTest.java
@@ -4,7 +4,6 @@ package org.chromium.chrome.browser.offlinepages; -import android.content.Context; import android.support.test.filters.SmallTest; import org.chromium.base.Callback; @@ -84,9 +83,8 @@ public void run() { // Ensure we start in an offline state. NetworkChangeNotifier.forceConnectivityState(false); - Context context = getActivity().getBaseContext(); if (!NetworkChangeNotifier.isInitialized()) { - NetworkChangeNotifier.init(context); + NetworkChangeNotifier.init(); } } });
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/OfflinePageRequestTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/OfflinePageRequestTest.java index 63d43915..42ae2e9a 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/OfflinePageRequestTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/OfflinePageRequestTest.java
@@ -45,7 +45,7 @@ @Override public void run() { if (!NetworkChangeNotifier.isInitialized()) { - NetworkChangeNotifier.init(getActivity().getBaseContext()); + NetworkChangeNotifier.init(); } NetworkChangeNotifier.forceConnectivityState(true);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtilsTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtilsTest.java index 43e5b9c9..307e7e9 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtilsTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtilsTest.java
@@ -58,10 +58,8 @@ Profile profile = Profile.getLastUsedProfile(); mOfflinePageBridge = OfflinePageBridge.getForProfile(profile); - // Context context1 = getInstrumentation().getTargetContext(); - Context context2 = getActivity().getBaseContext(); if (!NetworkChangeNotifier.isInitialized()) { - NetworkChangeNotifier.init(context2); + NetworkChangeNotifier.init(); } if (mOfflinePageBridge.isOfflinePageModelLoaded()) { semaphore.release();
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/RecentTabsTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/RecentTabsTest.java index 4560a32..60f49ac4 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/RecentTabsTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/RecentTabsTest.java
@@ -4,7 +4,6 @@ package org.chromium.chrome.browser.offlinepages; -import android.content.Context; import android.support.test.filters.MediumTest; import org.chromium.base.Callback; @@ -73,9 +72,8 @@ public void run() { // Ensure we start in an offline state. NetworkChangeNotifier.forceConnectivityState(false); - Context context = getActivity().getBaseContext(); if (!NetworkChangeNotifier.isInitialized()) { - NetworkChangeNotifier.init(context); + NetworkChangeNotifier.init(); } } });
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index 10af1824..a955d50 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn
@@ -782,8 +782,6 @@ "ntp_snippets/content_suggestions_service_factory.h", "ntp_snippets/download_suggestions_provider.cc", "ntp_snippets/download_suggestions_provider.h", - "ntp_snippets/ntp_snippets_features.cc", - "ntp_snippets/ntp_snippets_features.h", "ntp_snippets/ntp_snippets_metrics.cc", "ntp_snippets/ntp_snippets_metrics.h", "ntp_tiles/chrome_most_visited_sites_factory.cc",
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 77959be..6223b4d 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -28,7 +28,6 @@ #include "cc/base/switches.h" #include "chrome/browser/experiments/memory_ablation_experiment.h" #include "chrome/browser/flag_descriptions.h" -#include "chrome/browser/ntp_snippets/ntp_snippets_features.h" #include "chrome/browser/predictors/resource_prefetch_common.h" #include "chrome/browser/prerender/prerender_field_trial.h" #include "chrome/common/channel_info.h" @@ -2227,9 +2226,9 @@ flag_descriptions::kEnableNtpSuggestionsNotificationsDescription, kOsAndroid, FEATURE_WITH_PARAMS_VALUE_TYPE( - params::ntp_snippets::kNotificationsFeature, + ntp_snippets::kNotificationsFeature, kContentSuggestionsNotificationsFeatureVariations, - params::ntp_snippets::kNotificationsFeature.name)}, + ntp_snippets::kNotificationsFeature.name)}, {"ntp-condensed-layout", flag_descriptions::kNtpCondensedLayoutName, flag_descriptions::kNtpCondensedLayoutDescription, kOsAndroid, FEATURE_VALUE_TYPE(chrome::android::kNTPCondensedLayoutFeature)},
diff --git a/chrome/browser/android/chrome_feature_list.cc b/chrome/browser/android/chrome_feature_list.cc index 23e63e7..6298950 100644 --- a/chrome/browser/android/chrome_feature_list.cc +++ b/chrome/browser/android/chrome_feature_list.cc
@@ -12,7 +12,6 @@ #include "base/feature_list.h" #include "base/macros.h" #include "base/metrics/field_trial_params.h" -#include "chrome/browser/ntp_snippets/ntp_snippets_features.h" #include "chrome/common/chrome_features.h" #include "components/autofill/core/browser/autofill_experiments.h" #include "components/data_reduction_proxy/core/common/data_reduction_proxy_features.h" @@ -82,11 +81,11 @@ &kWebVRCardboardSupport, &ntp_snippets::kIncreasedVisibility, &ntp_snippets::kForeignSessionsSuggestionsFeature, + &ntp_snippets::kNotificationsFeature, &ntp_snippets::kPublisherFaviconsFromNewServerFeature, &offline_pages::kBackgroundLoaderForDownloadsFeature, &offline_pages::kOfflinePagesCTFeature, // See crbug.com/620421. &offline_pages::kOfflinePagesSharingFeature, - ¶ms::ntp_snippets::kNotificationsFeature, &password_manager::features::kViewPasswords, &subresource_filter::kSafeBrowsingSubresourceFilterExperimentalUI, };
diff --git a/chrome/browser/android/ntp/content_suggestions_notification_helper.cc b/chrome/browser/android/ntp/content_suggestions_notification_helper.cc index 3afed6d..bb234e0 100644 --- a/chrome/browser/android/ntp/content_suggestions_notification_helper.cc +++ b/chrome/browser/android/ntp/content_suggestions_notification_helper.cc
@@ -10,10 +10,10 @@ #include "base/android/jni_string.h" #include "base/metrics/histogram_macros.h" #include "base/strings/utf_string_conversions.h" -#include "chrome/browser/ntp_snippets/ntp_snippets_features.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/common/pref_names.h" +#include "components/ntp_snippets/features.h" #include "components/prefs/pref_service.h" #include "components/variations/variations_associated_data.h" #include "jni/ContentSuggestionsNotificationHelper_jni.h" @@ -22,9 +22,9 @@ #include "ui/gfx/image/image_skia.h" using base::android::JavaParamRef; -using params::ntp_snippets::kNotificationsFeature; -using params::ntp_snippets::kNotificationsIgnoredLimitParam; -using params::ntp_snippets::kNotificationsIgnoredDefaultLimit; +using ntp_snippets::kNotificationsFeature; +using ntp_snippets::kNotificationsIgnoredLimitParam; +using ntp_snippets::kNotificationsIgnoredDefaultLimit; namespace ntp_snippets {
diff --git a/chrome/browser/android/ntp/content_suggestions_notifier_service.cc b/chrome/browser/android/ntp/content_suggestions_notifier_service.cc index 300e724..ad4f121 100644 --- a/chrome/browser/android/ntp/content_suggestions_notifier_service.cc +++ b/chrome/browser/android/ntp/content_suggestions_notifier_service.cc
@@ -12,12 +12,12 @@ #include "chrome/browser/android/ntp/content_suggestions_notification_helper.h" #include "chrome/browser/notifications/notification.h" #include "chrome/browser/notifications/notification_handler.h" -#include "chrome/browser/ntp_snippets/ntp_snippets_features.h" #include "chrome/browser/ntp_snippets/ntp_snippets_metrics.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" #include "components/ntp_snippets/content_suggestions_service.h" +#include "components/ntp_snippets/features.h" #include "components/pref_registry/pref_registry_syncable.h" #include "components/prefs/pref_service.h" #include "components/strings/grit/components_strings.h" @@ -33,16 +33,16 @@ using ntp_snippets::ContentSuggestionsNotificationHelper; using ntp_snippets::ContentSuggestionsService; using ntp_snippets::KnownCategories; -using params::ntp_snippets::kNotificationsDailyLimit; -using params::ntp_snippets::kNotificationsDefaultDailyLimit; -using params::ntp_snippets::kNotificationsDefaultPriority; -using params::ntp_snippets::kNotificationsFeature; -using params::ntp_snippets::kNotificationsKeepWhenFrontmostParam; -using params::ntp_snippets::kNotificationsOpenToNTPParam; -using params::ntp_snippets::kNotificationsPriorityParam; -using params::ntp_snippets::kNotificationsTextParam; -using params::ntp_snippets::kNotificationsTextValueAndMore; -using params::ntp_snippets::kNotificationsTextValueSnippet; +using ntp_snippets::kNotificationsDailyLimit; +using ntp_snippets::kNotificationsDefaultDailyLimit; +using ntp_snippets::kNotificationsDefaultPriority; +using ntp_snippets::kNotificationsFeature; +using ntp_snippets::kNotificationsKeepWhenFrontmostParam; +using ntp_snippets::kNotificationsOpenToNTPParam; +using ntp_snippets::kNotificationsPriorityParam; +using ntp_snippets::kNotificationsTextParam; +using ntp_snippets::kNotificationsTextValueAndMore; +using ntp_snippets::kNotificationsTextValueSnippet; namespace {
diff --git a/chrome/browser/chromeos/app_mode/kiosk_crash_restore_browsertest.cc b/chrome/browser/chromeos/app_mode/kiosk_crash_restore_browsertest.cc index ded881c..c6f9a59c 100644 --- a/chrome/browser/chromeos/app_mode/kiosk_crash_restore_browsertest.cc +++ b/chrome/browser/chromeos/app_mode/kiosk_crash_restore_browsertest.cc
@@ -107,10 +107,9 @@ fake_cws_->SetUpdateCrx(test_app_id_, test_app_id_ + ".crx", "1.0.0"); } - void RunTestOnMainThreadLoop() override { + void PreRunTestOnMainThread() override { termination_observer_.reset(new TerminationObserver()); - - InProcessBrowserTest::RunTestOnMainThreadLoop(); + InProcessBrowserTest::PreRunTestOnMainThread(); } void SetUpOnMainThread() override {
diff --git a/chrome/browser/chromeos/login/auto_launched_kiosk_browsertest.cc b/chrome/browser/chromeos/login/auto_launched_kiosk_browsertest.cc index 3371e70..4c41f62 100644 --- a/chrome/browser/chromeos/login/auto_launched_kiosk_browsertest.cc +++ b/chrome/browser/chromeos/login/auto_launched_kiosk_browsertest.cc
@@ -324,6 +324,11 @@ ExtensionApiTest::SetUpInProcessBrowserTestFixture(); } + void PreRunTestOnMainThread() override { + termination_observer_.reset(new TerminationObserver()); + InProcessBrowserTest::PreRunTestOnMainThread(); + } + void SetUpOnMainThread() override { extensions::browsertest_util::CreateAndInitializeLocalCache(); @@ -332,12 +337,6 @@ ExtensionApiTest::SetUpOnMainThread(); } - void RunTestOnMainThreadLoop() override { - termination_observer_.reset(new TerminationObserver()); - - ExtensionApiTest::RunTestOnMainThreadLoop(); - } - void TearDownOnMainThread() override { termination_observer_.reset();
diff --git a/chrome/browser/chromeos/system/tray_accessibility_browsertest.cc b/chrome/browser/chromeos/system/tray_accessibility_browsertest.cc index f884de4..029933c 100644 --- a/chrome/browser/chromeos/system/tray_accessibility_browsertest.cc +++ b/chrome/browser/chromeos/system/tray_accessibility_browsertest.cc
@@ -87,12 +87,8 @@ void SetUpOnMainThread() override { AccessibilityManager::Get()->SetProfileForTest(GetProfile()); MagnificationManager::Get()->SetProfileForTest(GetProfile()); - } - - void RunTestOnMainThreadLoop() override { // Need to mark oobe completed to show detailed views. StartupUtils::MarkOobeCompleted(); - InProcessBrowserTest::RunTestOnMainThreadLoop(); } void TearDownOnMainThread() override {
diff --git a/chrome/browser/downgrade/user_data_downgrade_browsertest.cc b/chrome/browser/downgrade/user_data_downgrade_browsertest.cc index 0340327..a395463 100644 --- a/chrome/browser/downgrade/user_data_downgrade_browsertest.cc +++ b/chrome/browser/downgrade/user_data_downgrade_browsertest.cc
@@ -83,13 +83,13 @@ // InProcessBrowserTest: // Verify the content of renamed user data directory. - void RunTestOnMainThreadLoop() override { + void SetUpOnMainThread() override { ASSERT_TRUE(base::DirectoryExists(moved_user_data_dir_)); ASSERT_TRUE( base::PathExists(moved_user_data_dir_.Append(other_file_.BaseName()))); EXPECT_EQ(GetNextChromeVersion(), GetLastVersion(moved_user_data_dir_).GetString()); - InProcessBrowserTest::RunTestOnMainThreadLoop(); + UserDataDowngradeBrowserTestBase::SetUpOnMainThread(); } };
diff --git a/chrome/browser/extensions/api/screenlock_private/screenlock_private_apitest.cc b/chrome/browser/extensions/api/screenlock_private/screenlock_private_apitest.cc index 48db51d..a97f783 100644 --- a/chrome/browser/extensions/api/screenlock_private/screenlock_private_apitest.cc +++ b/chrome/browser/extensions/api/screenlock_private/screenlock_private_apitest.cc
@@ -58,19 +58,18 @@ GetProfileAttributesWithPath(profile()->GetPath(), &entry)); entry->SetAuthInfo( kTestGaiaId, base::UTF8ToUTF16(test_account_id_.GetUserEmail())); - ExtensionApiTest::SetUpOnMainThread(); - } - - protected: - // ExtensionApiTest override: - void RunTestOnMainThreadLoop() override { registrar_.Add(this, extensions::NOTIFICATION_EXTENSION_TEST_MESSAGE, content::NotificationService::AllSources()); - ExtensionApiTest::RunTestOnMainThreadLoop(); + ExtensionApiTest::SetUpOnMainThread(); + } + + void TearDownOnMainThread() override { + ExtensionApiTest::TearDownOnMainThread(); registrar_.RemoveAll(); } + protected: // content::NotificationObserver override: void Observe(int type, const content::NotificationSource& source,
diff --git a/chrome/browser/ntp_snippets/content_suggestions_notifier_service_factory.cc b/chrome/browser/ntp_snippets/content_suggestions_notifier_service_factory.cc index 57ed436..d206065b 100644 --- a/chrome/browser/ntp_snippets/content_suggestions_notifier_service_factory.cc +++ b/chrome/browser/ntp_snippets/content_suggestions_notifier_service_factory.cc
@@ -7,16 +7,16 @@ #include "base/memory/ptr_util.h" #include "base/memory/singleton.h" #include "chrome/browser/ntp_snippets/content_suggestions_service_factory.h" -#include "chrome/browser/ntp_snippets/ntp_snippets_features.h" #include "chrome/browser/profiles/profile.h" #include "components/keyed_service/content/browser_context_dependency_manager.h" +#include "components/ntp_snippets/features.h" #include "components/variations/variations_associated_data.h" #if defined(OS_ANDROID) #include "chrome/browser/android/ntp/content_suggestions_notifier_service.h" #endif -using params::ntp_snippets::kNotificationsFeature; +using ntp_snippets::kNotificationsFeature; ContentSuggestionsNotifierServiceFactory* ContentSuggestionsNotifierServiceFactory::GetInstance() {
diff --git a/chrome/browser/ntp_snippets/ntp_snippets_features.cc b/chrome/browser/ntp_snippets/ntp_snippets_features.cc deleted file mode 100644 index 312efc10..0000000 --- a/chrome/browser/ntp_snippets/ntp_snippets_features.cc +++ /dev/null
@@ -1,25 +0,0 @@ -// Copyright 2016 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 "chrome/browser/ntp_snippets/ntp_snippets_features.h" - -namespace params { -namespace ntp_snippets { - -const base::Feature kNotificationsFeature = {"ContentSuggestionsNotifications", - base::FEATURE_DISABLED_BY_DEFAULT}; - -const char kNotificationsPriorityParam[] = "priority"; -const char kNotificationsTextParam[] = "text"; -const char kNotificationsTextValuePublisher[] = "publisher"; -const char kNotificationsTextValueSnippet[] = "snippet"; -const char kNotificationsTextValueAndMore[] = "and_more"; -const char kNotificationsKeepWhenFrontmostParam[] = - "keep_notification_when_frontmost"; -const char kNotificationsOpenToNTPParam[] = "open_to_ntp"; -const char kNotificationsDailyLimit[] = "daily_limit"; -const char kNotificationsIgnoredLimitParam[] = "ignored_limit"; - -} // namespace ntp_snippets -} // namespace params
diff --git a/chrome/browser/ntp_snippets/ntp_snippets_features.h b/chrome/browser/ntp_snippets/ntp_snippets_features.h deleted file mode 100644 index 4baa9e47..0000000 --- a/chrome/browser/ntp_snippets/ntp_snippets_features.h +++ /dev/null
@@ -1,49 +0,0 @@ -// Copyright 2016 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 CHROME_BROWSER_NTP_SNIPPETS_NTP_SNIPPETS_FEATURES_H_ -#define CHROME_BROWSER_NTP_SNIPPETS_NTP_SNIPPETS_FEATURES_H_ - -#include "base/feature_list.h" - -namespace params { -namespace ntp_snippets { - -// Enables and configures notifications for content suggestions. -extern const base::Feature kNotificationsFeature; - -// An integer. The priority of the notification, ranging from -2 (PRIORITY_MIN) -// to 2 (PRIORITY_MAX). Vibrates and makes sound if >= 0. -extern const char kNotificationsPriorityParam[]; -constexpr int kNotificationsDefaultPriority = -1; - -// "publisher": use article's publisher as notification's text (default). -// "snippet": use article's snippet as notification's text. -// "and_more": use "From $1. Read this article and $2 more." as text. -extern const char kNotificationsTextParam[]; -extern const char kNotificationsTextValuePublisher[]; -extern const char kNotificationsTextValueSnippet[]; -extern const char kNotificationsTextValueAndMore[]; - -// "true": when Chrome becomes frontmost, leave notifications open. -// "false": automatically dismiss notification when Chrome becomes frontmost. -extern const char kNotificationsKeepWhenFrontmostParam[]; - -// "true": notifications link to chrome://newtab, with appropriate text. -// "false": notifications link to URL of notifying article. -extern const char kNotificationsOpenToNTPParam[]; - -// An integer. The maximum number of notifications that will be shown in 1 day. -extern const char kNotificationsDailyLimit[]; -constexpr int kNotificationsDefaultDailyLimit = 1; - -// An integer. The number of notifications that can be ignored. If the user -// ignores this many notifications or more, we stop sending them. -extern const char kNotificationsIgnoredLimitParam[]; -constexpr int kNotificationsIgnoredDefaultLimit = 3; - -} // namespace ntp_snippets -} // namespace params - -#endif // CHROME_BROWSER_NTP_SNIPPETS_NTP_SNIPPETS_FEATURES_H_
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_browsertest.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_browsertest.cc index f7a63ac..55ab6225 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_browsertest.cc +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_browsertest.cc
@@ -224,13 +224,13 @@ ~LauncherPlatformAppBrowserTest() override {} - void RunTestOnMainThreadLoop() override { + void SetUpOnMainThread() override { // Ensure ash starts the session and creates the shelf and controller. SessionControllerClient::FlushForTesting(); controller_ = GetChromeLauncherControllerImpl(); ASSERT_TRUE(controller_); - return extensions::PlatformAppBrowserTest::RunTestOnMainThreadLoop(); + extensions::PlatformAppBrowserTest::SetUpOnMainThread(); } ash::ShelfModel* shelf_model() { return ash::Shell::Get()->shelf_model(); } @@ -281,7 +281,7 @@ ~ShelfAppBrowserTest() override {} - void RunTestOnMainThreadLoop() override { + void SetUpOnMainThread() override { // Ensure ash starts the session and creates the shelf and controller. SessionControllerClient::FlushForTesting(); @@ -290,7 +290,7 @@ model_ = ash::Shell::Get()->shelf_model(); controller_ = GetChromeLauncherControllerImpl(); ASSERT_TRUE(controller_); - return ExtensionBrowserTest::RunTestOnMainThreadLoop(); + ExtensionBrowserTest::SetUpOnMainThread(); } size_t NumberOfDetectedLauncherBrowsers(bool show_all_tabs) {
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index c669f15f..8e54d5edb 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -1135,6 +1135,15 @@ "//testing/scripts/run_telemetry_as_googletest.py", ] } + + # TODO(GYP_GONE): Delete this after we've converted everything to GN. + # This target exist only for compatibility w/ GYP. + group("tab_capture_end2end_tests") { + testonly = true + deps = [ + ":browser_tests", + ] + } } static_library("browser_tests_runner") {
diff --git a/chrome/test/base/in_process_browser_test.cc b/chrome/test/base/in_process_browser_test.cc index 9af204a..867c5ca5 100644 --- a/chrome/test/base/in_process_browser_test.cc +++ b/chrome/test/base/in_process_browser_test.cc
@@ -519,7 +519,7 @@ } #endif -void InProcessBrowserTest::RunTestOnMainThreadLoop() { +void InProcessBrowserTest::PreRunTestOnMainThread() { AfterStartupTaskUtils::SetBrowserStartupIsCompleteForTesting(); // Pump startup related events. @@ -566,13 +566,15 @@ if (browser_ && global_browser_set_up_function_) ASSERT_TRUE(global_browser_set_up_function_(browser_)); - SetUpOnMainThread(); #if defined(OS_MACOSX) autorelease_pool_->Recycle(); #endif - if (!HasFatalFailure()) - RunTestOnMainThread(); + // TODO(jam): remove this. + disable_io_checks(); +} + +void InProcessBrowserTest::PostRunTestOnMainThread() { #if defined(OS_MACOSX) autorelease_pool_->Recycle(); #endif @@ -583,9 +585,6 @@ EXPECT_EQ("", error_message); } - // Invoke cleanup and quit even if there are failures. This is similar to - // gtest in that it invokes TearDown even if Setup fails. - TearDownOnMainThread(); #if defined(OS_MACOSX) autorelease_pool_->Recycle(); #endif
diff --git a/chrome/test/base/in_process_browser_test.h b/chrome/test/base/in_process_browser_test.h index b3c7c00..69cf984 100644 --- a/chrome/test/base/in_process_browser_test.h +++ b/chrome/test/base/in_process_browser_test.h
@@ -170,7 +170,8 @@ virtual bool SetUpUserDataDirectory() WARN_UNUSED_RESULT; // BrowserTestBase: - void RunTestOnMainThreadLoop() override; + void PreRunTestOnMainThread() override; + void PostRunTestOnMainThread() override; // Ensures that no devtools are open, and then opens the devtools. void OpenDevToolsWindow(content::WebContents* web_contents);
diff --git a/chrome/test/chromedriver/test/run_py_tests.py b/chrome/test/chromedriver/test/run_py_tests.py index e67e253..ce5a8453 100755 --- a/chrome/test/chromedriver/test/run_py_tests.py +++ b/chrome/test/chromedriver/test/run_py_tests.py
@@ -101,7 +101,10 @@ # Xvfb doesn't support maximization. 'ChromeDriverTest.testWindowMaximize', ] -_OS_SPECIFIC_FILTER['mac'] = [] +_OS_SPECIFIC_FILTER['mac'] = [ + # https://bugs.chromium.org/p/chromedriver/issues/detail?id=1779 + 'ChromeDriverTest.testWindowMaximize', +] _DESKTOP_NEGATIVE_FILTER = [ # Desktop doesn't support touch (without --touch-events).
diff --git a/chromecast/browser/renderer_prelauncher_test.cc b/chromecast/browser/renderer_prelauncher_test.cc index 3e36800c..f1e93e5 100644 --- a/chromecast/browser/renderer_prelauncher_test.cc +++ b/chromecast/browser/renderer_prelauncher_test.cc
@@ -30,7 +30,8 @@ protected: // content::BrowserTestBase implementation: void SetUp() override; - void RunTestOnMainThreadLoop() override; + void PreRunTestOnMainThread() override; + void PostRunTestOnMainThread() override {} private: DISALLOW_COPY_AND_ASSIGN(RendererPrelauncherTest); @@ -44,15 +45,11 @@ BrowserTestBase::SetUp(); } -void RendererPrelauncherTest::RunTestOnMainThreadLoop() { +void RendererPrelauncherTest::PreRunTestOnMainThread() { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); base::RunLoop().RunUntilIdle(); metrics::CastMetricsHelper::GetInstance()->SetDummySessionIdForTesting(); - - SetUpOnMainThread(); - RunTestOnMainThread(); - TearDownOnMainThread(); } IN_PROC_BROWSER_TEST_F(RendererPrelauncherTest, ReusedRenderer) {
diff --git a/chromecast/browser/test/cast_browser_test.cc b/chromecast/browser/test/cast_browser_test.cc index 29a32fe..b3c71f5db 100644 --- a/chromecast/browser/test/cast_browser_test.cc +++ b/chromecast/browser/test/cast_browser_test.cc
@@ -33,29 +33,21 @@ BrowserTestBase::SetUp(); } -void CastBrowserTest::TearDownOnMainThread() { - cast_web_view_.reset(); - - BrowserTestBase::TearDownOnMainThread(); -} - void CastBrowserTest::SetUpCommandLine(base::CommandLine* command_line) { - BrowserTestBase::SetUpCommandLine(command_line); - command_line->AppendSwitch(switches::kNoWifi); command_line->AppendSwitchASCII(switches::kTestType, "browser"); } -void CastBrowserTest::RunTestOnMainThreadLoop() { +void CastBrowserTest::PreRunTestOnMainThread() { // Pump startup related events. DCHECK_CURRENTLY_ON(content::BrowserThread::UI); base::RunLoop().RunUntilIdle(); metrics::CastMetricsHelper::GetInstance()->SetDummySessionIdForTesting(); +} - SetUpOnMainThread(); - RunTestOnMainThread(); - TearDownOnMainThread(); +void CastBrowserTest::PostRunTestOnMainThread() { + cast_web_view_.reset(); } content::WebContents* CastBrowserTest::NavigateToURL(const GURL& url) {
diff --git a/chromecast/browser/test/cast_browser_test.h b/chromecast/browser/test/cast_browser_test.h index 5c94dd3..895384e 100644 --- a/chromecast/browser/test/cast_browser_test.h +++ b/chromecast/browser/test/cast_browser_test.h
@@ -31,9 +31,9 @@ // content::BrowserTestBase implementation: void SetUp() final; - void TearDownOnMainThread() override; void SetUpCommandLine(base::CommandLine* command_line) override; - void RunTestOnMainThreadLoop() final; + void PreRunTestOnMainThread() override; + void PostRunTestOnMainThread() override; content::WebContents* NavigateToURL(const GURL& url);
diff --git a/chromecast/public/cast_egl_platform.h b/chromecast/public/cast_egl_platform.h index a597f9f..30bcf39 100644 --- a/chromecast/public/cast_egl_platform.h +++ b/chromecast/public/cast_egl_platform.h
@@ -27,10 +27,15 @@ // caller. desired_list contains list of desired EGL properties and values. virtual const int* GetEGLSurfaceProperties(const int* desired_list) = 0; - // Initialize/ShutdownHardware are called at most once each over the object's - // lifetime. Initialize will be called before creating display type or - // window. If Initialize fails, return false (Shutdown will still be called). + // InitializeHardware is called once (before creating display type or window) + // and must return false on failure. virtual bool InitializeHardware() = 0; + + // DEPRECATED - ShutdownHardware may not be called in practice (helps speed + // up GPU process shutdown). Implementations must handle cleanup/shutdown + // without an explicit cleanup API (this was already required anyway to handle + // GPU process crash scenarios correctly). + // TODO(halliwell): remove this API in next system update. virtual void ShutdownHardware() = 0; // These three are called once after hardware is successfully initialized. @@ -41,17 +46,22 @@ virtual void* GetGles2Library() = 0; virtual GLGetProcAddressProc GetGLProcAddressProc() = 0; - // Creates/destroys an EGLNativeDisplayType. These may be called multiple - // times over the object's lifetime, for example to release the display when - // switching to an external application. There will be at most one display - // type at a time. + // Creates an EGLNativeDisplayType. Called once when initializing display. virtual NativeDisplayType CreateDisplayType(const Size& size) = 0; + + // DEPRECATED - destroys display type. Currently not called, see notes on + // ShutdownHardware above. + // TODO(halliwell): remove if no longer needed. virtual void DestroyDisplayType(NativeDisplayType display_type) = 0; - // Creates/destroys an EGLNativeWindow. There will be at most one window at a - // time, created within a valid display type. + // Creates an EGLNativeWindow using previously-created DisplayType. Called + // once when initializing display. virtual NativeWindowType CreateWindow(NativeDisplayType display_type, const Size& size) = 0; + + // DEPRECATED - destroys window. Currently not called, see notes on + // ShutdownHardware above. + // TODO(halliwell): remove if no longer needed. virtual void DestroyWindow(NativeWindowType window) = 0; // Specifies if creating multiple surfaces on a window is broken on this
diff --git a/components/autofill/core/browser/autofill_manager.cc b/components/autofill/core/browser/autofill_manager.cc index 933b7c5..e1c3846 100644 --- a/components/autofill/core/browser/autofill_manager.cc +++ b/components/autofill/core/browser/autofill_manager.cc
@@ -1440,6 +1440,8 @@ ServerFieldTypeSet non_empty_types; personal_data_->GetNonEmptyTypes(&non_empty_types); + if (submitted_form.is_signin_upload()) + non_empty_types.insert(PASSWORD); download_manager_->StartUploadRequest( submitted_form, was_autofilled, non_empty_types,
diff --git a/components/autofill/core/browser/autofill_manager_unittest.cc b/components/autofill/core/browser/autofill_manager_unittest.cc index e9d94a4..b6e9583b 100644 --- a/components/autofill/core/browser/autofill_manager_unittest.cc +++ b/components/autofill/core/browser/autofill_manager_unittest.cc
@@ -334,6 +334,13 @@ } } + MOCK_METHOD5(StartUploadRequest, + bool(const FormStructure&, + bool, + const ServerFieldTypeSet&, + const std::string&, + bool)); + private: std::vector<FormStructure*> last_queried_forms_; @@ -538,7 +545,8 @@ autofill_enabled_(true), credit_card_upload_enabled_(false), credit_card_was_uploaded_(false), - expected_observed_submission_(true) { + expected_observed_submission_(true), + call_parent_upload_form_data_(false) { set_payments_client( new TestPaymentsClient(driver->GetURLRequestContext(), this)); } @@ -569,6 +577,10 @@ expected_observed_submission_ = expected; } + void set_call_parent_upload_form_data(bool value) { + call_parent_upload_form_data_ = value; + } + void UploadFormDataAsyncCallback(const FormStructure* submitted_form, const base::TimeTicks& load_time, const base::TimeTicks& interaction_time, @@ -615,6 +627,9 @@ void UploadFormData(const FormStructure& submitted_form, bool observed_submission) override { submitted_form_signature_ = submitted_form.FormSignatureAsStr(); + + if (call_parent_upload_form_data_) + AutofillManager::UploadFormData(submitted_form, observed_submission); } const std::string GetSubmittedFormSignature() { @@ -664,6 +679,7 @@ bool credit_card_upload_enabled_; bool credit_card_was_uploaded_; bool expected_observed_submission_; + bool call_parent_upload_form_data_; std::unique_ptr<base::RunLoop> run_loop_; @@ -6071,6 +6087,7 @@ // callback initiated by WaitForAsyncUploadProcess checks these expectations.) autofill_manager_->set_expected_submitted_field_types(expected_types); autofill_manager_->set_expected_observed_submission(true); + autofill_manager_->set_call_parent_upload_form_data(true); autofill_manager_->ResetRunLoop(); std::unique_ptr<FormStructure> form_structure(new FormStructure(form)); @@ -6078,6 +6095,11 @@ form_structure->field(1)->set_possible_types({autofill::PASSWORD}); std::string signature = form_structure->FormSignatureAsStr(); + + ServerFieldTypeSet uploaded_available_types; + EXPECT_CALL(*download_manager_, + StartUploadRequest(_, false, _, std::string(), true)) + .WillOnce(DoAll(SaveArg<2>(&uploaded_available_types), Return(true))); autofill_manager_->StartUploadProcess(std::move(form_structure), base::TimeTicks::Now(), true); @@ -6085,6 +6107,8 @@ autofill_manager_->WaitForAsyncUploadProcess(); EXPECT_EQ(signature, autofill_manager_->GetSubmittedFormSignature()); + EXPECT_NE(uploaded_available_types.end(), + uploaded_available_types.find(autofill::PASSWORD)); } } // namespace autofill
diff --git a/components/autofill/core/browser/form_structure.cc b/components/autofill/core/browser/form_structure.cc index 9bff7e2..4695b65b4 100644 --- a/components/autofill/core/browser/form_structure.cc +++ b/components/autofill/core/browser/form_structure.cc
@@ -295,6 +295,19 @@ type == CREDIT_CARD_EXP_DATE_4_DIGIT_YEAR; } +// Returns true iff all form fields autofill types are in |contained_types|. +bool AllTypesCaptured(const FormStructure& form, + const ServerFieldTypeSet& contained_types) { + for (const auto& field : form) { + for (const auto& type : field->possible_types()) { + if (type != UNKNOWN_TYPE && type != EMPTY_TYPE && + !contained_types.count(type)) + return false; + } + } + return true; +} + } // namespace FormStructure::FormStructure(const FormData& form) @@ -395,15 +408,7 @@ bool observed_submission, AutofillUploadContents* upload) const { DCHECK(ShouldBeCrowdsourced()); - - // Verify that |available_field_types| agrees with the possible field types we - // are uploading. - for (const auto& field : *this) { - for (const auto& type : field->possible_types()) { - DCHECK(type == UNKNOWN_TYPE || type == EMPTY_TYPE || - available_field_types.count(type)); - } - } + DCHECK(AllTypesCaptured(*this, available_field_types)); upload->set_submission(observed_submission); upload->set_client_version(kClientVersion);
diff --git a/components/ntp_snippets/features.cc b/components/ntp_snippets/features.cc index 0b90a42..6910f40 100644 --- a/components/ntp_snippets/features.cc +++ b/components/ntp_snippets/features.cc
@@ -13,6 +13,20 @@ namespace ntp_snippets { +// Keep sorted, and keep nullptr at the end. +const base::Feature*(kAllFeatures[]) = {&kArticleSuggestionsFeature, + &kBookmarkSuggestionsFeature, + &kCategoryOrder, + &kCategoryRanker, + &kForeignSessionsSuggestionsFeature, + &kIncreasedVisibility, + &kNotificationsFeature, + &kPhysicalWebPageSuggestionsFeature, + &kPreferAmpUrlsFeature, + &kPublisherFaviconsFromNewServerFeature, + &kRecentOfflineTabSuggestionsFeature, + nullptr}; + const base::Feature kArticleSuggestionsFeature{ "NTPArticleSuggestions", base::FEATURE_ENABLED_BY_DEFAULT}; @@ -113,4 +127,18 @@ return CategoryOrderChoice::GENERAL; } +const base::Feature kNotificationsFeature = {"ContentSuggestionsNotifications", + base::FEATURE_DISABLED_BY_DEFAULT}; + +const char kNotificationsPriorityParam[] = "priority"; +const char kNotificationsTextParam[] = "text"; +const char kNotificationsTextValuePublisher[] = "publisher"; +const char kNotificationsTextValueSnippet[] = "snippet"; +const char kNotificationsTextValueAndMore[] = "and_more"; +const char kNotificationsKeepWhenFrontmostParam[] = + "keep_notification_when_frontmost"; +const char kNotificationsOpenToNTPParam[] = "open_to_ntp"; +const char kNotificationsDailyLimit[] = "daily_limit"; +const char kNotificationsIgnoredLimitParam[] = "ignored_limit"; + } // namespace ntp_snippets
diff --git a/components/ntp_snippets/features.h b/components/ntp_snippets/features.h index 8832aed..9946e7c2d 100644 --- a/components/ntp_snippets/features.h +++ b/components/ntp_snippets/features.h
@@ -18,6 +18,14 @@ namespace ntp_snippets { +// +// Null-terminated list of all features related to content suggestions. +// +// If you add a base::Feature below, you must add it to this list. It is used in +// internal pages to list relevant parameters and settings. +// +extern const base::Feature*(kAllFeatures[]); + // Features to turn individual providers/categories on/off. // TODO(jkrcal): Rename to kRemoteSuggestionsFeature. extern const base::Feature kArticleSuggestionsFeature; @@ -72,6 +80,39 @@ // Returns which category order to use according to kCategoryOrder feature. CategoryOrderChoice GetSelectedCategoryOrder(); +// Enables and configures notifications for content suggestions on Android. +extern const base::Feature kNotificationsFeature; + +// An integer. The priority of the notification, ranging from -2 (PRIORITY_MIN) +// to 2 (PRIORITY_MAX). Vibrates and makes sound if >= 0. +extern const char kNotificationsPriorityParam[]; +constexpr int kNotificationsDefaultPriority = -1; + +// "publisher": use article's publisher as notification's text (default). +// "snippet": use article's snippet as notification's text. +// "and_more": use "From $1. Read this article and $2 more." as text. +extern const char kNotificationsTextParam[]; +extern const char kNotificationsTextValuePublisher[]; +extern const char kNotificationsTextValueSnippet[]; +extern const char kNotificationsTextValueAndMore[]; + +// "true": when Chrome becomes frontmost, leave notifications open. +// "false": automatically dismiss notification when Chrome becomes frontmost. +extern const char kNotificationsKeepWhenFrontmostParam[]; + +// "true": notifications link to chrome://newtab, with appropriate text. +// "false": notifications link to URL of notifying article. +extern const char kNotificationsOpenToNTPParam[]; + +// An integer. The maximum number of notifications that will be shown in 1 day. +extern const char kNotificationsDailyLimit[]; +constexpr int kNotificationsDefaultDailyLimit = 1; + +// An integer. The number of notifications that can be ignored. If the user +// ignores this many notifications or more, we stop sending them. +extern const char kNotificationsIgnoredLimitParam[]; +constexpr int kNotificationsIgnoredDefaultLimit = 3; + } // namespace ntp_snippets #endif // COMPONENTS_NTP_SNIPPETS_FEATURES_H_
diff --git a/components/update_client/url_request_post_interceptor.cc b/components/update_client/url_request_post_interceptor.cc index 38501606..9753cb9 100644 --- a/components/update_client/url_request_post_interceptor.cc +++ b/components/update_client/url_request_post_interceptor.cc
@@ -8,10 +8,13 @@ #include "base/files/file_util.h" #include "base/macros.h" +#include "base/memory/ref_counted.h" #include "base/strings/stringprintf.h" #include "components/update_client/test_configurator.h" #include "net/base/upload_bytes_element_reader.h" #include "net/base/upload_data_stream.h" +#include "net/http/http_response_headers.h" +#include "net/http/http_util.h" #include "net/url_request/url_request.h" #include "net/url_request/url_request_filter.h" #include "net/url_request/url_request_interceptor.h" @@ -32,7 +35,12 @@ response_body_(response_body) {} protected: - int GetResponseCode() const override { return response_code_; } + void GetResponseInfo(net::HttpResponseInfo* info) override { + const std::string headers = + base::StringPrintf("HTTP/1.1 %i OK\r\n\r\n", response_code_); + info->headers = base::MakeShared<net::HttpResponseHeaders>( + net::HttpUtil::AssembleRawHeaders(headers.c_str(), headers.length())); + } int GetData(std::string* mime_type, std::string* charset,
diff --git a/content/browser/android/background_sync_network_observer_android.cc b/content/browser/android/background_sync_network_observer_android.cc index 2d9aa7d..04484f2 100644 --- a/content/browser/android/background_sync_network_observer_android.cc +++ b/content/browser/android/background_sync_network_observer_android.cc
@@ -4,7 +4,6 @@ #include "content/browser/android/background_sync_network_observer_android.h" -#include "base/android/context_utils.h" #include "jni/BackgroundSyncNetworkObserver_jni.h" using base::android::JavaParamRef; @@ -38,8 +37,7 @@ JNIEnv* env = base::android::AttachCurrentThread(); base::android::ScopedJavaGlobalRef<jobject> obj( Java_BackgroundSyncNetworkObserver_createObserver( - env, base::android::GetApplicationContext(), - reinterpret_cast<jlong>(this))); + env, reinterpret_cast<jlong>(this))); j_observer_.Reset(obj); }
diff --git a/content/browser/android/composited_touch_handle_drawable.cc b/content/browser/android/composited_touch_handle_drawable.cc index 859c470..a48b0fa1 100644 --- a/content/browser/android/composited_touch_handle_drawable.cc +++ b/content/browser/android/composited_touch_handle_drawable.cc
@@ -4,7 +4,6 @@ #include "content/browser/android/composited_touch_handle_drawable.h" -#include "base/android/context_utils.h" #include "base/lazy_instance.h" #include "base/logging.h" #include "base/macros.h"
diff --git a/content/browser/android/java_interfaces_impl.cc b/content/browser/android/java_interfaces_impl.cc index 64ac665..8bfa589b 100644 --- a/content/browser/android/java_interfaces_impl.cc +++ b/content/browser/android/java_interfaces_impl.cc
@@ -8,7 +8,6 @@ #include <utility> -#include "base/android/context_utils.h" #include "base/android/jni_android.h" #include "base/memory/singleton.h" #include "content/browser/frame_host/render_frame_host_impl.h" @@ -28,8 +27,7 @@ service_manager::mojom::InterfaceProviderPtr provider; JNIEnv* env = base::android::AttachCurrentThread(); Java_InterfaceRegistrarImpl_createInterfaceRegistryForContext( - env, mojo::MakeRequest(&provider).PassMessagePipe().release().value(), - base::android::GetApplicationContext()); + env, mojo::MakeRequest(&provider).PassMessagePipe().release().value()); interface_provider_.Bind(std::move(provider)); }
diff --git a/content/browser/child_process_launcher_helper_android.cc b/content/browser/child_process_launcher_helper_android.cc index a46f2c4..b498bb4f 100644 --- a/content/browser/child_process_launcher_helper_android.cc +++ b/content/browser/child_process_launcher_helper_android.cc
@@ -7,7 +7,6 @@ #include <memory> #include "base/android/apk_assets.h" -#include "base/android/context_utils.h" #include "base/android/jni_array.h" #include "base/i18n/icu_util.h" #include "base/logging.h" @@ -133,8 +132,7 @@ constexpr int param_key = 0; // TODO(boliu): Use this. java_peer_.Reset(Java_ChildProcessLauncherHelper_create( - env, reinterpret_cast<intptr_t>(this), - base::android::GetApplicationContext(), param_key, j_argv, + env, reinterpret_cast<intptr_t>(this), param_key, j_argv, child_process_id(), j_file_infos)); AddRef(); // Balanced by OnChildProcessStarted.
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc index 7271a3a..4a9724e 100644 --- a/content/browser/loader/resource_dispatcher_host_impl.cc +++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -1885,7 +1885,8 @@ largest_outstanding_request_count_seen_); } - if (stats.num_requests > largest_outstanding_request_count_seen_) { + if (stats.num_requests > + largest_outstanding_request_per_process_count_seen_) { largest_outstanding_request_per_process_count_seen_ = stats.num_requests; UMA_HISTOGRAM_COUNTS_1M( "Net.ResourceDispatcherHost.OutstandingRequests.PerProcess",
diff --git a/content/browser/media/android/media_resource_getter_impl.cc b/content/browser/media/android/media_resource_getter_impl.cc index 662bcf32..5d737ba 100644 --- a/content/browser/media/android/media_resource_getter_impl.cc +++ b/content/browser/media/android/media_resource_getter_impl.cc
@@ -4,7 +4,6 @@ #include "content/browser/media/android/media_resource_getter_impl.h" -#include "base/android/context_utils.h" #include "base/android/jni_android.h" #include "base/android/jni_string.h" #include "base/android/scoped_java_ref.h" @@ -123,12 +122,11 @@ ScopedJavaLocalRef<jstring> j_url_string = ConvertUTF8ToJavaString(env, url); ScopedJavaLocalRef<jstring> j_cookies = ConvertUTF8ToJavaString(env, cookies); - const JavaRef<jobject>& j_context = base::android::GetApplicationContext(); ScopedJavaLocalRef<jstring> j_user_agent = ConvertUTF8ToJavaString( env, user_agent); ScopedJavaLocalRef<jobject> j_metadata = - Java_MediaResourceGetter_extractMediaMetadata( - env, j_context, j_url_string, j_cookies, j_user_agent); + Java_MediaResourceGetter_extractMediaMetadata(env, j_url_string, + j_cookies, j_user_agent); PostMediaMetadataCallbackTask(callback, env, j_metadata); }
diff --git a/content/browser/media/session/audio_focus_delegate_android.cc b/content/browser/media/session/audio_focus_delegate_android.cc index d96d3c8..e778f71f 100644 --- a/content/browser/media/session/audio_focus_delegate_android.cc +++ b/content/browser/media/session/audio_focus_delegate_android.cc
@@ -4,7 +4,6 @@ #include "content/browser/media/session/audio_focus_delegate_android.h" -#include "base/android/context_utils.h" #include "base/android/jni_android.h" #include "content/browser/media/session/media_session_impl.h" #include "jni/AudioFocusDelegate_jni.h" @@ -31,9 +30,8 @@ void AudioFocusDelegateAndroid::Initialize() { JNIEnv* env = base::android::AttachCurrentThread(); DCHECK(env); - j_media_session_delegate_.Reset(Java_AudioFocusDelegate_create( - env, base::android::GetApplicationContext(), - reinterpret_cast<intptr_t>(this))); + j_media_session_delegate_.Reset( + Java_AudioFocusDelegate_create(env, reinterpret_cast<intptr_t>(this))); } bool AudioFocusDelegateAndroid::RequestAudioFocus(
diff --git a/content/browser/memory/memory_monitor_android.cc b/content/browser/memory/memory_monitor_android.cc index d351c9a..260a91a 100644 --- a/content/browser/memory/memory_monitor_android.cc +++ b/content/browser/memory/memory_monitor_android.cc
@@ -4,7 +4,6 @@ #include "content/browser/memory/memory_monitor_android.h" -#include "base/android/context_utils.h" #include "base/android/jni_android.h" #include "base/memory/ptr_util.h" #include "content/browser/memory/memory_coordinator_impl.h" @@ -18,8 +17,7 @@ void RegisterComponentCallbacks() { Java_MemoryMonitorAndroid_registerComponentCallbacks( - base::android::AttachCurrentThread(), - base::android::GetApplicationContext()); + base::android::AttachCurrentThread()); } } @@ -40,9 +38,7 @@ void MemoryMonitorAndroidDelegateImpl::GetMemoryInfo(MemoryInfo* out) { DCHECK(out); JNIEnv* env = base::android::AttachCurrentThread(); - Java_MemoryMonitorAndroid_getMemoryInfo( - env, base::android::GetApplicationContext(), - reinterpret_cast<intptr_t>(out)); + Java_MemoryMonitorAndroid_getMemoryInfo(env, reinterpret_cast<intptr_t>(out)); } // Called by JNI to populate ActivityManager.MemoryInfo.
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc index 4c3471f..5275ebf 100644 --- a/content/browser/renderer_host/render_widget_host_view_android.cc +++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -10,7 +10,6 @@ #include "base/android/application_status_listener.h" #include "base/android/build_info.h" -#include "base/android/context_utils.h" #include "base/bind.h" #include "base/callback_helpers.h" #include "base/command_line.h" @@ -1320,13 +1319,12 @@ } base::android::ScopedJavaLocalRef<jobject> activityContext = content_view_core_->GetContext(); + // If activityContext is null then Application context is used instead on + // the java side in CompositedTouchHandleDrawable. return std::unique_ptr<ui::TouchHandleDrawable>( new CompositedTouchHandleDrawable( content_view_core_->GetViewAndroid()->GetLayer(), view_.GetDipScale(), - // Use the activity context where possible (instead of the application - // context) to ensure proper handle theming. - activityContext.is_null() ? base::android::GetApplicationContext() - : activityContext)); + activityContext)); } void RenderWidgetHostViewAndroid::SynchronousCopyContents(
diff --git a/content/browser/site_per_process_browsertest.cc b/content/browser/site_per_process_browsertest.cc index 44876e7..a8a26b9 100644 --- a/content/browser/site_per_process_browsertest.cc +++ b/content/browser/site_per_process_browsertest.cc
@@ -716,8 +716,9 @@ SitePerProcessBrowserTest::SetUpCommandLine(command_line); // TODO(iclelland): Remove this switch when Feature Policy ships. // https://crbug.com/623682 - command_line->AppendSwitchASCII(switches::kEnableBlinkFeatures, - "FeaturePolicy"); + command_line->AppendSwitchASCII( + switches::kEnableBlinkFeatures, + "FeaturePolicy,FeaturePolicyExperimentalFeatures"); } ParsedFeaturePolicyHeader CreateFPHeader(
diff --git a/content/browser/speech/speech_recognizer_impl_android.cc b/content/browser/speech/speech_recognizer_impl_android.cc index 5862e28..143fa81c 100644 --- a/content/browser/speech/speech_recognizer_impl_android.cc +++ b/content/browser/speech/speech_recognizer_impl_android.cc
@@ -6,7 +6,6 @@ #include <stddef.h> -#include "base/android/context_utils.h" #include "base/android/jni_android.h" #include "base/android/jni_array.h" #include "base/android/jni_string.h" @@ -24,7 +23,6 @@ using base::android::AppendJavaStringArrayToStringVector; using base::android::AttachCurrentThread; using base::android::ConvertUTF8ToJavaString; -using base::android::GetApplicationContext; using base::android::JavaFloatArrayToFloatVector; using base::android::JavaParamRef; @@ -60,8 +58,8 @@ bool interim_results) { DCHECK_CURRENTLY_ON(BrowserThread::UI); JNIEnv* env = AttachCurrentThread(); - j_recognition_.Reset(Java_SpeechRecognition_createSpeechRecognition(env, - GetApplicationContext(), reinterpret_cast<intptr_t>(this))); + j_recognition_.Reset(Java_SpeechRecognition_createSpeechRecognition( + env, reinterpret_cast<intptr_t>(this))); Java_SpeechRecognition_startRecognition( env, j_recognition_, ConvertUTF8ToJavaString(env, language), continuous, interim_results);
diff --git a/content/public/android/java/src/org/chromium/content/browser/AudioFocusDelegate.java b/content/public/android/java/src/org/chromium/content/browser/AudioFocusDelegate.java index 2642433..af80591 100644 --- a/content/public/android/java/src/org/chromium/content/browser/AudioFocusDelegate.java +++ b/content/public/android/java/src/org/chromium/content/browser/AudioFocusDelegate.java
@@ -7,6 +7,7 @@ import android.content.Context; import android.media.AudioManager; +import org.chromium.base.ContextUtils; import org.chromium.base.Log; import org.chromium.base.ThreadUtils; import org.chromium.base.annotations.CalledByNative; @@ -27,7 +28,6 @@ public class AudioFocusDelegate implements AudioManager.OnAudioFocusChangeListener { private static final String TAG = "MediaSession"; - private Context mContext; private int mFocusType; private boolean mIsDucking; @@ -35,15 +35,13 @@ // It will be set to 0 when the native AudioFocusDelegateAndroid object is destroyed. private long mNativeAudioFocusDelegateAndroid; - private AudioFocusDelegate(final Context context, long nativeAudioFocusDelegateAndroid) { - mContext = context; + private AudioFocusDelegate(long nativeAudioFocusDelegateAndroid) { mNativeAudioFocusDelegateAndroid = nativeAudioFocusDelegateAndroid; } @CalledByNative - private static AudioFocusDelegate create( - Context context, long nativeAudioFocusDelegateAndroid) { - return new AudioFocusDelegate(context, nativeAudioFocusDelegateAndroid); + private static AudioFocusDelegate create(long nativeAudioFocusDelegateAndroid) { + return new AudioFocusDelegate(nativeAudioFocusDelegateAndroid); } @CalledByNative @@ -64,12 +62,14 @@ @CalledByNative private void abandonAudioFocus() { assert ThreadUtils.runningOnUiThread(); - AudioManager am = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE); + AudioManager am = (AudioManager) ContextUtils.getApplicationContext().getSystemService( + Context.AUDIO_SERVICE); am.abandonAudioFocus(this); } private boolean requestAudioFocusInternal() { - AudioManager am = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE); + AudioManager am = (AudioManager) ContextUtils.getApplicationContext().getSystemService( + Context.AUDIO_SERVICE); int result = am.requestAudioFocus(this, AudioManager.STREAM_MUSIC, mFocusType); return result == AudioManager.AUDIOFOCUS_REQUEST_GRANTED;
diff --git a/content/public/android/java/src/org/chromium/content/browser/BackgroundSyncNetworkObserver.java b/content/public/android/java/src/org/chromium/content/browser/BackgroundSyncNetworkObserver.java index 0415911..fc1bb9a 100644 --- a/content/public/android/java/src/org/chromium/content/browser/BackgroundSyncNetworkObserver.java +++ b/content/public/android/java/src/org/chromium/content/browser/BackgroundSyncNetworkObserver.java
@@ -5,11 +5,11 @@ package org.chromium.content.browser; import android.Manifest; -import android.content.Context; import android.content.pm.PackageManager; import android.os.Process; import org.chromium.base.ApiCompatibilityUtils; +import org.chromium.base.ContextUtils; import org.chromium.base.ThreadUtils; import org.chromium.base.annotations.CalledByNative; import org.chromium.base.annotations.JNINamespace; @@ -38,7 +38,6 @@ private static final String TAG = "cr_BgSyncNetObserver"; private NetworkChangeNotifierAutoDetect mNotifier; - private Context mContext; // The singleton instance. private static BackgroundSyncNetworkObserver sInstance; @@ -46,22 +45,22 @@ // List of native observers. These are each called when the network state changes. private List<Long> mNativePtrs; - private BackgroundSyncNetworkObserver(Context ctx) { + private BackgroundSyncNetworkObserver() { ThreadUtils.assertOnUiThread(); - mContext = ctx; mNativePtrs = new ArrayList<Long>(); } - private static boolean canCreateObserver(Context ctx) { - return ApiCompatibilityUtils.checkPermission(ctx, Manifest.permission.ACCESS_NETWORK_STATE, - Process.myPid(), Process.myUid()) == PackageManager.PERMISSION_GRANTED; + private static boolean canCreateObserver() { + return ApiCompatibilityUtils.checkPermission(ContextUtils.getApplicationContext(), + Manifest.permission.ACCESS_NETWORK_STATE, Process.myPid(), Process.myUid()) + == PackageManager.PERMISSION_GRANTED; } @CalledByNative - private static BackgroundSyncNetworkObserver createObserver(Context ctx, long nativePtr) { + private static BackgroundSyncNetworkObserver createObserver(long nativePtr) { ThreadUtils.assertOnUiThread(); if (sInstance == null) { - sInstance = new BackgroundSyncNetworkObserver(ctx); + sInstance = new BackgroundSyncNetworkObserver(); } sInstance.registerObserver(nativePtr); return sInstance; @@ -69,7 +68,7 @@ private void registerObserver(final long nativePtr) { ThreadUtils.assertOnUiThread(); - if (!canCreateObserver(mContext)) { + if (!canCreateObserver()) { RecordHistogram.recordBooleanHistogram( "BackgroundSync.NetworkObserver.HasPermission", false); return; @@ -77,8 +76,8 @@ // Create the NetworkChangeNotifierAutoDetect if it does not exist already. if (mNotifier == null) { - mNotifier = new NetworkChangeNotifierAutoDetect(this, mContext, - new RegistrationPolicyAlwaysRegister()); + mNotifier = new NetworkChangeNotifierAutoDetect( + this, new RegistrationPolicyAlwaysRegister()); RecordHistogram.recordBooleanHistogram( "BackgroundSync.NetworkObserver.HasPermission", true); }
diff --git a/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncherHelper.java b/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncherHelper.java index 9d8845b..cd0f0703 100644 --- a/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncherHelper.java +++ b/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncherHelper.java
@@ -49,21 +49,20 @@ } @CalledByNative - private static ChildProcessLauncherHelper create(long nativePointer, Context context, - int paramId, final String[] commandLine, int childProcessId, - FileDescriptorInfo[] filesToBeMapped) { + private static ChildProcessLauncherHelper create(long nativePointer, int paramId, + final String[] commandLine, int childProcessId, FileDescriptorInfo[] filesToBeMapped) { assert LauncherThread.runningOnLauncherThread(); return new ChildProcessLauncherHelper( - nativePointer, context, paramId, commandLine, childProcessId, filesToBeMapped); + nativePointer, paramId, commandLine, childProcessId, filesToBeMapped); } - private ChildProcessLauncherHelper(long nativePointer, Context context, int paramId, - final String[] commandLine, int childProcessId, FileDescriptorInfo[] filesToBeMapped) { + private ChildProcessLauncherHelper(long nativePointer, int paramId, final String[] commandLine, + int childProcessId, FileDescriptorInfo[] filesToBeMapped) { assert LauncherThread.runningOnLauncherThread(); mNativeChildProcessLauncherHelper = nativePointer; - ChildProcessLauncher.start(context, paramId, commandLine, childProcessId, filesToBeMapped, - new ChildProcessLauncher.LaunchCallback() { + ChildProcessLauncher.start(ContextUtils.getApplicationContext(), paramId, commandLine, + childProcessId, filesToBeMapped, new ChildProcessLauncher.LaunchCallback() { @Override public void onChildProcessStarted(int pid) { mPid = pid;
diff --git a/content/public/android/java/src/org/chromium/content/browser/InterfaceRegistrarImpl.java b/content/public/android/java/src/org/chromium/content/browser/InterfaceRegistrarImpl.java index 0e8df902..7873733 100644 --- a/content/public/android/java/src/org/chromium/content/browser/InterfaceRegistrarImpl.java +++ b/content/public/android/java/src/org/chromium/content/browser/InterfaceRegistrarImpl.java
@@ -27,12 +27,12 @@ private static boolean sHasRegisteredRegistrars; @CalledByNative - static void createInterfaceRegistryForContext(int nativeHandle, Context applicationContext) { + static void createInterfaceRegistryForContext(int nativeHandle) { ensureContentRegistrarsAreRegistered(); InterfaceRegistry registry = InterfaceRegistry.create( CoreImpl.getInstance().acquireNativeHandle(nativeHandle).toMessagePipeHandle()); - InterfaceRegistrar.Registry.applyContextRegistrars(registry, applicationContext); + InterfaceRegistrar.Registry.applyContextRegistrars(registry); } @CalledByNative
diff --git a/content/public/android/java/src/org/chromium/content/browser/MediaResourceGetter.java b/content/public/android/java/src/org/chromium/content/browser/MediaResourceGetter.java index bad3279..3f34048 100644 --- a/content/public/android/java/src/org/chromium/content/browser/MediaResourceGetter.java +++ b/content/public/android/java/src/org/chromium/content/browser/MediaResourceGetter.java
@@ -14,6 +14,7 @@ import android.os.ParcelFileDescriptor; import android.text.TextUtils; +import org.chromium.base.ContextUtils; import org.chromium.base.Log; import org.chromium.base.PathUtils; import org.chromium.base.VisibleForTesting; @@ -112,12 +113,10 @@ } @CalledByNative - private static MediaMetadata extractMediaMetadata(final Context context, - final String url, - final String cookies, - final String userAgent) { + private static MediaMetadata extractMediaMetadata( + final String url, final String cookies, final String userAgent) { return new MediaResourceGetter().extract( - context, url, cookies, userAgent); + ContextUtils.getApplicationContext(), url, cookies, userAgent); } @CalledByNative
diff --git a/content/public/android/java/src/org/chromium/content/browser/MemoryMonitorAndroid.java b/content/public/android/java/src/org/chromium/content/browser/MemoryMonitorAndroid.java index 3c252c2..3cd56df 100644 --- a/content/public/android/java/src/org/chromium/content/browser/MemoryMonitorAndroid.java +++ b/content/public/android/java/src/org/chromium/content/browser/MemoryMonitorAndroid.java
@@ -9,6 +9,7 @@ import android.content.Context; import android.content.res.Configuration; +import org.chromium.base.ContextUtils; import org.chromium.base.Log; import org.chromium.base.annotations.CalledByNative; import org.chromium.base.annotations.JNINamespace; @@ -30,14 +31,14 @@ * Get the current MemoryInfo from ActivityManager and invoke the native * callback to populate the MemoryInfo. * - * @param context The context of the application. * @param outPtr A native output pointer to populate MemoryInfo. This is * passed back to the native callback. */ @CalledByNative - private static void getMemoryInfo(Context context, long outPtr) { - ActivityManager am = (ActivityManager) context.getSystemService( - Context.ACTIVITY_SERVICE); + private static void getMemoryInfo(long outPtr) { + ActivityManager am = + (ActivityManager) ContextUtils.getApplicationContext().getSystemService( + Context.ACTIVITY_SERVICE); try { am.getMemoryInfo(sMemoryInfo); } catch (RuntimeException e) { @@ -59,10 +60,9 @@ /** * Register ComponentCallbacks2 to receive memory pressure signals. * - * @param context The context of the application. */ @CalledByNative - private static void registerComponentCallbacks(Context context) { + private static void registerComponentCallbacks() { sCallbacks = new ComponentCallbacks2() { @Override public void onTrimMemory(int level) { @@ -78,7 +78,7 @@ public void onConfigurationChanged(Configuration config) { } }; - context.registerComponentCallbacks(sCallbacks); + ContextUtils.getApplicationContext().registerComponentCallbacks(sCallbacks); } private static native void nativeGetMemoryInfoCallback(
diff --git a/content/public/android/java/src/org/chromium/content/browser/SpeechRecognition.java b/content/public/android/java/src/org/chromium/content/browser/SpeechRecognition.java index 41b253e..7ddb2bc 100644 --- a/content/public/android/java/src/org/chromium/content/browser/SpeechRecognition.java +++ b/content/public/android/java/src/org/chromium/content/browser/SpeechRecognition.java
@@ -17,6 +17,7 @@ import android.speech.RecognizerIntent; import android.speech.SpeechRecognizer; +import org.chromium.base.ContextUtils; import org.chromium.base.PackageUtils; import org.chromium.base.annotations.CalledByNative; import org.chromium.base.annotations.JNINamespace; @@ -50,7 +51,6 @@ // PROVIDER_MIN_VERSION as selected by initialize(). private static ComponentName sRecognitionProvider; - private final Context mContext; private final Intent mIntent; private final RecognitionListener mListener; private SpeechRecognizer mRecognizer; @@ -188,8 +188,10 @@ if (!service.packageName.equals(PROVIDER_PACKAGE_NAME)) continue; - if (PackageUtils.getPackageVersion(context, service.packageName) < PROVIDER_MIN_VERSION) + if (PackageUtils.getPackageVersion(context, service.packageName) + < PROVIDER_MIN_VERSION) { continue; + } sRecognitionProvider = new ComponentName(service.packageName, service.name); @@ -200,21 +202,22 @@ return false; } - private SpeechRecognition(final Context context, long nativeSpeechRecognizerImplAndroid) { - mContext = context; + private SpeechRecognition(long nativeSpeechRecognizerImplAndroid) { mContinuous = false; mNativeSpeechRecognizerImplAndroid = nativeSpeechRecognizerImplAndroid; mListener = new Listener(); mIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); if (sRecognitionProvider != null) { - mRecognizer = SpeechRecognizer.createSpeechRecognizer(mContext, sRecognitionProvider); + mRecognizer = SpeechRecognizer.createSpeechRecognizer( + ContextUtils.getApplicationContext(), sRecognitionProvider); } else { // It is possible to force-enable the speech recognition web platform feature (using a // command-line flag) even if initialize() failed to find the PROVIDER_PACKAGE_NAME // provider, in which case the first available speech recognition provider is used. // Caveat: Continuous mode may not work as expected with a different provider. - mRecognizer = SpeechRecognizer.createSpeechRecognizer(mContext); + mRecognizer = + SpeechRecognizer.createSpeechRecognizer(ContextUtils.getApplicationContext()); } mRecognizer.setRecognitionListener(mListener); @@ -244,8 +247,8 @@ @CalledByNative private static SpeechRecognition createSpeechRecognition( - Context context, long nativeSpeechRecognizerImplAndroid) { - return new SpeechRecognition(context, nativeSpeechRecognizerImplAndroid); + long nativeSpeechRecognizerImplAndroid) { + return new SpeechRecognition(nativeSpeechRecognizerImplAndroid); } @CalledByNative
diff --git a/content/public/android/java/src/org/chromium/content/browser/input/HandleViewResources.java b/content/public/android/java/src/org/chromium/content/browser/input/HandleViewResources.java index f4ad96f..e50d3b3 100644 --- a/content/public/android/java/src/org/chromium/content/browser/input/HandleViewResources.java +++ b/content/public/android/java/src/org/chromium/content/browser/input/HandleViewResources.java
@@ -13,6 +13,7 @@ import android.graphics.drawable.Drawable; import org.chromium.base.ApiCompatibilityUtils; +import org.chromium.base.ContextUtils; import org.chromium.base.annotations.CalledByNative; import org.chromium.base.annotations.JNINamespace; @@ -67,8 +68,12 @@ return drawable; } - private static Bitmap getHandleBitmap(Context context, final int[] attrs) { + private static Bitmap getHandleBitmap(Context activityContext, final int[] attrs) { // TODO(jdduke): Properly derive and apply theme color. + Context context = activityContext; + if (context == null) { + context = ContextUtils.getApplicationContext(); + } TypedArray a = context.getTheme().obtainStyledAttributes(attrs); final int resId = a.getResourceId(a.getIndex(0), 0); final Resources res = a.getResources();
diff --git a/content/public/android/java/src/org/chromium/content_public/browser/InterfaceRegistrar.java b/content/public/android/java/src/org/chromium/content_public/browser/InterfaceRegistrar.java index 131260b..55acd45 100644 --- a/content/public/android/java/src/org/chromium/content_public/browser/InterfaceRegistrar.java +++ b/content/public/android/java/src/org/chromium/content_public/browser/InterfaceRegistrar.java
@@ -6,6 +6,7 @@ import android.content.Context; +import org.chromium.base.ContextUtils; import org.chromium.services.service_manager.InterfaceRegistry; import java.util.ArrayList; @@ -30,12 +31,12 @@ private List<InterfaceRegistrar<ParamType>> mRegistrars = new ArrayList<InterfaceRegistrar<ParamType>>(); - public static void applyContextRegistrars( - InterfaceRegistry interfaceRegistry, Context context) { + public static void applyContextRegistrars(InterfaceRegistry interfaceRegistry) { if (sContextRegistry == null) { return; } - sContextRegistry.applyRegistrars(interfaceRegistry, context); + sContextRegistry.applyRegistrars( + interfaceRegistry, ContextUtils.getApplicationContext()); } public static void applyWebContentsRegistrars(
diff --git a/content/public/test/browser_test_base.cc b/content/public/test/browser_test_base.cc index a562bf0d..20b2bff 100644 --- a/content/public/test/browser_test_base.cc +++ b/content/public/test/browser_test_base.cc
@@ -18,6 +18,7 @@ #include "base/sys_info.h" #include "base/test/test_timeouts.h" #include "base/threading/sequenced_worker_pool.h" +#include "base/threading/thread_restrictions.h" #include "build/build_config.h" #include "content/browser/renderer_host/render_process_host_impl.h" #include "content/browser/tracing/tracing_controller_impl.h" @@ -145,7 +146,8 @@ : expected_exit_code_(0), enable_pixel_output_(false), use_software_compositing_(false), - set_up_called_(false) { + set_up_called_(false), + disable_io_checks_(false) { #if defined(OS_MACOSX) base::mac::SetOverrideAmIBundled(true); #endif @@ -343,7 +345,16 @@ // waiting. base::MessageLoop::ScopedNestableTaskAllower allow( base::MessageLoop::current()); - RunTestOnMainThreadLoop(); + PreRunTestOnMainThread(); + SetUpOnMainThread(); + bool old_io_allowed_value = false; + if (!disable_io_checks_) + base::ThreadRestrictions::SetIOAllowed(false); + RunTestOnMainThread(); + if (!disable_io_checks_) + base::ThreadRestrictions::SetIOAllowed(old_io_allowed_value); + TearDownOnMainThread(); + PostRunTestOnMainThread(); } if (base::CommandLine::ForCurrentProcess()->HasSwitch(
diff --git a/content/public/test/browser_test_base.h b/content/public/test/browser_test_base.h index 168ba75..a404d0f5 100644 --- a/content/public/test/browser_test_base.h +++ b/content/public/test/browser_test_base.h
@@ -67,13 +67,20 @@ // Override this for things you would normally override TearDown for. virtual void TearDownInProcessBrowserTestFixture() {} + // This is invoked from main after browser_init/browser_main have completed. + // This prepares for the test by creating a new browser and doing any other + // initialization. + // This is meant to be inherited only by the test harness. + virtual void PreRunTestOnMainThread() = 0; + // Override this rather than TestBody. + // Note this is internally called by the browser test macros. virtual void RunTestOnMainThread() = 0; - // This is invoked from main after browser_init/browser_main have completed. - // This prepares for the test by creating a new browser, runs the test - // (RunTestOnMainThread), quits the browsers and returns. - virtual void RunTestOnMainThreadLoop() = 0; + // This is invoked from main after RunTestOnMainThread has run, to give the + // harness a chance for post-test cleanup. + // This is meant to be inherited only by the test harness. + virtual void PostRunTestOnMainThread() = 0; // Sets expected browser exit code, in case it's different than 0 (success). void set_expected_exit_code(int code) { expected_exit_code_ = code; } @@ -124,6 +131,10 @@ // Returns true if the test will be using GL acceleration via a software GL. bool UsingSoftwareGL() const; + // Temporary + // TODO(jam): remove this. + void disable_io_checks() { disable_io_checks_ = true; } + private: void ProxyRunTestOnMainThreadLoop(); @@ -151,6 +162,11 @@ // not run and report a false positive result. bool set_up_called_; + // Tests should keep on the IO thread checks to test that production code + // paths don't make file access. Keep this for now since src/chrome didn't + // check this. + bool disable_io_checks_; + #if defined(OS_POSIX) bool handle_sigterm_; #endif
diff --git a/content/public/test/content_browser_test.cc b/content/public/test/content_browser_test.cc index c8f358b..3e49d308 100644 --- a/content/public/test/content_browser_test.cc +++ b/content/public/test/content_browser_test.cc
@@ -10,7 +10,6 @@ #include "base/message_loop/message_loop.h" #include "base/path_service.h" #include "base/run_loop.h" -#include "base/threading/thread_restrictions.h" #include "build/build_config.h" #include "content/public/browser/render_process_host.h" #include "content/public/common/content_paths.h" @@ -27,10 +26,6 @@ #include "content/shell/app/shell_main_delegate.h" #endif -#if defined(OS_MACOSX) -#include "base/mac/scoped_nsautorelease_pool.h" -#endif - #if !defined(OS_CHROMEOS) && defined(OS_LINUX) #include "ui/base/ime/input_method_initializer.h" #endif @@ -107,7 +102,7 @@ #endif } -void ContentBrowserTest::RunTestOnMainThreadLoop() { +void ContentBrowserTest::PreRunTestOnMainThread() { if (!switches::IsRunLayoutTestSwitchPresent()) { CHECK_EQ(Shell::windows().size(), 1u); shell_ = Shell::windows()[0]; @@ -121,7 +116,7 @@ // deallocation via an autorelease pool (such as browser window closure and // browser shutdown). To avoid this, the following pool is recycled after each // time code is directly executed. - base::mac::ScopedNSAutoreleasePool pool; + pool_ = new base::mac::ScopedNSAutoreleasePool; #endif // Pump startup related events. @@ -129,18 +124,13 @@ base::RunLoop().RunUntilIdle(); #if defined(OS_MACOSX) - pool.Recycle(); + pool_->Recycle(); #endif +} - SetUpOnMainThread(); - - bool old_io_allowed_value = base::ThreadRestrictions::SetIOAllowed(false); - RunTestOnMainThread(); - base::ThreadRestrictions::SetIOAllowed(old_io_allowed_value); - - TearDownOnMainThread(); +void ContentBrowserTest::PostRunTestOnMainThread() { #if defined(OS_MACOSX) - pool.Recycle(); + pool_->Recycle(); #endif for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator());
diff --git a/content/public/test/content_browser_test.h b/content/public/test/content_browser_test.h index b91b350f..44134f2 100644 --- a/content/public/test/content_browser_test.h +++ b/content/public/test/content_browser_test.h
@@ -11,6 +11,10 @@ #include "content/public/test/browser_test.h" #include "content/public/test/browser_test_base.h" +#if defined(OS_MACOSX) +#include "base/mac/scoped_nsautorelease_pool.h" +#endif + namespace content { class Shell; class ShellMainDelegate; @@ -26,7 +30,8 @@ void TearDown() override; // BrowserTestBase: - void RunTestOnMainThreadLoop() override; + void PreRunTestOnMainThread() override; + void PostRunTestOnMainThread() override; protected: // Creates a new window and loads about:blank. @@ -41,6 +46,17 @@ private: Shell* shell_; +#if defined(OS_MACOSX) + // On Mac, without the following autorelease pool, code which is directly + // executed (as opposed to executed inside a message loop) would autorelease + // objects into a higher-level pool. This pool is not recycled in-sync with + // the message loops' pools and causes problems with code relying on + // deallocation via an autorelease pool (such as browser window closure and + // browser shutdown). To avoid this, the following pool is recycled after each + // time code is directly executed. + base::mac::ScopedNSAutoreleasePool* pool_ = nullptr; +#endif + #if defined(OS_ANDROID) // For all other platforms, this is done automatically when calling into // ContentMain. For Android we set things up manually.
diff --git a/content/public/test/navigation_simulator.cc b/content/public/test/navigation_simulator.cc index a83df10f..c2bc5cf 100644 --- a/content/public/test/navigation_simulator.cc +++ b/content/public/test/navigation_simulator.cc
@@ -155,9 +155,7 @@ if (GetLastThrottleCheckResult() == NavigationThrottle::PROCEED) { CHECK_EQ(1, num_will_start_request_called_); } else { - // TODO(clamy): Add error handling code based on the - // NavigationThrottleCheckResult here and in other methods. - state_ = FAILED; + FailFromThrottleCheck(GetLastThrottleCheckResult()); } } @@ -216,7 +214,7 @@ CHECK_EQ(previous_did_redirect_navigation_called + 1, num_did_redirect_navigation_called_); } else { - state_ = FAILED; + FailFromThrottleCheck(GetLastThrottleCheckResult()); } } @@ -260,7 +258,7 @@ WaitForThrottleChecksComplete(); if (GetLastThrottleCheckResult() != NavigationThrottle::PROCEED) { - state_ = FAILED; + FailFromThrottleCheck(GetLastThrottleCheckResult()); return; } @@ -571,4 +569,46 @@ return render_frame_host_; } +void NavigationSimulator::FailFromThrottleCheck( + NavigationThrottle::ThrottleCheckResult result) { + DCHECK_NE(result, NavigationThrottle::PROCEED); + state_ = FAILED; + + // Special failure logic only needed for non-PlzNavigate case. + if (IsBrowserSideNavigationEnabled()) + return; + int error_code = net::OK; + switch (result) { + case NavigationThrottle::PROCEED: + case NavigationThrottle::DEFER: + NOTREACHED(); + break; + case NavigationThrottle::CANCEL: + case NavigationThrottle::CANCEL_AND_IGNORE: + error_code = net::ERR_ABORTED; + break; + case NavigationThrottle::BLOCK_REQUEST: + error_code = net::ERR_BLOCKED_BY_CLIENT; + break; + case NavigationThrottle::BLOCK_RESPONSE: + error_code = net::ERR_BLOCKED_BY_RESPONSE; + break; + }; + + FrameHostMsg_DidFailProvisionalLoadWithError_Params error_params; + error_params.error_code = error_code; + error_params.url = navigation_url_; + render_frame_host_->OnMessageReceived( + FrameHostMsg_DidFailProvisionalLoadWithError( + render_frame_host_->GetRoutingID(), error_params)); + bool should_result_in_error_page = error_code != net::ERR_ABORTED; + if (!should_result_in_error_page) { + render_frame_host_->OnMessageReceived( + FrameHostMsg_DidStopLoading(render_frame_host_->GetRoutingID())); + CHECK_EQ(1, num_did_finish_navigation_called_); + } else { + CHECK_EQ(0, num_did_finish_navigation_called_); + } +} + } // namespace content
diff --git a/content/public/test/navigation_simulator.h b/content/public/test/navigation_simulator.h index e239168e..ac76f92 100644 --- a/content/public/test/navigation_simulator.h +++ b/content/public/test/navigation_simulator.h
@@ -167,6 +167,11 @@ // NavigationHandle. void PrepareCompleteCallbackOnHandle(); + // Simulates the DidFailProvisionalLoad IPC following a NavigationThrottle + // cancelling the navigation. + // PlzNavigate: this is not needed. + void FailFromThrottleCheck(NavigationThrottle::ThrottleCheckResult result); + enum State { INITIALIZATION, STARTED,
diff --git a/content/renderer/input/input_event_filter_unittest.cc b/content/renderer/input/input_event_filter_unittest.cc index e52bfd4..7c33174 100644 --- a/content/renderer/input/input_event_filter_unittest.cc +++ b/content/renderer/input/input_event_filter_unittest.cc
@@ -259,8 +259,8 @@ } void RegisterRoute() { - input_event_queue_ = - new MainThreadEventQueue(this, main_task_runner_, &renderer_scheduler_); + input_event_queue_ = new MainThreadEventQueue(this, main_task_runner_, + &renderer_scheduler_, true); filter_->RegisterRoutingID(kTestRoutingID, input_event_queue_); }
diff --git a/content/renderer/input/main_thread_event_queue.cc b/content/renderer/input/main_thread_event_queue.cc index 1e43d59..94d1d49 100644 --- a/content/renderer/input/main_thread_event_queue.cc +++ b/content/renderer/input/main_thread_event_queue.cc
@@ -201,7 +201,8 @@ MainThreadEventQueue::MainThreadEventQueue( MainThreadEventQueueClient* client, const scoped_refptr<base::SingleThreadTaskRunner>& main_task_runner, - blink::scheduler::RendererScheduler* renderer_scheduler) + blink::scheduler::RendererScheduler* renderer_scheduler, + bool allow_raf_aligned_input) : client_(client), last_touch_start_forced_nonblocking_due_to_fling_(false), enable_fling_passive_listener_flag_(base::FeatureList::IsEnabled( @@ -210,8 +211,10 @@ base::FeatureList::IsEnabled( features::kMainThreadBusyScrollIntervention)), handle_raf_aligned_touch_input_( + allow_raf_aligned_input && base::FeatureList::IsEnabled(features::kRafAlignedTouchInputEvents)), handle_raf_aligned_mouse_input_( + allow_raf_aligned_input && base::FeatureList::IsEnabled(features::kRafAlignedMouseInputEvents)), main_task_runner_(main_task_runner), renderer_scheduler_(renderer_scheduler) { @@ -341,13 +344,6 @@ PostTaskToMainThread(); } -void MainThreadEventQueue::DispatchInFlightEvent() { - if (in_flight_event_) { - in_flight_event_->Dispatch(this); - in_flight_event_.reset(); - } -} - void MainThreadEventQueue::PossiblyScheduleMainFrame() { if (IsRafAlignedInputDisabled()) return; @@ -383,15 +379,16 @@ } while (events_to_process--) { + std::unique_ptr<MainThreadEventQueueTask> task; { base::AutoLock lock(shared_state_lock_); if (shared_state_.events_.empty()) return; - in_flight_event_ = shared_state_.events_.Pop(); + task = shared_state_.events_.Pop(); } // Dispatching the event is outside of critical section. - DispatchInFlightEvent(); + task->Dispatch(this); } PossiblyScheduleMainFrame(); } @@ -424,6 +421,7 @@ } while (queue_size_at_start--) { + std::unique_ptr<MainThreadEventQueueTask> task; { base::AutoLock lock(shared_state_lock_); @@ -442,11 +440,10 @@ shared_state_.last_async_touch_move_timestamp_ = frame_time; } } - in_flight_event_ = shared_state_.events_.Pop(); + task = shared_state_.events_.Pop(); } - // Dispatching the event is outside of critical section. - DispatchInFlightEvent(); + task->Dispatch(this); } PossiblyScheduleMainFrame();
diff --git a/content/renderer/input/main_thread_event_queue.h b/content/renderer/input/main_thread_event_queue.h index 5a8e652..5001f04 100644 --- a/content/renderer/input/main_thread_event_queue.h +++ b/content/renderer/input/main_thread_event_queue.h
@@ -81,7 +81,8 @@ MainThreadEventQueue( MainThreadEventQueueClient* client, const scoped_refptr<base::SingleThreadTaskRunner>& main_task_runner, - blink::scheduler::RendererScheduler* renderer_scheduler); + blink::scheduler::RendererScheduler* renderer_scheduler, + bool allow_raf_aligned_input); // Called once the compositor has handled |event| and indicated that it is // a non-blocking event to be queued to the main thread. @@ -100,7 +101,6 @@ void QueueEvent(std::unique_ptr<MainThreadEventQueueTask> event); void PostTaskToMainThread(); void DispatchEvents(); - void DispatchInFlightEvent(); void PossiblyScheduleMainFrame(); void SetNeedsMainFrame(); InputEventAckState HandleEventOnMainThread( @@ -123,7 +123,6 @@ friend class MainThreadEventQueueTest; friend class MainThreadEventQueueInitializationTest; MainThreadEventQueueClient* client_; - std::unique_ptr<MainThreadEventQueueTask> in_flight_event_; bool last_touch_start_forced_nonblocking_due_to_fling_; bool enable_fling_passive_listener_flag_; bool enable_non_blocking_due_to_main_thread_responsiveness_flag_;
diff --git a/content/renderer/input/main_thread_event_queue_unittest.cc b/content/renderer/input/main_thread_event_queue_unittest.cc index f7bd1b0..7ab0207 100644 --- a/content/renderer/input/main_thread_event_queue_unittest.cc +++ b/content/renderer/input/main_thread_event_queue_unittest.cc
@@ -116,8 +116,8 @@ } void SetUp() override { - queue_ = - new MainThreadEventQueue(this, main_task_runner_, &renderer_scheduler_); + queue_ = new MainThreadEventQueue(this, main_task_runner_, + &renderer_scheduler_, true); } bool HandleEvent(WebInputEvent& event, InputEventAckState ack_result) { @@ -915,8 +915,8 @@ base::FieldTrialList::CreateFieldTrial( "MainThreadResponsivenessScrollIntervention", "Enabled123"); - queue_ = - new MainThreadEventQueue(this, main_task_runner_, &renderer_scheduler_); + queue_ = new MainThreadEventQueue(this, main_task_runner_, + &renderer_scheduler_, true); EXPECT_TRUE(enable_non_blocking_due_to_main_thread_responsiveness_flag()); EXPECT_EQ(base::TimeDelta::FromMilliseconds(123), main_thread_responsiveness_threshold()); @@ -926,8 +926,8 @@ MainThreadResponsivenessThresholdDisabled) { base::FieldTrialList::CreateFieldTrial( "MainThreadResponsivenessScrollIntervention", "Control"); - queue_ = - new MainThreadEventQueue(this, main_task_runner_, &renderer_scheduler_); + queue_ = new MainThreadEventQueue(this, main_task_runner_, + &renderer_scheduler_, true); EXPECT_FALSE(enable_non_blocking_due_to_main_thread_responsiveness_flag()); EXPECT_EQ(base::TimeDelta::FromMilliseconds(0), main_thread_responsiveness_threshold());
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc index c3d32c31..f7fec29 100644 --- a/content/renderer/render_widget.cc +++ b/content/renderer/render_widget.cc
@@ -1312,7 +1312,9 @@ #endif // For background pages and certain tests, we don't want to trigger // CompositorFrameSink creation. - if (compositor_never_visible_ || !RenderThreadImpl::current()) + bool should_generate_frame_sink = + !compositor_never_visible_ && RenderThreadImpl::current(); + if (!should_generate_frame_sink) compositor_->SetNeverVisible(); StartCompositor(); @@ -1327,7 +1329,7 @@ if (input_handler_manager) { input_event_queue_ = new MainThreadEventQueue( this, render_thread->GetRendererScheduler()->CompositorTaskRunner(), - render_thread->GetRendererScheduler()); + render_thread->GetRendererScheduler(), should_generate_frame_sink); input_handler_manager->AddInputHandler( routing_id_, compositor()->GetInputHandler(), input_event_queue_, weak_ptr_factory_.GetWeakPtr(),
diff --git a/content/shell/browser/layout_test/scoped_android_configuration.cc b/content/shell/browser/layout_test/scoped_android_configuration.cc index 1cdb4d5..90b3225 100644 --- a/content/shell/browser/layout_test/scoped_android_configuration.cc +++ b/content/shell/browser/layout_test/scoped_android_configuration.cc
@@ -8,7 +8,6 @@ #include <iostream> #include <memory> -#include "base/android/context_utils.h" #include "base/android/jni_android.h" #include "base/android/jni_string.h" #include "base/command_line.h"
diff --git a/content/test/gpu/generate_buildbot_json.py b/content/test/gpu/generate_buildbot_json.py index 5c4d8a38..f32b73f 100755 --- a/content/test/gpu/generate_buildbot_json.py +++ b/content/test/gpu/generate_buildbot_json.py
@@ -1470,13 +1470,6 @@ 'os_types': ['android'], }, ], - 'args': [ - '--enable-gpu', - '--test-launcher-jobs=1', - '--test-launcher-filter-file=../../testing/buildbot/filters/' + \ - 'tab-capture-end2end-tests.browser_tests.filter', - ], - 'test': 'browser_tests', }, 'video_decode_accelerator_d3d11_unittest': { 'tester_configs': [ @@ -1555,8 +1548,8 @@ 'args': [ '--enable-gpu', '--test-launcher-jobs=1', - '--test-launcher-filter-file=../../testing/buildbot/filters/' + \ - 'tab-capture-end2end-tests.browser_tests.filter', + '--gtest_filter=CastStreamingApiTestWithPixelOutput.EndToEnd*:' + \ + 'TabCaptureApiPixelTest.EndToEnd*' ], 'swarming': { 'can_use_on_swarming_builders': False,
diff --git a/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py b/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py index 029b7420..179d0ed 100644 --- a/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py +++ b/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py
@@ -223,6 +223,9 @@ self.Fail('conformance2/glsl3/vector-dynamic-indexing-swizzled-lvalue.html', ['mac'], bug=709351) self.Fail('conformance2/rendering/' + + 'blitframebuffer-resolve-to-back-buffer.html', + ['mac'], bug=699566) + self.Fail('conformance2/rendering/' + 'framebuffer-completeness-unaffected.html', ['mac'], bug=630800) self.Fail('deqp/functional/gles3/fbocompleteness.html',
diff --git a/content/test/navigation_simulator_unittest.cc b/content/test/navigation_simulator_unittest.cc index 27638b79..8148502 100644 --- a/content/test/navigation_simulator_unittest.cc +++ b/content/test/navigation_simulator_unittest.cc
@@ -4,13 +4,22 @@ #include "content/public/test/navigation_simulator.h" +#include <string> +#include <tuple> + +#include "base/bind.h" +#include "base/macros.h" #include "base/memory/weak_ptr.h" #include "base/run_loop.h" +#include "content/public/browser/browser_thread.h" #include "content/public/browser/navigation_handle.h" #include "content/public/browser/navigation_throttle.h" +#include "content/public/browser/web_contents_observer.h" #include "content/test/test_render_frame_host.h" +#include "content/test/test_render_view_host.h" #include "content/test/test_web_contents.h" #include "testing/gtest/include/gtest/gtest.h" +#include "url/gurl.h" namespace content { @@ -45,6 +54,7 @@ return sync == SYNCHRONOUS ? "SYNCHRONOUS" : "ASYNCHRONOUS"; } +// TODO(csharrison): Expose this class in the content public API. class CancellingNavigationThrottle : public NavigationThrottle { public: CancellingNavigationThrottle(NavigationHandle* handle, @@ -88,9 +98,12 @@ navigation_handle()->Resume(); } + private: const CancelTime cancel_time_; const ResultSynchrony sync_; base::WeakPtrFactory<CancellingNavigationThrottle> weak_ptr_factory_; + + DISALLOW_COPY_AND_ASSIGN(CancellingNavigationThrottle); }; class NavigationSimulatorTest : public RenderViewHostImplTestHarness, @@ -98,6 +111,9 @@ public testing::WithParamInterface< std::tuple<CancelTime, ResultSynchrony>> { public: + NavigationSimulatorTest() {} + ~NavigationSimulatorTest() override {} + void SetUp() override { RenderViewHostImplTestHarness::SetUp(); contents()->GetMainFrame()->InitializeRenderFrameIfNeeded(); @@ -107,15 +123,28 @@ GURL("https://example.test"), main_rfh()); } + void TearDown() override { + EXPECT_TRUE(did_finish_navigation_); + RenderViewHostImplTestHarness::TearDown(); + } + void DidStartNavigation(content::NavigationHandle* handle) override { handle->RegisterThrottleForTesting( base::MakeUnique<CancellingNavigationThrottle>(handle, cancel_time_, sync_)); } + void DidFinishNavigation(content::NavigationHandle* handle) override { + did_finish_navigation_ = true; + } + CancelTime cancel_time_; ResultSynchrony sync_; std::unique_ptr<NavigationSimulator> simulator_; + bool did_finish_navigation_ = false; + + private: + DISALLOW_COPY_AND_ASSIGN(NavigationSimulatorTest); }; // Stress test the navigation simulator by having a navigation throttle cancel
diff --git a/extensions/browser/extension_protocols.cc b/extensions/browser/extension_protocols.cc index ef0c65a5..1c9e2a6 100644 --- a/extensions/browser/extension_protocols.cc +++ b/extensions/browser/extension_protocols.cc
@@ -202,10 +202,6 @@ *info = response_info_; } - // This always returns 200 because a URLRequestExtensionJob will only get - // created in MaybeCreateJob() if the file exists. - int GetResponseCode() const override { return 200; } - void Start() override { request_timer_.reset(new base::ElapsedTimer()); base::FilePath* read_file_path = new base::FilePath;
diff --git a/extensions/browser/guest_view/web_view/web_view_apitest.cc b/extensions/browser/guest_view/web_view/web_view_apitest.cc index bce35f7..6206dd12 100644 --- a/extensions/browser/guest_view/web_view/web_view_apitest.cc +++ b/extensions/browser/guest_view/web_view/web_view_apitest.cc
@@ -29,6 +29,7 @@ #include "extensions/common/extension.h" #include "extensions/common/extension_paths.h" #include "extensions/common/switches.h" +#include "extensions/shell/browser/desktop_controller.h" #include "extensions/shell/browser/shell_content_browser_client.h" #include "extensions/shell/browser/shell_extension_system.h" #include "extensions/shell/test/shell_test.h" @@ -175,11 +176,6 @@ ASSERT_TRUE(done_listener.WaitUntilSatisfied()); } -void WebViewAPITest::RunTestOnMainThreadLoop() { - AppShellTest::RunTestOnMainThreadLoop(); - GetGuestViewManager()->WaitForAllGuestsDeleted(); -} - void WebViewAPITest::SetUpCommandLine(base::CommandLine* command_line) { AppShellTest::SetUpCommandLine(command_line); command_line->AppendSwitchASCII(::switches::kJavaScriptFlags, "--expose-gc"); @@ -236,6 +232,8 @@ } void WebViewAPITest::TearDownOnMainThread() { + DesktopController::instance()->CloseAppWindows(); + GetGuestViewManager()->WaitForAllGuestsDeleted(); TestGetConfigFunction::set_test_config_state(nullptr); AppShellTest::TearDownOnMainThread();
diff --git a/extensions/browser/guest_view/web_view/web_view_apitest.h b/extensions/browser/guest_view/web_view/web_view_apitest.h index ed182b3..7285124b 100644 --- a/extensions/browser/guest_view/web_view/web_view_apitest.h +++ b/extensions/browser/guest_view/web_view/web_view_apitest.h
@@ -44,7 +44,6 @@ void SendMessageToEmbedder(const std::string& message); // content::BrowserTestBase implementation. - void RunTestOnMainThreadLoop() override; void SetUpCommandLine(base::CommandLine* command_line) override; void SetUpOnMainThread() override; void TearDownOnMainThread() override;
diff --git a/extensions/shell/test/shell_test.cc b/extensions/shell/test/shell_test.cc index 0d505513..a6930d9 100644 --- a/extensions/shell/test/shell_test.cc +++ b/extensions/shell/test/shell_test.cc
@@ -47,24 +47,20 @@ content::BrowserTestBase::SetUp(); } -void AppShellTest::SetUpOnMainThread() { +void AppShellTest::PreRunTestOnMainThread() { browser_context_ = ShellContentBrowserClient::Get()->GetBrowserContext(); extension_system_ = static_cast<ShellExtensionSystem*>( ExtensionSystem::Get(browser_context_)); extension_system_->Init(); -} - -void AppShellTest::RunTestOnMainThreadLoop() { DCHECK(base::MessageLoopForUI::IsCurrent()); base::RunLoop().RunUntilIdle(); - SetUpOnMainThread(); + // TODO(jam): remove this. + disable_io_checks(); +} - RunTestOnMainThread(); - - TearDownOnMainThread(); - +void AppShellTest::PostRunTestOnMainThread() { // Clean up the app window. DesktopController::instance()->CloseAppWindows(); }
diff --git a/extensions/shell/test/shell_test.h b/extensions/shell/test/shell_test.h index 8548d16..c3da8a6ca 100644 --- a/extensions/shell/test/shell_test.h +++ b/extensions/shell/test/shell_test.h
@@ -26,8 +26,8 @@ // content::BrowserTestBase implementation. void SetUp() override; - void SetUpOnMainThread() override; - void RunTestOnMainThreadLoop() override; + void PreRunTestOnMainThread() override; + void PostRunTestOnMainThread() override; content::BrowserContext* browser_context() { return browser_context_; }
diff --git a/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_image.txt b/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_image.txt index 0d6a4c4..2ba1e39 100644 --- a/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_image.txt +++ b/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_image.txt
@@ -32,10 +32,10 @@ New Procedures and Functions - GLuint CreateImageCHROMIUM(ClientBuffer buffer, - GLsizei width, - GLsizei height, - GLenum internalformat) + GLuint CreateImageCHROMIUM(ClientBuffer buffer, + GLsizei width, + GLsizei height, + GLenum internalformat) Create an image from <buffer> with width equal to <width> and height equal to <height> and format equal to <internalformat>. @@ -50,42 +50,12 @@ COMPRESSED_RGB_S3TC_DXT1_EXT, COMPRESSED_RGBA_S3TC_DXT5_EXT or ETC1_RGB8_OES. - void DestroyImageCHROMIUM(GLuint image_id) + void DestroyImageCHROMIUM(GLuint image_id) Frees the image previously created by a call to CreateImageCHROMIUM. INVALID_OPERATION is generated if <image_id> is not a valid image id. - void BindTexImage2DCHROMIUM(GLenum target, GLint image_id) - - Binds the texture object currently bound to <target> to the image - <image_id> previously created by a call to CreateImageCHROMIUM. - - INVALID_OPERATION is generated if no texture is bound to <target>. - - INVALID_OPERATION is generated if <image_id> is not a valid image id. - - void BindTexImage2DWithInternalformatCHROMIUM(GLenum target, - GLenum internalformat, - GLint image_id) - - Behaves exactly like BindTexImage2DCHROMIUM, but forces the - texture to use the specified <internalformat> rather than the - default one. This function is provided solely as a workaround for - driver bugs on some platforms. BindTexImage2DCHROMIUM should be - used by almost all users. - - void ReleaseTexImage2DCHROMIUM(GLenum target, GLint image_id) - - Unbinds the texture object bound to <target> from the image - <image_id> previously created by a call to CreateImageCHROMIUM. If - the texture is not currently bound to the image, has no effect, - though may still generate errors. - - INVALID_OPERATION is generated if no texture is bound to <target>. - - INVALID_OPERATION is generated if <image_id> is not a valid image id. - Dependencies on EXT_texture_format_BGRA8888 If EXT_texture_format_BGRA8888 is not supported:
diff --git a/gpu/GLES2/gl2chromium_autogen.h b/gpu/GLES2/gl2chromium_autogen.h index 8820d0f..b5114bd 100644 --- a/gpu/GLES2/gl2chromium_autogen.h +++ b/gpu/GLES2/gl2chromium_autogen.h
@@ -310,8 +310,6 @@ GLES2_GET_FUN(CreateAndConsumeTextureCHROMIUM) #define glBindUniformLocationCHROMIUM GLES2_GET_FUN(BindUniformLocationCHROMIUM) #define glBindTexImage2DCHROMIUM GLES2_GET_FUN(BindTexImage2DCHROMIUM) -#define glBindTexImage2DWithInternalformatCHROMIUM \ - GLES2_GET_FUN(BindTexImage2DWithInternalformatCHROMIUM) #define glReleaseTexImage2DCHROMIUM GLES2_GET_FUN(ReleaseTexImage2DCHROMIUM) #define glTraceBeginCHROMIUM GLES2_GET_FUN(TraceBeginCHROMIUM) #define glTraceEndCHROMIUM GLES2_GET_FUN(TraceEndCHROMIUM)
diff --git a/gpu/GLES2/gl2extchromium.h b/gpu/GLES2/gl2extchromium.h index 8c1f3df1..e38949b 100644 --- a/gpu/GLES2/gl2extchromium.h +++ b/gpu/GLES2/gl2extchromium.h
@@ -84,14 +84,6 @@ GLsizei height, GLenum internalformat); GL_APICALL void GL_APIENTRY glDestroyImageCHROMIUM(GLuint image_id); -GL_APICALL void GL_APIENTRY glBindTexImage2DCHROMIUM(GLenum target, - GLint imageId); -GL_APICALL void GL_APIENTRY -glBindTexImage2DWithInternalformatCHROMIUM(GLenum target, - GLenum internalformat, - GLint imageId); -GL_APICALL void GL_APIENTRY glReleaseTexImage2DCHROMIUM(GLenum target, - GLint imageId); #endif typedef GLuint(GL_APIENTRYP PFNGLCREATEIMAGECHROMIUMPROC)( ClientBuffer buffer, @@ -100,14 +92,6 @@ GLenum internalformat); typedef void ( GL_APIENTRYP PFNGLDESTROYIMAGECHROMIUMPROC)(GLuint image_id); -typedef void(GL_APIENTRYP PFNGLBINDTEXIMAGE2DCHROMIUMPROC)(GLenum target, - GLint imageId); -typedef void(GL_APIENTRYP PFNGLBINDTEXIMAGE2DWITHINTERNALFORMATCHROMIUMPROC)( - GLenum target, - GLenum internalformat, - GLint imageId); -typedef void(GL_APIENTRYP PFNGLRELEASETEXIMAGE2DCHROMIUMPROC)(GLenum target, - GLint imageId); #endif /* GL_CHROMIUM_image */ #ifndef GL_RGB_YCRCB_420_CHROMIUM @@ -185,6 +169,21 @@ #endif #endif /* GL_CHROMIUM_get_error_query */ +/* GL_CHROMIUM_texture_from_image */ +#ifndef GL_CHROMIUM_texture_from_image +#define GL_CHROMIUM_texture_from_image 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glBindTexImage2DCHROMIUM( + GLenum target, GLint imageId); +GL_APICALL void GL_APIENTRY glReleaseTexImage2DCHROMIUM( + GLenum target, GLint imageId); +#endif +typedef void (GL_APIENTRYP PFNGLBINDTEXIMAGE2DCHROMIUMPROC) ( + GLenum target, GLint imageId); +typedef void (GL_APIENTRYP PFNGLRELEASETEXIMAGE2DCHROMIUMPROC) ( + GLenum target, GLint imageId); +#endif /* GL_CHROMIUM_texture_from_image */ + /* GL_CHROMIUM_post_sub_buffer */ #ifndef GL_CHROMIUM_post_sub_buffer #define GL_CHROMIUM_post_sub_buffer 1
diff --git a/gpu/command_buffer/build_gles2_cmd_buffer.py b/gpu/command_buffer/build_gles2_cmd_buffer.py index 01593a3..479b2d6 100755 --- a/gpu/command_buffer/build_gles2_cmd_buffer.py +++ b/gpu/command_buffer/build_gles2_cmd_buffer.py
@@ -4278,11 +4278,6 @@ 'unit_test': False, 'extension': "CHROMIUM_image", }, - 'BindTexImage2DWithInternalformatCHROMIUM': { - 'decoder_func': 'DoBindTexImage2DWithInternalformatCHROMIUM', - 'unit_test': False, - 'extension': "CHROMIUM_image", - }, 'ReleaseTexImage2DCHROMIUM': { 'decoder_func': 'DoReleaseTexImage2DCHROMIUM', 'unit_test': False,
diff --git a/gpu/command_buffer/client/gles2_c_lib_autogen.h b/gpu/command_buffer/client/gles2_c_lib_autogen.h index 8640ab7..b789a6b 100644 --- a/gpu/command_buffer/client/gles2_c_lib_autogen.h +++ b/gpu/command_buffer/client/gles2_c_lib_autogen.h
@@ -1415,13 +1415,6 @@ void GL_APIENTRY GLES2BindTexImage2DCHROMIUM(GLenum target, GLint imageId) { gles2::GetGLContext()->BindTexImage2DCHROMIUM(target, imageId); } -void GL_APIENTRY -GLES2BindTexImage2DWithInternalformatCHROMIUM(GLenum target, - GLenum internalformat, - GLint imageId) { - gles2::GetGLContext()->BindTexImage2DWithInternalformatCHROMIUM( - target, internalformat, imageId); -} void GL_APIENTRY GLES2ReleaseTexImage2DCHROMIUM(GLenum target, GLint imageId) { gles2::GetGLContext()->ReleaseTexImage2DCHROMIUM(target, imageId); } @@ -2826,11 +2819,6 @@ reinterpret_cast<GLES2FunctionPointer>(glBindTexImage2DCHROMIUM), }, { - "glBindTexImage2DWithInternalformatCHROMIUM", - reinterpret_cast<GLES2FunctionPointer>( - glBindTexImage2DWithInternalformatCHROMIUM), - }, - { "glReleaseTexImage2DCHROMIUM", reinterpret_cast<GLES2FunctionPointer>(glReleaseTexImage2DCHROMIUM), },
diff --git a/gpu/command_buffer/client/gles2_cmd_helper_autogen.h b/gpu/command_buffer/client/gles2_cmd_helper_autogen.h index 2573fd9..834b474 100644 --- a/gpu/command_buffer/client/gles2_cmd_helper_autogen.h +++ b/gpu/command_buffer/client/gles2_cmd_helper_autogen.h
@@ -2651,16 +2651,6 @@ } } -void BindTexImage2DWithInternalformatCHROMIUM(GLenum target, - GLenum internalformat, - GLint imageId) { - gles2::cmds::BindTexImage2DWithInternalformatCHROMIUM* c = - GetCmdSpace<gles2::cmds::BindTexImage2DWithInternalformatCHROMIUM>(); - if (c) { - c->Init(target, internalformat, imageId); - } -} - void ReleaseTexImage2DCHROMIUM(GLenum target, GLint imageId) { gles2::cmds::ReleaseTexImage2DCHROMIUM* c = GetCmdSpace<gles2::cmds::ReleaseTexImage2DCHROMIUM>();
diff --git a/gpu/command_buffer/client/gles2_implementation_autogen.h b/gpu/command_buffer/client/gles2_implementation_autogen.h index d605f61..ee52301 100644 --- a/gpu/command_buffer/client/gles2_implementation_autogen.h +++ b/gpu/command_buffer/client/gles2_implementation_autogen.h
@@ -996,10 +996,6 @@ void BindTexImage2DCHROMIUM(GLenum target, GLint imageId) override; -void BindTexImage2DWithInternalformatCHROMIUM(GLenum target, - GLenum internalformat, - GLint imageId) override; - void ReleaseTexImage2DCHROMIUM(GLenum target, GLint imageId) override; void TraceBeginCHROMIUM(const char* category_name,
diff --git a/gpu/command_buffer/client/gles2_implementation_impl_autogen.h b/gpu/command_buffer/client/gles2_implementation_impl_autogen.h index a5a5091..db5d667 100644 --- a/gpu/command_buffer/client/gles2_implementation_impl_autogen.h +++ b/gpu/command_buffer/client/gles2_implementation_impl_autogen.h
@@ -3195,21 +3195,6 @@ CheckGLError(); } -void GLES2Implementation::BindTexImage2DWithInternalformatCHROMIUM( - GLenum target, - GLenum internalformat, - GLint imageId) { - GPU_CLIENT_SINGLE_THREAD_CHECK(); - GPU_CLIENT_LOG("[" << GetLogPrefix() - << "] glBindTexImage2DWithInternalformatCHROMIUM(" - << GLES2Util::GetStringTextureBindTarget(target) << ", " - << GLES2Util::GetStringEnum(internalformat) << ", " - << imageId << ")"); - helper_->BindTexImage2DWithInternalformatCHROMIUM(target, internalformat, - imageId); - CheckGLError(); -} - void GLES2Implementation::ReleaseTexImage2DCHROMIUM(GLenum target, GLint imageId) { GPU_CLIENT_SINGLE_THREAD_CHECK();
diff --git a/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h b/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h index 55e10eae..cee92feee 100644 --- a/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h +++ b/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h
@@ -2781,17 +2781,6 @@ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); } -TEST_F(GLES2ImplementationTest, BindTexImage2DWithInternalformatCHROMIUM) { - struct Cmds { - cmds::BindTexImage2DWithInternalformatCHROMIUM cmd; - }; - Cmds expected; - expected.cmd.Init(GL_TEXTURE_2D, 2, 3); - - gl_->BindTexImage2DWithInternalformatCHROMIUM(GL_TEXTURE_2D, 2, 3); - EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); -} - TEST_F(GLES2ImplementationTest, ReleaseTexImage2DCHROMIUM) { struct Cmds { cmds::ReleaseTexImage2DCHROMIUM cmd;
diff --git a/gpu/command_buffer/client/gles2_interface_autogen.h b/gpu/command_buffer/client/gles2_interface_autogen.h index 07a37155..65724af 100644 --- a/gpu/command_buffer/client/gles2_interface_autogen.h +++ b/gpu/command_buffer/client/gles2_interface_autogen.h
@@ -732,9 +732,6 @@ GLint location, const char* name) = 0; virtual void BindTexImage2DCHROMIUM(GLenum target, GLint imageId) = 0; -virtual void BindTexImage2DWithInternalformatCHROMIUM(GLenum target, - GLenum internalformat, - GLint imageId) = 0; virtual void ReleaseTexImage2DCHROMIUM(GLenum target, GLint imageId) = 0; virtual void TraceBeginCHROMIUM(const char* category_name, const char* trace_name) = 0;
diff --git a/gpu/command_buffer/client/gles2_interface_stub_autogen.h b/gpu/command_buffer/client/gles2_interface_stub_autogen.h index bee6141..54dabbc 100644 --- a/gpu/command_buffer/client/gles2_interface_stub_autogen.h +++ b/gpu/command_buffer/client/gles2_interface_stub_autogen.h
@@ -710,9 +710,6 @@ GLint location, const char* name) override; void BindTexImage2DCHROMIUM(GLenum target, GLint imageId) override; -void BindTexImage2DWithInternalformatCHROMIUM(GLenum target, - GLenum internalformat, - GLint imageId) override; void ReleaseTexImage2DCHROMIUM(GLenum target, GLint imageId) override; void TraceBeginCHROMIUM(const char* category_name, const char* trace_name) override;
diff --git a/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h b/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h index fd49260..5073353b 100644 --- a/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h +++ b/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h
@@ -965,10 +965,6 @@ const char* /* name */) {} void GLES2InterfaceStub::BindTexImage2DCHROMIUM(GLenum /* target */, GLint /* imageId */) {} -void GLES2InterfaceStub::BindTexImage2DWithInternalformatCHROMIUM( - GLenum /* target */, - GLenum /* internalformat */, - GLint /* imageId */) {} void GLES2InterfaceStub::ReleaseTexImage2DCHROMIUM(GLenum /* target */, GLint /* imageId */) {} void GLES2InterfaceStub::TraceBeginCHROMIUM(const char* /* category_name */,
diff --git a/gpu/command_buffer/client/gles2_trace_implementation_autogen.h b/gpu/command_buffer/client/gles2_trace_implementation_autogen.h index 911c4fd0..783d7cc 100644 --- a/gpu/command_buffer/client/gles2_trace_implementation_autogen.h +++ b/gpu/command_buffer/client/gles2_trace_implementation_autogen.h
@@ -710,9 +710,6 @@ GLint location, const char* name) override; void BindTexImage2DCHROMIUM(GLenum target, GLint imageId) override; -void BindTexImage2DWithInternalformatCHROMIUM(GLenum target, - GLenum internalformat, - GLint imageId) override; void ReleaseTexImage2DCHROMIUM(GLenum target, GLint imageId) override; void TraceBeginCHROMIUM(const char* category_name, const char* trace_name) override;
diff --git a/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h b/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h index 4b096cd..01db22e 100644 --- a/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h +++ b/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h
@@ -2054,16 +2054,6 @@ gl_->BindTexImage2DCHROMIUM(target, imageId); } -void GLES2TraceImplementation::BindTexImage2DWithInternalformatCHROMIUM( - GLenum target, - GLenum internalformat, - GLint imageId) { - TRACE_EVENT_BINARY_EFFICIENT0( - "gpu", "GLES2Trace::BindTexImage2DWithInternalformatCHROMIUM"); - gl_->BindTexImage2DWithInternalformatCHROMIUM(target, internalformat, - imageId); -} - void GLES2TraceImplementation::ReleaseTexImage2DCHROMIUM(GLenum target, GLint imageId) { TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::ReleaseTexImage2DCHROMIUM");
diff --git a/gpu/command_buffer/cmd_buffer_functions.txt b/gpu/command_buffer/cmd_buffer_functions.txt index 2b87eff..a1055e8 100644 --- a/gpu/command_buffer/cmd_buffer_functions.txt +++ b/gpu/command_buffer/cmd_buffer_functions.txt
@@ -293,7 +293,6 @@ GL_APICALL void GL_APIENTRY glCreateAndConsumeTextureINTERNAL (GLenumTextureBindTarget target, GLuint texture, const GLbyte* mailbox); GL_APICALL void GL_APIENTRY glBindUniformLocationCHROMIUM (GLidProgram program, GLint location, const char* name); GL_APICALL void GL_APIENTRY glBindTexImage2DCHROMIUM (GLenumTextureBindTarget target, GLint imageId); -GL_APICALL void GL_APIENTRY glBindTexImage2DWithInternalformatCHROMIUM (GLenumTextureBindTarget target, GLenum internalformat, GLint imageId); GL_APICALL void GL_APIENTRY glReleaseTexImage2DCHROMIUM (GLenumTextureBindTarget target, GLint imageId); GL_APICALL void GL_APIENTRY glTraceBeginCHROMIUM (const char* category_name, const char* trace_name); GL_APICALL void GL_APIENTRY glTraceEndCHROMIUM (void);
diff --git a/gpu/command_buffer/common/gles2_cmd_format_autogen.h b/gpu/command_buffer/common/gles2_cmd_format_autogen.h index 3ec79a2..2f1e47f 100644 --- a/gpu/command_buffer/common/gles2_cmd_format_autogen.h +++ b/gpu/command_buffer/common/gles2_cmd_format_autogen.h
@@ -13084,52 +13084,6 @@ static_assert(offsetof(BindTexImage2DCHROMIUM, imageId) == 8, "offset of BindTexImage2DCHROMIUM imageId should be 8"); -struct BindTexImage2DWithInternalformatCHROMIUM { - typedef BindTexImage2DWithInternalformatCHROMIUM ValueType; - static const CommandId kCmdId = kBindTexImage2DWithInternalformatCHROMIUM; - static const cmd::ArgFlags kArgFlags = cmd::kFixed; - static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); - - static uint32_t ComputeSize() { - return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT - } - - void SetHeader() { header.SetCmd<ValueType>(); } - - void Init(GLenum _target, GLenum _internalformat, GLint _imageId) { - SetHeader(); - target = _target; - internalformat = _internalformat; - imageId = _imageId; - } - - void* Set(void* cmd, GLenum _target, GLenum _internalformat, GLint _imageId) { - static_cast<ValueType*>(cmd)->Init(_target, _internalformat, _imageId); - return NextCmdAddress<ValueType>(cmd); - } - - gpu::CommandHeader header; - uint32_t target; - uint32_t internalformat; - int32_t imageId; -}; - -static_assert(sizeof(BindTexImage2DWithInternalformatCHROMIUM) == 16, - "size of BindTexImage2DWithInternalformatCHROMIUM should be 16"); -static_assert( - offsetof(BindTexImage2DWithInternalformatCHROMIUM, header) == 0, - "offset of BindTexImage2DWithInternalformatCHROMIUM header should be 0"); -static_assert( - offsetof(BindTexImage2DWithInternalformatCHROMIUM, target) == 4, - "offset of BindTexImage2DWithInternalformatCHROMIUM target should be 4"); -static_assert(offsetof(BindTexImage2DWithInternalformatCHROMIUM, - internalformat) == 8, - "offset of BindTexImage2DWithInternalformatCHROMIUM " - "internalformat should be 8"); -static_assert( - offsetof(BindTexImage2DWithInternalformatCHROMIUM, imageId) == 12, - "offset of BindTexImage2DWithInternalformatCHROMIUM imageId should be 12"); - struct ReleaseTexImage2DCHROMIUM { typedef ReleaseTexImage2DCHROMIUM ValueType; static const CommandId kCmdId = kReleaseTexImage2DCHROMIUM;
diff --git a/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h b/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h index d7094ea1..1bf9ced5 100644 --- a/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h +++ b/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h
@@ -4434,21 +4434,6 @@ CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd)); } -TEST_F(GLES2FormatTest, BindTexImage2DWithInternalformatCHROMIUM) { - cmds::BindTexImage2DWithInternalformatCHROMIUM& cmd = - *GetBufferAs<cmds::BindTexImage2DWithInternalformatCHROMIUM>(); - void* next_cmd = cmd.Set(&cmd, static_cast<GLenum>(11), - static_cast<GLenum>(12), static_cast<GLint>(13)); - EXPECT_EQ(static_cast<uint32_t>( - cmds::BindTexImage2DWithInternalformatCHROMIUM::kCmdId), - cmd.header.command); - EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); - EXPECT_EQ(static_cast<GLenum>(11), cmd.target); - EXPECT_EQ(static_cast<GLenum>(12), cmd.internalformat); - EXPECT_EQ(static_cast<GLint>(13), cmd.imageId); - CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd)); -} - TEST_F(GLES2FormatTest, ReleaseTexImage2DCHROMIUM) { cmds::ReleaseTexImage2DCHROMIUM& cmd = *GetBufferAs<cmds::ReleaseTexImage2DCHROMIUM>();
diff --git a/gpu/command_buffer/common/gles2_cmd_ids_autogen.h b/gpu/command_buffer/common/gles2_cmd_ids_autogen.h index bd9ccf3..ffef2d5 100644 --- a/gpu/command_buffer/common/gles2_cmd_ids_autogen.h +++ b/gpu/command_buffer/common/gles2_cmd_ids_autogen.h
@@ -281,60 +281,59 @@ OP(CreateAndConsumeTextureINTERNALImmediate) /* 522 */ \ OP(BindUniformLocationCHROMIUMBucket) /* 523 */ \ OP(BindTexImage2DCHROMIUM) /* 524 */ \ - OP(BindTexImage2DWithInternalformatCHROMIUM) /* 525 */ \ - OP(ReleaseTexImage2DCHROMIUM) /* 526 */ \ - OP(TraceBeginCHROMIUM) /* 527 */ \ - OP(TraceEndCHROMIUM) /* 528 */ \ - OP(DiscardFramebufferEXTImmediate) /* 529 */ \ - OP(LoseContextCHROMIUM) /* 530 */ \ - OP(InsertFenceSyncCHROMIUM) /* 531 */ \ - OP(WaitSyncTokenCHROMIUM) /* 532 */ \ - OP(DrawBuffersEXTImmediate) /* 533 */ \ - OP(DiscardBackbufferCHROMIUM) /* 534 */ \ - OP(ScheduleOverlayPlaneCHROMIUM) /* 535 */ \ - OP(ScheduleCALayerSharedStateCHROMIUM) /* 536 */ \ - OP(ScheduleCALayerCHROMIUM) /* 537 */ \ - OP(ScheduleCALayerInUseQueryCHROMIUMImmediate) /* 538 */ \ - OP(CommitOverlayPlanesCHROMIUM) /* 539 */ \ - OP(SwapInterval) /* 540 */ \ - OP(FlushDriverCachesCHROMIUM) /* 541 */ \ - OP(ScheduleDCLayerSharedStateCHROMIUM) /* 542 */ \ - OP(ScheduleDCLayerCHROMIUM) /* 543 */ \ - OP(MatrixLoadfCHROMIUMImmediate) /* 544 */ \ - OP(MatrixLoadIdentityCHROMIUM) /* 545 */ \ - OP(GenPathsCHROMIUM) /* 546 */ \ - OP(DeletePathsCHROMIUM) /* 547 */ \ - OP(IsPathCHROMIUM) /* 548 */ \ - OP(PathCommandsCHROMIUM) /* 549 */ \ - OP(PathParameterfCHROMIUM) /* 550 */ \ - OP(PathParameteriCHROMIUM) /* 551 */ \ - OP(PathStencilFuncCHROMIUM) /* 552 */ \ - OP(StencilFillPathCHROMIUM) /* 553 */ \ - OP(StencilStrokePathCHROMIUM) /* 554 */ \ - OP(CoverFillPathCHROMIUM) /* 555 */ \ - OP(CoverStrokePathCHROMIUM) /* 556 */ \ - OP(StencilThenCoverFillPathCHROMIUM) /* 557 */ \ - OP(StencilThenCoverStrokePathCHROMIUM) /* 558 */ \ - OP(StencilFillPathInstancedCHROMIUM) /* 559 */ \ - OP(StencilStrokePathInstancedCHROMIUM) /* 560 */ \ - OP(CoverFillPathInstancedCHROMIUM) /* 561 */ \ - OP(CoverStrokePathInstancedCHROMIUM) /* 562 */ \ - OP(StencilThenCoverFillPathInstancedCHROMIUM) /* 563 */ \ - OP(StencilThenCoverStrokePathInstancedCHROMIUM) /* 564 */ \ - OP(BindFragmentInputLocationCHROMIUMBucket) /* 565 */ \ - OP(ProgramPathFragmentInputGenCHROMIUM) /* 566 */ \ - OP(GetBufferSubDataAsyncCHROMIUM) /* 567 */ \ - OP(CoverageModulationCHROMIUM) /* 568 */ \ - OP(BlendBarrierKHR) /* 569 */ \ - OP(ApplyScreenSpaceAntialiasingCHROMIUM) /* 570 */ \ - OP(BindFragDataLocationIndexedEXTBucket) /* 571 */ \ - OP(BindFragDataLocationEXTBucket) /* 572 */ \ - OP(GetFragDataIndexEXT) /* 573 */ \ - OP(UniformMatrix4fvStreamTextureMatrixCHROMIUMImmediate) /* 574 */ \ - OP(OverlayPromotionHintCHROMIUM) /* 575 */ \ - OP(SwapBuffersWithBoundsCHROMIUMImmediate) /* 576 */ \ - OP(SetDrawRectangleCHROMIUM) /* 577 */ \ - OP(SetEnableDCLayersCHROMIUM) /* 578 */ + OP(ReleaseTexImage2DCHROMIUM) /* 525 */ \ + OP(TraceBeginCHROMIUM) /* 526 */ \ + OP(TraceEndCHROMIUM) /* 527 */ \ + OP(DiscardFramebufferEXTImmediate) /* 528 */ \ + OP(LoseContextCHROMIUM) /* 529 */ \ + OP(InsertFenceSyncCHROMIUM) /* 530 */ \ + OP(WaitSyncTokenCHROMIUM) /* 531 */ \ + OP(DrawBuffersEXTImmediate) /* 532 */ \ + OP(DiscardBackbufferCHROMIUM) /* 533 */ \ + OP(ScheduleOverlayPlaneCHROMIUM) /* 534 */ \ + OP(ScheduleCALayerSharedStateCHROMIUM) /* 535 */ \ + OP(ScheduleCALayerCHROMIUM) /* 536 */ \ + OP(ScheduleCALayerInUseQueryCHROMIUMImmediate) /* 537 */ \ + OP(CommitOverlayPlanesCHROMIUM) /* 538 */ \ + OP(SwapInterval) /* 539 */ \ + OP(FlushDriverCachesCHROMIUM) /* 540 */ \ + OP(ScheduleDCLayerSharedStateCHROMIUM) /* 541 */ \ + OP(ScheduleDCLayerCHROMIUM) /* 542 */ \ + OP(MatrixLoadfCHROMIUMImmediate) /* 543 */ \ + OP(MatrixLoadIdentityCHROMIUM) /* 544 */ \ + OP(GenPathsCHROMIUM) /* 545 */ \ + OP(DeletePathsCHROMIUM) /* 546 */ \ + OP(IsPathCHROMIUM) /* 547 */ \ + OP(PathCommandsCHROMIUM) /* 548 */ \ + OP(PathParameterfCHROMIUM) /* 549 */ \ + OP(PathParameteriCHROMIUM) /* 550 */ \ + OP(PathStencilFuncCHROMIUM) /* 551 */ \ + OP(StencilFillPathCHROMIUM) /* 552 */ \ + OP(StencilStrokePathCHROMIUM) /* 553 */ \ + OP(CoverFillPathCHROMIUM) /* 554 */ \ + OP(CoverStrokePathCHROMIUM) /* 555 */ \ + OP(StencilThenCoverFillPathCHROMIUM) /* 556 */ \ + OP(StencilThenCoverStrokePathCHROMIUM) /* 557 */ \ + OP(StencilFillPathInstancedCHROMIUM) /* 558 */ \ + OP(StencilStrokePathInstancedCHROMIUM) /* 559 */ \ + OP(CoverFillPathInstancedCHROMIUM) /* 560 */ \ + OP(CoverStrokePathInstancedCHROMIUM) /* 561 */ \ + OP(StencilThenCoverFillPathInstancedCHROMIUM) /* 562 */ \ + OP(StencilThenCoverStrokePathInstancedCHROMIUM) /* 563 */ \ + OP(BindFragmentInputLocationCHROMIUMBucket) /* 564 */ \ + OP(ProgramPathFragmentInputGenCHROMIUM) /* 565 */ \ + OP(GetBufferSubDataAsyncCHROMIUM) /* 566 */ \ + OP(CoverageModulationCHROMIUM) /* 567 */ \ + OP(BlendBarrierKHR) /* 568 */ \ + OP(ApplyScreenSpaceAntialiasingCHROMIUM) /* 569 */ \ + OP(BindFragDataLocationIndexedEXTBucket) /* 570 */ \ + OP(BindFragDataLocationEXTBucket) /* 571 */ \ + OP(GetFragDataIndexEXT) /* 572 */ \ + OP(UniformMatrix4fvStreamTextureMatrixCHROMIUMImmediate) /* 573 */ \ + OP(OverlayPromotionHintCHROMIUM) /* 574 */ \ + OP(SwapBuffersWithBoundsCHROMIUMImmediate) /* 575 */ \ + OP(SetDrawRectangleCHROMIUM) /* 576 */ \ + OP(SetEnableDCLayersCHROMIUM) /* 577 */ enum CommandId { kOneBeforeStartPoint =
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc index db2c9d2..b9097406 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -1041,14 +1041,6 @@ void DoBindTexImage2DCHROMIUM( GLenum target, GLint image_id); - void DoBindTexImage2DWithInternalformatCHROMIUM(GLenum target, - GLenum internalformat, - GLint image_id); - // Common implementation of DoBindTexImage2DCHROMIUM entry points. - void BindTexImage2DCHROMIUMImpl(const char* function_name, - GLenum target, - GLenum internalformat, - GLint image_id); void DoReleaseTexImage2DCHROMIUM( GLenum target, GLint image_id); @@ -17771,26 +17763,10 @@ GLenum target, GLint image_id) { TRACE_EVENT0("gpu", "GLES2DecoderImpl::DoBindTexImage2DCHROMIUM"); - BindTexImage2DCHROMIUMImpl("glBindTexImage2DCHROMIUM", target, 0, image_id); -} - -void GLES2DecoderImpl::DoBindTexImage2DWithInternalformatCHROMIUM( - GLenum target, - GLenum internalformat, - GLint image_id) { - TRACE_EVENT0("gpu", - "GLES2DecoderImpl::DoBindTexImage2DWithInternalformatCHROMIUM"); - - BindTexImage2DCHROMIUMImpl("glBindTexImage2DWithInternalformatCHROMIUM", - target, internalformat, image_id); -} - -void GLES2DecoderImpl::BindTexImage2DCHROMIUMImpl(const char* function_name, - GLenum target, - GLenum internalformat, - GLint image_id) { if (target == GL_TEXTURE_CUBE_MAP) { - LOCAL_SET_GL_ERROR(GL_INVALID_ENUM, function_name, "invalid target"); + LOCAL_SET_GL_ERROR( + GL_INVALID_ENUM, + "glBindTexImage2DCHROMIUM", "invalid target"); return; } @@ -17799,14 +17775,17 @@ TextureRef* texture_ref = texture_manager()->GetTextureInfoForTargetUnlessDefault(&state_, target); if (!texture_ref) { - LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name, "no texture bound"); + LOCAL_SET_GL_ERROR( + GL_INVALID_OPERATION, + "glBindTexImage2DCHROMIUM", "no texture bound"); return; } gl::GLImage* image = image_manager()->LookupImage(image_id); if (!image) { - LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name, - "no image found with the given ID"); + LOCAL_SET_GL_ERROR( + GL_INVALID_OPERATION, + "glBindTexImage2DCHROMIUM", "no image found with the given ID"); return; } @@ -17818,22 +17797,15 @@ // Note: We fallback to using CopyTexImage() before the texture is used // when BindTexImage() fails. - if (internalformat) { - if (image->BindTexImageWithInternalformat(target, internalformat)) - image_state = Texture::BOUND; - } else { - if (image->BindTexImage(target)) - image_state = Texture::BOUND; - } + if (image->BindTexImage(target)) + image_state = Texture::BOUND; } gfx::Size size = image->GetSize(); - GLenum texture_internalformat = - internalformat ? internalformat : image->GetInternalFormat(); - texture_manager()->SetLevelInfo(texture_ref, target, 0, - texture_internalformat, size.width(), - size.height(), 1, 0, texture_internalformat, - GL_UNSIGNED_BYTE, gfx::Rect(size)); + GLenum internalformat = image->GetInternalFormat(); + texture_manager()->SetLevelInfo( + texture_ref, target, 0, internalformat, size.width(), size.height(), 1, 0, + internalformat, GL_UNSIGNED_BYTE, gfx::Rect(size)); texture_manager()->SetLevelImage(texture_ref, target, 0, image, image_state); }
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h b/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h index 25237e2..fa2f5799 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h
@@ -4778,24 +4778,6 @@ return error::kNoError; } -error::Error GLES2DecoderImpl::HandleBindTexImage2DWithInternalformatCHROMIUM( - uint32_t immediate_data_size, - const volatile void* cmd_data) { - const volatile gles2::cmds::BindTexImage2DWithInternalformatCHROMIUM& c = - *static_cast<const volatile gles2::cmds:: - BindTexImage2DWithInternalformatCHROMIUM*>(cmd_data); - GLenum target = static_cast<GLenum>(c.target); - GLenum internalformat = static_cast<GLenum>(c.internalformat); - GLint imageId = static_cast<GLint>(c.imageId); - if (!validators_->texture_bind_target.IsValid(target)) { - LOCAL_SET_GL_ERROR_INVALID_ENUM( - "glBindTexImage2DWithInternalformatCHROMIUM", target, "target"); - return error::kNoError; - } - DoBindTexImage2DWithInternalformatCHROMIUM(target, internalformat, imageId); - return error::kNoError; -} - error::Error GLES2DecoderImpl::HandleReleaseTexImage2DCHROMIUM( uint32_t immediate_data_size, const volatile void* cmd_data) {
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc index 032369e0..eac5a9889 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc
@@ -885,34 +885,6 @@ } } -error::Error GLES2DecoderPassthroughImpl::BindTexImage2DCHROMIUMImpl( - GLenum target, - GLenum internalformat, - GLint imageId) { - if (target != GL_TEXTURE_2D) { - InsertError(GL_INVALID_ENUM, "Invalid target"); - return error::kNoError; - } - - gl::GLImage* image = image_manager_->LookupImage(imageId); - if (image == nullptr) { - InsertError(GL_INVALID_OPERATION, "No image found with the given ID"); - return error::kNoError; - } - - if (internalformat) { - if (!image->BindTexImageWithInternalformat(target, internalformat)) { - image->CopyTexImage(target); - } - } else { - if (!image->BindTexImage(target)) { - image->CopyTexImage(target); - } - } - - return error::kNoError; -} - #define GLES2_CMD_OP(name) \ { \ &GLES2DecoderPassthroughImpl::Handle##name, cmds::name::kArgFlags, \
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h index f6ab1099..0985a2c3 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h
@@ -303,10 +303,6 @@ void UpdateTextureBinding(GLenum target, GLuint client_id, GLuint service_id); - error::Error BindTexImage2DCHROMIUMImpl(GLenum target, - GLenum internalformat, - GLint image_id); - int commands_to_process_; DebugMarkerManager debug_marker_manager_;
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doer_prototypes.h b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doer_prototypes.h index 7ab02bc..60282e14 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doer_prototypes.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doer_prototypes.h
@@ -796,9 +796,6 @@ GLint location, const char* name); error::Error DoBindTexImage2DCHROMIUM(GLenum target, GLint imageId); -error::Error DoBindTexImage2DWithInternalformatCHROMIUM(GLenum target, - GLenum internalformat, - GLint imageId); error::Error DoReleaseTexImage2DCHROMIUM(GLenum target, GLint imageId); error::Error DoTraceBeginCHROMIUM(const char* category_name, const char* trace_name);
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc index 3600f809..9bfcb6b 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc
@@ -3485,15 +3485,22 @@ error::Error GLES2DecoderPassthroughImpl::DoBindTexImage2DCHROMIUM( GLenum target, GLint imageId) { - return BindTexImage2DCHROMIUMImpl(target, 0, imageId); -} + if (target != GL_TEXTURE_2D) { + InsertError(GL_INVALID_ENUM, "Invalid target"); + return error::kNoError; + } -error::Error -GLES2DecoderPassthroughImpl::DoBindTexImage2DWithInternalformatCHROMIUM( - GLenum target, - GLenum internalformat, - GLint imageId) { - return BindTexImage2DCHROMIUMImpl(target, internalformat, imageId); + gl::GLImage* image = image_manager_->LookupImage(imageId); + if (image == nullptr) { + InsertError(GL_INVALID_OPERATION, "No image found with the given ID"); + return error::kNoError; + } + + if (!image->BindTexImage(target)) { + image->CopyTexImage(target); + } + + return error::kNoError; } error::Error GLES2DecoderPassthroughImpl::DoReleaseTexImage2DCHROMIUM(
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_handlers_autogen.cc b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_handlers_autogen.cc index 629a24d..9c6f95f 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_handlers_autogen.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_handlers_autogen.cc
@@ -4024,24 +4024,6 @@ return error::kNoError; } -error::Error -GLES2DecoderPassthroughImpl::HandleBindTexImage2DWithInternalformatCHROMIUM( - uint32_t immediate_data_size, - const volatile void* cmd_data) { - const volatile gles2::cmds::BindTexImage2DWithInternalformatCHROMIUM& c = - *static_cast<const volatile gles2::cmds:: - BindTexImage2DWithInternalformatCHROMIUM*>(cmd_data); - GLenum target = static_cast<GLenum>(c.target); - GLenum internalformat = static_cast<GLenum>(c.internalformat); - GLint imageId = static_cast<GLint>(c.imageId); - error::Error error = DoBindTexImage2DWithInternalformatCHROMIUM( - target, internalformat, imageId); - if (error != error::kNoError) { - return error; - } - return error::kNoError; -} - error::Error GLES2DecoderPassthroughImpl::HandleReleaseTexImage2DCHROMIUM( uint32_t immediate_data_size, const volatile void* cmd_data) {
diff --git a/headless/test/headless_browser_test.cc b/headless/test/headless_browser_test.cc index 714a00f6..1ad15d8 100644 --- a/headless/test/headless_browser_test.cc +++ b/headless/test/headless_browser_test.cc
@@ -137,22 +137,15 @@ HeadlessBrowserTest::~HeadlessBrowserTest() {} -void HeadlessBrowserTest::SetUpOnMainThread() {} - -void HeadlessBrowserTest::TearDownOnMainThread() { - browser()->Shutdown(); -} - -void HeadlessBrowserTest::RunTestOnMainThreadLoop() { +void HeadlessBrowserTest::PreRunTestOnMainThread() { DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); // Pump startup related events. base::RunLoop().RunUntilIdle(); +} - SetUpOnMainThread(); - RunTestOnMainThread(); - TearDownOnMainThread(); - +void HeadlessBrowserTest::PostRunTestOnMainThread() { + browser()->Shutdown(); for (content::RenderProcessHost::iterator i( content::RenderProcessHost::AllHostsIterator()); !i.IsAtEnd(); i.Advance()) {
diff --git a/headless/test/headless_browser_test.h b/headless/test/headless_browser_test.h index 78a2f97..e5e29e5 100644 --- a/headless/test/headless_browser_test.h +++ b/headless/test/headless_browser_test.h
@@ -60,9 +60,8 @@ ~HeadlessBrowserTest() override; // BrowserTestBase: - void RunTestOnMainThreadLoop() override; - void SetUpOnMainThread() override; - void TearDownOnMainThread() override; + void PreRunTestOnMainThread() override; + void PostRunTestOnMainThread() override; // Run an asynchronous test in a nested run loop. The caller should call // FinishAsynchronousTest() to notify that the test should finish.
diff --git a/ios/net/protocol_handler_util_unittest.mm b/ios/net/protocol_handler_util_unittest.mm index 3c2d849e..54a3c1b 100644 --- a/ios/net/protocol_handler_util_unittest.mm +++ b/ios/net/protocol_handler_util_unittest.mm
@@ -39,7 +39,6 @@ namespace net { namespace { -const int kResponseCode = 200; const char* kTextHtml = "text/html"; const char* kTextPlain = "text/plain"; const char* kAscii = "US-ASCII"; @@ -87,9 +86,6 @@ info->headers = new HttpResponseHeaders(header_string); } - int GetResponseCode() const override { - return kResponseCode; - } protected: ~HeadersURLRequestJob() override {}
diff --git a/ios/web/webui/url_data_manager_ios_backend.mm b/ios/web/webui/url_data_manager_ios_backend.mm index ee2c895..23a1094 100644 --- a/ios/web/webui/url_data_manager_ios_backend.mm +++ b/ios/web/webui/url_data_manager_ios_backend.mm
@@ -104,7 +104,6 @@ void Kill() override; int ReadRawData(net::IOBuffer* buf, int buf_size) override; bool GetMimeType(std::string* mime_type) const override; - int GetResponseCode() const override; void GetResponseInfo(net::HttpResponseInfo* info) override; // Used to notify that the requested data's |mime_type| is ready. @@ -250,10 +249,6 @@ return !mime_type_.empty(); } -int URLRequestChromeJob::GetResponseCode() const { - return net::HTTP_OK; -} - void URLRequestChromeJob::GetResponseInfo(net::HttpResponseInfo* info) { DCHECK(!info->headers.get()); // Set the headers so that requests serviced by ChromeURLDataManagerIOS
diff --git a/mojo/public/cpp/bindings/map_traits_wtf_hash_map.h b/mojo/public/cpp/bindings/map_traits_wtf_hash_map.h index 1f0ccf0..128350f 100644 --- a/mojo/public/cpp/bindings/map_traits_wtf_hash_map.h +++ b/mojo/public/cpp/bindings/map_traits_wtf_hash_map.h
@@ -25,7 +25,7 @@ static void SetToNull(WTF::HashMap<K, V>* output) { // WTF::HashMap<> doesn't support null state. Set it to empty instead. - output->Clear(); + output->clear(); } static size_t GetSize(const WTF::HashMap<K, V>& input) { @@ -56,7 +56,7 @@ return true; } - static void SetToEmpty(WTF::HashMap<K, V>* output) { output->Clear(); } + static void SetToEmpty(WTF::HashMap<K, V>* output) { output->clear(); } }; } // namespace mojo
diff --git a/net/android/cellular_signal_strength.cc b/net/android/cellular_signal_strength.cc index 4c23695..69888c9 100644 --- a/net/android/cellular_signal_strength.cc +++ b/net/android/cellular_signal_strength.cc
@@ -4,7 +4,6 @@ #include "net/android/cellular_signal_strength.h" -#include "base/android/context_utils.h" #include "jni/AndroidCellularSignalStrength_jni.h" namespace net { @@ -29,8 +28,7 @@ bool GetSignalStrengthDbm(int32_t* signal_strength_dbm) { int32_t signal_strength_dbm_tmp = Java_AndroidCellularSignalStrength_getSignalStrengthDbm( - base::android::AttachCurrentThread(), - base::android::GetApplicationContext()); + base::android::AttachCurrentThread()); if (signal_strength_dbm_tmp == ERROR_NOT_SUPPORTED) return false; @@ -41,8 +39,7 @@ bool GetSignalStrengthLevel(int32_t* signal_strength_level) { int32_t signal_strength_level_tmp = Java_AndroidCellularSignalStrength_getSignalStrengthLevel( - base::android::AttachCurrentThread(), - base::android::GetApplicationContext()); + base::android::AttachCurrentThread()); if (signal_strength_level_tmp == ERROR_NOT_SUPPORTED) return false;
diff --git a/net/android/java/src/org/chromium/net/AndroidCellularSignalStrength.java b/net/android/java/src/org/chromium/net/AndroidCellularSignalStrength.java index fc26a81..06a0a9f 100644 --- a/net/android/java/src/org/chromium/net/AndroidCellularSignalStrength.java +++ b/net/android/java/src/org/chromium/net/AndroidCellularSignalStrength.java
@@ -17,6 +17,7 @@ import android.telephony.CellInfoWcdma; import android.telephony.TelephonyManager; +import org.chromium.base.ContextUtils; import org.chromium.base.annotations.CalledByNative; import org.chromium.base.annotations.JNINamespace; @@ -35,8 +36,8 @@ */ @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2) @CalledByNative - public static int getSignalStrengthDbm(Context context) { - List<CellInfo> cellInfos = getRegisteredCellInfo(context); + public static int getSignalStrengthDbm() { + List<CellInfo> cellInfos = getRegisteredCellInfo(); return cellInfos == null || cellInfos.size() != 1 ? CellularSignalStrengthError.ERROR_NOT_SUPPORTED : getSignalStrengthDbm(cellInfos.get(0)); @@ -50,8 +51,8 @@ */ @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2) @CalledByNative - public static int getSignalStrengthLevel(Context context) { - List<CellInfo> cellInfos = getRegisteredCellInfo(context); + public static int getSignalStrengthLevel() { + List<CellInfo> cellInfos = getRegisteredCellInfo(); return cellInfos == null || cellInfos.size() != 1 ? CellularSignalStrengthError.ERROR_NOT_SUPPORTED : getSignalStrengthLevel(cellInfos.get(0)); @@ -66,12 +67,13 @@ * TODO(tbansal): Consider using {@link TelephonyManager#getNeighboringCellInfo} * for earlier versions of Android. */ - private static boolean isAPIAvailable(Context context) { + private static boolean isAPIAvailable() { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2) return false; try { - return context.checkPermission(Manifest.permission.ACCESS_COARSE_LOCATION, - Process.myPid(), Process.myUid()) + return ContextUtils.getApplicationContext().checkPermission( + Manifest.permission.ACCESS_COARSE_LOCATION, Process.myPid(), + Process.myUid()) == PackageManager.PERMISSION_GRANTED; } catch (Exception ignored) { // Work around certain platforms where this method sometimes throws a runtime exception. @@ -86,13 +88,14 @@ * mobile network. May return {@code null}. */ @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2) - private static List<CellInfo> getRegisteredCellInfo(Context context) { - if (!isAPIAvailable(context)) { + private static List<CellInfo> getRegisteredCellInfo() { + if (!isAPIAvailable()) { return null; } TelephonyManager telephonyManager = - (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); + (TelephonyManager) ContextUtils.getApplicationContext().getSystemService( + Context.TELEPHONY_SERVICE); if (telephonyManager == null) { return null; }
diff --git a/net/android/java/src/org/chromium/net/AndroidNetworkLibrary.java b/net/android/java/src/org/chromium/net/AndroidNetworkLibrary.java index 725cc1c..e4fffd9 100644 --- a/net/android/java/src/org/chromium/net/AndroidNetworkLibrary.java +++ b/net/android/java/src/org/chromium/net/AndroidNetworkLibrary.java
@@ -22,6 +22,7 @@ import android.telephony.TelephonyManager; import android.util.Log; +import org.chromium.base.ContextUtils; import org.chromium.base.annotations.CalledByNative; import org.chromium.base.annotations.CalledByNativeUnchecked; @@ -44,7 +45,6 @@ /** * Stores the key pair through the CertInstaller activity. - * @param context current application context. * @param publicKey The public key bytes as DER-encoded SubjectPublicKeyInfo (X.509) * @param privateKey The private key as DER-encoded PrivateKeyInfo (PKCS#8). * @return: true on success, false on failure. @@ -54,7 +54,7 @@ * by the CertInstaller UI itself. */ @CalledByNative - public static boolean storeKeyPair(Context context, byte[] publicKey, byte[] privateKey) { + public static boolean storeKeyPair(byte[] publicKey, byte[] privateKey) { // TODO(digit): Use KeyChain official extra values to pass the public and private // keys when they're available. The "KEY" and "PKEY" hard-coded constants were taken // from the platform sources, since there are no official KeyChain.EXTRA_XXX definitions @@ -64,7 +64,7 @@ intent.putExtra("PKEY", privateKey); intent.putExtra("KEY", publicKey); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - context.startActivity(intent); + ContextUtils.getApplicationContext().startActivity(intent); return true; } catch (ActivityNotFoundException e) { Log.w(TAG, "could not store key pair: " + e); @@ -156,9 +156,10 @@ * Returns the ISO country code equivalent of the current MCC. */ @CalledByNative - private static String getNetworkCountryIso(Context context) { + private static String getNetworkCountryIso() { TelephonyManager telephonyManager = - (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); + (TelephonyManager) ContextUtils.getApplicationContext().getSystemService( + Context.TELEPHONY_SERVICE); if (telephonyManager == null) return ""; return telephonyManager.getNetworkCountryIso(); } @@ -168,9 +169,10 @@ * the numeric name of the current registered operator. */ @CalledByNative - private static String getNetworkOperator(Context context) { + private static String getNetworkOperator() { TelephonyManager telephonyManager = - (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); + (TelephonyManager) ContextUtils.getApplicationContext().getSystemService( + Context.TELEPHONY_SERVICE); if (telephonyManager == null) return ""; return telephonyManager.getNetworkOperator(); } @@ -180,9 +182,10 @@ * the numeric name of the current SIM operator. */ @CalledByNative - private static String getSimOperator(Context context) { + private static String getSimOperator() { TelephonyManager telephonyManager = - (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); + (TelephonyManager) ContextUtils.getApplicationContext().getSystemService( + Context.TELEPHONY_SERVICE); if (telephonyManager == null) return ""; return telephonyManager.getSimOperator(); } @@ -192,9 +195,10 @@ * suggests that use of data may incur extra costs. */ @CalledByNative - private static boolean getIsRoaming(Context context) { + private static boolean getIsRoaming() { ConnectivityManager connectivityManager = - (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); + (ConnectivityManager) ContextUtils.getApplicationContext().getSystemService( + Context.CONNECTIVITY_SERVICE); NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo(); if (networkInfo == null) return false; // No active network. return networkInfo.isRoaming(); @@ -209,12 +213,13 @@ */ @TargetApi(Build.VERSION_CODES.M) @CalledByNative - private static boolean getIsCaptivePortal(Context context) { + private static boolean getIsCaptivePortal() { // NetworkCapabilities.NET_CAPABILITY_CAPTIVE_PORTAL is only available on Marshmallow and // later versions. if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) return false; ConnectivityManager connectivityManager = - (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); + (ConnectivityManager) ContextUtils.getApplicationContext().getSystemService( + Context.CONNECTIVITY_SERVICE); if (connectivityManager == null) return false; Network network = connectivityManager.getActiveNetwork(); @@ -230,11 +235,8 @@ * returns empty string. */ @CalledByNative - public static String getWifiSSID(Context context) { - if (context == null) { - return ""; - } - final Intent intent = context.registerReceiver( + public static String getWifiSSID() { + final Intent intent = ContextUtils.getApplicationContext().registerReceiver( null, new IntentFilter(WifiManager.NETWORK_STATE_CHANGED_ACTION)); if (intent != null) { final WifiInfo wifiInfo = intent.getParcelableExtra(WifiManager.EXTRA_WIFI_INFO); @@ -267,9 +269,10 @@ @TargetApi(Build.VERSION_CODES.M) @CalledByNative - private static byte[][] getDnsServers(Context context) { + private static byte[][] getDnsServers() { ConnectivityManager connectivityManager = - (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); + (ConnectivityManager) ContextUtils.getApplicationContext().getSystemService( + Context.CONNECTIVITY_SERVICE); if (connectivityManager == null) { return new byte[0][0]; }
diff --git a/net/android/java/src/org/chromium/net/NetworkChangeNotifier.java b/net/android/java/src/org/chromium/net/NetworkChangeNotifier.java index 9aab28d..2d0fe8d 100644 --- a/net/android/java/src/org/chromium/net/NetworkChangeNotifier.java +++ b/net/android/java/src/org/chromium/net/NetworkChangeNotifier.java
@@ -34,7 +34,6 @@ public void onConnectionTypeChanged(int connectionType); } - private final Context mContext; private final ArrayList<Long> mNativeChangeNotifiers; private final ObserverList<ConnectionTypeObserver> mConnectionTypeObservers; private NetworkChangeNotifierAutoDetect mAutoDetector; @@ -45,19 +44,23 @@ private static NetworkChangeNotifier sInstance; @VisibleForTesting - protected NetworkChangeNotifier(Context context) { - mContext = context.getApplicationContext(); + protected NetworkChangeNotifier() { mNativeChangeNotifiers = new ArrayList<Long>(); mConnectionTypeObservers = new ObserverList<ConnectionTypeObserver>(); } + // TODO(wnwen): Remove after downstream no longer depends on this. + public static NetworkChangeNotifier init(Context context) { + return init(); + } + /** * Initializes the singleton once. */ @CalledByNative - public static NetworkChangeNotifier init(Context context) { + public static NetworkChangeNotifier init() { if (sInstance == null) { - sInstance = new NetworkChangeNotifier(context); + sInstance = new NetworkChangeNotifier(); } return sInstance; } @@ -214,7 +217,7 @@ notifyObserversToPurgeActiveNetworkList(activeNetIds); } }, - mContext, policy); + policy); final NetworkChangeNotifierAutoDetect.NetworkState networkState = mAutoDetector.getCurrentNetworkState(); updateCurrentConnectionType(
diff --git a/net/android/java/src/org/chromium/net/NetworkChangeNotifierAutoDetect.java b/net/android/java/src/org/chromium/net/NetworkChangeNotifierAutoDetect.java index daed21f..e1da29a 100644 --- a/net/android/java/src/org/chromium/net/NetworkChangeNotifierAutoDetect.java +++ b/net/android/java/src/org/chromium/net/NetworkChangeNotifierAutoDetect.java
@@ -30,6 +30,7 @@ import org.chromium.base.ApplicationState; import org.chromium.base.ApplicationStatus; +import org.chromium.base.ContextUtils; import org.chromium.base.ThreadUtils; import org.chromium.base.VisibleForTesting; import org.chromium.base.metrics.RecordHistogram; @@ -377,7 +378,7 @@ return ""; } } - return AndroidNetworkLibrary.getWifiSSID(mContext); + return AndroidNetworkLibrary.getWifiSSID(); } // Fetches WifiInfo and records UMA for NullPointerExceptions. @@ -599,7 +600,6 @@ private final NetworkConnectivityIntentFilter mIntentFilter; private final Observer mObserver; - private final Context mContext; private final RegistrationPolicy mRegistrationPolicy; // mConnectivityManagerDelegates and mWifiManagerDelegate are only non-final for testing. @@ -679,15 +679,14 @@ * {@link RegistrationPolicyApplicationStatus}). */ @TargetApi(Build.VERSION_CODES.LOLLIPOP) - public NetworkChangeNotifierAutoDetect( - Observer observer, Context context, RegistrationPolicy policy) { + public NetworkChangeNotifierAutoDetect(Observer observer, RegistrationPolicy policy) { // Since BroadcastReceiver is always called back on UI thread, ensure // running on UI thread so notification logic can be single-threaded. ThreadUtils.assertOnUiThread(); mObserver = observer; - mContext = context.getApplicationContext(); - mConnectivityManagerDelegate = new ConnectivityManagerDelegate(context); - mWifiManagerDelegate = new WifiManagerDelegate(context); + mConnectivityManagerDelegate = + new ConnectivityManagerDelegate(ContextUtils.getApplicationContext()); + mWifiManagerDelegate = new WifiManagerDelegate(ContextUtils.getApplicationContext()); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { mNetworkCallback = new MyNetworkCallback(); mNetworkRequest = new NetworkRequest.Builder() @@ -760,7 +759,8 @@ // returns non-null, it means the broadcast was previously issued and onReceive() will be // immediately called with this previous Intent. Since this initial callback doesn't // actually indicate a network change, we can ignore it by setting mIgnoreNextBroadcast. - mIgnoreNextBroadcast = mContext.registerReceiver(this, mIntentFilter) != null; + mIgnoreNextBroadcast = + ContextUtils.getApplicationContext().registerReceiver(this, mIntentFilter) != null; mRegistered = true; if (mNetworkCallback != null) { @@ -789,7 +789,7 @@ */ public void unregister() { if (!mRegistered) return; - mContext.unregisterReceiver(this); + ContextUtils.getApplicationContext().unregisterReceiver(this); mRegistered = false; if (mNetworkCallback != null) { mConnectivityManagerDelegate.unregisterNetworkCallback(mNetworkCallback);
diff --git a/net/android/java/src/org/chromium/net/ProxyChangeListener.java b/net/android/java/src/org/chromium/net/ProxyChangeListener.java index f1362d3..1ccf7a59 100644 --- a/net/android/java/src/org/chromium/net/ProxyChangeListener.java +++ b/net/android/java/src/org/chromium/net/ProxyChangeListener.java
@@ -14,6 +14,7 @@ import android.text.TextUtils; import android.util.Log; +import org.chromium.base.ContextUtils; import org.chromium.base.annotations.CalledByNative; import org.chromium.base.annotations.JNINamespace; import org.chromium.base.annotations.NativeClassQualifiedName; @@ -31,7 +32,6 @@ private static boolean sEnabled = true; private long mNativePtr; - private Context mContext; private ProxyReceiver mProxyReceiver; private Delegate mDelegate; @@ -55,9 +55,7 @@ public void proxySettingsChanged(); } - private ProxyChangeListener(Context context) { - mContext = context; - } + private ProxyChangeListener() {} public static void setEnabled(boolean enabled) { sEnabled = enabled; @@ -68,8 +66,8 @@ } @CalledByNative - public static ProxyChangeListener create(Context context) { - return new ProxyChangeListener(context); + public static ProxyChangeListener create() { + return new ProxyChangeListener(); } @CalledByNative @@ -202,14 +200,14 @@ IntentFilter filter = new IntentFilter(); filter.addAction(Proxy.PROXY_CHANGE_ACTION); mProxyReceiver = new ProxyReceiver(); - mContext.getApplicationContext().registerReceiver(mProxyReceiver, filter); + ContextUtils.getApplicationContext().registerReceiver(mProxyReceiver, filter); } private void unregisterReceiver() { if (mProxyReceiver == null) { return; } - mContext.unregisterReceiver(mProxyReceiver); + ContextUtils.getApplicationContext().unregisterReceiver(mProxyReceiver); mProxyReceiver = null; }
diff --git a/net/android/javatests/src/org/chromium/net/NetworkChangeNotifierTest.java b/net/android/javatests/src/org/chromium/net/NetworkChangeNotifierTest.java index b3996271c..78342aa 100644 --- a/net/android/javatests/src/org/chromium/net/NetworkChangeNotifierTest.java +++ b/net/android/javatests/src/org/chromium/net/NetworkChangeNotifierTest.java
@@ -34,6 +34,7 @@ import org.junit.runner.RunWith; import org.chromium.base.ApplicationState; +import org.chromium.base.ContextUtils; import org.chromium.base.ThreadUtils; import org.chromium.base.library_loader.LibraryLoader; import org.chromium.base.library_loader.LibraryProcessType; @@ -84,10 +85,6 @@ * Listens for native notifications of max bandwidth change. */ private static class TestNetworkChangeNotifier extends NetworkChangeNotifier { - private TestNetworkChangeNotifier(Context context) { - super(context); - } - @Override void notifyObserversOfMaxBandwidthChange(double maxBandwidthMbps) { mReceivedMaxBandwidthNotification = true; @@ -137,7 +134,7 @@ try { return sNetworkConstructor.newInstance(netId); } catch ( - InstantiationException | InvocationTargetException | IllegalAccessException e) { + InstantiationException | InvocationTargetException | IllegalAccessException e) { throw new IllegalStateException("Trying to create Network when not allowed"); } } @@ -408,8 +405,9 @@ * it is in the foreground. */ private void createTestNotifier(WatchForChanges watchForChanges) { - Context context = new ContextWrapper( - InstrumentationRegistry.getInstrumentation().getTargetContext()) { + Context context = new ContextWrapper(InstrumentationRegistry.getInstrumentation() + .getTargetContext() + .getApplicationContext()) { // Mock out to avoid unintended system interaction. @Override public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter) { @@ -425,7 +423,8 @@ return this; } }; - mNotifier = new TestNetworkChangeNotifier(context); + ContextUtils.initApplicationContextForTests(context); + mNotifier = new TestNetworkChangeNotifier(); NetworkChangeNotifier.resetInstanceForTests(mNotifier); if (watchForChanges == WatchForChanges.ALWAYS) { NetworkChangeNotifier.registerToReceiveNotificationsAlways(); @@ -478,13 +477,11 @@ @MediumTest @Feature({"Android-AppBase"}) public void testNetworkChangeNotifierRegistersWhenPolicyDictates() { - Context context = InstrumentationRegistry.getInstrumentation().getTargetContext(); - NetworkChangeNotifierAutoDetect.Observer observer = new TestNetworkChangeNotifierAutoDetectObserver(); NetworkChangeNotifierAutoDetect receiver = new NetworkChangeNotifierAutoDetect( - observer, context, new RegistrationPolicyApplicationStatus() { + observer, new RegistrationPolicyApplicationStatus() { @Override int getApplicationState() { return ApplicationState.HAS_RUNNING_ACTIVITIES; @@ -494,7 +491,7 @@ Assert.assertTrue(receiver.isReceiverRegisteredForTesting()); receiver = new NetworkChangeNotifierAutoDetect( - observer, context, new RegistrationPolicyApplicationStatus() { + observer, new RegistrationPolicyApplicationStatus() { @Override int getApplicationState() { return ApplicationState.HAS_PAUSED_ACTIVITIES; @@ -758,7 +755,6 @@ NetworkChangeNotifierAutoDetect.Observer observer = new TestNetworkChangeNotifierAutoDetectObserver(); NetworkChangeNotifierAutoDetect ncn = new NetworkChangeNotifierAutoDetect(observer, - InstrumentationRegistry.getInstrumentation().getTargetContext(), new RegistrationPolicyAlwaysRegister()); ncn.getNetworksAndTypes(); ncn.getDefaultNetId(); @@ -773,13 +769,11 @@ @MediumTest @Feature({"Android-AppBase"}) public void testQueryableAPIsReturnExpectedValuesFromMockDelegate() throws Exception { - Context context = InstrumentationRegistry.getInstrumentation().getTargetContext(); - NetworkChangeNotifierAutoDetect.Observer observer = new TestNetworkChangeNotifierAutoDetectObserver(); NetworkChangeNotifierAutoDetect ncn = new NetworkChangeNotifierAutoDetect( - observer, context, new RegistrationPolicyApplicationStatus() { + observer, new RegistrationPolicyApplicationStatus() { @Override int getApplicationState() { return ApplicationState.HAS_PAUSED_ACTIVITIES; @@ -844,7 +838,6 @@ return; } // Setup NetworkChangeNotifierAutoDetect - final Context context = InstrumentationRegistry.getInstrumentation().getTargetContext(); final TestNetworkChangeNotifierAutoDetectObserver observer = new TestNetworkChangeNotifierAutoDetectObserver(); Callable<NetworkChangeNotifierAutoDetect> callable = @@ -852,7 +845,7 @@ @Override public NetworkChangeNotifierAutoDetect call() { return new NetworkChangeNotifierAutoDetect( - observer, context, new RegistrationPolicyApplicationStatus() { + observer, new RegistrationPolicyApplicationStatus() { // This override prevents NetworkChangeNotifierAutoDetect from // registering for events right off the bat. We'll delay this // until our MockConnectivityManagerDelegate is first installed
diff --git a/net/android/network_change_notifier_delegate_android.cc b/net/android/network_change_notifier_delegate_android.cc index 6bafb44..73cfb99 100644 --- a/net/android/network_change_notifier_delegate_android.cc +++ b/net/android/network_change_notifier_delegate_android.cc
@@ -4,7 +4,6 @@ #include "net/android/network_change_notifier_delegate_android.h" -#include "base/android/context_utils.h" #include "base/android/jni_array.h" #include "base/logging.h" #include "jni/NetworkChangeNotifier_jni.h" @@ -74,9 +73,7 @@ NetworkChangeNotifierDelegateAndroid::NetworkChangeNotifierDelegateAndroid() : observers_(new base::ObserverListThreadSafe<Observer>()) { JNIEnv* env = base::android::AttachCurrentThread(); - java_network_change_notifier_.Reset( - Java_NetworkChangeNotifier_init( - env, base::android::GetApplicationContext())); + java_network_change_notifier_.Reset(Java_NetworkChangeNotifier_init(env)); Java_NetworkChangeNotifier_addNativeObserver( env, java_network_change_notifier_, reinterpret_cast<intptr_t>(this)); SetCurrentConnectionType(
diff --git a/net/android/network_library.cc b/net/android/network_library.cc index 7535952..48f3a95 100644 --- a/net/android/network_library.cc +++ b/net/android/network_library.cc
@@ -4,7 +4,6 @@ #include "net/android/network_library.h" -#include "base/android/context_utils.h" #include "base/android/jni_android.h" #include "base/android/jni_array.h" #include "base/android/jni_string.h" @@ -16,7 +15,6 @@ using base::android::AttachCurrentThread; using base::android::ConvertJavaStringToUTF8; using base::android::ConvertUTF8ToJavaString; -using base::android::GetApplicationContext; using base::android::ScopedJavaLocalRef; using base::android::ToJavaArrayOfByteArray; using base::android::ToJavaByteArray; @@ -73,8 +71,8 @@ ToJavaByteArray(env, public_key, public_len); ScopedJavaLocalRef<jbyteArray> private_array = ToJavaByteArray(env, private_key, private_len); - jboolean ret = Java_AndroidNetworkLibrary_storeKeyPair( - env, GetApplicationContext(), public_array, private_array); + jboolean ret = + Java_AndroidNetworkLibrary_storeKeyPair(env, public_array, private_array); LOG_IF(WARNING, !ret) << "Call to Java_AndroidNetworkLibrary_storeKeyPair failed"; return ret; @@ -110,50 +108,42 @@ std::string GetTelephonyNetworkCountryIso() { return base::android::ConvertJavaStringToUTF8( Java_AndroidNetworkLibrary_getNetworkCountryIso( - base::android::AttachCurrentThread(), - base::android::GetApplicationContext())); + base::android::AttachCurrentThread())); } std::string GetTelephonyNetworkOperator() { return base::android::ConvertJavaStringToUTF8( Java_AndroidNetworkLibrary_getNetworkOperator( - base::android::AttachCurrentThread(), - base::android::GetApplicationContext())); + base::android::AttachCurrentThread())); } std::string GetTelephonySimOperator() { return base::android::ConvertJavaStringToUTF8( Java_AndroidNetworkLibrary_getSimOperator( - base::android::AttachCurrentThread(), - base::android::GetApplicationContext())); + base::android::AttachCurrentThread())); } bool GetIsRoaming() { return Java_AndroidNetworkLibrary_getIsRoaming( - base::android::AttachCurrentThread(), - base::android::GetApplicationContext()); + base::android::AttachCurrentThread()); } bool GetIsCaptivePortal() { return Java_AndroidNetworkLibrary_getIsCaptivePortal( - base::android::AttachCurrentThread(), - base::android::GetApplicationContext()); + base::android::AttachCurrentThread()); } std::string GetWifiSSID() { return base::android::ConvertJavaStringToUTF8( Java_AndroidNetworkLibrary_getWifiSSID( - base::android::AttachCurrentThread(), - base::android::GetApplicationContext())); + base::android::AttachCurrentThread())); } void GetDnsServers(std::vector<IPEndPoint>* dns_servers) { JNIEnv* env = AttachCurrentThread(); std::vector<std::string> dns_servers_strings; base::android::JavaArrayOfByteArrayToStringVector( - env, Java_AndroidNetworkLibrary_getDnsServers( - env, base::android::GetApplicationContext()) - .obj(), + env, Java_AndroidNetworkLibrary_getDnsServers(env).obj(), &dns_servers_strings); for (const std::string& dns_address_string : dns_servers_strings) { IPAddress dns_address(
diff --git a/net/cert/x509_util_android.cc b/net/cert/x509_util_android.cc index b2219b1a..908ce3c 100644 --- a/net/cert/x509_util_android.cc +++ b/net/cert/x509_util_android.cc
@@ -5,7 +5,6 @@ #include "net/cert/x509_util_android.h" #include "base/android/build_info.h" -#include "base/android/context_utils.h" #include "base/metrics/histogram_macros.h" #include "jni/X509Util_jni.h" #include "net/cert/cert_database.h"
diff --git a/net/proxy/proxy_config_service_android.cc b/net/proxy/proxy_config_service_android.cc index 096ad47..1b3878d 100644 --- a/net/proxy/proxy_config_service_android.cc +++ b/net/proxy/proxy_config_service_android.cc
@@ -6,7 +6,6 @@ #include <sys/system_properties.h> -#include "base/android/context_utils.h" #include "base/android/jni_array.h" #include "base/android/jni_string.h" #include "base/bind.h" @@ -208,9 +207,7 @@ DCHECK(OnJNIThread()); JNIEnv* env = AttachCurrentThread(); if (java_proxy_change_listener_.is_null()) { - java_proxy_change_listener_.Reset( - Java_ProxyChangeListener_create( - env, base::android::GetApplicationContext())); + java_proxy_change_listener_.Reset(Java_ProxyChangeListener_create(env)); CHECK(!java_proxy_change_listener_.is_null()); } Java_ProxyChangeListener_start(env, java_proxy_change_listener_,
diff --git a/sandbox/win/sandbox_poc/main_ui_window.h b/sandbox/win/sandbox_poc/main_ui_window.h index b995b34..5bf98dd 100644 --- a/sandbox/win/sandbox_poc/main_ui_window.h +++ b/sandbox/win/sandbox_poc/main_ui_window.h
@@ -14,7 +14,6 @@ namespace sandbox { class BrokerServices; -enum ResultCode; } // Header file for the MainUIWindow, a simple window with a menu bar that
diff --git a/sandbox/win/src/filesystem_policy.h b/sandbox/win/src/filesystem_policy.h index c2ee160..0ed1e5d 100644 --- a/sandbox/win/src/filesystem_policy.h +++ b/sandbox/win/src/filesystem_policy.h
@@ -17,8 +17,6 @@ namespace sandbox { -enum EvalResult; - // This class centralizes most of the knowledge related to file system policy class FileSystemPolicy { public:
diff --git a/sandbox/win/src/interception.h b/sandbox/win/src/interception.h index 969b367..d21bed30 100644 --- a/sandbox/win/src/interception.h +++ b/sandbox/win/src/interception.h
@@ -17,12 +17,12 @@ #include "base/gtest_prod_util.h" #include "base/macros.h" #include "base/strings/string16.h" +#include "sandbox/win/src/interceptors.h" #include "sandbox/win/src/sandbox_types.h" namespace sandbox { class TargetProcess; -enum InterceptorId; // Internal structures used for communication between the broker and the target. struct DllPatchInfo;
diff --git a/sandbox/win/src/interception_internal.h b/sandbox/win/src/interception_internal.h index 45a0557..390bd9eb 100644 --- a/sandbox/win/src/interception_internal.h +++ b/sandbox/win/src/interception_internal.h
@@ -11,14 +11,13 @@ #include <stddef.h> +#include "sandbox/win/src/interceptors.h" #include "sandbox/win/src/sandbox_types.h" namespace sandbox { const int kMaxThunkDataBytes = 64; -enum InterceptorId; - // The following structures contain variable size fields at the end, and will be // used to transfer information between two processes. In order to guarantee // our ability to follow the chain of structures, the alignment should be fixed,
diff --git a/sandbox/win/src/named_pipe_policy.h b/sandbox/win/src/named_pipe_policy.h index 02aa26c..20f0e97f 100644 --- a/sandbox/win/src/named_pipe_policy.h +++ b/sandbox/win/src/named_pipe_policy.h
@@ -14,8 +14,6 @@ namespace sandbox { -enum EvalResult; - // This class centralizes most of the knowledge related to named pipe creation. class NamedPipePolicy { public:
diff --git a/sandbox/win/src/process_mitigations_win32k_policy.h b/sandbox/win/src/process_mitigations_win32k_policy.h index bc39b99..1fffdc7 100644 --- a/sandbox/win/src/process_mitigations_win32k_policy.h +++ b/sandbox/win/src/process_mitigations_win32k_policy.h
@@ -12,8 +12,6 @@ namespace sandbox { -enum EvalResult; - // A callback function type to get a function for testing. typedef void* (*OverrideForTestFunction)(const char* name);
diff --git a/sandbox/win/src/process_thread_policy.h b/sandbox/win/src/process_thread_policy.h index f51d89f..f92f996 100644 --- a/sandbox/win/src/process_thread_policy.h +++ b/sandbox/win/src/process_thread_policy.h
@@ -17,8 +17,6 @@ namespace sandbox { -enum EvalResult; - // This class centralizes most of the knowledge related to process execution. class ProcessPolicy { public:
diff --git a/sandbox/win/src/registry_policy.h b/sandbox/win/src/registry_policy.h index ddea1bf5..de4690e 100644 --- a/sandbox/win/src/registry_policy.h +++ b/sandbox/win/src/registry_policy.h
@@ -17,8 +17,6 @@ namespace sandbox { -enum EvalResult; - // This class centralizes most of the knowledge related to registry policy class RegistryPolicy { public:
diff --git a/sandbox/win/src/sandbox_types.h b/sandbox/win/src/sandbox_types.h index ae36ef5..7282fa5 100644 --- a/sandbox/win/src/sandbox_types.h +++ b/sandbox/win/src/sandbox_types.h
@@ -13,7 +13,8 @@ // Operation result codes returned by the sandbox API. // // Note: These codes are listed in a histogram and any new codes should be added -// at the end. +// at the end. If the underlying type is changed then the forward declaration in +// sandbox_init.h must be updated. // enum ResultCode : int { SBOX_ALL_OK = 0,
diff --git a/sandbox/win/src/sync_policy.h b/sandbox/win/src/sync_policy.h index 24e5c7d..6cb9d83 100644 --- a/sandbox/win/src/sync_policy.h +++ b/sandbox/win/src/sync_policy.h
@@ -17,8 +17,6 @@ namespace sandbox { -enum EvalResult; - // This class centralizes most of the knowledge related to sync policy class SyncPolicy { public:
diff --git a/storage/browser/fileapi/file_writer_delegate_unittest.cc b/storage/browser/fileapi/file_writer_delegate_unittest.cc index 39deadf..9733b4b 100644 --- a/storage/browser/fileapi/file_writer_delegate_unittest.cc +++ b/storage/browser/fileapi/file_writer_delegate_unittest.cc
@@ -201,8 +201,6 @@ return buf_size; } - int GetResponseCode() const override { return 200; } - void GetResponseInfo(net::HttpResponseInfo* info) override { const char kStatus[] = "HTTP/1.1 200 OK\0"; const size_t kStatusLen = arraysize(kStatus);
diff --git a/testing/buildbot/chromium.gpu.fyi.json b/testing/buildbot/chromium.gpu.fyi.json index 1fe703d8..280ad07 100644 --- a/testing/buildbot/chromium.gpu.fyi.json +++ b/testing/buildbot/chromium.gpu.fyi.json
@@ -3785,7 +3785,7 @@ "args": [ "--enable-gpu", "--test-launcher-jobs=1", - "--test-launcher-filter-file=../../testing/buildbot/filters/tab-capture-end2end-tests.browser_tests.filter" + "--gtest_filter=CastStreamingApiTestWithPixelOutput.EndToEnd*:TabCaptureApiPixelTest.EndToEnd*" ], "name": "tab_capture_end2end_tests", "swarming": { @@ -4241,7 +4241,7 @@ "args": [ "--enable-gpu", "--test-launcher-jobs=1", - "--test-launcher-filter-file=../../testing/buildbot/filters/tab-capture-end2end-tests.browser_tests.filter" + "--gtest_filter=CastStreamingApiTestWithPixelOutput.EndToEnd*:TabCaptureApiPixelTest.EndToEnd*" ], "name": "tab_capture_end2end_tests", "swarming": { @@ -4723,7 +4723,7 @@ "args": [ "--enable-gpu", "--test-launcher-jobs=1", - "--test-launcher-filter-file=../../testing/buildbot/filters/tab-capture-end2end-tests.browser_tests.filter" + "--gtest_filter=CastStreamingApiTestWithPixelOutput.EndToEnd*:TabCaptureApiPixelTest.EndToEnd*" ], "name": "tab_capture_end2end_tests", "swarming": { @@ -5234,25 +5234,6 @@ }, { "args": [ - "--enable-gpu", - "--test-launcher-jobs=1", - "--test-launcher-filter-file=../../testing/buildbot/filters/tab-capture-end2end-tests.browser_tests.filter" - ], - "name": "tab_capture_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "10de:104a", - "os": "Ubuntu" - } - ] - }, - "test": "browser_tests", - "use_xvfb": false - }, - { - "args": [ "--use-gpu-in-tests" ], "swarming": { @@ -5311,6 +5292,19 @@ }, "test": "swiftshader_unittests", "use_xvfb": false + }, + { + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "10de:104a", + "os": "Ubuntu" + } + ] + }, + "test": "tab_capture_end2end_tests", + "use_xvfb": false } ], "isolated_scripts": [ @@ -6131,7 +6125,7 @@ "args": [ "--enable-gpu", "--test-launcher-jobs=1", - "--test-launcher-filter-file=../../testing/buildbot/filters/tab-capture-end2end-tests.browser_tests.filter" + "--gtest_filter=CastStreamingApiTestWithPixelOutput.EndToEnd*:TabCaptureApiPixelTest.EndToEnd*" ], "name": "tab_capture_end2end_tests", "swarming": { @@ -6563,7 +6557,7 @@ "args": [ "--enable-gpu", "--test-launcher-jobs=1", - "--test-launcher-filter-file=../../testing/buildbot/filters/tab-capture-end2end-tests.browser_tests.filter" + "--gtest_filter=CastStreamingApiTestWithPixelOutput.EndToEnd*:TabCaptureApiPixelTest.EndToEnd*" ], "name": "tab_capture_end2end_tests", "swarming": { @@ -7005,30 +6999,6 @@ }, { "args": [ - "--enable-gpu", - "--test-launcher-jobs=1", - "--test-launcher-filter-file=../../testing/buildbot/filters/tab-capture-end2end-tests.browser_tests.filter" - ], - "name": "tab_capture_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "8086:0a2e", - "os": "Mac-10.12" - }, - { - "gpu": "1002:6821", - "hidpi": "1", - "os": "Mac" - } - ] - }, - "test": "browser_tests", - "use_xvfb": false - }, - { - "args": [ "--use-gpu-in-tests" ], "swarming": { @@ -7129,6 +7099,24 @@ }, "test": "swiftshader_unittests", "use_xvfb": false + }, + { + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0a2e", + "os": "Mac-10.12" + }, + { + "gpu": "1002:6821", + "hidpi": "1", + "os": "Mac" + } + ] + }, + "test": "tab_capture_end2end_tests", + "use_xvfb": false } ], "isolated_scripts": [ @@ -7866,7 +7854,7 @@ "args": [ "--enable-gpu", "--test-launcher-jobs=1", - "--test-launcher-filter-file=../../testing/buildbot/filters/tab-capture-end2end-tests.browser_tests.filter" + "--gtest_filter=CastStreamingApiTestWithPixelOutput.EndToEnd*:TabCaptureApiPixelTest.EndToEnd*" ], "name": "tab_capture_end2end_tests", "swarming": { @@ -8261,25 +8249,6 @@ }, { "args": [ - "--enable-gpu", - "--test-launcher-jobs=1", - "--test-launcher-filter-file=../../testing/buildbot/filters/tab-capture-end2end-tests.browser_tests.filter" - ], - "name": "tab_capture_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "8086:0a2e", - "os": "Mac-10.12" - } - ] - }, - "test": "browser_tests", - "use_xvfb": false - }, - { - "args": [ "--use-gpu-in-tests" ], "swarming": { @@ -8355,6 +8324,19 @@ }, "test": "swiftshader_unittests", "use_xvfb": false + }, + { + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0a2e", + "os": "Mac-10.12" + } + ] + }, + "test": "tab_capture_end2end_tests", + "use_xvfb": false } ], "isolated_scripts": [ @@ -9509,26 +9491,6 @@ }, { "args": [ - "--enable-gpu", - "--test-launcher-jobs=1", - "--test-launcher-filter-file=../../testing/buildbot/filters/tab-capture-end2end-tests.browser_tests.filter" - ], - "name": "tab_capture_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "1002:6821", - "hidpi": "1", - "os": "Mac" - } - ] - }, - "test": "browser_tests", - "use_xvfb": false - }, - { - "args": [ "--use-gpu-in-tests" ], "swarming": { @@ -9609,6 +9571,20 @@ }, "test": "swiftshader_unittests", "use_xvfb": false + }, + { + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "1002:6821", + "hidpi": "1", + "os": "Mac" + } + ] + }, + "test": "tab_capture_end2end_tests", + "use_xvfb": false } ], "isolated_scripts": [ @@ -9962,26 +9938,6 @@ }, { "args": [ - "--enable-gpu", - "--test-launcher-jobs=1", - "--test-launcher-filter-file=../../testing/buildbot/filters/tab-capture-end2end-tests.browser_tests.filter" - ], - "name": "tab_capture_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "10de:0fe9", - "hidpi": "1", - "os": "Mac" - } - ] - }, - "test": "browser_tests", - "use_xvfb": false - }, - { - "args": [ "--use-gpu-in-tests" ], "swarming": { @@ -10062,6 +10018,20 @@ }, "test": "swiftshader_unittests", "use_xvfb": false + }, + { + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "10de:0fe9", + "hidpi": "1", + "os": "Mac" + } + ] + }, + "test": "tab_capture_end2end_tests", + "use_xvfb": false } ], "isolated_scripts": [ @@ -12954,7 +12924,7 @@ "args": [ "--enable-gpu", "--test-launcher-jobs=1", - "--test-launcher-filter-file=../../testing/buildbot/filters/tab-capture-end2end-tests.browser_tests.filter" + "--gtest_filter=CastStreamingApiTestWithPixelOutput.EndToEnd*:TabCaptureApiPixelTest.EndToEnd*" ], "name": "tab_capture_end2end_tests", "swarming": { @@ -13524,7 +13494,7 @@ "args": [ "--enable-gpu", "--test-launcher-jobs=1", - "--test-launcher-filter-file=../../testing/buildbot/filters/tab-capture-end2end-tests.browser_tests.filter" + "--gtest_filter=CastStreamingApiTestWithPixelOutput.EndToEnd*:TabCaptureApiPixelTest.EndToEnd*" ], "name": "tab_capture_end2end_tests", "swarming": { @@ -14111,25 +14081,6 @@ }, { "args": [ - "--enable-gpu", - "--test-launcher-jobs=1", - "--test-launcher-filter-file=../../testing/buildbot/filters/tab-capture-end2end-tests.browser_tests.filter" - ], - "name": "tab_capture_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "10de:104a", - "os": "Windows-10" - } - ] - }, - "test": "browser_tests", - "use_xvfb": false - }, - { - "args": [ "--use-gpu-in-tests" ], "swarming": { @@ -14227,6 +14178,19 @@ "use_xvfb": false }, { + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "10de:104a", + "os": "Windows-10" + } + ] + }, + "test": "tab_capture_end2end_tests", + "use_xvfb": false + }, + { "args": [ "--use-angle=d3d11", "--use-test-data-path", @@ -15823,7 +15787,7 @@ "args": [ "--enable-gpu", "--test-launcher-jobs=1", - "--test-launcher-filter-file=../../testing/buildbot/filters/tab-capture-end2end-tests.browser_tests.filter" + "--gtest_filter=CastStreamingApiTestWithPixelOutput.EndToEnd*:TabCaptureApiPixelTest.EndToEnd*" ], "name": "tab_capture_end2end_tests", "swarming": { @@ -16425,25 +16389,6 @@ }, { "args": [ - "--enable-gpu", - "--test-launcher-jobs=1", - "--test-launcher-filter-file=../../testing/buildbot/filters/tab-capture-end2end-tests.browser_tests.filter" - ], - "name": "tab_capture_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "1002:6613", - "os": "Windows-2008ServerR2-SP1" - } - ] - }, - "test": "browser_tests", - "use_xvfb": false - }, - { - "args": [ "--use-gpu-in-tests" ], "swarming": { @@ -16541,6 +16486,19 @@ "use_xvfb": false }, { + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "1002:6613", + "os": "Windows-2008ServerR2-SP1" + } + ] + }, + "test": "tab_capture_end2end_tests", + "use_xvfb": false + }, + { "args": [ "--use-angle=d3d11", "--use-test-data-path", @@ -17089,25 +17047,6 @@ }, { "args": [ - "--enable-gpu", - "--test-launcher-jobs=1", - "--test-launcher-filter-file=../../testing/buildbot/filters/tab-capture-end2end-tests.browser_tests.filter" - ], - "name": "tab_capture_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "10de:104a", - "os": "Windows-2008ServerR2-SP1" - } - ] - }, - "test": "browser_tests", - "use_xvfb": false - }, - { - "args": [ "--use-gpu-in-tests" ], "swarming": { @@ -17205,6 +17144,19 @@ "use_xvfb": false }, { + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "10de:104a", + "os": "Windows-2008ServerR2-SP1" + } + ] + }, + "test": "tab_capture_end2end_tests", + "use_xvfb": false + }, + { "args": [ "--use-angle=d3d11", "--use-test-data-path", @@ -18311,25 +18263,6 @@ }, { "args": [ - "--enable-gpu", - "--test-launcher-jobs=1", - "--test-launcher-filter-file=../../testing/buildbot/filters/tab-capture-end2end-tests.browser_tests.filter" - ], - "name": "tab_capture_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "10de:104a", - "os": "Windows-2008ServerR2-SP1" - } - ] - }, - "test": "browser_tests", - "use_xvfb": false - }, - { - "args": [ "--use-gpu-in-tests" ], "swarming": { @@ -18427,6 +18360,19 @@ "use_xvfb": false }, { + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "10de:104a", + "os": "Windows-2008ServerR2-SP1" + } + ] + }, + "test": "tab_capture_end2end_tests", + "use_xvfb": false + }, + { "args": [ "--use-angle=d3d11", "--use-test-data-path",
diff --git a/testing/buildbot/chromium.gpu.json b/testing/buildbot/chromium.gpu.json index 0fb25e38..b6b733e 100644 --- a/testing/buildbot/chromium.gpu.json +++ b/testing/buildbot/chromium.gpu.json
@@ -337,25 +337,6 @@ }, { "args": [ - "--enable-gpu", - "--test-launcher-jobs=1", - "--test-launcher-filter-file=../../testing/buildbot/filters/tab-capture-end2end-tests.browser_tests.filter" - ], - "name": "tab_capture_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "10de:104a", - "os": "Ubuntu" - } - ] - }, - "test": "browser_tests", - "use_xvfb": false - }, - { - "args": [ "--use-gpu-in-tests" ], "swarming": { @@ -385,6 +366,19 @@ }, "test": "gl_unittests", "use_xvfb": false + }, + { + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "10de:104a", + "os": "Ubuntu" + } + ] + }, + "test": "tab_capture_end2end_tests", + "use_xvfb": false } ], "isolated_scripts": [ @@ -974,25 +968,6 @@ }, { "args": [ - "--enable-gpu", - "--test-launcher-jobs=1", - "--test-launcher-filter-file=../../testing/buildbot/filters/tab-capture-end2end-tests.browser_tests.filter" - ], - "name": "tab_capture_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "8086:0a2e", - "os": "Mac-10.12" - } - ] - }, - "test": "browser_tests", - "use_xvfb": false - }, - { - "args": [ "--use-gpu-in-tests" ], "swarming": { @@ -1022,6 +997,19 @@ }, "test": "gl_unittests", "use_xvfb": false + }, + { + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0a2e", + "os": "Mac-10.12" + } + ] + }, + "test": "tab_capture_end2end_tests", + "use_xvfb": false } ], "isolated_scripts": [ @@ -1625,26 +1613,6 @@ }, { "args": [ - "--enable-gpu", - "--test-launcher-jobs=1", - "--test-launcher-filter-file=../../testing/buildbot/filters/tab-capture-end2end-tests.browser_tests.filter" - ], - "name": "tab_capture_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "1002:6821", - "hidpi": "1", - "os": "Mac" - } - ] - }, - "test": "browser_tests", - "use_xvfb": false - }, - { - "args": [ "--use-gpu-in-tests" ], "swarming": { @@ -1676,6 +1644,20 @@ }, "test": "gl_unittests", "use_xvfb": false + }, + { + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "1002:6821", + "hidpi": "1", + "os": "Mac" + } + ] + }, + "test": "tab_capture_end2end_tests", + "use_xvfb": false } ], "isolated_scripts": [ @@ -2294,25 +2276,6 @@ }, { "args": [ - "--enable-gpu", - "--test-launcher-jobs=1", - "--test-launcher-filter-file=../../testing/buildbot/filters/tab-capture-end2end-tests.browser_tests.filter" - ], - "name": "tab_capture_end2end_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "10de:104a", - "os": "Windows-2008ServerR2-SP1" - } - ] - }, - "test": "browser_tests", - "use_xvfb": false - }, - { - "args": [ "--use-gpu-in-tests" ], "swarming": { @@ -2344,6 +2307,19 @@ "use_xvfb": false }, { + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "10de:104a", + "os": "Windows-2008ServerR2-SP1" + } + ] + }, + "test": "tab_capture_end2end_tests", + "use_xvfb": false + }, + { "args": [ "--use-angle=d3d11", "--use-test-data-path",
diff --git a/testing/buildbot/filters/BUILD.gn b/testing/buildbot/filters/BUILD.gn index 5559437..1d2d0ec 100644 --- a/testing/buildbot/filters/BUILD.gn +++ b/testing/buildbot/filters/BUILD.gn
@@ -25,7 +25,6 @@ "//testing/buildbot/filters/mojo.fyi.browser_tests.filter", "//testing/buildbot/filters/mojo.fyi.mus.browser_tests.filter", "//testing/buildbot/filters/site-per-process.browser_tests.filter", - "//testing/buildbot/filters/tab-capture-end2end-tests.browser_tests.filter", ] }
diff --git a/testing/buildbot/filters/tab-capture-end2end-tests.browser_tests.filter b/testing/buildbot/filters/tab-capture-end2end-tests.browser_tests.filter deleted file mode 100644 index fa34a7f..0000000 --- a/testing/buildbot/filters/tab-capture-end2end-tests.browser_tests.filter +++ /dev/null
@@ -1,2 +0,0 @@ -CastStreamingApiTestWithPixelOutput.EndToEnd* -TabCaptureApiPixelTest.EndToEnd*
diff --git a/testing/buildbot/gn_isolate_map.pyl b/testing/buildbot/gn_isolate_map.pyl index afc2d21..bb3f5f1 100644 --- a/testing/buildbot/gn_isolate_map.pyl +++ b/testing/buildbot/gn_isolate_map.pyl
@@ -30,6 +30,9 @@ # "console_test_launcher" # : the test is a gtest-based test that uses the "brave-new-test-launcher" # from //base/test:test_support but does not need Xvfb. +# "gpu_browser_test" +# : the test is a subset of the browser_tests that will be run against +# a real GPU. # "additional_compile_target" # : this isn't actually a test, but we still need a mapping from the # ninja target to the GN label in order to analyze it. @@ -891,6 +894,11 @@ "label": "//android_webview:system_webview_apk", "type": "additional_compile_target", }, + "tab_capture_end2end_tests": { + "label": "//chrome/test:browser_tests", + "type": "gpu_browser_test", + "gtest_filter": "CastStreamingApiTestWithPixelOutput.EndToEnd*:TabCaptureApiPixelTest.EndToEnd*", + }, "telemetry_gpu_integration_test": { "label": "//chrome/test:telemetry_gpu_integration_test", "type": "script",
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations index 8bbadac..1d21eee 100644 --- a/third_party/WebKit/LayoutTests/TestExpectations +++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -3483,17 +3483,6 @@ crbug.com/708934 fast/backgrounds/background-image-relative-url-in-iframe.html [ Failure Pass ] -# Skip tests for vibrate with feature policy -crbug.com/710850 http/tests/feature-policy/vibrate-enabledforall.php [ Skip ] -crbug.com/710850 http/tests/feature-policy/vibrate-enabledforself.php [ Skip ] -crbug.com/710850 http/tests/feature-policy/vibrate-disabled.php [ Skip ] -crbug.com/710850 virtual/feature-policy/http/tests/feature-policy/vibrate-enabledforall.php [ Skip ] -crbug.com/710850 virtual/feature-policy/http/tests/feature-policy/vibrate-enabledforself.php [ Skip ] -crbug.com/710850 virtual/feature-policy/http/tests/feature-policy/vibrate-disabled.php [ Skip ] -crbug.com/710850 virtual/mojo-loading/http/tests/feature-policy/vibrate-enabledforall.php [ Skip ] -crbug.com/710850 virtual/mojo-loading/http/tests/feature-policy/vibrate-enabledforself.php [ Skip ] -crbug.com/710850 virtual/mojo-loading/http/tests/feature-policy/vibrate-disabled.php [ Skip ] - crbug.com/713509 crypto/subtle/worker-subtle-crypto-concurrent.html [ Pass Timeout ] crbug.com/713685 [ Linux ] fast/workers/termination-early.html [ Crash Pass ]
diff --git a/third_party/WebKit/LayoutTests/VirtualTestSuites b/third_party/WebKit/LayoutTests/VirtualTestSuites index 46300a71..00bf19d 100644 --- a/third_party/WebKit/LayoutTests/VirtualTestSuites +++ b/third_party/WebKit/LayoutTests/VirtualTestSuites
@@ -493,6 +493,11 @@ "args": ["--enable-blink-features=FeaturePolicy"] }, { + "prefix": "feature-policy-experimental-features", + "base": "http/tests/feature-policy-experimental-features", + "args": ["--enable-blink-features=FeaturePolicy,FeaturePolicyExperimentalFeatures"] + }, + { "prefix": "mojo-localstorage", "base": "external/wpt/webstorage", "args": ["--mojo-local-storage"]
diff --git a/third_party/WebKit/LayoutTests/csspaint/parse-input-arguments-expected.txt b/third_party/WebKit/LayoutTests/csspaint/parse-input-arguments-expected.txt index 67808d75..5f2e37e 100644 --- a/third_party/WebKit/LayoutTests/csspaint/parse-input-arguments-expected.txt +++ b/third_party/WebKit/LayoutTests/csspaint/parse-input-arguments-expected.txt
@@ -1,7 +1,7 @@ CONSOLE MESSAGE: line 15: The worklet should throw an error with: "failed!" CONSOLE ERROR: line 1: Uncaught Error: failed! CONSOLE MESSAGE: line 15: The worklet should throw an error with: " Failed to execute 'registerPaint' on 'PaintWorkletGlobalScope': The value provided is neither an array, nor does it have indexed properties." -CONSOLE ERROR: line 1: Uncaught TypeError: Failed to execute 'registerPaint' on 'PaintWorkletGlobalScope': The value provided is neither an array, nor does it have indexed properties. +CONSOLE ERROR: line 1: Uncaught TypeError: Failed to execute 'registerPaint' on 'PaintWorkletGlobalScope': The provided value cannot be converted to a sequence. CONSOLE MESSAGE: line 15: The worklet should throw an error with: "Failed to execute 'registerPaint' on 'PaintWorkletGlobalScope': Invalid argument types." CONSOLE ERROR: line 1: Uncaught TypeError: Failed to execute 'registerPaint' on 'PaintWorkletGlobalScope': Invalid argument types. CONSOLE MESSAGE: line 19: The worklet should not throw an error.
diff --git a/third_party/WebKit/LayoutTests/csspaint/registerPaint-expected.txt b/third_party/WebKit/LayoutTests/csspaint/registerPaint-expected.txt index f2d1a010..b9774e6c 100644 --- a/third_party/WebKit/LayoutTests/csspaint/registerPaint-expected.txt +++ b/third_party/WebKit/LayoutTests/csspaint/registerPaint-expected.txt
@@ -5,7 +5,7 @@ CONSOLE MESSAGE: line 15: The worklet should throw an error with: "failed!" CONSOLE ERROR: line 1: Uncaught Error: failed! CONSOLE MESSAGE: line 15: The worklet should throw an error with: "The value provided is neither an array, nor does it have indexed properties." -CONSOLE ERROR: line 1: Uncaught TypeError: Failed to execute 'registerPaint' on 'PaintWorkletGlobalScope': The value provided is neither an array, nor does it have indexed properties. +CONSOLE ERROR: line 1: Uncaught TypeError: Failed to execute 'registerPaint' on 'PaintWorkletGlobalScope': The provided value cannot be converted to a sequence. CONSOLE MESSAGE: line 15: The worklet should throw an error with: "The 'prototype' object on the class does not exist." CONSOLE ERROR: line 1: Uncaught TypeError: Failed to execute 'registerPaint' on 'PaintWorkletGlobalScope': The 'prototype' object on the class does not exist. CONSOLE MESSAGE: line 15: The worklet should throw an error with: "The 'prototype' property on the class is not an object."
diff --git a/third_party/WebKit/LayoutTests/http/tests/feature-policy/resources/feature-policy-vibrate-disabled.html b/third_party/WebKit/LayoutTests/http/tests/feature-policy-experimental-features/resources/feature-policy-vibrate-disabled.html similarity index 97% rename from third_party/WebKit/LayoutTests/http/tests/feature-policy/resources/feature-policy-vibrate-disabled.html rename to third_party/WebKit/LayoutTests/http/tests/feature-policy-experimental-features/resources/feature-policy-vibrate-disabled.html index 2fab1c8..147acd9 100644 --- a/third_party/WebKit/LayoutTests/http/tests/feature-policy/resources/feature-policy-vibrate-disabled.html +++ b/third_party/WebKit/LayoutTests/http/tests/feature-policy-experimental-features/resources/feature-policy-vibrate-disabled.html
@@ -22,4 +22,5 @@ </script> <body> <button id="test" onclick="testVibrate();">Click to vibrate</button> - +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/http/tests/feature-policy/resources/feature-policy-vibrate-enabled.html b/third_party/WebKit/LayoutTests/http/tests/feature-policy-experimental-features/resources/feature-policy-vibrate-enabled.html similarity index 100% rename from third_party/WebKit/LayoutTests/http/tests/feature-policy/resources/feature-policy-vibrate-enabled.html rename to third_party/WebKit/LayoutTests/http/tests/feature-policy-experimental-features/resources/feature-policy-vibrate-enabled.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/feature-policy/vibrate-disabled-expected.txt b/third_party/WebKit/LayoutTests/http/tests/feature-policy-experimental-features/vibrate-disabled-expected.txt similarity index 60% rename from third_party/WebKit/LayoutTests/http/tests/feature-policy/vibrate-disabled-expected.txt rename to third_party/WebKit/LayoutTests/http/tests/feature-policy-experimental-features/vibrate-disabled-expected.txt index 9962515..ee1a2141 100644 --- a/third_party/WebKit/LayoutTests/http/tests/feature-policy/vibrate-disabled-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/feature-policy-experimental-features/vibrate-disabled-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE ERROR: line 9: Blocked call to navigator.vibrate because user hasn't tapped on the frame or any embedded frame yet: https://www.chromestatus.com/feature/5644273861001216. -------- @@ -13,6 +12,6 @@ Frame: '<!--framePath //<!--frame1-->-->' -------- This is a testharness.js-based test. -PASS No iframe may call navigator.vibrate when disabled. +FAIL No iframe may call navigator.vibrate when disabled. assert_false: expected false got true Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/http/tests/feature-policy/vibrate-enabledforself.php b/third_party/WebKit/LayoutTests/http/tests/feature-policy-experimental-features/vibrate-disabled.php similarity index 69% copy from third_party/WebKit/LayoutTests/http/tests/feature-policy/vibrate-enabledforself.php copy to third_party/WebKit/LayoutTests/http/tests/feature-policy-experimental-features/vibrate-disabled.php index b9abda90..66409b1 100644 --- a/third_party/WebKit/LayoutTests/http/tests/feature-policy/vibrate-enabledforself.php +++ b/third_party/WebKit/LayoutTests/http/tests/feature-policy-experimental-features/vibrate-disabled.php
@@ -3,10 +3,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// This test ensures that navigator.vibrate when enabled for self only works on -// the same origin. +// This test ensures that navigator.vibrate when disabled may not be called by +// any iframe. -Header("Feature-Policy: {\"vibrate\": [\"self\"]}"); +Header("Feature-Policy: {\"vibrate\": []}"); ?> <!DOCTYPE html> @@ -31,7 +31,7 @@ </script> </head> <body onload="loaded();"> -<iframe id="f1" src="resources/feature-policy-vibrate-enabled.html"></iframe> -<iframe id="f2" src="http://localhost:8000/feature-policy/resources/feature-policy-vibrate-disabled.html"></iframe> +<iframe id="f1" src="resources/feature-policy-vibrate-disabled.html"></iframe> +<iframe id="f2" src="http://localhost:8000/feature-policy-experimental-features/resources/feature-policy-vibrate-disabled.html"></iframe> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/http/tests/feature-policy/vibrate-enabledforall.php b/third_party/WebKit/LayoutTests/http/tests/feature-policy-experimental-features/vibrate-enabledforall.php similarity index 84% rename from third_party/WebKit/LayoutTests/http/tests/feature-policy/vibrate-enabledforall.php rename to third_party/WebKit/LayoutTests/http/tests/feature-policy-experimental-features/vibrate-enabledforall.php index 50c03732..0fcaee73 100644 --- a/third_party/WebKit/LayoutTests/http/tests/feature-policy/vibrate-enabledforall.php +++ b/third_party/WebKit/LayoutTests/http/tests/feature-policy-experimental-features/vibrate-enabledforall.php
@@ -22,7 +22,7 @@ function loaded() { var iframes = document.getElementsByTagName('iframe'); - for (var i = 0; i < iframes.length; ++i) { // < 1; ++i) { // + for (var i = 0; i < iframes.length; ++i) { var iframe = iframes[i]; // The iframe uses eventSender to emulate a user navigatation, which requires absolute coordinates. iframe.contentWindow.postMessage({x: iframe.offsetLeft, y: iframe.offsetTop}, "*"); @@ -32,6 +32,6 @@ </head> <body onload="loaded();"> <iframe id="f1" src="resources/feature-policy-vibrate-enabled.html"></iframe> -<iframe id="f2" src="http://localhost:8000/feature-policy/resources/feature-policy-vibrate-enabled.html"></iframe> +<iframe id="f2" src="http://localhost:8000/feature-policy-experimental-features/resources/feature-policy-vibrate-enabled.html"></iframe> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/virtual/feature-policy/http/tests/feature-policy/vibrate-enabledforself-expected.txt b/third_party/WebKit/LayoutTests/http/tests/feature-policy-experimental-features/vibrate-enabledforself-expected.txt similarity index 77% copy from third_party/WebKit/LayoutTests/virtual/feature-policy/http/tests/feature-policy/vibrate-enabledforself-expected.txt copy to third_party/WebKit/LayoutTests/http/tests/feature-policy-experimental-features/vibrate-enabledforself-expected.txt index 68316136..2a461439 100644 --- a/third_party/WebKit/LayoutTests/virtual/feature-policy/http/tests/feature-policy/vibrate-enabledforself-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/feature-policy-experimental-features/vibrate-enabledforself-expected.txt
@@ -12,6 +12,6 @@ Frame: '<!--framePath //<!--frame1-->-->' -------- This is a testharness.js-based test. -PASS No iframe may call navigator.vibrate when disabled. +FAIL No iframe may call navigator.vibrate when disabled. assert_false: expected false got true Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/http/tests/feature-policy/vibrate-enabledforself.php b/third_party/WebKit/LayoutTests/http/tests/feature-policy-experimental-features/vibrate-enabledforself.php similarity index 88% rename from third_party/WebKit/LayoutTests/http/tests/feature-policy/vibrate-enabledforself.php rename to third_party/WebKit/LayoutTests/http/tests/feature-policy-experimental-features/vibrate-enabledforself.php index b9abda90..8f92b61 100644 --- a/third_party/WebKit/LayoutTests/http/tests/feature-policy/vibrate-enabledforself.php +++ b/third_party/WebKit/LayoutTests/http/tests/feature-policy-experimental-features/vibrate-enabledforself.php
@@ -32,6 +32,6 @@ </head> <body onload="loaded();"> <iframe id="f1" src="resources/feature-policy-vibrate-enabled.html"></iframe> -<iframe id="f2" src="http://localhost:8000/feature-policy/resources/feature-policy-vibrate-disabled.html"></iframe> +<iframe id="f2" src="http://localhost:8000/feature-policy-experimental-features/resources/feature-policy-vibrate-disabled.html"></iframe> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/http/tests/feature-policy/vibrate-disabled.php b/third_party/WebKit/LayoutTests/http/tests/feature-policy/vibrate-disabled.php deleted file mode 100644 index e777a05..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/feature-policy/vibrate-disabled.php +++ /dev/null
@@ -1,28 +0,0 @@ -<?php -// Copyright 2016 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 test ensures that navigator.vibrate when disabled may not be called by -// any iframe. - -Header("Feature-Policy: {\"vibrate\": []}"); -?> - -<!DOCTYPE html> -<html> -<head> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> -<script> - if (window.testRunner) { - testRunner.dumpAsText(); - testRunner.dumpChildFramesAsText(); - } -</script> -</head> -<body> -<iframe id="f1" src="resources/feature-policy-vibrate-disabled.html"></iframe> -<iframe id="f2" src="http://localhost:8000/feature-policy/resources/feature-policy-vibrate-disabled.html"></iframe> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/http/tests/feature-policy/vibrate-enabledforall-expected.txt b/third_party/WebKit/LayoutTests/http/tests/feature-policy/vibrate-enabledforall-expected.txt deleted file mode 100644 index fe246c2..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/feature-policy/vibrate-enabledforall-expected.txt +++ /dev/null
@@ -1,17 +0,0 @@ - - --------- -Frame: '<!--framePath //<!--frame0-->-->' --------- -This is a testharness.js-based test. -PASS Any iframe may call navigator.vibrate when enabled. -Harness: the test ran to completion. - - --------- -Frame: '<!--framePath //<!--frame1-->-->' --------- -This is a testharness.js-based test. -FAIL Any iframe may call navigator.vibrate when enabled. assert_true: expected true got false -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/virtual/feature-policy-experimental-features/http/tests/feature-policy-experimental-features/README.txt b/third_party/WebKit/LayoutTests/virtual/feature-policy-experimental-features/http/tests/feature-policy-experimental-features/README.txt new file mode 100644 index 0000000..57c92bf --- /dev/null +++ b/third_party/WebKit/LayoutTests/virtual/feature-policy-experimental-features/http/tests/feature-policy-experimental-features/README.txt
@@ -0,0 +1 @@ +Tests which run under the FeaturePolicyExperimentalFeatures flag
diff --git a/third_party/WebKit/LayoutTests/virtual/feature-policy/http/tests/feature-policy/vibrate-disabled-expected.txt b/third_party/WebKit/LayoutTests/virtual/feature-policy-experimental-features/http/tests/feature-policy-experimental-features/vibrate-disabled-expected.txt similarity index 67% rename from third_party/WebKit/LayoutTests/virtual/feature-policy/http/tests/feature-policy/vibrate-disabled-expected.txt rename to third_party/WebKit/LayoutTests/virtual/feature-policy-experimental-features/http/tests/feature-policy-experimental-features/vibrate-disabled-expected.txt index 2c16e6bd..48c8228 100644 --- a/third_party/WebKit/LayoutTests/virtual/feature-policy/http/tests/feature-policy/vibrate-disabled-expected.txt +++ b/third_party/WebKit/LayoutTests/virtual/feature-policy-experimental-features/http/tests/feature-policy-experimental-features/vibrate-disabled-expected.txt
@@ -1,4 +1,5 @@ -CONSOLE ERROR: line 9: Navigator.vibrate() is not enabled in feature policy for this frame. +CONSOLE ERROR: line 17: Navigator.vibrate() is not enabled in feature policy for this frame. +CONSOLE ERROR: line 17: Navigator.vibrate() is not enabled in feature policy for this frame. --------
diff --git a/third_party/WebKit/LayoutTests/virtual/feature-policy/http/tests/feature-policy/vibrate-enabledforself-expected.txt b/third_party/WebKit/LayoutTests/virtual/feature-policy-experimental-features/http/tests/feature-policy-experimental-features/vibrate-enabledforself-expected.txt similarity index 80% rename from third_party/WebKit/LayoutTests/virtual/feature-policy/http/tests/feature-policy/vibrate-enabledforself-expected.txt rename to third_party/WebKit/LayoutTests/virtual/feature-policy-experimental-features/http/tests/feature-policy-experimental-features/vibrate-enabledforself-expected.txt index 68316136..fb70f28 100644 --- a/third_party/WebKit/LayoutTests/virtual/feature-policy/http/tests/feature-policy/vibrate-enabledforself-expected.txt +++ b/third_party/WebKit/LayoutTests/virtual/feature-policy-experimental-features/http/tests/feature-policy-experimental-features/vibrate-enabledforself-expected.txt
@@ -1,3 +1,4 @@ +CONSOLE ERROR: line 17: Navigator.vibrate() is not enabled in feature policy for this frame. --------
diff --git a/third_party/WebKit/LayoutTests/virtual/feature-policy/http/tests/feature-policy/vibrate_in_cross_origin_iframe_blocked-expected.txt b/third_party/WebKit/LayoutTests/virtual/feature-policy-experimental-features/http/tests/feature-policy-experimental-features/vibrate_in_cross_origin_iframe_blocked-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/virtual/feature-policy/http/tests/feature-policy/vibrate_in_cross_origin_iframe_blocked-expected.txt rename to third_party/WebKit/LayoutTests/virtual/feature-policy-experimental-features/http/tests/feature-policy-experimental-features/vibrate_in_cross_origin_iframe_blocked-expected.txt
diff --git a/third_party/WebKit/LayoutTests/virtual/feature-policy/http/tests/feature-policy/vibrate-enabledforall-expected.txt b/third_party/WebKit/LayoutTests/virtual/feature-policy/http/tests/feature-policy/vibrate-enabledforall-expected.txt deleted file mode 100644 index 58c3a55c..0000000 --- a/third_party/WebKit/LayoutTests/virtual/feature-policy/http/tests/feature-policy/vibrate-enabledforall-expected.txt +++ /dev/null
@@ -1,17 +0,0 @@ - - --------- -Frame: '<!--framePath //<!--frame0-->-->' --------- -This is a testharness.js-based test. -PASS Any iframe may call navigator.vibrate when enabled. -Harness: the test ran to completion. - - --------- -Frame: '<!--framePath //<!--frame1-->-->' --------- -This is a testharness.js-based test. -PASS Any iframe may call navigator.vibrate when enabled. -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/webaudio/constructor/channelmerger.html b/third_party/WebKit/LayoutTests/webaudio/constructor/channelmerger.html index 92260a0..e2906a21 100644 --- a/third_party/WebKit/LayoutTests/webaudio/constructor/channelmerger.html +++ b/third_party/WebKit/LayoutTests/webaudio/constructor/channelmerger.html
@@ -5,149 +5,104 @@ <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <script src="../resources/audit-util.js"></script> - <script src="../resources/audio-testing.js"></script> - <script src="audionodeoptions.js"></script> + <script src="../resources/audit.js"></script> + <script src="new-audionodeoptions.js"></script> </head> <body> <script> - var context; + let context; - var audit = Audit.createTaskRunner(); + let audit = Audit.createTaskRunner(); - audit.defineTask("initialize", function (taskDone) { - Should("context = new OfflineAudioContext(...)", function () { - context = new OfflineAudioContext(1, 1, 48000); - }).notThrow(); - - taskDone(); + audit.define('initialize', (task, should) => { + context = initializeContext(should); + task.done(); }); - audit.defineTask("invalid constructor", function (taskDone) { - var node; - var success = true; - - success = Should("new ChannelMergerNode()", function () { - node = new ChannelMergerNode(); - }).throw("TypeError"); - success = Should("new ChannelMergerNode(1)", function () { - node = new ChannelMergerNode(1) && success; - }).throw("TypeError"); - success = Should("new ChannelMergerNode(context, 42)", function () { - node = new ChannelMergerNode(context, 42) && success; - }).throw("TypeError"); - - Should("Invalid constructors", success) - .summarize( - "correctly threw errors", - "did not throw errors in all cases"); - - taskDone(); + audit.define('invalid constructor', (task, should) => { + testInvalidConstructor(should, 'ChannelMergerNode', context); + task.done(); }); - audit.defineTask("default constructor", function (taskDone) { - var node; - var success = true; + audit.define('default constructor', (task, should) => { + let prefix = 'node0'; + let node = + testDefaultConstructor(should, 'ChannelMergerNode', context, { + prefix: prefix, + numberOfInputs: 6, + numberOfOutputs: 1, + channelCount: 1, + channelCountMode: 'explicit', + channelInterpretation: 'speakers' + }); - success = Should("node0 = new ChannelMergerNode(context)", function () { - node = new ChannelMergerNode(context); - }).notThrow(); - success = Should("node0 instanceof ChannelMergerNode", node instanceof ChannelMergerNode) - .beEqualTo(true) && success; - - success = Should("node0.numberOfInputs", node.numberOfInputs) - .beEqualTo(6) && success; - success = Should("node0.numberOfOutputs", node.numberOfOutputs) - .beEqualTo(1) && success; - success = Should("node0.channelCount", node.channelCount) - .beEqualTo(1) && success; - success = Should("node0.channelCountMode", node.channelCountMode) - .beEqualTo("explicit") && success; - success = Should("node0.channelInterpretation", node.channelInterpretation) - .beEqualTo("speakers") && success; - - Should("new ChannelMergerNode(context)", success) - .summarize( - "constructed node with correct attributes", - "did not construct correct node correctly") - - taskDone(); + task.done(); }); - audit.defineTask("test AudioNodeOptions", function (taskDone) { - testAudioNodeOptions(context, "ChannelMergerNode", { - expectedChannelCount: { - value: 1, + audit.define('test AudioNodeOptions', (task, should) => { + testAudioNodeOptions(should, context, 'ChannelMergerNode', { + channelCount: + {value: 1, isFixed: true, errorType: 'InvalidStateError'}, + channelCountMode: { + value: 'explicit', isFixed: true, - errorType: "InvalidStateError" - }, - expectedChannelCountMode: { - value: "explicit", - isFixed: true, - errorType: "InvalidStateError" + errorType: 'InvalidStateError' } }); - taskDone(); + task.done(); }); - audit.defineTask("constructor options", function (taskDone) { - var node; - var success = true; - var options = { + audit.define('constructor options', (task, should) => { + let node; + let options = { numberOfInputs: 3, numberOfOutputs: 9, - channelInterpretation: "discrete" + channelInterpretation: 'discrete' }; - success = Should("node1 = new ChannelMergerNode(context, " + JSON.stringify(options) + - ")", - function () { - node = new ChannelMergerNode(context, options); - }).notThrow(); - - success = Should("node1.numberOfInputs", node.numberOfInputs) - .beEqualTo(options.numberOfInputs) && success; - success = Should("node1.numberOfOutputs", node.numberOfOutputs) - .beEqualTo(1) && success; - success = Should("node1.channelInterpretation", node.channelInterpretation) - .beEqualTo(options.channelInterpretation) && success; - - options = { - numberOfInputs: 99 - }; - success = Should("new ChannelMergerNode(c, " + JSON.stringify(options) + ")", - function () { + should( + () => { node = new ChannelMergerNode(context, options); - }) - .throw("IndexSizeError") && success; + }, + 'node1 = new ChannelMergerNode(context, ' + + JSON.stringify(options) + ')') + .notThrow(); - options = { - channelCount: 3 - }; - success = Should("new ChannelMergerNode(c, " + JSON.stringify(options) + ")", - function () { + should(node.numberOfInputs, 'node1.numberOfInputs') + .beEqualTo(options.numberOfInputs); + should(node.numberOfOutputs, 'node1.numberOfOutputs').beEqualTo(1); + should(node.channelInterpretation, 'node1.channelInterpretation') + .beEqualTo(options.channelInterpretation); + + options = {numberOfInputs: 99}; + should( + () => { node = new ChannelMergerNode(context, options); - }) - .throw("InvalidStateError") && success; + }, + 'new ChannelMergerNode(c, ' + JSON.stringify(options) + ')') + .throw('IndexSizeError'); - options = { - channelCountMode: "max" - }; - success = Should("new ChannelMergerNode(c, " + JSON.stringify(options) + ")", - function () { + options = {channelCount: 3}; + should( + () => { node = new ChannelMergerNode(context, options); - }) - .throw("InvalidStateError") && success; + }, + 'new ChannelMergerNode(c, ' + JSON.stringify(options) + ')') + .throw('InvalidStateError'); - Should("new ChannelMergerNode() with options", success) - .summarize( - "constructed with correct attributes", - "was not constructed correctly"); + options = {channelCountMode: 'max'}; + should( + () => { + node = new ChannelMergerNode(context, options); + }, + 'new ChannelMergerNode(c, ' + JSON.stringify(options) + ')') + .throw('InvalidStateError'); - taskDone(); + task.done(); }); - audit.runTasks(); + audit.run(); </script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/webaudio/constructor/new-audionodeoptions.js b/third_party/WebKit/LayoutTests/webaudio/constructor/new-audionodeoptions.js index d151613..fd999e40 100644 --- a/third_party/WebKit/LayoutTests/webaudio/constructor/new-audionodeoptions.js +++ b/third_party/WebKit/LayoutTests/webaudio/constructor/new-audionodeoptions.js
@@ -11,8 +11,8 @@ // Test that we can set channelCount and that errors are thrown for // invalid values let testChannelCount = 17; - if (expectedNodeOptions.ChannelCount) { - testChannelCount = expectedNodeOptions.ChannelCount.value; + if (expectedNodeOptions.channelCount) { + testChannelCount = expectedNodeOptions.channelCount.value; } should( () => { @@ -25,12 +25,12 @@ .notThrow(); should(node.channelCount, 'node.channelCount').beEqualTo(testChannelCount); - if (expectedNodeOptions.ChannelCount && - expectedNodeOptions.ChannelCount.isFixed) { + if (expectedNodeOptions.channelCount && + expectedNodeOptions.channelCount.isFixed) { // The channel count is fixed. Verify that we throw an error if // we try to change it. Arbitrarily set the count to be one more // than the expected value. - testChannelCount = expectedNodeOptions.ChannelCount.value + 1; + testChannelCount = expectedNodeOptions.channelCount.value + 1; should( () => { node = new window[nodeName]( @@ -40,7 +40,7 @@ {channelCount: testChannelCount})); }, 'new ' + nodeName + '(c, {channelCount: ' + testChannelCount + '}}') - .throw(expectedNodeOptions.ChannelCount.errorType || 'TypeError'); + .throw(expectedNodeOptions.channelCount.errorType || 'TypeError'); } else { // The channel count is not fixed. Try to set the count to invalid // values and make sure an error is thrown. @@ -63,8 +63,8 @@ // Test channelCountMode let testChannelCountMode = 'max'; - if (expectedNodeOptions.ChannelCountMode) { - testChannelCountMode = expectedNodeOptions.ChannelCountMode.value; + if (expectedNodeOptions.channelCountMode) { + testChannelCountMode = expectedNodeOptions.channelCountMode.value; } should( () => { @@ -77,15 +77,15 @@ .notThrow(); should(node.channelCountMode, 'node.channelCountMode').beEqualTo(testChannelCountMode); - if (expectedNodeOptions.ChannelCountMode && - expectedNodeOptions.ChannelCountMode.isFixed) { + if (expectedNodeOptions.channelCountMode && + expectedNodeOptions.channelCountMode.isFixed) { // Channel count mode is fixed. Test setting to something else throws. let testChannelCountModeMap = { 'max': 'clamped-max', 'clamped-max': 'explicit', 'explicit': 'max' }; - testChannelCountMode = testChannelCountModeMap[expectedNodeOptions.ChannelCountMode.value]; + testChannelCountMode = testChannelCountModeMap[expectedNodeOptions.channelCountMode.value]; should( () => { node = new window[nodeName]( @@ -95,7 +95,7 @@ {channelCountMode: testChannelCountMode})); }, 'new ' + nodeName + '(c, {channelCountMode: "' + testChannelCountMode + '"}') - .throw(expectedNodeOptions.ChannelCountMode.errorType); + .throw(expectedNodeOptions.channelCountMode.errorType); } else { // Mode is not fixed. Verify that we can set the mode to all valid // values, and that we throw for invalid values.
diff --git a/third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp b/third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp index 48433a8..2655591 100644 --- a/third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp
@@ -137,7 +137,7 @@ } void DOMWrapperWorld::Dispose() { - dom_object_holders_.Clear(); + dom_object_holders_.clear(); dom_data_store_.reset(); DCHECK(GetWorldMap().Contains(world_id_)); GetWorldMap().erase(world_id_);
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.cpp b/third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.cpp index 536ab52..1ac93cc0 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.cpp
@@ -125,10 +125,10 @@ data->private_property_.reset(); data->string_cache_->Dispose(); data->string_cache_.reset(); - data->interface_template_map_for_non_main_world_.Clear(); - data->interface_template_map_for_main_world_.Clear(); - data->operation_template_map_for_non_main_world_.Clear(); - data->operation_template_map_for_main_world_.Clear(); + data->interface_template_map_for_non_main_world_.clear(); + data->interface_template_map_for_main_world_.clear(); + data->operation_template_map_for_non_main_world_.clear(); + data->operation_template_map_for_main_world_.clear(); if (IsMainThread()) g_main_thread_per_isolate_data = 0;
diff --git a/third_party/WebKit/Source/core/animation/css/CSSAnimationUpdate.h b/third_party/WebKit/Source/core/animation/css/CSSAnimationUpdate.h index c406856..7c0ef5bf 100644 --- a/third_party/WebKit/Source/core/animation/css/CSSAnimationUpdate.h +++ b/third_party/WebKit/Source/core/animation/css/CSSAnimationUpdate.h
@@ -121,14 +121,14 @@ void Clear() { new_animations_.clear(); animations_with_updates_.clear(); - new_transitions_.Clear(); - active_interpolations_for_animations_.Clear(); - active_interpolations_for_custom_transitions_.Clear(); - active_interpolations_for_standard_transitions_.Clear(); + new_transitions_.clear(); + active_interpolations_for_animations_.clear(); + active_interpolations_for_custom_transitions_.clear(); + active_interpolations_for_standard_transitions_.clear(); cancelled_animation_indices_.clear(); animation_indices_with_pause_toggled_.clear(); - cancelled_transitions_.Clear(); - finished_transitions_.Clear(); + cancelled_transitions_.clear(); + finished_transitions_.clear(); updated_compositor_keyframes_.clear(); }
diff --git a/third_party/WebKit/Source/core/animation/css/CSSAnimations.cpp b/third_party/WebKit/Source/core/animation/css/CSSAnimations.cpp index a837bd2c..12a4ea84 100644 --- a/third_party/WebKit/Source/core/animation/css/CSSAnimations.cpp +++ b/third_party/WebKit/Source/core/animation/css/CSSAnimations.cpp
@@ -433,7 +433,7 @@ } void CSSAnimations::MaybeApplyPendingUpdate(Element* element) { - previous_active_interpolations_for_animations_.Clear(); + previous_active_interpolations_for_animations_.clear(); if (pending_update_.IsEmpty()) return; @@ -931,7 +931,7 @@ } running_animations_.clear(); - transitions_.Clear(); + transitions_.clear(); ClearPendingUpdate(); }
diff --git a/third_party/WebKit/Source/core/css/CSSSegmentedFontFace.cpp b/third_party/WebKit/Source/core/css/CSSSegmentedFontFace.cpp index 0f80338a..f15693b 100644 --- a/third_party/WebKit/Source/core/css/CSSSegmentedFontFace.cpp +++ b/third_party/WebKit/Source/core/css/CSSSegmentedFontFace.cpp
@@ -50,7 +50,7 @@ if (font_data_table_.IsEmpty()) return; - font_data_table_.Clear(); + font_data_table_.clear(); } bool CSSSegmentedFontFace::IsValid() const {
diff --git a/third_party/WebKit/Source/core/css/CSSValuePool.h b/third_party/WebKit/Source/core/css/CSSValuePool.h index fed3507..aff318f3 100644 --- a/third_party/WebKit/Source/core/css/CSSValuePool.h +++ b/third_party/WebKit/Source/core/css/CSSValuePool.h
@@ -101,7 +101,7 @@ ColorValueCache::AddResult GetColorCacheEntry(RGBA32 rgb_value) { // Just wipe out the cache and start rebuilding if it gets too big. if (color_value_cache_.size() > kMaximumColorCacheSize) - color_value_cache_.Clear(); + color_value_cache_.clear(); return color_value_cache_.insert(rgb_value, nullptr); } FontFamilyValueCache::AddResult GetFontFamilyCacheEntry( @@ -112,7 +112,7 @@ const AtomicString& string) { // Just wipe out the cache and start rebuilding if it gets too big. if (font_face_value_cache_.size() > kMaximumFontFaceCacheSize) - font_face_value_cache_.Clear(); + font_face_value_cache_.clear(); return font_face_value_cache_.insert(string, nullptr); }
diff --git a/third_party/WebKit/Source/core/css/FontFaceCache.cpp b/third_party/WebKit/Source/core/css/FontFaceCache.cpp index 0aad6ab..99aec0b2 100644 --- a/third_party/WebKit/Source/core/css/FontFaceCache.cpp +++ b/third_party/WebKit/Source/core/css/FontFaceCache.cpp
@@ -114,16 +114,16 @@ void FontFaceCache::ClearCSSConnected() { for (const auto& item : style_rule_to_font_face_) RemoveFontFace(item.value.Get(), true); - style_rule_to_font_face_.Clear(); + style_rule_to_font_face_.clear(); } void FontFaceCache::ClearAll() { if (font_faces_.IsEmpty()) return; - font_faces_.Clear(); - fonts_.Clear(); - style_rule_to_font_face_.Clear(); + font_faces_.clear(); + fonts_.clear(); + style_rule_to_font_face_.clear(); css_connected_font_faces_.clear(); IncrementVersion(); }
diff --git a/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp b/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp index 865a075..ee78eb3 100644 --- a/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp +++ b/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp
@@ -104,7 +104,7 @@ if (font_data && font_data->GetCustomFontData()) font_data->GetCustomFontData()->ClearFontFaceSource(); } - font_data_table_.Clear(); + font_data_table_.clear(); } bool RemoteFontFaceSource::IsLoading() const {
diff --git a/third_party/WebKit/Source/core/css/RuleFeature.cpp b/third_party/WebKit/Source/core/css/RuleFeature.cpp index d1979af..93ad62d 100644 --- a/third_party/WebKit/Source/core/css/RuleFeature.cpp +++ b/third_party/WebKit/Source/core/css/RuleFeature.cpp
@@ -283,10 +283,10 @@ CHECK(is_alive_); metadata_.Clear(); - class_invalidation_sets_.Clear(); - attribute_invalidation_sets_.Clear(); - id_invalidation_sets_.Clear(); - pseudo_invalidation_sets_.Clear(); + class_invalidation_sets_.clear(); + attribute_invalidation_sets_.clear(); + id_invalidation_sets_.clear(); + pseudo_invalidation_sets_.clear(); universal_sibling_invalidation_set_.Clear(); nth_invalidation_set_.Clear(); @@ -973,10 +973,10 @@ sibling_rules_.clear(); uncommon_attribute_rules_.clear(); metadata_.Clear(); - class_invalidation_sets_.Clear(); - attribute_invalidation_sets_.Clear(); - id_invalidation_sets_.Clear(); - pseudo_invalidation_sets_.Clear(); + class_invalidation_sets_.clear(); + attribute_invalidation_sets_.clear(); + id_invalidation_sets_.clear(); + pseudo_invalidation_sets_.clear(); universal_sibling_invalidation_set_.Clear(); nth_invalidation_set_.Clear(); viewport_dependent_media_query_results_.clear();
diff --git a/third_party/WebKit/Source/core/css/invalidation/StyleInvalidator.cpp b/third_party/WebKit/Source/core/css/invalidation/StyleInvalidator.cpp index 5388acfb..dc676f0 100644 --- a/third_party/WebKit/Source/core/css/invalidation/StyleInvalidator.cpp +++ b/third_party/WebKit/Source/core/css/invalidation/StyleInvalidator.cpp
@@ -40,7 +40,7 @@ Invalidate(*document_element, recursion_data, sibling_data); document.ClearChildNeedsStyleInvalidation(); document.ClearNeedsStyleInvalidation(); - pending_invalidation_map_.Clear(); + pending_invalidation_map_.clear(); } void StyleInvalidator::ScheduleInvalidationSetsForNode(
diff --git a/third_party/WebKit/Source/core/css/resolver/MatchedPropertiesCache.cpp b/third_party/WebKit/Source/core/css/resolver/MatchedPropertiesCache.cpp index f8ed4f59..ee9c4fb 100644 --- a/third_party/WebKit/Source/core/css/resolver/MatchedPropertiesCache.cpp +++ b/third_party/WebKit/Source/core/css/resolver/MatchedPropertiesCache.cpp
@@ -104,7 +104,7 @@ for (auto& cache_entry : cache_) { cache_entry.value->Clear(); } - cache_.Clear(); + cache_.clear(); } void MatchedPropertiesCache::ClearViewportDependent() {
diff --git a/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.cpp b/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.cpp index 56922e0..169053d 100644 --- a/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.cpp +++ b/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.cpp
@@ -131,7 +131,7 @@ author_style_sheets_.clear(); viewport_dependent_media_query_results_.clear(); device_dependent_media_query_results_.clear(); - keyframes_rule_map_.Clear(); + keyframes_rule_map_.clear(); tree_boundary_crossing_rule_set_ = nullptr; has_deep_or_shadow_selector_ = false; needs_append_all_sheets_ = false;
diff --git a/third_party/WebKit/Source/core/dom/CSSSelectorWatch.cpp b/third_party/WebKit/Source/core/dom/CSSSelectorWatch.cpp index 4bde989..1f2629e 100644 --- a/third_party/WebKit/Source/core/dom/CSSSelectorWatch.cpp +++ b/third_party/WebKit/Source/core/dom/CSSSelectorWatch.cpp
@@ -84,8 +84,8 @@ GetSupplementable()->GetFrame()->Loader().Client()->SelectorMatchChanged( added_selectors, removed_selectors); } - added_selectors_.Clear(); - removed_selectors_.Clear(); + added_selectors_.clear(); + removed_selectors_.clear(); timer_expirations_ = 0; }
diff --git a/third_party/WebKit/Source/core/dom/CSSSelectorWatchTest.cpp b/third_party/WebKit/Source/core/dom/CSSSelectorWatchTest.cpp index 7dd6823..3eecb31 100644 --- a/third_party/WebKit/Source/core/dom/CSSSelectorWatchTest.cpp +++ b/third_party/WebKit/Source/core/dom/CSSSelectorWatchTest.cpp
@@ -38,8 +38,8 @@ } void CSSSelectorWatchTest::ClearAddedRemoved(CSSSelectorWatch& watch) { - watch.added_selectors_.Clear(); - watch.removed_selectors_.Clear(); + watch.added_selectors_.clear(); + watch.removed_selectors_.clear(); } TEST_F(CSSSelectorWatchTest, RecalcOnDocumentChange) {
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp index a364261..6b21cda 100644 --- a/third_party/WebKit/Source/core/dom/Document.cpp +++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -2129,7 +2129,7 @@ // Only retain the HashMap for the duration of StyleRecalc and // LayoutTreeConstruction. - non_attached_style_.Clear(); + non_attached_style_.clear(); ClearChildNeedsStyleRecalc(); ClearChildNeedsReattachLayoutTree();
diff --git a/third_party/WebKit/Source/core/dom/IntersectionObserverController.cpp b/third_party/WebKit/Source/core/dom/IntersectionObserverController.cpp index 89a91b6e..1850886 100644 --- a/third_party/WebKit/Source/core/dom/IntersectionObserverController.cpp +++ b/third_party/WebKit/Source/core/dom/IntersectionObserverController.cpp
@@ -58,7 +58,7 @@ void IntersectionObserverController::DeliverIntersectionObservations() { ExecutionContext* context = GetExecutionContext(); if (!context) { - pending_intersection_observers_.Clear(); + pending_intersection_observers_.clear(); return; } if (context->IsContextSuspended()) {
diff --git a/third_party/WebKit/Source/core/dom/ModuleMap.cpp b/third_party/WebKit/Source/core/dom/ModuleMap.cpp index a402aca..16b7898 100644 --- a/third_party/WebKit/Source/core/dom/ModuleMap.cpp +++ b/third_party/WebKit/Source/core/dom/ModuleMap.cpp
@@ -98,7 +98,7 @@ for (const auto& client : clients_) { DispatchFinishedNotificationAsync(client); } - clients_.Clear(); + clients_.clear(); } ModuleScript* ModuleMap::Entry::GetModuleScript() const {
diff --git a/third_party/WebKit/Source/core/dom/MutationObserver.cpp b/third_party/WebKit/Source/core/dom/MutationObserver.cpp index fce9101..29ea1844 100644 --- a/third_party/WebKit/Source/core/dom/MutationObserver.cpp +++ b/third_party/WebKit/Source/core/dom/MutationObserver.cpp
@@ -292,7 +292,7 @@ MutationObserverVector observers; CopyToVector(ActiveMutationObservers(), observers); - ActiveMutationObservers().Clear(); + ActiveMutationObservers().clear(); SlotChangeList slots; slots.Swap(ActiveSlotChangeList());
diff --git a/third_party/WebKit/Source/core/dom/PresentationAttributeStyle.cpp b/third_party/WebKit/Source/core/dom/PresentationAttributeStyle.cpp index c60a74b..af20447 100644 --- a/third_party/WebKit/Source/core/dom/PresentationAttributeStyle.cpp +++ b/third_party/WebKit/Source/core/dom/PresentationAttributeStyle.cpp
@@ -118,7 +118,7 @@ hit_count_ = 0; if (hit_count > kMinimumPresentationAttributeCacheHitCountPerMinute) return; - GetPresentationAttributeCache().Clear(); + GetPresentationAttributeCache().clear(); } unsigned hit_count_; @@ -222,7 +222,7 @@ kPresentationAttributeCacheMaximumSize) { // FIXME: Discarding the entire cache when it gets too big is probably bad // since it creates a perf "cliff". Perhaps we should use an LRU? - GetPresentationAttributeCache().Clear(); + GetPresentationAttributeCache().clear(); GetPresentationAttributeCache().Set(cache_hash, new_entry); } else { cache_value->value = new_entry;
diff --git a/third_party/WebKit/Source/core/dom/ScriptedIdleTaskController.cpp b/third_party/WebKit/Source/core/dom/ScriptedIdleTaskController.cpp index 7e3c6fda..c4f2b5d 100644 --- a/third_party/WebKit/Source/core/dom/ScriptedIdleTaskController.cpp +++ b/third_party/WebKit/Source/core/dom/ScriptedIdleTaskController.cpp
@@ -194,7 +194,7 @@ } void ScriptedIdleTaskController::ContextDestroyed(ExecutionContext*) { - callbacks_.Clear(); + callbacks_.clear(); } void ScriptedIdleTaskController::Suspend() {
diff --git a/third_party/WebKit/Source/core/dom/SelectorQuery.cpp b/third_party/WebKit/Source/core/dom/SelectorQuery.cpp index 12531ba2..753db0e 100644 --- a/third_party/WebKit/Source/core/dom/SelectorQuery.cpp +++ b/third_party/WebKit/Source/core/dom/SelectorQuery.cpp
@@ -570,7 +570,7 @@ } void SelectorQueryCache::Invalidate() { - entries_.Clear(); + entries_.clear(); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/dom/StyleEngine.cpp b/third_party/WebKit/Source/core/dom/StyleEngine.cpp index 81a37da9..739ee05 100644 --- a/third_party/WebKit/Source/core/dom/StyleEngine.cpp +++ b/third_party/WebKit/Source/core/dom/StyleEngine.cpp
@@ -344,7 +344,7 @@ probe::activeStyleSheetsUpdated(document_); - dirty_tree_scopes_.Clear(); + dirty_tree_scopes_.clear(); document_scope_dirty_ = false; all_tree_scopes_dirty_ = false; tree_scopes_removed_ = false; @@ -461,8 +461,8 @@ ClearResolvers(); global_rule_set_.Dispose(); tree_boundary_crossing_scopes_.Clear(); - dirty_tree_scopes_.Clear(); - active_tree_scopes_.Clear(); + dirty_tree_scopes_.clear(); + active_tree_scopes_.clear(); viewport_resolver_ = nullptr; media_query_evaluator_ = nullptr; if (font_selector_)
diff --git a/third_party/WebKit/Source/core/dom/custom/V0CustomElementScheduler.cpp b/third_party/WebKit/Source/core/dom/custom/V0CustomElementScheduler.cpp index 1c6ecc6..4a38cce 100644 --- a/third_party/WebKit/Source/core/dom/custom/V0CustomElementScheduler.cpp +++ b/third_party/WebKit/Source/core/dom/custom/V0CustomElementScheduler.cpp
@@ -159,12 +159,12 @@ void V0CustomElementScheduler::CallbackDispatcherDidFinish() { if (V0CustomElementMicrotaskDispatcher::Instance().ElementQueueIsEmpty()) - CallbackQueues().Clear(); + CallbackQueues().clear(); } void V0CustomElementScheduler::MicrotaskDispatcherDidFinish() { DCHECK(!V0CustomElementProcessingStack::InCallbackDeliveryScope()); - CallbackQueues().Clear(); + CallbackQueues().clear(); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/dom/shadow/DistributedNodes.h b/third_party/WebKit/Source/core/dom/shadow/DistributedNodes.h index 566013ba..3682b7a 100644 --- a/third_party/WebKit/Source/core/dom/shadow/DistributedNodes.h +++ b/third_party/WebKit/Source/core/dom/shadow/DistributedNodes.h
@@ -53,7 +53,7 @@ void Append(Node*); void Clear() { nodes_.clear(); - indices_.Clear(); + indices_.clear(); } void ShrinkToFit() { nodes_.ShrinkToFit(); }
diff --git a/third_party/WebKit/Source/core/dom/shadow/ElementShadowV0.cpp b/third_party/WebKit/Source/core/dom/shadow/ElementShadowV0.cpp index 8eca608..ff25c27 100644 --- a/third_party/WebKit/Source/core/dom/shadow/ElementShadowV0.cpp +++ b/third_party/WebKit/Source/core/dom/shadow/ElementShadowV0.cpp
@@ -250,7 +250,7 @@ } void ElementShadowV0::ClearDistribution() { - node_to_insertion_points_.Clear(); + node_to_insertion_points_.clear(); for (ShadowRoot* root = &element_shadow_->YoungestShadowRoot(); root; root = root->OlderShadowRoot())
diff --git a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp index e641fe5..cdb98a3 100644 --- a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp +++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp
@@ -84,7 +84,7 @@ } void DocumentMarkerController::Clear() { - markers_.Clear(); + markers_.clear(); possibly_existing_marker_types_ = 0; }
diff --git a/third_party/WebKit/Source/core/events/PointerEventFactory.cpp b/third_party/WebKit/Source/core/events/PointerEventFactory.cpp index bc61fa0..06be779b 100644 --- a/third_party/WebKit/Source/core/events/PointerEventFactory.cpp +++ b/third_party/WebKit/Source/core/events/PointerEventFactory.cpp
@@ -450,8 +450,8 @@ primary_id_[type] = PointerEventFactory::kInvalidId; id_count_[type] = 0; } - pointer_incoming_id_mapping_.Clear(); - pointer_id_mapping_.Clear(); + pointer_incoming_id_mapping_.clear(); + pointer_id_mapping_.clear(); // Always add mouse pointer in initialization and never remove it. // No need to add it to m_pointerIncomingIdMapping as it is not going to be
diff --git a/third_party/WebKit/Source/core/frame/DOMTimerTest.cpp b/third_party/WebKit/Source/core/frame/DOMTimerTest.cpp index eb969169..dca9dd4 100644 --- a/third_party/WebKit/Source/core/frame/DOMTimerTest.cpp +++ b/third_party/WebKit/Source/core/frame/DOMTimerTest.cpp
@@ -6,6 +6,8 @@ #include <vector> +#include "bindings/core/v8/IDLTypes.h" +#include "bindings/core/v8/NativeValueTraitsImpl.h" #include "bindings/core/v8/ScriptController.h" #include "bindings/core/v8/ScriptSourceCode.h" #include "bindings/core/v8/V8Binding.h" @@ -60,8 +62,8 @@ Vector<double> ToDoubleArray(v8::Local<v8::Value> value, v8::HandleScope& scope) { NonThrowableExceptionState exception_state; - return ToImplArray<Vector<double>>(value, 0, scope.GetIsolate(), - exception_state); + return NativeValueTraits<IDLSequence<IDLDouble>>::NativeValue( + scope.GetIsolate(), value, exception_state); } double ToDoubleValue(v8::Local<v8::Value> value, v8::HandleScope& scope) {
diff --git a/third_party/WebKit/Source/core/frame/HostsUsingFeatures.cpp b/third_party/WebKit/Source/core/frame/HostsUsingFeatures.cpp index 7bbdbf4..d4b4dac 100644 --- a/third_party/WebKit/Source/core/frame/HostsUsingFeatures.cpp +++ b/third_party/WebKit/Source/core/frame/HostsUsingFeatures.cpp
@@ -71,7 +71,7 @@ } void HostsUsingFeatures::Clear() { - value_by_name_.Clear(); + value_by_name_.clear(); url_and_values_.clear(); } @@ -142,7 +142,7 @@ for (auto& name_and_value : value_by_name_) name_and_value.value.RecordNameToRappor(name_and_value.key); - value_by_name_.Clear(); + value_by_name_.clear(); } void HostsUsingFeatures::Value::Aggregate(HostsUsingFeatures::Value other) {
diff --git a/third_party/WebKit/Source/core/frame/LocalFrame.cpp b/third_party/WebKit/Source/core/frame/LocalFrame.cpp index b64d75d6..60df1d23 100644 --- a/third_party/WebKit/Source/core/frame/LocalFrame.cpp +++ b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
@@ -463,7 +463,7 @@ probe::frameDetachedFromParent(this); Frame::Detach(type); - supplements_.Clear(); + supplements_.clear(); frame_scheduler_.reset(); WeakIdentifierMap<LocalFrame>::NotifyObjectDestroyed(this); lifecycle_.AdvanceTo(FrameLifecycle::kDetached);
diff --git a/third_party/WebKit/Source/core/frame/PerformanceMonitor.cpp b/third_party/WebKit/Source/core/frame/PerformanceMonitor.cpp index 15421d8..738a0a6 100644 --- a/third_party/WebKit/Source/core/frame/PerformanceMonitor.cpp +++ b/third_party/WebKit/Source/core/frame/PerformanceMonitor.cpp
@@ -94,7 +94,7 @@ void PerformanceMonitor::Shutdown() { if (!local_root_) return; - subscriptions_.Clear(); + subscriptions_.clear(); UpdateInstrumentation(); Platform::Current()->CurrentThread()->RemoveTaskTimeObserver(this); local_root_->InstrumentingAgents()->removePerformanceMonitor(this);
diff --git a/third_party/WebKit/Source/core/frame/SubresourceIntegrity.cpp b/third_party/WebKit/Source/core/frame/SubresourceIntegrity.cpp index 67148939..1a886368 100644 --- a/third_party/WebKit/Source/core/frame/SubresourceIntegrity.cpp +++ b/third_party/WebKit/Source/core/frame/SubresourceIntegrity.cpp
@@ -328,7 +328,7 @@ const UChar* end = characters.end(); const UChar* current_integrity_end; - metadata_set.Clear(); + metadata_set.clear(); bool error = false; // The integrity attribute takes the form:
diff --git a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp index 20ef17a0..025f81f 100644 --- a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
@@ -531,7 +531,7 @@ return; if (!OriginClean()) { - listeners_.Clear(); + listeners_.clear(); return; }
diff --git a/third_party/WebKit/Source/core/html/HTMLIFrameElementAllow.cpp b/third_party/WebKit/Source/core/html/HTMLIFrameElementAllow.cpp index 52cc909..90b0a50 100644 --- a/third_party/WebKit/Source/core/html/HTMLIFrameElementAllow.cpp +++ b/third_party/WebKit/Source/core/html/HTMLIFrameElementAllow.cpp
@@ -32,15 +32,15 @@ const SpaceSplitString& tokens = this->Tokens(); // Collects a list of valid feature names. + const FeatureNameMap& feature_name_map = GetDefaultFeatureNameMap(); for (size_t i = 0; i < tokens.size(); ++i) { - WebFeaturePolicyFeature feature = GetWebFeaturePolicyFeature(tokens[i]); - if (feature == WebFeaturePolicyFeature::kNotFound) { + if (!feature_name_map.Contains(tokens[i])) { token_errors.Append(token_errors.IsEmpty() ? "'" : ", '"); token_errors.Append(tokens[i]); token_errors.Append("'"); ++num_token_errors; } else { - feature_names.push_back(feature); + feature_names.push_back(feature_name_map.at(tokens[i])); } } @@ -60,8 +60,7 @@ bool HTMLIFrameElementAllow::ValidateTokenValue(const AtomicString& token_value, ExceptionState&) const { - return GetWebFeaturePolicyFeature(token_value.GetString()) != - WebFeaturePolicyFeature::kNotFound; + return GetDefaultFeatureNameMap().Contains(token_value.GetString()); } void HTMLIFrameElementAllow::ValueWasSet() {
diff --git a/third_party/WebKit/Source/core/html/HTMLSlotElement.cpp b/third_party/WebKit/Source/core/html/HTMLSlotElement.cpp index bf89d354e..16bdf79 100644 --- a/third_party/WebKit/Source/core/html/HTMLSlotElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLSlotElement.cpp
@@ -142,7 +142,7 @@ // lazyReattachDistributedNodesIfNeeded() assigned_nodes_.clear(); distributed_nodes_.clear(); - distributed_indices_.Clear(); + distributed_indices_.clear(); } void HTMLSlotElement::SaveAndClearDistribution() {
diff --git a/third_party/WebKit/Source/core/html/PublicURLManager.cpp b/third_party/WebKit/Source/core/html/PublicURLManager.cpp index 193ea3a..51e7d2b 100644 --- a/third_party/WebKit/Source/core/html/PublicURLManager.cpp +++ b/third_party/WebKit/Source/core/html/PublicURLManager.cpp
@@ -102,7 +102,7 @@ registry_url.key->UnregisterURL(KURL(kParsedURLString, url.key)); } - registry_to_url_.Clear(); + registry_to_url_.clear(); } DEFINE_TRACE(PublicURLManager) {
diff --git a/third_party/WebKit/Source/core/html/canvas/CanvasFontCache.cpp b/third_party/WebKit/Source/core/html/canvas/CanvasFontCache.cpp index 2e516e7..31deffbd 100644 --- a/third_party/WebKit/Source/core/html/canvas/CanvasFontCache.cpp +++ b/third_party/WebKit/Source/core/html/canvas/CanvasFontCache.cpp
@@ -144,9 +144,9 @@ } void CanvasFontCache::PruneAll() { - fetched_fonts_.Clear(); + fetched_fonts_.clear(); font_lru_list_.clear(); - fonts_resolved_using_default_style_.Clear(); + fonts_resolved_using_default_style_.clear(); } DEFINE_TRACE(CanvasFontCache) {
diff --git a/third_party/WebKit/Source/core/html/forms/FormController.cpp b/third_party/WebKit/Source/core/html/forms/FormController.cpp index 10b380e0..4ce9561 100644 --- a/third_party/WebKit/Source/core/html/forms/FormController.cpp +++ b/third_party/WebKit/Source/core/html/forms/FormController.cpp
@@ -498,7 +498,7 @@ void FormController::FormStatesFromStateVector( const Vector<String>& state_vector, SavedFormStateMap& map) { - map.Clear(); + map.clear(); size_t i = 0; if (state_vector.size() < 1 || state_vector[i++] != FormStateSignature()) @@ -515,7 +515,7 @@ map.insert(form_key, std::move(state)); } if (i != state_vector.size()) - map.Clear(); + map.clear(); } void FormController::WillDeleteForm(HTMLFormElement* form) {
diff --git a/third_party/WebKit/Source/core/html/track/vtt/VTTParser.cpp b/third_party/WebKit/Source/core/html/track/vtt/VTTParser.cpp index 0dc2f1b..70e0860 100644 --- a/third_party/WebKit/Source/core/html/track/vtt/VTTParser.cpp +++ b/third_party/WebKit/Source/core/html/track/vtt/VTTParser.cpp
@@ -104,7 +104,7 @@ line_reader_.SetEndOfStream(); Parse(); FlushPendingCue(); - region_map_.Clear(); + region_map_.clear(); } void VTTParser::Parse() {
diff --git a/third_party/WebKit/Source/core/input/PointerEventManager.cpp b/third_party/WebKit/Source/core/input/PointerEventManager.cpp index 51501f3..e7dcdc8 100644 --- a/third_party/WebKit/Source/core/input/PointerEventManager.cpp +++ b/third_party/WebKit/Source/core/input/PointerEventManager.cpp
@@ -64,9 +64,9 @@ in_canceled_state_for_pointer_type_touch_ = false; pointer_event_factory_.Clear(); touch_ids_for_canceled_pointerdowns_.Clear(); - node_under_pointer_.Clear(); - pointer_capture_target_.Clear(); - pending_pointer_capture_target_.Clear(); + node_under_pointer_.clear(); + pointer_capture_target_.clear(); + pending_pointer_capture_target_.clear(); dispatching_pointer_id_ = 0; }
diff --git a/third_party/WebKit/Source/core/input/TouchEventManager.cpp b/third_party/WebKit/Source/core/input/TouchEventManager.cpp index f45287cf..bf8c9d6a 100644 --- a/third_party/WebKit/Source/core/input/TouchEventManager.cpp +++ b/third_party/WebKit/Source/core/input/TouchEventManager.cpp
@@ -103,8 +103,8 @@ void TouchEventManager::Clear() { touch_sequence_document_.Clear(); - target_for_touch_id_.Clear(); - region_for_touch_id_.Clear(); + target_for_touch_id_.clear(); + region_for_touch_id_.clear(); touch_pressed_ = false; suppressing_touchmoves_within_slop_ = false; current_touch_action_ = kTouchActionAuto;
diff --git a/third_party/WebKit/Source/core/inspector/InspectorAnimationAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorAnimationAgent.cpp index cf53b6f..deed8ba2 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorAnimationAgent.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorAnimationAgent.cpp
@@ -72,19 +72,19 @@ clone->cancel(); state_->setBoolean(AnimationAgentState::animationAgentEnabled, false); instrumenting_agents_->removeInspectorAnimationAgent(this); - id_to_animation_.Clear(); - id_to_animation_type_.Clear(); - id_to_animation_clone_.Clear(); - cleared_animations_.Clear(); + id_to_animation_.clear(); + id_to_animation_type_.clear(); + id_to_animation_clone_.clear(); + cleared_animations_.clear(); return Response::OK(); } void InspectorAnimationAgent::DidCommitLoadForLocalFrame(LocalFrame* frame) { if (frame == inspected_frames_->Root()) { - id_to_animation_.Clear(); - id_to_animation_type_.Clear(); - id_to_animation_clone_.Clear(); - cleared_animations_.Clear(); + id_to_animation_.clear(); + id_to_animation_type_.clear(); + id_to_animation_clone_.clear(); + cleared_animations_.clear(); } double playback_rate = 1; state_->getDouble(AnimationAgentState::animationAgentPlaybackRate,
diff --git a/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp index 0424089..a3d3fda 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
@@ -713,12 +713,12 @@ } void InspectorCSSAgent::Reset() { - id_to_inspector_style_sheet_.Clear(); - id_to_inspector_style_sheet_for_inline_style_.Clear(); - css_style_sheet_to_inspector_style_sheet_.Clear(); - document_to_css_style_sheets_.Clear(); - invalidated_documents_.Clear(); - node_to_inspector_style_sheet_.Clear(); + id_to_inspector_style_sheet_.clear(); + id_to_inspector_style_sheet_for_inline_style_.clear(); + css_style_sheet_to_inspector_style_sheet_.clear(); + document_to_css_style_sheets_.clear(); + invalidated_documents_.clear(); + node_to_inspector_style_sheet_.clear(); ResetNonPersistentData(); } @@ -2087,7 +2087,7 @@ documents_to_change.insert(element->ownerDocument()); } - node_id_to_forced_pseudo_state_.Clear(); + node_id_to_forced_pseudo_state_.clear(); for (auto& document : documents_to_change) document->SetNeedsStyleRecalc( kSubtreeStyleChange,
diff --git a/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp index 2c6bb54..eeb2f49 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp
@@ -165,7 +165,7 @@ for (auto& attribute : style_attr_invalidated_elements_) elements.push_back(attribute.Get()); dom_agent_->StyleAttributeInvalidated(elements); - style_attr_invalidated_elements_.Clear(); + style_attr_invalidated_elements_.clear(); } DEFINE_TRACE(InspectorRevalidateDOMTask) { @@ -544,13 +544,13 @@ void InspectorDOMAgent::DiscardFrontendBindings() { if (history_) history_->Reset(); - search_results_.Clear(); - document_node_to_id_map_->Clear(); - id_to_node_.Clear(); - id_to_nodes_map_.Clear(); + search_results_.clear(); + document_node_to_id_map_->clear(); + id_to_node_.clear(); + id_to_nodes_map_.clear(); ReleaseDanglingNodes(); - children_requested_.Clear(); - cached_child_count_.Clear(); + children_requested_.clear(); + cached_child_count_.clear(); if (revalidate_task_) revalidate_task_->Reset(); }
diff --git a/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp index eb1571e..26709a03 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp
@@ -201,7 +201,7 @@ Response InspectorDOMDebuggerAgent::disable() { SetEnabled(false); - dom_breakpoints_.Clear(); + dom_breakpoints_.clear(); state_->remove(DOMDebuggerAgentState::kEventListenerBreakpoints); state_->remove(DOMDebuggerAgentState::kXhrBreakpoints); state_->remove(DOMDebuggerAgentState::kPauseOnAllXHRs); @@ -801,7 +801,7 @@ } void InspectorDOMDebuggerAgent::DidCommitLoadForLocalFrame(LocalFrame*) { - dom_breakpoints_.Clear(); + dom_breakpoints_.clear(); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/inspector/InspectorLayerTreeAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorLayerTreeAgent.cpp index 763ae957..dcfa0c9 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorLayerTreeAgent.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorLayerTreeAgent.cpp
@@ -198,7 +198,7 @@ Response InspectorLayerTreeAgent::disable() { instrumenting_agents_->removeInspectorLayerTreeAgent(this); - snapshot_by_id_.Clear(); + snapshot_by_id_.clear(); return Response::OK(); }
diff --git a/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp index 32972c0c..3047b35 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp
@@ -1225,7 +1225,7 @@ state_->setString(NetworkAgentState::kUserAgentOverride, ""); instrumenting_agents_->removeInspectorNetworkAgent(this); resources_data_->Clear(); - known_request_id_map_.Clear(); + known_request_id_map_.clear(); return Response::OK(); } @@ -1528,7 +1528,7 @@ } void InspectorNetworkAgent::RemoveFinishedReplayXHRFired(TimerBase*) { - replay_xhrs_to_be_deleted_.Clear(); + replay_xhrs_to_be_deleted_.clear(); } InspectorNetworkAgent::InspectorNetworkAgent(InspectedFrames* inspected_frames)
diff --git a/third_party/WebKit/Source/core/inspector/InspectorResourceContainer.cpp b/third_party/WebKit/Source/core/inspector/InspectorResourceContainer.cpp index 35543ec..6012b16 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorResourceContainer.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorResourceContainer.cpp
@@ -21,8 +21,8 @@ void InspectorResourceContainer::DidCommitLoadForLocalFrame(LocalFrame* frame) { if (frame != inspected_frames_->Root()) return; - style_sheet_contents_.Clear(); - style_element_contents_.Clear(); + style_sheet_contents_.clear(); + style_element_contents_.clear(); } void InspectorResourceContainer::StoreStyleSheetContent(const String& url,
diff --git a/third_party/WebKit/Source/core/inspector/InspectorStyleSheet.cpp b/third_party/WebKit/Source/core/inspector/InspectorStyleSheet.cpp index 973f911..e737a2cf 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorStyleSheet.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorStyleSheet.cpp
@@ -1786,8 +1786,8 @@ } void InspectorStyleSheet::MapSourceDataToCSSOM() { - rule_to_source_data_.Clear(); - source_data_to_rule_.Clear(); + rule_to_source_data_.clear(); + source_data_to_rule_.clear(); cssom_flat_rules_.clear(); CSSRuleVector& cssom_rules = cssom_flat_rules_;
diff --git a/third_party/WebKit/Source/core/inspector/InspectorWorkerAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorWorkerAgent.cpp index c0bb92e..a3d8cdd 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorWorkerAgent.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorWorkerAgent.cpp
@@ -152,7 +152,7 @@ } id_proxy.value->DisconnectFromInspector(this); } - connected_proxies_.Clear(); + connected_proxies_.clear(); } void InspectorWorkerAgent::DidCommitLoadForLocalFrame(LocalFrame* frame) { @@ -167,7 +167,7 @@ GetFrontend()->detachedFromTarget(id_proxy.key); id_proxy.value->DisconnectFromInspector(this); } - connected_proxies_.Clear(); + connected_proxies_.clear(); } protocol::DictionaryValue* InspectorWorkerAgent::AttachedWorkerIds() {
diff --git a/third_party/WebKit/Source/core/inspector/NetworkResourcesData.cpp b/third_party/WebKit/Source/core/inspector/NetworkResourcesData.cpp index 5ee5dd90..4dd18aa9 100644 --- a/third_party/WebKit/Source/core/inspector/NetworkResourcesData.cpp +++ b/third_party/WebKit/Source/core/inspector/NetworkResourcesData.cpp
@@ -394,7 +394,7 @@ } request_id_to_resource_data_map_.swap(preserved_map); - reused_xhr_replay_data_request_ids_.Clear(); + reused_xhr_replay_data_request_ids_.clear(); } void NetworkResourcesData::SetResourcesDataSizeLimits(
diff --git a/third_party/WebKit/Source/core/layout/DepthOrderedLayoutObjectList.cpp b/third_party/WebKit/Source/core/layout/DepthOrderedLayoutObjectList.cpp index f414d09..a066c2a 100644 --- a/third_party/WebKit/Source/core/layout/DepthOrderedLayoutObjectList.cpp +++ b/third_party/WebKit/Source/core/layout/DepthOrderedLayoutObjectList.cpp
@@ -52,7 +52,7 @@ } void DepthOrderedLayoutObjectList::Clear() { - data_->objects_.Clear(); + data_->objects_.clear(); data_->ordered_objects_.clear(); }
diff --git a/third_party/WebKit/Source/core/layout/Grid.cpp b/third_party/WebKit/Source/core/layout/Grid.cpp index 44f41f5..256c38c9 100644 --- a/third_party/WebKit/Source/core/layout/Grid.cpp +++ b/third_party/WebKit/Source/core/layout/Grid.cpp
@@ -140,8 +140,8 @@ } grid_.Resize(0); - grid_item_area_.Clear(); - grid_items_indexes_map_.Clear(); + grid_item_area_.clear(); + grid_items_indexes_map_.clear(); has_any_orthogonal_grid_item_ = false; smallest_row_start_ = 0; smallest_column_start_ = 0;
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp b/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp index 9bb4d8f..a4d3b0b 100644 --- a/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp
@@ -626,7 +626,7 @@ if (last_end_offset != run->stop_) { // If we don't have enough cached data, we'll measure the run again. can_use_cached_word_measurements = false; - fallback_fonts.Clear(); + fallback_fonts.clear(); } }
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp index 881e0bf..92f2ff0 100644 --- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -5865,7 +5865,7 @@ if (SnapAreaSet* areas = SnapAreas()) { for (auto& snap_area : *areas) snap_area->rare_data_->snap_container_ = nullptr; - areas->Clear(); + areas->clear(); } }
diff --git a/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp b/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp index ae3f5d5..6d8de24 100644 --- a/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
@@ -360,7 +360,7 @@ if (!relayout_children && SimplifiedLayout()) return; - relaid_out_children_.Clear(); + relaid_out_children_.clear(); WTF::AutoReset<bool> reset1(&in_layout_, true); DCHECK_EQ(has_definite_height_, SizeDefiniteness::kUnknown);
diff --git a/third_party/WebKit/Source/core/layout/LayoutGrid.cpp b/third_party/WebKit/Source/core/layout/LayoutGrid.cpp index 00436b9..dc0db8f 100644 --- a/third_party/WebKit/Source/core/layout/LayoutGrid.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
@@ -236,8 +236,8 @@ SimplifiedLayout()) return; - row_axis_alignment_context_.Clear(); - col_axis_alignment_context_.Clear(); + row_axis_alignment_context_.clear(); + col_axis_alignment_context_.clear(); SubtreeLayoutScope layout_scope(*this);
diff --git a/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp b/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp index 2899bc5..f56be8c7 100644 --- a/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
@@ -1288,7 +1288,7 @@ total_cells_count; overflow_.reset(); - overflowing_cells_.Clear(); + overflowing_cells_.clear(); force_slow_paint_path_with_overflowing_cell_ = false; #if DCHECK_IS_ON() bool has_overflowing_cell = false; @@ -1313,7 +1313,7 @@ force_slow_paint_path_with_overflowing_cell_ = true; // The slow path does not make any use of the overflowing cells info, // don't hold on to the memory. - overflowing_cells_.Clear(); + overflowing_cells_.clear(); } } }
diff --git a/third_party/WebKit/Source/core/layout/LayoutThemeMac.mm b/third_party/WebKit/Source/core/layout/LayoutThemeMac.mm index 8f1d73f..2b0ec74 100644 --- a/third_party/WebKit/Source/core/layout/LayoutThemeMac.mm +++ b/third_party/WebKit/Source/core/layout/LayoutThemeMac.mm
@@ -339,7 +339,7 @@ } void LayoutThemeMac::PlatformColorsDidChange() { - system_color_cache_.Clear(); + system_color_cache_.clear(); LayoutTheme::PlatformColorsDidChange(); }
diff --git a/third_party/WebKit/Source/core/layout/TextAutosizer.cpp b/third_party/WebKit/Source/core/layout/TextAutosizer.cpp index a4cec13..ce898ee 100644 --- a/third_party/WebKit/Source/core/layout/TextAutosizer.cpp +++ b/third_party/WebKit/Source/core/layout/TextAutosizer.cpp
@@ -389,7 +389,7 @@ cluster_stack_.clear(); styles_retained_during_layout_.clear(); #if DCHECK_IS_ON() - blocks_that_have_begun_layout_.Clear(); + blocks_that_have_begun_layout_.clear(); #endif // Tables can create two layout scopes for the same block so the isEmpty // check below is needed to guard against endLayout being called twice. @@ -1386,7 +1386,7 @@ supercluster->multiplier_ = old_multipiler; } } - potentially_inconsistent_superclusters.Clear(); + potentially_inconsistent_superclusters.clear(); } DEFINE_TRACE(TextAutosizer) {
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.cpp index 6d5bc63..4a2c32a 100644 --- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.cpp +++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.cpp
@@ -98,7 +98,7 @@ SvgTreeScopeResourcesFromElement(client_element) .AddPendingResource(to_id, *client_element); } - clients_.Clear(); + clients_.clear(); } void LayoutSVGResourceContainer::IdChanged(const AtomicString& old_id,
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceFilter.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceFilter.cpp index 3027b37f..9ab2bf4 100644 --- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceFilter.cpp +++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceFilter.cpp
@@ -47,7 +47,7 @@ void LayoutSVGResourceFilter::DisposeFilterMap() { for (auto& filter : filter_) filter.value->Dispose(); - filter_.Clear(); + filter_.clear(); } void LayoutSVGResourceFilter::WillBeDestroyed() {
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceGradient.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceGradient.cpp index 074a284..531eada7 100644 --- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceGradient.cpp +++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceGradient.cpp
@@ -33,7 +33,7 @@ void LayoutSVGResourceGradient::RemoveAllClientsFromCache( bool mark_for_invalidation) { - gradient_map_.Clear(); + gradient_map_.clear(); should_collect_gradient_attributes_ = true; MarkAllClientsForInvalidation( mark_for_invalidation ? kPaintInvalidation : kParentOnlyInvalidation);
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourcePattern.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourcePattern.cpp index f5eabd8..e07568e 100644 --- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourcePattern.cpp +++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourcePattern.cpp
@@ -53,7 +53,7 @@ void LayoutSVGResourcePattern::RemoveAllClientsFromCache( bool mark_for_invalidation) { - pattern_map_.Clear(); + pattern_map_.clear(); should_collect_pattern_attributes_ = true; MarkAllClientsForInvalidation( mark_for_invalidation ? kPaintInvalidation : kParentOnlyInvalidation);
diff --git a/third_party/WebKit/Source/core/layout/svg/SVGResourcesCycleSolver.cpp b/third_party/WebKit/Source/core/layout/svg/SVGResourcesCycleSolver.cpp index 94986229..908bd384 100644 --- a/third_party/WebKit/Source/core/layout/svg/SVGResourcesCycleSolver.cpp +++ b/third_party/WebKit/Source/core/layout/svg/SVGResourcesCycleSolver.cpp
@@ -104,7 +104,7 @@ resources_->ClearReferencesTo(local_resource); } - active_resources_.Clear(); + active_resources_.clear(); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/layout/svg/SVGTextLayoutAttributesBuilder.cpp b/third_party/WebKit/Source/core/layout/svg/SVGTextLayoutAttributesBuilder.cpp index df0b189..765f8c1 100644 --- a/third_party/WebKit/Source/core/layout/svg/SVGTextLayoutAttributesBuilder.cpp +++ b/third_party/WebKit/Source/core/layout/svg/SVGTextLayoutAttributesBuilder.cpp
@@ -33,7 +33,7 @@ unsigned& value_list_position, const SVGCharacterDataMap& all_characters_map) { SVGCharacterDataMap& character_data_map = text.CharacterDataMap(); - character_data_map.Clear(); + character_data_map.clear(); LineLayoutSVGInlineText text_line_layout(&text); for (SVGInlineTextMetricsIterator iterator(text_line_layout); @@ -58,7 +58,7 @@ : text_root_(text_root), character_count_(0) {} void SVGTextLayoutAttributesBuilder::BuildLayoutAttributes() { - character_data_map_.Clear(); + character_data_map_.clear(); if (text_positions_.IsEmpty()) { character_count_ = 0;
diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp b/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp index c520331..f5b4624 100644 --- a/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp +++ b/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp
@@ -335,7 +335,7 @@ document->SetInsecureRequestPolicy(kUpgradeInsecureRequests); for (const auto& test : tests) { - document->InsecureNavigationsToUpgrade()->Clear(); + document->InsecureNavigationsToUpgrade()->clear(); // We always upgrade for FrameTypeNone and FrameTypeNested. ExpectUpgrade(test.original, WebURLRequest::kRequestContextScript,
diff --git a/third_party/WebKit/Source/core/loader/ProgressTracker.cpp b/third_party/WebKit/Source/core/loader/ProgressTracker.cpp index e76b30c6..77d0458 100644 --- a/third_party/WebKit/Source/core/loader/ProgressTracker.cpp +++ b/third_party/WebKit/Source/core/loader/ProgressTracker.cpp
@@ -90,7 +90,7 @@ } void ProgressTracker::Reset() { - progress_items_.Clear(); + progress_items_.clear(); progress_value_ = 0; last_notified_progress_value_ = 0; last_notified_progress_time_ = 0;
diff --git a/third_party/WebKit/Source/core/loader/private/CrossOriginPreflightResultCache.cpp b/third_party/WebKit/Source/core/loader/private/CrossOriginPreflightResultCache.cpp index 8750991..4b4fb37 100644 --- a/third_party/WebKit/Source/core/loader/private/CrossOriginPreflightResultCache.cpp +++ b/third_party/WebKit/Source/core/loader/private/CrossOriginPreflightResultCache.cpp
@@ -94,7 +94,7 @@ bool CrossOriginPreflightResultCacheItem::Parse( const ResourceResponse& response, String& error_description) { - methods_.Clear(); + methods_.clear(); if (!ParseAccessControlAllowList( response.HttpHeaderField(HTTPNames::Access_Control_Allow_Methods), methods_)) { @@ -104,7 +104,7 @@ return false; } - headers_.Clear(); + headers_.clear(); if (!ParseAccessControlAllowList( response.HttpHeaderField(HTTPNames::Access_Control_Allow_Headers), headers_)) {
diff --git a/third_party/WebKit/Source/core/page/PrintContext.cpp b/third_party/WebKit/Source/core/page/PrintContext.cpp index 4e2d3cec..2897a12c 100644 --- a/third_party/WebKit/Source/core/page/PrintContext.cpp +++ b/third_party/WebKit/Source/core/page/PrintContext.cpp
@@ -187,7 +187,7 @@ ASSERT(is_printing_); is_printing_ = false; frame_->SetPrinting(false, FloatSize(), FloatSize(), 0); - linked_destinations_.Clear(); + linked_destinations_.clear(); linked_destinations_valid_ = false; }
diff --git a/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp b/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp index 99dec03..eb1b461d 100644 --- a/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp +++ b/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp
@@ -559,7 +559,7 @@ HeapHashMap<const PaintLayer*, HeapVector<Member<const LocalFrame>>>; static void MakeLayerChildFrameMap(const LocalFrame* current_frame, LayerFrameMap* map) { - map->Clear(); + map->clear(); const FrameTree& tree = current_frame->Tree(); for (const Frame* child = tree.FirstChild(); child; child = child->Tree().NextSibling()) { @@ -732,9 +732,9 @@ for (const auto& scrollbar : vertical_scrollbars_) GraphicsLayer::UnregisterContentsLayer(scrollbar.value->Layer()); - horizontal_scrollbars_.Clear(); - vertical_scrollbars_.Clear(); - layers_with_touch_rects_.Clear(); + horizontal_scrollbars_.clear(); + vertical_scrollbars_.clear(); + layers_with_touch_rects_.clear(); was_frame_scrollable_ = false; last_main_thread_scrolling_reasons_ = 0; @@ -770,7 +770,7 @@ Vector<LayoutRect>()); } - layers_with_touch_rects_.Clear(); + layers_with_touch_rects_.clear(); for (const auto& layer_rect : layer_rects) { if (!layer_rect.value.IsEmpty()) { const PaintLayer* composited_layer =
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp index 23d1185d..39eac7dd 100644 --- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp +++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
@@ -1561,7 +1561,7 @@ EPosition::kSticky) sticky_layer->SetNeedsCompositingInputsUpdate(); } - d->sticky_constraints_map_.Clear(); + d->sticky_constraints_map_.clear(); } }
diff --git a/third_party/WebKit/Source/core/svg/SVGElement.cpp b/third_party/WebKit/Source/core/svg/SVGElement.cpp index bf80cca..2b7f899 100644 --- a/third_party/WebKit/Source/core/svg/SVGElement.cpp +++ b/third_party/WebKit/Source/core/svg/SVGElement.cpp
@@ -261,7 +261,7 @@ } }); } - SvgRareData()->WebAnimatedAttributes().Clear(); + SvgRareData()->WebAnimatedAttributes().clear(); } void SVGElement::SetAnimatedAttribute(const QualifiedName& attribute, @@ -424,7 +424,7 @@ ToSVGElement(root_parent)->UpdateRelativeLengthsInformation(false, this); } - elements_with_relative_lengths_.Clear(); + elements_with_relative_lengths_.clear(); } SECURITY_DCHECK(!root_parent->IsSVGElement() || @@ -1136,7 +1136,7 @@ } } - SvgRareData()->ElementInstances().Clear(); + SvgRareData()->ElementInstances().clear(); } void SVGElement::SetNeedsStyleRecalcForInstances( @@ -1317,7 +1317,7 @@ DCHECK(source_element->HasSVGRareData()); source_element->EnsureSVGRareData()->OutgoingReferences().erase(this); } - incoming_references.Clear(); + incoming_references.clear(); } void SVGElement::RemoveAllOutgoingReferences() { @@ -1329,7 +1329,7 @@ DCHECK(target_element->HasSVGRareData()); target_element->EnsureSVGRareData()->IncomingReferences().erase(this); } - outgoing_references.Clear(); + outgoing_references.clear(); } DEFINE_TRACE(SVGElement) {
diff --git a/third_party/WebKit/Source/core/timing/PerformanceUserTiming.cpp b/third_party/WebKit/Source/core/timing/PerformanceUserTiming.cpp index 6493725..55ff947 100644 --- a/third_party/WebKit/Source/core/timing/PerformanceUserTiming.cpp +++ b/third_party/WebKit/Source/core/timing/PerformanceUserTiming.cpp
@@ -96,7 +96,7 @@ static void ClearPeformanceEntries(PerformanceEntryMap& performance_entry_map, const String& name) { if (name.IsNull()) { - performance_entry_map.Clear(); + performance_entry_map.clear(); return; }
diff --git a/third_party/WebKit/Source/core/workers/MainThreadWorklet.cpp b/third_party/WebKit/Source/core/workers/MainThreadWorklet.cpp index 58705df7..6429719 100644 --- a/third_party/WebKit/Source/core/workers/MainThreadWorklet.cpp +++ b/third_party/WebKit/Source/core/workers/MainThreadWorklet.cpp
@@ -73,7 +73,7 @@ void MainThreadWorklet::ContextDestroyed(ExecutionContext* execution_context) { DCHECK(IsMainThread()); - resolver_map_.Clear(); + resolver_map_.clear(); Worklet::ContextDestroyed(execution_context); }
diff --git a/third_party/WebKit/Source/core/workers/ThreadedWorklet.cpp b/third_party/WebKit/Source/core/workers/ThreadedWorklet.cpp index 58497b5..7a90cc8 100644 --- a/third_party/WebKit/Source/core/workers/ThreadedWorklet.cpp +++ b/third_party/WebKit/Source/core/workers/ThreadedWorklet.cpp
@@ -66,7 +66,7 @@ DCHECK(IsMainThread()); for (const auto& script_loader : loader_to_resolver_map_.Keys()) script_loader->Cancel(); - loader_to_resolver_map_.Clear(); + loader_to_resolver_map_.clear(); Worklet::ContextDestroyed(execution_context); }
diff --git a/third_party/WebKit/Source/core/workers/WorkerEventQueue.cpp b/third_party/WebKit/Source/core/workers/WorkerEventQueue.cpp index e6a3c08..43e094a 100644 --- a/third_party/WebKit/Source/core/workers/WorkerEventQueue.cpp +++ b/third_party/WebKit/Source/core/workers/WorkerEventQueue.cpp
@@ -82,7 +82,7 @@ is_closed_ = true; for (const auto& event : pending_events_) probe::AsyncTaskCanceled(event->target()->GetExecutionContext(), event); - pending_events_.Clear(); + pending_events_.clear(); } bool WorkerEventQueue::RemoveEvent(Event* event) {
diff --git a/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp b/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp index 1447ae5..e72412e 100644 --- a/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp +++ b/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp
@@ -97,7 +97,7 @@ while (!listeners.IsEmpty()) { for (const auto& listener : listeners) listener->ClearListenerObject(); - listeners.Clear(); + listeners.clear(); // Pick up any additions made while iterating. listeners.swap(event_listeners_); }
diff --git a/third_party/WebKit/Source/core/xml/XPathParser.cpp b/third_party/WebKit/Source/core/xml/XPathParser.cpp index ee165159..9abe1d3 100644 --- a/third_party/WebKit/Source/core/xml/XPathParser.cpp +++ b/third_party/WebKit/Source/core/xml/XPathParser.cpp
@@ -482,7 +482,7 @@ current_parser_ = old_parser; if (parse_error) { - strings_.Clear(); + strings_.clear(); top_expr_ = nullptr;
diff --git a/third_party/WebKit/Source/core/xml/XSLTProcessor.cpp b/third_party/WebKit/Source/core/xml/XSLTProcessor.cpp index 1ba8804..6900525 100644 --- a/third_party/WebKit/Source/core/xml/XSLTProcessor.cpp +++ b/third_party/WebKit/Source/core/xml/XSLTProcessor.cpp
@@ -164,7 +164,7 @@ void XSLTProcessor::reset() { stylesheet_.Clear(); stylesheet_root_node_.Clear(); - parameters_.Clear(); + parameters_.clear(); } DEFINE_TRACE(XSLTProcessor) {
diff --git a/third_party/WebKit/Source/core/xml/XSLTProcessor.h b/third_party/WebKit/Source/core/xml/XSLTProcessor.h index 9c5ef7e..aacad56 100644 --- a/third_party/WebKit/Source/core/xml/XSLTProcessor.h +++ b/third_party/WebKit/Source/core/xml/XSLTProcessor.h
@@ -74,7 +74,7 @@ String getParameter(const String& namespace_uri, const String& local_name) const; void removeParameter(const String& namespace_uri, const String& local_name); - void clearParameters() { parameters_.Clear(); } + void clearParameters() { parameters_.clear(); } void reset();
diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothAttributeInstanceMap.cpp b/third_party/WebKit/Source/modules/bluetooth/BluetoothAttributeInstanceMap.cpp index 8b0e4c3c6..8749f05 100644 --- a/third_party/WebKit/Source/modules/bluetooth/BluetoothAttributeInstanceMap.cpp +++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothAttributeInstanceMap.cpp
@@ -86,9 +86,9 @@ } void BluetoothAttributeInstanceMap::Clear() { - service_id_to_object_.Clear(); - characteristic_id_to_object_.Clear(); - descriptor_id_to_object_.Clear(); + service_id_to_object_.clear(); + characteristic_id_to_object_.clear(); + descriptor_id_to_object_.clear(); } DEFINE_TRACE(BluetoothAttributeInstanceMap) {
diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTServer.h b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTServer.h index 74f888b..5de3590 100644 --- a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTServer.h +++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTServer.h
@@ -57,7 +57,7 @@ // and returns true, false otherwise. bool RemoveFromActiveAlgorithms(ScriptPromiseResolver*); // Removes all ScriptPromiseResolvers from the set of Active Algorithms. - void ClearActiveAlgorithms() { active_algorithms_.Clear(); } + void ClearActiveAlgorithms() { active_algorithms_.clear(); } // If gatt is connected then sets gatt.connected to false and disconnects. // This function only performs the necessary steps to ensure a device
diff --git a/third_party/WebKit/Source/modules/cachestorage/Cache.cpp b/third_party/WebKit/Source/modules/cachestorage/Cache.cpp index bf116ee..2bf6e74 100644 --- a/third_party/WebKit/Source/modules/cachestorage/Cache.cpp +++ b/third_party/WebKit/Source/modules/cachestorage/Cache.cpp
@@ -4,8 +4,12 @@ #include "modules/cachestorage/Cache.h" +#include <memory> +#include <utility> #include "bindings/core/v8/CallbackPromiseAdapter.h" #include "bindings/core/v8/ExceptionState.h" +#include "bindings/core/v8/IDLTypes.h" +#include "bindings/core/v8/NativeValueTraitsImpl.h" #include "bindings/core/v8/ScriptPromiseResolver.h" #include "bindings/core/v8/ScriptState.h" #include "bindings/core/v8/V8Binding.h" @@ -22,8 +26,6 @@ #include "platform/HTTPNames.h" #include "platform/Histogram.h" #include "public/platform/modules/serviceworker/WebServiceWorkerCache.h" -#include <memory> -#include <utility> namespace blink { @@ -233,9 +235,9 @@ ScriptValue Call(ScriptValue value) override { NonThrowableExceptionState exception_state; - HeapVector<Member<Response>> responses = ToMemberNativeArray<Response>( - value.V8Value(), requests_.size(), GetScriptState()->GetIsolate(), - exception_state); + HeapVector<Member<Response>> responses = + NativeValueTraits<IDLSequence<Response>>::NativeValue( + GetScriptState()->GetIsolate(), value.V8Value(), exception_state); for (const auto& response : responses) { if (!response->ok()) {
diff --git a/third_party/WebKit/Source/modules/cachestorage/CacheTest.cpp b/third_party/WebKit/Source/modules/cachestorage/CacheTest.cpp index 4ceb231a..83d1829 100644 --- a/third_party/WebKit/Source/modules/cachestorage/CacheTest.cpp +++ b/third_party/WebKit/Source/modules/cachestorage/CacheTest.cpp
@@ -8,6 +8,8 @@ #include <memory> #include <string> #include "bindings/core/v8/ExceptionState.h" +#include "bindings/core/v8/IDLTypes.h" +#include "bindings/core/v8/NativeValueTraitsImpl.h" #include "bindings/core/v8/ScriptFunction.h" #include "bindings/core/v8/ScriptPromise.h" #include "bindings/core/v8/ScriptPromiseResolver.h" @@ -611,14 +613,13 @@ ScriptPromise result = cache->keys(GetScriptState(), exception_state); ScriptValue script_value = GetResolveValue(result); - Vector<v8::Local<v8::Value>> requests = - ToImplArray<Vector<v8::Local<v8::Value>>>(script_value.V8Value(), 0, - GetIsolate(), exception_state); + HeapVector<Member<Request>> requests = + NativeValueTraits<IDLSequence<Request>>::NativeValue( + GetIsolate(), script_value.V8Value(), exception_state); EXPECT_EQ(expected_urls.size(), requests.size()); for (int i = 0, minsize = std::min(expected_urls.size(), requests.size()); i < minsize; ++i) { - Request* request = - V8Request::toImplWithTypeCheck(GetIsolate(), requests[i]); + Request* request = requests[i]; EXPECT_TRUE(request); if (request) EXPECT_EQ(expected_urls[i], request->url()); @@ -674,14 +675,13 @@ options, exception_state); ScriptValue script_value = GetResolveValue(result); - Vector<v8::Local<v8::Value>> responses = - ToImplArray<Vector<v8::Local<v8::Value>>>(script_value.V8Value(), 0, - GetIsolate(), exception_state); + HeapVector<Member<Response>> responses = + NativeValueTraits<IDLSequence<Response>>::NativeValue( + GetIsolate(), script_value.V8Value(), exception_state); EXPECT_EQ(expected_urls.size(), responses.size()); for (int i = 0, minsize = std::min(expected_urls.size(), responses.size()); i < minsize; ++i) { - Response* response = - V8Response::toImplWithTypeCheck(GetIsolate(), responses[i]); + Response* response = responses[i]; EXPECT_TRUE(response); if (response) EXPECT_EQ(expected_urls[i], response->url());
diff --git a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp index 25d0c375..c34f122 100644 --- a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp +++ b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
@@ -532,7 +532,7 @@ if (target_size == 0) { // Short cut: LRU does not matter when evicting everything font_lru_list_.clear(); - fonts_resolved_using_current_style_.Clear(); + fonts_resolved_using_current_style_.clear(); return; } while (font_lru_list_.size() > target_size) {
diff --git a/third_party/WebKit/Source/modules/canvas2d/HitRegion.cpp b/third_party/WebKit/Source/modules/canvas2d/HitRegion.cpp index 2d2ae48..74d40a7 100644 --- a/third_party/WebKit/Source/modules/canvas2d/HitRegion.cpp +++ b/third_party/WebKit/Source/modules/canvas2d/HitRegion.cpp
@@ -85,8 +85,8 @@ void HitRegionManager::RemoveAllHitRegions() { hit_region_list_.clear(); - hit_region_id_map_.Clear(); - hit_region_control_map_.Clear(); + hit_region_id_map_.clear(); + hit_region_control_map_.clear(); } HitRegion* HitRegionManager::GetHitRegionById(const String& id) const {
diff --git a/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.cpp b/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.cpp index 34829c6..0be5906 100644 --- a/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.cpp +++ b/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.cpp
@@ -4,6 +4,8 @@ #include "modules/csspaint/PaintWorkletGlobalScope.h" +#include "bindings/core/v8/IDLTypes.h" +#include "bindings/core/v8/NativeValueTraitsImpl.h" #include "bindings/core/v8/V8BindingMacros.h" #include "bindings/core/v8/WorkerOrWorkletScriptController.h" #include "core/CSSPropertyNames.h" @@ -56,7 +58,7 @@ ScriptController()->GetScriptState()); // Explicitly clear the paint defininitions to break a reference cycle // between them and this global scope. - paint_definitions_.Clear(); + paint_definitions_.clear(); WorkletGlobalScope::Dispose(); } @@ -92,8 +94,9 @@ Vector<AtomicString> custom_invalidation_properties; if (!IsUndefinedOrNull(input_properties_value)) { - Vector<String> properties = ToImplArray<Vector<String>>( - input_properties_value, 0, isolate, exception_state); + Vector<String> properties = + NativeValueTraits<IDLSequence<IDLString>>::NativeValue( + isolate, input_properties_value, exception_state); if (exception_state.HadException()) return; @@ -118,8 +121,9 @@ return; if (!IsUndefinedOrNull(input_argument_type_values)) { - Vector<String> argument_types = ToImplArray<Vector<String>>( - input_argument_type_values, 0, isolate, exception_state); + Vector<String> argument_types = + NativeValueTraits<IDLSequence<IDLString>>::NativeValue( + isolate, input_argument_type_values, exception_state); if (exception_state.HadException()) return;
diff --git a/third_party/WebKit/Source/modules/geolocation/Geolocation.cpp b/third_party/WebKit/Source/modules/geolocation/Geolocation.cpp index f792e058..6034f7d 100644 --- a/third_party/WebKit/Source/modules/geolocation/Geolocation.cpp +++ b/third_party/WebKit/Source/modules/geolocation/Geolocation.cpp
@@ -131,9 +131,9 @@ CancelAllRequests(); StopUpdating(); geolocation_permission_ = kPermissionDenied; - pending_for_permission_notifiers_.Clear(); + pending_for_permission_notifiers_.clear(); last_position_ = nullptr; - one_shots_.Clear(); + one_shots_.clear(); watchers_.Clear(); } @@ -327,7 +327,7 @@ PositionError::kPermissionDenied, kPermissionDeniedErrorMessage)); } } - pending_for_permission_notifiers_.Clear(); + pending_for_permission_notifiers_.clear(); } void Geolocation::SendError(GeoNotifierVector& notifiers, @@ -413,7 +413,7 @@ // added by calls to Geolocation methods from the callbacks, and to prevent // further callbacks to these notifiers. GeoNotifierVector one_shots_with_cached_position; - one_shots_.Clear(); + one_shots_.clear(); if (error->IsFatal()) watchers_.Clear(); else { @@ -474,7 +474,7 @@ // Clear the lists before we make the callbacks, to avoid clearing notifiers // added by calls to Geolocation methods from the callbacks, and to prevent // further callbacks to these notifiers. - one_shots_.Clear(); + one_shots_.clear(); SendPosition(one_shots_copy, last_position_); SendPosition(watchers_copy, last_position_);
diff --git a/third_party/WebKit/Source/modules/geolocation/GeolocationWatchers.cpp b/third_party/WebKit/Source/modules/geolocation/GeolocationWatchers.cpp index 2286942..6d572519 100644 --- a/third_party/WebKit/Source/modules/geolocation/GeolocationWatchers.cpp +++ b/third_party/WebKit/Source/modules/geolocation/GeolocationWatchers.cpp
@@ -52,8 +52,8 @@ } void GeolocationWatchers::Clear() { - id_to_notifier_map_.Clear(); - notifier_to_id_map_.Clear(); + id_to_notifier_map_.clear(); + notifier_to_id_map_.clear(); } bool GeolocationWatchers::IsEmpty() const {
diff --git a/third_party/WebKit/Source/modules/imagecapture/ImageCapture.cpp b/third_party/WebKit/Source/modules/imagecapture/ImageCapture.cpp index 62ae971..58a274f5 100644 --- a/third_party/WebKit/Source/modules/imagecapture/ImageCapture.cpp +++ b/third_party/WebKit/Source/modules/imagecapture/ImageCapture.cpp
@@ -116,7 +116,7 @@ void ImageCapture::ContextDestroyed(ExecutionContext*) { RemoveAllEventListeners(); - service_requests_.Clear(); + service_requests_.clear(); DCHECK(!HasEventListeners()); } @@ -646,7 +646,7 @@ service_.reset(); for (ScriptPromiseResolver* resolver : service_requests_) resolver->Reject(DOMException::Create(kNotFoundError, kNoServiceError)); - service_requests_.Clear(); + service_requests_.clear(); } DEFINE_TRACE(ImageCapture) {
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.cpp index 2022121..9b053e1d 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.cpp +++ b/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.cpp
@@ -958,7 +958,7 @@ << "An object store got deleted outside a versionchange transaction."; deleted_ = true; - metadata_->indexes.Clear(); + metadata_->indexes.clear(); for (auto& it : index_map_) { IDBIndex* index = it.value; @@ -977,7 +977,7 @@ clear_index_cache_called_ = true; #endif // DCHECK_IS_ON() - index_map_.Clear(); + index_map_.clear(); } void IDBObjectStore::RevertMetadata(
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp index c581c0e..fd55b17 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp +++ b/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp
@@ -608,13 +608,13 @@ DCHECK(old_store_metadata_.Contains(object_store)); } } - object_store_map_.Clear(); + object_store_map_.clear(); for (auto& it : old_store_metadata_) { IDBObjectStore* object_store = it.key; object_store->ClearIndexCache(); } - old_store_metadata_.Clear(); + old_store_metadata_.clear(); deleted_indexes_.clear(); deleted_object_stores_.clear();
diff --git a/third_party/WebKit/Source/modules/nfc/NFC.cpp b/third_party/WebKit/Source/modules/nfc/NFC.cpp index ce7bead8..4a3d6ece 100644 --- a/third_party/WebKit/Source/modules/nfc/NFC.cpp +++ b/third_party/WebKit/Source/modules/nfc/NFC.cpp
@@ -601,8 +601,8 @@ void NFC::ContextDestroyed(ExecutionContext*) { nfc_.reset(); - requests_.Clear(); - callbacks_.Clear(); + requests_.clear(); + callbacks_.clear(); } // https://w3c.github.io/web-nfc/#writing-or-pushing-content @@ -712,7 +712,7 @@ if (!promise.IsEmpty()) return promise; - callbacks_.Clear(); + callbacks_.clear(); ScriptPromiseResolver* resolver = ScriptPromiseResolver::Create(script_state); requests_.insert(resolver); nfc_->CancelAllWatches(ConvertToBaseCallback( @@ -748,7 +748,7 @@ void NFC::OnConnectionError() { nfc_.reset(); - callbacks_.Clear(); + callbacks_.clear(); // If NFCService is not available or disappears when NFC hardware is // disabled, reject promise with NotSupportedError exception. @@ -756,7 +756,7 @@ resolver->Reject(NFCError::Take( resolver, device::nfc::mojom::blink::NFCErrorType::NOT_SUPPORTED)); - requests_.Clear(); + requests_.clear(); } void NFC::OnWatch(const WTF::Vector<uint32_t>& ids,
diff --git a/third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.cpp b/third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.cpp index d66c1f1d..c367c3c3 100644 --- a/third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.cpp +++ b/third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.cpp
@@ -154,7 +154,7 @@ return promise; } - availability_callbacks_.Clear(); + availability_callbacks_.clear(); resolver->Resolve(); return promise; @@ -301,7 +301,7 @@ prompt_promise_resolver_ = nullptr; } - availability_callbacks_.Clear(); + availability_callbacks_.clear(); if (state_ != WebRemotePlaybackState::kDisconnected) media_element_->RequestRemotePlaybackStop();
diff --git a/third_party/WebKit/Source/modules/shapedetection/BarcodeDetector.cpp b/third_party/WebKit/Source/modules/shapedetection/BarcodeDetector.cpp index e06e3c58..f657b7f5 100644 --- a/third_party/WebKit/Source/modules/shapedetection/BarcodeDetector.cpp +++ b/third_party/WebKit/Source/modules/shapedetection/BarcodeDetector.cpp
@@ -78,7 +78,7 @@ request->Reject(DOMException::Create(kNotSupportedError, "Barcode Detection not implemented.")); } - barcode_service_requests_.Clear(); + barcode_service_requests_.clear(); barcode_service_.reset(); }
diff --git a/third_party/WebKit/Source/modules/shapedetection/FaceDetector.cpp b/third_party/WebKit/Source/modules/shapedetection/FaceDetector.cpp index a090801..8f7f19bc 100644 --- a/third_party/WebKit/Source/modules/shapedetection/FaceDetector.cpp +++ b/third_party/WebKit/Source/modules/shapedetection/FaceDetector.cpp
@@ -77,7 +77,7 @@ request->Reject(DOMException::Create(kNotSupportedError, "Face Detection not implemented.")); } - face_service_requests_.Clear(); + face_service_requests_.clear(); face_service_.reset(); }
diff --git a/third_party/WebKit/Source/modules/shapedetection/TextDetector.cpp b/third_party/WebKit/Source/modules/shapedetection/TextDetector.cpp index 5d73eec..5de4222 100644 --- a/third_party/WebKit/Source/modules/shapedetection/TextDetector.cpp +++ b/third_party/WebKit/Source/modules/shapedetection/TextDetector.cpp
@@ -68,7 +68,7 @@ request->Reject(DOMException::Create(kNotSupportedError, "Text Detection not implemented.")); } - text_service_requests_.Clear(); + text_service_requests_.clear(); text_service_.reset(); }
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioWorkletGlobalScope.cpp b/third_party/WebKit/Source/modules/webaudio/AudioWorkletGlobalScope.cpp index e42afbd..42dc52e 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioWorkletGlobalScope.cpp +++ b/third_party/WebKit/Source/modules/webaudio/AudioWorkletGlobalScope.cpp
@@ -43,7 +43,7 @@ void AudioWorkletGlobalScope::Dispose() { DCHECK(IsContextThread()); - processor_definition_map_.Clear(); + processor_definition_map_.clear(); processor_instances_.clear(); ThreadedWorkletGlobalScope::Dispose(); }
diff --git a/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp b/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp index c7090d8f..3b44d912 100644 --- a/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp +++ b/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp
@@ -687,7 +687,7 @@ if (i != kNotFound) active_source_nodes_.erase(i); } - finished_source_nodes_.Clear(); + finished_source_nodes_.clear(); } bool BaseAudioContext::ReleaseFinishedSourceNodes() { @@ -838,7 +838,7 @@ for (auto& resolver : decode_audio_resolvers_) resolver->Reject(DOMException::Create(kInvalidStateError, "Audio context is going away")); - decode_audio_resolvers_.Clear(); + decode_audio_resolvers_.clear(); } void BaseAudioContext::MaybeUnlockUserGesture() {
diff --git a/third_party/WebKit/Source/modules/webaudio/DeferredTaskHandler.cpp b/third_party/WebKit/Source/modules/webaudio/DeferredTaskHandler.cpp index 0603919..d5b4e91 100644 --- a/third_party/WebKit/Source/modules/webaudio/DeferredTaskHandler.cpp +++ b/third_party/WebKit/Source/modules/webaudio/DeferredTaskHandler.cpp
@@ -119,7 +119,7 @@ for (AudioSummingJunction* junction : dirty_summing_junctions_) junction->UpdateRenderingState(); - dirty_summing_junctions_.Clear(); + dirty_summing_junctions_.clear(); } void DeferredTaskHandler::HandleDirtyAudioNodeOutputs() { @@ -199,7 +199,7 @@ for (AudioHandler* node : deferred_count_mode_change_) node->UpdateChannelCountMode(); - deferred_count_mode_change_.Clear(); + deferred_count_mode_change_.clear(); } void DeferredTaskHandler::UpdateChangedChannelInterpretation() { @@ -207,7 +207,7 @@ for (AudioHandler* node : deferred_channel_interpretation_change_) node->UpdateChannelInterpretation(); - deferred_channel_interpretation_change_.Clear(); + deferred_channel_interpretation_change_.clear(); } DeferredTaskHandler::DeferredTaskHandler()
diff --git a/third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.cpp b/third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.cpp index b110337..39fdad6 100644 --- a/third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.cpp +++ b/third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.cpp
@@ -441,7 +441,7 @@ kInvalidStateError, "Audio context is going away")); } - scheduled_suspends_.Clear(); + scheduled_suspends_.clear(); DCHECK_EQ(resume_resolvers_.size(), 0u); RejectPendingDecodeAudioDataResolvers();
diff --git a/third_party/WebKit/Source/modules/webdatabase/DatabaseThread.cpp b/third_party/WebKit/Source/modules/webdatabase/DatabaseThread.cpp index a09a664..98916da 100644 --- a/third_party/WebKit/Source/modules/webdatabase/DatabaseThread.cpp +++ b/third_party/WebKit/Source/modules/webdatabase/DatabaseThread.cpp
@@ -114,7 +114,7 @@ it != end; ++it) (*it)->Close(); } - open_database_set_.Clear(); + open_database_set_.clear(); thread_->PostTask(BLINK_FROM_HERE, WTF::Bind(&DatabaseThread::CleanupDatabaseThreadCompleted,
diff --git a/third_party/WebKit/Source/modules/webdatabase/InspectorDatabaseAgent.cpp b/third_party/WebKit/Source/modules/webdatabase/InspectorDatabaseAgent.cpp index 9d66c9f..2d5f410 100644 --- a/third_party/WebKit/Source/modules/webdatabase/InspectorDatabaseAgent.cpp +++ b/third_party/WebKit/Source/modules/webdatabase/InspectorDatabaseAgent.cpp
@@ -262,7 +262,7 @@ if (frame != page_->MainFrame()) return; - resources_.Clear(); + resources_.clear(); } InspectorDatabaseAgent::InspectorDatabaseAgent(Page* page) @@ -290,7 +290,7 @@ state_->setBoolean(DatabaseAgentState::kDatabaseAgentEnabled, enabled_); if (DatabaseClient* client = DatabaseClient::FromPage(page_)) client->SetInspectorAgent(nullptr); - resources_.Clear(); + resources_.clear(); return Response::OK(); }
diff --git a/third_party/WebKit/Source/modules/webdatabase/SQLTransactionCoordinator.cpp b/third_party/WebKit/Source/modules/webdatabase/SQLTransactionCoordinator.cpp index 1d1ba20a..58316a4 100644 --- a/third_party/WebKit/Source/modules/webdatabase/SQLTransactionCoordinator.cpp +++ b/third_party/WebKit/Source/modules/webdatabase/SQLTransactionCoordinator.cpp
@@ -146,7 +146,7 @@ } // Clean up all pending transactions for all databases - coordination_info_map_.Clear(); + coordination_info_map_.clear(); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp index 31b094c8..908b2ec 100644 --- a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp +++ b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
@@ -194,7 +194,7 @@ for (auto& callback : get_buffer_sub_data_async_callbacks_) { callback->Destroy(); } - get_buffer_sub_data_async_callbacks_.Clear(); + get_buffer_sub_data_async_callbacks_.clear(); WebGLRenderingContextBase::DestroyContext(); } @@ -426,8 +426,6 @@ if (isContextLost()) return; - DrawingBuffer::ScopedRGBEmulationForBlitFramebuffer emulation( - GetDrawingBuffer()); ContextGL()->BlitFramebufferCHROMIUM(src_x0, src_y0, src_x1, src_y1, dst_x0, dst_y0, dst_x1, dst_y1, mask, filter); }
diff --git a/third_party/WebKit/Source/modules/webshare/NavigatorShare.cpp b/third_party/WebKit/Source/modules/webshare/NavigatorShare.cpp index 34cbe23..e4006ff4 100644 --- a/third_party/WebKit/Source/modules/webshare/NavigatorShare.cpp +++ b/third_party/WebKit/Source/modules/webshare/NavigatorShare.cpp
@@ -151,7 +151,7 @@ for (auto& client : clients_) { client->OnConnectionError(); } - clients_.Clear(); + clients_.clear(); service_.reset(); }
diff --git a/third_party/WebKit/Source/modules/webusb/USB.cpp b/third_party/WebKit/Source/modules/webusb/USB.cpp index 4faf249be6..3d30cc3 100644 --- a/third_party/WebKit/Source/modules/webusb/USB.cpp +++ b/third_party/WebKit/Source/modules/webusb/USB.cpp
@@ -134,9 +134,9 @@ void USB::ContextDestroyed(ExecutionContext*) { device_manager_.reset(); - device_manager_requests_.Clear(); + device_manager_requests_.clear(); chooser_service_.reset(); - chooser_service_requests_.Clear(); + chooser_service_requests_.clear(); } USBDevice* USB::GetOrCreateDevice(UsbDeviceInfoPtr device_info) { @@ -206,14 +206,14 @@ client_binding_.Close(); for (ScriptPromiseResolver* resolver : device_manager_requests_) resolver->Resolve(HeapVector<Member<USBDevice>>(0)); - device_manager_requests_.Clear(); + device_manager_requests_.clear(); } void USB::OnChooserServiceConnectionError() { chooser_service_.reset(); for (ScriptPromiseResolver* resolver : chooser_service_requests_) resolver->Reject(DOMException::Create(kNotFoundError, kNoDeviceSelected)); - chooser_service_requests_.Clear(); + chooser_service_requests_.clear(); } void USB::AddedEventListener(const AtomicString& event_type,
diff --git a/third_party/WebKit/Source/modules/webusb/USBDevice.cpp b/third_party/WebKit/Source/modules/webusb/USBDevice.cpp index 5079e42..172f1a87 100644 --- a/third_party/WebKit/Source/modules/webusb/USBDevice.cpp +++ b/third_party/WebKit/Source/modules/webusb/USBDevice.cpp
@@ -468,7 +468,7 @@ void USBDevice::ContextDestroyed(ExecutionContext*) { device_.reset(); - device_requests_.Clear(); + device_requests_.clear(); } DEFINE_TRACE(USBDevice) { @@ -920,7 +920,7 @@ opened_ = false; for (ScriptPromiseResolver* resolver : device_requests_) resolver->Reject(DOMException::Create(kNotFoundError, kDeviceUnavailable)); - device_requests_.Clear(); + device_requests_.clear(); } bool USBDevice::MarkRequestComplete(ScriptPromiseResolver* resolver) {
diff --git a/third_party/WebKit/Source/platform/LayoutLocale.cpp b/third_party/WebKit/Source/platform/LayoutLocale.cpp index 856a9f3..309e06b9 100644 --- a/third_party/WebKit/Source/platform/LayoutLocale.cpp +++ b/third_party/WebKit/Source/platform/LayoutLocale.cpp
@@ -164,7 +164,7 @@ system_ = nullptr; default_for_han_ = nullptr; default_for_han_computed_ = false; - GetLocaleMap().Clear(); + GetLocaleMap().clear(); } Hyphenation* LayoutLocale::GetHyphenation() const {
diff --git a/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp b/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp index 2466e0e5..dfd49ab0 100644 --- a/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp +++ b/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp
@@ -12,49 +12,17 @@ namespace blink { -WebFeaturePolicyFeature GetWebFeaturePolicyFeature(const String& feature) { - if (feature == "fullscreen") - return WebFeaturePolicyFeature::kFullscreen; - if (feature == "payment") - return WebFeaturePolicyFeature::kPayment; - if (feature == "vibrate") - return WebFeaturePolicyFeature::kVibrate; - if (RuntimeEnabledFeatures::featurePolicyExperimentalFeaturesEnabled()) { - if (feature == "camera") - return WebFeaturePolicyFeature::kCamera; - if (feature == "eme") - return WebFeaturePolicyFeature::kEme; - if (feature == "microphone") - return WebFeaturePolicyFeature::kMicrophone; - if (feature == "speaker") - return WebFeaturePolicyFeature::kSpeaker; - if (feature == "cookie") - return WebFeaturePolicyFeature::kDocumentCookie; - if (feature == "domain") - return WebFeaturePolicyFeature::kDocumentDomain; - if (feature == "docwrite") - return WebFeaturePolicyFeature::kDocumentWrite; - if (feature == "geolocation") - return WebFeaturePolicyFeature::kGeolocation; - if (feature == "midi") - return WebFeaturePolicyFeature::kMidiFeature; - if (feature == "notifications") - return WebFeaturePolicyFeature::kNotifications; - if (feature == "push") - return WebFeaturePolicyFeature::kPush; - if (feature == "sync-script") - return WebFeaturePolicyFeature::kSyncScript; - if (feature == "sync-xhr") - return WebFeaturePolicyFeature::kSyncXHR; - if (feature == "webrtc") - return WebFeaturePolicyFeature::kWebRTC; - } - return WebFeaturePolicyFeature::kNotFound; +WebParsedFeaturePolicy ParseFeaturePolicy(const String& policy, + RefPtr<SecurityOrigin> origin, + Vector<String>* messages) { + return ParseFeaturePolicy(policy, origin, messages, + GetDefaultFeatureNameMap()); } WebParsedFeaturePolicy ParseFeaturePolicy(const String& policy, RefPtr<SecurityOrigin> origin, - Vector<String>* messages) { + Vector<String>* messages, + const FeatureNameMap& feature_names) { Vector<WebParsedFeaturePolicyDeclaration> whitelists; // Use a reasonable parse depth limit; the actual maximum depth is only going @@ -77,9 +45,9 @@ for (size_t j = 0; j < item->size(); ++j) { JSONObject::Entry entry = item->at(j); - WebFeaturePolicyFeature feature = GetWebFeaturePolicyFeature(entry.first); - if (feature == WebFeaturePolicyFeature::kNotFound) + if (!feature_names.Contains(entry.first)) continue; // Unrecognized feature; skip + WebFeaturePolicyFeature feature = feature_names.at(entry.first); JSONArray* targets = JSONArray::Cast(entry.second); if (!targets) { if (messages) @@ -131,4 +99,42 @@ return whitelists; } +const FeatureNameMap& GetDefaultFeatureNameMap() { + DEFINE_STATIC_LOCAL(FeatureNameMap, default_feature_name_map, ()); + if (default_feature_name_map.IsEmpty()) { + default_feature_name_map.Set("fullscreen", + WebFeaturePolicyFeature::kFullscreen); + default_feature_name_map.Set("payment", WebFeaturePolicyFeature::kPayment); + if (RuntimeEnabledFeatures::featurePolicyExperimentalFeaturesEnabled()) { + default_feature_name_map.Set("vibrate", + WebFeaturePolicyFeature::kVibrate); + default_feature_name_map.Set("camera", WebFeaturePolicyFeature::kCamera); + default_feature_name_map.Set("eme", WebFeaturePolicyFeature::kEme); + default_feature_name_map.Set("microphone", + WebFeaturePolicyFeature::kMicrophone); + default_feature_name_map.Set("speaker", + WebFeaturePolicyFeature::kSpeaker); + default_feature_name_map.Set("cookie", + WebFeaturePolicyFeature::kDocumentCookie); + default_feature_name_map.Set("domain", + WebFeaturePolicyFeature::kDocumentDomain); + default_feature_name_map.Set("docwrit", + WebFeaturePolicyFeature::kDocumentWrite); + default_feature_name_map.Set("geolocation", + WebFeaturePolicyFeature::kGeolocation); + default_feature_name_map.Set("midi", + WebFeaturePolicyFeature::kMidiFeature); + default_feature_name_map.Set("notifications", + WebFeaturePolicyFeature::kNotifications); + default_feature_name_map.Set("push", WebFeaturePolicyFeature::kPush); + default_feature_name_map.Set("sync-script", + WebFeaturePolicyFeature::kSyncScript); + default_feature_name_map.Set("sync-xhr", + WebFeaturePolicyFeature::kSyncXHR); + default_feature_name_map.Set("webrtc", WebFeaturePolicyFeature::kWebRTC); + } + } + return default_feature_name_map; +} + } // namespace blink
diff --git a/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.h b/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.h index e4f38bb..378c003 100644 --- a/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.h +++ b/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.h
@@ -7,8 +7,10 @@ #include "platform/PlatformExport.h" #include "platform/weborigin/SecurityOrigin.h" +#include "platform/wtf/HashMap.h" #include "platform/wtf/RefPtr.h" #include "platform/wtf/Vector.h" +#include "platform/wtf/text/StringHash.h" #include "platform/wtf/text/WTFString.h" #include "public/platform/WebFeaturePolicy.h" @@ -16,10 +18,10 @@ namespace blink { -// Returns the corresponding WebFeaturePolicyFeature enum given a feature -// string. -PLATFORM_EXPORT WebFeaturePolicyFeature -GetWebFeaturePolicyFeature(const String& feature); +// Returns a map between feature name (string) and WebFeaturePolicyFeature +// (enum). +typedef HashMap<String, WebFeaturePolicyFeature> FeatureNameMap; +PLATFORM_EXPORT const FeatureNameMap& GetDefaultFeatureNameMap(); // Converts a JSON feature policy string into a vector of whitelists, one for // each feature specified. Unrecognized features are filtered out. If |messages| @@ -30,6 +32,15 @@ RefPtr<SecurityOrigin>, Vector<String>* messages); +// Converts a JSON feature policy string into a vector of whitelists (see +// comments above), with an explicit FeatureNameMap. This method is primarily +// used for testing. +PLATFORM_EXPORT WebParsedFeaturePolicy +ParseFeaturePolicy(const String& policy, + RefPtr<SecurityOrigin>, + Vector<String>* messages, + const FeatureNameMap& feature_names); + // Given a vector of WebFeaturePolicyFeatures and an origin, creates a vector of // whitelists, one for each feature specified. PLATFORM_EXPORT WebParsedFeaturePolicy GetContainerPolicyFromAllowedFeatures(
diff --git a/third_party/WebKit/Source/platform/feature_policy/FeaturePolicyTest.cpp b/third_party/WebKit/Source/platform/feature_policy/FeaturePolicyTest.cpp index ff42573..f3dfdb03 100644 --- a/third_party/WebKit/Source/platform/feature_policy/FeaturePolicyTest.cpp +++ b/third_party/WebKit/Source/platform/feature_policy/FeaturePolicyTest.cpp
@@ -46,13 +46,19 @@ RefPtr<SecurityOrigin> origin_a_ = SecurityOrigin::CreateFromString(ORIGIN_A); RefPtr<SecurityOrigin> origin_b_ = SecurityOrigin::CreateFromString(ORIGIN_B); RefPtr<SecurityOrigin> origin_c_ = SecurityOrigin::CreateFromString(ORIGIN_C); + + const FeatureNameMap test_feature_name_map = { + {"fullscreen", blink::WebFeaturePolicyFeature::kFullscreen}, + {"payment", blink::WebFeaturePolicyFeature::kPayment}, + {"vibrate", blink::WebFeaturePolicyFeature::kVibrate}}; }; TEST_F(FeaturePolicyTest, ParseValidPolicy) { Vector<String> messages; for (const char* policy_string : kValidPolicies) { messages.clear(); - ParseFeaturePolicy(policy_string, origin_a_.Get(), &messages); + ParseFeaturePolicy(policy_string, origin_a_.Get(), &messages, + test_feature_name_map); EXPECT_EQ(0UL, messages.size()); } } @@ -61,7 +67,8 @@ Vector<String> messages; for (const char* policy_string : kInvalidPolicies) { messages.clear(); - ParseFeaturePolicy(policy_string, origin_a_.Get(), &messages); + ParseFeaturePolicy(policy_string, origin_a_.Get(), &messages, + test_feature_name_map); EXPECT_NE(0UL, messages.size()); } } @@ -70,23 +77,24 @@ Vector<String> messages; // Empty policy. - WebParsedFeaturePolicy parsed_policy = - ParseFeaturePolicy("{}", origin_a_.Get(), &messages); + WebParsedFeaturePolicy parsed_policy = ParseFeaturePolicy( + "{}", origin_a_.Get(), &messages, test_feature_name_map); EXPECT_EQ(0UL, parsed_policy.size()); // Simple policy with "self". - parsed_policy = ParseFeaturePolicy("{\"vibrate\": [\"self\"]}", - origin_a_.Get(), &messages); + parsed_policy = + ParseFeaturePolicy("{\"vibrate\": [\"self\"]}", origin_a_.Get(), + &messages, test_feature_name_map); EXPECT_EQ(1UL, parsed_policy.size()); + EXPECT_EQ(WebFeaturePolicyFeature::kVibrate, parsed_policy[0].feature); EXPECT_FALSE(parsed_policy[0].matches_all_origins); EXPECT_EQ(1UL, parsed_policy[0].origins.size()); EXPECT_TRUE(origin_a_->IsSameSchemeHostPortAndSuborigin( parsed_policy[0].origins[0].Get())); - // Simple policy with *. - parsed_policy = - ParseFeaturePolicy("{\"vibrate\": [\"*\"]}", origin_a_.Get(), &messages); + parsed_policy = ParseFeaturePolicy("{\"vibrate\": [\"*\"]}", origin_a_.Get(), + &messages, test_feature_name_map); EXPECT_EQ(1UL, parsed_policy.size()); EXPECT_EQ(WebFeaturePolicyFeature::kVibrate, parsed_policy[0].feature); EXPECT_TRUE(parsed_policy[0].matches_all_origins); @@ -97,7 +105,7 @@ "{\"vibrate\": [\"*\"], " "\"fullscreen\": [\"https://example.net\", \"https://example.org\"], " "\"payment\": [\"self\"]}", - origin_a_.Get(), &messages); + origin_a_.Get(), &messages, test_feature_name_map); EXPECT_EQ(3UL, parsed_policy.size()); EXPECT_EQ(WebFeaturePolicyFeature::kVibrate, parsed_policy[0].feature); EXPECT_TRUE(parsed_policy[0].matches_all_origins);
diff --git a/third_party/WebKit/Source/platform/fonts/FontCache.cpp b/third_party/WebKit/Source/platform/fonts/FontCache.cpp index 9484371..76efde5 100644 --- a/third_party/WebKit/Source/platform/fonts/FontCache.cpp +++ b/third_party/WebKit/Source/platform/fonts/FontCache.cpp
@@ -394,7 +394,7 @@ iter != g_fallback_list_shaper_cache->end(); ++iter) { items += iter->value->size(); } - g_fallback_list_shaper_cache->Clear(); + g_fallback_list_shaper_cache->clear(); } DEFINE_STATIC_LOCAL(CustomCountHistogram, shape_cache_histogram, ("Blink.Fonts.ShapeCache", 1, 1000000, 50));
diff --git a/third_party/WebKit/Source/platform/fonts/GenericFontFamilySettings.cpp b/third_party/WebKit/Source/platform/fonts/GenericFontFamilySettings.cpp index c43f3e1..e36e57f1 100644 --- a/third_party/WebKit/Source/platform/fonts/GenericFontFamilySettings.cpp +++ b/third_party/WebKit/Source/platform/fonts/GenericFontFamilySettings.cpp
@@ -180,13 +180,13 @@ } void GenericFontFamilySettings::Reset() { - standard_font_family_map_.Clear(); - serif_font_family_map_.Clear(); - fixed_font_family_map_.Clear(); - sans_serif_font_family_map_.Clear(); - cursive_font_family_map_.Clear(); - fantasy_font_family_map_.Clear(); - pictograph_font_family_map_.Clear(); + standard_font_family_map_.clear(); + serif_font_family_map_.clear(); + fixed_font_family_map_.clear(); + sans_serif_font_family_map_.clear(); + cursive_font_family_map_.clear(); + fantasy_font_family_map_.clear(); + pictograph_font_family_map_.clear(); } } // namespace blink
diff --git a/third_party/WebKit/Source/platform/fonts/shaping/ShapeCache.h b/third_party/WebKit/Source/platform/fonts/shaping/ShapeCache.h index 703cf4455..37498c9 100644 --- a/third_party/WebKit/Source/platform/fonts/shaping/ShapeCache.h +++ b/third_party/WebKit/Source/platform/fonts/shaping/ShapeCache.h
@@ -156,8 +156,8 @@ } void Clear() { - single_char_map_.Clear(); - short_string_map_.Clear(); + single_char_map_.clear(); + short_string_map_.clear(); } unsigned size() const { @@ -213,8 +213,8 @@ return value; // No need to be fancy: we're just trying to avoid pathological growth. - single_char_map_.Clear(); - short_string_map_.Clear(); + single_char_map_.clear(); + short_string_map_.clear(); return 0; }
diff --git a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp index d4f3845..15555873 100644 --- a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp +++ b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
@@ -576,19 +576,6 @@ return CreateColorBuffer(size_); } -DrawingBuffer::ScopedRGBEmulationForBlitFramebuffer:: - ScopedRGBEmulationForBlitFramebuffer(DrawingBuffer* drawing_buffer) - : drawing_buffer_(drawing_buffer) { - doing_work_ = drawing_buffer->SetupRGBEmulationForBlitFramebuffer(); -} - -DrawingBuffer::ScopedRGBEmulationForBlitFramebuffer:: - ~ScopedRGBEmulationForBlitFramebuffer() { - if (doing_work_) { - drawing_buffer_->CleanupRGBEmulationForBlitFramebuffer(); - } -} - DrawingBuffer::ColorBuffer::ColorBuffer( DrawingBuffer* drawing_buffer, const ColorBufferParameters& parameters, @@ -612,10 +599,6 @@ if (image_id) { gl->BindTexture(parameters.target, texture_id); gl->ReleaseTexImage2DCHROMIUM(parameters.target, image_id); - if (rgb_workaround_texture_id) { - gl->BindTexture(parameters.target, rgb_workaround_texture_id); - gl->ReleaseTexImage2DCHROMIUM(parameters.target, image_id); - } gl->DestroyImageCHROMIUM(image_id); switch (parameters.target) { case GL_TEXTURE_2D: @@ -635,7 +618,6 @@ gpu_memory_buffer.reset(); } gl->DeleteTextures(1, &texture_id); - gl->DeleteTextures(1, &rgb_workaround_texture_id); } bool DrawingBuffer::Initialize(const IntSize& size, bool use_multisampling) { @@ -1276,78 +1258,6 @@ return GL_RGB8_OES; } -bool DrawingBuffer::SetupRGBEmulationForBlitFramebuffer() { - // We only need to do this work if: - // - The user has selected alpha:false and antialias:false - // - We are using CHROMIUM_image with RGB emulation - // macOS is the only platform on which this is necessary. - - if (want_alpha_channel_ || anti_aliasing_mode_ != kNone) - return false; - - if (!(ShouldUseChromiumImage() && - ContextProvider()->GetCapabilities().chromium_image_rgb_emulation)) - return false; - - if (!back_color_buffer_) - return false; - - // If for some reason the back buffer doesn't have a CHROMIUM_image, - // don't proceed with this workaround. - if (!back_color_buffer_->image_id) - return false; - - // Before allowing the BlitFramebuffer call to go through, it's necessary - // to swap out the RGBA texture that's bound to the CHROMIUM_image - // instance with an RGB texture. BlitFramebuffer requires the internal - // formats of the source and destination to match when doing a - // multisample resolve, and the best way to achieve this without adding - // more full-screen blits is to hook up a true RGB texture to the - // underlying IOSurface. Unfortunately, on macOS, this rendering path - // destroys the alpha channel and requires a fixup afterward, which is - // why it isn't used all the time. - - GLuint rgb_texture = back_color_buffer_->rgb_workaround_texture_id; - GLenum target = GC3D_TEXTURE_RECTANGLE_ARB; - if (!rgb_texture) { - gl_->GenTextures(1, &rgb_texture); - gl_->BindTexture(target, rgb_texture); - gl_->TexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - gl_->TexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - gl_->TexParameteri(target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - gl_->TexParameteri(target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - - // Bind this texture to the CHROMIUM_image instance that the color - // buffer owns. This is an expensive operation, so it's important that - // the result be cached. - gl_->BindTexImage2DWithInternalformatCHROMIUM(target, GL_RGB, - back_color_buffer_->image_id); - back_color_buffer_->rgb_workaround_texture_id = rgb_texture; - } - - gl_->FramebufferTexture2D(GL_DRAW_FRAMEBUFFER_ANGLE, GL_COLOR_ATTACHMENT0, - target, rgb_texture, 0); - return true; -} - -void DrawingBuffer::CleanupRGBEmulationForBlitFramebuffer() { - // This will only be called if SetupRGBEmulationForBlitFramebuffer was. - // Put the framebuffer back the way it was, and clear the alpha channel. - DCHECK(back_color_buffer_); - DCHECK(back_color_buffer_->image_id); - GLenum target = GC3D_TEXTURE_RECTANGLE_ARB; - gl_->FramebufferTexture2D(GL_DRAW_FRAMEBUFFER_ANGLE, GL_COLOR_ATTACHMENT0, - target, back_color_buffer_->texture_id, 0); - // Clear the alpha channel. - gl_->ColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_TRUE); - gl_->Disable(GL_SCISSOR_TEST); - gl_->ClearColor(0, 0, 0, 1); - gl_->Clear(GL_COLOR_BUFFER_BIT); - DCHECK(client_); - client_->DrawingBufferClientRestoreScissorTest(); - client_->DrawingBufferClientRestoreMaskAndClearValues(); -} - DrawingBuffer::ScopedStateRestorer::ScopedStateRestorer( DrawingBuffer* drawing_buffer) : drawing_buffer_(drawing_buffer) {
diff --git a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h index b99c5e7..56f1eea 100644 --- a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h +++ b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h
@@ -232,19 +232,6 @@ new_mailbox_callback_ = std::move(closure); } - // This class helps implement correct semantics for BlitFramebuffer - // when the DrawingBuffer is using a CHROMIUM image for its backing - // store and RGB emulation is in use (basically, macOS only). - class PLATFORM_EXPORT ScopedRGBEmulationForBlitFramebuffer { - public: - ScopedRGBEmulationForBlitFramebuffer(DrawingBuffer*); - ~ScopedRGBEmulationForBlitFramebuffer(); - - private: - RefPtr<DrawingBuffer> drawing_buffer_; - bool doing_work_ = false; - }; - protected: // For unittests DrawingBuffer(std::unique_ptr<WebGraphicsContext3DProvider>, std::unique_ptr<Extensions3DUtil>, @@ -270,7 +257,6 @@ Vector<RecycledBitmap> recycled_bitmaps_; private: - friend class ScopedRGBEmulationForBlitFramebuffer; friend class ScopedStateRestorer; friend class ColorBuffer; @@ -331,16 +317,6 @@ const GLuint image_id = 0; std::unique_ptr<gfx::GpuMemoryBuffer> gpu_memory_buffer; - // If we're emulating an RGB back buffer using an RGBA Chromium - // image (essentially macOS only), then when performing - // BlitFramebuffer calls, we have to swap in an RGB texture in - // place of the RGBA texture bound to the image. The reason is - // that BlitFramebuffer requires the internal formats of the - // source and destination to match (e.g. RGB8 on both sides). - // There are bugs in the semantics of RGB8 textures in this - // situation (the alpha channel is zeroed), requiring more fixups. - GLuint rgb_workaround_texture_id = 0; - // The mailbox used to send this buffer to the compositor. gpu::Mailbox mailbox; @@ -452,11 +428,6 @@ // The format to use when creating a multisampled renderbuffer. GLenum GetMultisampledRenderbufferFormat(); - // Helpers to ensure correct behavior of BlitFramebuffer when using - // an emulated RGB CHROMIUM_image back buffer. - bool SetupRGBEmulationForBlitFramebuffer(); - void CleanupRGBEmulationForBlitFramebuffer(); - // Weak, reset by beginDestruction. Client* client_ = nullptr; @@ -477,9 +448,9 @@ std::unique_ptr<WTF::Closure> new_mailbox_callback_; - // The current state restorer, which is used to track state dirtying. It is an + // The current state restorer, which is used to track state dirtying. It is in // error to dirty state shared with WebGL while there is no existing state - // restorer. + // restorer. It is also in error to instantiate two state restorers at once. ScopedStateRestorer* state_restorer_ = nullptr; // This is used when the user requests either a depth or stencil buffer.
diff --git a/third_party/WebKit/Source/platform/graphics/gpu/Extensions3DUtil.cpp b/third_party/WebKit/Source/platform/graphics/gpu/Extensions3DUtil.cpp index 8890f53d1..54ba072 100644 --- a/third_party/WebKit/Source/platform/graphics/gpu/Extensions3DUtil.cpp +++ b/third_party/WebKit/Source/platform/graphics/gpu/Extensions3DUtil.cpp
@@ -63,8 +63,8 @@ if (requestable_extensions_.Contains(name)) { gl_->RequestExtensionCHROMIUM(name.Ascii().data()); - enabled_extensions_.Clear(); - requestable_extensions_.Clear(); + enabled_extensions_.clear(); + requestable_extensions_.clear(); InitializeExtensions(); } return enabled_extensions_.Contains(name);
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp b/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp index ec70301..85d87fa6 100644 --- a/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp +++ b/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp
@@ -529,7 +529,7 @@ // These data structures are used during painting only. DCHECK(!IsSkippingCache()); #if DCHECK_IS_ON() - new_display_item_indices_by_client_.Clear(); + new_display_item_indices_by_client_.clear(); #endif if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && @@ -542,7 +542,7 @@ DisplayItemClient::CacheGenerationOrInvalidationReason::Next(); new_cached_subsequences_.swap(current_cached_subsequences_); - new_cached_subsequences_.Clear(); + new_cached_subsequences_.clear(); last_cached_subsequence_end_ = 0; for (auto& item : current_cached_subsequences_) { item.key->SetDisplayItemsCached(current_cache_generation_); @@ -596,8 +596,8 @@ std::move(new_display_item_list_), new_paint_chunks_.ReleasePaintChunks(), gpu_analyzer.suitableForGpuRasterization()); ResetCurrentListIndices(); - out_of_order_item_indices_.Clear(); - out_of_order_chunk_indices_.Clear(); + out_of_order_item_indices_.clear(); + out_of_order_chunk_indices_.clear(); items_moved_into_new_list_.clear(); if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PropertyTreeStateTest.cpp b/third_party/WebKit/Source/platform/graphics/paint/PropertyTreeStateTest.cpp index 178685b9..e1218a9 100644 --- a/third_party/WebKit/Source/platform/graphics/paint/PropertyTreeStateTest.cpp +++ b/third_party/WebKit/Source/platform/graphics/paint/PropertyTreeStateTest.cpp
@@ -227,7 +227,7 @@ EXPECT_EQ(second_compositor_element_id, state.GetCompositorElementId(composited_element_ids)); - composited_element_ids.Clear(); + composited_element_ids.clear(); composited_element_ids.insert(second_compositor_element_id); EXPECT_EQ(first_compositor_element_id, state.GetCompositorElementId(composited_element_ids));
diff --git a/third_party/WebKit/Source/platform/heap/HeapTest.cpp b/third_party/WebKit/Source/platform/heap/HeapTest.cpp index a108ddc..c451c59c 100644 --- a/third_party/WebKit/Source/platform/heap/HeapTest.cpp +++ b/third_party/WebKit/Source/platform/heap/HeapTest.cpp
@@ -1538,7 +1538,7 @@ // Check that map_ hasn't shrunk. EXPECT_LT(31ul, map_.Capacity()); // Just releasing the backing is allowed. - map_.Clear(); + map_.clear(); EXPECT_EQ(0ul, map_.Capacity()); } @@ -2179,7 +2179,7 @@ Persistent<HeapObjectIdentityMap> map = new HeapObjectIdentityMap(); - map->Clear(); + map->clear(); size_t after_set_was_created = heap.ObjectPayloadSizeForTesting(); EXPECT_TRUE(after_set_was_created > initial_object_payload_size); @@ -2981,7 +2981,7 @@ EXPECT_TRUE(set.Contains(three)); EXPECT_TRUE(set.Contains(four)); - set.Clear(); + set.clear(); ConservativelyCollectGarbage(); EXPECT_FALSE(set.Contains(one)); EXPECT_FALSE(set.Contains(two)); @@ -3032,7 +3032,7 @@ EXPECT_TRUE(set.Contains(three)); EXPECT_TRUE(set.Contains(four)); - set.Clear(); + set.clear(); ConservativelyCollectGarbage(); EXPECT_FALSE(set.Contains(one)); EXPECT_FALSE(set.Contains(two)); @@ -3370,8 +3370,8 @@ luck.Clear(); if (clear_maps) { - map->Clear(); // Clear map. - ref_map->Clear(); // Clear map. + map->clear(); // Clear map. + ref_map->clear(); // Clear map. } else { map.Clear(); // Clear Persistent handle, not map. ref_map.Clear(); // Clear Persistent handle, not map. @@ -3615,13 +3615,13 @@ keep_numbers_alive[i] = nullptr; if (collection_number != kWeakStrongIndex) - weak_strong->Clear(); + weak_strong->clear(); if (collection_number != kStrongWeakIndex) - strong_weak->Clear(); + strong_weak->clear(); if (collection_number != kWeakWeakIndex) - weak_weak->Clear(); + weak_weak->clear(); if (collection_number != kWeakSetIndex) - weak_set->Clear(); + weak_set->clear(); if (collection_number != kWeakOrderedSetIndex) weak_ordered_set->clear(); @@ -4661,7 +4661,7 @@ SimpleClassWithDestructor* has_destructor = new SimpleClassWithDestructor(); map.insert(IntWrapper::Create(1), WTF::WrapUnique(has_destructor)); SimpleClassWithDestructor::was_destructed_ = false; - map.Clear(); + map.clear(); EXPECT_TRUE(SimpleClassWithDestructor::was_destructed_); } @@ -5187,7 +5187,7 @@ } else { EXPECT_EQ(0u, outer->size()); } - outer->Clear(); + outer->clear(); Persistent<IntWrapper> deep = IntWrapper::Create(42); Persistent<IntWrapper> home = IntWrapper::Create(103); Persistent<IntWrapper> composite = IntWrapper::Create(91); @@ -6699,7 +6699,7 @@ } EXPECT_FALSE(string.Impl()->HasOneRef()); - map.Clear(); + map.clear(); EXPECT_TRUE(string.Impl()->HasOneRef()); }
diff --git a/third_party/WebKit/Source/platform/heap/Persistent.h b/third_party/WebKit/Source/platform/heap/Persistent.h index 855169f..18eb93dc 100644 --- a/third_party/WebKit/Source/platform/heap/Persistent.h +++ b/third_party/WebKit/Source/platform/heap/Persistent.h
@@ -591,7 +591,7 @@ PersistentHeapCollectionBase<Collection>* collection = (reinterpret_cast<PersistentHeapCollectionBase<Collection>*>(self)); collection->Uninitialize(); - collection->Clear(); + collection->clear(); } NO_SANITIZE_ADDRESS
diff --git a/third_party/WebKit/Source/platform/instrumentation/tracing/web_process_memory_dump.cc b/third_party/WebKit/Source/platform/instrumentation/tracing/web_process_memory_dump.cc index 13aa65c..c29bb98 100644 --- a/third_party/WebKit/Source/platform/instrumentation/tracing/web_process_memory_dump.cc +++ b/third_party/WebKit/Source/platform/instrumentation/tracing/web_process_memory_dump.cc
@@ -96,7 +96,7 @@ void WebProcessMemoryDump::Clear() { // Clear all the WebMemoryAllocatorDump wrappers. - memory_allocator_dumps_.Clear(); + memory_allocator_dumps_.clear(); // Clear the actual MemoryAllocatorDump objects from the underlying PMD. process_memory_dump_->Clear();
diff --git a/third_party/WebKit/Source/platform/loader/fetch/Resource.cpp b/third_party/WebKit/Source/platform/loader/fetch/Resource.cpp index d825319..cb136e1 100644 --- a/third_party/WebKit/Source/platform/loader/fetch/Resource.cpp +++ b/third_party/WebKit/Source/platform/loader/fetch/Resource.cpp
@@ -301,7 +301,7 @@ HeapVector<Member<Resource>> resources; for (const Member<Resource>& resource : resources_with_pending_clients_) resources.push_back(resource.Get()); - resources_with_pending_clients_.Clear(); + resources_with_pending_clients_.clear(); for (const auto& resource : resources) resource->FinishPendingClients();
diff --git a/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp b/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp index b225c49..dd265302 100644 --- a/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp +++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
@@ -330,7 +330,7 @@ } if (validated_urls_.size() >= kMaxValidatedURLsSize) { - validated_urls_.Clear(); + validated_urls_.clear(); } validated_urls_.insert(params.GetResourceRequest().Url()); }
diff --git a/third_party/WebKit/Source/platform/network/HTTPHeaderMap.h b/third_party/WebKit/Source/platform/network/HTTPHeaderMap.h index aa757fc..abc9325 100644 --- a/third_party/WebKit/Source/platform/network/HTTPHeaderMap.h +++ b/third_party/WebKit/Source/platform/network/HTTPHeaderMap.h
@@ -63,7 +63,7 @@ const_iterator begin() const { return headers_.begin(); } const_iterator end() const { return headers_.end(); } const_iterator Find(const AtomicString& k) const { return headers_.Find(k); } - void Clear() { headers_.Clear(); } + void Clear() { headers_.clear(); } bool Contains(const AtomicString& k) const { return headers_.Contains(k); } const AtomicString& Get(const AtomicString& k) const { return headers_.at(k);
diff --git a/third_party/WebKit/Source/platform/testing/weburl_loader_mock_factory_impl.cc b/third_party/WebKit/Source/platform/testing/weburl_loader_mock_factory_impl.cc index b441fd5..053278b 100644 --- a/third_party/WebKit/Source/platform/testing/weburl_loader_mock_factory_impl.cc +++ b/third_party/WebKit/Source/platform/testing/weburl_loader_mock_factory_impl.cc
@@ -73,8 +73,8 @@ } void WebURLLoaderMockFactoryImpl::UnregisterAllURLsAndClearMemoryCache() { - url_to_response_info_.Clear(); - url_to_error_info_.Clear(); + url_to_response_info_.clear(); + url_to_error_info_.clear(); GetMemoryCache()->EvictResources(); }
diff --git a/third_party/WebKit/Source/platform/weborigin/SecurityPolicy.cpp b/third_party/WebKit/Source/platform/weborigin/SecurityPolicy.cpp index dd64aef..677e2f8 100644 --- a/third_party/WebKit/Source/platform/weborigin/SecurityPolicy.cpp +++ b/third_party/WebKit/Source/platform/weborigin/SecurityPolicy.cpp
@@ -253,7 +253,7 @@ void SecurityPolicy::ResetOriginAccessWhitelists() { ASSERT(IsMainThread()); - GetOriginAccessMap().Clear(); + GetOriginAccessMap().clear(); } bool SecurityPolicy::ReferrerPolicyFromString(
diff --git a/third_party/WebKit/Source/platform/wtf/HashCountedSet.h b/third_party/WebKit/Source/platform/wtf/HashCountedSet.h index fe51fcb1..5fc0cc81 100644 --- a/third_party/WebKit/Source/platform/wtf/HashCountedSet.h +++ b/third_party/WebKit/Source/platform/wtf/HashCountedSet.h
@@ -101,7 +101,7 @@ void RemoveAll(iterator); // Clears the whole set. - void clear() { impl_.Clear(); } + void clear() { impl_.clear(); } Vector<Value> AsVector() const;
diff --git a/third_party/WebKit/Source/platform/wtf/HashMap.h b/third_party/WebKit/Source/platform/wtf/HashMap.h index 5b9a117..32f845fe 100644 --- a/third_party/WebKit/Source/platform/wtf/HashMap.h +++ b/third_party/WebKit/Source/platform/wtf/HashMap.h
@@ -152,7 +152,7 @@ void erase(KeyPeekInType); void erase(iterator); - void Clear(); + void clear(); template <typename Collection> void RemoveAll(const Collection& to_be_removed) { WTF::RemoveAll(*this, to_be_removed); @@ -624,7 +624,7 @@ typename W, typename X, typename Y> -inline void HashMap<T, U, V, W, X, Y>::Clear() { +inline void HashMap<T, U, V, W, X, Y>::clear() { impl_.clear(); }
diff --git a/third_party/WebKit/Source/platform/wtf/HashMapTest.cpp b/third_party/WebKit/Source/platform/wtf/HashMapTest.cpp index 1c25077f..25e388c 100644 --- a/third_party/WebKit/Source/platform/wtf/HashMapTest.cpp +++ b/third_party/WebKit/Source/platform/wtf/HashMapTest.cpp
@@ -290,7 +290,7 @@ InstanceCounter::counter_ = 0; HashMap<int, InstanceCounter> map; map.Set(1, InstanceCounter()); - map.Clear(); + map.clear(); EXPECT_EQ(0, InstanceCounter::counter_); } @@ -409,7 +409,7 @@ iter = map.Find(13); EXPECT_TRUE(iter == map.end()); - map.Clear(); + map.clear(); } TEST(HashMapTest, MoveOnlyKeyType) { @@ -464,7 +464,7 @@ iter = map.Find(MoveOnly(13)); EXPECT_TRUE(iter == map.end()); - map.Clear(); + map.clear(); } class CountCopy final { @@ -651,7 +651,7 @@ iter = map.Find(Pair(MoveOnly(13), -13)); EXPECT_TRUE(iter == map.end()); - map.Clear(); + map.clear(); } bool IsOneTwoThree(const HashMap<int, int>& map) {
diff --git a/third_party/WebKit/Source/platform/wtf/HashSet.h b/third_party/WebKit/Source/platform/wtf/HashSet.h index 4010427..6b3395c 100644 --- a/third_party/WebKit/Source/platform/wtf/HashSet.h +++ b/third_party/WebKit/Source/platform/wtf/HashSet.h
@@ -121,7 +121,7 @@ void erase(ValuePeekInType); void erase(iterator); - void Clear(); + void clear(); template <typename Collection> void RemoveAll(const Collection& to_be_removed) { WTF::RemoveAll(*this, to_be_removed); @@ -282,7 +282,7 @@ } template <typename T, typename U, typename V, typename W> -inline void HashSet<T, U, V, W>::Clear() { +inline void HashSet<T, U, V, W>::clear() { impl_.clear(); }
diff --git a/third_party/WebKit/Source/platform/wtf/HashSetTest.cpp b/third_party/WebKit/Source/platform/wtf/HashSetTest.cpp index 0328518..6416469 100644 --- a/third_party/WebKit/Source/platform/wtf/HashSetTest.cpp +++ b/third_party/WebKit/Source/platform/wtf/HashSetTest.cpp
@@ -122,7 +122,7 @@ set.erase(ptr1); EXPECT_TRUE(deleted1); - set.Clear(); + set.clear(); EXPECT_TRUE(deleted2); EXPECT_TRUE(set.IsEmpty()); @@ -397,7 +397,7 @@ iter = set.Find(MoveOnly(13)); EXPECT_TRUE(iter == set.end()); - set.Clear(); + set.clear(); } TEST(HashSetTest, UniquePtr) {
diff --git a/tools/binary_size/libsupersize/archive.py b/tools/binary_size/libsupersize/archive.py index eeb6de4..13441d07 100644 --- a/tools/binary_size/libsupersize/archive.py +++ b/tools/binary_size/libsupersize/archive.py
@@ -11,7 +11,6 @@ import gzip import logging import os -import multiprocessing import posixpath import re import subprocess @@ -155,13 +154,9 @@ return path -def _ExtractSourcePaths(symbols, output_directory): - """Fills in the .source_path attribute of all symbols. - - Returns True if source paths were found. - """ - mapper = ninja_parser.SourceFileMapper(output_directory) - not_found_paths = set() +def _ExtractSourcePaths(symbols, source_mapper): + """Fills in the .source_path attribute of all symbols.""" + logging.debug('Parsed %d .ninja files.', source_mapper.parsed_file_count) for symbol in symbols: object_path = symbol.object_path @@ -169,14 +164,9 @@ continue # We don't have source info for prebuilt .a files. if not os.path.isabs(object_path) and not object_path.startswith('..'): - source_path = mapper.FindSourceForPath(object_path) + source_path = source_mapper.FindSourceForPath(object_path) if source_path: symbol.source_path = _NormalizeSourcePath(source_path) - elif object_path not in not_found_paths: - not_found_paths.add(object_path) - logging.warning('Could not find source path for %s', object_path) - logging.debug('Parsed %d .ninja files.', mapper.GetParsedFileCount()) - return len(not_found_paths) == 0 def _CalculatePadding(symbols): @@ -349,20 +339,23 @@ def CreateSizeInfo(map_path, lazy_paths=None, no_source_paths=False, raw_only=False): """Creates a SizeInfo from the given map file.""" - if not no_source_paths: - # output_directory needed for source file information. - lazy_paths.VerifyOutputDirectory() # tool_prefix needed for c++filt. lazy_paths.VerifyToolPrefix() + if not no_source_paths: + # Parse .ninja files at the same time as parsing the .map file. + source_mapper_result = helpers.ForkAndCall( + ninja_parser.Parse, lazy_paths.VerifyOutputDirectory()) + with _OpenMaybeGz(map_path) as map_file: section_sizes, raw_symbols = ( linker_map_parser.MapFileParser().Parse(map_file)) if not no_source_paths: logging.info('Extracting source paths from .ninja files') - all_found = _ExtractSourcePaths(raw_symbols, lazy_paths.output_directory) - assert all_found, ( + source_mapper = source_mapper_result.get() + _ExtractSourcePaths(raw_symbols, source_mapper) + assert source_mapper.unmatched_paths_count == 0, ( 'One or more source file paths could not be found. Likely caused by ' '.ninja files being generated at a different time than the .map file.') @@ -538,10 +531,8 @@ if apk_path: metadata[models.METADATA_APK_FILENAME] = relative_to_out(apk_path) # Extraction takes around 1 second, so do it in parallel. - pool_of_one = multiprocessing.Pool(1) - apk_elf_result = pool_of_one.apply_async( - _ElfInfoFromApk, (apk_path, apk_so_path, lazy_paths.tool_prefix)) - pool_of_one.close() + apk_elf_result = helpers.ForkAndCall( + _ElfInfoFromApk, apk_path, apk_so_path, lazy_paths.tool_prefix) size_info = CreateSizeInfo( map_path, lazy_paths, no_source_paths=args.no_source_paths, raw_only=True)
diff --git a/tools/binary_size/libsupersize/helpers.py b/tools/binary_size/libsupersize/helpers.py index bddcd764..4379f82d 100644 --- a/tools/binary_size/libsupersize/helpers.py +++ b/tools/binary_size/libsupersize/helpers.py
@@ -4,8 +4,40 @@ """Utility methods.""" +import atexit +import multiprocessing import os +import threading SRC_ROOT = os.path.dirname( os.path.dirname(os.path.dirname(os.path.dirname(__file__)))) + + +def MakeProcessPool(*args): + """Wrapper for multiprocessing.Pool, with fix to terminate on exit.""" + ret = multiprocessing.Pool(*args) + def close_pool(): + ret.terminate() + + def on_exit(): + thread = threading.Thread(target=close_pool) + thread.daemon = True + thread.start() + + # Without calling terminate() on a separate thread, the call can block + # forever. + atexit.register(on_exit) + return ret + + +def ForkAndCall(func, *args, **kwargs): + """Uses multiprocessing to run the given function in a fork'ed process. + + Returns: + A Result object (call .get() to get the return value) + """ + pool_of_one = MakeProcessPool(1) + result = pool_of_one.apply_async(func, args=args, kwds=kwargs) + pool_of_one.close() + return result
diff --git a/tools/binary_size/libsupersize/ninja_parser.py b/tools/binary_size/libsupersize/ninja_parser.py index 6486c5e..22d5519 100644 --- a/tools/binary_size/libsupersize/ninja_parser.py +++ b/tools/binary_size/libsupersize/ninja_parser.py
@@ -14,68 +14,21 @@ _REGEX = re.compile(r'build ([^:]+?\.[ao]): \w+ (.*?)(?: \||\n|$)') -class SourceFileMapper(object): - def __init__(self, output_directory): - self._output_directory = output_directory - self._ninja_files_to_parse = ['build.ninja'] - self._seen_ninja_files = set(('build.ninja',)) - self._dep_map = {} +class _SourceMapper(object): + def __init__(self, dep_map, parsed_file_count): + self._dep_map = dep_map + self.parsed_file_count = parsed_file_count + self._unmatched_paths = set() - def _ParseNinja(self, path): - with open(os.path.join(self._output_directory, path)) as obj: - self._ParseNinjaLines(obj) - - def _ParseNinjaLines(self, lines): - dep_map = self._dep_map - sub_ninjas = [] - for line in lines: - if line.startswith('subninja '): - subpath = line[9:-1] - assert subpath not in self._seen_ninja_files, ( - 'Double include of ' + subpath) - self._seen_ninja_files.add(subpath) - sub_ninjas.append(subpath) - continue - m = _REGEX.match(line) - if m: - output, srcs = m.groups() - output = output.replace('\\ ', ' ') - assert output not in dep_map, 'Duplicate output: ' + output - if output[-1] == 'o': - dep_map[output] = srcs.replace('\\ ', ' ') - else: - srcs = srcs.replace('\\ ', '\b') - obj_paths = (s.replace('\b', ' ') for s in srcs.split(' ')) - dep_map[output] = {os.path.basename(p): p for p in obj_paths} - - # Add reversed so that the first on encoundered is at the top of the stack. - self._ninja_files_to_parse.extend(reversed(sub_ninjas)) - - def _Lookup(self, path): - """Looks for |path| within self._dep_map. - - If not found, continues to parse subninjas until it is found or there are no - more subninjas. - """ - ret = self._dep_map.get(path) - while not ret and self._ninja_files_to_parse: - self._ParseNinja(self._ninja_files_to_parse.pop()) - ret = self._dep_map.get(path) - return ret - - def FindSourceForPath(self, path): - """Returns the source path for the given object path (or None if not found). - - Paths for objects within archives should be in the format: foo/bar.a(baz.o) - """ + def _FindSourceForPathInternal(self, path): if not path.endswith(')'): - return self._Lookup(path) + return self._dep_map.get(path) # foo/bar.a(baz.o) start_idx = path.index('(') lib_name = path[:start_idx] obj_name = path[start_idx + 1:-1] - by_basename = self._Lookup(lib_name) + by_basename = self._dep_map.get(lib_name) if not by_basename: return None obj_path = by_basename.get(obj_name) @@ -83,7 +36,56 @@ # Found the library, but it doesn't list the .o file. logging.warning('no obj basename for %s', path) return None - return self._Lookup(obj_path) + return self._dep_map.get(obj_path) - def GetParsedFileCount(self): - return len(self._seen_ninja_files) + def FindSourceForPath(self, path): + """Returns the source path for the given object path (or None if not found). + + Paths for objects within archives should be in the format: foo/bar.a(baz.o) + """ + ret = self._FindSourceForPathInternal(path) + if not ret and path not in self._unmatched_paths: + if self.unmatched_paths_count < 10: + logging.warning('Could not find source path for %s', path) + self._unmatched_paths.add(path) + return ret + + @property + def unmatched_paths_count(self): + return len(self._unmatched_paths) + + +def _ParseOneFile(lines, dep_map): + sub_ninjas = [] + for line in lines: + if line.startswith('subninja '): + sub_ninjas.append(line[9:-1]) + continue + m = _REGEX.match(line) + if m: + output, srcs = m.groups() + output = output.replace('\\ ', ' ') + assert output not in dep_map, 'Duplicate output: ' + output + if output[-1] == 'o': + dep_map[output] = srcs.replace('\\ ', ' ') + else: + srcs = srcs.replace('\\ ', '\b') + obj_paths = (s.replace('\b', ' ') for s in srcs.split(' ')) + dep_map[output] = {os.path.basename(p): p for p in obj_paths} + return sub_ninjas + + +def Parse(output_directory): + to_parse = ['build.ninja'] + seen_paths = set(to_parse) + dep_map = {} + while to_parse: + path = os.path.join(output_directory, to_parse.pop()) + with open(path) as obj: + sub_ninjas = _ParseOneFile(obj, dep_map) + for subpath in sub_ninjas: + assert subpath not in seen_paths, 'Double include of ' + subpath + seen_paths.add(subpath) + to_parse.extend(sub_ninjas) + + return _SourceMapper(dep_map, len(seen_paths))
diff --git a/tools/mb/mb.py b/tools/mb/mb.py index 16cb1fa..1aea7a384 100755 --- a/tools/mb/mb.py +++ b/tools/mb/mb.py
@@ -853,6 +853,11 @@ runtime_deps_targets = [ target + '.runtime_deps', 'obj/%s.stamp.runtime_deps' % label.replace(':', '/')] + elif isolate_map[target]['type'] == 'gpu_browser_test': + if self.platform == 'win32': + runtime_deps_targets = ['browser_tests.exe.runtime_deps'] + else: + runtime_deps_targets = ['browser_tests.runtime_deps'] elif (isolate_map[target]['type'] == 'script' or isolate_map[target].get('label_type') == 'group'): # For script targets, the build target is usually a group, @@ -1120,6 +1125,19 @@ '--msan=%d' % msan, '--tsan=%d' % tsan, ] + elif test_type == 'gpu_browser_test': + extra_files = [ + '../../testing/test_env.py' + ] + gtest_filter = isolate_map[target]['gtest_filter'] + cmdline = [ + '../../testing/test_env.py', + './browser_tests' + executable_suffix, + '--test-launcher-bot-mode', + '--enable-gpu', + '--test-launcher-jobs=1', + '--gtest_filter=%s' % gtest_filter, + ] elif test_type == 'script': extra_files = [ '../../testing/test_env.py' @@ -1268,19 +1286,16 @@ return 0 gn_inp = {} - gn_inp['files'] = sorted(['//' + f for f in inp['files'] - if not f.startswith('//')]) + gn_inp['files'] = ['//' + f for f in inp['files'] if not f.startswith('//')] isolate_map = self.ReadIsolateMap() err, gn_inp['additional_compile_targets'] = self.MapTargetsToLabels( isolate_map, inp['additional_compile_targets']) - gn_inp['additional_compile_targets'].sort() if err: raise MBErr(err) err, gn_inp['test_targets'] = self.MapTargetsToLabels( isolate_map, inp['test_targets']) - gn_inp['test_targets'].sort() if err: raise MBErr(err) labels_to_targets = {}
diff --git a/ui/gl/gl_image.cc b/ui/gl/gl_image.cc index 8525c6c..c11006d 100644 --- a/ui/gl/gl_image.cc +++ b/ui/gl/gl_image.cc
@@ -6,11 +6,6 @@ namespace gl { -bool GLImage::BindTexImageWithInternalformat(unsigned target, - unsigned internalformat) { - return false; -} - bool GLImage::EmulatingRGB() const { return false; }
diff --git a/ui/gl/gl_image.h b/ui/gl/gl_image.h index be3d6f4c..f0d0842 100644 --- a/ui/gl/gl_image.h +++ b/ui/gl/gl_image.h
@@ -43,13 +43,6 @@ // It is valid for an implementation to always return false. virtual bool BindTexImage(unsigned target) = 0; - // Bind image to texture currently bound to |target|, forcing the texture's - // internal format to the specified one. This is a feature not available on - // all platforms. Returns true on success. It is valid for an implementation - // to always return false. - virtual bool BindTexImageWithInternalformat(unsigned target, - unsigned internalformat); - // Release image from texture currently bound to |target|. virtual void ReleaseTexImage(unsigned target) = 0;
diff --git a/ui/gl/gl_image_io_surface.h b/ui/gl/gl_image_io_surface.h index 9cffcec..70962e6d 100644 --- a/ui/gl/gl_image_io_surface.h +++ b/ui/gl/gl_image_io_surface.h
@@ -45,8 +45,6 @@ gfx::Size GetSize() override; unsigned GetInternalFormat() override; bool BindTexImage(unsigned target) override; - bool BindTexImageWithInternalformat(unsigned target, - unsigned internalformat) override; void ReleaseTexImage(unsigned target) override {} bool CopyTexImage(unsigned target) override; bool CopyTexSubImage(unsigned target,
diff --git a/ui/gl/gl_image_io_surface.mm b/ui/gl/gl_image_io_surface.mm index fc4df49..8e20830 100644 --- a/ui/gl/gl_image_io_surface.mm +++ b/ui/gl/gl_image_io_surface.mm
@@ -168,9 +168,8 @@ } // When an IOSurface is bound to a texture with internalformat "GL_RGB", many -// OpenGL operations are broken. Therefore, don't allow an IOSurface to be bound -// with GL_RGB unless overridden via BindTexImageWithInternalformat. -// crbug.com/595948, crbug.com/699566. +// OpenGL operations are broken. Therefore, never allow an IOSurface to be bound +// with GL_RGB. https://crbug.com/595948. GLenum ConvertRequestedInternalFormat(GLenum internalformat) { if (internalformat == GL_RGB) return GL_RGBA; @@ -238,11 +237,6 @@ } bool GLImageIOSurface::BindTexImage(unsigned target) { - return BindTexImageWithInternalformat(target, 0); -} - -bool GLImageIOSurface::BindTexImageWithInternalformat(unsigned target, - unsigned internalformat) { DCHECK(thread_checker_.CalledOnValidThread()); TRACE_EVENT0("gpu", "GLImageIOSurface::BindTexImage"); base::TimeTicks start_time = base::TimeTicks::Now(); @@ -264,12 +258,10 @@ static_cast<CGLContextObj>(GLContext::GetCurrent()->GetHandle()); DCHECK(io_surface_); - - GLenum texture_format = - internalformat ? internalformat : TextureFormat(format_); - CGLError cgl_error = CGLTexImageIOSurface2D( - cgl_context, target, texture_format, size_.width(), size_.height(), - DataFormat(format_), DataType(format_), io_surface_.get(), 0); + CGLError cgl_error = + CGLTexImageIOSurface2D(cgl_context, target, TextureFormat(format_), + size_.width(), size_.height(), DataFormat(format_), + DataType(format_), io_surface_.get(), 0); if (cgl_error != kCGLNoError) { LOG(ERROR) << "Error in CGLTexImageIOSurface2D: " << CGLErrorString(cgl_error);
diff --git a/ui/native_theme/native_theme_mac.h b/ui/native_theme/native_theme_mac.h index e7ad9d31..be23493 100644 --- a/ui/native_theme/native_theme_mac.h +++ b/ui/native_theme/native_theme_mac.h
@@ -46,15 +46,6 @@ const gfx::Rect& rect, const MenuItemExtraParams& menu_item) const override; - // Creates a shader appropriate for painting the background of a button. - static sk_sp<SkShader> GetButtonBackgroundShader(ButtonBackgroundType type, - int height); - - // Creates a shader for the button border. This should be painted over with - // the background after insetting the rounded rect. - static sk_sp<SkShader> GetButtonBorderShader(ButtonBackgroundType type, - int height); - // Paints the styled button shape used for default controls on Mac. The basic // style is used for dialog buttons, comboboxes, and tabbed pane tabs. // Depending on the control part being drawn, the left or the right side can
diff --git a/ui/native_theme/native_theme_mac.mm b/ui/native_theme/native_theme_mac.mm index 7611a11..5b46fbb4 100644 --- a/ui/native_theme/native_theme_mac.mm +++ b/ui/native_theme/native_theme_mac.mm
@@ -8,18 +8,11 @@ #include <stddef.h> #include "base/mac/mac_util.h" -#include "base/mac/scoped_cftyperef.h" #include "base/mac/sdk_forward_declarations.h" #include "base/macros.h" #import "skia/ext/skia_utils_mac.h" -#include "third_party/skia/include/core/SkDrawLooper.h" -#include "third_party/skia/include/core/SkRRect.h" -#include "third_party/skia/include/effects/SkGradientShader.h" #include "ui/base/material_design/material_design_controller.h" -#include "ui/gfx/color_palette.h" #include "ui/gfx/geometry/rect.h" -#include "ui/gfx/shadow_value.h" -#include "ui/gfx/skia_paint_util.h" #include "ui/gfx/skia_util.h" #include "ui/native_theme/common_theme.h" @@ -286,151 +279,6 @@ } } -// static -sk_sp<SkShader> NativeThemeMac::GetButtonBackgroundShader( - ButtonBackgroundType type, - int height) { - using ColorByState = EnumArray<ButtonBackgroundType, SkColor>; - SkPoint gradient_points[2]; - gradient_points[0].iset(0, 0); - gradient_points[1].iset(0, height); - - SkScalar gradient_positions[] = { 0.0, 1.0 }; - - // These hex values are directly from the detailed specs in - // https://crbug.com/543683. - const SkColor kGrey = SkColorSetRGB(0xf6, 0xf6, 0xf6); - const SkColor kBlueStart = SkColorSetRGB(0x6b, 0xb3, 0xfa); - const SkColor kBlueEnd = SkColorSetRGB(0x07, 0x7d, 0xff); - const SkColor kPressedBlueStart = SkColorSetRGB(0x3e, 0x8b, 0xf6); - const SkColor kPressedBlueEnd = SkColorSetRGB(0x03, 0x51, 0xff); - - ColorByState start_colors; - start_colors[ButtonBackgroundType::DISABLED] = kGrey; - start_colors[ButtonBackgroundType::HIGHLIGHTED] = kBlueStart; - start_colors[ButtonBackgroundType::NORMAL] = SK_ColorWHITE; - start_colors[ButtonBackgroundType::PRESSED] = kPressedBlueStart; - - ColorByState end_colors; - end_colors[ButtonBackgroundType::DISABLED] = kGrey; - end_colors[ButtonBackgroundType::HIGHLIGHTED] = kBlueEnd; - end_colors[ButtonBackgroundType::NORMAL] = SK_ColorWHITE; - end_colors[ButtonBackgroundType::PRESSED] = kPressedBlueEnd; - - SkColor gradient_colors[] = {start_colors[type], end_colors[type]}; - - for (size_t i = 0; i < arraysize(gradient_colors); ++i) - gradient_colors[i] = ApplySystemControlTint(gradient_colors[i]); - - return SkGradientShader::MakeLinear( - gradient_points, gradient_colors, gradient_positions, - arraysize(gradient_positions), - SkShader::kClamp_TileMode); -} - -// static -sk_sp<SkShader> NativeThemeMac::GetButtonBorderShader(ButtonBackgroundType type, - int height) { - using ColorByState = EnumArray<ButtonBackgroundType, SkColor>; - SkPoint gradient_points[2]; - gradient_points[0].iset(0, 0); - gradient_points[1].iset(0, height); - - // Two positions works well for pressed and highlighted, but the side edges of - // disabled and normal are more heavily weighted at the top and bottom. - // TODO(tapted): Use more positions for normal and disabled. - SkScalar gradient_positions[] = {0.0, 1.0}; - - ColorByState top_edge; - top_edge[ButtonBackgroundType::DISABLED] = SkColorSetRGB(0xd2, 0xc2, 0xc2); - top_edge[ButtonBackgroundType::HIGHLIGHTED] = SkColorSetRGB(0x6a, 0x9f, 0xff); - top_edge[ButtonBackgroundType::NORMAL] = SkColorSetRGB(0xcc, 0xcc, 0xcc); - top_edge[ButtonBackgroundType::PRESSED] = SkColorSetRGB(0x4f, 0x72, 0xfb); - ColorByState bottom_edge; - bottom_edge[ButtonBackgroundType::DISABLED] = SkColorSetRGB(0xbe, 0xbe, 0xbe); - bottom_edge[ButtonBackgroundType::HIGHLIGHTED] = - SkColorSetRGB(0x43, 0x52, 0xff); - bottom_edge[ButtonBackgroundType::NORMAL] = SkColorSetRGB(0x9d, 0x9d, 0x9d); - bottom_edge[ButtonBackgroundType::PRESSED] = SkColorSetRGB(0x3e, 0x12, 0xff); - - SkColor gradient_colors[] = {top_edge[type], bottom_edge[type]}; - - for (size_t i = 0; i < arraysize(gradient_colors); ++i) - gradient_colors[i] = ApplySystemControlTint(gradient_colors[i]); - - return SkGradientShader::MakeLinear( - gradient_points, gradient_colors, gradient_positions, - arraysize(gradient_positions), SkShader::kClamp_TileMode); -} - -// static -void NativeThemeMac::PaintStyledGradientButton(cc::PaintCanvas* canvas, - const gfx::Rect& integer_bounds, - ButtonBackgroundType type, - bool round_left, - bool round_right, - bool focus) { - const SkScalar kBorderThickness = 1; - const SkScalar kFocusRingThickness = 4; - const SkColor kFocusRingColor = ApplySystemControlTint( - SkColorSetARGB(0x94, 0x79, 0xa7, 0xe9)); - - const SkVector kNoCurve = {0, 0}; - const SkVector kCurve = {kButtonCornerRadius, kButtonCornerRadius}; - const SkVector kLeftCurves[4] = {kCurve, kNoCurve, kNoCurve, kCurve}; - const SkVector kRightCurves[4] = {kNoCurve, kCurve, kCurve, kNoCurve}; - - const SkScalar kShadowOffsetY = 1; - const SkColor kShadowColor = SkColorSetA(SK_ColorBLACK, 0x05); - const double kShadowBlur = 0.0; - const std::vector<gfx::ShadowValue> shadows( - 1, gfx::ShadowValue(gfx::Vector2d(0, kShadowOffsetY), kShadowBlur, - kShadowColor)); - - SkRect bounds = gfx::RectToSkRect(integer_bounds); - - // Inset to account for the focus ring. Note it draws over the border stroke. - bounds.inset(kFocusRingThickness - kBorderThickness, - kFocusRingThickness - kBorderThickness); - - SkRRect shape; - if (round_left && round_right) - shape.setRectXY(bounds, kButtonCornerRadius, kButtonCornerRadius); - else if (round_left) - shape.setRectRadii(bounds, kLeftCurves); - else if (round_right) - shape.setRectRadii(bounds, kRightCurves); - else - shape.setRect(bounds); - - cc::PaintFlags flags; - flags.setStyle(cc::PaintFlags::kFill_Style); - flags.setAntiAlias(true); - - // First draw the darker "outer" border, with its gradient and shadow. Inside - // a tab strip, this will draw over the outer border and inner separator. - flags.setLooper(gfx::CreateShadowDrawLooper(shadows)); - flags.setShader( - cc::WrapSkShader(GetButtonBorderShader(type, shape.height()))); - canvas->drawRRect(shape, flags); - - // Then, inset the rounded rect and draw over that with the inner gradient. - shape.inset(kBorderThickness, kBorderThickness); - flags.setLooper(nullptr); - flags.setShader( - cc::WrapSkShader(GetButtonBackgroundShader(type, shape.height()))); - canvas->drawRRect(shape, flags); - - if (!focus) - return; - - SkRRect outer_shape; - shape.outset(kFocusRingThickness, kFocusRingThickness, &outer_shape); - flags.setShader(nullptr); - flags.setColor(kFocusRingColor); - canvas->drawDRRect(outer_shape, shape, flags); -} - NativeThemeMac::NativeThemeMac() { }
diff --git a/ui/views/animation/ink_drop_host_view.cc b/ui/views/animation/ink_drop_host_view.cc index 5cdaedb..789f1b5e 100644 --- a/ui/views/animation/ink_drop_host_view.cc +++ b/ui/views/animation/ink_drop_host_view.cc
@@ -15,6 +15,7 @@ #include "ui/views/animation/ink_drop_mask.h" #include "ui/views/animation/ink_drop_stub.h" #include "ui/views/animation/square_ink_drop_ripple.h" +#include "ui/views/style/platform_style.h" namespace views { namespace { @@ -271,7 +272,7 @@ InkDrop* InkDropHostView::GetInkDrop() { if (!ink_drop_) { - if (ink_drop_mode_ == InkDropMode::OFF) + if (ink_drop_mode_ == InkDropMode::OFF || !PlatformStyle::kUseRipples) ink_drop_ = base::MakeUnique<InkDropStub>(); else ink_drop_ = CreateInkDrop();
diff --git a/ui/views/controls/button/checkbox.cc b/ui/views/controls/button/checkbox.cc index acef051..e5bc894f1 100644 --- a/ui/views/controls/button/checkbox.cc +++ b/ui/views/controls/button/checkbox.cc
@@ -37,8 +37,7 @@ if (UseMd()) { set_request_focus_on_press(false); - SetInkDropMode(PlatformStyle::kUseRipples ? InkDropMode::ON - : InkDropMode::OFF); + SetInkDropMode(InkDropMode::ON); set_has_ink_drop_action_on_click(true); } else { std::unique_ptr<LabelButtonBorder> button_border(new LabelButtonBorder());
diff --git a/ui/views/controls/button/md_text_button.cc b/ui/views/controls/button/md_text_button.cc index 9e9e780..f208999 100644 --- a/ui/views/controls/button/md_text_button.cc +++ b/ui/views/controls/button/md_text_button.cc
@@ -188,8 +188,7 @@ MdTextButton::MdTextButton(ButtonListener* listener) : LabelButton(listener, base::string16()), is_prominent_(false) { - SetInkDropMode(PlatformStyle::kUseRipples ? InkDropMode::ON - : InkDropMode::OFF); + SetInkDropMode(InkDropMode::ON); set_has_ink_drop_action_on_click(true); SetHorizontalAlignment(gfx::ALIGN_CENTER); SetFocusForPlatform();
diff --git a/ui/views/controls/combobox/combobox.cc b/ui/views/controls/combobox/combobox.cc index f9c1c2d..6781ecb 100644 --- a/ui/views/controls/combobox/combobox.cc +++ b/ui/views/controls/combobox/combobox.cc
@@ -123,8 +123,7 @@ set_notify_action(PlatformStyle::kMenuNotifyActivationAction); if (UseMd()) { - SetInkDropMode(PlatformStyle::kUseRipples ? InkDropMode::ON - : InkDropMode::OFF); + SetInkDropMode(InkDropMode::ON); set_has_ink_drop_action_on_click(true); } }