diff --git a/DEPS b/DEPS index a483d00..9ee6942 100644 --- a/DEPS +++ b/DEPS
@@ -40,7 +40,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Skia # and whatever else without interference from each other. - 'skia_revision': 'bc7a4fb06780f9829b4b21470fe6f0503d2297cd', + 'skia_revision': '7717d4a343bad38017c91459f1637868844bda47', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. @@ -192,7 +192,7 @@ Var('chromium_git') + '/external/bidichecker/lib.git' + '@' + '97f2aa645b74c28c57eca56992235c79850fa9e0', 'src/third_party/webgl/src': - Var('chromium_git') + '/external/khronosgroup/webgl.git' + '@' + '9b0c9deb177ff875792ad19bf925418eb890f735', + Var('chromium_git') + '/external/khronosgroup/webgl.git' + '@' + '3c655cc7cfb2e22f3f8595a5d54171ad9382980a', 'src/third_party/webdriver/pylib': Var('chromium_git') + '/external/selenium/py.git' + '@' + '5fd78261a75fe08d27ca4835fb6c5ce4b42275bd',
diff --git a/WATCHLISTS b/WATCHLISTS index f512b4a..2cfc1a6d 100644 --- a/WATCHLISTS +++ b/WATCHLISTS
@@ -532,7 +532,7 @@ 'ui/events/blink/' }, 'installer': { - 'filepath': 'chrome/installer/', + 'filepath': 'chrome/install(_static|er)/', }, 'installer_linux': { 'filepath': 'chrome/installer/linux/',
diff --git a/base/android/java/src/org/chromium/base/metrics/RecordHistogram.java b/base/android/java/src/org/chromium/base/metrics/RecordHistogram.java index c51cf58..eaf57b7 100644 --- a/base/android/java/src/org/chromium/base/metrics/RecordHistogram.java +++ b/base/android/java/src/org/chromium/base/metrics/RecordHistogram.java
@@ -25,16 +25,23 @@ */ @JNINamespace("base::android") public class RecordHistogram { - private static boolean sIsDisabledForTests; + private static Throwable sDisabledBy; private static Map<String, Long> sCache = Collections.synchronizedMap(new HashMap<String, Long>()); /** - * Tests may not have native initialized, so they may need to disable metrics. + * Tests may not have native initialized, so they may need to disable metrics. The value should + * be reset after the test done, to avoid carrying over state to unrelated tests. + * + * In JUnit tests this can be done automatically using + * {@link org.chromium.chrome.browser.DisableHistogramsRule} */ @VisibleForTesting - public static void disableForTests() { - sIsDisabledForTests = true; + public static void setDisabledForTests(boolean disabled) { + if (disabled && sDisabledBy != null) { + throw new IllegalStateException("Histograms are already disabled.", sDisabledBy); + } + sDisabledBy = disabled ? new Throwable() : null; } private static long getCachedHistogramKey(String name) { @@ -54,7 +61,7 @@ * @param sample sample to be recorded, either true or false */ public static void recordBooleanHistogram(String name, boolean sample) { - if (sIsDisabledForTests) return; + if (sDisabledBy != null) return; long key = getCachedHistogramKey(name); long result = nativeRecordBooleanHistogram(name, key, sample); if (result != key) sCache.put(name, result); @@ -70,7 +77,7 @@ * lower than |boundary| */ public static void recordEnumeratedHistogram(String name, int sample, int boundary) { - if (sIsDisabledForTests) return; + if (sDisabledBy != null) return; long key = getCachedHistogramKey(name); long result = nativeRecordEnumeratedHistogram(name, key, sample, boundary); if (result != key) sCache.put(name, result); @@ -117,7 +124,7 @@ */ public static void recordCustomCountHistogram( String name, int sample, int min, int max, int numBuckets) { - if (sIsDisabledForTests) return; + if (sDisabledBy != null) return; long key = getCachedHistogramKey(name); long result = nativeRecordCustomCountHistogram(name, key, sample, min, max, numBuckets); if (result != key) sCache.put(name, result); @@ -134,7 +141,7 @@ */ public static void recordLinearCountHistogram( String name, int sample, int min, int max, int numBuckets) { - if (sIsDisabledForTests) return; + if (sDisabledBy != null) return; long key = getCachedHistogramKey(name); long result = nativeRecordLinearCountHistogram(name, key, sample, min, max, numBuckets); if (result != key) sCache.put(name, result); @@ -147,7 +154,7 @@ * @param sample sample to be recorded, at least 0 and at most 100. */ public static void recordPercentageHistogram(String name, int sample) { - if (sIsDisabledForTests) return; + if (sDisabledBy != null) return; long key = getCachedHistogramKey(name); long result = nativeRecordEnumeratedHistogram(name, key, sample, 101); if (result != key) sCache.put(name, result); @@ -160,7 +167,7 @@ * values. */ public static void recordSparseSlowlyHistogram(String name, int sample) { - if (sIsDisabledForTests) return; + if (sDisabledBy != null) return; long key = getCachedHistogramKey(name); long result = nativeRecordSparseHistogram(name, key, sample); if (result != key) sCache.put(name, result); @@ -241,7 +248,7 @@ private static void recordCustomTimesHistogramMilliseconds( String name, long duration, long min, long max, int numBuckets) { - if (sIsDisabledForTests) return; + if (sDisabledBy != null) return; long key = getCachedHistogramKey(name); // Note: Duration, min and max are clamped to int here because that's what's expected by // the native histograms API. Callers of these functions still pass longs because that's @@ -266,7 +273,7 @@ * Initializes the metrics system. */ public static void initialize() { - if (sIsDisabledForTests) return; + if (sDisabledBy != null) return; nativeInitialize(); }
diff --git a/base/android/java/src/org/chromium/base/metrics/RecordUserAction.java b/base/android/java/src/org/chromium/base/metrics/RecordUserAction.java index 3b294c7..06004d69 100644 --- a/base/android/java/src/org/chromium/base/metrics/RecordUserAction.java +++ b/base/android/java/src/org/chromium/base/metrics/RecordUserAction.java
@@ -5,7 +5,6 @@ package org.chromium.base.metrics; import org.chromium.base.ThreadUtils; -import org.chromium.base.VisibleForTesting; import org.chromium.base.annotations.JNINamespace; /** @@ -19,19 +18,7 @@ */ @JNINamespace("base::android") public class RecordUserAction { - private static boolean sIsDisabledForTests; - - /** - * Tests may not have native initialized, so they may need to disable metrics. - */ - @VisibleForTesting - public static void disableForTests() { - sIsDisabledForTests = true; - } - public static void record(final String action) { - if (sIsDisabledForTests) return; - if (ThreadUtils.runningOnUiThread()) { nativeRecordUserAction(action); return;
diff --git a/build/config/sanitizers/BUILD.gn b/build/config/sanitizers/BUILD.gn index e742546..a68fc8bf 100644 --- a/build/config/sanitizers/BUILD.gn +++ b/build/config/sanitizers/BUILD.gn
@@ -200,6 +200,9 @@ ldflags = [] if (is_asan) { ldflags += [ "-fsanitize=address" ] + if (!is_mac && !is_chromeos) { + ldflags += [ "-fsanitize-address-use-after-scope" ] + } } if (is_lsan) { ldflags += [ "-fsanitize=leak" ] @@ -309,6 +312,9 @@ cflags = [] if (is_asan) { cflags += [ "-fsanitize=address" ] + if (!is_mac && !is_chromeos && !is_win) { + cflags += [ "-fsanitize-address-use-after-scope" ] + } if (!asan_globals) { cflags += [ "-mllvm",
diff --git a/build_overrides/v8.gni b/build_overrides/v8.gni index 59132e3c..b174fa0 100644 --- a/build_overrides/v8.gni +++ b/build_overrides/v8.gni
@@ -23,3 +23,5 @@ [ "//third_party/WebKit/Source/core/streams/WritableStream.js" ] v8_enable_inspector_override = true +v8_enable_gdbjit = false +v8_imminent_deprecation_warnings_default = false
diff --git a/chrome/android/java/res/xml/autofill_and_payments_preference_fragment_screen.xml b/chrome/android/java/res/xml/autofill_and_payments_preference_fragment_screen.xml new file mode 100644 index 0000000..bdeeb73f --- /dev/null +++ b/chrome/android/java/res/xml/autofill_and_payments_preference_fragment_screen.xml
@@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright 2017 The Chromium Authors. All rights reserved. + Use of this source code is governed by a BSD-style license that can be + found in the LICENSE file. --> + +<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" /> \ No newline at end of file
diff --git a/chrome/android/java/res/xml/autofill_and_payments_preferences.xml b/chrome/android/java/res/xml/autofill_and_payments_preferences.xml new file mode 100644 index 0000000..71a81f2 --- /dev/null +++ b/chrome/android/java/res/xml/autofill_and_payments_preferences.xml
@@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright 2017 The Chromium Authors. All rights reserved. + Use of this source code is governed by a BSD-style license that can be + found in the LICENSE file. --> + +<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> + + <org.chromium.chrome.browser.preferences.ChromeSwitchPreference + android:key="autofill_switch" + android:title="@string/autofill_switch" /> + + <Preference + android:title="@string/autofill_profiles_title" + android:fragment="org.chromium.chrome.browser.preferences.autofill.AutofillProfilesFragment" /> + + <Preference + android:title="@string/autofill_credit_cards_title" + android:fragment="org.chromium.chrome.browser.preferences.autofill.AutofillCreditCardsFragment" /> + +</PreferenceScreen> \ No newline at end of file
diff --git a/chrome/android/java/res/xml/autofill_preferences.xml b/chrome/android/java/res/xml/autofill_preferences.xml deleted file mode 100644 index c87ae8e..0000000 --- a/chrome/android/java/res/xml/autofill_preferences.xml +++ /dev/null
@@ -1,29 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright 2014 The Chromium Authors. All rights reserved. - Use of this source code is governed by a BSD-style license that can be - found in the LICENSE file. --> - -<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> - - <org.chromium.chrome.browser.preferences.ChromeSwitchPreference - android:key="autofill_switch" - android:summaryOn="@string/text_on" - android:summaryOff="@string/text_off" /> - - <org.chromium.chrome.browser.preferences.PreferenceCategoryWithButton - android:key="autofill_profiles" - android:enabled="true" - android:title="@string/autofill_profiles_title" - android:fragment="org.chromium.chrome.browser.preferences.autofill.AutofillProfileEditor" - android:contentDescription="@string/autofill_create_profile" - /> - - <org.chromium.chrome.browser.preferences.PreferenceCategoryWithButton - android:key="autofill_credit_cards" - android:enabled="true" - android:title="@string/autofill_credit_cards_title" - android:fragment="org.chromium.chrome.browser.preferences.autofill.AutofillLocalCardEditor" - android:contentDescription="@string/autofill_create_credit_card" - /> - -</PreferenceScreen>
diff --git a/chrome/android/java/res/xml/main_preferences.xml b/chrome/android/java/res/xml/main_preferences.xml index 30e4add..45979b6 100644 --- a/chrome/android/java/res/xml/main_preferences.xml +++ b/chrome/android/java/res/xml/main_preferences.xml
@@ -16,9 +16,9 @@ android:key="search_engine" android:title="@string/prefs_search_engine"/> <org.chromium.chrome.browser.preferences.ChromeBasePreference - android:fragment="org.chromium.chrome.browser.preferences.autofill.AutofillPreferences" + android:fragment="org.chromium.chrome.browser.preferences.autofill.AutofillAndPaymentsPreferences" android:key="autofill_settings" - android:title="@string/prefs_autofill" /> + android:title="@string/prefs_autofill_and_payments" /> <org.chromium.chrome.browser.preferences.ChromeBasePreference android:key="saved_passwords"/> <Preference
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java index 95a2c85..508246a8 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java
@@ -47,7 +47,7 @@ import org.chromium.chrome.browser.policy.PolicyAuditor; import org.chromium.chrome.browser.preferences.LocationSettings; import org.chromium.chrome.browser.preferences.PreferencesLauncher; -import org.chromium.chrome.browser.preferences.autofill.AutofillPreferences; +import org.chromium.chrome.browser.preferences.autofill.AutofillAndPaymentsPreferences; import org.chromium.chrome.browser.preferences.password.SavePasswordsPreferences; import org.chromium.chrome.browser.rlz.RevenueStats; import org.chromium.chrome.browser.services.AndroidEduOwnerCheckCallback; @@ -144,8 +144,8 @@ @CalledByNative protected void showAutofillSettings() { - PreferencesLauncher.launchSettingsPage(this, - AutofillPreferences.class.getName()); + PreferencesLauncher.launchSettingsPage( + this, AutofillAndPaymentsPreferences.class.getName()); } @CalledByNative
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/autofill/PersonalDataManager.java b/chrome/android/java/src/org/chromium/chrome/browser/autofill/PersonalDataManager.java index d0ec482..b4ee5f6d 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/autofill/PersonalDataManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/autofill/PersonalDataManager.java
@@ -12,7 +12,7 @@ import org.chromium.base.annotations.JNINamespace; import org.chromium.chrome.R; import org.chromium.chrome.browser.ResourceId; -import org.chromium.chrome.browser.preferences.autofill.AutofillPreferences; +import org.chromium.chrome.browser.preferences.autofill.AutofillAndPaymentsPreferences; import org.chromium.content_public.browser.WebContents; import java.util.ArrayList; @@ -131,7 +131,7 @@ * locale. All other fields are empty strings, because JNI does not handle null strings. */ public AutofillProfile() { - this("" /* guid */, AutofillPreferences.SETTINGS_ORIGIN /* origin */, + this("" /* guid */, AutofillAndPaymentsPreferences.SETTINGS_ORIGIN /* origin */, true /* isLocal */, "" /* fullName */, "" /* companyName */, "" /* streetAddress */, "" /* region */, "" /* locality */, "" /* dependentLocality */, "" /* postalCode */, "" /* sortingCode */, @@ -373,10 +373,11 @@ } public CreditCard() { - this("" /* guid */, AutofillPreferences.SETTINGS_ORIGIN /*origin */, true /* isLocal */, - false /* isCached */, "" /* name */, "" /* number */, "" /* obfuscatedNumber */, - "" /* month */, "" /* year */, "" /* basicCardPaymentType */, - 0 /* issuerIconDrawableId */, "" /* billingAddressId */, "" /* serverId */); + this("" /* guid */, AutofillAndPaymentsPreferences.SETTINGS_ORIGIN /*origin */, + true /* isLocal */, false /* isCached */, "" /* name */, "" /* number */, + "" /* obfuscatedNumber */, "" /* month */, "" /* year */, + "" /* basicCardPaymentType */, 0 /* issuerIconDrawableId */, + "" /* billingAddressId */, "" /* serverId */); } /** TODO(estade): remove this constructor. */ @@ -827,6 +828,24 @@ } /** + * Checks whether the Autofill PersonalDataManager has profiles. + * + * @return True If there are profiles. + */ + public boolean hasProfiles() { + return nativeHasProfiles(mPersonalDataManagerAndroid); + } + + /** + * Checks whether the Autofill PersonalDataManager has credit cards. + * + * @return True If there are credit cards. + */ + public boolean hasCreditCards() { + return nativeHasCreditCards(mPersonalDataManagerAndroid); + } + + /** * @return Whether the Autofill feature is enabled. */ public static boolean isAutofillEnabled() { @@ -940,6 +959,8 @@ String guid, String regionCode, NormalizedAddressRequestDelegate delegate); private native void nativeCancelPendingAddressNormalizations( long nativePersonalDataManagerAndroid); + private static native boolean nativeHasProfiles(long nativePersonalDataManagerAndroid); + private static native boolean nativeHasCreditCards(long nativePersonalDataManagerAndroid); private static native boolean nativeIsAutofillEnabled(); private static native void nativeSetAutofillEnabled(boolean enable); private static native boolean nativeIsAutofillManaged();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaNotificationManager.java b/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaNotificationManager.java index f13bd44..080fbf7 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaNotificationManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaNotificationManager.java
@@ -673,7 +673,10 @@ clearNotification(); } + @Nullable private MediaMetadataCompat createMetadata() { + if (mMediaNotificationInfo.isPrivate) return null; + MediaMetadataCompat.Builder metadataBuilder = new MediaMetadataCompat.Builder(); metadataBuilder.putString(MediaMetadataCompat.METADATA_KEY_TITLE,
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/InnerNode.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/InnerNode.java index a638260..9dd7967 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/InnerNode.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/InnerNode.java
@@ -71,10 +71,10 @@ } @Override - public void onBindViewHolder(NewTabPageViewHolder holder, int position, List<Object> payloads) { + public void onBindViewHolder(NewTabPageViewHolder holder, int position) { int index = getChildIndexForPosition(position); mChildren.get(index).onBindViewHolder( - holder, position - getStartingOffsetForChildIndex(index), payloads); + holder, position - getStartingOffsetForChildIndex(index)); } @Override
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/Leaf.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/Leaf.java index c512bfb7..0d984143 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/Leaf.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/Leaf.java
@@ -7,8 +7,6 @@ import org.chromium.base.Callback; import org.chromium.chrome.browser.ntp.snippets.SnippetArticle; -import java.util.List; - /** * A permanent leaf in the tree, i.e. a single item. * If the leaf is not to be a permanent member of the tree, see {@link OptionalLeaf} for an @@ -28,7 +26,7 @@ } @Override - public void onBindViewHolder(NewTabPageViewHolder holder, int position, List<Object> payload) { + public void onBindViewHolder(NewTabPageViewHolder holder, int position) { if (position != 0) throw new IndexOutOfBoundsException(); onBindViewHolder(holder); } @@ -53,7 +51,7 @@ /** * Display the data for this item. * @param holder The view holder that should be updated. - * @see #onBindViewHolder(NewTabPageViewHolder, int, List) + * @see #onBindViewHolder(NewTabPageViewHolder, int) * @see android.support.v7.widget.RecyclerView.Adapter#onBindViewHolder */ protected abstract void onBindViewHolder(NewTabPageViewHolder holder);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java index 9ee7337..373d773 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java
@@ -19,9 +19,9 @@ import org.chromium.chrome.browser.ntp.snippets.SnippetArticle; import org.chromium.chrome.browser.ntp.snippets.SnippetArticleViewHolder; import org.chromium.chrome.browser.offlinepages.OfflinePageBridge; +import org.chromium.chrome.browser.suggestions.PartialUpdateId; import org.chromium.chrome.browser.suggestions.SuggestionsUiDelegate; -import java.util.Collections; import java.util.List; /** @@ -142,12 +142,29 @@ @Override public void onBindViewHolder(NewTabPageViewHolder holder, int position, List<Object> payloads) { - mRoot.onBindViewHolder(holder, position, payloads); + if (payloads.isEmpty()) { + mRoot.onBindViewHolder(holder, position); + return; + } + + for (Object payload : payloads) { + @PartialUpdateId + int updateId = (int) payload; + + switch (updateId) { + case PartialUpdateId.OFFLINE_BADGE: + assert holder instanceof SnippetArticleViewHolder; + ((SnippetArticleViewHolder) holder).refreshOfflineBadgeVisibility(); + break; + default: + assert false; // Unknown payload + } + } } @Override public void onBindViewHolder(NewTabPageViewHolder holder, final int position) { - mRoot.onBindViewHolder(holder, position, Collections.emptyList()); + mRoot.onBindViewHolder(holder, position); } @Override
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/OptionalLeaf.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/OptionalLeaf.java index 1411c1e..fe95e48 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/OptionalLeaf.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/OptionalLeaf.java
@@ -9,8 +9,6 @@ import org.chromium.base.Callback; import org.chromium.chrome.browser.ntp.snippets.SnippetArticle; -import java.util.List; - /** * An optional leaf (i.e. single item) in the tree. Depending on its internal state (see * {@link #isVisible()}), the item will be present or absent from the tree, by manipulating the @@ -34,7 +32,7 @@ } @Override - public void onBindViewHolder(NewTabPageViewHolder holder, int position, List<Object> payload) { + public void onBindViewHolder(NewTabPageViewHolder holder, int position) { checkIndex(position); onBindViewHolder(holder); } @@ -82,7 +80,7 @@ /** * Display the data for this item. * @param holder The view holder that should be updated. - * @see #onBindViewHolder(NewTabPageViewHolder, int, List) + * @see #onBindViewHolder(NewTabPageViewHolder, int) * @see android.support.v7.widget.RecyclerView.Adapter#onBindViewHolder */ protected abstract void onBindViewHolder(NewTabPageViewHolder holder);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java index a74ae55..156bb65 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java
@@ -19,6 +19,7 @@ import org.chromium.chrome.browser.offlinepages.ClientId; import org.chromium.chrome.browser.offlinepages.OfflinePageBridge; import org.chromium.chrome.browser.offlinepages.OfflinePageItem; +import org.chromium.chrome.browser.suggestions.PartialUpdateId; import org.chromium.chrome.browser.suggestions.SuggestionsRanker; import org.chromium.chrome.browser.suggestions.SuggestionsUiDelegate; @@ -104,14 +105,12 @@ } @Override - public void onBindViewHolder( - NewTabPageViewHolder holder, int position, List<Object> payloads) { + public void onBindViewHolder(NewTabPageViewHolder holder, int position) { checkIndex(position); assert holder instanceof SnippetArticleViewHolder; SnippetArticle suggestion = getSuggestionAt(position); mSuggestionsRanker.rankSuggestion(suggestion); - ((SnippetArticleViewHolder) holder) - .onBindViewHolder(suggestion, mCategoryInfo, payloads); + ((SnippetArticleViewHolder) holder).onBindViewHolder(suggestion, mCategoryInfo); } @Override @@ -190,7 +189,7 @@ article.setOfflinePageOfflineId(newId); if ((oldId == null) == (newId == null)) return; - notifyItemChanged(index, SnippetArticleViewHolder.PARTIAL_UPDATE_OFFLINE_ID); + notifyItemChanged(index, PartialUpdateId.OFFLINE_BADGE); } } @@ -256,8 +255,8 @@ } @Override - public void onBindViewHolder(NewTabPageViewHolder holder, int position, List<Object> payloads) { - super.onBindViewHolder(holder, position, payloads); + public void onBindViewHolder(NewTabPageViewHolder holder, int position) { + super.onBindViewHolder(holder, position); childSeen(position); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/TreeNode.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/TreeNode.java index 6d9eb7e..c08736c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/TreeNode.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/TreeNode.java
@@ -7,8 +7,6 @@ import org.chromium.base.Callback; import org.chromium.chrome.browser.ntp.snippets.SnippetArticle; -import java.util.List; - /** * A tree interface to allow the New Tab Page RecyclerView to delegate to other components. */ @@ -38,13 +36,12 @@ int getItemViewType(int position); /** - * Display the data at {@code position} under this subtree, making a partial update based on - * the {@code payload} data. + * Display the data at {@code position} under this subtree. * @param holder The view holder that should be updated. * @param position The position of the item under this subtree. - * @see android.support.v7.widget.RecyclerView.Adapter#onBindViewHolder(ViewHolder, int, List) + * @see android.support.v7.widget.RecyclerView.Adapter#onBindViewHolder(ViewHolder, int) */ - void onBindViewHolder(NewTabPageViewHolder holder, int position, List<Object> payloads); + void onBindViewHolder(NewTabPageViewHolder holder, int position); /** * @param position The position to query.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticleViewHolder.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticleViewHolder.java index a96cbd38..231225b 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticleViewHolder.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticleViewHolder.java
@@ -43,7 +43,6 @@ import java.net.URI; import java.net.URISyntaxException; -import java.util.List; import java.util.concurrent.TimeUnit; /** @@ -57,8 +56,6 @@ private static final String FAVICON_SERVICE_FORMAT = "https://s2.googleusercontent.com/s2/favicons?domain=%s&src=chrome_newtab_mobile&sz=%d&alt=404"; - public static final int PARTIAL_UPDATE_OFFLINE_ID = 1; - private final SuggestionsUiDelegate mUiDelegate; private final TextView mHeadlineTextView; private final TextView mPublisherTextView; @@ -227,13 +224,7 @@ BidiFormatter.getInstance().unicodeWrap(article.mPublisher), relativeTimeSpan); } - public void onBindViewHolder( - SnippetArticle article, SuggestionsCategoryInfo categoryInfo, List<Object> payloads) { - if (!payloads.isEmpty() && article.equals(mArticle)) { - performPartialBind(payloads); - return; - } - + public void onBindViewHolder(SnippetArticle article, SuggestionsCategoryInfo categoryInfo) { super.onBindViewHolder(); mArticle = article; @@ -279,19 +270,14 @@ mRecyclerView.onSnippetBound(itemView); } - private void refreshOfflineBadgeVisibility() { + /** Updates the visibility of the card's offline badge by checking the bound article's info. */ + public void refreshOfflineBadgeVisibility() { if (!SnippetsConfig.isOfflineBadgeEnabled()) return; boolean visible = mArticle.getOfflinePageOfflineId() != null || mArticle.mIsAssetDownload; if (visible == (mOfflineBadge.getVisibility() == View.VISIBLE)) return; mOfflineBadge.setVisibility(visible ? View.VISIBLE : View.GONE); } - private void performPartialBind(List<Object> payload) { - if (payload.contains(PARTIAL_UPDATE_OFFLINE_ID)) { - refreshOfflineBadgeVisibility(); - } - } - private static class FetchImageCallback extends Callback<Bitmap> { private SnippetArticleViewHolder mViewHolder; private final SnippetArticle mSnippet;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java index f0f2e26..72d09e98 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java
@@ -32,7 +32,7 @@ import org.chromium.chrome.browser.payments.ui.SectionInformation; import org.chromium.chrome.browser.payments.ui.ShoppingCart; import org.chromium.chrome.browser.preferences.PreferencesLauncher; -import org.chromium.chrome.browser.preferences.autofill.AutofillPreferences; +import org.chromium.chrome.browser.preferences.autofill.AutofillAndPaymentsPreferences; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tabmodel.EmptyTabModelObserver; @@ -1115,7 +1115,7 @@ @Override public void onCardAndAddressSettingsClicked() { Intent intent = PreferencesLauncher.createIntentForSettingsPage( - mContext, AutofillPreferences.class.getName()); + mContext, AutofillAndPaymentsPreferences.class.getName()); mContext.startActivity(intent); disconnectFromClientWithDebugMessage("Card and address settings clicked"); recordAbortReasonHistogram(PaymentRequestMetrics.ABORT_REASON_ABORTED_BY_USER);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/MainPreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/MainPreferences.java index a37d109..67d0934 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/MainPreferences.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/MainPreferences.java
@@ -109,7 +109,6 @@ ChromeBasePreference autofillPref = (ChromeBasePreference) findPreference(PREF_AUTOFILL_SETTINGS); - setOnOffSummary(autofillPref, PersonalDataManager.isAutofillEnabled()); autofillPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate); ChromeBasePreference passwordsPref =
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/PreferenceCategoryWithButton.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/PreferenceCategoryWithButton.java deleted file mode 100644 index adab1a86..0000000 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/PreferenceCategoryWithButton.java +++ /dev/null
@@ -1,58 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.chrome.browser.preferences; - -import android.content.Context; -import android.content.res.TypedArray; -import android.preference.Preference; -import android.preference.PreferenceGroup; -import android.text.TextUtils; -import android.util.AttributeSet; -import android.view.View; -import android.view.View.OnClickListener; - -import org.chromium.chrome.R; - -/** - * Used to group {@link Preference} objects and provide a disabled - * title above the group with an icon inline with the title. Clicking on the icon starts - * the PreferenceFragment associated with the Preference. - */ -public class PreferenceCategoryWithButton extends PreferenceGroup implements OnClickListener { - - private String mContentDescription; - - public PreferenceCategoryWithButton(Context context, AttributeSet attrs) { - super(context, attrs); - setLayoutResource(R.layout.preference_category); - setSelectable(false); - - TypedArray a = context.obtainStyledAttributes(attrs, - new int[] {android.R.attr.contentDescription}); - mContentDescription = a.getString(0); - a.recycle(); - } - - @Override - protected void onBindView(final View view) { - super.onBindView(view); - // On pre-L devices, PreferenceCategoryWithButtonStyle is reused for PreferenceCategory, - // which needs a top padding of 16dp; we don't want this top padding for - // PreferenceCategoryWithButton views. - view.setPadding(view.getPaddingLeft(), 0, view.getPaddingRight(), view.getPaddingBottom()); - View button = view.findViewById(android.R.id.icon); - button.setOnClickListener(this); - - if (!TextUtils.isEmpty(mContentDescription)) { - button.setContentDescription(mContentDescription); - } - } - - @Override - public void onClick(View v) { - ((Preferences) getContext()).startFragment(getFragment(), null); - } - -}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillAndPaymentsPreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillAndPaymentsPreferences.java new file mode 100644 index 0000000..2841b29 --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillAndPaymentsPreferences.java
@@ -0,0 +1,51 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.preferences.autofill; + +import android.os.Bundle; +import android.preference.Preference; +import android.preference.Preference.OnPreferenceChangeListener; +import android.preference.PreferenceFragment; + +import org.chromium.chrome.R; +import org.chromium.chrome.browser.autofill.PersonalDataManager; +import org.chromium.chrome.browser.preferences.ChromeSwitchPreference; + +/** + * Autofill and payments settings fragment, which allows the user to edit autofill and credit card + * profiles and control payment apps. + */ +public class AutofillAndPaymentsPreferences extends PreferenceFragment { + public static final String AUTOFILL_GUID = "guid"; + + // Needs to be in sync with kSettingsOrigin[] in + // chrome/browser/ui/webui/options/autofill_options_handler.cc + public static final String SETTINGS_ORIGIN = "Chrome settings"; + private static final String PREF_AUTOFILL_SWITCH = "autofill_switch"; + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + addPreferencesFromResource(R.xml.autofill_and_payments_preferences); + getActivity().setTitle(R.string.prefs_autofill_and_payments); + + ChromeSwitchPreference autofillSwitch = + (ChromeSwitchPreference) findPreference(PREF_AUTOFILL_SWITCH); + autofillSwitch.setOnPreferenceChangeListener(new OnPreferenceChangeListener() { + @Override + public boolean onPreferenceChange(Preference preference, Object newValue) { + PersonalDataManager.setAutofillEnabled((boolean) newValue); + return true; + } + }); + } + + @Override + public void onResume() { + super.onResume(); + ((ChromeSwitchPreference) findPreference(PREF_AUTOFILL_SWITCH)) + .setChecked(PersonalDataManager.isAutofillEnabled()); + } +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillCreditCardsFragment.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillCreditCardsFragment.java new file mode 100644 index 0000000..60660c6 --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillCreditCardsFragment.java
@@ -0,0 +1,92 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.preferences.autofill; + +import android.graphics.PorterDuff; +import android.graphics.drawable.Drawable; +import android.os.Bundle; +import android.preference.Preference; +import android.preference.PreferenceFragment; + +import org.chromium.base.ApiCompatibilityUtils; +import org.chromium.chrome.R; +import org.chromium.chrome.browser.autofill.PersonalDataManager; +import org.chromium.chrome.browser.autofill.PersonalDataManager.CreditCard; + +/** + * Autofill credit cards fragment, which allows the user to edit credit cards. + */ +public class AutofillCreditCardsFragment + extends PreferenceFragment implements PersonalDataManager.PersonalDataManagerObserver { + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + addPreferencesFromResource(R.xml.autofill_and_payments_preference_fragment_screen); + getActivity().setTitle(R.string.autofill_credit_cards_title); + } + + @Override + public void onResume() { + super.onResume(); + // Always rebuild our list of credit cards. Although we could detect if credit cards are + // added or deleted, the credit card summary (number) might be different. To be safe, we + // update all. + rebuildCreditCardList(); + } + + private void rebuildCreditCardList() { + getPreferenceScreen().removeAll(); + getPreferenceScreen().setOrderingAsAdded(true); + + for (CreditCard card : PersonalDataManager.getInstance().getCreditCardsForSettings()) { + // Add a preference for the credit card. + Preference pref = new Preference(getActivity()); + pref.setTitle(card.getObfuscatedNumber()); + pref.setSummary(card.getFormattedExpirationDate(getActivity())); + pref.setIcon(card.getIssuerIconDrawableId()); + + if (card.getIsLocal()) { + pref.setFragment(AutofillLocalCardEditor.class.getName()); + } else { + pref.setFragment(AutofillServerCardEditor.class.getName()); + pref.setWidgetLayoutResource(R.layout.autofill_server_data_label); + } + + Bundle args = pref.getExtras(); + args.putString(AutofillAndPaymentsPreferences.AUTOFILL_GUID, card.getGUID()); + getPreferenceScreen().addPreference(pref); + } + + // Add 'Add credit card' button. Tap of it brings up card editor which allows users type in + // new credit cards. + Preference pref = new Preference(getActivity()); + Drawable plusIcon = ApiCompatibilityUtils.getDrawable(getResources(), R.drawable.plus); + plusIcon.mutate(); + plusIcon.setColorFilter( + ApiCompatibilityUtils.getColor(getResources(), R.color.pref_accent_color), + PorterDuff.Mode.SRC_IN); + pref.setIcon(plusIcon); + pref.setTitle(R.string.autofill_create_credit_card); + pref.setFragment(AutofillLocalCardEditor.class.getName()); + getPreferenceScreen().addPreference(pref); + } + + @Override + public void onPersonalDataChanged() { + rebuildCreditCardList(); + } + + @Override + public void onActivityCreated(Bundle savedInstanceState) { + super.onActivityCreated(savedInstanceState); + PersonalDataManager.getInstance().registerDataObserver(this); + } + + @Override + public void onDestroyView() { + PersonalDataManager.getInstance().unregisterDataObserver(this); + super.onDestroyView(); + } +} \ No newline at end of file
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillEditorBase.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillEditorBase.java index 0dc1dfd..8017eb5 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillEditorBase.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillEditorBase.java
@@ -51,10 +51,10 @@ mContext = container.getContext(); // We know which profile to edit based on the GUID stuffed in - // our extras by AutofillPreferences. + // our extras by AutofillAndPaymentsPreferences. Bundle extras = getArguments(); if (extras != null) { - mGUID = extras.getString(AutofillPreferences.AUTOFILL_GUID); + mGUID = extras.getString(AutofillAndPaymentsPreferences.AUTOFILL_GUID); } if (mGUID == null) { mGUID = "";
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillLocalCardEditor.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillLocalCardEditor.java index 94d423e9..1f90119 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillLocalCardEditor.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillLocalCardEditor.java
@@ -170,7 +170,7 @@ R.string.payments_card_number_invalid_validation_message)); return false; } - CreditCard card = new CreditCard(mGUID, AutofillPreferences.SETTINGS_ORIGIN, + CreditCard card = new CreditCard(mGUID, AutofillAndPaymentsPreferences.SETTINGS_ORIGIN, true /* isLocal */, false /* isCached */, mNameText.getText().toString().trim(), cardNumber, "" /* obfuscatedNumber */, String.valueOf(mExpirationMonth.getSelectedItemPosition() + 1),
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillPreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillPreferences.java deleted file mode 100644 index 7ab509fb..0000000 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillPreferences.java +++ /dev/null
@@ -1,165 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.chrome.browser.preferences.autofill; - -import android.graphics.PorterDuff; -import android.graphics.drawable.Drawable; -import android.os.Bundle; -import android.preference.Preference; -import android.preference.Preference.OnPreferenceChangeListener; -import android.preference.PreferenceFragment; -import android.preference.PreferenceGroup; - -import org.chromium.base.ApiCompatibilityUtils; -import org.chromium.chrome.R; -import org.chromium.chrome.browser.autofill.PersonalDataManager; -import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile; -import org.chromium.chrome.browser.autofill.PersonalDataManager.CreditCard; -import org.chromium.chrome.browser.preferences.ChromeSwitchPreference; - -/** - * Autofill settings fragment, which allows the user to edit autofill and credit card profiles. - */ -public class AutofillPreferences extends PreferenceFragment - implements OnPreferenceChangeListener, PersonalDataManager.PersonalDataManagerObserver { - - public static final String AUTOFILL_GUID = "guid"; - // Needs to be in sync with kSettingsOrigin[] in - // chrome/browser/ui/webui/options/autofill_options_handler.cc - public static final String SETTINGS_ORIGIN = "Chrome settings"; - private static final String PREF_AUTOFILL_SWITCH = "autofill_switch"; - private static final String PREF_AUTOFILL_PROFILES = "autofill_profiles"; - private static final String PREF_AUTOFILL_CREDIT_CARDS = "autofill_credit_cards"; - - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - addPreferencesFromResource(R.xml.autofill_preferences); - getActivity().setTitle(R.string.prefs_autofill); - - ChromeSwitchPreference autofillSwitch = - (ChromeSwitchPreference) findPreference(PREF_AUTOFILL_SWITCH); - autofillSwitch.setOnPreferenceChangeListener(new OnPreferenceChangeListener() { - @Override - public boolean onPreferenceChange(Preference preference, Object newValue) { - PersonalDataManager.setAutofillEnabled((boolean) newValue); - return true; - } - }); - - setPreferenceCategoryIcons(); - } - - @Override - public boolean onPreferenceChange(Preference preference, Object newValue) { - refreshState(); - return true; - } - - private void setPreferenceCategoryIcons() { - Drawable plusIcon = ApiCompatibilityUtils.getDrawable(getResources(), R.drawable.plus); - plusIcon.mutate(); - plusIcon.setColorFilter( - ApiCompatibilityUtils.getColor(getResources(), R.color.pref_accent_color), - PorterDuff.Mode.SRC_IN); - findPreference(PREF_AUTOFILL_PROFILES).setIcon(plusIcon); - - plusIcon = ApiCompatibilityUtils.getDrawable(getResources(), R.drawable.plus); - plusIcon.mutate(); - plusIcon.setColorFilter( - ApiCompatibilityUtils.getColor(getResources(), R.color.pref_accent_color), - PorterDuff.Mode.SRC_IN); - findPreference(PREF_AUTOFILL_CREDIT_CARDS).setIcon(plusIcon); - } - - /** - * Refresh state (profile and credit card lists, preference summaries, etc.). - */ - private void refreshState() { - updateSummaries(); - rebuildProfileList(); - rebuildCreditCardList(); - } - - // Always clears the list before building/rebuilding. - private void rebuildProfileList() { - // Add an edit preference for each current Chrome profile. - PreferenceGroup profileCategory = (PreferenceGroup) findPreference(PREF_AUTOFILL_PROFILES); - profileCategory.removeAll(); - for (AutofillProfile profile : PersonalDataManager.getInstance().getProfilesForSettings()) { - // Add an item on the current page... - Preference pref = new Preference(getActivity()); - pref.setTitle(profile.getFullName()); - pref.setSummary(profile.getLabel()); - - if (profile.getIsLocal()) { - pref.setFragment(AutofillProfileEditor.class.getName()); - } else { - pref.setWidgetLayoutResource(R.layout.autofill_server_data_label); - pref.setFragment(AutofillServerProfilePreferences.class.getName()); - } - - Bundle args = pref.getExtras(); - args.putString(AUTOFILL_GUID, profile.getGUID()); - profileCategory.addPreference(pref); - } - } - - private void rebuildCreditCardList() { - PreferenceGroup profileCategory = - (PreferenceGroup) findPreference(PREF_AUTOFILL_CREDIT_CARDS); - profileCategory.removeAll(); - for (CreditCard card : PersonalDataManager.getInstance().getCreditCardsForSettings()) { - // Add an item on the current page... - Preference pref = new Preference(getActivity()); - pref.setTitle(card.getObfuscatedNumber()); - pref.setSummary(card.getFormattedExpirationDate(getActivity())); - - if (card.getIsLocal()) { - pref.setFragment(AutofillLocalCardEditor.class.getName()); - } else { - pref.setFragment(AutofillServerCardEditor.class.getName()); - pref.setWidgetLayoutResource(R.layout.autofill_server_data_label); - } - - Bundle args = pref.getExtras(); - args.putString(AUTOFILL_GUID, card.getGUID()); - profileCategory.addPreference(pref); - } - } - - private void updateSummaries() { - ChromeSwitchPreference autofillSwitch = - (ChromeSwitchPreference) findPreference(PREF_AUTOFILL_SWITCH); - autofillSwitch.setChecked(PersonalDataManager.isAutofillEnabled()); - } - - @Override - public void onResume() { - super.onResume(); - // Always rebuild our list of profiles. Although we could - // detect if profiles are added or deleted (GUID list - // changes), the profile summary (name+addr) might be - // different. To be safe, we update all. - refreshState(); - } - - @Override - public void onPersonalDataChanged() { - refreshState(); - } - - @Override - public void onActivityCreated(Bundle savedInstanceState) { - super.onActivityCreated(savedInstanceState); - PersonalDataManager.getInstance().registerDataObserver(this); - } - - @Override - public void onDestroyView() { - PersonalDataManager.getInstance().unregisterDataObserver(this); - super.onDestroyView(); - } -}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillProfileEditor.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillProfileEditor.java index 411923f..2cf26a8 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillProfileEditor.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillProfileEditor.java
@@ -240,7 +240,7 @@ @Override protected boolean saveEntry() { AutofillProfile profile = new PersonalDataManager.AutofillProfile(mGUID, - AutofillPreferences.SETTINGS_ORIGIN, true /* isLocal */, + AutofillAndPaymentsPreferences.SETTINGS_ORIGIN, true /* isLocal */, getFieldText(AddressField.RECIPIENT), getFieldText(AddressField.ORGANIZATION), getFieldText(AddressField.STREET_ADDRESS), getFieldText(AddressField.ADMIN_AREA), getFieldText(AddressField.LOCALITY), getFieldText(AddressField.DEPENDENT_LOCALITY),
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillProfilesFragment.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillProfilesFragment.java new file mode 100644 index 0000000..352c3cf7 --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillProfilesFragment.java
@@ -0,0 +1,91 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.preferences.autofill; + +import android.graphics.PorterDuff; +import android.graphics.drawable.Drawable; +import android.os.Bundle; +import android.preference.Preference; +import android.preference.PreferenceFragment; + +import org.chromium.base.ApiCompatibilityUtils; +import org.chromium.chrome.R; +import org.chromium.chrome.browser.autofill.PersonalDataManager; +import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile; + +/** + * Autofill profiles fragment, which allows the user to edit autofill profiles. + */ +public class AutofillProfilesFragment + extends PreferenceFragment implements PersonalDataManager.PersonalDataManagerObserver { + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + addPreferencesFromResource(R.xml.autofill_and_payments_preference_fragment_screen); + getActivity().setTitle(R.string.autofill_profiles_title); + } + + @Override + public void onResume() { + super.onResume(); + // Always rebuild our list of profiles. Although we could detect if profiles are added or + // deleted (GUID list changes), the profile summary (name+addr) might be different. To be + // safe, we update all. + rebuildProfileList(); + } + + private void rebuildProfileList() { + getPreferenceScreen().removeAll(); + getPreferenceScreen().setOrderingAsAdded(true); + + for (AutofillProfile profile : PersonalDataManager.getInstance().getProfilesForSettings()) { + // Add a preference for the profile. + Preference pref = new Preference(getActivity()); + pref.setTitle(profile.getFullName()); + pref.setSummary(profile.getLabel()); + + if (profile.getIsLocal()) { + pref.setFragment(AutofillProfileEditor.class.getName()); + } else { + pref.setWidgetLayoutResource(R.layout.autofill_server_data_label); + pref.setFragment(AutofillServerProfilePreferences.class.getName()); + } + + Bundle args = pref.getExtras(); + args.putString(AutofillAndPaymentsPreferences.AUTOFILL_GUID, profile.getGUID()); + getPreferenceScreen().addPreference(pref); + } + + // Add 'Add address' button. Tap of it brings up address editor which allows users type in + // new addresses. + Preference pref = new Preference(getActivity()); + Drawable plusIcon = ApiCompatibilityUtils.getDrawable(getResources(), R.drawable.plus); + plusIcon.mutate(); + plusIcon.setColorFilter( + ApiCompatibilityUtils.getColor(getResources(), R.color.pref_accent_color), + PorterDuff.Mode.SRC_IN); + pref.setIcon(plusIcon); + pref.setTitle(R.string.autofill_create_profile); + pref.setFragment(AutofillProfileEditor.class.getName()); + getPreferenceScreen().addPreference(pref); + } + + @Override + public void onPersonalDataChanged() { + rebuildProfileList(); + } + + @Override + public void onActivityCreated(Bundle savedInstanceState) { + super.onActivityCreated(savedInstanceState); + PersonalDataManager.getInstance().registerDataObserver(this); + } + + @Override + public void onDestroyView() { + PersonalDataManager.getInstance().unregisterDataObserver(this); + super.onDestroyView(); + } +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillServerProfilePreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillServerProfilePreferences.java index 8255d568..e1411f3 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillServerProfilePreferences.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillServerProfilePreferences.java
@@ -32,10 +32,10 @@ getActivity().setTitle(R.string.autofill_edit_profile); // We know which card to display based on the GUID stuffed in - // our extras by AutofillPreferences. + // our extras by AutofillAndPaymentsPreferences. Bundle extras = getArguments(); if (extras != null) { - mGUID = extras.getString(AutofillPreferences.AUTOFILL_GUID); + mGUID = extras.getString(AutofillAndPaymentsPreferences.AUTOFILL_GUID); } assert mGUID != null; AutofillProfile profile = PersonalDataManager.getInstance().getProfile(mGUID);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/PartialUpdateId.java b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/PartialUpdateId.java new file mode 100644 index 0000000..cde816d --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/PartialUpdateId.java
@@ -0,0 +1,22 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.suggestions; + +import android.support.annotation.IntDef; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +/** + * Payloads to be passed to mark the different types of partial binds that can be made on view + * holders + * @see org.chromium.chrome.browser.ntp.cards.InnerNode#notifyItemChanged(int, Object) + */ +@IntDef({PartialUpdateId.OFFLINE_BADGE}) +@Retention(RetentionPolicy.SOURCE) +public @interface PartialUpdateId { + /** Marks a request to update a suggestion's offline badge */ + int OFFLINE_BADGE = 1; +}
diff --git a/chrome/android/java/strings/android_chrome_strings.grd b/chrome/android/java/strings/android_chrome_strings.grd index 048b851..67668fb 100644 --- a/chrome/android/java/strings/android_chrome_strings.grd +++ b/chrome/android/java/strings/android_chrome_strings.grd
@@ -268,13 +268,16 @@ </message> <!-- Autofill preferences --> - <message name="IDS_PREFS_AUTOFILL" desc="Title for 'Autofill forms' settings, which control what personal data can be automatically filled into web page forms. [CHAR-LIMIT=32]"> + <message name="IDS_PREFS_AUTOFILL_AND_PAYMENTS" desc="Title of Autofill and payments settings prefrences. [CHAR-LIMIT=32]"> + Autofill and payments + </message> + <message name="IDS_AUTOFILL_SWITCH" desc="Title for 'Autofill forms' switch preference, which controls whether personal data can be automatically filled into web page forms. [CHAR-LIMIT=32]"> Autofill forms </message> - <message name="IDS_AUTOFILL_PROFILES_TITLE" desc="Header above the list of profiles (which contain the user's name, address, etc) that can be automatically filled into web page forms. [CHAR-LIMIT=32]"> + <message name="IDS_AUTOFILL_PROFILES_TITLE" desc="Title of the preference to list profiles (which contain the user's name, address, etc) that can be automatically filled into web page forms. [CHAR-LIMIT=32]"> Addresses - </message> - <message name="IDS_AUTOFILL_CREDIT_CARDS_TITLE" desc="Header above the list of the user's credit cards that can be automatically filled into web page forms. [CHAR-LIMIT=32]"> + </message> + <message name="IDS_AUTOFILL_CREDIT_CARDS_TITLE" desc="Title of the preference to list the user's credit cards that can be automatically filled into web page forms. [CHAR-LIMIT=32]"> Credit cards </message> <message name="IDS_AUTOFILL_CREATE_PROFILE" desc="Button that allows the user to create a new profile (which contains the user's name, address, etc) that will be automatically filled into web page forms. [CHAR-LIMIT=32]">
diff --git a/chrome/android/java_sources.gni b/chrome/android/java_sources.gni index 068a25a..4cac408 100644 --- a/chrome/android/java_sources.gni +++ b/chrome/android/java_sources.gni
@@ -781,7 +781,6 @@ "java/src/org/chromium/chrome/browser/preferences/ManagedPreferenceDelegate.java", "java/src/org/chromium/chrome/browser/preferences/ManagedPreferencesUtils.java", "java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java", - "java/src/org/chromium/chrome/browser/preferences/PreferenceCategoryWithButton.java", "java/src/org/chromium/chrome/browser/preferences/Preferences.java", "java/src/org/chromium/chrome/browser/preferences/PreferencesLauncher.java", "java/src/org/chromium/chrome/browser/preferences/ProtectedContentResetCredentialConfirmDialogFragment.java", @@ -798,10 +797,12 @@ "java/src/org/chromium/chrome/browser/preferences/TextMessagePreference.java", "java/src/org/chromium/chrome/browser/preferences/TextMessageWithLinkAndIconPreference.java", "java/src/org/chromium/chrome/browser/preferences/TextScalePreference.java", + "java/src/org/chromium/chrome/browser/preferences/autofill/AutofillAndPaymentsPreferences.java", + "java/src/org/chromium/chrome/browser/preferences/autofill/AutofillCreditCardsFragment.java", "java/src/org/chromium/chrome/browser/preferences/autofill/AutofillCreditCardEditor.java", "java/src/org/chromium/chrome/browser/preferences/autofill/AutofillEditorBase.java", "java/src/org/chromium/chrome/browser/preferences/autofill/AutofillLocalCardEditor.java", - "java/src/org/chromium/chrome/browser/preferences/autofill/AutofillPreferences.java", + "java/src/org/chromium/chrome/browser/preferences/autofill/AutofillProfilesFragment.java", "java/src/org/chromium/chrome/browser/preferences/autofill/AutofillProfileBridge.java", "java/src/org/chromium/chrome/browser/preferences/autofill/AutofillProfileEditor.java", "java/src/org/chromium/chrome/browser/preferences/autofill/AutofillServerCardEditor.java", @@ -918,6 +919,7 @@ "java/src/org/chromium/chrome/browser/snackbar/undo/UndoBarController.java", "java/src/org/chromium/chrome/browser/ssl/SecurityStateModel.java", "java/src/org/chromium/chrome/browser/suggestions/ContentSuggestionsActivity.java", + "java/src/org/chromium/chrome/browser/suggestions/PartialUpdateId.java", "java/src/org/chromium/chrome/browser/suggestions/SuggestionsNavigationDelegate.java", "java/src/org/chromium/chrome/browser/suggestions/SuggestionsNavigationDelegateImpl.java", "java/src/org/chromium/chrome/browser/suggestions/SuggestionsUiDelegate.java", @@ -1498,6 +1500,7 @@ "junit/src/org/chromium/chrome/browser/ChromeBackgroundServiceWaiterTest.java", "junit/src/org/chromium/chrome/browser/EnableFeatures.java", "junit/src/org/chromium/chrome/browser/DelayedScreenLockIntentHandlerTest.java", + "junit/src/org/chromium/chrome/browser/DisableHistogramsRule.java", "junit/src/org/chromium/chrome/browser/ShortcutHelperTest.java", "junit/src/org/chromium/chrome/browser/SSLClientCertificateRequestTest.java", "junit/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelperTest.java",
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/BackgroundSyncLauncherTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/BackgroundSyncLauncherTest.java index 24ce642..37def570 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/BackgroundSyncLauncherTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/BackgroundSyncLauncherTest.java
@@ -28,12 +28,18 @@ protected void setUp() throws Exception { mContext = new AdvancedMockContext(getInstrumentation().getTargetContext()); BackgroundSyncLauncher.setGCMEnabled(false); - RecordHistogram.disableForTests(); + RecordHistogram.setDisabledForTests(true); mLauncher = BackgroundSyncLauncher.create(mContext); // Ensure that the initial task is given enough time to complete. waitForLaunchBrowserTask(); } + @Override + public void tearDown() throws Exception { + super.tearDown(); + RecordHistogram.setDisabledForTests(false); + } + private void deleteLauncherInstance() { mLauncher.destroy(); mLauncher = null;
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/ChromeBackgroundServiceTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/ChromeBackgroundServiceTest.java index 4a587161..3d9ff05d 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/ChromeBackgroundServiceTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/ChromeBackgroundServiceTest.java
@@ -96,12 +96,18 @@ protected void setUp() throws Exception { mContext = new AdvancedMockContext(getInstrumentation().getTargetContext()); BackgroundSyncLauncher.setGCMEnabled(false); - RecordHistogram.disableForTests(); + RecordHistogram.setDisabledForTests(true); mSyncLauncher = BackgroundSyncLauncher.create(mContext); mSnippetsLauncher = SnippetsLauncher.create(mContext); mTaskService = new MockTaskService(); } + @Override + public void tearDown() throws Exception { + super.tearDown(); + RecordHistogram.setDisabledForTests(false); + } + private void deleteSyncLauncherInstance() { mSyncLauncher.destroy(); mSyncLauncher = null;
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/download/DownloadManagerServiceTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/download/DownloadManagerServiceTest.java index b7049cf..1193695 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/download/DownloadManagerServiceTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/download/DownloadManagerServiceTest.java
@@ -311,10 +311,16 @@ @Override protected void setUp() throws Exception { super.setUp(); - RecordHistogram.disableForTests(); + RecordHistogram.setDisabledForTests(true); loadNativeLibraryAndInitBrowserProcess(); } + @Override + public void tearDown() throws Exception { + super.tearDown(); + RecordHistogram.setDisabledForTests(false); + } + private static Handler getTestHandler() { HandlerThread handlerThread = new HandlerThread("handlerThread"); handlerThread.start();
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandlerTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandlerTest.java index 9af58de..97ecaa13 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandlerTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandlerTest.java
@@ -110,12 +110,18 @@ @Override protected void setUp() throws Exception { super.setUp(); - RecordHistogram.disableForTests(); + RecordHistogram.setDisabledForTests(true); mDelegate.mQueryIntentOverride = null; ChromeWebApkHost.initForTesting(false); // disabled by default loadNativeLibraryNoBrowserProcess(); } + @Override + public void tearDown() throws Exception { + super.tearDown(); + RecordHistogram.setDisabledForTests(false); + } + @SmallTest public void testOrdinaryIncognitoUri() { // http://crbug.com/587306: Don't prompt the user for capturing URLs in incognito, just keep
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/precache/PrecacheControllerTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/precache/PrecacheControllerTest.java index 736ded5f..bc94723a 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/precache/PrecacheControllerTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/precache/PrecacheControllerTest.java
@@ -108,12 +108,18 @@ mPrecacheLauncher.setController(mPrecacheController); mPrecacheController.setPrecacheLauncher(mPrecacheLauncher); PrecacheController.setTaskScheduler(mPrecacheTaskScheduler); - RecordHistogram.disableForTests(); + RecordHistogram.setDisabledForTests(true); Editor editor = ContextUtils.getAppSharedPreferences().edit(); editor.putBoolean(PrecacheController.PREF_IS_PRECACHING_ENABLED, false); editor.apply(); } + @Override + public void tearDown() throws Exception { + super.tearDown(); + RecordHistogram.setDisabledForTests(false); + } + protected void verifyScheduledAndCanceledCounts( int expectedPeriodicScheduled, int expectedContinuationScheduled, int expectedPeriodicCanceled, int expectedContinuationCanceled) {
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/RestoreMigrateTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/RestoreMigrateTest.java index 415a846d..a777695 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/RestoreMigrateTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/RestoreMigrateTest.java
@@ -266,10 +266,14 @@ TabPersistentStore storeIn = buildTabPersistentStore(selectorIn, 0); int maxId = Math.max(getMaxId(selector0), getMaxId(selector1)); - RecordHistogram.disableForTests(); - storeIn.loadState(false /* ignoreIncognitoFiles */); - assertEquals("Invalid next id", maxId + 1, - TabIdManager.getInstance().generateValidId(Tab.INVALID_TAB_ID)); + try { + RecordHistogram.setDisabledForTests(true); + storeIn.loadState(false /* ignoreIncognitoFiles */); + assertEquals("Invalid next id", maxId + 1, + TabIdManager.getInstance().generateValidId(Tab.INVALID_TAB_ID)); + } finally { + RecordHistogram.setDisabledForTests(false); + } } /** @@ -295,9 +299,13 @@ TabPersistentStore storeIn1 = buildTabPersistentStore(selectorIn1, 1); - RecordHistogram.disableForTests(); - storeIn0.loadState(false /* ignoreIncognitoFiles */); - storeIn1.loadState(false /* ignoreIncognitoFiles */); + try { + RecordHistogram.setDisabledForTests(true); + storeIn0.loadState(false /* ignoreIncognitoFiles */); + storeIn1.loadState(false /* ignoreIncognitoFiles */); + } finally { + RecordHistogram.setDisabledForTests(false); + } assertEquals("Unexpected number of tabs to load", 6, storeIn0.getRestoredTabCount()); assertEquals("Unexpected number of tabs to load", 3, storeIn1.getRestoredTabCount());
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/ActivityAssignerTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/ActivityAssignerTest.java index 1d61773..69d6d9c0 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/ActivityAssignerTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/ActivityAssignerTest.java
@@ -32,7 +32,7 @@ @Override protected void setUp() throws Exception { super.setUp(); - RecordHistogram.disableForTests(); + RecordHistogram.setDisabledForTests(true); mContext = new AdvancedMockContext(ContextUtils.getApplicationContext()); mPreferences = new HashMap[ActivityAssigner.NAMESPACE_COUNT]; for (int i = 0; i < ActivityAssigner.NAMESPACE_COUNT; ++i) { @@ -42,6 +42,12 @@ ContextUtils.initApplicationContextForTests(mContext); } + @Override + public void tearDown() throws Exception { + super.tearDown(); + RecordHistogram.setDisabledForTests(false); + } + @UiThreadTest @SmallTest @Feature({"Webapps"})
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappAuthenticatorTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappAuthenticatorTest.java index 1410505..3a64e47 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappAuthenticatorTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappAuthenticatorTest.java
@@ -15,10 +15,21 @@ * Tests for {@link WebappAuthenticator}. */ public class WebappAuthenticatorTest extends InstrumentationTestCase { + @Override + public void setUp() throws Exception { + super.setUp(); + RecordHistogram.setDisabledForTests(true); + } + + @Override + protected void tearDown() throws Exception { + super.tearDown(); + RecordHistogram.setDisabledForTests(false); + } + @SmallTest @Feature({"Webapps"}) public void testAuthentication() { - RecordHistogram.disableForTests(); Context context = getInstrumentation().getTargetContext(); String url = "http://www.example.org/hello.html"; byte[] mac = WebappAuthenticator.getMacForUrl(context, url);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappDirectoryManagerTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappDirectoryManagerTest.java index 7d8f59c1..820b346b 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappDirectoryManagerTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappDirectoryManagerTest.java
@@ -75,7 +75,7 @@ @Override public void setUp() throws Exception { super.setUp(); - RecordHistogram.disableForTests(); + RecordHistogram.setDisabledForTests(true); mMockContext = new WebappMockContext(); mWebappDirectoryManager = new TestWebappDirectoryManager(); @@ -88,6 +88,7 @@ @Override public void tearDown() throws Exception { FileUtils.recursivelyDeleteFile(new File(mMockContext.getBaseDirectory())); + RecordHistogram.setDisabledForTests(false); super.tearDown(); }
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/DisableHistogramsRule.java b/chrome/android/junit/src/org/chromium/chrome/browser/DisableHistogramsRule.java new file mode 100644 index 0000000..506da77e --- /dev/null +++ b/chrome/android/junit/src/org/chromium/chrome/browser/DisableHistogramsRule.java
@@ -0,0 +1,25 @@ +// 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. + +package org.chromium.chrome.browser; + +import org.junit.rules.ExternalResource; + +import org.chromium.base.metrics.RecordHistogram; + +/** + * Disables histogram recording for the duration of the tests. + */ +public class DisableHistogramsRule extends ExternalResource { + + @Override + protected void before() throws Throwable { + RecordHistogram.setDisabledForTests(true); + } + + @Override + protected void after() { + RecordHistogram.setDisabledForTests(false); + } +} \ No newline at end of file
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/ContentSuggestionsTestUtils.java b/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/ContentSuggestionsTestUtils.java index 463aefe..b1fbb183 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/ContentSuggestionsTestUtils.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/ContentSuggestionsTestUtils.java
@@ -17,7 +17,6 @@ import org.chromium.chrome.browser.ntp.snippets.SnippetArticleViewHolder; import java.util.ArrayList; -import java.util.Collections; import java.util.List; /** Utilities to make testing content suggestions code easier. */ @@ -172,8 +171,7 @@ public static void bindViewHolders(InnerNode node, int startIndex, int endIndex) { for (int i = startIndex; i < endIndex; ++i) { - node.onBindViewHolder( - makeViewHolder(node.getItemViewType(i)), i, Collections.emptyList()); + node.onBindViewHolder(makeViewHolder(node.getItemViewType(i)), i); } }
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/InnerNodeTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/InnerNodeTest.java index 8217f76..4d1596e 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/InnerNodeTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/InnerNodeTest.java
@@ -30,8 +30,6 @@ import org.chromium.testing.local.LocalRobolectricTestRunner; import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; import java.util.List; /** @@ -81,17 +79,15 @@ @Test public void testBindViewHolder() { NewTabPageViewHolder holder = mock(NewTabPageViewHolder.class); - List<Object> payload1 = Collections.emptyList(); - List<Object> payload2 = Arrays.<Object>asList("some data", "some other data"); - mInnerNode.onBindViewHolder(holder, 0, payload1); - mInnerNode.onBindViewHolder(holder, 5, payload1); - mInnerNode.onBindViewHolder(holder, 6, payload2); - mInnerNode.onBindViewHolder(holder, 11, payload1); + mInnerNode.onBindViewHolder(holder, 0); + mInnerNode.onBindViewHolder(holder, 5); + mInnerNode.onBindViewHolder(holder, 6); + mInnerNode.onBindViewHolder(holder, 11); - verify(mChildren.get(0)).onBindViewHolder(holder, 0, payload1); - verify(mChildren.get(2)).onBindViewHolder(holder, 2, payload1); - verify(mChildren.get(4)).onBindViewHolder(holder, 0, payload2); - verify(mChildren.get(6)).onBindViewHolder(holder, 0, payload1); + verify(mChildren.get(0)).onBindViewHolder(holder, 0); + verify(mChildren.get(2)).onBindViewHolder(holder, 2); + verify(mChildren.get(4)).onBindViewHolder(holder, 0); + verify(mChildren.get(6)).onBindViewHolder(holder, 0); } @Test
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapterTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapterTest.java index 1efc4a6..5241c2c 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapterTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapterTest.java
@@ -48,11 +48,10 @@ import org.chromium.base.Callback; import org.chromium.base.ContextUtils; -import org.chromium.base.metrics.RecordHistogram; -import org.chromium.base.metrics.RecordUserAction; import org.chromium.base.test.util.Feature; import org.chromium.chrome.R; import org.chromium.chrome.browser.ChromeFeatureList; +import org.chromium.chrome.browser.DisableHistogramsRule; import org.chromium.chrome.browser.EnableFeatures; import org.chromium.chrome.browser.ntp.ContextMenuManager; import org.chromium.chrome.browser.ntp.NewTabPage.DestructionObserver; @@ -86,6 +85,8 @@ public class NewTabPageAdapterTest { @Rule public EnableFeatures.Processor mEnableFeatureProcessor = new EnableFeatures.Processor(); + @Rule + public DisableHistogramsRule mDisableHistogramsRule = new DisableHistogramsRule(); private FakeSuggestionsSource mSource; private NewTabPageAdapter mAdapter; @@ -202,9 +203,6 @@ when(mMockSigninManager.isSignedInOnNative()).thenReturn(true); when(mMockSigninManager.isSignInAllowed()).thenReturn(true); - RecordHistogram.disableForTests(); - RecordUserAction.disableForTests(); - @CategoryInt final int category = KnownCategories.ARTICLES; mSource = new FakeSuggestionsSource();
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/SectionListTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/SectionListTest.java index 195e6fd..4d27499 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/SectionListTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/SectionListTest.java
@@ -14,6 +14,7 @@ import static org.chromium.chrome.browser.ntp.cards.ContentSuggestionsTestUtils.registerCategory; import org.junit.Before; +import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; @@ -21,8 +22,8 @@ import org.robolectric.annotation.Config; import org.chromium.base.Callback; -import org.chromium.base.metrics.RecordHistogram; import org.chromium.base.test.util.Feature; +import org.chromium.chrome.browser.DisableHistogramsRule; import org.chromium.chrome.browser.ntp.cards.ContentSuggestionsTestUtils.CategoryInfoBuilder; import org.chromium.chrome.browser.ntp.snippets.FakeSuggestionsSource; import org.chromium.chrome.browser.ntp.snippets.KnownCategories; @@ -40,6 +41,9 @@ @RunWith(LocalRobolectricTestRunner.class) @Config(manifest = Config.NONE) public class SectionListTest { + @Rule + public DisableHistogramsRule mDisableHistogramsRule = new DisableHistogramsRule(); + @Mock private SuggestionsUiDelegate mUiDelegate; @Mock @@ -52,7 +56,6 @@ public void setUp() { MockitoAnnotations.initMocks(this); mSuggestionSource = new FakeSuggestionsSource(); - RecordHistogram.disableForTests(); when(mUiDelegate.getSuggestionsSource()).thenReturn(mSuggestionSource); when(mUiDelegate.getMetricsReporter()).thenReturn(mMetricsReporter);
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSectionTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSectionTest.java index 3d8b185..9ed3c4b43 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSectionTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSectionTest.java
@@ -25,6 +25,7 @@ import static org.chromium.chrome.browser.ntp.cards.ContentSuggestionsTestUtils.createDummySuggestions; import org.junit.Before; +import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; @@ -34,6 +35,7 @@ import org.chromium.base.Callback; import org.chromium.base.test.util.Feature; import org.chromium.chrome.browser.ChromeFeatureList; +import org.chromium.chrome.browser.DisableHistogramsRule; import org.chromium.chrome.browser.EnableFeatures; import org.chromium.chrome.browser.ntp.cards.ContentSuggestionsTestUtils.CategoryInfoBuilder; import org.chromium.chrome.browser.ntp.snippets.CategoryStatus; @@ -58,6 +60,9 @@ @RunWith(LocalRobolectricTestRunner.class) @Config(manifest = Config.NONE) public class SuggestionsSectionTest { + @Rule + public DisableHistogramsRule mDisableHistogramsRule = new DisableHistogramsRule(); + @Mock private SuggestionsSection.Delegate mDelegate; @Mock
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/BackgroundOfflinerTaskTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/BackgroundOfflinerTaskTest.java index 0787835..f589465 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/BackgroundOfflinerTaskTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/BackgroundOfflinerTaskTest.java
@@ -22,6 +22,7 @@ import org.junit.After; import org.junit.Before; +import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; @@ -36,9 +37,9 @@ import org.chromium.base.BaseSwitches; import org.chromium.base.CommandLine; import org.chromium.base.SysUtils; -import org.chromium.base.metrics.RecordHistogram; import org.chromium.base.test.util.Feature; import org.chromium.chrome.browser.ChromeBackgroundServiceWaiter; +import org.chromium.chrome.browser.DisableHistogramsRule; import org.chromium.net.ConnectionType; /** @@ -56,6 +57,9 @@ private static final String IS_LOW_END_DEVICE_SWITCH = "--" + BaseSwitches.ENABLE_LOW_END_DEVICE_MODE; + @Rule + public DisableHistogramsRule mDisableHistogramsRule = new DisableHistogramsRule(); + @Mock private OfflinePageUtils mOfflinePageUtils; @@ -84,7 +88,6 @@ OfflinePageUtils.setInstanceForTesting(mOfflinePageUtils); mStubBackgroundSchedulerProcessor = new StubBackgroundSchedulerProcessor(); - RecordHistogram.disableForTests(); mContext = RuntimeEnvironment.application; mGcmNetworkManager = (ShadowGcmNetworkManager) ShadowExtractor.extract( GcmNetworkManager.getInstance(mContext));
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/superviseduser/SupervisedUserContentProviderUnitTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/superviseduser/SupervisedUserContentProviderUnitTest.java index 1a44291..07fafd3 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/superviseduser/SupervisedUserContentProviderUnitTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/superviseduser/SupervisedUserContentProviderUnitTest.java
@@ -14,10 +14,8 @@ import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -import org.chromium.base.metrics.RecordHistogram; -import org.chromium.components.webrestrictions.browser.WebRestrictionsContentProvider.WebRestrictionsResult; -import org.chromium.testing.local.LocalRobolectricTestRunner; import org.junit.Before; +import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mockito; @@ -25,6 +23,10 @@ import org.mockito.stubbing.Answer; import org.robolectric.annotation.Config; +import org.chromium.chrome.browser.DisableHistogramsRule; +import org.chromium.components.webrestrictions.browser.WebRestrictionsContentProvider.WebRestrictionsResult; +import org.chromium.testing.local.LocalRobolectricTestRunner; + /** * Tests of SupervisedUserContentProvider. This is tested as a simple class, not as a content * provider. The content provider aspects are tested with WebRestrictionsContentProviderTest. @@ -32,12 +34,13 @@ @RunWith(LocalRobolectricTestRunner.class) @Config(manifest = Config.NONE) public class SupervisedUserContentProviderUnitTest { + @Rule + public DisableHistogramsRule mDisableHistogramsRule = new DisableHistogramsRule(); private SupervisedUserContentProvider mSupervisedUserContentProvider; @Before public void setUp() { - RecordHistogram.disableForTests(); mSupervisedUserContentProvider = Mockito.spy(new SupervisedUserContentProvider()); mSupervisedUserContentProvider.setNativeSupervisedUserContentProviderForTesting(1234L); }
diff --git a/chrome/browser/android/feedback/screenshot_task.cc b/chrome/browser/android/feedback/screenshot_task.cc index 0381101..4e8d3e2 100644 --- a/chrome/browser/android/feedback/screenshot_task.cc +++ b/chrome/browser/android/feedback/screenshot_task.cc
@@ -31,7 +31,7 @@ void SnapshotCallback(JNIEnv* env, const JavaRef<jobject>& callback, - scoped_refptr<base::RefCountedMemory> png_data) { + scoped_refptr<base::RefCountedBytes> png_data) { jbyteArray jbytes = nullptr; if (png_data.get()) { size_t size = png_data->size(); @@ -50,7 +50,7 @@ WindowAndroid* window_android = reinterpret_cast<WindowAndroid*>( native_window_android); gfx::Rect window_bounds(window_width, window_height); - ui::GrabWindowSnapshotAsyncPNG( + ui::GrabWindowSnapshotAsync( window_android, window_bounds, base::ThreadTaskRunnerHandle::Get(), base::Bind(&SnapshotCallback, env, ScopedJavaGlobalRef<jobject>(env, jcallback)));
diff --git a/chrome/browser/autofill/android/personal_data_manager_android.cc b/chrome/browser/autofill/android/personal_data_manager_android.cc index 782f25cf7..07d2f95 100644 --- a/chrome/browser/autofill/android/personal_data_manager_android.cc +++ b/chrome/browser/autofill/android/personal_data_manager_android.cc
@@ -789,6 +789,18 @@ pending_normalization_.clear(); } +jboolean PersonalDataManagerAndroid::HasProfiles( + JNIEnv* env, + const base::android::JavaParamRef<jobject>& unused_obj) { + return !personal_data_manager_->GetProfiles().empty(); +} + +jboolean PersonalDataManagerAndroid::HasCreditCards( + JNIEnv* env, + const base::android::JavaParamRef<jobject>& unused_obj) { + return !personal_data_manager_->GetCreditCards().empty(); +} + ScopedJavaLocalRef<jobjectArray> PersonalDataManagerAndroid::GetProfileGUIDs( JNIEnv* env, const std::vector<AutofillProfile*>& profiles) {
diff --git a/chrome/browser/autofill/android/personal_data_manager_android.h b/chrome/browser/autofill/android/personal_data_manager_android.h index 2b3becc..9973f12f 100644 --- a/chrome/browser/autofill/android/personal_data_manager_android.h +++ b/chrome/browser/autofill/android/personal_data_manager_android.h
@@ -330,6 +330,15 @@ JNIEnv* env, const base::android::JavaParamRef<jobject>& unused_obj); + // Checks whether the Autofill PersonalDataManager has profiles. + jboolean HasProfiles(JNIEnv* env, + const base::android::JavaParamRef<jobject>& unused_obj); + + // Checks whether the Autofill PersonalDataManager has credit cards. + jboolean HasCreditCards( + JNIEnv* env, + const base::android::JavaParamRef<jobject>& unused_obj); + private: ~PersonalDataManagerAndroid() override;
diff --git a/chrome/browser/chromeos/login/screenshot_testing/screenshot_tester.cc b/chrome/browser/chromeos/login/screenshot_testing/screenshot_tester.cc index 92dc8336..4849de4 100644 --- a/chrome/browser/chromeos/login/screenshot_testing/screenshot_tester.cc +++ b/chrome/browser/chromeos/login/screenshot_testing/screenshot_tester.cc
@@ -187,9 +187,10 @@ LOG(ERROR) << "Can't create directory" << image_path.DirName().value(); return false; } - if (static_cast<size_t>(base::WriteFile( - image_path, reinterpret_cast<const char*>(png_data->front()), - png_data->size())) != png_data->size()) { + if (static_cast<size_t>( + base::WriteFile(image_path, + reinterpret_cast<char*>(&(png_data->data()[0])), + png_data->size())) != png_data->size()) { LOG(ERROR) << "Can't save screenshot " << image_path.BaseName().value() << "."; return false; @@ -199,9 +200,10 @@ return true; } -void ScreenshotTester::ReturnScreenshot(PNGFile* screenshot, PNGFile png_data) { +void ScreenshotTester::ReturnScreenshot(const PNGFile& screenshot, + PNGFile png_data) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); - *screenshot = png_data; + screenshot->data() = png_data->data(); content::BrowserThread::PostTask( content::BrowserThread::UI, FROM_HERE, run_loop_quitter_); } @@ -210,11 +212,13 @@ DCHECK_CURRENTLY_ON(content::BrowserThread::UI); aura::Window* primary_window = ash::Shell::GetPrimaryRootWindow(); gfx::Rect rect = primary_window->bounds(); - PNGFile screenshot; - ui::GrabWindowSnapshotAsyncPNG( - primary_window, rect, content::BrowserThread::GetBlockingPool(), - base::Bind(&ScreenshotTester::ReturnScreenshot, - weak_factory_.GetWeakPtr(), &screenshot)); + PNGFile screenshot = new base::RefCountedBytes; + ui::GrabWindowSnapshotAsync(primary_window, + rect, + content::BrowserThread::GetBlockingPool(), + base::Bind(&ScreenshotTester::ReturnScreenshot, + weak_factory_.GetWeakPtr(), + screenshot)); base::RunLoop run_loop; run_loop_quitter_ = run_loop.QuitClosure(); run_loop.Run(); @@ -236,7 +240,7 @@ if (golden_screenshot_size == -1) { CHECK(false) << "Can't get golden screenshot size"; } - scoped_refptr<base::RefCountedBytes> png_data = new base::RefCountedBytes; + PNGFile png_data = new base::RefCountedBytes; png_data->data().resize(golden_screenshot_size); base::ReadFile(image_path, reinterpret_cast<char*>(&(png_data->data()[0])), @@ -248,7 +252,9 @@ SkBitmap ScreenshotTester::ProcessImageForComparison(const PNGFile& image) { CHECK(image.get()); SkBitmap current_bitmap; - gfx::PNGCodec::Decode(image->front(), image->size(), ¤t_bitmap); + gfx::PNGCodec::Decode(reinterpret_cast<unsigned char*>(&(image->data()[0])), + image->data().size(), + ¤t_bitmap); EraseIgnoredAreas(current_bitmap); return current_bitmap; } @@ -323,12 +329,11 @@ testing_result.similarity = result.result; - scoped_refptr<base::RefCountedBytes> diff_image(new base::RefCountedBytes); - diff_image->data().resize(result.rgbDiffBitmap.getSize()); - CHECK(gfx::PNGCodec::EncodeBGRASkBitmap(result.rgbDiffBitmap, false, - &diff_image->data())) + testing_result.diff_image = new base::RefCountedBytes; + testing_result.diff_image->data().resize(result.rgbDiffBitmap.getSize()); + CHECK(gfx::PNGCodec::EncodeBGRASkBitmap( + result.rgbDiffBitmap, false, &testing_result.diff_image->data())) << "Could not encode difference to PNG"; - testing_result.diff_image = diff_image; return testing_result; }
diff --git a/chrome/browser/chromeos/login/screenshot_testing/screenshot_tester.h b/chrome/browser/chromeos/login/screenshot_testing/screenshot_tester.h index eafd43e..6474157 100644 --- a/chrome/browser/chromeos/login/screenshot_testing/screenshot_tester.h +++ b/chrome/browser/chromeos/login/screenshot_testing/screenshot_tester.h
@@ -24,7 +24,7 @@ ScreenshotTester(); virtual ~ScreenshotTester(); - typedef scoped_refptr<base::RefCountedMemory> PNGFile; + typedef scoped_refptr<base::RefCountedBytes> PNGFile; // Contains the results of comparison struct Result { @@ -106,7 +106,7 @@ void LogComparisonResults(const ScreenshotTester::Result& result); // Saves |png_data| as a current screenshot. - void ReturnScreenshot(PNGFile* screenshot, PNGFile png_data); + void ReturnScreenshot(const PNGFile& screenshot, PNGFile png_data); // Loads golden screenshot from the disk, assuming it lies at |image_path|. // Fails if there is no such a file. @@ -138,7 +138,7 @@ base::FilePath artifacts_dir_; // |run_loop_quitter_| is used to stop waiting when - // ui::GrabWindowSnapshotAsyncPNG completes. + // ui::GrabWindowSnapshotAsync completes. base::Closure run_loop_quitter_; // Is true when we're in test mode:
diff --git a/chrome/browser/chromeos/policy/remote_commands/device_command_screenshot_job.cc b/chrome/browser/chromeos/policy/remote_commands/device_command_screenshot_job.cc index 249f3d9..2e0e156f 100644 --- a/chrome/browser/chromeos/policy/remote_commands/device_command_screenshot_job.cc +++ b/chrome/browser/chromeos/policy/remote_commands/device_command_screenshot_job.cc
@@ -60,7 +60,7 @@ void RunStoreScreenshotOnTaskRunner( const ui::GrabWindowSnapshotAsyncPNGCallback& store_screenshot_callback, scoped_refptr<base::TaskRunner> task_runner, - scoped_refptr<base::RefCountedMemory> png_data) { + scoped_refptr<base::RefCountedBytes> png_data) { task_runner->PostTask(FROM_HERE, base::Bind(store_screenshot_callback, png_data)); } @@ -157,7 +157,7 @@ void DeviceCommandScreenshotJob::StoreScreenshot( size_t screen, - scoped_refptr<base::RefCountedMemory> png_data) { + scoped_refptr<base::RefCountedBytes> png_data) { screenshots_.insert(std::make_pair(screen, png_data)); DCHECK_LT(0, num_pending_screenshots_); --num_pending_screenshots_;
diff --git a/chrome/browser/chromeos/policy/remote_commands/device_command_screenshot_job.h b/chrome/browser/chromeos/policy/remote_commands/device_command_screenshot_job.h index da124bd..b1b588d 100644 --- a/chrome/browser/chromeos/policy/remote_commands/device_command_screenshot_job.h +++ b/chrome/browser/chromeos/policy/remote_commands/device_command_screenshot_job.h
@@ -110,7 +110,7 @@ void TerminateImpl() override; void StoreScreenshot(size_t screen, - scoped_refptr<base::RefCountedMemory> png_data); + scoped_refptr<base::RefCountedBytes> png_data); void StartScreenshotUpload(); @@ -128,7 +128,7 @@ int num_pending_screenshots_; // Caches the already completed screenshots for the different displays. - std::map<int, scoped_refptr<base::RefCountedMemory>> screenshots_; + std::map<int, scoped_refptr<base::RefCountedBytes>> screenshots_; // The Delegate is used to acquire screenshots and create UploadJobs. std::unique_ptr<Delegate> screenshot_delegate_;
diff --git a/chrome/browser/chromeos/policy/remote_commands/screenshot_delegate.cc b/chrome/browser/chromeos/policy/remote_commands/screenshot_delegate.cc index eec0979..fe9264c 100644 --- a/chrome/browser/chromeos/policy/remote_commands/screenshot_delegate.cc +++ b/chrome/browser/chromeos/policy/remote_commands/screenshot_delegate.cc
@@ -42,7 +42,7 @@ gfx::NativeWindow window, const gfx::Rect& source_rect, const ui::GrabWindowSnapshotAsyncPNGCallback& callback) { - ui::GrabWindowSnapshotAsyncPNG( + ui::GrabWindowSnapshotAsync( window, source_rect, blocking_task_runner_, base::Bind(&ScreenshotDelegate::StoreScreenshot, weak_ptr_factory_.GetWeakPtr(), callback)); @@ -69,7 +69,7 @@ void ScreenshotDelegate::StoreScreenshot( const ui::GrabWindowSnapshotAsyncPNGCallback& callback, - scoped_refptr<base::RefCountedMemory> png_data) { + scoped_refptr<base::RefCountedBytes> png_data) { callback.Run(png_data); }
diff --git a/chrome/browser/chromeos/policy/remote_commands/screenshot_delegate.h b/chrome/browser/chromeos/policy/remote_commands/screenshot_delegate.h index 6dbba859..1301fd2 100644 --- a/chrome/browser/chromeos/policy/remote_commands/screenshot_delegate.h +++ b/chrome/browser/chromeos/policy/remote_commands/screenshot_delegate.h
@@ -21,7 +21,7 @@ namespace policy { // An implementation of the |DeviceCommandScreenshotJob::Delegate| that uses -// aura's GrabWindowSnapshotAsyncPNG() to acquire the window snapshot. +// aura's GrabWindowSnapshotAsync() to acquire the window snapshot. class ScreenshotDelegate : public DeviceCommandScreenshotJob::Delegate { public: explicit ScreenshotDelegate( @@ -40,7 +40,7 @@ private: void StoreScreenshot(const ui::GrabWindowSnapshotAsyncPNGCallback& callback, - scoped_refptr<base::RefCountedMemory> png_data); + scoped_refptr<base::RefCountedBytes> png_data); scoped_refptr<base::TaskRunner> blocking_task_runner_;
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc index c1578c2a..6197196 100644 --- a/chrome/browser/io_thread.cc +++ b/chrome/browser/io_thread.cc
@@ -357,7 +357,7 @@ #endif globals_(nullptr), is_quic_allowed_by_policy_(true), - http_09_on_non_default_ports_enabled_(false), + http_09_on_non_default_ports_enabled_(true), creation_time_(base::TimeTicks::Now()), weak_factory_(this) { scoped_refptr<base::SingleThreadTaskRunner> io_thread_proxy =
diff --git a/chrome/browser/mac/exception_processor.mm b/chrome/browser/mac/exception_processor.mm index 3922146..b293c94 100644 --- a/chrome/browser/mac/exception_processor.mm +++ b/chrome/browser/mac/exception_processor.mm
@@ -79,7 +79,9 @@ static const char* const kExceptionSinkholes[] = { "CFRunLoopRunSpecific", + "_CFXNotificationPost", "_dispatch_client_callout", + "__NSFireDelayedPerform", }; // This function is used to make it clear to the crash processor that this is @@ -173,6 +175,8 @@ } } + DVLOG(1) << "Stopping search for exception handler at " << proc_name; + break; } }
diff --git a/chrome/browser/mac/exception_processor_unittest.mm b/chrome/browser/mac/exception_processor_unittest.mm index 0e8460b..78f570b 100644 --- a/chrome/browser/mac/exception_processor_unittest.mm +++ b/chrome/browser/mac/exception_processor_unittest.mm
@@ -154,6 +154,65 @@ ".*TEST PASS.*"); } +void ThrowExceptionFromSelector() { + base::mac::DisableOSCrashDumps(); + chrome::InstallObjcExceptionPreprocessor(); + + NSException* exception = [NSException exceptionWithName:@"ThrowFromSelector" + reason:@"" + userInfo:nil]; + + [exception performSelector:@selector(raise) withObject:nil afterDelay:0.1]; + + [[NSRunLoop currentRunLoop] runUntilDate: + [NSDate dateWithTimeIntervalSinceNow:10]]; + + fprintf(stderr, "TEST FAILED\n"); + exit(1); +} + +TEST(ExceptionProcessorTest, ThrowExceptionFromSelector) { + ::testing::FLAGS_gtest_death_test_style = "threadsafe"; + EXPECT_DEATH(ThrowExceptionFromSelector(), + ".*FATAL:exception_processor\\.mm.*" + "Terminating from Objective-C exception:.*"); +} + +void ThrowInNotificationObserver() { + base::mac::DisableOSCrashDumps(); + chrome::InstallObjcExceptionPreprocessor(); + + NSNotification* notification = + [NSNotification notificationWithName:@"TestExceptionInObserver" + object:nil]; + + NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; + [center addObserverForName:[notification name] + object:nil + queue:nil + usingBlock:^(NSNotification*) { + [NSException raise:@"ThrowInNotificationObserver" + format:@""]; + }]; + + [center performSelector:@selector(postNotification:) + withObject:notification + afterDelay:0]; + + [[NSRunLoop currentRunLoop] runUntilDate: + [NSDate dateWithTimeIntervalSinceNow:10]]; + + fprintf(stderr, "TEST FAILED\n"); + exit(1); +} + +TEST(ExceptionProcessorTest, ThrowInNotificationObserver) { + ::testing::FLAGS_gtest_death_test_style = "threadsafe"; + EXPECT_DEATH(ThrowInNotificationObserver(), + ".*FATAL:exception_processor\\.mm.*" + "Terminating from Objective-C exception:.*"); +} + void ThrowExceptionInRunLoopWithoutProcessor() { base::mac::DisableOSCrashDumps(); chrome::UninstallObjcExceptionPreprocessor();
diff --git a/chrome/browser/net/errorpage_browsertest.cc b/chrome/browser/net/errorpage_browsertest.cc index 6e1fa82..018c7aa 100644 --- a/chrome/browser/net/errorpage_browsertest.cc +++ b/chrome/browser/net/errorpage_browsertest.cc
@@ -1494,12 +1494,14 @@ EXPECT_TRUE(IsDisplayingText(browser(), kHostnameJSUnicode)); } -// Make sure HTTP/0.9 is disabled on non-default ports by default. +// Make sure HTTP/0.9 is enabled on non-default ports by default. IN_PROC_BROWSER_TEST_F(ErrorPageTest, Http09WeirdPort) { + const char kHttp09Response[] = "JumboShrimp"; ASSERT_TRUE(embedded_test_server()->Start()); ui_test_utils::NavigateToURL( - browser(), embedded_test_server()->GetURL("/echo-raw?spam")); - ExpectDisplayingLocalErrorPage(browser(), net::ERR_INVALID_HTTP_RESPONSE); + browser(), embedded_test_server()->GetURL(std::string("/echo-raw?") + + kHttp09Response)); + EXPECT_TRUE(IsDisplayingText(browser(), kHttp09Response)); } class ErrorPageWithHttp09OnNonDefaultPortsTest : public InProcessBrowserTest {
diff --git a/chrome/browser/resources/settings/bluetooth_page/bluetooth_device_dialog.js b/chrome/browser/resources/settings/bluetooth_page/bluetooth_device_dialog.js index e84f96c4..a5ebfd0 100644 --- a/chrome/browser/resources/settings/bluetooth_page/bluetooth_device_dialog.js +++ b/chrome/browser/resources/settings/bluetooth_page/bluetooth_device_dialog.js
@@ -60,7 +60,7 @@ return; // If the iron-list is populated with at least one visible item then // focus it. - let item = this.$$('iron-list bluetooth-device-list-item'); + var item = this.$$('iron-list bluetooth-device-list-item'); if (item && item.offsetParent != null) { item.focus(); this.itemWasFocused_ = true;
diff --git a/chrome/browser/resources/settings/bluetooth_page/bluetooth_device_list_item.js b/chrome/browser/resources/settings/bluetooth_page/bluetooth_device_list_item.js index fb87d7a..898e479 100644 --- a/chrome/browser/resources/settings/bluetooth_page/bluetooth_device_list_item.js +++ b/chrome/browser/resources/settings/bluetooth_page/bluetooth_device_list_item.js
@@ -26,15 +26,15 @@ * @private */ onMenuButtonTap_: function(event) { - let button = /** @type {!HTMLElement} */ (event.target); - let menu = /** @type {!CrActionMenuElement} */ (this.$.dotsMenu); + var button = /** @type {!HTMLElement} */ (event.target); + var menu = /** @type {!CrActionMenuElement} */ (this.$.dotsMenu); menu.showAt(button); event.stopPropagation(); }, /** @private */ onConnectActionTap_: function() { - let action = this.isDisconnected_(this.device) ? 'connect' : 'disconnect'; + var action = this.isDisconnected_(this.device) ? 'connect' : 'disconnect'; this.fire('device-event', { action: action, device: this.device,
diff --git a/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.js b/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.js index 35054c2..29a6ca68 100644 --- a/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.js +++ b/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.js
@@ -228,8 +228,8 @@ /** @private */ deviceListChanged_: function() { - for (let device of this.deviceList_) { - if (device.connected) { + for (var i = 0; i < this.deviceList_.length; ++i) { + if (this.deviceList_[i].connected) { this.deviceConnected_ = true; return; } @@ -455,8 +455,8 @@ // TODO(stevenjb): Show error. console.error( 'Error setting pairing response: ' + options.device.name + - ': Response: ' + options.response + ': Error: ' + - chrome.runtime.lastError.message); + ': Response: ' + options.response + + ': Error: ' + chrome.runtime.lastError.message); } this.$$('#deviceDialog').close(); }.bind(this));
diff --git a/chrome/browser/resources/settings/device_page/display.js b/chrome/browser/resources/settings/device_page/display.js index c2ea9e9..31e25c8 100644 --- a/chrome/browser/resources/settings/device_page/display.js +++ b/chrome/browser/resources/settings/device_page/display.js
@@ -153,7 +153,7 @@ selectedDisplayChanged_: function() { // Set |modeValues_| before |selectedModeIndex_| so that the slider updates // correctly. - let numModes = this.selectedDisplay.modes.length; + var numModes = this.selectedDisplay.modes.length; if (numModes == 0) { this.modeValues_ = []; this.selectedModeIndex_ = 0; @@ -270,15 +270,15 @@ this.currentSelectedModeIndex_ == -1) { // If currentSelectedModeIndex_ == -1, selectedDisplay and // selectedModeIndex_ are not in sync. - let widthStr = this.selectedDisplay.bounds.width.toString(); - let heightStr = this.selectedDisplay.bounds.height.toString(); - return this.i18n('displayResolutionText', widthStr, heightStr); + return this.i18n( + 'displayResolutionText', this.selectedDisplay.bounds.width.toString(), + this.selectedDisplay.bounds.height.toString()); } - let mode = this.selectedDisplay.modes[this.selectedModeIndex_]; - let best = + var mode = this.selectedDisplay.modes[this.selectedModeIndex_]; + var best = this.selectedDisplay.isInternal ? mode.uiScale == 1.0 : mode.isNative; - let widthStr = mode.width.toString(); - let heightStr = mode.height.toString(); + var widthStr = mode.width.toString(); + var heightStr = mode.height.toString(); if (best) return this.i18n('displayResolutionTextBest', widthStr, heightStr); else if (mode.isNative) @@ -292,7 +292,8 @@ */ onSelectDisplay_: function(e) { var id = e.detail; - for (let display of this.displays) { + for (var i = 0; i < this.displays.length; ++i) { + var display = this.displays[i]; if (id != display.id) continue; this.currentSelectedModeIndex_ = -1; @@ -367,7 +368,7 @@ * @private */ onOrientationChange_: function(event) { - let target = /** @type {!HTMLSelectElement} */ (event.target); + var target = /** @type {!HTMLSelectElement} */ (event.target); /** @type {!chrome.system.display.DisplayProperties} */ var properties = { rotation: parseInt(target.value, 10) }; @@ -385,7 +386,8 @@ properties.mirroringSourceId = ''; } else { // Set the mirroringSourceId of the secondary (first non-primary) display. - for (var display of this.displays) { + for (var i = 0; i < this.displays.length; ++i) { + var display = this.displays[i]; if (display.id != this.primaryDisplayId) { id = display.id; break; @@ -412,7 +414,8 @@ var displayIds = ''; var primaryDisplay = undefined; var selectedDisplay = undefined; - for (var display of this.displays) { + for (var i = 0; i < this.displays.length; ++i) { + var display = this.displays[i]; if (displayIds) displayIds += ','; displayIds += display.id;
diff --git a/chrome/browser/resources/settings/device_page/display_layout.js b/chrome/browser/resources/settings/device_page/display_layout.js index 5e080cf3..76aac19 100644 --- a/chrome/browser/resources/settings/device_page/display_layout.js +++ b/chrome/browser/resources/settings/device_page/display_layout.js
@@ -92,7 +92,7 @@ }; var maxWidth = bounds.width; var maxHeight = bounds.height; - for (let i = 1; i < this.displays.length; ++i) { + for (var i = 1; i < this.displays.length; ++i) { display = this.displays[i]; bounds = this.getCalculatedDisplayBounds(display.id); boundsBoundingBox.left = Math.min(boundsBoundingBox.left, bounds.left); @@ -156,8 +156,8 @@ Math.round(this.visualOffset_.left + (bounds.left * this.visualScale)); var top = OFFSET + Math.round(this.visualOffset_.top + (bounds.top * this.visualScale)); - return `height: ${height}px; width: ${width}px;` + - ` left: ${left}px; top: ${top}px`; + return 'height: ' + height + 'px; width: ' + width + 'px;' + + ' left: ' + left + 'px; top: ' + top + 'px'; }, /**
diff --git a/chrome/browser/resources/settings/device_page/drag_behavior.js b/chrome/browser/resources/settings/device_page/drag_behavior.js index 8bec4da..c08cf0c 100644 --- a/chrome/browser/resources/settings/device_page/drag_behavior.js +++ b/chrome/browser/resources/settings/device_page/drag_behavior.js
@@ -81,7 +81,7 @@ /** @private */ addListeners_: function() { - let container = this.container_; + var container = this.container_; if (!container || this.mouseDownListener_) return; this.mouseDownListener_ = this.onMouseDown_.bind(this); @@ -103,7 +103,7 @@ /** @private */ removeListeners_: function() { - let container = this.container_; + var container = this.container_; if (!container || !this.mouseDownListener_) return; container.removeEventListener('mousedown', this.mouseDownListener_);
diff --git a/chrome/browser/resources/settings/device_page/layout_behavior.js b/chrome/browser/resources/settings/device_page/layout_behavior.js index 82690a72..dcea057 100644 --- a/chrome/browser/resources/settings/device_page/layout_behavior.js +++ b/chrome/browser/resources/settings/device_page/layout_behavior.js
@@ -58,17 +58,20 @@ this.mirroring = displays.length > 0 && !!displays[0].mirroringSourceId; this.displayBoundsMap_.clear(); - for (let display of displays) + for (var i = 0; i < displays.length; ++i) { + var display = displays[i]; this.displayBoundsMap_.set(display.id, display.bounds); - + } this.displayLayoutMap_.clear(); - for (let layout of layouts) + for (var j = 0; j < layouts.length; ++j) { + var layout = layouts[j]; this.displayLayoutMap_.set(layout.id, layout); - + } this.calculatedBoundsMap_.clear(); - for (let display of displays) { + for (var k = 0; k < displays.length; ++k) { + display = displays[k]; if (!this.calculatedBoundsMap_.has(display.id)) { - let bounds = display.bounds; + var bounds = display.bounds; this.calculateBounds_(display.id, bounds.width, bounds.height); } } @@ -146,8 +149,6 @@ // We cannot re-parent the primary display, so instead make all other // displays orphans and clear their calculated bounds. orphanIds = this.findChildren_(id, true /* recurse */); - for (let o in orphanIds) - this.calculatedBoundsMap_.delete(o); // Re-parent |dragParentId_|. It will be forced to parent to the dragged // display since it is the only non-orphan. @@ -156,8 +157,6 @@ } else { // All immediate children of |layout| will need to be re-parented. orphanIds = this.findChildren_(id, false /* do not recurse */); - for (let o in orphanIds) - this.calculatedBoundsMap_.delete(o); // When re-parenting to a descendant, also parent any immediate child to // drag display's current parent. @@ -220,11 +219,13 @@ */ updateOrphans_: function(orphanIds) { var orphans = orphanIds.slice(); - for (let orphan of orphanIds) { + for (var i = 0; i < orphanIds.length; ++i) { + var orphan = orphanIds[i]; var newOrphans = this.findChildren_(orphan, true /* recurse */); // If the dragged display was re-parented to one of its children, // there may be duplicates so merge the lists. - for (let o of newOrphans) { + for (var ii = 0; ii < newOrphans.length; ++ii) { + var o = newOrphans[ii]; if (!orphans.includes(o)) orphans.push(o); } @@ -292,10 +293,9 @@ */ findChildren_: function(parentId, recurse) { var children = []; - for (let childId of this.displayLayoutMap_.keys()) { - if (childId == parentId) - continue; - if (this.displayLayoutMap_.get(childId).parentId == parentId) { + this.displayLayoutMap_.forEach(function(value, key) { + var childId = key; + if (childId != parentId && value.parentId == parentId) { // Insert immediate children at the front of the array. children.unshift(childId); if (recurse) { @@ -303,7 +303,7 @@ children = children.concat(this.findChildren_(childId, true)); } } - } + }.bind(this)); return children; }, @@ -370,7 +370,9 @@ var y = bounds.top + bounds.height / 2; var closestId = ''; var closestDelta2 = 0; - for (let otherId of this.calculatedBoundsMap_.keys()) { + var keys = this.calculatedBoundsMap_.keys(); + for (var iter = keys.next(); !iter.done; iter = keys.next()) { + var otherId = iter.value; if (otherId == displayId) continue; if (opt_ignoreIds && opt_ignoreIds.includes(otherId)) @@ -551,7 +553,10 @@ var checkCollisions = true; while (checkCollisions) { checkCollisions = false; - for (let otherId of others) { + var othersValues = others.values(); + for (var iter = othersValues.next(); !iter.done; + iter = othersValues.next()) { + var otherId = iter.value; var otherBounds = this.getCalculatedDisplayBounds(otherId); if (this.collideWithBoundsAndModifyDelta_( bounds, otherBounds, deltaPos)) { @@ -591,24 +596,24 @@ // the point is already inside. if (Math.abs(deltaPos.x) > Math.abs(deltaPos.y)) { deltaPos.y = 0; - let snapDeltaX; + var snapDeltaX; if (deltaPos.x > 0) { - let x = otherBounds.left - bounds.width; - snapDeltaX = Math.max(0, x - bounds.left); + snapDeltaX = + Math.max(0, (otherBounds.left - bounds.width) - bounds.left); } else { - let x = otherBounds.left + otherBounds.width; - snapDeltaX = Math.min(x - bounds.left, 0); + snapDeltaX = + Math.min(0, (otherBounds.left + otherBounds.width) - bounds.left); } deltaPos.x = snapDeltaX; } else { deltaPos.x = 0; - let snapDeltaY; + var snapDeltaY; if (deltaPos.y > 0) { - let y = otherBounds.top - bounds.height; - snapDeltaY = Math.min(0, y - bounds.top); + snapDeltaY = + Math.min(0, (otherBounds.top - bounds.height) - bounds.top); } else if (deltaPos.y < 0) { - let y = otherBounds.top + otherBounds.height; - snapDeltaY = Math.max(y - bounds.top, 0); + snapDeltaY = + Math.max(0, (otherBounds.top + otherBounds.height) - bounds.top); } else { snapDeltaY = 0; } @@ -688,7 +693,8 @@ * @private */ highlightEdge_: function(id, layoutPosition) { - for (let layout of this.layouts) { + for (var i = 0; i < this.layouts.length; ++i) { + var layout = this.layouts[i]; var highlight = (layout.id == id) ? layoutPosition : undefined; var div = this.$$('#_' + layout.id); div.classList.toggle(
diff --git a/chrome/browser/resources/settings/internet_page/internet_detail_page.js b/chrome/browser/resources/settings/internet_page/internet_detail_page.js index 6fcc9697..312cb69 100644 --- a/chrome/browser/resources/settings/internet_page/internet_detail_page.js +++ b/chrome/browser/resources/settings/internet_page/internet_detail_page.js
@@ -157,7 +157,7 @@ this.networkingPrivate.onNetworksChanged.addListener( this.networksChangedListener_); } - let queryParams = settings.getQueryParameters(); + var queryParams = settings.getQueryParameters(); this.guid = queryParams.get('guid') || ''; if (!this.guid) { console.error('No guid specified for page:' + route); @@ -582,8 +582,8 @@ onc.NameServersConfigType = newNsConfigType; } else if (field == 'StaticIPConfig') { if (ipConfigType == CrOnc.IPConfigType.STATIC) { - let staticIpConfig = this.networkProperties.StaticIPConfig; - let ipConfigValue = /** @type {!Object} */ (value); + var staticIpConfig = this.networkProperties.StaticIPConfig; + var ipConfigValue = /** @type {!Object} */ (value); if (staticIpConfig && this.allPropertiesMatch_(staticIpConfig, ipConfigValue)) { return; @@ -594,12 +594,12 @@ onc.StaticIPConfig = /** @type {!chrome.networkingPrivate.IPConfigProperties} */ ({}); } - for (let key in value) + for (var key in value) onc.StaticIPConfig[key] = value[key]; } else if (field == 'NameServers') { // If a StaticIPConfig property is specified and its NameServers value // matches the new value, no need to set anything. - let nameServers = /** @type {!Array<string>} */ (value); + var nameServers = /** @type {!Array<string>} */ (value); if (onc.NameServersConfigType == CrOnc.IPConfigType.STATIC && onc.StaticIPConfig && onc.StaticIPConfig.NameServers == nameServers) { return; @@ -700,8 +700,8 @@ * @private */ hasVisibleFields_: function(fields) { - for (let key of fields) { - let value = this.get(key, this.networkProperties); + for (var i = 0; i < fields.length; ++i) { + var value = this.get(fields[i], this.networkProperties); if (value !== undefined && value !== '') return true; } @@ -728,7 +728,7 @@ 'RestrictedConnectivity', 'Cellular.ServingOperator.Name'); } if (this.networkProperties.Type == CrOnc.Type.VPN) { - let vpnType = CrOnc.getActiveValue(this.networkProperties.VPN.Type); + var vpnType = CrOnc.getActiveValue(this.networkProperties.VPN.Type); if (vpnType == 'ThirdPartyVPN') { fields.push('VPN.ThirdPartyVPN.ProviderName'); } else { @@ -865,7 +865,7 @@ * @private */ allPropertiesMatch_: function(curValue, newValue) { - for (let key in newValue) { + for (var key in newValue) { if (newValue[key] != curValue[key]) return false; }
diff --git a/chrome/browser/resources/settings/internet_page/internet_page.js b/chrome/browser/resources/settings/internet_page/internet_page.js index b08722e..cd63a51 100644 --- a/chrome/browser/resources/settings/internet_page/internet_page.js +++ b/chrome/browser/resources/settings/internet_page/internet_page.js
@@ -159,7 +159,7 @@ * @private */ onAddThirdPartyVpnTap_: function(event) { - let provider = event.model.item; + var provider = event.model.item; chrome.send('addNetwork', [CrOnc.Type.VPN, provider.ExtensionID]); }, @@ -169,9 +169,9 @@ * @private */ onGetAllExtensions_: function(extensions) { - let vpnProviders = []; - for (var extension of extensions) - this.addVpnProvider_(vpnProviders, extension); + var vpnProviders = []; + for (var i = 0; i < extensions.length; ++i) + this.addVpnProvider_(vpnProviders, extensions[i]); this.thirdPartyVpnProviders_ = vpnProviders; },
diff --git a/chrome/browser/resources/settings/internet_page/network_apnlist.js b/chrome/browser/resources/settings/internet_page/network_apnlist.js index 66bdde1..629e27c2 100644 --- a/chrome/browser/resources/settings/internet_page/network_apnlist.js +++ b/chrome/browser/resources/settings/internet_page/network_apnlist.js
@@ -181,7 +181,7 @@ * @private */ onSelectApnChange_: function(event) { - let target = /** @type {!HTMLSelectElement} */(event.target); + var target = /** @type {!HTMLSelectElement} */(event.target); var accessPointName = target.value; // When selecting 'Other', don't set a change event unless a valid // non-default value has been set for Other. @@ -262,10 +262,8 @@ * @private */ findApnInList: function(apnList, accessPointName) { - for (let a of apnList) { - if (a.AccessPointName == accessPointName) - return a; - } - return undefined; + return apnList.find(function(a) { + return a.AccessPointName == accessPointName; + }); } });
diff --git a/chrome/browser/resources/settings/internet_page/network_ip_config.js b/chrome/browser/resources/settings/internet_page/network_ip_config.js index 90b8e39..b67955e 100644 --- a/chrome/browser/resources/settings/internet_page/network_ip_config.js +++ b/chrome/browser/resources/settings/internet_page/network_ip_config.js
@@ -140,8 +140,8 @@ var result = {}; if (!ipconfig) return result; - for (let key in ipconfig) { - let value = ipconfig[key]; + for (var key in ipconfig) { + var value = ipconfig[key]; if (key == 'RoutingPrefix') result.RoutingPrefix = CrOnc.getRoutingPrefixAsNetmask(value); else @@ -158,8 +158,8 @@ */ getIPConfigProperties_: function(ipconfig) { var result = {}; - for (let key in ipconfig) { - let value = ipconfig[key]; + for (var key in ipconfig) { + var value = ipconfig[key]; if (key == 'RoutingPrefix') result.RoutingPrefix = CrOnc.getRoutingPrefixAsLength(value); else
diff --git a/chrome/browser/resources/settings/internet_page/network_nameservers.js b/chrome/browser/resources/settings/internet_page/network_nameservers.js index 1dd03da..1429517c 100644 --- a/chrome/browser/resources/settings/internet_page/network_nameservers.js +++ b/chrome/browser/resources/settings/internet_page/network_nameservers.js
@@ -110,7 +110,7 @@ setNameservers_: function(nameserversType, nameservers) { if (nameserversType == 'custom') { // Add empty entries for unset custom nameservers. - for (let i = nameservers.length; i < this.MAX_NAMESERVERS; ++i) + for (var i = nameservers.length; i < this.MAX_NAMESERVERS; ++i) nameservers[i] = ''; } this.nameservers_ = nameservers; @@ -153,8 +153,8 @@ onTypeChange_: function(event) { if (this.nameserversType_ == 'custom') this.savedNameservers_ = this.nameservers_; - let target = /** @type {!HTMLSelectElement} */ (event.target); - let type = target.value; + var target = /** @type {!HTMLSelectElement} */ (event.target); + var type = target.value; this.nameserversType_ = type; if (type == 'custom') { // Restore the saved nameservers. @@ -187,24 +187,19 @@ var type = this.nameserversType_; if (type == 'custom') { - let nameservers = []; - for (let i = 0; i < this.MAX_NAMESERVERS; ++i) { - let id = 'nameserver' + i; - let nameserverInput = this.$$('#' + id); - let nameserver = ''; - if (nameserverInput) - nameserver = this.$$('#' + id).value; - nameservers.push(nameserver); + var nameservers = new Array(this.MAX_NAMESERVERS); + for (var i = 0; i < this.MAX_NAMESERVERS; ++i) { + var nameserverInput = this.$$('#nameserver' + i); + nameservers[i] = nameserverInput ? nameserverInput.value : ''; } this.fire('nameservers-change', { field: 'NameServers', value: nameservers, }); } else if (type == 'google') { - let nameservers = this.GOOGLE_NAMESERVERS; this.fire('nameservers-change', { field: 'NameServers', - value: nameservers, + value: this.GOOGLE_NAMESERVERS, }); } else { // automatic
diff --git a/chrome/browser/resources/settings/internet_page/network_property_list.js b/chrome/browser/resources/settings/internet_page/network_property_list.js index c82744b..d64e622 100644 --- a/chrome/browser/resources/settings/internet_page/network_property_list.js +++ b/chrome/browser/resources/settings/internet_page/network_property_list.js
@@ -91,8 +91,8 @@ // We do not provide translations for every possible network property key. // For keys specific to a type, strip the type prefix. var result = prefix + key; - for (let entry in chrome.networkingPrivate.NetworkType) { - let type = chrome.networkingPrivate.NetworkType[entry]; + for (var entry in chrome.networkingPrivate.NetworkType) { + var type = chrome.networkingPrivate.NetworkType[entry]; if (result.startsWith(type + '.')) { result = result.substr(type.length + 1); break; @@ -160,7 +160,7 @@ if (typeof value == 'number' || typeof value == 'boolean') return value.toString(); assert(typeof value == 'string'); - let valueStr = /** @type {string} */ (value); + var valueStr = /** @type {string} */ (value); var oncKey = 'Onc' + prefix + key; oncKey = oncKey.replace(/\./g, '-'); oncKey += '_' + valueStr;
diff --git a/chrome/browser/resources/settings/internet_page/network_proxy.js b/chrome/browser/resources/settings/internet_page/network_proxy.js index 01a2a08..9e96db90 100644 --- a/chrome/browser/resources/settings/internet_page/network_proxy.js +++ b/chrome/browser/resources/settings/internet_page/network_proxy.js
@@ -153,7 +153,7 @@ // For shared networks with unmanaged proxy settings, ignore any saved // proxy settings (use the default values). if (this.isShared_()) { - let property = this.getProxySettingsTypeProperty_(); + var property = this.getProxySettingsTypeProperty_(); if (!this.isControlled(property) && !this.useSharedProxies_) { this.setProxyAsync_(proxy); return; // Proxy settings will be ignored. @@ -184,11 +184,11 @@ /** @type {!CrOnc.ProxyLocation|undefined} */ ( CrOnc.getSimpleActiveProperties(proxySettings.Manual.SOCKS)) || proxy.Manual.HTTPProxy; - let json_http = JSON.stringify(proxy.Manual.HTTPProxy); + var jsonHttp = proxy.Manual.HTTPProxy; this.useSameProxy_ = - json_http == JSON.stringify(proxy.Manual.SecureHTTPProxy) && - json_http == JSON.stringify(proxy.Manual.FTPProxy) && - json_http == JSON.stringify(proxy.Manual.SOCKS); + CrOnc.proxyMatches(jsonHttp, proxy.Manual.SecureHTTPProxy) && + CrOnc.proxyMatches(jsonHttp, proxy.Manual.FTPProxy) && + CrOnc.proxyMatches(jsonHttp, proxy.Manual.SOCKS); } if (proxySettings.ExcludeDomains) { proxy.ExcludeDomains = /** @type {!Array<string>|undefined} */ ( @@ -228,7 +228,7 @@ /** @private */ useSharedProxiesChanged_: function() { - let pref = this.getPref('settings.use_shared_proxies'); + var pref = this.getPref('settings.use_shared_proxies'); this.useSharedProxies_ = !!pref && !!pref.value; this.updateProxy_(); }, @@ -257,10 +257,10 @@ */ sendProxyChange_: function() { if (this.proxy_.Type == CrOnc.ProxySettingsType.MANUAL) { - let proxy = + var proxy = /** @type {!CrOnc.ProxySettings} */ (Object.assign({}, this.proxy_)); - let manual = proxy.Manual; - let defaultProxy = manual.HTTPProxy; + var manual = proxy.Manual; + var defaultProxy = manual.HTTPProxy; if (!defaultProxy || !defaultProxy.Host) return; if (this.useSameProxy_ || !this.get('SecureHTTPProxy.Host', manual)) { @@ -292,7 +292,7 @@ * @private */ onTypeChange_: function(event) { - let target = /** @type {!HTMLSelectElement} */ (event.target); + var target = /** @type {!HTMLSelectElement} */ (event.target); var type = /** @type {chrome.networkingPrivate.ProxySettingsType} */ ( target.value); this.set('proxy_.Type', type); @@ -370,7 +370,7 @@ * @private */ shouldShowNetworkPolicyIndicator_: function() { - let property = this.getProxySettingsTypeProperty_(); + var property = this.getProxySettingsTypeProperty_(); return !!property && !this.isExtensionControlled(property) && this.isNetworkPolicyEnforced(property); }, @@ -380,7 +380,7 @@ * @private */ shouldShowExtensionIndicator_: function() { - let property = this.getProxySettingsTypeProperty_(); + var property = this.getProxySettingsTypeProperty_(); return !!property && this.isExtensionControlled(property); }, @@ -403,7 +403,7 @@ return false; if (!this.networkProperties.hasOwnProperty('ProxySettings')) return true; // No proxy settings defined, so not enforced. - let property = /** @type {!CrOnc.ManagedProperty|undefined} */ ( + var property = /** @type {!CrOnc.ManagedProperty|undefined} */ ( this.get('ProxySettings.' + propertyName, this.networkProperties)); if (!property) return true;
diff --git a/chrome/browser/resources/settings/internet_page/network_summary.js b/chrome/browser/resources/settings/internet_page/network_summary.js index 4035048..d917901d 100644 --- a/chrome/browser/resources/settings/internet_page/network_summary.js +++ b/chrome/browser/resources/settings/internet_page/network_summary.js
@@ -268,7 +268,7 @@ return; } // Find the active state for the type and update it. - for (let i = 0; i < this.activeNetworkStates_.length; ++i) { + for (var i = 0; i < this.activeNetworkStates_.length; ++i) { if (this.activeNetworkStates_[i].type == state.type) { this.activeNetworkStates_[i] = state; return; @@ -343,8 +343,10 @@ var newDeviceStates; if (opt_deviceStates) { newDeviceStates = /** @type {!DeviceStateObject} */ ({}); - for (let state of opt_deviceStates) + for (var i = 0; i < opt_deviceStates.length; ++i) { + var state = opt_deviceStates[i]; newDeviceStates[state.Type] = state; + } } else { newDeviceStates = this.deviceStates_; } @@ -363,16 +365,16 @@ }; var firstConnectedNetwork = null; - networkStates.forEach(function(state) { - let type = state.Type; + networkStates.forEach(function(networkState) { + var type = networkState.Type; if (!activeNetworkStatesByType.has(type)) { - activeNetworkStatesByType.set(type, state); - if (!firstConnectedNetwork && state.Type != CrOnc.Type.VPN && - state.ConnectionState == CrOnc.ConnectionState.CONNECTED) { - firstConnectedNetwork = state; + activeNetworkStatesByType.set(type, networkState); + if (!firstConnectedNetwork && networkState.Type != CrOnc.Type.VPN && + networkState.ConnectionState == CrOnc.ConnectionState.CONNECTED) { + firstConnectedNetwork = networkState; } } - newNetworkStateLists[type].push(state); + newNetworkStateLists[type].push(networkState); }, this); this.defaultNetwork = firstConnectedNetwork; @@ -387,17 +389,18 @@ // Push the active networks onto newActiveNetworkStates in order based on // device priority, creating an empty state for devices with no networks. - let newActiveNetworkStates = []; + var newActiveNetworkStates = []; this.activeNetworkIds_ = new Set; - let orderedDeviceTypes = [ + var orderedDeviceTypes = [ CrOnc.Type.ETHERNET, CrOnc.Type.WI_FI, CrOnc.Type.CELLULAR, CrOnc.Type.WI_MAX, CrOnc.Type.VPN ]; - for (let type of orderedDeviceTypes) { - let device = newDeviceStates[type]; + for (var i = 0; i < orderedDeviceTypes.length; ++i) { + var type = orderedDeviceTypes[i]; + var device = newDeviceStates[type]; if (!device) continue; - let state = activeNetworkStatesByType.get(type) || {GUID: '', Type: type}; + var state = activeNetworkStatesByType.get(type) || {GUID: '', Type: type}; if (state.Source === undefined && device.State == chrome.networkingPrivate.DeviceStateType.PROHIBITED) { // Prohibited technologies are enforced by the device policy.
diff --git a/chrome/browser/resources/settings/internet_page/network_summary_item.js b/chrome/browser/resources/settings/internet_page/network_summary_item.js index 4b6ff90a..22662ba8 100644 --- a/chrome/browser/resources/settings/internet_page/network_summary_item.js +++ b/chrome/browser/resources/settings/internet_page/network_summary_item.js
@@ -104,7 +104,7 @@ * @private */ showSimInfo_: function() { - let device = this.deviceState; + var device = this.deviceState; if (device.Type != CrOnc.Type.CELLULAR || this.deviceIsEnabled_(this.deviceState)) { return false; @@ -201,7 +201,7 @@ expandIsVisible_: function() { if (!this.deviceIsEnabled_(this.deviceState)) return false; - let type = this.deviceState.Type; + var type = this.deviceState.Type; var minLength = (type == CrOnc.Type.WI_FI || type == CrOnc.Type.VPN) ? 1 : 2; return this.networkStateList.length >= minLength;
diff --git a/chrome/browser/resources/settings/passwords_and_forms_page/passwords_section.html b/chrome/browser/resources/settings/passwords_and_forms_page/passwords_section.html index f3073fb..7c9cfe4 100644 --- a/chrome/browser/resources/settings/passwords_and_forms_page/passwords_section.html +++ b/chrome/browser/resources/settings/passwords_and_forms_page/passwords_section.html
@@ -24,17 +24,19 @@ width: 0; } - /* The following non-flex directives allow eliding long originUrls from - * the left. Forcing rtl should not cause an issue for right-to-left - * languages in this case, since valid URL characters are restricted to - * ASCII. */ .website-column { - direction: rtl; + display: flex; flex: 3; - overflow: hidden; - text-align: left; - text-overflow: ellipsis; - white-space: nowrap; + } + + #originUrl { + /* The following non-flex directives allow eliding long originUrls from + * the left. Forcing rtl should not cause an issue for right-to-left + * languages in this case, since valid URL characters are restricted to + * ASCII. + */ + direction: rtl; + display: flex; } .username-column { @@ -84,9 +86,13 @@ scroll-target="[[subpageScrollTarget]]"> <template> <div class="list-item"> - <div class="website-column"> - <a id="originUrl" target="_blank" class="selectable" - href="[[item.linkUrl]]">[[item.loginPair.originUrl]]</a> + <div class="website-column no-min-width"> + <a id="originUrl" target="_blank" class="selectable no-min-width" + href="[[item.linkUrl]]"> + <span class="text-elide"> + [[item.loginPair.originUrl]] + </span> + </a> </div> <div class="username-column selectable" id="username">[[item.loginPair.username]]</div>
diff --git a/chrome/browser/resources/settings/people_page/people_page.html b/chrome/browser/resources/settings/people_page/people_page.html index b665839..f84470a 100644 --- a/chrome/browser/resources/settings/people_page/people_page.html +++ b/chrome/browser/resources/settings/people_page/people_page.html
@@ -99,17 +99,6 @@ padding-bottom: 10px; padding-top: 10px; } - - /** - * By default, flexbox children have min-width calculated to be the width - * of the content. However, in some cases we might want to allow the - * width to be smaller than the content (i.e. for long text to ellipsis). - * In such cases this class should be applied. - * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=1108514#c5) - */ - .no-min-width { - min-width: 0; - } </style> <settings-animated-pages id="pages" section="people"> <neon-animatable route-path="default">
diff --git a/chrome/browser/resources/settings/settings_shared_css.html b/chrome/browser/resources/settings/settings_shared_css.html index 8b4b3825..9526560 100644 --- a/chrome/browser/resources/settings/settings_shared_css.html +++ b/chrome/browser/resources/settings/settings_shared_css.html
@@ -170,6 +170,17 @@ white-space: nowrap; } + /** + * By default, flexbox children have min-width calculated to be the width + * of the content. However, in some cases we might want to allow the + * width to be smaller than the content (i.e. for long text to ellipsis). + * In such cases this class should be applied. + * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=1108514#c5) + */ + .no-min-width { + min-width: 0; + } + .button-strip { text-align: end; }
diff --git a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm index 01df50c..06e6398f 100644 --- a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm +++ b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
@@ -874,10 +874,14 @@ IsLocationBarDark()); } +// TODO(spqchan): Add tests for the security state decoration. void LocationBarViewMac::UpdateSecurityState(bool tab_changed) { using SecurityLevel = security_state::SecurityLevel; SecurityLevel new_security_level = GetToolbarModel()->GetSecurityLevel(false); + if (tab_changed) + security_state_bubble_decoration_->ResetAnimation(); + // If there's enough space, but the secure state decoration had animated // out, animate it back in. Otherwise, if the security state has changed, // animate the decoration if animation is enabled and the state changed is @@ -905,8 +909,9 @@ bool LocationBarViewMac::CanAnimateSecurityLevel( security_state::SecurityLevel level) const { - return security_level_ == security_state::SecurityLevel::DANGEROUS || - security_level_ == security_state::SecurityLevel::HTTP_SHOW_WARNING; + return !GetOmniboxView()->IsEditingOrEmpty() && + (security_level_ == security_state::SecurityLevel::DANGEROUS || + security_level_ == security_state::SecurityLevel::HTTP_SHOW_WARNING); } bool LocationBarViewMac::IsSecureConnection(
diff --git a/chrome/test/android/javatests/src/org/chromium/chrome/test/MultiActivityTestBase.java b/chrome/test/android/javatests/src/org/chromium/chrome/test/MultiActivityTestBase.java index 2141913..248cbc47 100644 --- a/chrome/test/android/javatests/src/org/chromium/chrome/test/MultiActivityTestBase.java +++ b/chrome/test/android/javatests/src/org/chromium/chrome/test/MultiActivityTestBase.java
@@ -136,7 +136,7 @@ @Override public void setUp() throws Exception { super.setUp(); - RecordHistogram.disableForTests(); + RecordHistogram.setDisabledForTests(true); mContext = getInstrumentation().getTargetContext(); CommandLineFlags.setUp(mContext, getClass().getMethod(getName())); ApplicationTestUtils.setUp(mContext, true); @@ -152,6 +152,7 @@ super.tearDown(); mStorageDelegate.ensureDirectoryDestroyed(); ApplicationTestUtils.tearDown(mContext); + RecordHistogram.setDisabledForTests(false); } /**
diff --git a/chrome/test/data/webui/settings/settings_passwords_section_browsertest.js b/chrome/test/data/webui/settings/settings_passwords_section_browsertest.js index 4443d97a..215f67e 100644 --- a/chrome/test/data/webui/settings/settings_passwords_section_browsertest.js +++ b/chrome/test/data/webui/settings/settings_passwords_section_browsertest.js
@@ -55,7 +55,7 @@ assert(node); var passwordInfo = passwordList[0]; assertEquals(passwordInfo.loginPair.originUrl, - node.querySelector('#originUrl').textContent); + node.querySelector('#originUrl').textContent.trim()); assertEquals(passwordInfo.linkUrl, node.querySelector('#originUrl').href); assertEquals(passwordInfo.loginPair.username,
diff --git a/content/browser/devtools/protocol/devtools_protocol_browsertest.cc b/content/browser/devtools/protocol/devtools_protocol_browsertest.cc index 50358c27..b7a73c0 100644 --- a/content/browser/devtools/protocol/devtools_protocol_browsertest.cc +++ b/content/browser/devtools/protocol/devtools_protocol_browsertest.cc
@@ -49,12 +49,10 @@ #include "third_party/skia/include/core/SkColor.h" #include "ui/base/layout.h" #include "ui/compositor/compositor_switches.h" -#include "ui/gfx/codec/jpeg_codec.h" #include "ui/gfx/codec/png_codec.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/size.h" #include "ui/gfx/skia_util.h" -#include "ui/snapshot/snapshot.h" #define EXPECT_SIZE_EQ(expected, actual) \ do { \ @@ -533,37 +531,10 @@ bitmap); } -std::unique_ptr<SkBitmap> DecodeJPEG(std::string base64_data) { - std::string jpeg_data; - if (!base::Base64Decode(base64_data, &jpeg_data)) - return nullptr; - return gfx::JPEGCodec::Decode( - reinterpret_cast<unsigned const char*>(jpeg_data.data()), - jpeg_data.size()); -} - -bool ColorsMatchWithinLimit(SkColor color1, - SkColor color2, - int32_t error_limit) { - auto a_distance = std::abs(static_cast<int32_t>(SkColorGetA(color1)) - - static_cast<int32_t>(SkColorGetA(color2))); - auto r_distance = std::abs(static_cast<int32_t>(SkColorGetR(color1)) - - static_cast<int32_t>(SkColorGetR(color2))); - auto g_distance = std::abs(static_cast<int32_t>(SkColorGetG(color1)) - - static_cast<int32_t>(SkColorGetG(color2))); - auto b_distance = std::abs(static_cast<int32_t>(SkColorGetB(color1)) - - static_cast<int32_t>(SkColorGetB(color2))); - - return a_distance * a_distance + r_distance * r_distance + - g_distance * g_distance + b_distance * b_distance <= - error_limit * error_limit; -} - // Adapted from cc::ExactPixelComparator. bool MatchesBitmap(const SkBitmap& expected_bmp, const SkBitmap& actual_bmp, - const gfx::Rect& matching_mask, - int error_limit) { + const gfx::Rect& matching_mask) { // Number of pixels with an error int error_pixels_count = 0; @@ -586,7 +557,7 @@ for (int y = matching_mask.y(); y < matching_mask.height(); ++y) { SkColor actual_color = actual_bmp.getColor(x, y); SkColor expected_color = expected_bmp.getColor(x, y); - if (!ColorsMatchWithinLimit(actual_color, expected_color, error_limit)) { + if (actual_color != expected_color) { if (error_pixels_count < 10) { LOG(ERROR) << "Pixel (" << x << "," << y << "): expected " << expected_color << " actual " << actual_color; @@ -609,38 +580,19 @@ class CaptureScreenshotTest : public DevToolsProtocolTest { protected: - enum ScreenshotEncoding { ENCODING_PNG, ENCODING_JPEG }; - void CaptureScreenshotAndCompareTo(const SkBitmap& expected_bitmap, - ScreenshotEncoding encoding) { - std::unique_ptr<base::DictionaryValue> params(new base::DictionaryValue()); - params->SetString("format", encoding == ENCODING_PNG ? "png" : "jpeg"); - params->SetInteger("quality", 100); - SendCommand("Page.captureScreenshot", std::move(params)); - + void CaptureScreenshotAndCompareTo(const SkBitmap& expected_bitmap) { + SendCommand("Page.captureScreenshot", nullptr); std::string base64; EXPECT_TRUE(result_->GetString("data", &base64)); - std::unique_ptr<SkBitmap> result_bitmap; - int error_limit = 0; - if (encoding == ENCODING_PNG) { - result_bitmap.reset(new SkBitmap()); - EXPECT_TRUE(DecodePNG(base64, result_bitmap.get())); - } else { - result_bitmap = DecodeJPEG(base64); - // Even with quality 100, jpeg isn't lossless. So, we allow some skew in - // pixel values. Not that this assumes that there is no skew in pixel - // positions, so will only work reliably if all pixels have equal values. - error_limit = 3; - } - EXPECT_TRUE(result_bitmap); - + SkBitmap result_bitmap; + EXPECT_TRUE(DecodePNG(base64, &result_bitmap)); gfx::Rect matching_mask(gfx::SkIRectToRect(expected_bitmap.bounds())); #if defined(OS_MACOSX) // Mask out the corners, which may be drawn differently on Mac because of // rounded corners. matching_mask.Inset(4, 4, 4, 4); #endif - EXPECT_TRUE(MatchesBitmap(expected_bitmap, *result_bitmap, matching_mask, - error_limit)); + EXPECT_TRUE(MatchesBitmap(expected_bitmap, result_bitmap, matching_mask)); } // Takes a screenshot of a colored box that is positioned inside the frame. @@ -699,7 +651,7 @@ expected_bitmap.allocN32Pixels(scaled_box_size.width(), scaled_box_size.height()); expected_bitmap.eraseColor(SkColorSetRGB(0x00, 0x00, 0xff)); - CaptureScreenshotAndCompareTo(expected_bitmap, ENCODING_PNG); + CaptureScreenshotAndCompareTo(expected_bitmap); // Reset for next screenshot. SendCommand("Emulation.resetViewport", nullptr); @@ -717,13 +669,13 @@ IN_PROC_BROWSER_TEST_F(CaptureScreenshotTest, CaptureScreenshot) { // This test fails consistently on low-end Android devices. // See crbug.com/653637. - // TODO(eseckler): Reenable with error limit if necessary. if (base::SysInfo::IsLowEndDevice()) return; - shell()->LoadURL( - GURL("data:text/html,<body style='background:#123456'></body>")); - WaitForLoadStop(shell()->web_contents()); + shell()->LoadURL(GURL("about:blank")); Attach(); + EXPECT_TRUE( + content::ExecuteScript(shell()->web_contents()->GetRenderViewHost(), + "document.body.style.background = '#123456'")); SkBitmap expected_bitmap; // We compare against the actual physical backing size rather than the // view size, because the view size is stored adjusted for DPI and only in @@ -733,30 +685,7 @@ ->GetPhysicalBackingSize(); expected_bitmap.allocN32Pixels(view_size.width(), view_size.height()); expected_bitmap.eraseColor(SkColorSetRGB(0x12, 0x34, 0x56)); - CaptureScreenshotAndCompareTo(expected_bitmap, ENCODING_PNG); -} - -IN_PROC_BROWSER_TEST_F(CaptureScreenshotTest, CaptureScreenshotJpeg) { - // This test fails consistently on low-end Android devices. - // See crbug.com/653637. - // TODO(eseckler): Reenable with error limit if necessary. - if (base::SysInfo::IsLowEndDevice()) - return; - - shell()->LoadURL( - GURL("data:text/html,<body style='background:#123456'></body>")); - WaitForLoadStop(shell()->web_contents()); - Attach(); - SkBitmap expected_bitmap; - // We compare against the actual physical backing size rather than the - // view size, because the view size is stored adjusted for DPI and only in - // integer precision. - gfx::Size view_size = static_cast<RenderWidgetHostViewBase*>( - shell()->web_contents()->GetRenderWidgetHostView()) - ->GetPhysicalBackingSize(); - expected_bitmap.allocN32Pixels(view_size.width(), view_size.height()); - expected_bitmap.eraseColor(SkColorSetRGB(0x12, 0x34, 0x56)); - CaptureScreenshotAndCompareTo(expected_bitmap, ENCODING_JPEG); + CaptureScreenshotAndCompareTo(expected_bitmap); } // Setting frame size (through RWHV) is not supported on Android.
diff --git a/content/browser/devtools/protocol/page_handler.cc b/content/browser/devtools/protocol/page_handler.cc index 740c0a2..f7ec85b 100644 --- a/content/browser/devtools/protocol/page_handler.cc +++ b/content/browser/devtools/protocol/page_handler.cc
@@ -9,8 +9,6 @@ #include "base/base64.h" #include "base/bind.h" #include "base/location.h" -#include "base/memory/ref_counted.h" -#include "base/memory/ref_counted_memory.h" #include "base/single_thread_task_runner.h" #include "base/strings/string16.h" #include "base/strings/utf_string_conversions.h" @@ -39,8 +37,6 @@ #include "ui/gfx/codec/jpeg_codec.h" #include "ui/gfx/codec/png_codec.h" #include "ui/gfx/geometry/size_conversions.h" -#include "ui/gfx/image/image.h" -#include "ui/gfx/image/image_util.h" #include "ui/snapshot/snapshot.h" #include "url/gurl.h" @@ -56,27 +52,37 @@ static int kCaptureRetryLimit = 2; static int kMaxScreencastFramesInFlight = 2; -std::string EncodeImage(const gfx::Image& image, - const std::string& format, - int quality) { - DCHECK(!image.IsEmpty()); - - scoped_refptr<base::RefCountedMemory> data; +std::string EncodeScreencastFrame(const SkBitmap& bitmap, + const std::string& format, + int quality) { + std::vector<unsigned char> data; + SkAutoLockPixels lock_image(bitmap); + bool encoded; if (format == kPng) { - data = image.As1xPNGBytes(); + encoded = gfx::PNGCodec::Encode( + reinterpret_cast<unsigned char*>(bitmap.getAddr32(0, 0)), + gfx::PNGCodec::FORMAT_SkBitmap, + gfx::Size(bitmap.width(), bitmap.height()), + bitmap.width() * bitmap.bytesPerPixel(), + false, std::vector<gfx::PNGCodec::Comment>(), &data); } else if (format == kJpeg) { - scoped_refptr<base::RefCountedBytes> bytes(new base::RefCountedBytes()); - if (gfx::JPEG1xEncodedDataFromImage(image, quality, &bytes->data())) - data = bytes; + encoded = gfx::JPEGCodec::Encode( + reinterpret_cast<unsigned char*>(bitmap.getAddr32(0, 0)), + gfx::JPEGCodec::FORMAT_SkBitmap, + bitmap.width(), + bitmap.height(), + bitmap.width() * bitmap.bytesPerPixel(), + quality, &data); + } else { + encoded = false; } - if (!data || !data->front()) + if (!encoded) return std::string(); std::string base_64_data; base::Base64Encode( - base::StringPiece(reinterpret_cast<const char*>(data->front()), - data->size()), + base::StringPiece(reinterpret_cast<char*>(&data[0]), data.size()), &base_64_data); return base_64_data; @@ -279,21 +285,15 @@ } void PageHandler::CaptureScreenshot( - Maybe<std::string> format, - Maybe<int> quality, std::unique_ptr<CaptureScreenshotCallback> callback) { if (!host_ || !host_->GetRenderWidgetHost()) { callback->sendFailure(Response::InternalError()); return; } - std::string screenshot_format = format.fromMaybe(kPng); - int screenshot_quality = quality.fromMaybe(kDefaultScreenshotQuality); - host_->GetRenderWidgetHost()->GetSnapshotFromBrowser( - base::Bind(&PageHandler::ScreenshotCaptured, weak_factory_.GetWeakPtr(), - base::Passed(std::move(callback)), screenshot_format, - screenshot_quality)); + base::Bind(&PageHandler::ScreenshotCaptured, + weak_factory_.GetWeakPtr(), base::Passed(std::move(callback)))); } Response PageHandler::StartScreencast(Maybe<std::string> format, @@ -519,8 +519,8 @@ base::PostTaskWithTraitsAndReplyWithResult( FROM_HERE, base::TaskTraits().WithShutdownBehavior( base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN), - base::Bind(&EncodeImage, gfx::Image::CreateFrom1xBitmap(bitmap), - screencast_format_, screencast_quality_), + base::Bind(&EncodeScreencastFrame, bitmap, screencast_format_, + screencast_quality_), base::Bind(&PageHandler::ScreencastFrameEncoded, weak_factory_.GetWeakPtr(), base::Passed(&metadata), base::Time::Now())); @@ -561,15 +561,18 @@ void PageHandler::ScreenshotCaptured( std::unique_ptr<CaptureScreenshotCallback> callback, - const std::string& format, - int quality, - const gfx::Image& image) { - if (image.IsEmpty()) { + const unsigned char* png_data, + size_t png_size) { + if (!png_data || !png_size) { callback->sendFailure(Response::Error("Unable to capture screenshot")); return; } - callback->sendSuccess(EncodeImage(image, format, quality)); + std::string base_64_data; + base::Base64Encode( + base::StringPiece(reinterpret_cast<const char*>(png_data), png_size), + &base_64_data); + callback->sendSuccess(base_64_data); } void PageHandler::OnColorPicked(int r, int g, int b, int a) {
diff --git a/content/browser/devtools/protocol/page_handler.h b/content/browser/devtools/protocol/page_handler.h index 5ebaa0c..fdb1ac5 100644 --- a/content/browser/devtools/protocol/page_handler.h +++ b/content/browser/devtools/protocol/page_handler.h
@@ -20,10 +20,6 @@ class SkBitmap; -namespace gfx { -class Image; -} // namespace gfx - namespace content { class DevToolsSession; @@ -69,8 +65,6 @@ Response NavigateToHistoryEntry(int entry_id) override; void CaptureScreenshot( - Maybe<std::string> format, - Maybe<int> quality, std::unique_ptr<CaptureScreenshotCallback> callback) override; Response StartScreencast(Maybe<std::string> format, Maybe<int> quality, @@ -97,8 +91,6 @@ void NavigationRequested(const PageNavigationThrottle* throttle); private: - enum EncodingFormat { PNG, JPEG }; - WebContentsImpl* GetWebContents(); void NotifyScreencastVisibility(bool visible); void InnerSwapCompositorFrame(); @@ -109,10 +101,10 @@ const base::Time& timestamp, const std::string& data); - void ScreenshotCaptured(std::unique_ptr<CaptureScreenshotCallback> callback, - const std::string& format, - int quality, - const gfx::Image& image); + void ScreenshotCaptured( + std::unique_ptr<CaptureScreenshotCallback> callback, + const unsigned char* png_data, + size_t png_size); void OnColorPicked(int r, int g, int b, int a);
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc index 23d15196..38be9707 100644 --- a/content/browser/renderer_host/render_widget_host_impl.cc +++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -87,7 +87,6 @@ #include "ui/gfx/color_space.h" #include "ui/gfx/geometry/size_conversions.h" #include "ui/gfx/geometry/vector2d_conversions.h" -#include "ui/gfx/image/image.h" #include "ui/gfx/image/image_skia.h" #include "ui/gfx/skbitmap_operations.h" #include "ui/snapshot/snapshot.h" @@ -2375,31 +2374,35 @@ gfx::Rect snapshot_bounds(GetView()->GetViewBounds().size()); #endif - gfx::Image image; - if (ui::GrabViewSnapshot(GetView()->GetNativeView(), snapshot_bounds, - &image)) { - OnSnapshotReceived(snapshot_id, image); + std::vector<unsigned char> png; + if (ui::GrabViewSnapshot( + GetView()->GetNativeView(), &png, snapshot_bounds)) { + OnSnapshotDataReceived(snapshot_id, &png.front(), png.size()); return; } ui::GrabViewSnapshotAsync( - GetView()->GetNativeView(), snapshot_bounds, - base::Bind(&RenderWidgetHostImpl::OnSnapshotReceived, - weak_factory_.GetWeakPtr(), snapshot_id)); + GetView()->GetNativeView(), + snapshot_bounds, + base::ThreadTaskRunnerHandle::Get(), + base::Bind(&RenderWidgetHostImpl::OnSnapshotDataReceivedAsync, + weak_factory_.GetWeakPtr(), + snapshot_id)); } -void RenderWidgetHostImpl::OnSnapshotReceived(int snapshot_id, - const gfx::Image& image) { +void RenderWidgetHostImpl::OnSnapshotDataReceived(int snapshot_id, + const unsigned char* data, + size_t size) { // Any pending snapshots with a lower ID than the one received are considered // to be implicitly complete, and returned the same snapshot data. PendingSnapshotMap::iterator it = pending_browser_snapshots_.begin(); while (it != pending_browser_snapshots_.end()) { - if (it->first <= snapshot_id) { - it->second.Run(image); - pending_browser_snapshots_.erase(it++); - } else { - ++it; - } + if (it->first <= snapshot_id) { + it->second.Run(data, size); + pending_browser_snapshots_.erase(it++); + } else { + ++it; + } } #if defined(OS_MACOSX) if (pending_browser_snapshots_.empty()) @@ -2407,6 +2410,15 @@ #endif } +void RenderWidgetHostImpl::OnSnapshotDataReceivedAsync( + int snapshot_id, + scoped_refptr<base::RefCountedBytes> png_data) { + if (png_data.get()) + OnSnapshotDataReceived(snapshot_id, png_data->front(), png_data->size()); + else + OnSnapshotDataReceived(snapshot_id, NULL, 0); +} + // static void RenderWidgetHostImpl::CompositorFrameDrawn( const std::vector<ui::LatencyInfo>& latency_info) {
diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h index 4e90a82..60cca7c 100644 --- a/content/browser/renderer_host/render_widget_host_impl.h +++ b/content/browser/renderer_host/render_widget_host_impl.h
@@ -53,6 +53,10 @@ struct ViewHostMsg_SelectionBounds_Params; struct ViewHostMsg_UpdateRect_Params; +namespace base { +class RefCountedBytes; +} + namespace blink { class WebInputEvent; class WebMouseEvent; @@ -66,7 +70,6 @@ #endif namespace gfx { -class Image; class Range; } @@ -205,12 +208,9 @@ void NotifyScreenInfoChanged(); // Forces redraw in the renderer and when the update reaches the browser - // grabs snapshot from the compositor. On MacOS, the snapshot is taken from - // the Cocoa view for end-to-end testing purposes. Returns a gfx::Image that - // is backed by an NSImage on MacOS or by an SkBitmap otherwise. The - // gfx::Image may be empty if the snapshot failed. + // grabs snapshot from the compositor. Returns PNG-encoded snapshot. using GetSnapshotFromBrowserCallback = - base::Callback<void(const gfx::Image&)>; + base::Callback<void(const unsigned char*, size_t)>; void GetSnapshotFromBrowser(const GetSnapshotFromBrowserCallback& callback); const NativeWebKeyboardEvent* GetLastKeyboardEvent() const; @@ -701,7 +701,13 @@ void WindowSnapshotReachedScreen(int snapshot_id); - void OnSnapshotReceived(int snapshot_id, const gfx::Image& image); + void OnSnapshotDataReceived(int snapshot_id, + const unsigned char* png, + size_t size); + + void OnSnapshotDataReceivedAsync( + int snapshot_id, + scoped_refptr<base::RefCountedBytes> png_data); // 1. Grants permissions to URL (if any) // 2. Grants permissions to filenames
diff --git a/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py b/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py index 119d9c6..8a57b370 100644 --- a/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py +++ b/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py
@@ -682,8 +682,11 @@ self.Fail('conformance2/textures/image/' + 'tex-3d-rg8ui-rg_integer-unsigned_byte.html', ['linux', ('nvidia', 0xf02)], bug=680282) - self.Fail('conformance2/textures/image_data/tex-2d-rg32f-rg-float.html', - ['linux', 'nvidia'], bug=682190) + self.Fail('conformance2/textures/image_data/tex-2d-rg16f-rg-half_float.html', + ['linux', 'nvidia'], bug=684399) + self.Fail('conformance2/textures/image_bitmap_from_blob/' + + 'tex-2d-rgb565-rgb-unsigned_byte.html', + ['linux', 'nvidia'], bug=684399) # Linux Intel self.Fail('conformance2/extensions/ext-color-buffer-float.html', @@ -696,14 +699,14 @@ self.Fail('deqp/functional/gles3/fbomultisample.8_samples.html', ['linux', 'intel'], bug=635528) - self.Fail('conformance2/textures/misc/tex-mipmap-levels.html', - ['linux', 'intel'], bug=666384) self.Fail('conformance2/textures/misc/tex-subimage3d-pixel-buffer-bug.html', ['linux', 'intel'], bug=662644) # WebGL 2.0.1 self.Fail('deqp/functional/gles3/shadertexturefunction/texturesize.html', ['linux', 'intel'], bug=666384) + self.Fail('conformance2/textures/misc/tex-3d-mipmap-levels-intel-bug.html', + ['linux', 'intel'], bug=666384) # Fails on Intel Mesa GL 3.3, passes on Intel Mesa GL 4.5. self.Fail('conformance2/misc/views-with-offsets.html',
diff --git a/content/test/gpu/gpu_tests/webgl_conformance_expectations.py b/content/test/gpu/gpu_tests/webgl_conformance_expectations.py index e72493b..3a069ffe 100644 --- a/content/test/gpu/gpu_tests/webgl_conformance_expectations.py +++ b/content/test/gpu/gpu_tests/webgl_conformance_expectations.py
@@ -148,10 +148,6 @@ 'copy-tex-image-and-sub-image-2d.html', ['win7', 'intel', 'no_passthrough']) - # Win / Intel failures - self.Skip('conformance/uniforms/gl-uniform-arrays.html', - ['win', 'debug', 'intel'], bug=678382) - # Win / Intel HD 530 failures self.Fail('conformance/canvas/to-data-url-test.html', ['win', 'intel'], bug=680797) @@ -457,8 +453,6 @@ # See https://bugs.freedesktop.org/show_bug.cgi?id=94477 self.Skip('conformance/glsl/bugs/temp-expressions-should-not-crash.html', ['linux', 'intel'], bug=540543) # GPU timeout - self.Skip('conformance/uniforms/gl-uniform-arrays.html', - ['linux', 'debug', 'intel'], bug=603906) # Fixed on Mesa 12.0 self.Fail('conformance/rendering/clipping-wide-points.html', ['linux', 'intel'], bug=642822)
diff --git a/ios/chrome/browser/reading_list/reading_list_distiller_page.h b/ios/chrome/browser/reading_list/reading_list_distiller_page.h index 8ebbfc8..44d29ca 100644 --- a/ios/chrome/browser/reading_list/reading_list_distiller_page.h +++ b/ios/chrome/browser/reading_list/reading_list_distiller_page.h
@@ -60,9 +60,9 @@ // triggers a navigation to it. Stop distillation of the page there as the new // load will trigger a new distillation. bool HandleGoogleCachedAMPPageJavaScriptResult(id result, id error); - - // Waits a delay then calls DelayedOnLoadURLDone. - void WaitForPageLoadCompletion(); + // Continue the distillation on the page that is currently loaded in + // |CurrentWebState()|. + void ContinuePageDistillation(); // Continues distillation by calling superclass |OnLoadURLDone|. void DelayedOnLoadURLDone();
diff --git a/ios/chrome/browser/reading_list/reading_list_distiller_page.mm b/ios/chrome/browser/reading_list/reading_list_distiller_page.mm index a95d1ab..8a3d58c7 100644 --- a/ios/chrome/browser/reading_list/reading_list_distiller_page.mm +++ b/ios/chrome/browser/reading_list/reading_list_distiller_page.mm
@@ -21,8 +21,9 @@ #include "url/url_constants.h" namespace { -// The delay between the page load and the distillation in seconds. -const int64_t kDistillationDelayInSeconds = 2; +// The delay given to the web page to render after the PageLoaded callback. +const int64_t kPageLoadDelayInSeconds = 2; + const char* kGetIframeURLJavaScript = "document.getElementsByTagName('iframe')[0].src;"; } // namespace @@ -105,24 +106,25 @@ DistillerPageIOS::OnLoadURLDone(load_completion_status); return; } - if (IsGoogleCachedAMPPage()) { - // Workaround for Google AMP pages. - HandleGoogleCachedAMPPage(); - } else { - WaitForPageLoadCompletion(); - } -} - -void ReadingListDistillerPage::WaitForPageLoadCompletion() { + // Page is loaded but rendering may not be done yet. Give a delay to the page. base::WeakPtr<ReadingListDistillerPage> weak_this = weak_ptr_factory_.GetWeakPtr(); base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( FROM_HERE, base::Bind(&ReadingListDistillerPage::DelayedOnLoadURLDone, weak_this), - base::TimeDelta::FromSeconds(kDistillationDelayInSeconds)); + base::TimeDelta::FromSeconds(kPageLoadDelayInSeconds)); } void ReadingListDistillerPage::DelayedOnLoadURLDone() { + if (IsGoogleCachedAMPPage()) { + // Workaround for Google AMP pages. + HandleGoogleCachedAMPPage(); + } else { + ContinuePageDistillation(); + } +} + +void ReadingListDistillerPage::ContinuePageDistillation() { // The page is ready to be distilled. // If the visible URL is not the original URL, notify the caller that URL // changed. @@ -170,7 +172,7 @@ !weak_this->HandleGoogleCachedAMPPageJavaScriptResult(result, error)) { // If there is an error on navigation, continue normal distillation. - weak_this->WaitForPageLoadCompletion(); + weak_this->ContinuePageDistillation(); } // If there is no error, the navigation completion will trigger a new // |OnLoadURLDone| call that will resume the distillation.
diff --git a/net/http/http_network_session.cc b/net/http/http_network_session.cc index c49af3b..df589ed 100644 --- a/net/http/http_network_session.cc +++ b/net/http/http_network_session.cc
@@ -156,7 +156,7 @@ quic_do_not_fragment(false), proxy_delegate(nullptr), enable_token_binding(false), - http_09_on_non_default_ports_enabled(false), + http_09_on_non_default_ports_enabled(true), restrict_to_one_preconnect_for_proxies(false) { quic_supported_versions.push_back(QUIC_VERSION_35); }
diff --git a/pdf/pdfium/pdfium_engine.cc b/pdf/pdfium/pdfium_engine.cc index 069e6b6..450c2e4 100644 --- a/pdf/pdfium/pdfium_engine.cc +++ b/pdf/pdfium/pdfium_engine.cc
@@ -2312,6 +2312,7 @@ } client_->NotifySelectedFindResultChanged(current_find_index_.GetIndex()); + client_->NotifyNumberOfFindResultsChanged(find_results_.size(), true); return true; }
diff --git a/services/ui/public/cpp/OWNERS b/services/ui/public/cpp/OWNERS index a166098..f6e789a 100644 --- a/services/ui/public/cpp/OWNERS +++ b/services/ui/public/cpp/OWNERS
@@ -1,2 +1,3 @@ per-file *_type_converter*.*=set noparent per-file *_type_converter*.*=file://ipc/SECURITY_OWNERS +per-file window_compositor_frame_sink*.*=fsamuel@chromium.org
diff --git a/services/ui/public/cpp/window_compositor_frame_sink.cc b/services/ui/public/cpp/window_compositor_frame_sink.cc index 130e6d5d..4b3f675 100644 --- a/services/ui/public/cpp/window_compositor_frame_sink.cc +++ b/services/ui/public/cpp/window_compositor_frame_sink.cc
@@ -56,6 +56,7 @@ void WindowCompositorFrameSink::DetachFromClient() { client_->SetBeginFrameSource(nullptr); begin_frame_source_.reset(); + client_binding_.reset(); compositor_frame_sink_.reset(); cc::CompositorFrameSink::DetachFromClient(); }
diff --git a/testing/buildbot/chromium.fyi.json b/testing/buildbot/chromium.fyi.json index c4b2361..ac4006ac 100644 --- a/testing/buildbot/chromium.fyi.json +++ b/testing/buildbot/chromium.fyi.json
@@ -672,116 +672,116 @@ "gtest_tests": [ { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "accessibility_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "angle_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "app_shell_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "aura_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "base_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "blink_heap_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "blink_platform_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true, + "can_use_on_swarming_builders": false, "shards": 10 }, "test": "browser_tests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "cacheinvalidation_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "capture_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "cast_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "cc_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "chromedriver_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "components_browsertests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "components_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "compositor_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "content_browsertests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "content_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "crypto_unittests" }, @@ -793,49 +793,49 @@ }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "device_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "display_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "events_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "extensions_browsertests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "extensions_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "gcm_unit_tests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "gfx_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "gin_unittests" }, @@ -847,199 +847,199 @@ }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "gn_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "google_apis_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "gpu_ipc_service_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "gpu_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "interactive_ui_tests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "ipc_tests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "jingle_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "media_blink_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "media_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "midi_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "mojo_common_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "mojo_public_bindings_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "mojo_public_system_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "mojo_system_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "nacl_loader_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "native_theme_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "net_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "pdf_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "ppapi_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "printing_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "remoting_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "sandbox_linux_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "skia_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "sql_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "storage_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "ui_base_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "ui_touch_selection_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "unit_tests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "url_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "views_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "webkit_unit_tests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "wm_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "wtf_unittests" } @@ -9828,43 +9828,43 @@ "gtest_tests": [ { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "accessibility_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "angle_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "app_shell_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "aura_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "base_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "blink_heap_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "blink_platform_unittests" }, @@ -9873,320 +9873,320 @@ "--gtest_filter=-SaveType/SavePageMultiFrameBrowserTest.ObjectElements/0" ], "swarming": { - "can_use_on_swarming_builders": true, + "can_use_on_swarming_builders": false, "shards": 10 }, "test": "browser_tests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "cacheinvalidation_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "capture_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "cc_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "chromedriver_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "components_browsertests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "components_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "compositor_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "content_browsertests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "content_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "crypto_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "dbus_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "device_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "display_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "events_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "extensions_browsertests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "extensions_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "gcm_unit_tests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "gfx_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "gin_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "gl_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "gn_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "google_apis_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "gpu_ipc_service_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "gpu_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "interactive_ui_tests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "ipc_tests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "jingle_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "media_blink_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "media_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "midi_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "mojo_common_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "mojo_public_bindings_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "mojo_public_system_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "mojo_system_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "nacl_loader_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "native_theme_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "net_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "pdf_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "ppapi_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "printing_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "remoting_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "sandbox_linux_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "skia_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "sql_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "ui_base_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "ui_touch_selection_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "unit_tests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "url_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "views_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "webkit_unit_tests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "wm_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "wtf_unittests" }
diff --git a/testing/buildbot/chromium.linux.json b/testing/buildbot/chromium.linux.json index 1780ab1..3fd2486 100644 --- a/testing/buildbot/chromium.linux.json +++ b/testing/buildbot/chromium.linux.json
@@ -2442,43 +2442,43 @@ "gtest_tests": [ { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "base_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "cacheinvalidation_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "capture_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "cast_alsa_cma_backend_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "cast_base_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "cast_crash_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "cast_media_unittests" }, @@ -2490,13 +2490,13 @@ "--test-launcher-jobs=1" ], "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "cast_shell_browsertests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "cast_shell_unittests" }, @@ -2505,103 +2505,103 @@ "--test-launcher-filter-file=src/testing/buildbot/filters/cast-linux.content_browsertests.filter" ], "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "content_browsertests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "content_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "crypto_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "gpu_ipc_service_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "gpu_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "ipc_tests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "jingle_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "media_blink_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "media_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "midi_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "net_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "ppapi_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "sandbox_linux_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "sql_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "storage_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "ui_base_unittests" }, { "swarming": { - "can_use_on_swarming_builders": true + "can_use_on_swarming_builders": false }, "test": "url_unittests" } @@ -3125,12 +3125,6 @@ "swarming": { "can_use_on_swarming_builders": true }, - "test": "snapshot_unittests" - }, - { - "swarming": { - "can_use_on_swarming_builders": true - }, "test": "sql_unittests" }, { @@ -3721,12 +3715,6 @@ "swarming": { "can_use_on_swarming_builders": true }, - "test": "snapshot_unittests" - }, - { - "swarming": { - "can_use_on_swarming_builders": true - }, "test": "sql_unittests" }, { @@ -4114,12 +4102,6 @@ "swarming": { "can_use_on_swarming_builders": true }, - "test": "snapshot_unittests" - }, - { - "swarming": { - "can_use_on_swarming_builders": true - }, "test": "sql_unittests" }, {
diff --git a/testing/buildbot/chromium.mac.json b/testing/buildbot/chromium.mac.json index 710920b..7213398 100644 --- a/testing/buildbot/chromium.mac.json +++ b/testing/buildbot/chromium.mac.json
@@ -13,7 +13,6 @@ "pdf_unittests", "printing_unittests", "skia_unittests", - "snapshot_unittests", "sql_unittests", "storage_unittests", "ui_base_unittests", @@ -303,12 +302,6 @@ "swarming": { "can_use_on_swarming_builders": true }, - "test": "snapshot_unittests" - }, - { - "swarming": { - "can_use_on_swarming_builders": true - }, "test": "sql_unittests" }, { @@ -660,12 +653,6 @@ "swarming": { "can_use_on_swarming_builders": true }, - "test": "snapshot_unittests" - }, - { - "swarming": { - "can_use_on_swarming_builders": true - }, "test": "sql_unittests" }, { @@ -1018,12 +1005,6 @@ "swarming": { "can_use_on_swarming_builders": true }, - "test": "snapshot_unittests" - }, - { - "swarming": { - "can_use_on_swarming_builders": true - }, "test": "sql_unittests" }, { @@ -1364,12 +1345,6 @@ "swarming": { "can_use_on_swarming_builders": true }, - "test": "snapshot_unittests" - }, - { - "swarming": { - "can_use_on_swarming_builders": true - }, "test": "sql_unittests" }, {
diff --git a/testing/buildbot/chromium.webrtc.fyi.json b/testing/buildbot/chromium.webrtc.fyi.json index 74689a9a..7949cf56 100644 --- a/testing/buildbot/chromium.webrtc.fyi.json +++ b/testing/buildbot/chromium.webrtc.fyi.json
@@ -6,14 +6,12 @@ }, "Android Builder (dbg)": { "additional_compile_targets": [ - "content_browsertests", - "service_manager_unittests" + "content_browsertests" ] }, "Android Builder ARM64 (dbg)": { "additional_compile_targets": [ - "content_browsertests", - "service_manager_unittests" + "content_browsertests" ] }, "Linux Builder": {
diff --git a/testing/buildbot/gn_isolate_map.pyl b/testing/buildbot/gn_isolate_map.pyl index a7f6d29..e6f84ad 100644 --- a/testing/buildbot/gn_isolate_map.pyl +++ b/testing/buildbot/gn_isolate_map.pyl
@@ -758,10 +758,6 @@ "label": "//skia:skia_unittests", "type": "console_test_launcher", }, - "snapshot_unittests": { - "label": "//ui/snapshot:snapshot_unittests", - "type": "windowed_test_launcher", - }, "sql_unittests": { "label": "//sql:sql_unittests", "type": "console_test_launcher",
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-input-element/checkbox.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-input-element/checkbox.html index bbbb700..b1ccc64c 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-input-element/checkbox.html +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-input-element/checkbox.html
@@ -146,7 +146,4 @@ assert_false(checkbox6.indeterminate); checkbox6.click(); }); - - // This is a change meant to be reverted to test the WPT Export - // process in Chromium. See https://crbug.com/679951 </script>
diff --git a/third_party/WebKit/LayoutTests/fast/css/font-face-cache-version.html b/third_party/WebKit/LayoutTests/fast/css/font-face-cache-version.html new file mode 100644 index 0000000..c23d9adda --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/css/font-face-cache-version.html
@@ -0,0 +1,22 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<script> + +async_test(function(t) { + var messages = []; + window.addEventListener('message', (evt) => { + messages.push(evt.data); + if (messages.length == 2) { + t.step(() => { + assert_not_equals(messages[0], messages[1], + 'The texts in two iframes should not be identical'); + t.done(); + }); + } + }); +}, 'Cached font from differnt document should not be used'); + +</script> +<iframe id='frame' src='resources/font-face-cache-version-frame1.html'></iframe> +<iframe id='frame' src='resources/font-face-cache-version-frame2.html'></iframe>
diff --git a/third_party/WebKit/LayoutTests/fast/css/resources/font-face-cache-version-frame1.html b/third_party/WebKit/LayoutTests/fast/css/resources/font-face-cache-version-frame1.html new file mode 100644 index 0000000..7666ce6 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/css/resources/font-face-cache-version-frame1.html
@@ -0,0 +1,18 @@ +<!DOCTYPE html> +<style> +@font-face { + font-family: CustomFont; + src: url('../../../resources/SpaceOnly.otf'); +} +span { + font: 48px CustomFont; +} +</style> +<span id="text"></span> +<script> +document.fonts.load('48px CustomFont').then(() => { + var span = document.getElementById('text'); + span.innerText = 'Hello'; + window.parent.postMessage(span.offsetWidth, '*'); +}); +</script>
diff --git a/third_party/WebKit/LayoutTests/fast/css/resources/font-face-cache-version-frame2.html b/third_party/WebKit/LayoutTests/fast/css/resources/font-face-cache-version-frame2.html new file mode 100644 index 0000000..ed53301 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/css/resources/font-face-cache-version-frame2.html
@@ -0,0 +1,18 @@ +<!DOCTYPE html> +<style> +@font-face { + font-family: CustomFont; + src: url('../../../resources/Ahem.ttf'); +} +span { + font: 48px CustomFont; +} +</style> +<span id="text"></span> +<script> +document.fonts.load('48px CustomFont').then(() => { + var span = document.getElementById('text'); + span.innerText = 'Hello'; + window.parent.postMessage(span.offsetWidth, '*'); +}); +</script>
diff --git a/third_party/WebKit/LayoutTests/webaudio/AudioNode/audionode-connect-method-chaining-expected.txt b/third_party/WebKit/LayoutTests/webaudio/AudioNode/audionode-connect-method-chaining-expected.txt deleted file mode 100644 index 50688c0a..0000000 --- a/third_party/WebKit/LayoutTests/webaudio/AudioNode/audionode-connect-method-chaining-expected.txt +++ /dev/null
@@ -1,63 +0,0 @@ -Test method chaining feature of AudioNode.connect() method. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - - -PASS The return value of AnalyserNode.connect(GainNode) matches the destination GainNode. -PASS The return value of AnalyserNode.connect(BiquadFilterNode, 0) matches the destination BiquadFilterNode. -PASS The return value of AnalyserNode.connect(ChannelMergerNode, 0, 1) matches the destination ChannelMergerNode. -PASS The return value of BiquadFilterNode.connect(GainNode) matches the destination GainNode. -PASS The return value of BiquadFilterNode.connect(BiquadFilterNode, 0) matches the destination BiquadFilterNode. -PASS The return value of BiquadFilterNode.connect(ChannelMergerNode, 0, 1) matches the destination ChannelMergerNode. -PASS The return value of AudioBufferSourceNode.connect(GainNode) matches the destination GainNode. -PASS The return value of AudioBufferSourceNode.connect(BiquadFilterNode, 0) matches the destination BiquadFilterNode. -PASS The return value of AudioBufferSourceNode.connect(ChannelMergerNode, 0, 1) matches the destination ChannelMergerNode. -PASS The return value of ChannelMergerNode.connect(GainNode) matches the destination GainNode. -PASS The return value of ChannelMergerNode.connect(BiquadFilterNode, 0) matches the destination BiquadFilterNode. -PASS The return value of ChannelMergerNode.connect(ChannelMergerNode, 0, 1) matches the destination ChannelMergerNode. -PASS The return value of ChannelSplitterNode.connect(GainNode) matches the destination GainNode. -PASS The return value of ChannelSplitterNode.connect(BiquadFilterNode, 0) matches the destination BiquadFilterNode. -PASS The return value of ChannelSplitterNode.connect(ChannelMergerNode, 0, 1) matches the destination ChannelMergerNode. -PASS The return value of ConvolverNode.connect(GainNode) matches the destination GainNode. -PASS The return value of ConvolverNode.connect(BiquadFilterNode, 0) matches the destination BiquadFilterNode. -PASS The return value of ConvolverNode.connect(ChannelMergerNode, 0, 1) matches the destination ChannelMergerNode. -PASS The return value of DelayNode.connect(GainNode) matches the destination GainNode. -PASS The return value of DelayNode.connect(BiquadFilterNode, 0) matches the destination BiquadFilterNode. -PASS The return value of DelayNode.connect(ChannelMergerNode, 0, 1) matches the destination ChannelMergerNode. -PASS The return value of DynamicsCompressorNode.connect(GainNode) matches the destination GainNode. -PASS The return value of DynamicsCompressorNode.connect(BiquadFilterNode, 0) matches the destination BiquadFilterNode. -PASS The return value of DynamicsCompressorNode.connect(ChannelMergerNode, 0, 1) matches the destination ChannelMergerNode. -PASS The return value of GainNode.connect(GainNode) matches the destination GainNode. -PASS The return value of GainNode.connect(BiquadFilterNode, 0) matches the destination BiquadFilterNode. -PASS The return value of GainNode.connect(ChannelMergerNode, 0, 1) matches the destination ChannelMergerNode. -PASS The return value of OscillatorNode.connect(GainNode) matches the destination GainNode. -PASS The return value of OscillatorNode.connect(BiquadFilterNode, 0) matches the destination BiquadFilterNode. -PASS The return value of OscillatorNode.connect(ChannelMergerNode, 0, 1) matches the destination ChannelMergerNode. -PASS The return value of PannerNode.connect(GainNode) matches the destination GainNode. -PASS The return value of PannerNode.connect(BiquadFilterNode, 0) matches the destination BiquadFilterNode. -PASS The return value of PannerNode.connect(ChannelMergerNode, 0, 1) matches the destination ChannelMergerNode. -PASS The return value of ScriptProcessorNode.connect(GainNode) matches the destination GainNode. -PASS The return value of ScriptProcessorNode.connect(BiquadFilterNode, 0) matches the destination BiquadFilterNode. -PASS The return value of ScriptProcessorNode.connect(ChannelMergerNode, 0, 1) matches the destination ChannelMergerNode. -PASS The return value of StereoPannerNode.connect(GainNode) matches the destination GainNode. -PASS The return value of StereoPannerNode.connect(BiquadFilterNode, 0) matches the destination BiquadFilterNode. -PASS The return value of StereoPannerNode.connect(ChannelMergerNode, 0, 1) matches the destination ChannelMergerNode. -PASS The return value of WaveShaperNode.connect(GainNode) matches the destination GainNode. -PASS The return value of WaveShaperNode.connect(BiquadFilterNode, 0) matches the destination BiquadFilterNode. -PASS The return value of WaveShaperNode.connect(ChannelMergerNode, 0, 1) matches the destination ChannelMergerNode. -PASS The return value of MediaElementAudioSourceNode.connect(GainNode) matches the destination GainNode. -PASS The return value of MediaElementAudioSourceNode.connect(BiquadFilterNode, 0) matches the destination BiquadFilterNode. -PASS The return value of MediaElementAudioSourceNode.connect(ChannelMergerNode, 0, 1) matches the destination ChannelMergerNode. -PASS The return value of MediaStreamAudioDestinationNode.connect(GainNode) matches the destination GainNode. -PASS The return value of MediaStreamAudioDestinationNode.connect(BiquadFilterNode, 0) matches the destination BiquadFilterNode. -PASS The return value of MediaStreamAudioDestinationNode.connect(ChannelMergerNode, 0, 1) matches the destination ChannelMergerNode. -PASS The return value of MediaStreamAudioSourceNode.connect(GainNode) matches the destination GainNode. -PASS The return value of MediaStreamAudioSourceNode.connect(BiquadFilterNode, 0) matches the destination BiquadFilterNode. -PASS The return value of MediaStreamAudioSourceNode.connect(ChannelMergerNode, 0, 1) matches the destination ChannelMergerNode. -PASS Connecting with an invalid output threw IndexSizeError: Failed to execute 'connect' on 'AudioNode': output index (1) exceeds number of outputs (1).. -PASS Connecting to a node from the different context threw InvalidAccessError: Failed to execute 'connect' on 'AudioNode': cannot connect to a destination belonging to a different audio context.. -PASS The output of chained connection of gain nodes contains only the constant 0.125. -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/WebKit/LayoutTests/webaudio/AudioNode/audionode-connect-method-chaining.html b/third_party/WebKit/LayoutTests/webaudio/AudioNode/audionode-connect-method-chaining.html index b555bfd9..b7f0880 100644 --- a/third_party/WebKit/LayoutTests/webaudio/AudioNode/audionode-connect-method-chaining.html +++ b/third_party/WebKit/LayoutTests/webaudio/AudioNode/audionode-connect-method-chaining.html
@@ -2,15 +2,14 @@ <html> <head> - <script src="../../resources/js-test.js"></script> + <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> </head> <body> <script> - description('Test method chaining feature of AudioNode.connect() method.'); - window.jsTestIsAsync = true; // AudioNode dictionary with associated arguments. var nodeDictionary = [ @@ -32,13 +31,12 @@ function verifyReturnedNode(config) { - if (config.destination === config.returned) { - testPassed('The return value of ' + config.desc + ' matches the destination ' + - config.returned.constructor.name + '.'); - } else { - testFailed('The return value of ' + config.desc + ' does NOT match the destination ' + - config.destination.constructor.name + '.'); - } + Should('The return value of ' + config.desc + + ' matches the destination ' + + config.returned.constructor.name, + config.destination === config.returned + ) + .beEqualTo(true); } // Test utility for batch method checking: in order to test 3 method @@ -156,7 +154,6 @@ }); audit.defineTask('finish', function (done) { - finishJSTest(); done(); });
diff --git a/third_party/WebKit/LayoutTests/webaudio/AudioNode/audionode-disconnect-audioparam-expected.txt b/third_party/WebKit/LayoutTests/webaudio/AudioNode/audionode-disconnect-audioparam-expected.txt deleted file mode 100644 index d892b79e..0000000 --- a/third_party/WebKit/LayoutTests/webaudio/AudioNode/audionode-disconnect-audioparam-expected.txt +++ /dev/null
@@ -1,18 +0,0 @@ -Test disconnect() method on AudioParam destination. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - - -PASS Channel #0 contains all the expected values in the correct order: [2.25,1.5]. -PASS The index of value change is equal to 11008. -PASS Channel #0 contains all the expected values in the correct order: [3,1.5]. -PASS The index of value change in channel #0 is equal to 11008. -PASS Channel #1 contains all the expected values in the correct order: [6,3]. -PASS The index of value change in channel #1 is equal to 11008. -PASS gain1.disconnect(gain3.gain) threw InvalidAccessError: Failed to execute 'disconnect' on 'AudioNode': the given AudioParam is not connected.. -PASS splitter.disconnect(gain1.gain, 1) threw InvalidAccessError: Failed to execute 'disconnect' on 'AudioNode': specified destination AudioParam and node output (1) are not connected.. -PASS splitter.disconnect(gain1.gain, 2) threw IndexSizeError: Failed to execute 'disconnect' on 'AudioNode': The output index provided (2) is outside the range [0, 1].. -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/WebKit/LayoutTests/webaudio/AudioNode/audionode-disconnect-audioparam.html b/third_party/WebKit/LayoutTests/webaudio/AudioNode/audionode-disconnect-audioparam.html index c290b6f..2cb620b 100644 --- a/third_party/WebKit/LayoutTests/webaudio/AudioNode/audionode-disconnect-audioparam.html +++ b/third_party/WebKit/LayoutTests/webaudio/AudioNode/audionode-disconnect-audioparam.html
@@ -2,15 +2,14 @@ <html> <head> - <script src="../../resources/js-test.js"></script> + <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> </head> <body> <script> - description('Test disconnect() method on AudioParam destination.'); - window.jsTestIsAsync = true; var renderQuantum = 128; @@ -198,7 +197,6 @@ }); audit.defineTask('finish', function (done) { - finishJSTest(); done(); });
diff --git a/third_party/WebKit/LayoutTests/webaudio/AudioNode/audionode-disconnect-expected.txt b/third_party/WebKit/LayoutTests/webaudio/AudioNode/audionode-disconnect-expected.txt deleted file mode 100644 index 78035cc..0000000 --- a/third_party/WebKit/LayoutTests/webaudio/AudioNode/audionode-disconnect-expected.txt +++ /dev/null
@@ -1,25 +0,0 @@ -Test disconnect() method on AudioNode destination. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - - -PASS Channel #0 contains only the constant 0. -PASS Channel #0 contains only the constant 4. -PASS Channel #0 contains only the constant 2. -PASS Channel #0 contains only the constant 3. -PASS Channel #0 contains only the constant 1. -PASS Channel #1 contains only the constant 2. -PASS Channel #2 contains only the constant 0. -PASS splitter.disconnect(2) threw IndexSizeError: Failed to execute 'disconnect' on 'AudioNode': The output index provided (2) is outside the range [0, 1].. -PASS Disconnecting a connection twice did not throw an exception. -PASS gain1.disconnect(gain2) threw InvalidAccessError: Failed to execute 'disconnect' on 'AudioNode': the given destination is not connected.. -PASS gain1.disconnect(gain3) threw InvalidAccessError: Failed to execute 'disconnect' on 'AudioNode': the given destination is not connected.. -PASS splitter.disconnect(gain2, 2) threw IndexSizeError: Failed to execute 'disconnect' on 'AudioNode': The output index provided (2) is outside the range [0, 1].. -PASS splitter.disconnect(gain1, 0) threw InvalidAccessError: Failed to execute 'disconnect' on 'AudioNode': output (0) is not connected to the given destination.. -PASS splitter.disconnect(gain3, 0, 0) threw InvalidAccessError: Failed to execute 'disconnect' on 'AudioNode': output (0) is not connected to the input (0) of the destination.. -PASS splitter.disconnect(merger, 3, 0) threw IndexSizeError: Failed to execute 'disconnect' on 'AudioNode': The output index provided (3) is outside the range [0, 1].. -PASS Disabled outputs handled correctly. -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/WebKit/LayoutTests/webaudio/AudioNode/audionode-disconnect.html b/third_party/WebKit/LayoutTests/webaudio/AudioNode/audionode-disconnect.html index 37187a6..f2d69e0 100644 --- a/third_party/WebKit/LayoutTests/webaudio/AudioNode/audionode-disconnect.html +++ b/third_party/WebKit/LayoutTests/webaudio/AudioNode/audionode-disconnect.html
@@ -2,15 +2,14 @@ <html> <head> - <script src="../../resources/js-test.js"></script> + <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> </head> <body> <script> - description('Test disconnect() method on AudioNode destination.'); - window.jsTestIsAsync = true; var audit = Audit.createTaskRunner(); @@ -273,7 +272,6 @@ }); audit.defineTask('finish', function (done) { - finishJSTest(); done(); });
diff --git a/third_party/WebKit/Source/bindings/core/v8/RejectedPromises.h b/third_party/WebKit/Source/bindings/core/v8/RejectedPromises.h index cf04307..7792ae1 100644 --- a/third_party/WebKit/Source/bindings/core/v8/RejectedPromises.h +++ b/third_party/WebKit/Source/bindings/core/v8/RejectedPromises.h
@@ -6,7 +6,7 @@ #define RejectedPromises_h #include "bindings/core/v8/SourceLocation.h" -#include "core/fetch/AccessControlStatus.h" +#include "platform/loader/fetch/AccessControlStatus.h" #include "wtf/Deque.h" #include "wtf/Forward.h" #include "wtf/RefCounted.h"
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptController.h b/third_party/WebKit/Source/bindings/core/v8/ScriptController.h index b161c103..3d92366 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptController.h +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptController.h
@@ -34,10 +34,10 @@ #include "bindings/core/v8/SharedPersistent.h" #include "bindings/core/v8/WindowProxyManager.h" #include "core/CoreExport.h" -#include "core/fetch/AccessControlStatus.h" -#include "core/fetch/CrossOriginAccessControl.h" #include "core/frame/LocalFrame.h" #include "platform/heap/Handle.h" +#include "platform/loader/fetch/AccessControlStatus.h" +#include "platform/loader/fetch/CrossOriginAccessControl.h" #include "wtf/HashMap.h" #include "wtf/Noncopyable.h" #include "wtf/Vector.h"
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.cpp index d737f8d3..1ed3e48 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.cpp
@@ -9,7 +9,6 @@ #include "core/dom/Document.h" #include "core/dom/Element.h" #include "core/dom/PendingScript.h" -#include "core/fetch/CachedMetadata.h" #include "core/frame/Settings.h" #include "core/html/parser/TextResourceDecoder.h" #include "core/loader/resource/ScriptResource.h" @@ -17,6 +16,7 @@ #include "platform/Histogram.h" #include "platform/SharedBuffer.h" #include "platform/instrumentation/tracing/TraceEvent.h" +#include "platform/loader/fetch/CachedMetadata.h" #include "public/platform/WebScheduler.h" #include "wtf/Deque.h" #include "wtf/PtrUtil.h"
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp b/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp index ca0503e..e9d3ec9 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp
@@ -44,7 +44,6 @@ #include "bindings/core/v8/V8Window.h" #include "bindings/core/v8/WorkerOrWorkletScriptController.h" #include "core/dom/Document.h" -#include "core/fetch/AccessControlStatus.h" #include "core/frame/LocalDOMWindow.h" #include "core/frame/LocalFrame.h" #include "core/frame/csp/ContentSecurityPolicy.h" @@ -54,6 +53,7 @@ #include "platform/EventDispatchForbiddenScope.h" #include "platform/RuntimeEnabledFeatures.h" #include "platform/instrumentation/tracing/TraceEvent.h" +#include "platform/loader/fetch/AccessControlStatus.h" #include "public/platform/Platform.h" #include "public/platform/WebScheduler.h" #include "public/platform/WebThread.h"
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp index 288b523..f3d1ce21 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
@@ -32,7 +32,6 @@ #include "bindings/core/v8/V8ThrowException.h" #include "core/dom/Document.h" #include "core/dom/ExecutionContext.h" -#include "core/fetch/CachedMetadata.h" #include "core/frame/LocalFrame.h" #include "core/frame/PerformanceMonitor.h" #include "core/inspector/InspectorTraceEvents.h" @@ -41,6 +40,7 @@ #include "platform/Histogram.h" #include "platform/ScriptForbiddenScope.h" #include "platform/instrumentation/tracing/TraceEvent.h" +#include "platform/loader/fetch/CachedMetadata.h" #include "public/platform/Platform.h" #include "wtf/CurrentTime.h"
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.h b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.h index b2e697a..ce8fe93 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.h +++ b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.h
@@ -31,7 +31,7 @@ #include "bindings/core/v8/V8BindingMacros.h" #include "bindings/core/v8/V8CacheOptions.h" #include "core/CoreExport.h" -#include "core/fetch/AccessControlStatus.h" +#include "platform/loader/fetch/AccessControlStatus.h" #include "wtf/Allocator.h" #include "wtf/text/TextPosition.h" #include "wtf/text/WTFString.h"
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunnerTest.cpp b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunnerTest.cpp index cd4a499..95dafb6 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunnerTest.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunnerTest.cpp
@@ -6,10 +6,10 @@ #include "bindings/core/v8/V8Binding.h" #include "bindings/core/v8/V8BindingForTesting.h" -#include "core/fetch/CachedMetadata.h" -#include "core/fetch/CachedMetadataHandler.h" #include "core/loader/resource/ScriptResource.h" #include "platform/heap/Handle.h" +#include "platform/loader/fetch/CachedMetadata.h" +#include "platform/loader/fetch/CachedMetadataHandler.h" #include "testing/gtest/include/gtest/gtest.h" #include <v8.h>
diff --git a/third_party/WebKit/Source/core/BUILD.gn b/third_party/WebKit/Source/core/BUILD.gn index f2c7670..3a548f33 100644 --- a/third_party/WebKit/Source/core/BUILD.gn +++ b/third_party/WebKit/Source/core/BUILD.gn
@@ -176,7 +176,6 @@ "//third_party/WebKit/Source/core/dom", "//third_party/WebKit/Source/core/editing", "//third_party/WebKit/Source/core/events", - "//third_party/WebKit/Source/core/fetch", "//third_party/WebKit/Source/core/fileapi", "//third_party/WebKit/Source/core/frame", "//third_party/WebKit/Source/core/html", @@ -608,14 +607,6 @@ ] } -make_names("make_core_generated_fetch_initiator_type_names") { - in_files = [ "fetch/FetchInitiatorTypeNames.in" ] - outputs = [ - "$blink_core_output_dir/fetch/FetchInitiatorTypeNames.cpp", - "$blink_core_output_dir/fetch/FetchInitiatorTypeNames.h", - ] -} - make_names("make_core_generated_event_type_names") { in_files = [ "events/EventTypeNames.in" ] outputs = [ @@ -871,7 +862,6 @@ ":make_core_generated_event_names", ":make_core_generated_event_target_names", ":make_core_generated_event_type_names", - ":make_core_generated_fetch_initiator_type_names", ":make_core_generated_html_element_factory", ":make_core_generated_html_element_lookup_trie", ":make_core_generated_html_entity_table", @@ -1094,22 +1084,6 @@ "events/EventPathTest.cpp", "events/EventTargetTest.cpp", "events/PointerEventFactoryTest.cpp", - "fetch/ClientHintsPreferencesTest.cpp", - "fetch/CrossOriginAccessControlTest.cpp", - "fetch/FetchTestingPlatformSupport.cpp", - "fetch/FetchTestingPlatformSupport.h", - "fetch/FetchUtilsTest.cpp", - "fetch/MemoryCacheCorrectnessTest.cpp", - "fetch/MemoryCacheTest.cpp", - "fetch/MockFetchContext.h", - "fetch/MockResource.cpp", - "fetch/MockResource.h", - "fetch/MockResourceClient.cpp", - "fetch/MockResourceClient.h", - "fetch/RawResourceTest.cpp", - "fetch/ResourceFetcherTest.cpp", - "fetch/ResourceLoaderOptionsTest.cpp", - "fetch/ResourceTest.cpp", "fileapi/FileListTest.cpp", "fileapi/FileTest.cpp", "frame/FeaturePolicyInFrameTest.cpp",
diff --git a/third_party/WebKit/Source/core/CoreInitializer.cpp b/third_party/WebKit/Source/core/CoreInitializer.cpp index dcbb619..d7b8602 100644 --- a/third_party/WebKit/Source/core/CoreInitializer.cpp +++ b/third_party/WebKit/Source/core/CoreInitializer.cpp
@@ -50,13 +50,13 @@ #include "core/dom/Document.h" #include "core/dom/StyleChangeReason.h" #include "core/events/EventFactory.h" -#include "core/fetch/FetchInitiatorTypeNames.h" #include "core/html/canvas/CanvasRenderingContextFactory.h" #include "core/html/parser/HTMLParserThread.h" #include "core/workers/WorkerThread.h" #include "platform/FontFamilyNames.h" #include "platform/HTTPNames.h" #include "platform/RuntimeEnabledFeatures.h" +#include "platform/loader/fetch/FetchInitiatorTypeNames.h" #include "platform/weborigin/KURL.h" #include "platform/weborigin/SchemeRegistry.h" #include "platform/weborigin/SecurityPolicy.h"
diff --git a/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.cpp b/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.cpp index 67731ba..dacc215a 100644 --- a/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.cpp
@@ -29,14 +29,14 @@ #include "core/css/StyleSheetContents.h" #include "core/dom/Document.h" #include "core/dom/Node.h" -#include "core/fetch/FetchInitiatorTypeNames.h" -#include "core/fetch/FetchRequest.h" -#include "core/fetch/ResourceFetcher.h" #include "core/loader/resource/FontResource.h" #include "platform/CrossOriginAttributeValue.h" #include "platform/RuntimeEnabledFeatures.h" #include "platform/fonts/FontCache.h" #include "platform/fonts/FontCustomPlatformData.h" +#include "platform/loader/fetch/FetchInitiatorTypeNames.h" +#include "platform/loader/fetch/FetchRequest.h" +#include "platform/loader/fetch/ResourceFetcher.h" #include "platform/weborigin/SecurityPolicy.h" #include "wtf/text/StringBuilder.h"
diff --git a/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.h b/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.h index 65575e7..76d22854 100644 --- a/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.h +++ b/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.h
@@ -27,8 +27,8 @@ #define CSSFontFaceSrcValue_h #include "core/css/CSSValue.h" -#include "core/fetch/ResourceOwner.h" #include "core/loader/resource/FontResource.h" +#include "platform/loader/fetch/ResourceOwner.h" #include "platform/weborigin/Referrer.h" #include "wtf/PassRefPtr.h" #include "wtf/text/WTFString.h"
diff --git a/third_party/WebKit/Source/core/css/CSSImageSetValue.cpp b/third_party/WebKit/Source/core/css/CSSImageSetValue.cpp index 4305fc6..ca150f3 100644 --- a/third_party/WebKit/Source/core/css/CSSImageSetValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSImageSetValue.cpp
@@ -28,14 +28,14 @@ #include "core/css/CSSImageValue.h" #include "core/css/CSSPrimitiveValue.h" #include "core/dom/Document.h" -#include "core/fetch/FetchInitiatorTypeNames.h" -#include "core/fetch/FetchRequest.h" -#include "core/fetch/ResourceFetcher.h" -#include "core/fetch/ResourceLoaderOptions.h" #include "core/frame/Settings.h" #include "core/loader/resource/ImageResourceContent.h" #include "core/style/StyleFetchedImageSet.h" #include "core/style/StyleInvalidImage.h" +#include "platform/loader/fetch/FetchInitiatorTypeNames.h" +#include "platform/loader/fetch/FetchRequest.h" +#include "platform/loader/fetch/ResourceFetcher.h" +#include "platform/loader/fetch/ResourceLoaderOptions.h" #include "platform/weborigin/KURL.h" #include "platform/weborigin/SecurityPolicy.h" #include "wtf/text/StringBuilder.h"
diff --git a/third_party/WebKit/Source/core/css/CSSImageValue.cpp b/third_party/WebKit/Source/core/css/CSSImageValue.cpp index c119d1b6..74b63bc 100644 --- a/third_party/WebKit/Source/core/css/CSSImageValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSImageValue.cpp
@@ -22,14 +22,14 @@ #include "core/css/CSSMarkup.h" #include "core/dom/Document.h" -#include "core/fetch/FetchInitiatorTypeNames.h" -#include "core/fetch/FetchRequest.h" -#include "core/fetch/ResourceFetcher.h" #include "core/frame/Settings.h" #include "core/loader/resource/ImageResourceContent.h" #include "core/style/StyleFetchedImage.h" #include "core/style/StyleInvalidImage.h" #include "platform/CrossOriginAttributeValue.h" +#include "platform/loader/fetch/FetchInitiatorTypeNames.h" +#include "platform/loader/fetch/FetchRequest.h" +#include "platform/loader/fetch/ResourceFetcher.h" #include "platform/weborigin/KURL.h" #include "platform/weborigin/SecurityPolicy.h"
diff --git a/third_party/WebKit/Source/core/css/FontFaceCache.cpp b/third_party/WebKit/Source/core/css/FontFaceCache.cpp index d13b86e..4cbd8c5 100644 --- a/third_party/WebKit/Source/core/css/FontFaceCache.cpp +++ b/third_party/WebKit/Source/core/css/FontFaceCache.cpp
@@ -32,14 +32,16 @@ #include "core/css/FontFace.h" #include "core/css/FontStyleMatcher.h" #include "core/css/StyleRule.h" -#include "core/fetch/ResourceFetcher.h" #include "core/loader/resource/FontResource.h" #include "platform/FontFamilyNames.h" #include "platform/fonts/FontDescription.h" +#include "platform/loader/fetch/ResourceFetcher.h" #include "wtf/text/AtomicString.h" namespace blink { +static unsigned s_version = 0; + FontFaceCache::FontFaceCache() : m_version(0) {} void FontFaceCache::add(CSSFontSelector* cssFontSelector, @@ -71,7 +73,7 @@ m_cssConnectedFontFaces.add(fontFace); m_fonts.remove(fontFace->family()); - ++m_version; + incrementVersion(); } void FontFaceCache::remove(const StyleRuleFontFace* fontFaceRule) { @@ -105,7 +107,7 @@ if (cssConnected) m_cssConnectedFontFaces.remove(fontFace); - ++m_version; + incrementVersion(); } void FontFaceCache::clearCSSConnected() { @@ -122,7 +124,11 @@ m_fonts.clear(); m_styleRuleToFontFace.clear(); m_cssConnectedFontFaces.clear(); - ++m_version; + incrementVersion(); +} + +void FontFaceCache::incrementVersion() { + m_version = ++s_version; } CSSSegmentedFontFace* FontFaceCache::get(const FontDescription& fontDescription,
diff --git a/third_party/WebKit/Source/core/css/FontFaceCache.h b/third_party/WebKit/Source/core/css/FontFaceCache.h index 0ff1953..ab0b07b 100644 --- a/third_party/WebKit/Source/core/css/FontFaceCache.h +++ b/third_party/WebKit/Source/core/css/FontFaceCache.h
@@ -65,7 +65,7 @@ } unsigned version() const { return m_version; } - void incrementVersion() { ++m_version; } + void incrementVersion(); DECLARE_TRACE();
diff --git a/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp b/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp index 3d2e777..cd27b86 100644 --- a/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp +++ b/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp
@@ -8,7 +8,6 @@ #include "core/css/CSSFontFace.h" #include "core/css/CSSFontSelector.h" #include "core/dom/Document.h" -#include "core/fetch/ResourceFetcher.h" #include "core/inspector/ConsoleMessage.h" #include "core/loader/FrameLoaderClient.h" #include "core/page/NetworkStateNotifier.h" @@ -17,6 +16,7 @@ #include "platform/fonts/FontCache.h" #include "platform/fonts/FontDescription.h" #include "platform/fonts/SimpleFontData.h" +#include "platform/loader/fetch/ResourceFetcher.h" #include "platform/network/ResourceLoadPriority.h" #include "public/platform/WebEffectiveConnectionType.h" #include "wtf/CurrentTime.h"
diff --git a/third_party/WebKit/Source/core/css/StyleRuleImport.cpp b/third_party/WebKit/Source/core/css/StyleRuleImport.cpp index 5d8d808..4a05f29 100644 --- a/third_party/WebKit/Source/core/css/StyleRuleImport.cpp +++ b/third_party/WebKit/Source/core/css/StyleRuleImport.cpp
@@ -24,10 +24,10 @@ #include "core/css/StyleSheetContents.h" #include "core/dom/Document.h" -#include "core/fetch/FetchInitiatorTypeNames.h" -#include "core/fetch/FetchRequest.h" -#include "core/fetch/ResourceFetcher.h" #include "core/loader/resource/CSSStyleSheetResource.h" +#include "platform/loader/fetch/FetchInitiatorTypeNames.h" +#include "platform/loader/fetch/FetchRequest.h" +#include "platform/loader/fetch/ResourceFetcher.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSResourceValue.h b/third_party/WebKit/Source/core/css/cssom/CSSResourceValue.h index 783fad71..00d29bb3 100644 --- a/third_party/WebKit/Source/core/css/cssom/CSSResourceValue.h +++ b/third_party/WebKit/Source/core/css/cssom/CSSResourceValue.h
@@ -7,7 +7,7 @@ #include "core/css/cssom/CSSStyleValue.h" -#include "core/fetch/Resource.h" +#include "platform/loader/fetch/Resource.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/css/parser/CSSParserContext.h b/third_party/WebKit/Source/core/css/parser/CSSParserContext.h index fbe7c94..818a7c46 100644 --- a/third_party/WebKit/Source/core/css/parser/CSSParserContext.h +++ b/third_party/WebKit/Source/core/css/parser/CSSParserContext.h
@@ -7,7 +7,7 @@ #include "core/CoreExport.h" #include "core/css/parser/CSSParserMode.h" -#include "core/fetch/ResourceLoaderOptions.h" +#include "platform/loader/fetch/ResourceLoaderOptions.h" #include "platform/weborigin/KURL.h" #include "platform/weborigin/Referrer.h"
diff --git a/third_party/WebKit/Source/core/css/resolver/ElementStyleResources.cpp b/third_party/WebKit/Source/core/css/resolver/ElementStyleResources.cpp index 23984df..560c5bed11 100644 --- a/third_party/WebKit/Source/core/css/resolver/ElementStyleResources.cpp +++ b/third_party/WebKit/Source/core/css/resolver/ElementStyleResources.cpp
@@ -28,7 +28,6 @@ #include "core/css/CSSImageValue.h" #include "core/css/CSSURIValue.h" #include "core/dom/Document.h" -#include "core/fetch/ResourceFetcher.h" #include "core/style/ComputedStyle.h" #include "core/style/ContentData.h" #include "core/style/CursorData.h" @@ -41,6 +40,7 @@ #include "core/style/StyleInvalidImage.h" #include "core/style/StylePendingImage.h" #include "core/svg/SVGElementProxy.h" +#include "platform/loader/fetch/ResourceFetcher.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/dom/DOMURL.cpp b/third_party/WebKit/Source/core/dom/DOMURL.cpp index dbebfe6..8c90912 100644 --- a/third_party/WebKit/Source/core/dom/DOMURL.cpp +++ b/third_party/WebKit/Source/core/dom/DOMURL.cpp
@@ -31,8 +31,8 @@ #include "core/dom/ExceptionCode.h" #include "core/dom/ExecutionContext.h" #include "core/dom/URLSearchParams.h" -#include "core/fetch/MemoryCache.h" #include "core/html/PublicURLManager.h" +#include "platform/loader/fetch/MemoryCache.h" #include "wtf/AutoReset.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp index 12388a1..230d3c9 100644 --- a/third_party/WebKit/Source/core/dom/Document.cpp +++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -135,7 +135,6 @@ #include "core/events/ScopedEventQueue.h" #include "core/events/VisualViewportResizeEvent.h" #include "core/events/VisualViewportScrollEvent.h" -#include "core/fetch/ResourceFetcher.h" #include "core/frame/DOMTimer.h" #include "core/frame/DOMVisualViewport.h" #include "core/frame/EventHandlerRegistry.h" @@ -232,6 +231,7 @@ #include "platform/ScriptForbiddenScope.h" #include "platform/WebFrameScheduler.h" #include "platform/instrumentation/tracing/TraceEvent.h" +#include "platform/loader/fetch/ResourceFetcher.h" #include "platform/network/ContentSecurityPolicyParsers.h" #include "platform/network/HTTPParsers.h" #include "platform/scroll/Scrollbar.h"
diff --git a/third_party/WebKit/Source/core/dom/Document.h b/third_party/WebKit/Source/core/dom/Document.h index 4b6fb9b..a46b828 100644 --- a/third_party/WebKit/Source/core/dom/Document.h +++ b/third_party/WebKit/Source/core/dom/Document.h
@@ -50,7 +50,6 @@ #include "core/dom/UserActionElementSet.h" #include "core/dom/ViewportDescription.h" #include "core/dom/custom/V0CustomElement.h" -#include "core/fetch/ClientHintsPreferences.h" #include "core/frame/DOMTimerCoordinator.h" #include "core/frame/HostsUsingFeatures.h" #include "core/html/parser/ParserSynchronizationPolicy.h" @@ -58,6 +57,7 @@ #include "platform/Length.h" #include "platform/Timer.h" #include "platform/WebTaskRunner.h" +#include "platform/loader/fetch/ClientHintsPreferences.h" #include "platform/scroll/ScrollTypes.h" #include "platform/weborigin/KURL.h" #include "platform/weborigin/ReferrerPolicy.h"
diff --git a/third_party/WebKit/Source/core/dom/ExecutionContext.cpp b/third_party/WebKit/Source/core/dom/ExecutionContext.cpp index ef843ee04..60a65d4 100644 --- a/third_party/WebKit/Source/core/dom/ExecutionContext.cpp +++ b/third_party/WebKit/Source/core/dom/ExecutionContext.cpp
@@ -33,13 +33,13 @@ #include "core/dom/TaskRunnerHelper.h" #include "core/events/ErrorEvent.h" #include "core/events/EventTarget.h" -#include "core/fetch/MemoryCache.h" #include "core/frame/UseCounter.h" #include "core/html/PublicURLManager.h" #include "core/inspector/ConsoleMessage.h" #include "core/inspector/InspectorInstrumentation.h" #include "core/workers/WorkerGlobalScope.h" #include "core/workers/WorkerThread.h" +#include "platform/loader/fetch/MemoryCache.h" #include "platform/weborigin/SecurityPolicy.h" #include "wtf/PtrUtil.h" #include <memory>
diff --git a/third_party/WebKit/Source/core/dom/ExecutionContext.h b/third_party/WebKit/Source/core/dom/ExecutionContext.h index a1e1162..8f57ab1 100644 --- a/third_party/WebKit/Source/core/dom/ExecutionContext.h +++ b/third_party/WebKit/Source/core/dom/ExecutionContext.h
@@ -32,9 +32,9 @@ #include "core/dom/ContextLifecycleNotifier.h" #include "core/dom/ContextLifecycleObserver.h" #include "core/dom/SecurityContext.h" -#include "core/fetch/AccessControlStatus.h" #include "platform/Supplementable.h" #include "platform/heap/Handle.h" +#include "platform/loader/fetch/AccessControlStatus.h" #include "platform/weborigin/KURL.h" #include "platform/weborigin/ReferrerPolicy.h" #include "public/platform/WebTraceLocation.h"
diff --git a/third_party/WebKit/Source/core/dom/PendingScript.h b/third_party/WebKit/Source/core/dom/PendingScript.h index fa93534..51378fb 100644 --- a/third_party/WebKit/Source/core/dom/PendingScript.h +++ b/third_party/WebKit/Source/core/dom/PendingScript.h
@@ -28,10 +28,10 @@ #include "bindings/core/v8/ScriptStreamer.h" #include "core/CoreExport.h" -#include "core/fetch/ResourceOwner.h" #include "core/loader/resource/ScriptResource.h" #include "platform/MemoryCoordinator.h" #include "platform/heap/Handle.h" +#include "platform/loader/fetch/ResourceOwner.h" #include "wtf/Noncopyable.h" #include "wtf/text/TextPosition.h"
diff --git a/third_party/WebKit/Source/core/dom/ProcessingInstruction.cpp b/third_party/WebKit/Source/core/dom/ProcessingInstruction.cpp index f056f82d..9a6bc34 100644 --- a/third_party/WebKit/Source/core/dom/ProcessingInstruction.cpp +++ b/third_party/WebKit/Source/core/dom/ProcessingInstruction.cpp
@@ -26,14 +26,14 @@ #include "core/dom/Document.h" #include "core/dom/IncrementLoadEventDelayCount.h" #include "core/dom/StyleEngine.h" -#include "core/fetch/FetchInitiatorTypeNames.h" -#include "core/fetch/FetchRequest.h" -#include "core/fetch/ResourceFetcher.h" #include "core/loader/resource/CSSStyleSheetResource.h" #include "core/loader/resource/XSLStyleSheetResource.h" #include "core/xml/DocumentXSLT.h" #include "core/xml/XSLStyleSheet.h" #include "core/xml/parser/XMLDocumentParser.h" // for parseAttributes() +#include "platform/loader/fetch/FetchInitiatorTypeNames.h" +#include "platform/loader/fetch/FetchRequest.h" +#include "platform/loader/fetch/ResourceFetcher.h" #include <memory> namespace blink {
diff --git a/third_party/WebKit/Source/core/dom/ProcessingInstruction.h b/third_party/WebKit/Source/core/dom/ProcessingInstruction.h index ec134b5..3ab26a7 100644 --- a/third_party/WebKit/Source/core/dom/ProcessingInstruction.h +++ b/third_party/WebKit/Source/core/dom/ProcessingInstruction.h
@@ -24,9 +24,9 @@ #include "core/dom/CharacterData.h" #include "core/dom/StyleEngineContext.h" -#include "core/fetch/ResourceOwner.h" #include "core/loader/resource/StyleSheetResource.h" #include "core/loader/resource/StyleSheetResourceClient.h" +#include "platform/loader/fetch/ResourceOwner.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/dom/ScriptLoader.cpp b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp index fb669a5f..e6a6769 100644 --- a/third_party/WebKit/Source/core/dom/ScriptLoader.cpp +++ b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
@@ -36,10 +36,6 @@ #include "core/dom/ScriptableDocumentParser.h" #include "core/dom/Text.h" #include "core/events/Event.h" -#include "core/fetch/AccessControlStatus.h" -#include "core/fetch/FetchRequest.h" -#include "core/fetch/MemoryCache.h" -#include "core/fetch/ResourceFetcher.h" #include "core/frame/LocalFrame.h" #include "core/frame/SubresourceIntegrity.h" #include "core/frame/UseCounter.h" @@ -51,6 +47,10 @@ #include "core/inspector/ConsoleMessage.h" #include "core/svg/SVGScriptElement.h" #include "platform/WebFrameScheduler.h" +#include "platform/loader/fetch/AccessControlStatus.h" +#include "platform/loader/fetch/FetchRequest.h" +#include "platform/loader/fetch/MemoryCache.h" +#include "platform/loader/fetch/ResourceFetcher.h" #include "platform/network/mime/MIMETypeRegistry.h" #include "platform/weborigin/SecurityOrigin.h" #include "public/platform/WebCachePolicy.h"
diff --git a/third_party/WebKit/Source/core/dom/ScriptLoader.h b/third_party/WebKit/Source/core/dom/ScriptLoader.h index e92c9e5..d44a5ec 100644 --- a/third_party/WebKit/Source/core/dom/ScriptLoader.h +++ b/third_party/WebKit/Source/core/dom/ScriptLoader.h
@@ -24,9 +24,9 @@ #include "core/CoreExport.h" #include "core/dom/PendingScript.h" #include "core/dom/ScriptRunner.h" -#include "core/fetch/FetchRequest.h" -#include "core/fetch/ResourceClient.h" #include "core/loader/resource/ScriptResource.h" +#include "platform/loader/fetch/FetchRequest.h" +#include "platform/loader/fetch/ResourceClient.h" #include "wtf/text/TextPosition.h" #include "wtf/text/WTFString.h"
diff --git a/third_party/WebKit/Source/core/editing/Editor.cpp b/third_party/WebKit/Source/core/editing/Editor.cpp index cbc1e08..0d57527 100644 --- a/third_party/WebKit/Source/core/editing/Editor.cpp +++ b/third_party/WebKit/Source/core/editing/Editor.cpp
@@ -62,7 +62,6 @@ #include "core/events/KeyboardEvent.h" #include "core/events/ScopedEventQueue.h" #include "core/events/TextEvent.h" -#include "core/fetch/ResourceFetcher.h" #include "core/frame/FrameView.h" #include "core/frame/LocalFrame.h" #include "core/frame/Settings.h" @@ -86,6 +85,7 @@ #include "core/page/Page.h" #include "core/svg/SVGImageElement.h" #include "platform/KillRing.h" +#include "platform/loader/fetch/ResourceFetcher.h" #include "platform/weborigin/KURL.h" #include "wtf/PtrUtil.h" #include "wtf/text/CharacterNames.h"
diff --git a/third_party/WebKit/Source/core/fetch/BUILD.gn b/third_party/WebKit/Source/core/fetch/BUILD.gn deleted file mode 100644 index 7bc81db..0000000 --- a/third_party/WebKit/Source/core/fetch/BUILD.gn +++ /dev/null
@@ -1,50 +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. - -import("//third_party/WebKit/Source/core/core.gni") - -blink_core_sources("fetch") { - sources = [ - "AccessControlStatus.h", - "CachedMetadata.cpp", - "CachedMetadata.h", - "CachedMetadataHandler.h", - "ClientHintsPreferences.cpp", - "ClientHintsPreferences.h", - "CrossOriginAccessControl.cpp", - "CrossOriginAccessControl.h", - "FetchContext.cpp", - "FetchContext.h", - "FetchInitiatorInfo.h", - "FetchRequest.cpp", - "FetchRequest.h", - "FetchUtils.cpp", - "FetchUtils.h", - "IntegrityMetadata.cpp", - "IntegrityMetadata.h", - "MemoryCache.cpp", - "MemoryCache.h", - "RawResource.cpp", - "RawResource.h", - "Resource.cpp", - "Resource.h", - "ResourceClient.h", - "ResourceClientWalker.h", - "ResourceFetcher.cpp", - "ResourceFetcher.h", - "ResourceLoader.cpp", - "ResourceLoader.h", - "ResourceLoaderOptions.h", - "ResourceLoadingLog.h", - "ResourceStatus.h", - "SubstituteData.h", - "UniqueIdentifier.cpp", - "UniqueIdentifier.h", - ] - - configs += [ - # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. - "//build/config/compiler:no_size_t_to_int_warning", - ] -}
diff --git a/third_party/WebKit/Source/core/fetch/DEPS b/third_party/WebKit/Source/core/fetch/DEPS deleted file mode 100644 index 1a786c4..0000000 --- a/third_party/WebKit/Source/core/fetch/DEPS +++ /dev/null
@@ -1,6 +0,0 @@ -include_rules = [ - "-bindings", - "-core", - "+core/CoreExport.h", - "+core/fetch", -]
diff --git a/third_party/WebKit/Source/core/fetch/FetchTestingPlatformSupport.cpp b/third_party/WebKit/Source/core/fetch/FetchTestingPlatformSupport.cpp deleted file mode 100644 index ce05ef4f..0000000 --- a/third_party/WebKit/Source/core/fetch/FetchTestingPlatformSupport.cpp +++ /dev/null
@@ -1,48 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "core/fetch/FetchTestingPlatformSupport.h" - -#include "core/fetch/MockFetchContext.h" -#include "platform/network/ResourceError.h" -#include "platform/testing/weburl_loader_mock_factory_impl.h" -#include "public/platform/Platform.h" -#include "public/platform/WebURL.h" -#include "public/platform/WebURLLoader.h" -#include "public/platform/WebURLLoaderMockFactory.h" -#include <memory> - -namespace blink { - -FetchTestingPlatformSupport::FetchTestingPlatformSupport() - : m_urlLoaderMockFactory(new WebURLLoaderMockFactoryImpl(this)) {} - -FetchTestingPlatformSupport::~FetchTestingPlatformSupport() = default; - -MockFetchContext* FetchTestingPlatformSupport::context() { - if (!m_context) { - m_context = MockFetchContext::create( - MockFetchContext::kShouldLoadNewResource, - currentThread()->scheduler()->loadingTaskRunner()); - } - return m_context; -} - -WebURLError FetchTestingPlatformSupport::cancelledError( - const WebURL& url) const { - return ResourceError(errorDomainBlinkInternal, -1, url.string(), - "cancelledError for testing"); -} - -WebURLLoaderMockFactory* -FetchTestingPlatformSupport::getURLLoaderMockFactory() { - return m_urlLoaderMockFactory.get(); -} - -WebURLLoader* FetchTestingPlatformSupport::createURLLoader() { - return m_urlLoaderMockFactory->createURLLoader( - m_oldPlatform->createURLLoader()); -} - -} // namespace blink
diff --git a/third_party/WebKit/Source/core/fileapi/FileReaderLoader.cpp b/third_party/WebKit/Source/core/fileapi/FileReaderLoader.cpp index 70361e9..ec334a5 100644 --- a/third_party/WebKit/Source/core/fileapi/FileReaderLoader.cpp +++ b/third_party/WebKit/Source/core/fileapi/FileReaderLoader.cpp
@@ -32,13 +32,13 @@ #include "core/dom/DOMArrayBuffer.h" #include "core/dom/ExecutionContext.h" -#include "core/fetch/FetchInitiatorTypeNames.h" #include "core/fileapi/Blob.h" #include "core/fileapi/FileReaderLoaderClient.h" #include "core/html/parser/TextResourceDecoder.h" #include "core/loader/ThreadableLoader.h" #include "platform/blob/BlobRegistry.h" #include "platform/blob/BlobURL.h" +#include "platform/loader/fetch/FetchInitiatorTypeNames.h" #include "platform/network/ResourceError.h" #include "platform/network/ResourceRequest.h" #include "platform/network/ResourceResponse.h"
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp index 6556ad4..9fca55f 100644 --- a/third_party/WebKit/Source/core/frame/FrameView.cpp +++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -45,7 +45,6 @@ #include "core/editing/RenderedPosition.h" #include "core/editing/markers/DocumentMarkerController.h" #include "core/events/ErrorEvent.h" -#include "core/fetch/ResourceFetcher.h" #include "core/frame/BrowserControls.h" #include "core/frame/EventHandlerRegistry.h" #include "core/frame/FrameHost.h" @@ -122,6 +121,7 @@ #include "platform/instrumentation/tracing/TraceEvent.h" #include "platform/instrumentation/tracing/TracedValue.h" #include "platform/json/JSONValues.h" +#include "platform/loader/fetch/ResourceFetcher.h" #include "platform/scroll/ScrollAnimatorBase.h" #include "platform/scroll/ScrollbarTheme.h" #include "platform/text/TextStream.h"
diff --git a/third_party/WebKit/Source/core/frame/ImageBitmapTest.cpp b/third_party/WebKit/Source/core/frame/ImageBitmapTest.cpp index 81678cd..e07812a 100644 --- a/third_party/WebKit/Source/core/frame/ImageBitmapTest.cpp +++ b/third_party/WebKit/Source/core/frame/ImageBitmapTest.cpp
@@ -32,7 +32,6 @@ #include "SkPixelRef.h" // FIXME: qualify this skia header file. #include "core/dom/Document.h" -#include "core/fetch/MemoryCache.h" #include "core/frame/FrameView.h" #include "core/html/HTMLCanvasElement.h" #include "core/html/HTMLImageElement.h" @@ -43,6 +42,7 @@ #include "platform/graphics/skia/SkiaUtils.h" #include "platform/heap/Handle.h" #include "platform/image-decoders/ImageDecoder.h" +#include "platform/loader/fetch/MemoryCache.h" #include "platform/network/ResourceRequest.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/skia/include/core/SkCanvas.h"
diff --git a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp index 62548b8..c474d8d 100644 --- a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp +++ b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
@@ -50,7 +50,6 @@ #include "core/events/PageTransitionEvent.h" #include "core/events/PopStateEvent.h" #include "core/events/ScopedEventQueue.h" -#include "core/fetch/ResourceFetcher.h" #include "core/frame/BarProp.h" #include "core/frame/DOMVisualViewport.h" #include "core/frame/EventHandlerRegistry.h" @@ -82,6 +81,7 @@ #include "core/timing/Performance.h" #include "platform/EventDispatchForbiddenScope.h" #include "platform/WebFrameScheduler.h" +#include "platform/loader/fetch/ResourceFetcher.h" #include "platform/weborigin/SecurityOrigin.h" #include "platform/weborigin/Suborigin.h" #include "public/platform/Platform.h"
diff --git a/third_party/WebKit/Source/core/frame/LocalFrame.cpp b/third_party/WebKit/Source/core/frame/LocalFrame.cpp index 78748e931..5c0ed1c 100644 --- a/third_party/WebKit/Source/core/frame/LocalFrame.cpp +++ b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
@@ -43,7 +43,6 @@ #include "core/editing/spellcheck/IdleSpellCheckCallback.h" #include "core/editing/spellcheck/SpellChecker.h" #include "core/events/Event.h" -#include "core/fetch/ResourceFetcher.h" #include "core/frame/EventHandlerRegistry.h" #include "core/frame/FrameConsole.h" #include "core/frame/FrameHost.h" @@ -88,6 +87,7 @@ #include "platform/graphics/paint/SkPictureBuilder.h" #include "platform/graphics/paint/TransformDisplayItem.h" #include "platform/json/JSONValues.h" +#include "platform/loader/fetch/ResourceFetcher.h" #include "platform/plugins/PluginData.h" #include "platform/text/TextStream.h" #include "public/platform/InterfaceProvider.h"
diff --git a/third_party/WebKit/Source/core/frame/SubresourceIntegrity.cpp b/third_party/WebKit/Source/core/frame/SubresourceIntegrity.cpp index 6000fdc..26b67f7c 100644 --- a/third_party/WebKit/Source/core/frame/SubresourceIntegrity.cpp +++ b/third_party/WebKit/Source/core/frame/SubresourceIntegrity.cpp
@@ -8,10 +8,10 @@ #include "core/dom/Document.h" #include "core/dom/Element.h" #include "core/dom/ExecutionContext.h" -#include "core/fetch/Resource.h" #include "core/frame/UseCounter.h" #include "core/inspector/ConsoleMessage.h" #include "platform/Crypto.h" +#include "platform/loader/fetch/Resource.h" #include "platform/weborigin/KURL.h" #include "platform/weborigin/SecurityOrigin.h" #include "public/platform/WebCrypto.h"
diff --git a/third_party/WebKit/Source/core/frame/SubresourceIntegrity.h b/third_party/WebKit/Source/core/frame/SubresourceIntegrity.h index b42f7b8..56c6333 100644 --- a/third_party/WebKit/Source/core/frame/SubresourceIntegrity.h +++ b/third_party/WebKit/Source/core/frame/SubresourceIntegrity.h
@@ -7,8 +7,8 @@ #include "base/gtest_prod_util.h" #include "core/CoreExport.h" -#include "core/fetch/IntegrityMetadata.h" #include "platform/Crypto.h" +#include "platform/loader/fetch/IntegrityMetadata.h" #include "wtf/Allocator.h" #include "wtf/text/WTFString.h"
diff --git a/third_party/WebKit/Source/core/frame/SubresourceIntegrityTest.cpp b/third_party/WebKit/Source/core/frame/SubresourceIntegrityTest.cpp index c9f3e39..7beac2f 100644 --- a/third_party/WebKit/Source/core/frame/SubresourceIntegrityTest.cpp +++ b/third_party/WebKit/Source/core/frame/SubresourceIntegrityTest.cpp
@@ -6,11 +6,11 @@ #include "core/HTMLNames.h" #include "core/dom/Document.h" -#include "core/fetch/IntegrityMetadata.h" -#include "core/fetch/RawResource.h" -#include "core/fetch/Resource.h" #include "core/html/HTMLScriptElement.h" #include "platform/Crypto.h" +#include "platform/loader/fetch/IntegrityMetadata.h" +#include "platform/loader/fetch/RawResource.h" +#include "platform/loader/fetch/Resource.h" #include "platform/weborigin/KURL.h" #include "platform/weborigin/SecurityOrigin.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.h b/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.h index 2c3a817..7dba69f 100644 --- a/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.h +++ b/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.h
@@ -5,11 +5,11 @@ #ifndef CSPDirectiveList_h #define CSPDirectiveList_h -#include "core/fetch/Resource.h" #include "core/frame/csp/ContentSecurityPolicy.h" #include "core/frame/csp/MediaListDirective.h" #include "core/frame/csp/SourceListDirective.h" #include "platform/heap/Handle.h" +#include "platform/loader/fetch/Resource.h" #include "platform/network/ContentSecurityPolicyParsers.h" #include "platform/network/HTTPParsers.h" #include "platform/network/ResourceRequest.h"
diff --git a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp index 9a34b96..9b43214a 100644 --- a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp +++ b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp
@@ -35,7 +35,6 @@ #include "core/dom/TaskRunnerHelper.h" #include "core/events/EventQueue.h" #include "core/events/SecurityPolicyViolationEvent.h" -#include "core/fetch/IntegrityMetadata.h" #include "core/frame/FrameClient.h" #include "core/frame/LocalDOMWindow.h" #include "core/frame/LocalFrame.h" @@ -53,6 +52,7 @@ #include "core/workers/WorkerGlobalScope.h" #include "platform/RuntimeEnabledFeatures.h" #include "platform/json/JSONValues.h" +#include "platform/loader/fetch/IntegrityMetadata.h" #include "platform/network/ContentSecurityPolicyParsers.h" #include "platform/network/ContentSecurityPolicyResponseHeaders.h" #include "platform/network/EncodedFormData.h"
diff --git a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.h b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.h index e19cd49..7e972cc 100644 --- a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.h +++ b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.h
@@ -30,9 +30,9 @@ #include "core/CoreExport.h" #include "core/dom/ExecutionContext.h" #include "core/dom/SecurityContext.h" -#include "core/fetch/Resource.h" #include "core/inspector/ConsoleTypes.h" #include "platform/heap/Handle.h" +#include "platform/loader/fetch/Resource.h" #include "platform/network/ContentSecurityPolicyParsers.h" #include "platform/network/HTTPParsers.h" #include "platform/network/ResourceRequest.h"
diff --git a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicyTest.cpp b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicyTest.cpp index cc39c481..5256b4e 100644 --- a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicyTest.cpp +++ b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicyTest.cpp
@@ -5,13 +5,13 @@ #include "core/frame/csp/ContentSecurityPolicy.h" #include "core/dom/Document.h" -#include "core/fetch/IntegrityMetadata.h" #include "core/frame/csp/CSPDirectiveList.h" #include "core/html/HTMLScriptElement.h" #include "core/loader/DocumentLoader.h" #include "core/testing/DummyPageHolder.h" #include "platform/Crypto.h" #include "platform/RuntimeEnabledFeatures.h" +#include "platform/loader/fetch/IntegrityMetadata.h" #include "platform/network/ContentSecurityPolicyParsers.h" #include "platform/network/ResourceRequest.h" #include "platform/weborigin/KURL.h"
diff --git a/third_party/WebKit/Source/core/html/HTMLDocument.h b/third_party/WebKit/Source/core/html/HTMLDocument.h index 502d29e..ba47969 100644 --- a/third_party/WebKit/Source/core/html/HTMLDocument.h +++ b/third_party/WebKit/Source/core/html/HTMLDocument.h
@@ -24,7 +24,7 @@ #define HTMLDocument_h #include "core/dom/Document.h" -#include "core/fetch/ResourceClient.h" +#include "platform/loader/fetch/ResourceClient.h" #include "wtf/HashCountedSet.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/html/HTMLImageElement.h b/third_party/WebKit/Source/core/html/HTMLImageElement.h index 40fef19..b831d14 100644 --- a/third_party/WebKit/Source/core/html/HTMLImageElement.h +++ b/third_party/WebKit/Source/core/html/HTMLImageElement.h
@@ -26,13 +26,13 @@ #include "bindings/core/v8/ActiveScriptWrappable.h" #include "core/CoreExport.h" -#include "core/fetch/FetchRequest.h" #include "core/html/FormAssociated.h" #include "core/html/HTMLElement.h" #include "core/html/HTMLImageLoader.h" #include "core/html/canvas/CanvasImageSource.h" #include "core/imagebitmap/ImageBitmapSource.h" #include "platform/graphics/GraphicsTypes.h" +#include "platform/loader/fetch/FetchRequest.h" #include "platform/network/ResourceResponse.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/html/HTMLImageLoader.cpp b/third_party/WebKit/Source/core/html/HTMLImageLoader.cpp index 9535f01b..85c1cbd 100644 --- a/third_party/WebKit/Source/core/html/HTMLImageLoader.cpp +++ b/third_party/WebKit/Source/core/html/HTMLImageLoader.cpp
@@ -24,12 +24,12 @@ #include "core/HTMLNames.h" #include "core/dom/Element.h" #include "core/events/Event.h" -#include "core/fetch/ResourceLoadingLog.h" #include "core/html/HTMLImageElement.h" #include "core/html/HTMLInputElement.h" #include "core/html/HTMLObjectElement.h" #include "core/html/parser/HTMLParserIdioms.h" #include "core/loader/resource/ImageResourceContent.h" +#include "platform/loader/fetch/ResourceLoadingLog.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/html/LinkResource.h b/third_party/WebKit/Source/core/html/LinkResource.h index 206ef6d..3bd5ab92 100644 --- a/third_party/WebKit/Source/core/html/LinkResource.h +++ b/third_party/WebKit/Source/core/html/LinkResource.h
@@ -32,8 +32,8 @@ #define LinkResource_h #include "core/CoreExport.h" -#include "core/fetch/FetchRequest.h" #include "platform/heap/Handle.h" +#include "platform/loader/fetch/FetchRequest.h" #include "platform/weborigin/KURL.h" #include "wtf/text/WTFString.h"
diff --git a/third_party/WebKit/Source/core/html/LinkStyle.h b/third_party/WebKit/Source/core/html/LinkStyle.h index 16b099fa..99dfded 100644 --- a/third_party/WebKit/Source/core/html/LinkStyle.h +++ b/third_party/WebKit/Source/core/html/LinkStyle.h
@@ -7,10 +7,10 @@ #include "core/dom/Node.h" #include "core/dom/StyleEngine.h" -#include "core/fetch/ResourceOwner.h" #include "core/html/LinkResource.h" #include "core/loader/resource/StyleSheetResource.h" #include "core/loader/resource/StyleSheetResourceClient.h" +#include "platform/loader/fetch/ResourceOwner.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/html/imports/HTMLImportLoader.h b/third_party/WebKit/Source/core/html/imports/HTMLImportLoader.h index da105ac..79701c6 100644 --- a/third_party/WebKit/Source/core/html/imports/HTMLImportLoader.h +++ b/third_party/WebKit/Source/core/html/imports/HTMLImportLoader.h
@@ -32,9 +32,9 @@ #define HTMLImportLoader_h #include "core/dom/DocumentParserClient.h" -#include "core/fetch/RawResource.h" -#include "core/fetch/ResourceOwner.h" #include "platform/heap/Handle.h" +#include "platform/loader/fetch/RawResource.h" +#include "platform/loader/fetch/ResourceOwner.h" #include "wtf/Vector.h" #include <memory>
diff --git a/third_party/WebKit/Source/core/html/imports/HTMLImportsController.cpp b/third_party/WebKit/Source/core/html/imports/HTMLImportsController.cpp index ec9374d..1281a303 100644 --- a/third_party/WebKit/Source/core/html/imports/HTMLImportsController.cpp +++ b/third_party/WebKit/Source/core/html/imports/HTMLImportsController.cpp
@@ -31,13 +31,13 @@ #include "core/html/imports/HTMLImportsController.h" #include "core/dom/Document.h" -#include "core/fetch/ResourceFetcher.h" #include "core/frame/LocalFrame.h" #include "core/frame/UseCounter.h" #include "core/html/imports/HTMLImportChild.h" #include "core/html/imports/HTMLImportChildClient.h" #include "core/html/imports/HTMLImportLoader.h" #include "core/html/imports/HTMLImportTreeRoot.h" +#include "platform/loader/fetch/ResourceFetcher.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.cpp b/third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.cpp index c943acd..e3b0069e 100644 --- a/third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.cpp +++ b/third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.cpp
@@ -28,13 +28,13 @@ #include "core/html/parser/CSSPreloadScanner.h" #include "core/dom/Document.h" -#include "core/fetch/FetchInitiatorTypeNames.h" #include "core/frame/Settings.h" #include "core/html/parser/HTMLParserIdioms.h" #include "core/html/parser/HTMLResourcePreloader.h" #include "core/loader/DocumentLoader.h" #include "core/loader/resource/CSSStyleSheetResource.h" #include "platform/Histogram.h" +#include "platform/loader/fetch/FetchInitiatorTypeNames.h" #include "platform/text/SegmentedString.h" #include <memory>
diff --git a/third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.h b/third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.h index bab368c..c8de46f 100644 --- a/third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.h +++ b/third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.h
@@ -27,12 +27,12 @@ #ifndef CSSPreloadScanner_h #define CSSPreloadScanner_h -#include "core/fetch/ResourceOwner.h" #include "core/html/parser/HTMLToken.h" #include "core/html/parser/PreloadRequest.h" #include "core/loader/resource/CSSStyleSheetResource.h" #include "core/loader/resource/StyleSheetResourceClient.h" #include "platform/heap/Handle.h" +#include "platform/loader/fetch/ResourceOwner.h" #include "wtf/text/StringBuilder.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/html/parser/CSSPreloadScannerTest.cpp b/third_party/WebKit/Source/core/html/parser/CSSPreloadScannerTest.cpp index e9ad6f5..130c77e 100644 --- a/third_party/WebKit/Source/core/html/parser/CSSPreloadScannerTest.cpp +++ b/third_party/WebKit/Source/core/html/parser/CSSPreloadScannerTest.cpp
@@ -4,13 +4,13 @@ #include "core/html/parser/CSSPreloadScanner.h" -#include "core/fetch/FetchContext.h" -#include "core/fetch/Resource.h" -#include "core/fetch/ResourceFetcher.h" #include "core/frame/Settings.h" #include "core/html/parser/HTMLResourcePreloader.h" #include "core/testing/DummyPageHolder.h" #include "platform/heap/Heap.h" +#include "platform/loader/fetch/FetchContext.h" +#include "platform/loader/fetch/Resource.h" +#include "platform/loader/fetch/ResourceFetcher.h" #include "platform/network/ResourceError.h" #include "platform/network/ResourceRequest.h" #include "platform/weborigin/KURL.h"
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp b/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp index fac3693..a8e305bb 100644 --- a/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp +++ b/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp
@@ -32,7 +32,6 @@ #include "core/dom/DocumentFragment.h" #include "core/dom/Element.h" #include "core/dom/TaskRunnerHelper.h" -#include "core/fetch/ResourceFetcher.h" #include "core/frame/LocalFrame.h" #include "core/frame/Settings.h" #include "core/html/HTMLDocument.h" @@ -54,6 +53,7 @@ #include "platform/WebFrameScheduler.h" #include "platform/heap/Handle.h" #include "platform/instrumentation/tracing/TraceEvent.h" +#include "platform/loader/fetch/ResourceFetcher.h" #include "public/platform/Platform.h" #include "public/platform/WebLoadingBehaviorFlag.h" #include "public/platform/WebScheduler.h"
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp b/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp index c01b999..b2398956 100644 --- a/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp +++ b/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp
@@ -34,7 +34,6 @@ #include "core/dom/ScriptLoader.h" #include "core/dom/TaskRunnerHelper.h" #include "core/events/Event.h" -#include "core/fetch/MemoryCache.h" #include "core/frame/LocalFrame.h" #include "core/html/parser/HTMLInputStream.h" #include "core/html/parser/HTMLParserScriptRunnerHost.h" @@ -44,6 +43,7 @@ #include "platform/WebFrameScheduler.h" #include "platform/instrumentation/tracing/TraceEvent.h" #include "platform/instrumentation/tracing/TracedValue.h" +#include "platform/loader/fetch/MemoryCache.h" #include "public/platform/Platform.h" #include <inttypes.h> #include <memory>
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.h b/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.h index 9d4946a1..f61cf2f 100644 --- a/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.h +++ b/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.h
@@ -28,9 +28,9 @@ #include "bindings/core/v8/ScriptStreamer.h" #include "core/dom/PendingScript.h" -#include "core/fetch/ResourceClient.h" #include "core/html/parser/HTMLParserReentryPermit.h" #include "platform/heap/Handle.h" +#include "platform/loader/fetch/ResourceClient.h" #include "wtf/Deque.h" #include "wtf/RefPtr.h" #include "wtf/text/TextPosition.h"
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp b/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp index c92c9f48..2b5e155 100644 --- a/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp +++ b/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp
@@ -35,7 +35,6 @@ #include "core/css/parser/SizesAttributeParser.h" #include "core/dom/Document.h" #include "core/dom/ScriptLoader.h" -#include "core/fetch/IntegrityMetadata.h" #include "core/frame/LocalFrame.h" #include "core/frame/Settings.h" #include "core/frame/SubresourceIntegrity.h" @@ -49,6 +48,7 @@ #include "core/loader/LinkLoader.h" #include "platform/Histogram.h" #include "platform/instrumentation/tracing/TraceEvent.h" +#include "platform/loader/fetch/IntegrityMetadata.h" #include "platform/network/mime/ContentType.h" #include "platform/network/mime/MIMETypeRegistry.h" #include "wtf/Optional.h"
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLPreloadScannerTest.cpp b/third_party/WebKit/Source/core/html/parser/HTMLPreloadScannerTest.cpp index f5e3fe6..f73a9b9 100644 --- a/third_party/WebKit/Source/core/html/parser/HTMLPreloadScannerTest.cpp +++ b/third_party/WebKit/Source/core/html/parser/HTMLPreloadScannerTest.cpp
@@ -6,13 +6,13 @@ #include "core/MediaTypeNames.h" #include "core/css/MediaValuesCached.h" -#include "core/fetch/ClientHintsPreferences.h" #include "core/frame/Settings.h" #include "core/html/CrossOriginAttribute.h" #include "core/html/parser/HTMLParserOptions.h" #include "core/html/parser/HTMLResourcePreloader.h" #include "core/html/parser/PreloadRequest.h" #include "core/testing/DummyPageHolder.h" +#include "platform/loader/fetch/ClientHintsPreferences.h" #include "testing/gtest/include/gtest/gtest.h" #include <memory>
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLResourcePreloader.cpp b/third_party/WebKit/Source/core/html/parser/HTMLResourcePreloader.cpp index 4b4801184..940c1aa 100644 --- a/third_party/WebKit/Source/core/html/parser/HTMLResourcePreloader.cpp +++ b/third_party/WebKit/Source/core/html/parser/HTMLResourcePreloader.cpp
@@ -26,13 +26,13 @@ #include "core/html/parser/HTMLResourcePreloader.h" #include "core/dom/Document.h" -#include "core/fetch/Resource.h" -#include "core/fetch/ResourceFetcher.h" #include "core/frame/Deprecation.h" #include "core/frame/Settings.h" #include "core/loader/DocumentLoader.h" #include "core/loader/resource/CSSStyleSheetResource.h" #include "platform/Histogram.h" +#include "platform/loader/fetch/Resource.h" +#include "platform/loader/fetch/ResourceFetcher.h" #include "public/platform/Platform.h" #include <memory>
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLSrcsetParser.cpp b/third_party/WebKit/Source/core/html/parser/HTMLSrcsetParser.cpp index b2cee22..ff0246e9 100644 --- a/third_party/WebKit/Source/core/html/parser/HTMLSrcsetParser.cpp +++ b/third_party/WebKit/Source/core/html/parser/HTMLSrcsetParser.cpp
@@ -32,14 +32,14 @@ #include "core/html/parser/HTMLSrcsetParser.h" #include "core/dom/Document.h" -#include "core/fetch/MemoryCache.h" -#include "core/fetch/ResourceFetcher.h" #include "core/frame/FrameConsole.h" #include "core/frame/LocalFrame.h" #include "core/frame/UseCounter.h" #include "core/html/parser/HTMLParserIdioms.h" #include "core/inspector/ConsoleMessage.h" #include "platform/json/JSONValues.h" +#include "platform/loader/fetch/MemoryCache.h" +#include "platform/loader/fetch/ResourceFetcher.h" #include "wtf/text/ParsingUtilities.h" #include "wtf/text/StringToNumber.h" #include <algorithm>
diff --git a/third_party/WebKit/Source/core/html/parser/PreloadRequest.cpp b/third_party/WebKit/Source/core/html/parser/PreloadRequest.cpp index 005e9f64..e8d296e 100644 --- a/third_party/WebKit/Source/core/html/parser/PreloadRequest.cpp +++ b/third_party/WebKit/Source/core/html/parser/PreloadRequest.cpp
@@ -5,11 +5,11 @@ #include "core/html/parser/PreloadRequest.h" #include "core/dom/Document.h" -#include "core/fetch/FetchInitiatorInfo.h" -#include "core/fetch/FetchRequest.h" -#include "core/fetch/ResourceFetcher.h" #include "core/loader/DocumentLoader.h" #include "platform/CrossOriginAttributeValue.h" +#include "platform/loader/fetch/FetchInitiatorInfo.h" +#include "platform/loader/fetch/FetchRequest.h" +#include "platform/loader/fetch/ResourceFetcher.h" #include "platform/weborigin/SecurityPolicy.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/html/parser/PreloadRequest.h b/third_party/WebKit/Source/core/html/parser/PreloadRequest.h index a60cd53..88de442a 100644 --- a/third_party/WebKit/Source/core/html/parser/PreloadRequest.h +++ b/third_party/WebKit/Source/core/html/parser/PreloadRequest.h
@@ -5,11 +5,11 @@ #ifndef PreloadRequest_h #define PreloadRequest_h -#include "core/fetch/ClientHintsPreferences.h" -#include "core/fetch/FetchRequest.h" -#include "core/fetch/IntegrityMetadata.h" -#include "core/fetch/Resource.h" #include "platform/CrossOriginAttributeValue.h" +#include "platform/loader/fetch/ClientHintsPreferences.h" +#include "platform/loader/fetch/FetchRequest.h" +#include "platform/loader/fetch/IntegrityMetadata.h" +#include "platform/loader/fetch/Resource.h" #include "platform/weborigin/SecurityPolicy.h" #include "wtf/Allocator.h" #include "wtf/PtrUtil.h"
diff --git a/third_party/WebKit/Source/core/inspector/DevToolsHost.cpp b/third_party/WebKit/Source/core/inspector/DevToolsHost.cpp index 8d94374..c228aa2 100644 --- a/third_party/WebKit/Source/core/inspector/DevToolsHost.cpp +++ b/third_party/WebKit/Source/core/inspector/DevToolsHost.cpp
@@ -36,7 +36,6 @@ #include "core/dom/ExecutionContext.h" #include "core/events/Event.h" #include "core/events/EventTarget.h" -#include "core/fetch/ResourceFetcher.h" #include "core/frame/FrameView.h" #include "core/frame/LocalDOMWindow.h" #include "core/frame/LocalFrame.h" @@ -53,6 +52,7 @@ #include "platform/ScriptForbiddenScope.h" #include "platform/SharedBuffer.h" #include "platform/UserGestureIndicator.h" +#include "platform/loader/fetch/ResourceFetcher.h" #include "platform/network/ResourceError.h" #include "platform/network/ResourceRequest.h" #include "platform/network/ResourceResponse.h"
diff --git a/third_party/WebKit/Source/core/inspector/InspectorInstrumentation.cpp b/third_party/WebKit/Source/core/inspector/InspectorInstrumentation.cpp index 7a33ad33..eb2e47d 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorInstrumentation.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorInstrumentation.cpp
@@ -33,7 +33,6 @@ #include "core/InstrumentingAgents.h" #include "core/events/Event.h" #include "core/events/EventTarget.h" -#include "core/fetch/FetchInitiatorInfo.h" #include "core/frame/FrameHost.h" #include "core/inspector/InspectorCSSAgent.h" #include "core/inspector/InspectorDOMDebuggerAgent.h" @@ -47,6 +46,7 @@ #include "core/workers/MainThreadWorkletGlobalScope.h" #include "core/workers/WorkerGlobalScope.h" #include "core/workers/WorkerThread.h" +#include "platform/loader/fetch/FetchInitiatorInfo.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp index 871393a..2aab6c33 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp
@@ -35,12 +35,6 @@ #include "core/dom/Document.h" #include "core/dom/ScriptableDocumentParser.h" #include "core/dom/TaskRunnerHelper.h" -#include "core/fetch/FetchInitiatorInfo.h" -#include "core/fetch/FetchInitiatorTypeNames.h" -#include "core/fetch/MemoryCache.h" -#include "core/fetch/Resource.h" -#include "core/fetch/ResourceFetcher.h" -#include "core/fetch/UniqueIdentifier.h" #include "core/fileapi/FileReaderLoader.h" #include "core/fileapi/FileReaderLoaderClient.h" #include "core/frame/FrameConsole.h" @@ -61,6 +55,12 @@ #include "core/xmlhttprequest/XMLHttpRequest.h" #include "platform/RuntimeEnabledFeatures.h" #include "platform/blob/BlobData.h" +#include "platform/loader/fetch/FetchInitiatorInfo.h" +#include "platform/loader/fetch/FetchInitiatorTypeNames.h" +#include "platform/loader/fetch/MemoryCache.h" +#include "platform/loader/fetch/Resource.h" +#include "platform/loader/fetch/ResourceFetcher.h" +#include "platform/loader/fetch/UniqueIdentifier.h" #include "platform/network/HTTPHeaderMap.h" #include "platform/network/ResourceError.h" #include "platform/network/ResourceLoadTiming.h"
diff --git a/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp index f75a8df..812d33c 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp
@@ -36,9 +36,6 @@ #include "core/HTMLNames.h" #include "core/dom/DOMImplementation.h" #include "core/dom/Document.h" -#include "core/fetch/MemoryCache.h" -#include "core/fetch/Resource.h" -#include "core/fetch/ResourceFetcher.h" #include "core/frame/FrameHost.h" #include "core/frame/FrameView.h" #include "core/frame/LocalFrame.h" @@ -62,6 +59,9 @@ #include "core/loader/resource/ScriptResource.h" #include "platform/PlatformResourceLoader.h" #include "platform/UserGestureIndicator.h" +#include "platform/loader/fetch/MemoryCache.h" +#include "platform/loader/fetch/Resource.h" +#include "platform/loader/fetch/ResourceFetcher.h" #include "platform/network/mime/MIMETypeRegistry.h" #include "platform/weborigin/SecurityOrigin.h" #include "wtf/CurrentTime.h"
diff --git a/third_party/WebKit/Source/core/inspector/InspectorResourceContentLoader.cpp b/third_party/WebKit/Source/core/inspector/InspectorResourceContentLoader.cpp index 7a4e20a..8fce332 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorResourceContentLoader.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorResourceContentLoader.cpp
@@ -7,10 +7,6 @@ #include "core/css/CSSStyleSheet.h" #include "core/css/StyleSheetContents.h" #include "core/dom/Document.h" -#include "core/fetch/FetchInitiatorTypeNames.h" -#include "core/fetch/RawResource.h" -#include "core/fetch/Resource.h" -#include "core/fetch/ResourceFetcher.h" #include "core/frame/LocalFrame.h" #include "core/inspector/InspectedFrames.h" #include "core/inspector/InspectorCSSAgent.h" @@ -18,6 +14,10 @@ #include "core/loader/resource/CSSStyleSheetResource.h" #include "core/loader/resource/StyleSheetResourceClient.h" #include "core/page/Page.h" +#include "platform/loader/fetch/FetchInitiatorTypeNames.h" +#include "platform/loader/fetch/RawResource.h" +#include "platform/loader/fetch/Resource.h" +#include "platform/loader/fetch/ResourceFetcher.h" #include "public/platform/WebCachePolicy.h" #include "public/platform/WebURLRequest.h"
diff --git a/third_party/WebKit/Source/core/inspector/InspectorResourceContentLoader.h b/third_party/WebKit/Source/core/inspector/InspectorResourceContentLoader.h index a8671c3..41feed2 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorResourceContentLoader.h +++ b/third_party/WebKit/Source/core/inspector/InspectorResourceContentLoader.h
@@ -6,7 +6,7 @@ #define InspectorResourceContentLoader_h #include "core/CoreExport.h" -#include "core/fetch/Resource.h" +#include "platform/loader/fetch/Resource.h" #include "wtf/Functional.h" #include "wtf/HashMap.h" #include "wtf/HashSet.h"
diff --git a/third_party/WebKit/Source/core/inspector/NetworkResourcesData.cpp b/third_party/WebKit/Source/core/inspector/NetworkResourcesData.cpp index 3ddf25f..8a877c7 100644 --- a/third_party/WebKit/Source/core/inspector/NetworkResourcesData.cpp +++ b/third_party/WebKit/Source/core/inspector/NetworkResourcesData.cpp
@@ -29,8 +29,8 @@ #include "core/inspector/NetworkResourcesData.h" #include "core/dom/DOMImplementation.h" -#include "core/fetch/Resource.h" #include "platform/SharedBuffer.h" +#include "platform/loader/fetch/Resource.h" #include "platform/network/ResourceResponse.h" #include <memory>
diff --git a/third_party/WebKit/Source/core/inspector/browser_protocol.json b/third_party/WebKit/Source/core/inspector/browser_protocol.json index e3cfff5..e25a9c23 100644 --- a/third_party/WebKit/Source/core/inspector/browser_protocol.json +++ b/third_party/WebKit/Source/core/inspector/browser_protocol.json
@@ -416,12 +416,8 @@ { "name": "captureScreenshot", "description": "Capture page screenshot.", - "parameters": [ - { "name": "format", "type": "string", "optional": true, "enum": ["jpeg", "png"], "description": "Image compression format (defaults to png)." }, - { "name": "quality", "type": "integer", "optional": true, "description": "Compression quality from range [0..100] (jpeg only)." } - ], "returns": [ - { "name": "data", "type": "string", "description": "Base64-encoded image data." } + { "name": "data", "type": "string", "description": "Base64-encoded image data (PNG)." } ], "experimental": true },
diff --git a/third_party/WebKit/Source/core/layout/LayoutImage.h b/third_party/WebKit/Source/core/layout/LayoutImage.h index 668c8799..bc63b2f6 100644 --- a/third_party/WebKit/Source/core/layout/LayoutImage.h +++ b/third_party/WebKit/Source/core/layout/LayoutImage.h
@@ -27,9 +27,9 @@ #define LayoutImage_h #include "core/CoreExport.h" -#include "core/fetch/ResourceClient.h" #include "core/layout/LayoutImageResource.h" #include "core/layout/LayoutReplaced.h" +#include "platform/loader/fetch/ResourceClient.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/layout/LayoutTestHelper.cpp b/third_party/WebKit/Source/core/layout/LayoutTestHelper.cpp index 4d6759e..06ccad5 100644 --- a/third_party/WebKit/Source/core/layout/LayoutTestHelper.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutTestHelper.cpp
@@ -4,9 +4,9 @@ #include "core/layout/LayoutTestHelper.h" -#include "core/fetch/MemoryCache.h" #include "core/frame/FrameHost.h" #include "core/html/HTMLIFrameElement.h" +#include "platform/loader/fetch/MemoryCache.h" #include "platform/scroll/ScrollbarTheme.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/loader/CrossOriginPreflightResultCache.cpp b/third_party/WebKit/Source/core/loader/CrossOriginPreflightResultCache.cpp index 277b8a5..e987bfb 100644 --- a/third_party/WebKit/Source/core/loader/CrossOriginPreflightResultCache.cpp +++ b/third_party/WebKit/Source/core/loader/CrossOriginPreflightResultCache.cpp
@@ -26,8 +26,8 @@ #include "core/loader/CrossOriginPreflightResultCache.h" -#include "core/fetch/FetchUtils.h" #include "platform/HTTPNames.h" +#include "platform/loader/fetch/FetchUtils.h" #include "platform/network/ResourceResponse.h" #include "wtf/CurrentTime.h" #include "wtf/StdLibExtras.h"
diff --git a/third_party/WebKit/Source/core/loader/CrossOriginPreflightResultCache.h b/third_party/WebKit/Source/core/loader/CrossOriginPreflightResultCache.h index 10d4b18..1fa930e2 100644 --- a/third_party/WebKit/Source/core/loader/CrossOriginPreflightResultCache.h +++ b/third_party/WebKit/Source/core/loader/CrossOriginPreflightResultCache.h
@@ -27,7 +27,7 @@ #ifndef CrossOriginPreflightResultCache_h #define CrossOriginPreflightResultCache_h -#include "core/fetch/ResourceLoaderOptions.h" +#include "platform/loader/fetch/ResourceLoaderOptions.h" #include "platform/weborigin/KURLHash.h" #include "wtf/HashMap.h" #include "wtf/HashSet.h"
diff --git a/third_party/WebKit/Source/core/loader/DocumentLoader.cpp b/third_party/WebKit/Source/core/loader/DocumentLoader.cpp index 245fd644..c04830b5 100644 --- a/third_party/WebKit/Source/core/loader/DocumentLoader.cpp +++ b/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
@@ -33,11 +33,6 @@ #include "core/dom/DocumentParser.h" #include "core/dom/WeakIdentifierMap.h" #include "core/events/Event.h" -#include "core/fetch/FetchInitiatorTypeNames.h" -#include "core/fetch/FetchRequest.h" -#include "core/fetch/FetchUtils.h" -#include "core/fetch/MemoryCache.h" -#include "core/fetch/ResourceFetcher.h" #include "core/frame/Deprecation.h" #include "core/frame/FrameHost.h" #include "core/frame/LocalDOMWindow.h" @@ -64,6 +59,11 @@ #include "core/page/Page.h" #include "platform/HTTPNames.h" #include "platform/UserGestureIndicator.h" +#include "platform/loader/fetch/FetchInitiatorTypeNames.h" +#include "platform/loader/fetch/FetchRequest.h" +#include "platform/loader/fetch/FetchUtils.h" +#include "platform/loader/fetch/MemoryCache.h" +#include "platform/loader/fetch/ResourceFetcher.h" #include "platform/mhtml/ArchiveResource.h" #include "platform/network/ContentSecurityPolicyResponseHeaders.h" #include "platform/network/HTTPParsers.h"
diff --git a/third_party/WebKit/Source/core/loader/DocumentLoader.h b/third_party/WebKit/Source/core/loader/DocumentLoader.h index 1117913..17c65bd 100644 --- a/third_party/WebKit/Source/core/loader/DocumentLoader.h +++ b/third_party/WebKit/Source/core/loader/DocumentLoader.h
@@ -33,10 +33,6 @@ #include "core/CoreExport.h" #include "core/dom/ViewportDescription.h" #include "core/dom/WeakIdentifierMap.h" -#include "core/fetch/ClientHintsPreferences.h" -#include "core/fetch/RawResource.h" -#include "core/fetch/ResourceLoaderOptions.h" -#include "core/fetch/SubstituteData.h" #include "core/frame/FrameTypes.h" #include "core/frame/csp/ContentSecurityPolicy.h" #include "core/loader/DocumentLoadTiming.h" @@ -45,6 +41,10 @@ #include "core/loader/LinkLoader.h" #include "core/loader/NavigationPolicy.h" #include "platform/SharedBuffer.h" +#include "platform/loader/fetch/ClientHintsPreferences.h" +#include "platform/loader/fetch/RawResource.h" +#include "platform/loader/fetch/ResourceLoaderOptions.h" +#include "platform/loader/fetch/SubstituteData.h" #include "platform/network/ResourceError.h" #include "platform/network/ResourceRequest.h" #include "platform/network/ResourceResponse.h"
diff --git a/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp b/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp index 2110f39c..d1431a2 100644 --- a/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp +++ b/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp
@@ -33,11 +33,6 @@ #include "core/dom/Document.h" #include "core/dom/TaskRunnerHelper.h" -#include "core/fetch/CrossOriginAccessControl.h" -#include "core/fetch/FetchRequest.h" -#include "core/fetch/FetchUtils.h" -#include "core/fetch/Resource.h" -#include "core/fetch/ResourceFetcher.h" #include "core/frame/FrameConsole.h" #include "core/frame/LocalFrame.h" #include "core/inspector/InspectorInstrumentation.h" @@ -50,6 +45,11 @@ #include "core/page/ChromeClient.h" #include "core/page/Page.h" #include "platform/SharedBuffer.h" +#include "platform/loader/fetch/CrossOriginAccessControl.h" +#include "platform/loader/fetch/FetchRequest.h" +#include "platform/loader/fetch/FetchUtils.h" +#include "platform/loader/fetch/Resource.h" +#include "platform/loader/fetch/ResourceFetcher.h" #include "platform/network/ResourceRequest.h" #include "platform/weborigin/SchemeRegistry.h" #include "platform/weborigin/SecurityOrigin.h"
diff --git a/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.h b/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.h index b470111..7303b3e 100644 --- a/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.h +++ b/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.h
@@ -33,11 +33,11 @@ #define DocumentThreadableLoader_h #include "core/CoreExport.h" -#include "core/fetch/RawResource.h" -#include "core/fetch/ResourceOwner.h" #include "core/loader/ThreadableLoader.h" #include "platform/Timer.h" #include "platform/heap/Handle.h" +#include "platform/loader/fetch/RawResource.h" +#include "platform/loader/fetch/ResourceOwner.h" #include "platform/network/HTTPHeaderMap.h" #include "platform/network/ResourceError.h" #include "platform/weborigin/Referrer.h"
diff --git a/third_party/WebKit/Source/core/loader/FrameClientHintsPreferencesContext.h b/third_party/WebKit/Source/core/loader/FrameClientHintsPreferencesContext.h index 260842af..0961b85 100644 --- a/third_party/WebKit/Source/core/loader/FrameClientHintsPreferencesContext.h +++ b/third_party/WebKit/Source/core/loader/FrameClientHintsPreferencesContext.h
@@ -5,9 +5,9 @@ #ifndef FrameClientHintsPreferencesContext_h #define FrameClientHintsPreferencesContext_h -#include "core/fetch/ClientHintsPreferences.h" #include "core/frame/Frame.h" #include "platform/heap/Persistent.h" +#include "platform/loader/fetch/ClientHintsPreferences.h" #include "wtf/Allocator.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp index 575b46ae..379d3e4 100644 --- a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp +++ b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
@@ -33,11 +33,6 @@ #include "bindings/core/v8/ScriptController.h" #include "bindings/core/v8/V8DOMActivityLogger.h" #include "core/dom/Document.h" -#include "core/fetch/ClientHintsPreferences.h" -#include "core/fetch/FetchInitiatorTypeNames.h" -#include "core/fetch/Resource.h" -#include "core/fetch/ResourceLoadingLog.h" -#include "core/fetch/UniqueIdentifier.h" #include "core/frame/FrameConsole.h" #include "core/frame/FrameHost.h" #include "core/frame/FrameView.h" @@ -69,6 +64,11 @@ #include "core/timing/Performance.h" #include "platform/WebFrameScheduler.h" #include "platform/instrumentation/tracing/TracedValue.h" +#include "platform/loader/fetch/ClientHintsPreferences.h" +#include "platform/loader/fetch/FetchInitiatorTypeNames.h" +#include "platform/loader/fetch/Resource.h" +#include "platform/loader/fetch/ResourceLoadingLog.h" +#include "platform/loader/fetch/UniqueIdentifier.h" #include "platform/mhtml/MHTMLArchive.h" #include "platform/network/NetworkUtils.h" #include "platform/network/ResourceLoadPriority.h"
diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContext.h b/third_party/WebKit/Source/core/loader/FrameFetchContext.h index 92c9b49..b3fbffb8 100644 --- a/third_party/WebKit/Source/core/loader/FrameFetchContext.h +++ b/third_party/WebKit/Source/core/loader/FrameFetchContext.h
@@ -32,12 +32,12 @@ #define FrameFetchContext_h #include "core/CoreExport.h" -#include "core/fetch/FetchContext.h" -#include "core/fetch/FetchRequest.h" -#include "core/fetch/ResourceFetcher.h" #include "core/frame/csp/ContentSecurityPolicy.h" #include "core/loader/LinkLoader.h" #include "platform/heap/Handle.h" +#include "platform/loader/fetch/FetchContext.h" +#include "platform/loader/fetch/FetchRequest.h" +#include "platform/loader/fetch/ResourceFetcher.h" #include "platform/network/ResourceRequest.h" #include "wtf/Forward.h"
diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp b/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp index 1299926..5fb9dca5 100644 --- a/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp +++ b/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp
@@ -31,9 +31,6 @@ #include "core/loader/FrameFetchContext.h" #include "core/dom/Document.h" -#include "core/fetch/FetchInitiatorInfo.h" -#include "core/fetch/MockResource.h" -#include "core/fetch/UniqueIdentifier.h" #include "core/frame/FrameHost.h" #include "core/frame/FrameOwner.h" #include "core/frame/FrameTypes.h" @@ -44,6 +41,9 @@ #include "core/loader/EmptyClients.h" #include "core/page/Page.h" #include "core/testing/DummyPageHolder.h" +#include "platform/loader/fetch/FetchInitiatorInfo.h" +#include "platform/loader/fetch/MockResource.h" +#include "platform/loader/fetch/UniqueIdentifier.h" #include "platform/network/ResourceRequest.h" #include "platform/weborigin/KURL.h" #include "public/platform/WebAddressSpace.h"
diff --git a/third_party/WebKit/Source/core/loader/FrameLoadRequest.h b/third_party/WebKit/Source/core/loader/FrameLoadRequest.h index db1246e..e13a3d0 100644 --- a/third_party/WebKit/Source/core/loader/FrameLoadRequest.h +++ b/third_party/WebKit/Source/core/loader/FrameLoadRequest.h
@@ -28,9 +28,9 @@ #include "core/dom/Document.h" #include "core/events/Event.h" -#include "core/fetch/ResourceLoaderOptions.h" -#include "core/fetch/SubstituteData.h" #include "core/loader/FrameLoaderTypes.h" +#include "platform/loader/fetch/ResourceLoaderOptions.h" +#include "platform/loader/fetch/SubstituteData.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/loader/FrameLoader.cpp b/third_party/WebKit/Source/core/loader/FrameLoader.cpp index 24b4a63d..3ecc0fc6 100644 --- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp +++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
@@ -49,7 +49,6 @@ #include "core/events/KeyboardEvent.h" #include "core/events/MouseEvent.h" #include "core/events/PageTransitionEvent.h" -#include "core/fetch/ResourceFetcher.h" #include "core/frame/FrameHost.h" #include "core/frame/FrameView.h" #include "core/frame/LocalDOMWindow.h" @@ -90,6 +89,7 @@ #include "platform/UserGestureIndicator.h" #include "platform/feature_policy/FeaturePolicy.h" #include "platform/instrumentation/tracing/TraceEvent.h" +#include "platform/loader/fetch/ResourceFetcher.h" #include "platform/network/HTTPParsers.h" #include "platform/network/ResourceRequest.h" #include "platform/scroll/ScrollAnimatorBase.h"
diff --git a/third_party/WebKit/Source/core/loader/FrameLoader.h b/third_party/WebKit/Source/core/loader/FrameLoader.h index be92d67..9c04c56 100644 --- a/third_party/WebKit/Source/core/loader/FrameLoader.h +++ b/third_party/WebKit/Source/core/loader/FrameLoader.h
@@ -37,7 +37,6 @@ #include "core/dom/IconURL.h" #include "core/dom/SandboxFlags.h" #include "core/dom/SecurityContext.h" -#include "core/fetch/ResourceLoaderOptions.h" #include "core/frame/FrameTypes.h" #include "core/loader/FrameLoaderStateMachine.h" #include "core/loader/FrameLoaderTypes.h" @@ -46,6 +45,7 @@ #include "platform/Timer.h" #include "platform/heap/Handle.h" #include "platform/instrumentation/tracing/TracedValue.h" +#include "platform/loader/fetch/ResourceLoaderOptions.h" #include "platform/network/ResourceRequest.h" #include "public/platform/WebInsecureRequestPolicy.h" #include "wtf/Forward.h"
diff --git a/third_party/WebKit/Source/core/loader/FrameLoaderClient.h b/third_party/WebKit/Source/core/loader/FrameLoaderClient.h index c3b0201..11a310e 100644 --- a/third_party/WebKit/Source/core/loader/FrameLoaderClient.h +++ b/third_party/WebKit/Source/core/loader/FrameLoaderClient.h
@@ -34,7 +34,6 @@ #include "core/CoreExport.h" #include "core/dom/Document.h" #include "core/dom/IconURL.h" -#include "core/fetch/ResourceLoaderOptions.h" #include "core/frame/FrameClient.h" #include "core/frame/FrameTypes.h" #include "core/html/LinkResource.h" @@ -42,6 +41,7 @@ #include "core/loader/FrameLoaderTypes.h" #include "core/loader/NavigationPolicy.h" #include "platform/heap/Handle.h" +#include "platform/loader/fetch/ResourceLoaderOptions.h" #include "platform/network/ContentSecurityPolicyParsers.h" #include "platform/network/ResourceLoadPriority.h" #include "platform/weborigin/Referrer.h"
diff --git a/third_party/WebKit/Source/core/loader/HttpEquiv.cpp b/third_party/WebKit/Source/core/loader/HttpEquiv.cpp index ba7b7e1..ec4fdffa 100644 --- a/third_party/WebKit/Source/core/loader/HttpEquiv.cpp +++ b/third_party/WebKit/Source/core/loader/HttpEquiv.cpp
@@ -7,7 +7,6 @@ #include "core/dom/Document.h" #include "core/dom/ScriptableDocumentParser.h" #include "core/dom/StyleEngine.h" -#include "core/fetch/ClientHintsPreferences.h" #include "core/frame/LocalFrame.h" #include "core/frame/UseCounter.h" #include "core/frame/csp/ContentSecurityPolicy.h" @@ -16,6 +15,7 @@ #include "core/loader/FrameClientHintsPreferencesContext.h" #include "core/origin_trials/OriginTrialContext.h" #include "platform/HTTPNames.h" +#include "platform/loader/fetch/ClientHintsPreferences.h" #include "platform/network/HTTPParsers.h" #include "platform/weborigin/KURL.h"
diff --git a/third_party/WebKit/Source/core/loader/ImageLoader.cpp b/third_party/WebKit/Source/core/loader/ImageLoader.cpp index 3dd9552..a48a04c6 100644 --- a/third_party/WebKit/Source/core/loader/ImageLoader.cpp +++ b/third_party/WebKit/Source/core/loader/ImageLoader.cpp
@@ -32,10 +32,6 @@ #include "core/dom/IncrementLoadEventDelayCount.h" #include "core/events/Event.h" #include "core/events/EventSender.h" -#include "core/fetch/FetchRequest.h" -#include "core/fetch/MemoryCache.h" -#include "core/fetch/ResourceFetcher.h" -#include "core/fetch/ResourceLoadingLog.h" #include "core/frame/LocalFrame.h" #include "core/frame/Settings.h" #include "core/frame/UseCounter.h" @@ -47,6 +43,10 @@ #include "core/layout/LayoutVideo.h" #include "core/layout/svg/LayoutSVGImage.h" #include "core/svg/graphics/SVGImage.h" +#include "platform/loader/fetch/FetchRequest.h" +#include "platform/loader/fetch/MemoryCache.h" +#include "platform/loader/fetch/ResourceFetcher.h" +#include "platform/loader/fetch/ResourceLoadingLog.h" #include "platform/weborigin/SecurityOrigin.h" #include "platform/weborigin/SecurityPolicy.h" #include "public/platform/WebCachePolicy.h"
diff --git a/third_party/WebKit/Source/core/loader/LinkLoader.cpp b/third_party/WebKit/Source/core/loader/LinkLoader.cpp index 63d977c..599b82c 100644 --- a/third_party/WebKit/Source/core/loader/LinkLoader.cpp +++ b/third_party/WebKit/Source/core/loader/LinkLoader.cpp
@@ -34,9 +34,6 @@ #include "core/css/MediaList.h" #include "core/css/MediaQueryEvaluator.h" #include "core/dom/Document.h" -#include "core/fetch/FetchInitiatorTypeNames.h" -#include "core/fetch/FetchRequest.h" -#include "core/fetch/ResourceFetcher.h" #include "core/frame/Settings.h" #include "core/frame/UseCounter.h" #include "core/html/CrossOriginAttribute.h" @@ -49,6 +46,9 @@ #include "core/loader/resource/LinkFetchResource.h" #include "platform/Prerender.h" #include "platform/RuntimeEnabledFeatures.h" +#include "platform/loader/fetch/FetchInitiatorTypeNames.h" +#include "platform/loader/fetch/FetchRequest.h" +#include "platform/loader/fetch/ResourceFetcher.h" #include "platform/network/LinkHeader.h" #include "platform/network/NetworkHints.h" #include "platform/network/mime/MIMETypeRegistry.h"
diff --git a/third_party/WebKit/Source/core/loader/LinkLoader.h b/third_party/WebKit/Source/core/loader/LinkLoader.h index f850ef0d..a81392b 100644 --- a/third_party/WebKit/Source/core/loader/LinkLoader.h +++ b/third_party/WebKit/Source/core/loader/LinkLoader.h
@@ -33,14 +33,14 @@ #define LinkLoader_h #include "core/CoreExport.h" -#include "core/fetch/ResourceClient.h" -#include "core/fetch/ResourceOwner.h" #include "core/loader/LinkLoaderClient.h" #include "core/loader/resource/LinkPreloadResourceClients.h" #include "platform/CrossOriginAttributeValue.h" #include "platform/PrerenderClient.h" #include "platform/Timer.h" #include "platform/heap/Handle.h" +#include "platform/loader/fetch/ResourceClient.h" +#include "platform/loader/fetch/ResourceOwner.h" #include "wtf/Optional.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/loader/LinkLoaderClient.h b/third_party/WebKit/Source/core/loader/LinkLoaderClient.h index 8df5774..59bff711 100644 --- a/third_party/WebKit/Source/core/loader/LinkLoaderClient.h +++ b/third_party/WebKit/Source/core/loader/LinkLoaderClient.h
@@ -34,6 +34,9 @@ #include "core/CoreExport.h" #include "platform/WebTaskRunner.h" +#include "platform/heap/GarbageCollected.h" +#include "platform/heap/InlinedGlobalMarkingVisitor.h" + namespace blink { class CORE_EXPORT LinkLoaderClient : public GarbageCollectedMixin {
diff --git a/third_party/WebKit/Source/core/loader/LinkLoaderTest.cpp b/third_party/WebKit/Source/core/loader/LinkLoaderTest.cpp index 6022ebb..0cc24247 100644 --- a/third_party/WebKit/Source/core/loader/LinkLoaderTest.cpp +++ b/third_party/WebKit/Source/core/loader/LinkLoaderTest.cpp
@@ -4,14 +4,14 @@ #include "core/loader/LinkLoader.h" -#include "core/fetch/MemoryCache.h" -#include "core/fetch/ResourceFetcher.h" #include "core/frame/Settings.h" #include "core/html/LinkRelAttribute.h" #include "core/loader/DocumentLoader.h" #include "core/loader/LinkLoaderClient.h" #include "core/loader/NetworkHintsInterface.h" #include "core/testing/DummyPageHolder.h" +#include "platform/loader/fetch/MemoryCache.h" +#include "platform/loader/fetch/ResourceFetcher.h" #include "platform/network/ResourceLoadPriority.h" #include "platform/testing/URLTestHelpers.h" #include "public/platform/Platform.h"
diff --git a/third_party/WebKit/Source/core/loader/NavigationScheduler.cpp b/third_party/WebKit/Source/core/loader/NavigationScheduler.cpp index a3774fe..ce336c4ac 100644 --- a/third_party/WebKit/Source/core/loader/NavigationScheduler.cpp +++ b/third_party/WebKit/Source/core/loader/NavigationScheduler.cpp
@@ -34,7 +34,6 @@ #include "bindings/core/v8/ScriptController.h" #include "core/events/Event.h" -#include "core/fetch/ResourceLoaderOptions.h" #include "core/frame/Deprecation.h" #include "core/frame/LocalFrame.h" #include "core/frame/csp/ContentSecurityPolicy.h" @@ -51,6 +50,7 @@ #include "platform/Histogram.h" #include "platform/SharedBuffer.h" #include "platform/UserGestureIndicator.h" +#include "platform/loader/fetch/ResourceLoaderOptions.h" #include "public/platform/Platform.h" #include "public/platform/WebCachePolicy.h" #include "public/platform/WebScheduler.h"
diff --git a/third_party/WebKit/Source/core/loader/PingLoader.cpp b/third_party/WebKit/Source/core/loader/PingLoader.cpp index 180ef4b..78c6280 100644 --- a/third_party/WebKit/Source/core/loader/PingLoader.cpp +++ b/third_party/WebKit/Source/core/loader/PingLoader.cpp
@@ -35,12 +35,6 @@ #include "core/dom/DOMArrayBufferView.h" #include "core/dom/Document.h" #include "core/dom/SecurityContext.h" -#include "core/fetch/CrossOriginAccessControl.h" -#include "core/fetch/FetchContext.h" -#include "core/fetch/FetchInitiatorTypeNames.h" -#include "core/fetch/FetchUtils.h" -#include "core/fetch/ResourceFetcher.h" -#include "core/fetch/UniqueIdentifier.h" #include "core/fileapi/File.h" #include "core/frame/FrameConsole.h" #include "core/frame/LocalFrame.h" @@ -56,6 +50,12 @@ #include "platform/WebFrameScheduler.h" #include "platform/exported/WrappedResourceRequest.h" #include "platform/exported/WrappedResourceResponse.h" +#include "platform/loader/fetch/CrossOriginAccessControl.h" +#include "platform/loader/fetch/FetchContext.h" +#include "platform/loader/fetch/FetchInitiatorTypeNames.h" +#include "platform/loader/fetch/FetchUtils.h" +#include "platform/loader/fetch/ResourceFetcher.h" +#include "platform/loader/fetch/UniqueIdentifier.h" #include "platform/network/EncodedFormData.h" #include "platform/network/ParsedContentType.h" #include "platform/network/ResourceError.h"
diff --git a/third_party/WebKit/Source/core/loader/PingLoader.h b/third_party/WebKit/Source/core/loader/PingLoader.h index 8b8dd8e..c2105a1 100644 --- a/third_party/WebKit/Source/core/loader/PingLoader.h +++ b/third_party/WebKit/Source/core/loader/PingLoader.h
@@ -33,10 +33,10 @@ #define PingLoader_h #include "core/CoreExport.h" -#include "core/fetch/ResourceLoaderOptions.h" #include "platform/Timer.h" #include "platform/heap/Handle.h" #include "platform/heap/SelfKeepAlive.h" +#include "platform/loader/fetch/ResourceLoaderOptions.h" #include "public/platform/WebURLLoaderClient.h" #include "wtf/Forward.h" #include "wtf/Noncopyable.h"
diff --git a/third_party/WebKit/Source/core/loader/PingLoaderTest.cpp b/third_party/WebKit/Source/core/loader/PingLoaderTest.cpp index 8fb18017..e5b9541 100644 --- a/third_party/WebKit/Source/core/loader/PingLoaderTest.cpp +++ b/third_party/WebKit/Source/core/loader/PingLoaderTest.cpp
@@ -4,11 +4,11 @@ #include "core/loader/PingLoader.h" -#include "core/fetch/SubstituteData.h" #include "core/frame/LocalFrame.h" #include "core/loader/EmptyClients.h" #include "core/loader/FrameLoader.h" #include "core/testing/DummyPageHolder.h" +#include "platform/loader/fetch/SubstituteData.h" #include "platform/testing/URLTestHelpers.h" #include "platform/testing/UnitTestHelpers.h" #include "platform/weborigin/KURL.h"
diff --git a/third_party/WebKit/Source/core/loader/ProgressTracker.cpp b/third_party/WebKit/Source/core/loader/ProgressTracker.cpp index e94adab3..fce737a 100644 --- a/third_party/WebKit/Source/core/loader/ProgressTracker.cpp +++ b/third_party/WebKit/Source/core/loader/ProgressTracker.cpp
@@ -25,8 +25,6 @@ #include "core/loader/ProgressTracker.h" -#include "core/fetch/Resource.h" -#include "core/fetch/ResourceFetcher.h" #include "core/frame/FrameView.h" #include "core/frame/LocalFrame.h" #include "core/frame/Settings.h" @@ -34,6 +32,8 @@ #include "core/loader/DocumentLoader.h" #include "core/loader/FrameLoader.h" #include "core/loader/FrameLoaderClient.h" +#include "platform/loader/fetch/Resource.h" +#include "platform/loader/fetch/ResourceFetcher.h" #include "platform/network/ResourceResponse.h" #include "wtf/CurrentTime.h" #include "wtf/PtrUtil.h"
diff --git a/third_party/WebKit/Source/core/loader/TextTrackLoader.cpp b/third_party/WebKit/Source/core/loader/TextTrackLoader.cpp index 4cb3399..b7b19d3 100644 --- a/third_party/WebKit/Source/core/loader/TextTrackLoader.cpp +++ b/third_party/WebKit/Source/core/loader/TextTrackLoader.cpp
@@ -27,12 +27,12 @@ #include "core/dom/Document.h" #include "core/dom/TaskRunnerHelper.h" -#include "core/fetch/FetchInitiatorTypeNames.h" -#include "core/fetch/FetchRequest.h" -#include "core/fetch/RawResource.h" -#include "core/fetch/ResourceFetcher.h" #include "core/inspector/ConsoleMessage.h" #include "platform/SharedBuffer.h" +#include "platform/loader/fetch/FetchInitiatorTypeNames.h" +#include "platform/loader/fetch/FetchRequest.h" +#include "platform/loader/fetch/RawResource.h" +#include "platform/loader/fetch/ResourceFetcher.h" #include "platform/weborigin/SecurityOrigin.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/loader/TextTrackLoader.h b/third_party/WebKit/Source/core/loader/TextTrackLoader.h index 1dc3ff3..3ce869eb 100644 --- a/third_party/WebKit/Source/core/loader/TextTrackLoader.h +++ b/third_party/WebKit/Source/core/loader/TextTrackLoader.h
@@ -26,11 +26,11 @@ #ifndef TextTrackLoader_h #define TextTrackLoader_h -#include "core/fetch/RawResource.h" -#include "core/fetch/ResourceOwner.h" #include "core/html/track/vtt/VTTParser.h" #include "platform/CrossOriginAttributeValue.h" #include "platform/heap/Handle.h" +#include "platform/loader/fetch/RawResource.h" +#include "platform/loader/fetch/ResourceOwner.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/loader/ThreadableLoader.h b/third_party/WebKit/Source/core/loader/ThreadableLoader.h index 9e8c56c..0bf63f0 100644 --- a/third_party/WebKit/Source/core/loader/ThreadableLoader.h +++ b/third_party/WebKit/Source/core/loader/ThreadableLoader.h
@@ -32,9 +32,9 @@ #define ThreadableLoader_h #include "core/CoreExport.h" -#include "core/fetch/ResourceLoaderOptions.h" #include "platform/CrossThreadCopier.h" #include "platform/heap/Handle.h" +#include "platform/loader/fetch/ResourceLoaderOptions.h" #include "wtf/Allocator.h" #include "wtf/Noncopyable.h" #include <memory>
diff --git a/third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp b/third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp index c3a6a22a..11c1b1d8 100644 --- a/third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp +++ b/third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp
@@ -5,8 +5,6 @@ #include "core/loader/ThreadableLoader.h" #include "core/dom/ExecutionContextTask.h" -#include "core/fetch/MemoryCache.h" -#include "core/fetch/ResourceLoaderOptions.h" #include "core/loader/DocumentThreadableLoader.h" #include "core/loader/ThreadableLoaderClient.h" #include "core/loader/WorkerThreadableLoader.h" @@ -15,6 +13,8 @@ #include "core/workers/WorkerThreadTestHelper.h" #include "platform/WaitableEvent.h" #include "platform/geometry/IntSize.h" +#include "platform/loader/fetch/MemoryCache.h" +#include "platform/loader/fetch/ResourceLoaderOptions.h" #include "platform/network/ResourceError.h" #include "platform/network/ResourceRequest.h" #include "platform/network/ResourceResponse.h"
diff --git a/third_party/WebKit/Source/core/loader/resource/CSSStyleSheetResource.cpp b/third_party/WebKit/Source/core/loader/resource/CSSStyleSheetResource.cpp index fe50b210..d40e5f1 100644 --- a/third_party/WebKit/Source/core/loader/resource/CSSStyleSheetResource.cpp +++ b/third_party/WebKit/Source/core/loader/resource/CSSStyleSheetResource.cpp
@@ -27,12 +27,12 @@ #include "core/loader/resource/CSSStyleSheetResource.h" #include "core/css/StyleSheetContents.h" -#include "core/fetch/FetchRequest.h" -#include "core/fetch/MemoryCache.h" -#include "core/fetch/ResourceClientWalker.h" -#include "core/fetch/ResourceFetcher.h" #include "core/loader/resource/StyleSheetResourceClient.h" #include "platform/SharedBuffer.h" +#include "platform/loader/fetch/FetchRequest.h" +#include "platform/loader/fetch/MemoryCache.h" +#include "platform/loader/fetch/ResourceClientWalker.h" +#include "platform/loader/fetch/ResourceFetcher.h" #include "wtf/CurrentTime.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/loader/resource/CSSStyleSheetResourceTest.cpp b/third_party/WebKit/Source/core/loader/resource/CSSStyleSheetResourceTest.cpp index 571a8579..d53773f 100644 --- a/third_party/WebKit/Source/core/loader/resource/CSSStyleSheetResourceTest.cpp +++ b/third_party/WebKit/Source/core/loader/resource/CSSStyleSheetResourceTest.cpp
@@ -16,15 +16,15 @@ #include "core/css/parser/CSSParserContext.h" #include "core/css/parser/CSSParserSelector.h" #include "core/dom/Document.h" -#include "core/fetch/FetchContext.h" -#include "core/fetch/FetchInitiatorTypeNames.h" -#include "core/fetch/FetchRequest.h" -#include "core/fetch/MemoryCache.h" -#include "core/fetch/ResourceFetcher.h" #include "core/loader/resource/ImageResource.h" #include "core/testing/DummyPageHolder.h" #include "platform/heap/Handle.h" #include "platform/heap/Heap.h" +#include "platform/loader/fetch/FetchContext.h" +#include "platform/loader/fetch/FetchInitiatorTypeNames.h" +#include "platform/loader/fetch/FetchRequest.h" +#include "platform/loader/fetch/MemoryCache.h" +#include "platform/loader/fetch/ResourceFetcher.h" #include "platform/network/ResourceRequest.h" #include "platform/testing/URLTestHelpers.h" #include "platform/testing/UnitTestHelpers.h"
diff --git a/third_party/WebKit/Source/core/loader/resource/DocumentResource.cpp b/third_party/WebKit/Source/core/loader/resource/DocumentResource.cpp index bcc6970..3ab496f 100644 --- a/third_party/WebKit/Source/core/loader/resource/DocumentResource.cpp +++ b/third_party/WebKit/Source/core/loader/resource/DocumentResource.cpp
@@ -23,9 +23,9 @@ #include "core/loader/resource/DocumentResource.h" #include "core/dom/XMLDocument.h" -#include "core/fetch/FetchRequest.h" -#include "core/fetch/ResourceFetcher.h" #include "platform/SharedBuffer.h" +#include "platform/loader/fetch/FetchRequest.h" +#include "platform/loader/fetch/ResourceFetcher.h" #include "wtf/text/StringBuilder.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/loader/resource/DocumentResource.h b/third_party/WebKit/Source/core/loader/resource/DocumentResource.h index 5019a12..adc45650 100644 --- a/third_party/WebKit/Source/core/loader/resource/DocumentResource.h +++ b/third_party/WebKit/Source/core/loader/resource/DocumentResource.h
@@ -23,11 +23,11 @@ #ifndef DocumentResource_h #define DocumentResource_h -#include "core/fetch/Resource.h" -#include "core/fetch/ResourceClient.h" #include "core/html/parser/TextResourceDecoder.h" #include "core/loader/resource/TextResource.h" #include "platform/heap/Handle.h" +#include "platform/loader/fetch/Resource.h" +#include "platform/loader/fetch/ResourceClient.h" #include <memory> namespace blink {
diff --git a/third_party/WebKit/Source/core/loader/resource/FontResource.cpp b/third_party/WebKit/Source/core/loader/resource/FontResource.cpp index 8a32534..c8d8995 100644 --- a/third_party/WebKit/Source/core/loader/resource/FontResource.cpp +++ b/third_party/WebKit/Source/core/loader/resource/FontResource.cpp
@@ -26,14 +26,14 @@ #include "core/loader/resource/FontResource.h" -#include "core/fetch/FetchRequest.h" -#include "core/fetch/ResourceClientWalker.h" -#include "core/fetch/ResourceFetcher.h" -#include "core/fetch/ResourceLoader.h" #include "platform/Histogram.h" #include "platform/SharedBuffer.h" #include "platform/fonts/FontCustomPlatformData.h" #include "platform/fonts/FontPlatformData.h" +#include "platform/loader/fetch/FetchRequest.h" +#include "platform/loader/fetch/ResourceClientWalker.h" +#include "platform/loader/fetch/ResourceFetcher.h" +#include "platform/loader/fetch/ResourceLoader.h" #include "wtf/CurrentTime.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/loader/resource/FontResource.h b/third_party/WebKit/Source/core/loader/resource/FontResource.h index e7cfae3..cbe83d7 100644 --- a/third_party/WebKit/Source/core/loader/resource/FontResource.h +++ b/third_party/WebKit/Source/core/loader/resource/FontResource.h
@@ -28,11 +28,11 @@ #include "base/gtest_prod_util.h" #include "core/CoreExport.h" -#include "core/fetch/Resource.h" -#include "core/fetch/ResourceClient.h" #include "platform/Timer.h" #include "platform/fonts/FontOrientation.h" #include "platform/heap/Handle.h" +#include "platform/loader/fetch/Resource.h" +#include "platform/loader/fetch/ResourceClient.h" #include <memory> namespace blink {
diff --git a/third_party/WebKit/Source/core/loader/resource/FontResourceTest.cpp b/third_party/WebKit/Source/core/loader/resource/FontResourceTest.cpp index 988beed..dc3629c3 100644 --- a/third_party/WebKit/Source/core/loader/resource/FontResourceTest.cpp +++ b/third_party/WebKit/Source/core/loader/resource/FontResourceTest.cpp
@@ -4,15 +4,15 @@ #include "core/loader/resource/FontResource.h" -#include "core/fetch/FetchInitiatorInfo.h" -#include "core/fetch/FetchRequest.h" -#include "core/fetch/MemoryCache.h" -#include "core/fetch/MockFetchContext.h" -#include "core/fetch/MockResourceClient.h" -#include "core/fetch/ResourceFetcher.h" -#include "core/fetch/ResourceLoader.h" #include "core/loader/resource/MockFontResourceClient.h" #include "platform/exported/WrappedResourceResponse.h" +#include "platform/loader/fetch/FetchInitiatorInfo.h" +#include "platform/loader/fetch/FetchRequest.h" +#include "platform/loader/fetch/MemoryCache.h" +#include "platform/loader/fetch/MockFetchContext.h" +#include "platform/loader/fetch/MockResourceClient.h" +#include "platform/loader/fetch/ResourceFetcher.h" +#include "platform/loader/fetch/ResourceLoader.h" #include "platform/network/ResourceError.h" #include "platform/network/ResourceRequest.h" #include "platform/network/ResourceResponse.h"
diff --git a/third_party/WebKit/Source/core/loader/resource/ImageResource.cpp b/third_party/WebKit/Source/core/loader/resource/ImageResource.cpp index f0ede4e..dda3a38 100644 --- a/third_party/WebKit/Source/core/loader/resource/ImageResource.cpp +++ b/third_party/WebKit/Source/core/loader/resource/ImageResource.cpp
@@ -23,17 +23,17 @@ #include "core/loader/resource/ImageResource.h" -#include "core/fetch/MemoryCache.h" -#include "core/fetch/ResourceClient.h" -#include "core/fetch/ResourceFetcher.h" -#include "core/fetch/ResourceLoader.h" -#include "core/fetch/ResourceLoadingLog.h" #include "core/loader/resource/ImageResourceContent.h" #include "core/loader/resource/ImageResourceInfo.h" #include "platform/Histogram.h" #include "platform/RuntimeEnabledFeatures.h" #include "platform/SharedBuffer.h" #include "platform/instrumentation/tracing/TraceEvent.h" +#include "platform/loader/fetch/MemoryCache.h" +#include "platform/loader/fetch/ResourceClient.h" +#include "platform/loader/fetch/ResourceFetcher.h" +#include "platform/loader/fetch/ResourceLoader.h" +#include "platform/loader/fetch/ResourceLoadingLog.h" #include "public/platform/Platform.h" #include "wtf/CurrentTime.h" #include "wtf/StdLibExtras.h"
diff --git a/third_party/WebKit/Source/core/loader/resource/ImageResource.h b/third_party/WebKit/Source/core/loader/resource/ImageResource.h index c479c2d..accceb9 100644 --- a/third_party/WebKit/Source/core/loader/resource/ImageResource.h +++ b/third_party/WebKit/Source/core/loader/resource/ImageResource.h
@@ -24,12 +24,12 @@ #define ImageResource_h #include "core/CoreExport.h" -#include "core/fetch/Resource.h" #include "core/loader/resource/ImageResourceContent.h" #include "core/loader/resource/ImageResourceInfo.h" #include "core/loader/resource/MultipartImageResourceParser.h" #include "platform/Timer.h" #include "platform/heap/Handle.h" +#include "platform/loader/fetch/Resource.h" #include <memory> namespace blink {
diff --git a/third_party/WebKit/Source/core/loader/resource/ImageResourceContent.h b/third_party/WebKit/Source/core/loader/resource/ImageResourceContent.h index 6532031d..af9c6fe 100644 --- a/third_party/WebKit/Source/core/loader/resource/ImageResourceContent.h +++ b/third_party/WebKit/Source/core/loader/resource/ImageResourceContent.h
@@ -6,13 +6,13 @@ #define ImageResourceContent_h #include "core/CoreExport.h" -#include "core/fetch/ResourceStatus.h" #include "platform/geometry/IntRect.h" #include "platform/geometry/IntSizeHash.h" #include "platform/geometry/LayoutSize.h" #include "platform/graphics/Image.h" #include "platform/graphics/ImageObserver.h" #include "platform/graphics/ImageOrientation.h" +#include "platform/loader/fetch/ResourceStatus.h" #include "platform/network/ResourceLoadPriority.h" #include "platform/weborigin/KURL.h" #include "wtf/HashCountedSet.h"
diff --git a/third_party/WebKit/Source/core/loader/resource/ImageResourceInfo.h b/third_party/WebKit/Source/core/loader/resource/ImageResourceInfo.h index 70f787b..fa2c4252 100644 --- a/third_party/WebKit/Source/core/loader/resource/ImageResourceInfo.h +++ b/third_party/WebKit/Source/core/loader/resource/ImageResourceInfo.h
@@ -6,9 +6,9 @@ #define ImageResourceInfo_h #include "core/CoreExport.h" -#include "core/fetch/ResourceStatus.h" #include "platform/heap/Handle.h" #include "platform/heap/Heap.h" +#include "platform/loader/fetch/ResourceStatus.h" #include "platform/weborigin/KURL.h" #include "wtf/Forward.h"
diff --git a/third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp b/third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp index 32ff4d3..0eb3a24 100644 --- a/third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp +++ b/third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp
@@ -30,18 +30,19 @@ #include "core/loader/resource/ImageResource.h" -#include "core/fetch/FetchInitiatorInfo.h" -#include "core/fetch/FetchRequest.h" -#include "core/fetch/MemoryCache.h" -#include "core/fetch/MockResourceClient.h" -#include "core/fetch/ResourceFetcher.h" -#include "core/fetch/ResourceLoader.h" -#include "core/fetch/UniqueIdentifier.h" +#include "core/loader/resource/MockImageResourceClient.h" #include "core/loader/resource/MockImageResourceObserver.h" #include "platform/SharedBuffer.h" #include "platform/exported/WrappedResourceResponse.h" #include "platform/graphics/BitmapImage.h" #include "platform/graphics/Image.h" +#include "platform/loader/fetch/FetchInitiatorInfo.h" +#include "platform/loader/fetch/FetchRequest.h" +#include "platform/loader/fetch/MemoryCache.h" +#include "platform/loader/fetch/MockResourceClient.h" +#include "platform/loader/fetch/ResourceFetcher.h" +#include "platform/loader/fetch/ResourceLoader.h" +#include "platform/loader/fetch/UniqueIdentifier.h" #include "platform/scheduler/test/fake_web_task_runner.h" #include "platform/testing/TestingPlatformSupport.h" #include "platform/testing/URLTestHelpers.h"
diff --git a/third_party/WebKit/Source/core/loader/resource/LinkFetchResource.cpp b/third_party/WebKit/Source/core/loader/resource/LinkFetchResource.cpp index c32391e..71518b8 100644 --- a/third_party/WebKit/Source/core/loader/resource/LinkFetchResource.cpp +++ b/third_party/WebKit/Source/core/loader/resource/LinkFetchResource.cpp
@@ -4,8 +4,8 @@ #include "core/loader/resource/LinkFetchResource.h" -#include "core/fetch/FetchRequest.h" -#include "core/fetch/ResourceFetcher.h" +#include "platform/loader/fetch/FetchRequest.h" +#include "platform/loader/fetch/ResourceFetcher.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/loader/resource/LinkFetchResource.h b/third_party/WebKit/Source/core/loader/resource/LinkFetchResource.h index 3ebf3f48..fadcc4c7 100644 --- a/third_party/WebKit/Source/core/loader/resource/LinkFetchResource.h +++ b/third_party/WebKit/Source/core/loader/resource/LinkFetchResource.h
@@ -5,8 +5,8 @@ #ifndef LinkFetchResource_h #define LinkFetchResource_h -#include "core/fetch/Resource.h" -#include "core/fetch/ResourceClient.h" +#include "platform/loader/fetch/Resource.h" +#include "platform/loader/fetch/ResourceClient.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/loader/resource/LinkPreloadResourceClients.h b/third_party/WebKit/Source/core/loader/resource/LinkPreloadResourceClients.h index 241d185..98fad7c 100644 --- a/third_party/WebKit/Source/core/loader/resource/LinkPreloadResourceClients.h +++ b/third_party/WebKit/Source/core/loader/resource/LinkPreloadResourceClients.h
@@ -5,13 +5,13 @@ #ifndef LinkPreloadResourceClients_h #define LinkPreloadResourceClients_h -#include "core/fetch/RawResource.h" -#include "core/fetch/ResourceOwner.h" #include "core/loader/resource/CSSStyleSheetResource.h" #include "core/loader/resource/FontResource.h" #include "core/loader/resource/ImageResource.h" #include "core/loader/resource/ScriptResource.h" #include "core/loader/resource/StyleSheetResourceClient.h" +#include "platform/loader/fetch/RawResource.h" +#include "platform/loader/fetch/ResourceOwner.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/loader/resource/MockFontResourceClient.h b/third_party/WebKit/Source/core/loader/resource/MockFontResourceClient.h index 948c980..fad5aa0d 100644 --- a/third_party/WebKit/Source/core/loader/resource/MockFontResourceClient.h +++ b/third_party/WebKit/Source/core/loader/resource/MockFontResourceClient.h
@@ -5,10 +5,10 @@ #ifndef MockFontResourceClient_h #define MockFontResourceClient_h -#include "core/fetch/Resource.h" -#include "core/fetch/ResourceClient.h" #include "core/loader/resource/FontResource.h" #include "platform/heap/Handle.h" +#include "platform/loader/fetch/Resource.h" +#include "platform/loader/fetch/ResourceClient.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/loader/resource/MockImageResourceClient.h b/third_party/WebKit/Source/core/loader/resource/MockImageResourceClient.h new file mode 100644 index 0000000..ecbc9130 --- /dev/null +++ b/third_party/WebKit/Source/core/loader/resource/MockImageResourceClient.h
@@ -0,0 +1,50 @@ +// 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 MockImageResourceClient_h +#define MockImageResourceClient_h + +#include "core/loader/resource/ImageResource.h" +#include "core/loader/resource/ImageResourceContent.h" +#include "core/loader/resource/ImageResourceObserver.h" +#include "platform/loader/fetch/MockResourceClient.h" + +namespace blink { + +class MockImageResourceClient final : public MockResourceClient, + public ImageResourceObserver { + public: + explicit MockImageResourceClient(ImageResource*); + ~MockImageResourceClient() override; + + void imageNotifyFinished(ImageResourceContent*) override; + void imageChanged(ImageResourceContent*, const IntRect*) override; + + String debugName() const override { return "MockImageResourceClient"; } + + bool notifyFinishedCalled() const override; + + void removeAsClient() override; + void dispose() override; + + int imageChangedCount() const { return m_imageChangedCount; } + int imageNotifyFinishedCount() const { return m_imageNotifyFinishedCount; } + + size_t encodedSizeOnLastImageChanged() const { + return m_encodedSizeOnLastImageChanged; + } + size_t encodedSizeOnImageNotifyFinished() const { + return m_encodedSizeOnImageNotifyFinished; + } + + private: + int m_imageChangedCount; + size_t m_encodedSizeOnLastImageChanged; + int m_imageNotifyFinishedCount; + size_t m_encodedSizeOnImageNotifyFinished; +}; + +} // namespace blink + +#endif // MockImageResourceClient_h
diff --git a/third_party/WebKit/Source/core/loader/resource/ScriptResource.cpp b/third_party/WebKit/Source/core/loader/resource/ScriptResource.cpp index 57d5197..86d9f73 100644 --- a/third_party/WebKit/Source/core/loader/resource/ScriptResource.cpp +++ b/third_party/WebKit/Source/core/loader/resource/ScriptResource.cpp
@@ -26,13 +26,13 @@ #include "core/loader/resource/ScriptResource.h" -#include "core/fetch/FetchRequest.h" -#include "core/fetch/IntegrityMetadata.h" -#include "core/fetch/ResourceClientWalker.h" -#include "core/fetch/ResourceFetcher.h" #include "platform/SharedBuffer.h" #include "platform/instrumentation/tracing/web_memory_allocator_dump.h" #include "platform/instrumentation/tracing/web_process_memory_dump.h" +#include "platform/loader/fetch/FetchRequest.h" +#include "platform/loader/fetch/IntegrityMetadata.h" +#include "platform/loader/fetch/ResourceClientWalker.h" +#include "platform/loader/fetch/ResourceFetcher.h" #include "platform/network/mime/MIMETypeRegistry.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/loader/resource/ScriptResource.h b/third_party/WebKit/Source/core/loader/resource/ScriptResource.h index ebf3d3a6..d5b257bbf 100644 --- a/third_party/WebKit/Source/core/loader/resource/ScriptResource.h +++ b/third_party/WebKit/Source/core/loader/resource/ScriptResource.h
@@ -27,9 +27,9 @@ #define ScriptResource_h #include "core/CoreExport.h" -#include "core/fetch/IntegrityMetadata.h" -#include "core/fetch/ResourceClient.h" #include "core/loader/resource/TextResource.h" +#include "platform/loader/fetch/IntegrityMetadata.h" +#include "platform/loader/fetch/ResourceClient.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/loader/resource/StyleSheetResourceClient.h b/third_party/WebKit/Source/core/loader/resource/StyleSheetResourceClient.h index 083262a2..f4ead5c 100644 --- a/third_party/WebKit/Source/core/loader/resource/StyleSheetResourceClient.h +++ b/third_party/WebKit/Source/core/loader/resource/StyleSheetResourceClient.h
@@ -27,7 +27,7 @@ #define StyleSheetResourceClient_h #include "core/CoreExport.h" -#include "core/fetch/ResourceClient.h" +#include "platform/loader/fetch/ResourceClient.h" #include "platform/weborigin/KURL.h" #include "wtf/Forward.h"
diff --git a/third_party/WebKit/Source/core/loader/resource/TextResource.h b/third_party/WebKit/Source/core/loader/resource/TextResource.h index 8d0bd812..e81ae1a3 100644 --- a/third_party/WebKit/Source/core/loader/resource/TextResource.h +++ b/third_party/WebKit/Source/core/loader/resource/TextResource.h
@@ -6,7 +6,7 @@ #define TextResource_h #include "core/CoreExport.h" -#include "core/fetch/Resource.h" +#include "platform/loader/fetch/Resource.h" #include <memory> namespace blink {
diff --git a/third_party/WebKit/Source/core/loader/resource/XSLStyleSheetResource.cpp b/third_party/WebKit/Source/core/loader/resource/XSLStyleSheetResource.cpp index ef6efa4..ca116558 100644 --- a/third_party/WebKit/Source/core/loader/resource/XSLStyleSheetResource.cpp +++ b/third_party/WebKit/Source/core/loader/resource/XSLStyleSheetResource.cpp
@@ -26,12 +26,12 @@ #include "core/loader/resource/XSLStyleSheetResource.h" -#include "core/fetch/FetchRequest.h" -#include "core/fetch/ResourceClientWalker.h" -#include "core/fetch/ResourceFetcher.h" #include "core/loader/resource/StyleSheetResourceClient.h" #include "platform/RuntimeEnabledFeatures.h" #include "platform/SharedBuffer.h" +#include "platform/loader/fetch/FetchRequest.h" +#include "platform/loader/fetch/ResourceClientWalker.h" +#include "platform/loader/fetch/ResourceFetcher.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/page/DragController.cpp b/third_party/WebKit/Source/core/page/DragController.cpp index f2ddcca..90e76ca 100644 --- a/third_party/WebKit/Source/core/page/DragController.cpp +++ b/third_party/WebKit/Source/core/page/DragController.cpp
@@ -46,7 +46,6 @@ #include "core/editing/commands/DragAndDropCommand.h" #include "core/editing/serializers/Serialization.h" #include "core/events/TextEvent.h" -#include "core/fetch/ResourceFetcher.h" #include "core/frame/FrameHost.h" #include "core/frame/FrameView.h" #include "core/frame/LocalFrame.h" @@ -77,6 +76,7 @@ #include "platform/graphics/BitmapImage.h" #include "platform/graphics/Image.h" #include "platform/graphics/ImageOrientation.h" +#include "platform/loader/fetch/ResourceFetcher.h" #include "platform/network/ResourceRequest.h" #include "platform/weborigin/SecurityOrigin.h" #include "public/platform/WebCommon.h"
diff --git a/third_party/WebKit/Source/core/page/Page.cpp b/third_party/WebKit/Source/core/page/Page.cpp index a48697d..1cfac486 100644 --- a/third_party/WebKit/Source/core/page/Page.cpp +++ b/third_party/WebKit/Source/core/page/Page.cpp
@@ -30,7 +30,6 @@ #include "core/editing/DragCaretController.h" #include "core/editing/markers/DocumentMarkerController.h" #include "core/events/Event.h" -#include "core/fetch/ResourceFetcher.h" #include "core/frame/DOMTimer.h" #include "core/frame/FrameConsole.h" #include "core/frame/FrameHost.h" @@ -55,6 +54,7 @@ #include "core/paint/PaintLayer.h" #include "platform/WebFrameScheduler.h" #include "platform/graphics/GraphicsLayer.h" +#include "platform/loader/fetch/ResourceFetcher.h" #include "platform/plugins/PluginData.h" #include "public/platform/Platform.h"
diff --git a/third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetector.cpp b/third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetector.cpp index ef20ba40..5b52320 100644 --- a/third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetector.cpp +++ b/third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetector.cpp
@@ -6,9 +6,9 @@ #include "core/css/FontFaceSet.h" #include "core/dom/TaskRunnerHelper.h" -#include "core/fetch/ResourceFetcher.h" #include "core/paint/PaintTiming.h" #include "platform/instrumentation/tracing/TraceEvent.h" +#include "platform/loader/fetch/ResourceFetcher.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/paint/FramePainter.cpp b/third_party/WebKit/Source/core/paint/FramePainter.cpp index d05be3f..5a62f26 100644 --- a/third_party/WebKit/Source/core/paint/FramePainter.cpp +++ b/third_party/WebKit/Source/core/paint/FramePainter.cpp
@@ -5,7 +5,6 @@ #include "core/paint/FramePainter.h" #include "core/editing/markers/DocumentMarkerController.h" -#include "core/fetch/MemoryCache.h" #include "core/frame/FrameView.h" #include "core/inspector/InspectorInstrumentation.h" #include "core/inspector/InspectorTraceEvents.h" @@ -21,6 +20,7 @@ #include "platform/graphics/GraphicsContext.h" #include "platform/graphics/paint/ClipRecorder.h" #include "platform/graphics/paint/ScopedPaintChunkProperties.h" +#include "platform/loader/fetch/MemoryCache.h" #include "platform/scroll/ScrollbarTheme.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/svg/SVGElementProxy.cpp b/third_party/WebKit/Source/core/svg/SVGElementProxy.cpp index 2d75aef..92bcb51 100644 --- a/third_party/WebKit/Source/core/svg/SVGElementProxy.cpp +++ b/third_party/WebKit/Source/core/svg/SVGElementProxy.cpp
@@ -5,11 +5,11 @@ #include "core/svg/SVGElementProxy.h" #include "core/dom/IdTargetObserver.h" -#include "core/fetch/FetchInitiatorTypeNames.h" -#include "core/fetch/FetchRequest.h" -#include "core/fetch/ResourceFetcher.h" #include "core/svg/SVGElement.h" #include "core/svg/SVGResourceClient.h" +#include "platform/loader/fetch/FetchInitiatorTypeNames.h" +#include "platform/loader/fetch/FetchRequest.h" +#include "platform/loader/fetch/ResourceFetcher.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/svg/SVGFEImageElement.cpp b/third_party/WebKit/Source/core/svg/SVGFEImageElement.cpp index feec0f6..d0154e8 100644 --- a/third_party/WebKit/Source/core/svg/SVGFEImageElement.cpp +++ b/third_party/WebKit/Source/core/svg/SVGFEImageElement.cpp
@@ -22,12 +22,12 @@ #include "core/svg/SVGFEImageElement.h" #include "core/dom/Document.h" -#include "core/fetch/FetchRequest.h" -#include "core/fetch/ResourceFetcher.h" #include "core/svg/SVGPreserveAspectRatio.h" #include "core/svg/SVGTreeScopeResources.h" #include "core/svg/graphics/filters/SVGFEImage.h" #include "platform/graphics/Image.h" +#include "platform/loader/fetch/FetchRequest.h" +#include "platform/loader/fetch/ResourceFetcher.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/svg/SVGUseElement.cpp b/third_party/WebKit/Source/core/svg/SVGUseElement.cpp index df2b4d7..89e88c0 100644 --- a/third_party/WebKit/Source/core/svg/SVGUseElement.cpp +++ b/third_party/WebKit/Source/core/svg/SVGUseElement.cpp
@@ -35,8 +35,6 @@ #include "core/dom/shadow/ElementShadow.h" #include "core/dom/shadow/ShadowRoot.h" #include "core/events/Event.h" -#include "core/fetch/FetchRequest.h" -#include "core/fetch/ResourceFetcher.h" #include "core/layout/svg/LayoutSVGTransformableContainer.h" #include "core/svg/SVGGElement.h" #include "core/svg/SVGLengthContext.h" @@ -44,6 +42,8 @@ #include "core/svg/SVGSymbolElement.h" #include "core/svg/SVGTreeScopeResources.h" #include "core/xml/parser/XMLDocumentParser.h" +#include "platform/loader/fetch/FetchRequest.h" +#include "platform/loader/fetch/ResourceFetcher.h" #include "wtf/Vector.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/testing/Internals.cpp b/third_party/WebKit/Source/core/testing/Internals.cpp index faf7bfe..05975ca 100644 --- a/third_party/WebKit/Source/core/testing/Internals.cpp +++ b/third_party/WebKit/Source/core/testing/Internals.cpp
@@ -70,8 +70,6 @@ #include "core/editing/spellcheck/IdleSpellCheckCallback.h" #include "core/editing/spellcheck/SpellCheckRequester.h" #include "core/editing/spellcheck/SpellChecker.h" -#include "core/fetch/MemoryCache.h" -#include "core/fetch/ResourceFetcher.h" #include "core/frame/EventHandlerRegistry.h" #include "core/frame/FrameConsole.h" #include "core/frame/FrameView.h" @@ -136,6 +134,8 @@ #include "platform/graphics/GraphicsLayer.h" #include "platform/heap/Handle.h" #include "platform/instrumentation/tracing/TraceEvent.h" +#include "platform/loader/fetch/MemoryCache.h" +#include "platform/loader/fetch/ResourceFetcher.h" #include "platform/network/ResourceLoadPriority.h" #include "platform/scroll/ProgrammaticScrollAnimator.h" #include "platform/scroll/ScrollbarTheme.h"
diff --git a/third_party/WebKit/Source/core/workers/InProcessWorkerBase.cpp b/third_party/WebKit/Source/core/workers/InProcessWorkerBase.cpp index 37deb15d..c6e64df 100644 --- a/third_party/WebKit/Source/core/workers/InProcessWorkerBase.cpp +++ b/third_party/WebKit/Source/core/workers/InProcessWorkerBase.cpp
@@ -6,11 +6,11 @@ #include "bindings/core/v8/ExceptionState.h" #include "core/events/MessageEvent.h" -#include "core/fetch/ResourceFetcher.h" #include "core/frame/csp/ContentSecurityPolicy.h" #include "core/inspector/InspectorInstrumentation.h" #include "core/workers/InProcessWorkerMessagingProxy.h" #include "core/workers/WorkerScriptLoader.h" +#include "platform/loader/fetch/ResourceFetcher.h" #include <memory> namespace blink {
diff --git a/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp b/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp index 961478a99..b2d5910 100644 --- a/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp +++ b/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp
@@ -37,7 +37,6 @@ #include "core/dom/SuspendableObject.h" #include "core/events/ErrorEvent.h" #include "core/events/Event.h" -#include "core/fetch/MemoryCache.h" #include "core/frame/DOMTimerCoordinator.h" #include "core/inspector/ConsoleMessage.h" #include "core/inspector/ConsoleMessageStorage.h" @@ -52,6 +51,7 @@ #include "core/workers/WorkerScriptLoader.h" #include "core/workers/WorkerThread.h" #include "platform/InstanceCounters.h" +#include "platform/loader/fetch/MemoryCache.h" #include "platform/network/ContentSecurityPolicyParsers.h" #include "platform/weborigin/KURL.h" #include "platform/weborigin/SecurityOrigin.h"
diff --git a/third_party/WebKit/Source/core/workers/WorkerGlobalScope.h b/third_party/WebKit/Source/core/workers/WorkerGlobalScope.h index 2c5486b81..bab2fc48 100644 --- a/third_party/WebKit/Source/core/workers/WorkerGlobalScope.h +++ b/third_party/WebKit/Source/core/workers/WorkerGlobalScope.h
@@ -34,7 +34,6 @@ #include "core/dom/ExecutionContext.h" #include "core/events/EventListener.h" #include "core/events/EventTarget.h" -#include "core/fetch/CachedMetadataHandler.h" #include "core/frame/DOMTimerCoordinator.h" #include "core/frame/DOMWindowBase64.h" #include "core/frame/csp/ContentSecurityPolicy.h" @@ -42,6 +41,7 @@ #include "core/workers/WorkerOrWorkletGlobalScope.h" #include "core/workers/WorkerSettings.h" #include "platform/heap/Handle.h" +#include "platform/loader/fetch/CachedMetadataHandler.h" #include "wtf/ListHashSet.h" #include <memory>
diff --git a/third_party/WebKit/Source/core/workers/Worklet.cpp b/third_party/WebKit/Source/core/workers/Worklet.cpp index 0a2d3b0..6dbdc7f 100644 --- a/third_party/WebKit/Source/core/workers/Worklet.cpp +++ b/third_party/WebKit/Source/core/workers/Worklet.cpp
@@ -10,12 +10,12 @@ #include "core/dom/DOMException.h" #include "core/dom/Document.h" #include "core/dom/ExceptionCode.h" -#include "core/fetch/FetchInitiatorTypeNames.h" #include "core/frame/LocalFrame.h" #include "core/loader/DocumentLoader.h" #include "core/loader/FrameFetchContext.h" #include "core/workers/WorkletGlobalScopeProxy.h" #include "core/workers/WorkletScriptLoader.h" +#include "platform/loader/fetch/FetchInitiatorTypeNames.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/workers/WorkletScriptLoader.h b/third_party/WebKit/Source/core/workers/WorkletScriptLoader.h index 1f0678d..6291fff 100644 --- a/third_party/WebKit/Source/core/workers/WorkletScriptLoader.h +++ b/third_party/WebKit/Source/core/workers/WorkletScriptLoader.h
@@ -6,9 +6,9 @@ #define WorkletScriptLoader_h #include "bindings/core/v8/ScriptPromiseResolver.h" -#include "core/fetch/ResourceClient.h" -#include "core/fetch/ResourceOwner.h" #include "core/loader/resource/ScriptResource.h" +#include "platform/loader/fetch/ResourceClient.h" +#include "platform/loader/fetch/ResourceOwner.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/xml/XSLImportRule.cpp b/third_party/WebKit/Source/core/xml/XSLImportRule.cpp index 9a00421..ca3385b 100644 --- a/third_party/WebKit/Source/core/xml/XSLImportRule.cpp +++ b/third_party/WebKit/Source/core/xml/XSLImportRule.cpp
@@ -22,12 +22,12 @@ #include "core/xml/XSLImportRule.h" #include "core/dom/Document.h" -#include "core/fetch/FetchInitiatorTypeNames.h" -#include "core/fetch/FetchRequest.h" -#include "core/fetch/RawResource.h" -#include "core/fetch/ResourceFetcher.h" #include "core/loader/resource/XSLStyleSheetResource.h" #include "platform/SharedBuffer.h" +#include "platform/loader/fetch/FetchInitiatorTypeNames.h" +#include "platform/loader/fetch/FetchRequest.h" +#include "platform/loader/fetch/RawResource.h" +#include "platform/loader/fetch/ResourceFetcher.h" #include "wtf/text/TextEncoding.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/xml/XSLTProcessorLibxslt.cpp b/third_party/WebKit/Source/core/xml/XSLTProcessorLibxslt.cpp index e6e7467..88284a9a0 100644 --- a/third_party/WebKit/Source/core/xml/XSLTProcessorLibxslt.cpp +++ b/third_party/WebKit/Source/core/xml/XSLTProcessorLibxslt.cpp
@@ -26,10 +26,6 @@ #include "core/dom/Document.h" #include "core/dom/TransformSource.h" #include "core/editing/serializers/Serialization.h" -#include "core/fetch/FetchInitiatorTypeNames.h" -#include "core/fetch/RawResource.h" -#include "core/fetch/Resource.h" -#include "core/fetch/ResourceFetcher.h" #include "core/frame/FrameConsole.h" #include "core/frame/FrameHost.h" #include "core/frame/LocalFrame.h" @@ -39,6 +35,10 @@ #include "core/xml/XSLTUnicodeSort.h" #include "core/xml/parser/XMLDocumentParser.h" #include "platform/SharedBuffer.h" +#include "platform/loader/fetch/FetchInitiatorTypeNames.h" +#include "platform/loader/fetch/RawResource.h" +#include "platform/loader/fetch/Resource.h" +#include "platform/loader/fetch/ResourceFetcher.h" #include "platform/network/ResourceError.h" #include "platform/network/ResourceRequest.h" #include "platform/network/ResourceResponse.h"
diff --git a/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp b/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp index 9197cbf7..caaea042 100644 --- a/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp +++ b/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp
@@ -41,9 +41,6 @@ #include "core/dom/ScriptLoader.h" #include "core/dom/StyleEngine.h" #include "core/dom/TransformSource.h" -#include "core/fetch/FetchInitiatorTypeNames.h" -#include "core/fetch/RawResource.h" -#include "core/fetch/ResourceFetcher.h" #include "core/frame/LocalFrame.h" #include "core/frame/UseCounter.h" #include "core/html/HTMLHtmlElement.h" @@ -62,6 +59,9 @@ #include "platform/RuntimeEnabledFeatures.h" #include "platform/SharedBuffer.h" #include "platform/instrumentation/tracing/TraceEvent.h" +#include "platform/loader/fetch/FetchInitiatorTypeNames.h" +#include "platform/loader/fetch/RawResource.h" +#include "platform/loader/fetch/ResourceFetcher.h" #include "platform/network/ResourceError.h" #include "platform/network/ResourceRequest.h" #include "platform/network/ResourceResponse.h"
diff --git a/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.h b/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.h index a665c6e..132c9fe 100644 --- a/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.h +++ b/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.h
@@ -28,10 +28,10 @@ #include "core/dom/ParserContentPolicy.h" #include "core/dom/ScriptableDocumentParser.h" -#include "core/fetch/ResourceClient.h" #include "core/loader/resource/ScriptResource.h" #include "core/xml/parser/XMLErrors.h" #include "platform/heap/Handle.h" +#include "platform/loader/fetch/ResourceClient.h" #include "platform/text/SegmentedString.h" #include "wtf/Compiler.h" #include "wtf/HashMap.h"
diff --git a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp index 658d805..4435f0b 100644 --- a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp +++ b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp
@@ -41,10 +41,6 @@ #include "core/editing/serializers/Serialization.h" #include "core/events/Event.h" #include "core/events/ProgressEvent.h" -#include "core/fetch/CrossOriginAccessControl.h" -#include "core/fetch/FetchInitiatorTypeNames.h" -#include "core/fetch/FetchUtils.h" -#include "core/fetch/ResourceLoaderOptions.h" #include "core/fileapi/Blob.h" #include "core/fileapi/File.h" #include "core/fileapi/FileReaderLoader.h" @@ -68,6 +64,10 @@ #include "platform/RuntimeEnabledFeatures.h" #include "platform/SharedBuffer.h" #include "platform/blob/BlobData.h" +#include "platform/loader/fetch/CrossOriginAccessControl.h" +#include "platform/loader/fetch/FetchInitiatorTypeNames.h" +#include "platform/loader/fetch/FetchUtils.h" +#include "platform/loader/fetch/ResourceLoaderOptions.h" #include "platform/network/HTTPParsers.h" #include "platform/network/NetworkLog.h" #include "platform/network/ParsedContentType.h"
diff --git a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js index 4fea93b..e554590 100644 --- a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js +++ b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js
@@ -376,7 +376,7 @@ this._model.deviceOutlineSetting().set(false); } - mainTarget.pageAgent().captureScreenshot('png', 100, screenshotCaptured.bind(this)); + mainTarget.pageAgent().captureScreenshot(screenshotCaptured.bind(this)); /** * @param {?Protocol.Error} error
diff --git a/third_party/WebKit/Source/modules/beacon/NavigatorBeacon.cpp b/third_party/WebKit/Source/modules/beacon/NavigatorBeacon.cpp index 57c952d..c87cb30 100644 --- a/third_party/WebKit/Source/modules/beacon/NavigatorBeacon.cpp +++ b/third_party/WebKit/Source/modules/beacon/NavigatorBeacon.cpp
@@ -10,7 +10,6 @@ #include "core/dom/DOMArrayBufferView.h" #include "core/dom/ExceptionCode.h" #include "core/dom/ExecutionContext.h" -#include "core/fetch/FetchUtils.h" #include "core/fileapi/Blob.h" #include "core/frame/LocalFrame.h" #include "core/frame/Settings.h" @@ -18,6 +17,7 @@ #include "core/frame/csp/ContentSecurityPolicy.h" #include "core/html/FormData.h" #include "core/loader/PingLoader.h" +#include "platform/loader/fetch/FetchUtils.h" namespace blink {
diff --git a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp index 59ebdfbb..4d23f7d8 100644 --- a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp +++ b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp
@@ -5,7 +5,6 @@ #include "modules/canvas2d/CanvasRenderingContext2D.h" #include "core/dom/Document.h" -#include "core/fetch/MemoryCache.h" #include "core/frame/FrameView.h" #include "core/frame/ImageBitmap.h" #include "core/html/HTMLCanvasElement.h" @@ -23,6 +22,7 @@ #include "platform/graphics/UnacceleratedImageBufferSurface.h" #include "platform/graphics/test/FakeGLES2Interface.h" #include "platform/graphics/test/FakeWebGraphicsContext3DProvider.h" +#include "platform/loader/fetch/MemoryCache.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/skia/include/core/SkColorSpaceXform.h"
diff --git a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DUsageTrackingTest.cpp b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DUsageTrackingTest.cpp index ec14f9e..af62268 100644 --- a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DUsageTrackingTest.cpp +++ b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DUsageTrackingTest.cpp
@@ -5,7 +5,6 @@ #include "modules/canvas2d/CanvasRenderingContext2D.h" #include "core/dom/Document.h" -#include "core/fetch/MemoryCache.h" #include "core/frame/FrameView.h" #include "core/frame/Settings.h" #include "core/html/HTMLCanvasElement.h" @@ -22,6 +21,7 @@ #include "platform/RuntimeEnabledFeatures.h" #include "platform/graphics/StaticBitmapImage.h" #include "platform/graphics/UnacceleratedImageBufferSurface.h" +#include "platform/loader/fetch/MemoryCache.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/third_party/WebKit/Source/modules/fetch/BlobBytesConsumer.cpp b/third_party/WebKit/Source/modules/fetch/BlobBytesConsumer.cpp index 1ddf1a9..46c1d67 100644 --- a/third_party/WebKit/Source/modules/fetch/BlobBytesConsumer.cpp +++ b/third_party/WebKit/Source/modules/fetch/BlobBytesConsumer.cpp
@@ -4,12 +4,12 @@ #include "modules/fetch/BlobBytesConsumer.h" -#include "core/fetch/FetchInitiatorTypeNames.h" #include "core/loader/ThreadableLoader.h" #include "modules/fetch/BytesConsumerForDataConsumerHandle.h" #include "platform/blob/BlobData.h" #include "platform/blob/BlobRegistry.h" #include "platform/blob/BlobURL.h" +#include "platform/loader/fetch/FetchInitiatorTypeNames.h" #include "platform/network/ResourceError.h" #include "platform/network/ResourceRequest.h" #include "platform/weborigin/KURL.h"
diff --git a/third_party/WebKit/Source/modules/fetch/FetchHeaderList.cpp b/third_party/WebKit/Source/modules/fetch/FetchHeaderList.cpp index ee964d6f..eb15911 100644 --- a/third_party/WebKit/Source/modules/fetch/FetchHeaderList.cpp +++ b/third_party/WebKit/Source/modules/fetch/FetchHeaderList.cpp
@@ -4,7 +4,7 @@ #include "modules/fetch/FetchHeaderList.h" -#include "core/fetch/FetchUtils.h" +#include "platform/loader/fetch/FetchUtils.h" #include "platform/network/HTTPParsers.h" #include "wtf/PtrUtil.h" #include <algorithm>
diff --git a/third_party/WebKit/Source/modules/fetch/FetchManager.cpp b/third_party/WebKit/Source/modules/fetch/FetchManager.cpp index f5ce08d0..6da72cf7 100644 --- a/third_party/WebKit/Source/modules/fetch/FetchManager.cpp +++ b/third_party/WebKit/Source/modules/fetch/FetchManager.cpp
@@ -10,7 +10,6 @@ #include "bindings/core/v8/V8ThrowException.h" #include "core/dom/DOMArrayBuffer.h" #include "core/dom/Document.h" -#include "core/fetch/FetchUtils.h" #include "core/fileapi/Blob.h" #include "core/frame/Frame.h" #include "core/frame/SubresourceIntegrity.h" @@ -30,6 +29,7 @@ #include "modules/fetch/Response.h" #include "modules/fetch/ResponseInit.h" #include "platform/HTTPNames.h" +#include "platform/loader/fetch/FetchUtils.h" #include "platform/network/NetworkUtils.h" #include "platform/network/ResourceError.h" #include "platform/network/ResourceRequest.h"
diff --git a/third_party/WebKit/Source/modules/fetch/FetchRequestData.cpp b/third_party/WebKit/Source/modules/fetch/FetchRequestData.cpp index 50a98543..f13a083 100644 --- a/third_party/WebKit/Source/modules/fetch/FetchRequestData.cpp +++ b/third_party/WebKit/Source/modules/fetch/FetchRequestData.cpp
@@ -6,7 +6,6 @@ #include "bindings/core/v8/ScriptState.h" #include "core/dom/ExecutionContext.h" -#include "core/fetch/ResourceLoaderOptions.h" #include "core/loader/ThreadableLoader.h" #include "modules/credentialmanager/PasswordCredential.h" #include "modules/fetch/BlobBytesConsumer.h" @@ -14,6 +13,7 @@ #include "modules/fetch/BytesConsumer.h" #include "modules/fetch/FetchHeaderList.h" #include "platform/HTTPNames.h" +#include "platform/loader/fetch/ResourceLoaderOptions.h" #include "platform/network/ResourceRequest.h" #include "public/platform/WebURLRequest.h" #include "public/platform/modules/serviceworker/WebServiceWorkerRequest.h"
diff --git a/third_party/WebKit/Source/modules/fetch/FetchResponseData.cpp b/third_party/WebKit/Source/modules/fetch/FetchResponseData.cpp index e8e7b98a6..a9d937e 100644 --- a/third_party/WebKit/Source/modules/fetch/FetchResponseData.cpp +++ b/third_party/WebKit/Source/modules/fetch/FetchResponseData.cpp
@@ -6,9 +6,9 @@ #include "bindings/core/v8/ScriptState.h" #include "core/dom/DOMArrayBuffer.h" -#include "core/fetch/FetchUtils.h" #include "modules/fetch/BodyStreamBuffer.h" #include "modules/fetch/FetchHeaderList.h" +#include "platform/loader/fetch/FetchUtils.h" #include "public/platform/modules/serviceworker/WebServiceWorkerResponse.h" #include "wtf/PtrUtil.h"
diff --git a/third_party/WebKit/Source/modules/fetch/FetchResponseData.h b/third_party/WebKit/Source/modules/fetch/FetchResponseData.h index ae20e68..5652605 100644 --- a/third_party/WebKit/Source/modules/fetch/FetchResponseData.h +++ b/third_party/WebKit/Source/modules/fetch/FetchResponseData.h
@@ -5,9 +5,9 @@ #ifndef FetchResponseData_h #define FetchResponseData_h -#include "core/fetch/CrossOriginAccessControl.h" #include "modules/ModulesExport.h" #include "platform/heap/Handle.h" +#include "platform/loader/fetch/CrossOriginAccessControl.h" #include "platform/weborigin/KURL.h" #include "public/platform/modules/serviceworker/WebServiceWorkerRequest.h" #include "wtf/PassRefPtr.h"
diff --git a/third_party/WebKit/Source/modules/fetch/Headers.cpp b/third_party/WebKit/Source/modules/fetch/Headers.cpp index 17d2d55..0b2b4339 100644 --- a/third_party/WebKit/Source/modules/fetch/Headers.cpp +++ b/third_party/WebKit/Source/modules/fetch/Headers.cpp
@@ -8,7 +8,7 @@ #include "bindings/core/v8/ExceptionState.h" #include "bindings/core/v8/V8IteratorResultValue.h" #include "core/dom/Iterator.h" -#include "core/fetch/FetchUtils.h" +#include "platform/loader/fetch/FetchUtils.h" #include "wtf/NotFound.h" #include "wtf/PassRefPtr.h" #include "wtf/RefPtr.h"
diff --git a/third_party/WebKit/Source/modules/fetch/Request.cpp b/third_party/WebKit/Source/modules/fetch/Request.cpp index e4323c9..c5619f07 100644 --- a/third_party/WebKit/Source/modules/fetch/Request.cpp +++ b/third_party/WebKit/Source/modules/fetch/Request.cpp
@@ -7,14 +7,14 @@ #include "bindings/core/v8/Dictionary.h" #include "core/dom/Document.h" #include "core/dom/ExecutionContext.h" -#include "core/fetch/FetchUtils.h" -#include "core/fetch/ResourceLoaderOptions.h" #include "core/loader/ThreadableLoader.h" #include "modules/fetch/BodyStreamBuffer.h" #include "modules/fetch/FetchManager.h" #include "modules/fetch/RequestInit.h" #include "platform/HTTPNames.h" #include "platform/RuntimeEnabledFeatures.h" +#include "platform/loader/fetch/FetchUtils.h" +#include "platform/loader/fetch/ResourceLoaderOptions.h" #include "platform/network/HTTPParsers.h" #include "platform/network/ResourceRequest.h" #include "platform/weborigin/OriginAccessEntry.h"
diff --git a/third_party/WebKit/Source/modules/fetch/Response.cpp b/third_party/WebKit/Source/modules/fetch/Response.cpp index 6cae459a..71e3ac0 100644 --- a/third_party/WebKit/Source/modules/fetch/Response.cpp +++ b/third_party/WebKit/Source/modules/fetch/Response.cpp
@@ -17,7 +17,6 @@ #include "core/dom/DOMArrayBuffer.h" #include "core/dom/DOMArrayBufferView.h" #include "core/dom/URLSearchParams.h" -#include "core/fetch/FetchUtils.h" #include "core/fileapi/Blob.h" #include "core/html/FormData.h" #include "core/streams/ReadableStreamOperations.h" @@ -25,6 +24,7 @@ #include "modules/fetch/BodyStreamBuffer.h" #include "modules/fetch/FormDataBytesConsumer.h" #include "modules/fetch/ResponseInit.h" +#include "platform/loader/fetch/FetchUtils.h" #include "platform/network/EncodedFormData.h" #include "platform/network/HTTPHeaderMap.h" #include "platform/network/NetworkUtils.h"
diff --git a/third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp b/third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp index 00ba58c..9682179 100644 --- a/third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp +++ b/third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp
@@ -5,10 +5,10 @@ #include "modules/notifications/NotificationImageLoader.h" #include "core/dom/ExecutionContext.h" -#include "core/fetch/ResourceLoaderOptions.h" #include "platform/Histogram.h" #include "platform/image-decoders/ImageDecoder.h" #include "platform/image-decoders/ImageFrame.h" +#include "platform/loader/fetch/ResourceLoaderOptions.h" #include "platform/network/ResourceError.h" #include "platform/network/ResourceLoadPriority.h" #include "platform/network/ResourceRequest.h"
diff --git a/third_party/WebKit/Source/modules/notifications/NotificationImageLoaderTest.cpp b/third_party/WebKit/Source/modules/notifications/NotificationImageLoaderTest.cpp index 62cb2cf..1868f90 100644 --- a/third_party/WebKit/Source/modules/notifications/NotificationImageLoaderTest.cpp +++ b/third_party/WebKit/Source/modules/notifications/NotificationImageLoaderTest.cpp
@@ -5,8 +5,8 @@ #include "modules/notifications/NotificationImageLoader.h" #include "core/dom/ExecutionContext.h" -#include "core/fetch/MemoryCache.h" #include "core/testing/DummyPageHolder.h" +#include "platform/loader/fetch/MemoryCache.h" #include "platform/testing/HistogramTester.h" #include "platform/testing/TestingPlatformSupport.h" #include "platform/testing/URLTestHelpers.h"
diff --git a/third_party/WebKit/Source/modules/notifications/NotificationResourcesLoaderTest.cpp b/third_party/WebKit/Source/modules/notifications/NotificationResourcesLoaderTest.cpp index 834b818..a32e0b1 100644 --- a/third_party/WebKit/Source/modules/notifications/NotificationResourcesLoaderTest.cpp +++ b/third_party/WebKit/Source/modules/notifications/NotificationResourcesLoaderTest.cpp
@@ -4,9 +4,9 @@ #include "modules/notifications/NotificationResourcesLoader.h" -#include "core/fetch/MemoryCache.h" #include "core/testing/DummyPageHolder.h" #include "platform/heap/Heap.h" +#include "platform/loader/fetch/MemoryCache.h" #include "platform/testing/URLTestHelpers.h" #include "platform/weborigin/KURL.h" #include "public/platform/Platform.h"
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ForeignFetchRespondWithObserver.cpp b/third_party/WebKit/Source/modules/serviceworkers/ForeignFetchRespondWithObserver.cpp index 2fcc3e0..1d4af48 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ForeignFetchRespondWithObserver.cpp +++ b/third_party/WebKit/Source/modules/serviceworkers/ForeignFetchRespondWithObserver.cpp
@@ -4,9 +4,9 @@ #include "modules/serviceworkers/ForeignFetchRespondWithObserver.h" -#include "core/fetch/CrossOriginAccessControl.h" #include "modules/fetch/Response.h" #include "modules/serviceworkers/ForeignFetchResponse.h" +#include "platform/loader/fetch/CrossOriginAccessControl.h" namespace blink {
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp index 475ca6f..0a0aa43c 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp
@@ -38,8 +38,6 @@ #include "bindings/core/v8/V8ThrowException.h" #include "core/dom/ExceptionCode.h" #include "core/events/Event.h" -#include "core/fetch/MemoryCache.h" -#include "core/fetch/ResourceLoaderOptions.h" #include "core/inspector/ConsoleMessage.h" #include "core/inspector/WorkerInspectorController.h" #include "core/inspector/WorkerThreadDebugger.h" @@ -56,6 +54,8 @@ #include "modules/serviceworkers/ServiceWorkerThread.h" #include "modules/serviceworkers/WaitUntilObserver.h" #include "platform/Histogram.h" +#include "platform/loader/fetch/MemoryCache.h" +#include "platform/loader/fetch/ResourceLoaderOptions.h" #include "platform/network/ResourceRequest.h" #include "platform/weborigin/KURL.h" #include "public/platform/Platform.h"
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerScriptCachedMetadataHandler.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerScriptCachedMetadataHandler.cpp index e4bb513..21a337c 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerScriptCachedMetadataHandler.cpp +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerScriptCachedMetadataHandler.cpp
@@ -4,9 +4,9 @@ #include "modules/serviceworkers/ServiceWorkerScriptCachedMetadataHandler.h" -#include "core/fetch/CachedMetadata.h" #include "core/workers/WorkerGlobalScope.h" #include "modules/serviceworkers/ServiceWorkerGlobalScopeClient.h" +#include "platform/loader/fetch/CachedMetadata.h" namespace blink {
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerScriptCachedMetadataHandler.h b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerScriptCachedMetadataHandler.h index ba935627..1ae3b0b 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerScriptCachedMetadataHandler.h +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerScriptCachedMetadataHandler.h
@@ -5,8 +5,8 @@ #ifndef ServiceWorkerScriptCachedMetadataHandler_h #define ServiceWorkerScriptCachedMetadataHandler_h -#include "core/fetch/CachedMetadataHandler.h" #include "platform/heap/Handle.h" +#include "platform/loader/fetch/CachedMetadataHandler.h" #include "platform/weborigin/KURL.h" #include "wtf/Vector.h" #include <stdint.h>
diff --git a/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp b/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp index c4b87bc..a06f140 100644 --- a/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp +++ b/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp
@@ -33,7 +33,6 @@ #include "core/dom/DOMArrayBuffer.h" #include "core/dom/Document.h" #include "core/dom/ExecutionContext.h" -#include "core/fetch/UniqueIdentifier.h" #include "core/fileapi/FileReaderLoader.h" #include "core/fileapi/FileReaderLoaderClient.h" #include "core/frame/LocalFrame.h" @@ -46,6 +45,7 @@ #include "modules/websockets/WebSocketChannelClient.h" #include "modules/websockets/WebSocketFrame.h" #include "modules/websockets/WebSocketHandleImpl.h" +#include "platform/loader/fetch/UniqueIdentifier.h" #include "platform/network/NetworkLog.h" #include "platform/network/WebSocketHandshakeRequest.h" #include "platform/weborigin/SecurityOrigin.h"
diff --git a/third_party/WebKit/Source/platform/BUILD.gn b/third_party/WebKit/Source/platform/BUILD.gn index 4d587b4..d327310 100644 --- a/third_party/WebKit/Source/platform/BUILD.gn +++ b/third_party/WebKit/Source/platform/BUILD.gn
@@ -1462,6 +1462,7 @@ "//mojo/public/cpp/bindings", "//mojo/public/cpp/bindings:wtf_support", "//third_party/WebKit/Source/platform/heap", + "//third_party/WebKit/Source/platform/loader", "//third_party/WebKit/public:mojo_bindings_blink", "//third_party/WebKit/public:offscreen_canvas_mojo_bindings_blink", "//third_party/ced", @@ -1581,6 +1582,10 @@ testonly = true sources = [ + "loader/fetch/MockResource.cpp", + "loader/fetch/MockResource.h", + "loader/fetch/MockResourceClient.cpp", + "loader/fetch/MockResourceClient.h", "network/mime/MockMimeRegistry.h", "scheduler/base/task_queue_manager_delegate_for_test.cc", "scheduler/base/test_time_source.cc", @@ -1761,6 +1766,18 @@ "instrumentation/tracing/web_process_memory_dump_test.cc", "json/JSONParserTest.cpp", "json/JSONValuesTest.cpp", + "loader/fetch/ClientHintsPreferencesTest.cpp", + "loader/fetch/CrossOriginAccessControlTest.cpp", + "loader/fetch/FetchTestingPlatformSupport.cpp", + "loader/fetch/FetchTestingPlatformSupport.h", + "loader/fetch/FetchUtilsTest.cpp", + "loader/fetch/MemoryCacheCorrectnessTest.cpp", + "loader/fetch/MemoryCacheTest.cpp", + "loader/fetch/MockFetchContext.h", + "loader/fetch/RawResourceTest.cpp", + "loader/fetch/ResourceFetcherTest.cpp", + "loader/fetch/ResourceLoaderOptionsTest.cpp", + "loader/fetch/ResourceTest.cpp", "mac/VersionUtilMacTest.mm", "mojo/CommonCustomTypesStructTraitsTest.cpp", "mojo/GeometryStructTraitsTest.cpp", @@ -1934,6 +1951,9 @@ data = [ "testing/data/", + # TODO(toyoshim): Used by ResourceFetcherTest. Remove this dependency. + "../web/tests/data/", + # Required by some image decoder tests. "image-decoders/testing/", "../../LayoutTests/images/resources/",
diff --git a/third_party/WebKit/Source/platform/loader/BUILD.gn b/third_party/WebKit/Source/platform/loader/BUILD.gn new file mode 100644 index 0000000..abacdd5 --- /dev/null +++ b/third_party/WebKit/Source/platform/loader/BUILD.gn
@@ -0,0 +1,83 @@ +# Copyright 2017 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//third_party/WebKit/Source/build/scripts/scripts.gni") +import("//third_party/WebKit/Source/platform/platform_generated.gni") + +make_names("make_platform_loader_generated_fetch_initiator_type_names") { + in_files = [ "fetch/FetchInitiatorTypeNames.in" ] + outputs = [ + "$blink_platform_output_dir/loader/fetch/FetchInitiatorTypeNames.cpp", + "$blink_platform_output_dir/loader/fetch/FetchInitiatorTypeNames.h", + ] +} + +source_set("loader") { + # This target is a logical part of the platform and only the platform target + # should depend on it. + visibility = [ "//third_party/WebKit/Source/platform" ] + + sources = [ + "fetch/AccessControlStatus.h", + "fetch/CachedMetadata.cpp", + "fetch/CachedMetadata.h", + "fetch/CachedMetadataHandler.h", + "fetch/ClientHintsPreferences.cpp", + "fetch/ClientHintsPreferences.h", + "fetch/CrossOriginAccessControl.cpp", + "fetch/CrossOriginAccessControl.h", + "fetch/FetchContext.cpp", + "fetch/FetchContext.h", + "fetch/FetchInitiatorInfo.h", + "fetch/FetchRequest.cpp", + "fetch/FetchRequest.h", + "fetch/FetchUtils.cpp", + "fetch/FetchUtils.h", + "fetch/IntegrityMetadata.cpp", + "fetch/IntegrityMetadata.h", + "fetch/MemoryCache.cpp", + "fetch/MemoryCache.h", + "fetch/RawResource.cpp", + "fetch/RawResource.h", + "fetch/Resource.cpp", + "fetch/Resource.h", + "fetch/ResourceClient.h", + "fetch/ResourceClientWalker.h", + "fetch/ResourceFetcher.cpp", + "fetch/ResourceFetcher.h", + "fetch/ResourceLoader.cpp", + "fetch/ResourceLoader.h", + "fetch/ResourceLoaderOptions.h", + "fetch/ResourceLoadingLog.h", + "fetch/ResourceStatus.h", + "fetch/SubstituteData.h", + "fetch/UniqueIdentifier.cpp", + "fetch/UniqueIdentifier.h", + ] + + sources += get_target_outputs( + ":make_platform_loader_generated_fetch_initiator_type_names") + + defines = [ "BLINK_PLATFORM_IMPLEMENTATION=1" ] + + configs += [ + "//third_party/WebKit/Source:config", + "//third_party/WebKit/Source:non_test_config", + "//third_party/WebKit/Source:inside_blink", + + # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. + "//build/config/compiler:no_size_t_to_int_warning", + ] + + deps = [ + ":make_platform_loader_generated_fetch_initiator_type_names", + ] + + public_deps = [ + "//base", + "//skia", + "//third_party/icu", + "//v8", + ] +}
diff --git a/third_party/WebKit/Source/core/fetch/OWNERS b/third_party/WebKit/Source/platform/loader/OWNERS similarity index 100% rename from third_party/WebKit/Source/core/fetch/OWNERS rename to third_party/WebKit/Source/platform/loader/OWNERS
diff --git a/third_party/WebKit/Source/core/fetch/AccessControlStatus.h b/third_party/WebKit/Source/platform/loader/fetch/AccessControlStatus.h similarity index 100% rename from third_party/WebKit/Source/core/fetch/AccessControlStatus.h rename to third_party/WebKit/Source/platform/loader/fetch/AccessControlStatus.h
diff --git a/third_party/WebKit/Source/core/fetch/CachePolicy.h b/third_party/WebKit/Source/platform/loader/fetch/CachePolicy.h similarity index 100% rename from third_party/WebKit/Source/core/fetch/CachePolicy.h rename to third_party/WebKit/Source/platform/loader/fetch/CachePolicy.h
diff --git a/third_party/WebKit/Source/core/fetch/CachedMetadata.cpp b/third_party/WebKit/Source/platform/loader/fetch/CachedMetadata.cpp similarity index 95% rename from third_party/WebKit/Source/core/fetch/CachedMetadata.cpp rename to third_party/WebKit/Source/platform/loader/fetch/CachedMetadata.cpp index 19b1105a4..670bf79 100644 --- a/third_party/WebKit/Source/core/fetch/CachedMetadata.cpp +++ b/third_party/WebKit/Source/platform/loader/fetch/CachedMetadata.cpp
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "core/fetch/CachedMetadata.h" +#include "platform/loader/fetch/CachedMetadata.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/fetch/CachedMetadata.h b/third_party/WebKit/Source/platform/loader/fetch/CachedMetadata.h similarity index 96% rename from third_party/WebKit/Source/core/fetch/CachedMetadata.h rename to third_party/WebKit/Source/platform/loader/fetch/CachedMetadata.h index c57566e..16336a9 100644 --- a/third_party/WebKit/Source/core/fetch/CachedMetadata.h +++ b/third_party/WebKit/Source/platform/loader/fetch/CachedMetadata.h
@@ -31,7 +31,7 @@ #ifndef CachedMetadata_h #define CachedMetadata_h -#include "core/CoreExport.h" +#include "platform/PlatformExport.h" #include "wtf/Assertions.h" #include "wtf/PassRefPtr.h" #include "wtf/RefCounted.h" @@ -45,7 +45,7 @@ // // Serialized data is NOT portable across architectures. However, reading the // data type ID will reject data generated with a different byte-order. -class CORE_EXPORT CachedMetadata : public RefCounted<CachedMetadata> { +class PLATFORM_EXPORT CachedMetadata : public RefCounted<CachedMetadata> { public: static PassRefPtr<CachedMetadata> create(uint32_t dataTypeID, const char* data,
diff --git a/third_party/WebKit/Source/core/fetch/CachedMetadataHandler.h b/third_party/WebKit/Source/platform/loader/fetch/CachedMetadataHandler.h similarity index 100% rename from third_party/WebKit/Source/core/fetch/CachedMetadataHandler.h rename to third_party/WebKit/Source/platform/loader/fetch/CachedMetadataHandler.h
diff --git a/third_party/WebKit/Source/core/fetch/ClientHintsPreferences.cpp b/third_party/WebKit/Source/platform/loader/fetch/ClientHintsPreferences.cpp similarity index 96% rename from third_party/WebKit/Source/core/fetch/ClientHintsPreferences.cpp rename to third_party/WebKit/Source/platform/loader/fetch/ClientHintsPreferences.cpp index 5b0c4f4..5ef845e 100644 --- a/third_party/WebKit/Source/core/fetch/ClientHintsPreferences.cpp +++ b/third_party/WebKit/Source/platform/loader/fetch/ClientHintsPreferences.cpp
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "core/fetch/ClientHintsPreferences.h" +#include "platform/loader/fetch/ClientHintsPreferences.h" #include "platform/RuntimeEnabledFeatures.h" #include "platform/network/HTTPParsers.h"
diff --git a/third_party/WebKit/Source/core/fetch/ClientHintsPreferences.h b/third_party/WebKit/Source/platform/loader/fetch/ClientHintsPreferences.h similarity index 93% rename from third_party/WebKit/Source/core/fetch/ClientHintsPreferences.h rename to third_party/WebKit/Source/platform/loader/fetch/ClientHintsPreferences.h index 996fd3aa..6401ba3 100644 --- a/third_party/WebKit/Source/core/fetch/ClientHintsPreferences.h +++ b/third_party/WebKit/Source/platform/loader/fetch/ClientHintsPreferences.h
@@ -5,13 +5,13 @@ #ifndef ClientHintsPreferences_h #define ClientHintsPreferences_h -#include "core/CoreExport.h" +#include "platform/PlatformExport.h" #include "wtf/Allocator.h" #include "wtf/text/WTFString.h" namespace blink { -class CORE_EXPORT ClientHintsPreferences { +class PLATFORM_EXPORT ClientHintsPreferences { DISALLOW_NEW(); public:
diff --git a/third_party/WebKit/Source/core/fetch/ClientHintsPreferencesTest.cpp b/third_party/WebKit/Source/platform/loader/fetch/ClientHintsPreferencesTest.cpp similarity index 95% rename from third_party/WebKit/Source/core/fetch/ClientHintsPreferencesTest.cpp rename to third_party/WebKit/Source/platform/loader/fetch/ClientHintsPreferencesTest.cpp index ac41843e..18bbe38c 100644 --- a/third_party/WebKit/Source/core/fetch/ClientHintsPreferencesTest.cpp +++ b/third_party/WebKit/Source/platform/loader/fetch/ClientHintsPreferencesTest.cpp
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "core/fetch/ClientHintsPreferences.h" +#include "platform/loader/fetch/ClientHintsPreferences.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/third_party/WebKit/Source/core/fetch/CrossOriginAccessControl.cpp b/third_party/WebKit/Source/platform/loader/fetch/CrossOriginAccessControl.cpp similarity index 98% rename from third_party/WebKit/Source/core/fetch/CrossOriginAccessControl.cpp rename to third_party/WebKit/Source/platform/loader/fetch/CrossOriginAccessControl.cpp index a135fbd..e833f35 100644 --- a/third_party/WebKit/Source/core/fetch/CrossOriginAccessControl.cpp +++ b/third_party/WebKit/Source/platform/loader/fetch/CrossOriginAccessControl.cpp
@@ -24,11 +24,11 @@ * */ -#include "core/fetch/CrossOriginAccessControl.h" +#include "platform/loader/fetch/CrossOriginAccessControl.h" -#include "core/fetch/FetchUtils.h" -#include "core/fetch/Resource.h" -#include "core/fetch/ResourceLoaderOptions.h" +#include "platform/loader/fetch/FetchUtils.h" +#include "platform/loader/fetch/Resource.h" +#include "platform/loader/fetch/ResourceLoaderOptions.h" #include "platform/network/HTTPParsers.h" #include "platform/network/ResourceRequest.h" #include "platform/network/ResourceResponse.h"
diff --git a/third_party/WebKit/Source/core/fetch/CrossOriginAccessControl.h b/third_party/WebKit/Source/platform/loader/fetch/CrossOriginAccessControl.h similarity index 92% rename from third_party/WebKit/Source/core/fetch/CrossOriginAccessControl.h rename to third_party/WebKit/Source/platform/loader/fetch/CrossOriginAccessControl.h index a53696b..9a7b077f 100644 --- a/third_party/WebKit/Source/core/fetch/CrossOriginAccessControl.h +++ b/third_party/WebKit/Source/platform/loader/fetch/CrossOriginAccessControl.h
@@ -27,8 +27,8 @@ #ifndef CrossOriginAccessControl_h #define CrossOriginAccessControl_h -#include "core/CoreExport.h" -#include "core/fetch/ResourceLoaderOptions.h" +#include "platform/PlatformExport.h" +#include "platform/loader/fetch/ResourceLoaderOptions.h" #include "platform/network/ResourceRequest.h" #include "wtf/Allocator.h" #include "wtf/Forward.h" @@ -44,7 +44,7 @@ class ResourceResponse; class SecurityOrigin; -class CrossOriginAccessControl { +class PLATFORM_EXPORT CrossOriginAccessControl { STATIC_ONLY(CrossOriginAccessControl); public: @@ -139,16 +139,16 @@ }; // TODO: also migrate these into the above static class. -CORE_EXPORT bool isOnAccessControlResponseHeaderWhitelist(const String&); +PLATFORM_EXPORT bool isOnAccessControlResponseHeaderWhitelist(const String&); -CORE_EXPORT ResourceRequest +PLATFORM_EXPORT ResourceRequest createAccessControlPreflightRequest(const ResourceRequest&); -CORE_EXPORT void parseAccessControlExposeHeadersAllowList( +PLATFORM_EXPORT void parseAccessControlExposeHeadersAllowList( const String& headerValue, HTTPHeaderSet&); -CORE_EXPORT void extractCorsExposedHeaderNamesList(const ResourceResponse&, - HTTPHeaderSet&); +PLATFORM_EXPORT void extractCorsExposedHeaderNamesList(const ResourceResponse&, + HTTPHeaderSet&); } // namespace blink
diff --git a/third_party/WebKit/Source/core/fetch/CrossOriginAccessControlTest.cpp b/third_party/WebKit/Source/platform/loader/fetch/CrossOriginAccessControlTest.cpp similarity index 97% rename from third_party/WebKit/Source/core/fetch/CrossOriginAccessControlTest.cpp rename to third_party/WebKit/Source/platform/loader/fetch/CrossOriginAccessControlTest.cpp index aaf03c3..25388c8 100644 --- a/third_party/WebKit/Source/core/fetch/CrossOriginAccessControlTest.cpp +++ b/third_party/WebKit/Source/platform/loader/fetch/CrossOriginAccessControlTest.cpp
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "core/fetch/CrossOriginAccessControl.h" +#include "platform/loader/fetch/CrossOriginAccessControl.h" #include "platform/network/ResourceRequest.h" #include "platform/weborigin/SecurityOrigin.h"
diff --git a/third_party/WebKit/Source/core/fetch/FetchContext.cpp b/third_party/WebKit/Source/platform/loader/fetch/FetchContext.cpp similarity index 95% rename from third_party/WebKit/Source/core/fetch/FetchContext.cpp rename to third_party/WebKit/Source/platform/loader/fetch/FetchContext.cpp index 910b02b..c6ec50cb 100644 --- a/third_party/WebKit/Source/core/fetch/FetchContext.cpp +++ b/third_party/WebKit/Source/platform/loader/fetch/FetchContext.cpp
@@ -28,7 +28,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "core/fetch/FetchContext.h" +#include "platform/loader/fetch/FetchContext.h" #include "public/platform/WebCachePolicy.h" @@ -74,9 +74,7 @@ WebURLRequest::RequestContext, Resource*) {} -void FetchContext::dispatchDidReceiveData(unsigned long, - const char*, - int) {} +void FetchContext::dispatchDidReceiveData(unsigned long, const char*, int) {} void FetchContext::dispatchDidReceiveEncodedData(unsigned long, int) {}
diff --git a/third_party/WebKit/Source/core/fetch/FetchContext.h b/third_party/WebKit/Source/platform/loader/fetch/FetchContext.h similarity index 94% rename from third_party/WebKit/Source/core/fetch/FetchContext.h rename to third_party/WebKit/Source/platform/loader/fetch/FetchContext.h index fbc9092..ffc6869 100644 --- a/third_party/WebKit/Source/core/fetch/FetchContext.h +++ b/third_party/WebKit/Source/platform/loader/fetch/FetchContext.h
@@ -31,12 +31,12 @@ #ifndef FetchContext_h #define FetchContext_h -#include "core/CoreExport.h" -#include "core/fetch/CachePolicy.h" -#include "core/fetch/FetchInitiatorInfo.h" -#include "core/fetch/FetchRequest.h" -#include "core/fetch/Resource.h" +#include "platform/PlatformExport.h" #include "platform/heap/Handle.h" +#include "platform/loader/fetch/CachePolicy.h" +#include "platform/loader/fetch/FetchInitiatorInfo.h" +#include "platform/loader/fetch/FetchRequest.h" +#include "platform/loader/fetch/Resource.h" #include "platform/network/ResourceLoadPriority.h" #include "platform/network/ResourceRequest.h" #include "wtf/Forward.h" @@ -59,10 +59,10 @@ // in response to events in the ResourceFetcher. The ResourceFetcher or its job // class, ResourceLoader, may call the methods on a FetchContext. // -// Any processing that depends on core/ components outside core/fetch/ should -// be implemented on a subclass of this interface, and then exposed to the -// ResourceFetcher via this interface. -class CORE_EXPORT FetchContext +// Any processing that depends on components outside platform/loader/fetch/ +// should be implemented on a subclass of this interface, and then exposed to +// the ResourceFetcher via this interface. +class PLATFORM_EXPORT FetchContext : public GarbageCollectedFinalized<FetchContext> { WTF_MAKE_NONCOPYABLE(FetchContext);
diff --git a/third_party/WebKit/Source/core/fetch/FetchInitiatorInfo.h b/third_party/WebKit/Source/platform/loader/fetch/FetchInitiatorInfo.h similarity index 100% rename from third_party/WebKit/Source/core/fetch/FetchInitiatorInfo.h rename to third_party/WebKit/Source/platform/loader/fetch/FetchInitiatorInfo.h
diff --git a/third_party/WebKit/Source/core/fetch/FetchInitiatorTypeNames.in b/third_party/WebKit/Source/platform/loader/fetch/FetchInitiatorTypeNames.in similarity index 84% rename from third_party/WebKit/Source/core/fetch/FetchInitiatorTypeNames.in rename to third_party/WebKit/Source/platform/loader/fetch/FetchInitiatorTypeNames.in index d661e18b..59acdd94 100644 --- a/third_party/WebKit/Source/core/fetch/FetchInitiatorTypeNames.in +++ b/third_party/WebKit/Source/platform/loader/fetch/FetchInitiatorTypeNames.in
@@ -1,5 +1,5 @@ namespace="FetchInitiatorType" -export="CORE_EXPORT" +export="PLATFORM_EXPORT" beacon css
diff --git a/third_party/WebKit/Source/core/fetch/FetchRequest.cpp b/third_party/WebKit/Source/platform/loader/fetch/FetchRequest.cpp similarity index 97% rename from third_party/WebKit/Source/core/fetch/FetchRequest.cpp rename to third_party/WebKit/Source/platform/loader/fetch/FetchRequest.cpp index 6fd3174..0200a64 100644 --- a/third_party/WebKit/Source/core/fetch/FetchRequest.cpp +++ b/third_party/WebKit/Source/platform/loader/fetch/FetchRequest.cpp
@@ -23,10 +23,10 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "core/fetch/FetchRequest.h" +#include "platform/loader/fetch/FetchRequest.h" -#include "core/fetch/CrossOriginAccessControl.h" -#include "core/fetch/ResourceFetcher.h" +#include "platform/loader/fetch/CrossOriginAccessControl.h" +#include "platform/loader/fetch/ResourceFetcher.h" #include "platform/weborigin/KURL.h" #include "platform/weborigin/SecurityOrigin.h" #include "platform/weborigin/Suborigin.h"
diff --git a/third_party/WebKit/Source/core/fetch/FetchRequest.h b/third_party/WebKit/Source/platform/loader/fetch/FetchRequest.h similarity index 94% rename from third_party/WebKit/Source/core/fetch/FetchRequest.h rename to third_party/WebKit/Source/platform/loader/fetch/FetchRequest.h index 435eabb..a2dea73 100644 --- a/third_party/WebKit/Source/core/fetch/FetchRequest.h +++ b/third_party/WebKit/Source/platform/loader/fetch/FetchRequest.h
@@ -26,12 +26,12 @@ #ifndef FetchRequest_h #define FetchRequest_h -#include "core/CoreExport.h" -#include "core/fetch/ClientHintsPreferences.h" -#include "core/fetch/FetchInitiatorInfo.h" -#include "core/fetch/IntegrityMetadata.h" -#include "core/fetch/ResourceLoaderOptions.h" #include "platform/CrossOriginAttributeValue.h" +#include "platform/PlatformExport.h" +#include "platform/loader/fetch/ClientHintsPreferences.h" +#include "platform/loader/fetch/FetchInitiatorInfo.h" +#include "platform/loader/fetch/IntegrityMetadata.h" +#include "platform/loader/fetch/ResourceLoaderOptions.h" #include "platform/network/ResourceRequest.h" #include "wtf/Allocator.h" #include "wtf/text/AtomicString.h" @@ -41,7 +41,7 @@ // A FetchRequest is a "parameter object" for ResourceFetcher::requestResource // to avoid the method having too many arguments. -class CORE_EXPORT FetchRequest { +class PLATFORM_EXPORT FetchRequest { STACK_ALLOCATED(); public:
diff --git a/third_party/WebKit/Source/platform/loader/fetch/FetchTestingPlatformSupport.cpp b/third_party/WebKit/Source/platform/loader/fetch/FetchTestingPlatformSupport.cpp new file mode 100644 index 0000000..5f31046 --- /dev/null +++ b/third_party/WebKit/Source/platform/loader/fetch/FetchTestingPlatformSupport.cpp
@@ -0,0 +1,76 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "platform/loader/fetch/FetchTestingPlatformSupport.h" + +#include "platform/loader/fetch/MockFetchContext.h" +#include "platform/network/ResourceError.h" +#include "platform/testing/weburl_loader_mock_factory_impl.h" +#include "public/platform/Platform.h" +#include "public/platform/WebURL.h" +#include "public/platform/WebURLLoader.h" +#include "public/platform/WebURLLoaderMockFactory.h" +#include <memory> + +namespace blink { + +namespace { + +// WebURLLoader that does nothing. This instance should be passed as a default +// WebURLLoader to create a WebURLLoader through WebURLLoaderMockFactory. +class AssertWebURLLoader : public WebURLLoader { + public: + ~AssertWebURLLoader() override {} + + // WebURLLoader: + void loadSynchronously(const WebURLRequest&, + WebURLResponse&, + WebURLError&, + WebData&, + int64_t& encodedDataLength, + int64_t& encodedBodyLength) override { + NOTREACHED(); + } + void loadAsynchronously(const WebURLRequest&, WebURLLoaderClient*) override { + NOTREACHED(); + } + void cancel() override { NOTREACHED(); } + void setDefersLoading(bool defer) override { NOTREACHED(); } + void setLoadingTaskRunner(base::SingleThreadTaskRunner*) override { + NOTREACHED(); + } +}; + +} // namespace + +FetchTestingPlatformSupport::FetchTestingPlatformSupport() + : m_urlLoaderMockFactory(new WebURLLoaderMockFactoryImpl(this)) {} + +FetchTestingPlatformSupport::~FetchTestingPlatformSupport() = default; + +MockFetchContext* FetchTestingPlatformSupport::context() { + if (!m_context) { + m_context = MockFetchContext::create( + MockFetchContext::kShouldLoadNewResource, + currentThread()->scheduler()->loadingTaskRunner()); + } + return m_context; +} + +WebURLError FetchTestingPlatformSupport::cancelledError( + const WebURL& url) const { + return ResourceError(errorDomainBlinkInternal, -1, url.string(), + "cancelledError for testing"); +} + +WebURLLoaderMockFactory* +FetchTestingPlatformSupport::getURLLoaderMockFactory() { + return m_urlLoaderMockFactory.get(); +} + +WebURLLoader* FetchTestingPlatformSupport::createURLLoader() { + return m_urlLoaderMockFactory->createURLLoader(new AssertWebURLLoader); +} + +} // namespace blink
diff --git a/third_party/WebKit/Source/core/fetch/FetchTestingPlatformSupport.h b/third_party/WebKit/Source/platform/loader/fetch/FetchTestingPlatformSupport.h similarity index 100% rename from third_party/WebKit/Source/core/fetch/FetchTestingPlatformSupport.h rename to third_party/WebKit/Source/platform/loader/fetch/FetchTestingPlatformSupport.h
diff --git a/third_party/WebKit/Source/core/fetch/FetchUtils.cpp b/third_party/WebKit/Source/platform/loader/fetch/FetchUtils.cpp similarity index 98% rename from third_party/WebKit/Source/core/fetch/FetchUtils.cpp rename to third_party/WebKit/Source/platform/loader/fetch/FetchUtils.cpp index 223e0c84..2e07a16 100644 --- a/third_party/WebKit/Source/core/fetch/FetchUtils.cpp +++ b/third_party/WebKit/Source/platform/loader/fetch/FetchUtils.cpp
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "core/fetch/FetchUtils.h" +#include "platform/loader/fetch/FetchUtils.h" #include "platform/HTTPNames.h" #include "platform/network/HTTPHeaderMap.h"
diff --git a/third_party/WebKit/Source/core/fetch/FetchUtils.h b/third_party/WebKit/Source/platform/loader/fetch/FetchUtils.h similarity index 95% rename from third_party/WebKit/Source/core/fetch/FetchUtils.h rename to third_party/WebKit/Source/platform/loader/fetch/FetchUtils.h index 07c272c6..b247d95 100644 --- a/third_party/WebKit/Source/core/fetch/FetchUtils.h +++ b/third_party/WebKit/Source/platform/loader/fetch/FetchUtils.h
@@ -5,7 +5,7 @@ #ifndef FetchUtils_h #define FetchUtils_h -#include "core/CoreExport.h" +#include "platform/PlatformExport.h" #include "wtf/Allocator.h" #include "wtf/Forward.h" @@ -13,7 +13,7 @@ class HTTPHeaderMap; -class CORE_EXPORT FetchUtils { +class PLATFORM_EXPORT FetchUtils { STATIC_ONLY(FetchUtils); public:
diff --git a/third_party/WebKit/Source/core/fetch/FetchUtilsTest.cpp b/third_party/WebKit/Source/platform/loader/fetch/FetchUtilsTest.cpp similarity index 97% rename from third_party/WebKit/Source/core/fetch/FetchUtilsTest.cpp rename to third_party/WebKit/Source/platform/loader/fetch/FetchUtilsTest.cpp index faec6044..455be53 100644 --- a/third_party/WebKit/Source/core/fetch/FetchUtilsTest.cpp +++ b/third_party/WebKit/Source/platform/loader/fetch/FetchUtilsTest.cpp
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "core/fetch/FetchUtils.h" +#include "platform/loader/fetch/FetchUtils.h" #include "testing/gtest/include/gtest/gtest.h" #include "wtf/text/WTFString.h"
diff --git a/third_party/WebKit/Source/core/fetch/IntegrityMetadata.cpp b/third_party/WebKit/Source/platform/loader/fetch/IntegrityMetadata.cpp similarity index 94% rename from third_party/WebKit/Source/core/fetch/IntegrityMetadata.cpp rename to third_party/WebKit/Source/platform/loader/fetch/IntegrityMetadata.cpp index c238455..9ed641f 100644 --- a/third_party/WebKit/Source/core/fetch/IntegrityMetadata.cpp +++ b/third_party/WebKit/Source/platform/loader/fetch/IntegrityMetadata.cpp
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "core/fetch/IntegrityMetadata.h" +#include "platform/loader/fetch/IntegrityMetadata.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/fetch/IntegrityMetadata.h b/third_party/WebKit/Source/platform/loader/fetch/IntegrityMetadata.h similarity index 93% rename from third_party/WebKit/Source/core/fetch/IntegrityMetadata.h rename to third_party/WebKit/Source/platform/loader/fetch/IntegrityMetadata.h index ae9e57c..1f24d7d 100644 --- a/third_party/WebKit/Source/core/fetch/IntegrityMetadata.h +++ b/third_party/WebKit/Source/platform/loader/fetch/IntegrityMetadata.h
@@ -5,8 +5,8 @@ #ifndef IntegrityMetadata_h #define IntegrityMetadata_h -#include "core/CoreExport.h" #include "platform/Crypto.h" +#include "platform/PlatformExport.h" #include "wtf/HashSet.h" #include "wtf/StringHasher.h" #include "wtf/text/StringHash.h" @@ -19,7 +19,7 @@ using IntegrityMetadataPair = std::pair<WTF::String, HashAlgorithm>; using IntegrityMetadataSet = WTF::HashSet<IntegrityMetadataPair>; -class CORE_EXPORT IntegrityMetadata { +class PLATFORM_EXPORT IntegrityMetadata { public: IntegrityMetadata() {} IntegrityMetadata(WTF::String digest, HashAlgorithm);
diff --git a/third_party/WebKit/Source/core/fetch/MemoryCache.cpp b/third_party/WebKit/Source/platform/loader/fetch/MemoryCache.cpp similarity index 99% rename from third_party/WebKit/Source/core/fetch/MemoryCache.cpp rename to third_party/WebKit/Source/platform/loader/fetch/MemoryCache.cpp index d1205da..94eba0a 100644 --- a/third_party/WebKit/Source/core/fetch/MemoryCache.cpp +++ b/third_party/WebKit/Source/platform/loader/fetch/MemoryCache.cpp
@@ -20,10 +20,10 @@ Boston, MA 02110-1301, USA. */ -#include "core/fetch/MemoryCache.h" +#include "platform/loader/fetch/MemoryCache.h" -#include "core/fetch/ResourceLoadingLog.h" #include "platform/instrumentation/tracing/TraceEvent.h" +#include "platform/loader/fetch/ResourceLoadingLog.h" #include "platform/weborigin/SecurityOrigin.h" #include "platform/weborigin/SecurityOriginHash.h" #include "public/platform/Platform.h"
diff --git a/third_party/WebKit/Source/core/fetch/MemoryCache.h b/third_party/WebKit/Source/platform/loader/fetch/MemoryCache.h similarity index 96% rename from third_party/WebKit/Source/core/fetch/MemoryCache.h rename to third_party/WebKit/Source/platform/loader/fetch/MemoryCache.h index 684067e..93de505 100644 --- a/third_party/WebKit/Source/core/fetch/MemoryCache.h +++ b/third_party/WebKit/Source/platform/loader/fetch/MemoryCache.h
@@ -26,10 +26,10 @@ #ifndef MemoryCache_h #define MemoryCache_h -#include "core/CoreExport.h" -#include "core/fetch/Resource.h" #include "platform/MemoryCoordinator.h" +#include "platform/PlatformExport.h" #include "platform/instrumentation/tracing/MemoryCacheDumpProvider.h" +#include "platform/loader/fetch/Resource.h" #include "public/platform/WebThread.h" #include "wtf/Allocator.h" #include "wtf/HashMap.h" @@ -70,7 +70,7 @@ // This cache holds subresources used by Web pages: images, scripts, // stylesheets, etc. -class CORE_EXPORT MemoryCache final +class PLATFORM_EXPORT MemoryCache final : public GarbageCollectedFinalized<MemoryCache>, public WebThread::TaskObserver, public MemoryCacheDumpClient, @@ -209,11 +209,11 @@ }; // Returns the global cache. -CORE_EXPORT MemoryCache* memoryCache(); +PLATFORM_EXPORT MemoryCache* memoryCache(); // Sets the global cache, used to swap in a test instance. Returns the old // MemoryCache object. -CORE_EXPORT MemoryCache* replaceMemoryCacheForTesting(MemoryCache*); +PLATFORM_EXPORT MemoryCache* replaceMemoryCacheForTesting(MemoryCache*); } // namespace blink
diff --git a/third_party/WebKit/Source/core/fetch/MemoryCacheCorrectnessTest.cpp b/third_party/WebKit/Source/platform/loader/fetch/MemoryCacheCorrectnessTest.cpp similarity index 97% rename from third_party/WebKit/Source/core/fetch/MemoryCacheCorrectnessTest.cpp rename to third_party/WebKit/Source/platform/loader/fetch/MemoryCacheCorrectnessTest.cpp index baefbba4..4e994b24 100644 --- a/third_party/WebKit/Source/core/fetch/MemoryCacheCorrectnessTest.cpp +++ b/third_party/WebKit/Source/platform/loader/fetch/MemoryCacheCorrectnessTest.cpp
@@ -28,15 +28,15 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "core/fetch/MemoryCache.h" +#include "platform/loader/fetch/MemoryCache.h" -#include "core/fetch/FetchContext.h" -#include "core/fetch/FetchRequest.h" -#include "core/fetch/MockFetchContext.h" -#include "core/fetch/MockResource.h" -#include "core/fetch/RawResource.h" -#include "core/fetch/Resource.h" -#include "core/fetch/ResourceFetcher.h" +#include "platform/loader/fetch/FetchContext.h" +#include "platform/loader/fetch/FetchRequest.h" +#include "platform/loader/fetch/MockFetchContext.h" +#include "platform/loader/fetch/MockResource.h" +#include "platform/loader/fetch/RawResource.h" +#include "platform/loader/fetch/Resource.h" +#include "platform/loader/fetch/ResourceFetcher.h" #include "platform/network/ResourceRequest.h" #include "platform/testing/TestingPlatformSupport.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/third_party/WebKit/Source/core/fetch/MemoryCacheTest.cpp b/third_party/WebKit/Source/platform/loader/fetch/MemoryCacheTest.cpp similarity index 97% rename from third_party/WebKit/Source/core/fetch/MemoryCacheTest.cpp rename to third_party/WebKit/Source/platform/loader/fetch/MemoryCacheTest.cpp index a6465be..182fbcb 100644 --- a/third_party/WebKit/Source/core/fetch/MemoryCacheTest.cpp +++ b/third_party/WebKit/Source/platform/loader/fetch/MemoryCacheTest.cpp
@@ -28,11 +28,12 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "core/fetch/MemoryCache.h" +#include "platform/loader/fetch/MemoryCache.h" -#include "core/fetch/MockResourceClient.h" -#include "core/fetch/RawResource.h" +#include "platform/loader/fetch/MockResourceClient.h" +#include "platform/loader/fetch/RawResource.h" #include "platform/network/ResourceRequest.h" +#include "platform/testing/TestingPlatformSupport.h" #include "platform/testing/UnitTestHelpers.h" #include "public/platform/Platform.h" #include "testing/gtest/include/gtest/gtest.h" @@ -88,6 +89,8 @@ } Persistent<MemoryCache> m_globalMemoryCache; + ScopedTestingPlatformSupport<TestingPlatformSupportWithMockScheduler> + m_platform; }; // Verifies that setters and getters for cache capacities work correcty. @@ -180,7 +183,8 @@ WTF::bind(&runTask2, resource1->encodedSize() + resource1->overheadSize() + resource2->encodedSize() + resource2->overheadSize())); - testing::runPendingTasks(); + static_cast<TestingPlatformSupportWithMockScheduler*>(Platform::current()) + ->runUntilIdle(); } // Verified that when ordering a prune in a runLoop task, the prune
diff --git a/third_party/WebKit/Source/core/fetch/MockFetchContext.h b/third_party/WebKit/Source/platform/loader/fetch/MockFetchContext.h similarity index 96% rename from third_party/WebKit/Source/core/fetch/MockFetchContext.h rename to third_party/WebKit/Source/platform/loader/fetch/MockFetchContext.h index e216241..6a7efaf7 100644 --- a/third_party/WebKit/Source/core/fetch/MockFetchContext.h +++ b/third_party/WebKit/Source/platform/loader/fetch/MockFetchContext.h
@@ -5,8 +5,8 @@ #ifndef MockFetchContext_h #define MockFetchContext_h -#include "core/fetch/FetchContext.h" -#include "core/fetch/FetchRequest.h" +#include "platform/loader/fetch/FetchContext.h" +#include "platform/loader/fetch/FetchRequest.h" #include "platform/network/ResourceTimingInfo.h" #include "platform/scheduler/test/fake_web_task_runner.h" #include "wtf/PtrUtil.h"
diff --git a/third_party/WebKit/Source/core/fetch/MockResource.cpp b/third_party/WebKit/Source/platform/loader/fetch/MockResource.cpp similarity index 85% rename from third_party/WebKit/Source/core/fetch/MockResource.cpp rename to third_party/WebKit/Source/platform/loader/fetch/MockResource.cpp index 57796d0..a4a8820 100644 --- a/third_party/WebKit/Source/core/fetch/MockResource.cpp +++ b/third_party/WebKit/Source/platform/loader/fetch/MockResource.cpp
@@ -2,11 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "core/fetch/MockResource.h" +#include "platform/loader/fetch/MockResource.h" -#include "core/fetch/FetchRequest.h" -#include "core/fetch/ResourceFetcher.h" -#include "core/fetch/ResourceLoaderOptions.h" +#include "platform/loader/fetch/FetchRequest.h" +#include "platform/loader/fetch/ResourceFetcher.h" +#include "platform/loader/fetch/ResourceLoaderOptions.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/fetch/MockResource.h b/third_party/WebKit/Source/platform/loader/fetch/MockResource.h similarity index 95% rename from third_party/WebKit/Source/core/fetch/MockResource.h rename to third_party/WebKit/Source/platform/loader/fetch/MockResource.h index b9e227d..c9339912 100644 --- a/third_party/WebKit/Source/core/fetch/MockResource.h +++ b/third_party/WebKit/Source/platform/loader/fetch/MockResource.h
@@ -5,8 +5,8 @@ #ifndef MockResource_h #define MockResource_h -#include "core/fetch/Resource.h" #include "platform/heap/Handle.h" +#include "platform/loader/fetch/Resource.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/fetch/MockResourceClient.cpp b/third_party/WebKit/Source/platform/loader/fetch/MockResourceClient.cpp similarity index 87% rename from third_party/WebKit/Source/core/fetch/MockResourceClient.cpp rename to third_party/WebKit/Source/platform/loader/fetch/MockResourceClient.cpp index 0534cd6..1317d252 100644 --- a/third_party/WebKit/Source/core/fetch/MockResourceClient.cpp +++ b/third_party/WebKit/Source/platform/loader/fetch/MockResourceClient.cpp
@@ -2,9 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "core/fetch/MockResourceClient.h" - -#include "testing/gtest/include/gtest/gtest.h" +#include "platform/loader/fetch/MockResourceClient.h" namespace blink { @@ -18,7 +16,7 @@ MockResourceClient::~MockResourceClient() {} void MockResourceClient::notifyFinished(Resource* resource) { - ASSERT_FALSE(m_notifyFinishedCalled); + CHECK(!m_notifyFinishedCalled); m_notifyFinishedCalled = true; m_encodedSizeOnNotifyFinished = resource->encodedSize(); }
diff --git a/third_party/WebKit/Source/core/fetch/MockResourceClient.h b/third_party/WebKit/Source/platform/loader/fetch/MockResourceClient.h similarity index 96% rename from third_party/WebKit/Source/core/fetch/MockResourceClient.h rename to third_party/WebKit/Source/platform/loader/fetch/MockResourceClient.h index f6d9c0a9..81e7cde 100644 --- a/third_party/WebKit/Source/core/fetch/MockResourceClient.h +++ b/third_party/WebKit/Source/platform/loader/fetch/MockResourceClient.h
@@ -31,9 +31,9 @@ #ifndef MockResourceClient_h #define MockResourceClient_h -#include "core/fetch/Resource.h" -#include "core/fetch/ResourceClient.h" #include "platform/heap/Handle.h" +#include "platform/loader/fetch/Resource.h" +#include "platform/loader/fetch/ResourceClient.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/fetch/RawResource.cpp b/third_party/WebKit/Source/platform/loader/fetch/RawResource.cpp similarity index 97% rename from third_party/WebKit/Source/core/fetch/RawResource.cpp rename to third_party/WebKit/Source/platform/loader/fetch/RawResource.cpp index 2a67b580..88c82a8 100644 --- a/third_party/WebKit/Source/core/fetch/RawResource.cpp +++ b/third_party/WebKit/Source/platform/loader/fetch/RawResource.cpp
@@ -23,14 +23,14 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "core/fetch/RawResource.h" +#include "platform/loader/fetch/RawResource.h" -#include "core/fetch/FetchRequest.h" -#include "core/fetch/MemoryCache.h" -#include "core/fetch/ResourceClientWalker.h" -#include "core/fetch/ResourceFetcher.h" -#include "core/fetch/ResourceLoader.h" #include "platform/HTTPNames.h" +#include "platform/loader/fetch/FetchRequest.h" +#include "platform/loader/fetch/MemoryCache.h" +#include "platform/loader/fetch/ResourceClientWalker.h" +#include "platform/loader/fetch/ResourceFetcher.h" +#include "platform/loader/fetch/ResourceLoader.h" #include <memory> namespace blink {
diff --git a/third_party/WebKit/Source/core/fetch/RawResource.h b/third_party/WebKit/Source/platform/loader/fetch/RawResource.h similarity index 95% rename from third_party/WebKit/Source/core/fetch/RawResource.h rename to third_party/WebKit/Source/platform/loader/fetch/RawResource.h index 95401e13..6573a2b 100644 --- a/third_party/WebKit/Source/core/fetch/RawResource.h +++ b/third_party/WebKit/Source/platform/loader/fetch/RawResource.h
@@ -23,9 +23,9 @@ #ifndef RawResource_h #define RawResource_h -#include "core/CoreExport.h" -#include "core/fetch/Resource.h" -#include "core/fetch/ResourceClient.h" +#include "platform/PlatformExport.h" +#include "platform/loader/fetch/Resource.h" +#include "platform/loader/fetch/ResourceClient.h" #include "public/platform/WebDataConsumerHandle.h" #include "wtf/WeakPtr.h" #include <memory> @@ -36,7 +36,7 @@ class ResourceFetcher; class SubstituteData; -class CORE_EXPORT RawResource final : public Resource { +class PLATFORM_EXPORT RawResource final : public Resource { public: using ClientType = RawResourceClient; @@ -109,7 +109,7 @@ return static_cast<RawResource*>(resource); } -class CORE_EXPORT RawResourceClient : public ResourceClient { +class PLATFORM_EXPORT RawResourceClient : public ResourceClient { public: static bool isExpectedType(ResourceClient* client) { return client->getResourceClientType() == RawResourceType; @@ -157,7 +157,7 @@ // Checks the sequence of callbacks of RawResourceClient. This can be used only // when a RawResourceClient is added as a client to at most one RawResource. -class CORE_EXPORT RawResourceClientStateChecker final { +class PLATFORM_EXPORT RawResourceClientStateChecker final { public: RawResourceClientStateChecker(); ~RawResourceClientStateChecker();
diff --git a/third_party/WebKit/Source/core/fetch/RawResourceTest.cpp b/third_party/WebKit/Source/platform/loader/fetch/RawResourceTest.cpp similarity index 93% rename from third_party/WebKit/Source/core/fetch/RawResourceTest.cpp rename to third_party/WebKit/Source/platform/loader/fetch/RawResourceTest.cpp index acc22a82..992f7ea 100644 --- a/third_party/WebKit/Source/core/fetch/RawResourceTest.cpp +++ b/third_party/WebKit/Source/platform/loader/fetch/RawResourceTest.cpp
@@ -28,13 +28,14 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "core/fetch/RawResource.h" +#include "platform/loader/fetch/RawResource.h" -#include "core/fetch/MemoryCache.h" -#include "core/fetch/ResourceFetcher.h" #include "platform/SharedBuffer.h" #include "platform/heap/Handle.h" +#include "platform/loader/fetch/MemoryCache.h" +#include "platform/loader/fetch/ResourceFetcher.h" #include "platform/network/ResourceTimingInfo.h" +#include "platform/testing/TestingPlatformSupport.h" #include "platform/testing/UnitTestHelpers.h" #include "public/platform/Platform.h" #include "public/platform/WebScheduler.h" @@ -50,6 +51,19 @@ using ::testing::_; using Checkpoint = ::testing::StrictMock<::testing::MockFunction<void(int)>>; +class RawResourceTest : public ::testing::Test { + public: + RawResourceTest() {} + ~RawResourceTest() override {} + + protected: + ScopedTestingPlatformSupport<TestingPlatformSupportWithMockScheduler> + m_platform; + + private: + DISALLOW_COPY_AND_ASSIGN(RawResourceTest); +}; + class MockRawResourceClient : public GarbageCollectedFinalized<MockRawResourceClient>, public RawResourceClient { @@ -93,7 +107,7 @@ MockRawResourceClient() = default; }; -TEST(RawResourceTest, DontIgnoreAcceptForCacheReuse) { +TEST_F(RawResourceTest, DontIgnoreAcceptForCacheReuse) { ResourceRequest jpegRequest; jpegRequest.setHTTPAccept("image/jpeg"); @@ -178,7 +192,7 @@ Member<Resource> m_resource; }; -TEST(RawResourceTest, RevalidationSucceeded) { +TEST_F(RawResourceTest, RevalidationSucceeded) { Resource* resource = RawResource::create(ResourceRequest("data:text/html,"), Resource::Raw); ResourceResponse response; @@ -211,7 +225,7 @@ EXPECT_EQ("abcd", String(client->data().data(), client->data().size())); } -TEST(RawResourceTest, RevalidationSucceededForResourceWithoutBody) { +TEST_F(RawResourceTest, RevalidationSucceededForResourceWithoutBody) { Resource* resource = RawResource::create(ResourceRequest("data:text/html,"), Resource::Raw); ResourceResponse response; @@ -242,7 +256,7 @@ EXPECT_EQ(0u, client->data().size()); } -TEST(RawResourceTest, RevalidationSucceededUpdateHeaders) { +TEST_F(RawResourceTest, RevalidationSucceededUpdateHeaders) { Resource* resource = RawResource::create(ResourceRequest("data:text/html,"), Resource::Raw); ResourceResponse response; @@ -315,7 +329,7 @@ EXPECT_EQ(0u, client->data().size()); } -TEST(RawResourceTest, RedirectDuringRevalidation) { +TEST_F(RawResourceTest, RedirectDuringRevalidation) { Resource* resource = RawResource::create( ResourceRequest("https://example.com/1"), Resource::Raw); ResourceResponse response; @@ -385,8 +399,8 @@ resource->addClient(client2); // Because RawResourceClient is added asynchronously, - // |runPendingTasks()| is called to make |client2| to be notified. - testing::runPendingTasks(); + // |runUntilIdle()| is called to make |client2| to be notified. + m_platform->runUntilIdle(); EXPECT_TRUE(client2->called()); EXPECT_EQ(1, client2->numberOfRedirectsReceived()); @@ -399,7 +413,7 @@ EXPECT_FALSE(resource->isAlive()); } -TEST(RawResourceTest, AddClientDuringCallback) { +TEST_F(RawResourceTest, AddClientDuringCallback) { Resource* raw = RawResource::create(ResourceRequest("data:text/html,"), Resource::Raw); @@ -414,7 +428,7 @@ Persistent<AddingClient> addingClient = new AddingClient(dummyClient.get(), raw); raw->addClient(addingClient); - testing::runPendingTasks(); + m_platform->runUntilIdle(); raw->removeClient(addingClient); EXPECT_FALSE(dummyClient->called()); EXPECT_FALSE(raw->isAlive()); @@ -445,7 +459,7 @@ Member<DummyClient> m_dummyClient; }; -TEST(RawResourceTest, RemoveClientDuringCallback) { +TEST_F(RawResourceTest, RemoveClientDuringCallback) { Resource* raw = RawResource::create(ResourceRequest("data:text/html,"), Resource::Raw); @@ -461,7 +475,7 @@ new RemovingClient(dummyClient.get()); raw->addClient(dummyClient); raw->addClient(removingClient); - testing::runPendingTasks(); + m_platform->runUntilIdle(); EXPECT_FALSE(raw->isAlive()); } @@ -469,7 +483,7 @@ // ResourceCallback. When revalidation is started after ResourceCallback is // scheduled and before it is dispatched, ResourceClient's callbacks should be // called appropriately. -TEST(RawResourceTest, StartFailedRevalidationWhileResourceCallback) { +TEST_F(RawResourceTest, StartFailedRevalidationWhileResourceCallback) { KURL url(ParsedURLString, "http://127.0.0.1:8000/foo.html"); ResourceResponse response; @@ -505,7 +519,7 @@ EXPECT_TRUE(resource->isCacheValidator()); // Make the ResourceCallback to be dispatched. - testing::runPendingTasks(); + m_platform->runUntilIdle(); checkpoint.Call(1); @@ -513,7 +527,7 @@ resource->appendData("newData", 8); } -TEST(RawResourceTest, StartSuccessfulRevalidationWhileResourceCallback) { +TEST_F(RawResourceTest, StartSuccessfulRevalidationWhileResourceCallback) { KURL url(ParsedURLString, "http://127.0.0.1:8000/foo.html"); ResourceResponse response; @@ -549,14 +563,15 @@ EXPECT_TRUE(resource->isCacheValidator()); // Make the ResourceCallback to be dispatched. - testing::runPendingTasks(); + m_platform->runUntilIdle(); checkpoint.Call(1); resource->responseReceived(newResponse, nullptr); } -TEST(RawResourceTest, CanReuseDevToolsEmulateNetworkConditionsClientIdHeader) { +TEST_F(RawResourceTest, + CanReuseDevToolsEmulateNetworkConditionsClientIdHeader) { ResourceRequest request("data:text/html,"); request.setHTTPHeaderField( HTTPNames::X_DevTools_Emulate_Network_Conditions_Client_Id, "Foo");
diff --git a/third_party/WebKit/Source/core/fetch/Resource.cpp b/third_party/WebKit/Source/platform/loader/fetch/Resource.cpp similarity index 98% rename from third_party/WebKit/Source/core/fetch/Resource.cpp rename to third_party/WebKit/Source/platform/loader/fetch/Resource.cpp index b688861..b4fd2da8 100644 --- a/third_party/WebKit/Source/core/fetch/Resource.cpp +++ b/third_party/WebKit/Source/platform/loader/fetch/Resource.cpp
@@ -22,23 +22,23 @@ Boston, MA 02110-1301, USA. */ -#include "core/fetch/Resource.h" +#include "platform/loader/fetch/Resource.h" -#include "core/fetch/CachedMetadata.h" -#include "core/fetch/CrossOriginAccessControl.h" -#include "core/fetch/FetchInitiatorTypeNames.h" -#include "core/fetch/FetchRequest.h" -#include "core/fetch/IntegrityMetadata.h" -#include "core/fetch/MemoryCache.h" -#include "core/fetch/ResourceClient.h" -#include "core/fetch/ResourceClientWalker.h" -#include "core/fetch/ResourceLoader.h" #include "platform/Histogram.h" #include "platform/InstanceCounters.h" #include "platform/RuntimeEnabledFeatures.h" #include "platform/SharedBuffer.h" #include "platform/WebTaskRunner.h" #include "platform/instrumentation/tracing/TraceEvent.h" +#include "platform/loader/fetch/CachedMetadata.h" +#include "platform/loader/fetch/CrossOriginAccessControl.h" +#include "platform/loader/fetch/FetchInitiatorTypeNames.h" +#include "platform/loader/fetch/FetchRequest.h" +#include "platform/loader/fetch/IntegrityMetadata.h" +#include "platform/loader/fetch/MemoryCache.h" +#include "platform/loader/fetch/ResourceClient.h" +#include "platform/loader/fetch/ResourceClientWalker.h" +#include "platform/loader/fetch/ResourceLoader.h" #include "platform/network/HTTPParsers.h" #include "platform/weborigin/KURL.h" #include "public/platform/Platform.h"
diff --git a/third_party/WebKit/Source/core/fetch/Resource.h b/third_party/WebKit/Source/platform/loader/fetch/Resource.h similarity index 97% rename from third_party/WebKit/Source/core/fetch/Resource.h rename to third_party/WebKit/Source/platform/loader/fetch/Resource.h index 36c8eef..ce181b0 100644 --- a/third_party/WebKit/Source/core/fetch/Resource.h +++ b/third_party/WebKit/Source/platform/loader/fetch/Resource.h
@@ -24,15 +24,15 @@ #ifndef Resource_h #define Resource_h -#include "core/CoreExport.h" -#include "core/fetch/CachedMetadataHandler.h" -#include "core/fetch/IntegrityMetadata.h" -#include "core/fetch/ResourceLoaderOptions.h" -#include "core/fetch/ResourceStatus.h" #include "platform/MemoryCoordinator.h" +#include "platform/PlatformExport.h" #include "platform/SharedBuffer.h" #include "platform/Timer.h" #include "platform/instrumentation/tracing/web_process_memory_dump.h" +#include "platform/loader/fetch/CachedMetadataHandler.h" +#include "platform/loader/fetch/IntegrityMetadata.h" +#include "platform/loader/fetch/ResourceLoaderOptions.h" +#include "platform/loader/fetch/ResourceStatus.h" #include "platform/network/ResourceError.h" #include "platform/network/ResourceLoadPriority.h" #include "platform/network/ResourceRequest.h" @@ -59,8 +59,8 @@ // should derive from ResourceClient, to get the function calls in case the // requested data has arrived. This class also does the actual communication // with the loader to obtain the resource from the network. -class CORE_EXPORT Resource : public GarbageCollectedFinalized<Resource>, - public MemoryCoordinatorClient { +class PLATFORM_EXPORT Resource : public GarbageCollectedFinalized<Resource>, + public MemoryCoordinatorClient { USING_GARBAGE_COLLECTED_MIXIN(Resource); WTF_MAKE_NONCOPYABLE(Resource);
diff --git a/third_party/WebKit/Source/core/fetch/ResourceClient.h b/third_party/WebKit/Source/platform/loader/fetch/ResourceClient.h similarity index 94% rename from third_party/WebKit/Source/core/fetch/ResourceClient.h rename to third_party/WebKit/Source/platform/loader/fetch/ResourceClient.h index d7c0710..5487714 100644 --- a/third_party/WebKit/Source/core/fetch/ResourceClient.h +++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceClient.h
@@ -26,7 +26,7 @@ #ifndef ResourceClient_h #define ResourceClient_h -#include "core/CoreExport.h" +#include "platform/PlatformExport.h" #include "platform/heap/Handle.h" #include "wtf/Forward.h" #include "wtf/text/WTFString.h" @@ -34,7 +34,7 @@ namespace blink { class Resource; -class CORE_EXPORT ResourceClient : public GarbageCollectedMixin { +class PLATFORM_EXPORT ResourceClient : public GarbageCollectedMixin { public: enum ResourceClientType { BaseResourceType,
diff --git a/third_party/WebKit/Source/core/fetch/ResourceClientWalker.h b/third_party/WebKit/Source/platform/loader/fetch/ResourceClientWalker.h similarity index 97% rename from third_party/WebKit/Source/core/fetch/ResourceClientWalker.h rename to third_party/WebKit/Source/platform/loader/fetch/ResourceClientWalker.h index 70ea28c..9e1862b 100644 --- a/third_party/WebKit/Source/core/fetch/ResourceClientWalker.h +++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceClientWalker.h
@@ -25,8 +25,8 @@ #ifndef ResourceClientWalker_h #define ResourceClientWalker_h -#include "core/fetch/ResourceClient.h" #include "platform/heap/Handle.h" +#include "platform/loader/fetch/ResourceClient.h" #include "wtf/Allocator.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp b/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp similarity index 98% rename from third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp rename to third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp index 5f25871..2ad9540 100644 --- a/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp +++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
@@ -25,18 +25,18 @@ sheets and html pages from the web. It has a memory cache for these objects. */ -#include "core/fetch/ResourceFetcher.h" +#include "platform/loader/fetch/ResourceFetcher.h" -#include "core/fetch/FetchContext.h" -#include "core/fetch/FetchInitiatorTypeNames.h" -#include "core/fetch/MemoryCache.h" -#include "core/fetch/ResourceLoader.h" -#include "core/fetch/ResourceLoadingLog.h" -#include "core/fetch/UniqueIdentifier.h" #include "platform/Histogram.h" #include "platform/RuntimeEnabledFeatures.h" #include "platform/instrumentation/tracing/TraceEvent.h" #include "platform/instrumentation/tracing/TracedValue.h" +#include "platform/loader/fetch/FetchContext.h" +#include "platform/loader/fetch/FetchInitiatorTypeNames.h" +#include "platform/loader/fetch/MemoryCache.h" +#include "platform/loader/fetch/ResourceLoader.h" +#include "platform/loader/fetch/ResourceLoadingLog.h" +#include "platform/loader/fetch/UniqueIdentifier.h" #include "platform/mhtml/ArchiveResource.h" #include "platform/mhtml/MHTMLArchive.h" #include "platform/network/NetworkInstrumentation.h" @@ -195,8 +195,7 @@ request.resourceRequest().priority()); } -static void populateTimingInfo(ResourceTimingInfo* info, - Resource* resource) { +static void populateTimingInfo(ResourceTimingInfo* info, Resource* resource) { KURL initialURL = resource->response().redirectResponses().isEmpty() ? resource->resourceRequest().url() : resource->response().redirectResponses()[0].url();
diff --git a/third_party/WebKit/Source/core/fetch/ResourceFetcher.h b/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.h similarity index 95% rename from third_party/WebKit/Source/core/fetch/ResourceFetcher.h rename to third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.h index 6c61eea..31a8810 100644 --- a/third_party/WebKit/Source/core/fetch/ResourceFetcher.h +++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.h
@@ -27,15 +27,15 @@ #ifndef ResourceFetcher_h #define ResourceFetcher_h -#include "core/CoreExport.h" -#include "core/fetch/CachePolicy.h" -#include "core/fetch/FetchContext.h" -#include "core/fetch/FetchInitiatorInfo.h" -#include "core/fetch/FetchRequest.h" -#include "core/fetch/Resource.h" -#include "core/fetch/ResourceLoaderOptions.h" -#include "core/fetch/SubstituteData.h" +#include "platform/PlatformExport.h" #include "platform/Timer.h" +#include "platform/loader/fetch/CachePolicy.h" +#include "platform/loader/fetch/FetchContext.h" +#include "platform/loader/fetch/FetchInitiatorInfo.h" +#include "platform/loader/fetch/FetchRequest.h" +#include "platform/loader/fetch/Resource.h" +#include "platform/loader/fetch/ResourceLoaderOptions.h" +#include "platform/loader/fetch/SubstituteData.h" #include "platform/network/ResourceError.h" #include "platform/network/ResourceLoadPriority.h" #include "wtf/HashMap.h" @@ -59,7 +59,7 @@ // to ResourceFetcher for their lifetime (and will create one if they are // initialized without a LocalFrame), so a Document can keep a ResourceFetcher // alive past detach if scripts still reference the Document. -class CORE_EXPORT ResourceFetcher +class PLATFORM_EXPORT ResourceFetcher : public GarbageCollectedFinalized<ResourceFetcher> { WTF_MAKE_NONCOPYABLE(ResourceFetcher); USING_PRE_FINALIZER(ResourceFetcher, clearPreloads);
diff --git a/third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp b/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcherTest.cpp similarity index 97% rename from third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp rename to third_party/WebKit/Source/platform/loader/fetch/ResourceFetcherTest.cpp index ed12b64..6c21954 100644 --- a/third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp +++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcherTest.cpp
@@ -28,23 +28,23 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "core/fetch/ResourceFetcher.h" +#include "platform/loader/fetch/ResourceFetcher.h" -#include "core/fetch/FetchInitiatorInfo.h" -#include "core/fetch/FetchInitiatorTypeNames.h" -#include "core/fetch/FetchRequest.h" -#include "core/fetch/FetchTestingPlatformSupport.h" -#include "core/fetch/MemoryCache.h" -#include "core/fetch/MockFetchContext.h" -#include "core/fetch/MockResource.h" -#include "core/fetch/MockResourceClient.h" -#include "core/fetch/RawResource.h" -#include "core/fetch/ResourceLoader.h" #include "platform/WebTaskRunner.h" #include "platform/exported/WrappedResourceResponse.h" #include "platform/heap/Handle.h" #include "platform/heap/HeapAllocator.h" #include "platform/heap/Member.h" +#include "platform/loader/fetch/FetchInitiatorInfo.h" +#include "platform/loader/fetch/FetchInitiatorTypeNames.h" +#include "platform/loader/fetch/FetchRequest.h" +#include "platform/loader/fetch/FetchTestingPlatformSupport.h" +#include "platform/loader/fetch/MemoryCache.h" +#include "platform/loader/fetch/MockFetchContext.h" +#include "platform/loader/fetch/MockResource.h" +#include "platform/loader/fetch/MockResourceClient.h" +#include "platform/loader/fetch/RawResource.h" +#include "platform/loader/fetch/ResourceLoader.h" #include "platform/network/ResourceError.h" #include "platform/network/ResourceRequest.h" #include "platform/network/ResourceTimingInfo.h"
diff --git a/third_party/WebKit/Source/core/fetch/ResourceLoader.cpp b/third_party/WebKit/Source/platform/loader/fetch/ResourceLoader.cpp similarity index 98% rename from third_party/WebKit/Source/core/fetch/ResourceLoader.cpp rename to third_party/WebKit/Source/platform/loader/fetch/ResourceLoader.cpp index 7f11fb7e..510afc9 100644 --- a/third_party/WebKit/Source/core/fetch/ResourceLoader.cpp +++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceLoader.cpp
@@ -27,15 +27,15 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "core/fetch/ResourceLoader.h" +#include "platform/loader/fetch/ResourceLoader.h" -#include "core/fetch/CrossOriginAccessControl.h" -#include "core/fetch/FetchContext.h" -#include "core/fetch/Resource.h" -#include "core/fetch/ResourceFetcher.h" #include "platform/SharedBuffer.h" #include "platform/exported/WrappedResourceRequest.h" #include "platform/exported/WrappedResourceResponse.h" +#include "platform/loader/fetch/CrossOriginAccessControl.h" +#include "platform/loader/fetch/FetchContext.h" +#include "platform/loader/fetch/Resource.h" +#include "platform/loader/fetch/ResourceFetcher.h" #include "platform/network/NetworkInstrumentation.h" #include "platform/network/ResourceError.h" #include "public/platform/Platform.h" @@ -135,9 +135,10 @@ ResourceRequestBlockedReason blockedReason) { m_resource->willNotFollowRedirect(); - if (m_loader) + if (m_loader) { handleError( ResourceError::cancelledDueToAccessCheckError(newURL, blockedReason)); + } } static bool isManualRedirectFetchRequest(const ResourceRequest& request) {
diff --git a/third_party/WebKit/Source/core/fetch/ResourceLoader.h b/third_party/WebKit/Source/platform/loader/fetch/ResourceLoader.h similarity index 97% rename from third_party/WebKit/Source/core/fetch/ResourceLoader.h rename to third_party/WebKit/Source/platform/loader/fetch/ResourceLoader.h index c8f0261..57895587 100644 --- a/third_party/WebKit/Source/core/fetch/ResourceLoader.h +++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceLoader.h
@@ -29,8 +29,8 @@ #ifndef ResourceLoader_h #define ResourceLoader_h -#include "core/CoreExport.h" -#include "core/fetch/ResourceLoaderOptions.h" +#include "platform/PlatformExport.h" +#include "platform/loader/fetch/ResourceLoaderOptions.h" #include "platform/network/ResourceRequest.h" #include "public/platform/WebURLLoader.h" #include "public/platform/WebURLLoaderClient.h" @@ -48,7 +48,7 @@ // needs to load the specified resource. A ResourceLoader creates a // WebURLLoader and loads the resource using it. Any per-load logic should be // implemented in this class basically. -class CORE_EXPORT ResourceLoader final +class PLATFORM_EXPORT ResourceLoader final : public GarbageCollectedFinalized<ResourceLoader>, protected WebURLLoaderClient { USING_PRE_FINALIZER(ResourceLoader, dispose);
diff --git a/third_party/WebKit/Source/core/fetch/ResourceLoaderOptions.h b/third_party/WebKit/Source/platform/loader/fetch/ResourceLoaderOptions.h similarity index 98% rename from third_party/WebKit/Source/core/fetch/ResourceLoaderOptions.h rename to third_party/WebKit/Source/platform/loader/fetch/ResourceLoaderOptions.h index 6da7bee..2e6cb0b6 100644 --- a/third_party/WebKit/Source/core/fetch/ResourceLoaderOptions.h +++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceLoaderOptions.h
@@ -31,9 +31,9 @@ #ifndef ResourceLoaderOptions_h #define ResourceLoaderOptions_h -#include "core/fetch/FetchInitiatorInfo.h" -#include "core/fetch/IntegrityMetadata.h" #include "platform/CrossThreadCopier.h" +#include "platform/loader/fetch/FetchInitiatorInfo.h" +#include "platform/loader/fetch/IntegrityMetadata.h" #include "platform/weborigin/SecurityOrigin.h" #include "wtf/Allocator.h"
diff --git a/third_party/WebKit/Source/core/fetch/ResourceLoaderOptionsTest.cpp b/third_party/WebKit/Source/platform/loader/fetch/ResourceLoaderOptionsTest.cpp similarity index 98% rename from third_party/WebKit/Source/core/fetch/ResourceLoaderOptionsTest.cpp rename to third_party/WebKit/Source/platform/loader/fetch/ResourceLoaderOptionsTest.cpp index 1ad930e..6d9f6464 100644 --- a/third_party/WebKit/Source/core/fetch/ResourceLoaderOptionsTest.cpp +++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceLoaderOptionsTest.cpp
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "core/fetch/ResourceLoaderOptions.h" +#include "platform/loader/fetch/ResourceLoaderOptions.h" #include "testing/gtest/include/gtest/gtest.h" #include <type_traits>
diff --git a/third_party/WebKit/Source/core/fetch/ResourceLoadingLog.h b/third_party/WebKit/Source/platform/loader/fetch/ResourceLoadingLog.h similarity index 100% rename from third_party/WebKit/Source/core/fetch/ResourceLoadingLog.h rename to third_party/WebKit/Source/platform/loader/fetch/ResourceLoadingLog.h
diff --git a/third_party/WebKit/Source/core/fetch/ResourceOwner.h b/third_party/WebKit/Source/platform/loader/fetch/ResourceOwner.h similarity index 98% rename from third_party/WebKit/Source/core/fetch/ResourceOwner.h rename to third_party/WebKit/Source/platform/loader/fetch/ResourceOwner.h index f22d61a..79f89c4 100644 --- a/third_party/WebKit/Source/core/fetch/ResourceOwner.h +++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceOwner.h
@@ -31,8 +31,8 @@ #ifndef ResourceOwner_h #define ResourceOwner_h -#include "core/fetch/Resource.h" #include "platform/heap/Handle.h" +#include "platform/loader/fetch/Resource.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/fetch/ResourceStatus.h b/third_party/WebKit/Source/platform/loader/fetch/ResourceStatus.h similarity index 100% rename from third_party/WebKit/Source/core/fetch/ResourceStatus.h rename to third_party/WebKit/Source/platform/loader/fetch/ResourceStatus.h
diff --git a/third_party/WebKit/Source/core/fetch/ResourceTest.cpp b/third_party/WebKit/Source/platform/loader/fetch/ResourceTest.cpp similarity index 92% rename from third_party/WebKit/Source/core/fetch/ResourceTest.cpp rename to third_party/WebKit/Source/platform/loader/fetch/ResourceTest.cpp index 5319046..a421b17 100644 --- a/third_party/WebKit/Source/core/fetch/ResourceTest.cpp +++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceTest.cpp
@@ -2,11 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "core/fetch/Resource.h" +#include "platform/loader/fetch/Resource.h" -#include "core/fetch/MemoryCache.h" -#include "core/fetch/RawResource.h" #include "platform/SharedBuffer.h" +#include "platform/loader/fetch/RawResource.h" #include "platform/network/ResourceRequest.h" #include "platform/network/ResourceResponse.h" #include "platform/testing/TestingPlatformSupport.h" @@ -19,7 +18,7 @@ namespace { -class MockPlatform final : public TestingPlatformSupport { +class MockPlatform final : public TestingPlatformSupportWithMockScheduler { public: MockPlatform() {} ~MockPlatform() override {} @@ -72,6 +71,7 @@ } TEST(ResourceTest, RevalidateWithFragment) { + ScopedTestingPlatformSupport<MockPlatform> mock; KURL url(ParsedURLString, "http://127.0.0.1:8000/foo.html"); ResourceResponse response; response.setURL(url);
diff --git a/third_party/WebKit/Source/core/fetch/SubstituteData.h b/third_party/WebKit/Source/platform/loader/fetch/SubstituteData.h similarity index 100% rename from third_party/WebKit/Source/core/fetch/SubstituteData.h rename to third_party/WebKit/Source/platform/loader/fetch/SubstituteData.h
diff --git a/third_party/WebKit/Source/core/fetch/UniqueIdentifier.cpp b/third_party/WebKit/Source/platform/loader/fetch/UniqueIdentifier.cpp similarity index 96% rename from third_party/WebKit/Source/core/fetch/UniqueIdentifier.cpp rename to third_party/WebKit/Source/platform/loader/fetch/UniqueIdentifier.cpp index 42db565f..783b5c9 100644 --- a/third_party/WebKit/Source/core/fetch/UniqueIdentifier.cpp +++ b/third_party/WebKit/Source/platform/loader/fetch/UniqueIdentifier.cpp
@@ -28,7 +28,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "core/fetch/UniqueIdentifier.h" +#include "platform/loader/fetch/UniqueIdentifier.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/fetch/UniqueIdentifier.h b/third_party/WebKit/Source/platform/loader/fetch/UniqueIdentifier.h similarity index 94% rename from third_party/WebKit/Source/core/fetch/UniqueIdentifier.h rename to third_party/WebKit/Source/platform/loader/fetch/UniqueIdentifier.h index d6a3eb4..15c4071 100644 --- a/third_party/WebKit/Source/core/fetch/UniqueIdentifier.h +++ b/third_party/WebKit/Source/platform/loader/fetch/UniqueIdentifier.h
@@ -31,11 +31,11 @@ #ifndef UniqueIdentifier_h #define UniqueIdentifier_h -#include "core/CoreExport.h" +#include "platform/PlatformExport.h" namespace blink { -CORE_EXPORT unsigned long createUniqueIdentifier(); +PLATFORM_EXPORT unsigned long createUniqueIdentifier(); } #endif // UniqueIdentifier_h
diff --git a/third_party/WebKit/Source/platform/testing/TestingPlatformSupport.cpp b/third_party/WebKit/Source/platform/testing/TestingPlatformSupport.cpp index 9fea2de..75d00bb4 100644 --- a/third_party/WebKit/Source/platform/testing/TestingPlatformSupport.cpp +++ b/third_party/WebKit/Source/platform/testing/TestingPlatformSupport.cpp
@@ -42,6 +42,7 @@ #include "mojo/public/cpp/bindings/strong_binding.h" #include "platform/HTTPNames.h" #include "platform/heap/Heap.h" +#include "platform/loader/fetch/FetchInitiatorTypeNames.h" #include "platform/network/mime/MockMimeRegistry.h" #include "platform/scheduler/base/real_time_domain.h" #include "platform/scheduler/base/task_queue_manager.h" @@ -342,6 +343,7 @@ ThreadState::current()->registerTraceDOMWrappers(nullptr, nullptr, nullptr, nullptr); HTTPNames::init(); + FetchInitiatorTypeNames::init(); } ScopedUnittestsEnvironmentSetup::~ScopedUnittestsEnvironmentSetup() {}
diff --git a/third_party/WebKit/Source/web/DevToolsEmulator.cpp b/third_party/WebKit/Source/web/DevToolsEmulator.cpp index 034223d..01dfa57 100644 --- a/third_party/WebKit/Source/web/DevToolsEmulator.cpp +++ b/third_party/WebKit/Source/web/DevToolsEmulator.cpp
@@ -4,7 +4,6 @@ #include "web/DevToolsEmulator.h" -#include "core/fetch/MemoryCache.h" #include "core/frame/FrameHost.h" #include "core/frame/FrameView.h" #include "core/frame/Settings.h" @@ -17,6 +16,7 @@ #include "platform/geometry/FloatSize.h" #include "platform/geometry/IntRect.h" #include "platform/geometry/IntSize.h" +#include "platform/loader/fetch/MemoryCache.h" #include "public/platform/WebLayerTreeView.h" #include "web/WebInputEventConversion.h" #include "web/WebLocalFrameImpl.h"
diff --git a/third_party/WebKit/Source/web/WebAssociatedURLLoaderImpl.cpp b/third_party/WebKit/Source/web/WebAssociatedURLLoaderImpl.cpp index b1d7d04..655baed 100644 --- a/third_party/WebKit/Source/web/WebAssociatedURLLoaderImpl.cpp +++ b/third_party/WebKit/Source/web/WebAssociatedURLLoaderImpl.cpp
@@ -32,13 +32,13 @@ #include "core/dom/ContextLifecycleObserver.h" #include "core/dom/TaskRunnerHelper.h" -#include "core/fetch/CrossOriginAccessControl.h" -#include "core/fetch/FetchUtils.h" #include "core/loader/DocumentThreadableLoader.h" #include "core/loader/DocumentThreadableLoaderClient.h" #include "platform/Timer.h" #include "platform/exported/WrappedResourceRequest.h" #include "platform/exported/WrappedResourceResponse.h" +#include "platform/loader/fetch/CrossOriginAccessControl.h" +#include "platform/loader/fetch/FetchUtils.h" #include "platform/network/HTTPParsers.h" #include "platform/network/ResourceError.h" #include "public/platform/WebHTTPHeaderVisitor.h"
diff --git a/third_party/WebKit/Source/web/WebCache.cpp b/third_party/WebKit/Source/web/WebCache.cpp index 40ed9b9..0bcfc6a 100644 --- a/third_party/WebKit/Source/web/WebCache.cpp +++ b/third_party/WebKit/Source/web/WebCache.cpp
@@ -30,7 +30,7 @@ #include "public/web/WebCache.h" -#include "core/fetch/MemoryCache.h" +#include "platform/loader/fetch/MemoryCache.h" namespace blink {
diff --git a/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp b/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp index 65d22d5..819b436 100644 --- a/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp +++ b/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp
@@ -34,7 +34,6 @@ #include "core/dom/Document.h" #include "core/dom/ExecutionContextTask.h" #include "core/dom/SecurityContext.h" -#include "core/fetch/SubstituteData.h" #include "core/frame/csp/ContentSecurityPolicy.h" #include "core/inspector/ConsoleMessage.h" #include "core/inspector/InspectorInstrumentation.h" @@ -51,6 +50,7 @@ #include "platform/Histogram.h" #include "platform/SharedBuffer.h" #include "platform/heap/Handle.h" +#include "platform/loader/fetch/SubstituteData.h" #include "platform/network/ContentSecurityPolicyParsers.h" #include "platform/network/ContentSecurityPolicyResponseHeaders.h" #include "platform/network/NetworkUtils.h"
diff --git a/third_party/WebKit/Source/web/WebLeakDetector.cpp b/third_party/WebKit/Source/web/WebLeakDetector.cpp index 9775d1fc..9efed05 100644 --- a/third_party/WebKit/Source/web/WebLeakDetector.cpp +++ b/third_party/WebKit/Source/web/WebLeakDetector.cpp
@@ -33,12 +33,12 @@ #include "bindings/core/v8/V8GCController.h" #include "core/editing/spellcheck/IdleSpellCheckCallback.h" #include "core/editing/spellcheck/SpellChecker.h" -#include "core/fetch/MemoryCache.h" #include "core/workers/InProcessWorkerMessagingProxy.h" #include "core/workers/WorkerThread.h" #include "modules/compositorworker/AbstractAnimationWorkletThread.h" #include "platform/InstanceCounters.h" #include "platform/Timer.h" +#include "platform/loader/fetch/MemoryCache.h" #include "public/platform/Platform.h" #include "public/platform/WebThread.h" #include "public/web/WebFrame.h"
diff --git a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp index 42ae88e..b3cac00 100644 --- a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp +++ b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
@@ -114,8 +114,6 @@ #include "core/editing/iterators/TextIterator.h" #include "core/editing/serializers/Serialization.h" #include "core/editing/spellcheck/SpellChecker.h" -#include "core/fetch/ResourceFetcher.h" -#include "core/fetch/SubstituteData.h" #include "core/frame/FrameHost.h" #include "core/frame/FrameView.h" #include "core/frame/LocalDOMWindow.h" @@ -172,6 +170,8 @@ #include "platform/graphics/skia/SkiaUtils.h" #include "platform/heap/Handle.h" #include "platform/instrumentation/tracing/TraceEvent.h" +#include "platform/loader/fetch/ResourceFetcher.h" +#include "platform/loader/fetch/SubstituteData.h" #include "platform/network/ResourceRequest.h" #include "platform/scroll/ScrollTypes.h" #include "platform/scroll/ScrollbarTheme.h"
diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp index 5aefab4..92cc431 100644 --- a/third_party/WebKit/Source/web/WebViewImpl.cpp +++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
@@ -49,7 +49,6 @@ #include "core/events/KeyboardEvent.h" #include "core/events/UIEventWithKeyState.h" #include "core/events/WheelEvent.h" -#include "core/fetch/UniqueIdentifier.h" #include "core/frame/BrowserControls.h" #include "core/frame/EventHandlerRegistry.h" #include "core/frame/FrameHost.h" @@ -115,6 +114,7 @@ #include "platform/graphics/paint/DrawingRecorder.h" #include "platform/image-decoders/ImageDecoder.h" #include "platform/instrumentation/tracing/TraceEvent.h" +#include "platform/loader/fetch/UniqueIdentifier.h" #include "platform/scroll/ScrollbarTheme.h" #include "platform/weborigin/SchemeRegistry.h" #include "public/platform/Platform.h"
diff --git a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp index 921bd1f..4f486737 100644 --- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp +++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
@@ -50,9 +50,6 @@ #include "core/editing/markers/DocumentMarkerController.h" #include "core/editing/spellcheck/SpellChecker.h" #include "core/events/MouseEvent.h" -#include "core/fetch/FetchRequest.h" -#include "core/fetch/MemoryCache.h" -#include "core/fetch/ResourceFetcher.h" #include "core/frame/FrameHost.h" #include "core/frame/FrameView.h" #include "core/frame/LocalFrame.h" @@ -87,6 +84,9 @@ #include "platform/RuntimeEnabledFeatures.h" #include "platform/UserGestureIndicator.h" #include "platform/geometry/FloatRect.h" +#include "platform/loader/fetch/FetchRequest.h" +#include "platform/loader/fetch/MemoryCache.h" +#include "platform/loader/fetch/ResourceFetcher.h" #include "platform/network/ResourceError.h" #include "platform/scroll/Scrollbar.h" #include "platform/scroll/ScrollbarTestSuite.h"
diff --git a/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp b/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp index a6104a01..eced8e2d 100644 --- a/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp +++ b/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp
@@ -488,6 +488,15 @@ return IsBlacklistedMethod(Node); } +bool IsKnownTraitName(clang::StringRef name) { + // This set of names is globally a type trait throughout chromium. + return name == "safeToCompareToEmptyOrDeleted"; +} + +AST_MATCHER(clang::VarDecl, isKnownTraitName) { + return IsKnownTraitName(Node.getName()); +} + // Helper to convert from a camelCaseName to camel_case_name. It uses some // heuristics to try to handle acronyms in camel case names correctly. std::string CamelCaseToUnderscoreCase(StringRef input) { @@ -718,6 +727,7 @@ bool GetNameForDecl(const clang::FunctionDecl& decl, clang::ASTContext& context, + bool for_type_trait, std::string& name) { name = decl.getName().str(); name[0] = clang::toUppercase(name[0]); @@ -765,6 +775,7 @@ bool GetNameForDecl(const clang::EnumConstantDecl& decl, clang::ASTContext& context, + bool for_type_trait, std::string& name) { StringRef original_name = decl.getName(); @@ -792,6 +803,7 @@ bool GetNameForDecl(const clang::FieldDecl& decl, clang::ASTContext& context, + bool for_type_trait, std::string& name) { StringRef original_name = decl.getName(); bool member_prefix = original_name.startswith(kBlinkFieldPrefix); @@ -811,6 +823,7 @@ bool GetNameForDecl(const clang::VarDecl& decl, clang::ASTContext& context, + bool for_type_trait, std::string& name) { StringRef original_name = decl.getName(); @@ -846,6 +859,13 @@ else if (original_name.startswith(kBlinkFieldPrefix)) original_name = original_name.substr(strlen(kBlinkFieldPrefix)); + // Type traits are written in_this_form rather than kInThisForm and not like + // members. + if (for_type_trait) { + name = CamelCaseToUnderscoreCase(original_name); + return true; + } + bool is_const = IsProbablyConst(decl, context); if (is_const) { // Don't try to rename constants that already conform to Chrome style. @@ -884,31 +904,34 @@ bool GetNameForDecl(const clang::FunctionTemplateDecl& decl, clang::ASTContext& context, + bool for_type_trait, std::string& name) { clang::FunctionDecl* templated_function = decl.getTemplatedDecl(); - return GetNameForDecl(*templated_function, context, name); + return GetNameForDecl(*templated_function, context, for_type_trait, name); } bool GetNameForDecl(const clang::NamedDecl& decl, clang::ASTContext& context, + bool for_type_trait, std::string& name) { if (auto* function = clang::dyn_cast<clang::FunctionDecl>(&decl)) - return GetNameForDecl(*function, context, name); + return GetNameForDecl(*function, context, for_type_trait, name); if (auto* var = clang::dyn_cast<clang::VarDecl>(&decl)) - return GetNameForDecl(*var, context, name); + return GetNameForDecl(*var, context, for_type_trait, name); if (auto* field = clang::dyn_cast<clang::FieldDecl>(&decl)) - return GetNameForDecl(*field, context, name); + return GetNameForDecl(*field, context, for_type_trait, name); if (auto* function_template = clang::dyn_cast<clang::FunctionTemplateDecl>(&decl)) - return GetNameForDecl(*function_template, context, name); + return GetNameForDecl(*function_template, context, for_type_trait, name); if (auto* enumc = clang::dyn_cast<clang::EnumConstantDecl>(&decl)) - return GetNameForDecl(*enumc, context, name); + return GetNameForDecl(*enumc, context, for_type_trait, name); return false; } bool GetNameForDecl(const clang::UsingDecl& decl, clang::ASTContext& context, + bool for_type_trait, std::string& name) { assert(decl.shadow_size() > 0); @@ -916,7 +939,8 @@ // functions, it can introduce multiple shadowed declarations. Just using the // first one is OK, since overloaded functions have the same name, by // definition. - return GetNameForDecl(*decl.shadow_begin()->getTargetDecl(), context, name); + return GetNameForDecl(*decl.shadow_begin()->getTargetDecl(), context, + for_type_trait, name); } template <typename Type> @@ -1121,7 +1145,7 @@ // Get the new name. std::string new_name; - if (!GetNameForDecl(*decl, *result.Context, new_name)) + if (!GetNameForDecl(*decl, *result.Context, for_type_traits_, new_name)) return; // If false, the name was not suitable for renaming. // Check if we are able to rewrite the decl (to avoid rewriting if the @@ -1134,6 +1158,11 @@ Base::AddReplacement(result, old_name, std::move(new_name)); } + + void set_for_type_traits(bool set) { for_type_traits_ = set; } + + protected: + bool for_type_traits_ = false; }; using FieldDeclRewriter = DeclRewriterBase<clang::FieldDecl, clang::NamedDecl>; @@ -1460,14 +1489,16 @@ // }; // matches |x|, |y|, and |VALUE|. auto field_decl_matcher = id("decl", fieldDecl(in_blink_namespace)); - auto is_type_trait_value = - varDecl(hasName("value"), hasStaticStorageDuration(), isPublic(), - hasType(isConstQualified()), - hasType(type(anyOf(builtinType(), enumType()))), - unless(hasAncestor(recordDecl( - has(cxxMethodDecl(isUserProvided(), isInstanceMethod())))))); + auto is_type_trait_value = varDecl( + anyOf(hasName("value"), isKnownTraitName()), hasStaticStorageDuration(), + isPublic(), hasType(isConstQualified()), + hasType(type(anyOf(builtinType(), enumType()))), + unless(hasAncestor(recordDecl( + has(cxxMethodDecl(isUserProvided(), isInstanceMethod())))))); auto var_decl_matcher = id("decl", varDecl(in_blink_namespace, unless(is_type_trait_value))); + auto type_trait_matcher = + id("decl", varDecl(is_type_trait_value, unless(hasName("value")))); auto enum_member_decl_matcher = id("decl", enumConstantDecl(in_blink_namespace)); @@ -1477,6 +1508,10 @@ VarDeclRewriter var_decl_rewriter(&replacements); match_finder.addMatcher(var_decl_matcher, &var_decl_rewriter); + VarDeclRewriter type_trait_rewriter(&replacements); + type_trait_rewriter.set_for_type_traits(true); + match_finder.addMatcher(type_trait_matcher, &type_trait_rewriter); + EnumConstantDeclRewriter enum_member_decl_rewriter(&replacements); match_finder.addMatcher(enum_member_decl_matcher, &enum_member_decl_rewriter);
diff --git a/tools/clang/rewrite_to_chrome_style/tests/fields-expected.cc b/tools/clang/rewrite_to_chrome_style/tests/fields-expected.cc index e59d5328..89bc554 100644 --- a/tools/clang/rewrite_to_chrome_style/tests/fields-expected.cc +++ b/tools/clang/rewrite_to_chrome_style/tests/fields-expected.cc
@@ -68,10 +68,22 @@ // https://crbug.com/640749#c1: Some type traits are inside blink namespace. struct IsGarbageCollectedMixin { static const bool value = true; + static const bool safe_to_compare_to_empty_or_deleted = false; }; } // namespace blink +namespace not_blink { + +// These are traits for WTF types that may be defined outside of blink such +// as in mojo. But their names are unique so we can globally treat them as +// type traits for renaming. +struct GloballyKnownTraits { + static const bool safe_to_compare_to_empty_or_deleted = false; +}; + +} // namespace not_blink + namespace WTF { // We don't want to capitalize fields in type traits
diff --git a/tools/clang/rewrite_to_chrome_style/tests/fields-original.cc b/tools/clang/rewrite_to_chrome_style/tests/fields-original.cc index d2c1b4d..5f0fda0 100644 --- a/tools/clang/rewrite_to_chrome_style/tests/fields-original.cc +++ b/tools/clang/rewrite_to_chrome_style/tests/fields-original.cc
@@ -65,10 +65,22 @@ // https://crbug.com/640749#c1: Some type traits are inside blink namespace. struct IsGarbageCollectedMixin { static const bool value = true; + static const bool safeToCompareToEmptyOrDeleted = false; }; } // namespace blink +namespace not_blink { + +// These are traits for WTF types that may be defined outside of blink such +// as in mojo. But their names are unique so we can globally treat them as +// type traits for renaming. +struct GloballyKnownTraits { + static const bool safeToCompareToEmptyOrDeleted = false; +}; + +} // namespace not_blink + namespace WTF { // We don't want to capitalize fields in type traits
diff --git a/ui/arc/notification/arc_custom_notification_view.cc b/ui/arc/notification/arc_custom_notification_view.cc index 8e33e369..027fd2a0 100644 --- a/ui/arc/notification/arc_custom_notification_view.cc +++ b/ui/arc/notification/arc_custom_notification_view.cc
@@ -259,7 +259,10 @@ } void ArcCustomNotificationView::CreateFloatingCloseButton() { - if (!surface_) + // Floating close button is a transient child of |surface_| and also part + // of the hosting widget's focus chain. It could only be created when both + // are present. + if (!surface_ || !GetWidget()) return; floating_close_button_ = new CloseButton(this); @@ -301,9 +304,6 @@ if (GetWidget()) AttachSurface(); - - if (item_) - UpdatePinnedState(); } } @@ -377,6 +377,11 @@ // Invokes Update() in case surface is attached during a slide. slide_helper_->Update(); + + // Updates pinned state to create or destroy the floating close button + // after |surface_| is attached to a widget. + if (item_) + UpdatePinnedState(); } void ArcCustomNotificationView::ViewHierarchyChanged(
diff --git a/ui/gfx/BUILD.gn b/ui/gfx/BUILD.gn index f1fdaa7c..461a41e0 100644 --- a/ui/gfx/BUILD.gn +++ b/ui/gfx/BUILD.gn
@@ -119,7 +119,6 @@ "image/image_util.cc", "image/image_util.h", "image/image_util_ios.mm", - "image/image_util_mac.mm", "interpolated_transform.cc", "interpolated_transform.h", "ios/NSString+CrStringDrawing.h",
diff --git a/ui/gfx/image/image_util.cc b/ui/gfx/image/image_util.cc index 3fca705a..d0d79b2 100644 --- a/ui/gfx/image/image_util.cc +++ b/ui/gfx/image/image_util.cc
@@ -44,18 +44,8 @@ return Image(); } -// The MacOS implementation of this function is in image_utils_mac.mm. -#if !defined(OS_MACOSX) -bool JPEG1xEncodedDataFromImage(const Image& image, - int quality, +bool JPEG1xEncodedDataFromImage(const Image& image, int quality, std::vector<unsigned char>* dst) { - return JPEG1xEncodedDataFromSkiaRepresentation(image, quality, dst); -} -#endif // !defined(OS_MACOSX) - -bool JPEG1xEncodedDataFromSkiaRepresentation(const Image& image, - int quality, - std::vector<unsigned char>* dst) { const gfx::ImageSkiaRep& image_skia_rep = image.AsImageSkia().GetRepresentation(1.0f); if (image_skia_rep.scale() != 1.0f)
diff --git a/ui/gfx/image/image_util.h b/ui/gfx/image/image_util.h index cee54a3..8f17c368 100644 --- a/ui/gfx/image/image_util.h +++ b/ui/gfx/image/image_util.h
@@ -33,10 +33,6 @@ int quality, std::vector<unsigned char>* dst); -bool JPEG1xEncodedDataFromSkiaRepresentation(const Image& image, - int quality, - std::vector<unsigned char>* dst); - // Computes the width of any nearly-transparent regions at the sides of the // image and returns them in |left| and |right|. This checks each column of // pixels from the outsides in, looking for anything with alpha above a
diff --git a/ui/gfx/image/image_util_mac.mm b/ui/gfx/image/image_util_mac.mm deleted file mode 100644 index 5be20b0..0000000 --- a/ui/gfx/image/image_util_mac.mm +++ /dev/null
@@ -1,40 +0,0 @@ -// Copyright (c) 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "ui/gfx/image/image_util.h" - -#import <Cocoa/Cocoa.h> - -#include "base/mac/scoped_nsobject.h" -#include "ui/gfx/image/image.h" - -namespace gfx { - -bool JPEG1xEncodedDataFromImage(const Image& image, - int quality, - std::vector<unsigned char>* dst) { - if (!image.HasRepresentation(gfx::Image::kImageRepCocoa)) - return JPEG1xEncodedDataFromSkiaRepresentation(image, quality, dst); - - NSImage* nsImage = image.ToNSImage(); - - CGImageRef cgImage = - [nsImage CGImageForProposedRect:nil context:nil hints:nil]; - base::scoped_nsobject<NSBitmapImageRep> rep( - [[NSBitmapImageRep alloc] initWithCGImage:cgImage]); - - float compressionFactor = quality / 100.0; - NSDictionary* options = @{ NSImageCompressionFactor : @(compressionFactor)}; - NSData* data = - [rep representationUsingType:NSJPEGFileType properties:options]; - - if ([data length] == 0) - return false; - - dst->resize([data length]); - [data getBytes:&dst->at(0) length:[data length]]; - return true; -} - -} // end namespace gfx
diff --git a/ui/snapshot/BUILD.gn b/ui/snapshot/BUILD.gn index 4685e1b..d6ae901 100644 --- a/ui/snapshot/BUILD.gn +++ b/ui/snapshot/BUILD.gn
@@ -10,7 +10,6 @@ "screenshot_grabber.cc", "screenshot_grabber.h", "screenshot_grabber_observer.h", - "snapshot.cc", "snapshot.h", "snapshot_android.cc", "snapshot_async.cc", @@ -85,7 +84,6 @@ "//ui/base", "//ui/compositor:test_support", "//ui/gfx", - "//ui/gfx:test_support", "//ui/gfx/geometry", "//ui/gl", ]
diff --git a/ui/snapshot/screenshot_grabber.cc b/ui/snapshot/screenshot_grabber.cc index da79cb2..02e91df 100644 --- a/ui/snapshot/screenshot_grabber.cc +++ b/ui/snapshot/screenshot_grabber.cc
@@ -43,7 +43,7 @@ void SaveScreenshot(scoped_refptr<base::TaskRunner> ui_task_runner, const ShowNotificationCallback& callback, const base::FilePath& screenshot_path, - scoped_refptr<base::RefCountedMemory> png_data, + scoped_refptr<base::RefCountedBytes> png_data, ScreenshotGrabberDelegate::FileResult result, const base::FilePath& local_path) { DCHECK(!base::MessageLoopForUI::IsCurrent()); @@ -57,7 +57,7 @@ // Successfully got a local file to write to, write png data. DCHECK_GT(static_cast<int>(png_data->size()), 0); if (static_cast<size_t>(base::WriteFile( - local_path, reinterpret_cast<const char*>(png_data->front()), + local_path, reinterpret_cast<char*>(&(png_data->data()[0])), static_cast<int>(png_data->size()))) != png_data->size()) { LOG(ERROR) << "Failed to save to " << local_path.value(); screenshot_result = @@ -168,7 +168,7 @@ cursor_hider_ = ScopedCursorHider::Create(aura_window->GetRootWindow()); #endif - ui::GrabWindowSnapshotAsyncPNG( + ui::GrabWindowSnapshotAsync( window, rect, blocking_task_runner_, base::Bind(&ScreenshotGrabber::GrabWindowSnapshotAsyncCallback, factory_.GetWeakPtr(), window_identifier, screenshot_path, @@ -209,7 +209,7 @@ const std::string& window_identifier, base::FilePath screenshot_path, bool is_partial, - scoped_refptr<base::RefCountedMemory> png_data) { + scoped_refptr<base::RefCountedBytes> png_data) { DCHECK(base::MessageLoopForUI::IsCurrent()); if (!png_data.get()) { if (is_partial) {
diff --git a/ui/snapshot/screenshot_grabber.h b/ui/snapshot/screenshot_grabber.h index 7a0a947..555f863 100644 --- a/ui/snapshot/screenshot_grabber.h +++ b/ui/snapshot/screenshot_grabber.h
@@ -84,7 +84,7 @@ const std::string& window_identifier, base::FilePath screenshot_path, bool is_partial, - scoped_refptr<base::RefCountedMemory> png_data); + scoped_refptr<base::RefCountedBytes> png_data); // A weak pointer to the screenshot taker client. ScreenshotGrabberDelegate* client_;
diff --git a/ui/snapshot/snapshot.cc b/ui/snapshot/snapshot.cc deleted file mode 100644 index aaee01f1..0000000 --- a/ui/snapshot/snapshot.cc +++ /dev/null
@@ -1,41 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "ui/snapshot/snapshot.h" - -#include "base/bind.h" -#include "base/callback.h" -#include "base/task_runner_util.h" -#include "ui/gfx/image/image.h" - -namespace ui { - -namespace { - -scoped_refptr<base::RefCountedMemory> EncodeImage(const gfx::Image& image) { - return image.As1xPNGBytes(); -} - -void EncodeImageAndSchedulePNGCallback( - scoped_refptr<base::TaskRunner> background_task_runner, - const GrabWindowSnapshotAsyncPNGCallback& callback, - const gfx::Image& image) { - base::PostTaskAndReplyWithResult(background_task_runner.get(), FROM_HERE, - base::Bind(EncodeImage, image), callback); -} - -} // namespace - -void GrabWindowSnapshotAsyncPNG( - gfx::NativeWindow window, - const gfx::Rect& source_rect, - scoped_refptr<base::TaskRunner> background_task_runner, - const GrabWindowSnapshotAsyncPNGCallback& callback) { - GrabWindowSnapshotAsync( - window, source_rect, - base::Bind(EncodeImageAndSchedulePNGCallback, - std::move(background_task_runner), callback)); -} - -} // namespace ui
diff --git a/ui/snapshot/snapshot.h b/ui/snapshot/snapshot.h index 3c83a92..4b2733c 100644 --- a/ui/snapshot/snapshot.h +++ b/ui/snapshot/snapshot.h
@@ -31,13 +31,16 @@ // used in a result of user action. Support for async vs synchronous // GrabWindowSnapshot differs by platform. To be most general, use the // synchronous function first and if it returns false call the async one. -SNAPSHOT_EXPORT bool GrabWindowSnapshot(gfx::NativeWindow window, - const gfx::Rect& snapshot_bounds, - gfx::Image* image); +SNAPSHOT_EXPORT bool GrabWindowSnapshot( + gfx::NativeWindow window, + std::vector<unsigned char>* png_representation, + const gfx::Rect& snapshot_bounds); -SNAPSHOT_EXPORT bool GrabViewSnapshot(gfx::NativeView view, - const gfx::Rect& snapshot_bounds, - gfx::Image* image); +SNAPSHOT_EXPORT bool GrabViewSnapshot( + gfx::NativeView view, + std::vector<unsigned char>* png_representation, + const gfx::Rect& snapshot_bounds); + // These functions take a snapshot of |source_rect|, specified in layer space // coordinates (DIP for desktop, physical pixels for Android), and scale the @@ -51,21 +54,16 @@ scoped_refptr<base::TaskRunner> background_task_runner, const GrabWindowSnapshotAsyncCallback& callback); +typedef base::Callback<void(scoped_refptr<base::RefCountedBytes> png_data)> + GrabWindowSnapshotAsyncPNGCallback; SNAPSHOT_EXPORT void GrabWindowSnapshotAsync( gfx::NativeWindow window, const gfx::Rect& source_rect, - const GrabWindowSnapshotAsyncCallback& callback); - + scoped_refptr<base::TaskRunner> background_task_runner, + const GrabWindowSnapshotAsyncPNGCallback& callback); SNAPSHOT_EXPORT void GrabViewSnapshotAsync( gfx::NativeView view, const gfx::Rect& source_rect, - const GrabWindowSnapshotAsyncCallback& callback); - -typedef base::Callback<void(scoped_refptr<base::RefCountedMemory> png_data)> - GrabWindowSnapshotAsyncPNGCallback; -SNAPSHOT_EXPORT void GrabWindowSnapshotAsyncPNG( - gfx::NativeWindow window, - const gfx::Rect& source_rect, scoped_refptr<base::TaskRunner> background_task_runner, const GrabWindowSnapshotAsyncPNGCallback& callback);
diff --git a/ui/snapshot/snapshot_android.cc b/ui/snapshot/snapshot_android.cc index 3de1f5ad..f687aa2 100644 --- a/ui/snapshot/snapshot_android.cc +++ b/ui/snapshot/snapshot_android.cc
@@ -24,14 +24,15 @@ // Sync versions are not supported in Android. Callers should fall back // to the async version. bool GrabViewSnapshot(gfx::NativeView view, - const gfx::Rect& snapshot_bounds, - gfx::Image* image) { - return GrabWindowSnapshot(view->GetWindowAndroid(), snapshot_bounds, image); + std::vector<unsigned char>* png_representation, + const gfx::Rect& snapshot_bounds) { + return GrabWindowSnapshot( + view->GetWindowAndroid(), png_representation, snapshot_bounds); } bool GrabWindowSnapshot(gfx::NativeWindow window, - const gfx::Rect& snapshot_bounds, - gfx::Image* image) { + std::vector<unsigned char>* png_representation, + const gfx::Rect& snapshot_bounds) { return false; } @@ -63,20 +64,28 @@ background_task_runner)); } -void GrabWindowSnapshotAsync(gfx::NativeWindow window, - const gfx::Rect& source_rect, - const GrabWindowSnapshotAsyncCallback& callback) { - MakeAsyncCopyRequest( - window, source_rect, - base::Bind(&SnapshotAsync::RunCallbackWithCopyOutputResult, callback)); +void GrabWindowSnapshotAsync( + gfx::NativeWindow window, + const gfx::Rect& source_rect, + scoped_refptr<base::TaskRunner> background_task_runner, + const GrabWindowSnapshotAsyncPNGCallback& callback) { + MakeAsyncCopyRequest(window, + source_rect, + base::Bind(&SnapshotAsync::EncodeCopyOutputResult, + callback, + background_task_runner)); } -void GrabViewSnapshotAsync(gfx::NativeView view, - const gfx::Rect& source_rect, - const GrabWindowSnapshotAsyncCallback& callback) { - MakeAsyncCopyRequest( - view->GetWindowAndroid(), source_rect, - base::Bind(&SnapshotAsync::RunCallbackWithCopyOutputResult, callback)); +void GrabViewSnapshotAsync( + gfx::NativeView view, + const gfx::Rect& source_rect, + scoped_refptr<base::TaskRunner> background_task_runner, + const GrabWindowSnapshotAsyncPNGCallback& callback) { + MakeAsyncCopyRequest(view->GetWindowAndroid(), + source_rect, + base::Bind(&SnapshotAsync::EncodeCopyOutputResult, + callback, + background_task_runner)); } } // namespace ui
diff --git a/ui/snapshot/snapshot_async.cc b/ui/snapshot/snapshot_async.cc index 173f70a..a4f0eb0 100644 --- a/ui/snapshot/snapshot_async.cc +++ b/ui/snapshot/snapshot_async.cc
@@ -10,6 +10,8 @@ #include "base/task_runner_util.h" #include "skia/ext/image_operations.h" #include "third_party/skia/include/core/SkBitmap.h" +#include "third_party/skia/include/core/SkPixelRef.h" +#include "ui/gfx/codec/png_codec.h" #include "ui/gfx/image/image.h" #include "ui/gfx/image/image_skia.h" #include "ui/gfx/skbitmap_operations.h" @@ -32,6 +34,29 @@ static_cast<SkBitmap::Allocator*>(NULL)); } +scoped_refptr<base::RefCountedBytes> EncodeBitmap(const SkBitmap& bitmap) { + scoped_refptr<base::RefCountedBytes> png_data(new base::RefCountedBytes); + SkAutoLockPixels lock(bitmap); + unsigned char* pixels = reinterpret_cast<unsigned char*>(bitmap.getPixels()); +#if SK_A32_SHIFT == 24 && SK_R32_SHIFT == 16 && SK_G32_SHIFT == 8 + gfx::PNGCodec::ColorFormat kColorFormat = gfx::PNGCodec::FORMAT_BGRA; +#elif SK_A32_SHIFT == 24 && SK_B32_SHIFT == 16 && SK_G32_SHIFT == 8 + gfx::PNGCodec::ColorFormat kColorFormat = gfx::PNGCodec::FORMAT_RGBA; +#else +#error Unknown color format +#endif + if (!gfx::PNGCodec::Encode(pixels, + kColorFormat, + gfx::Size(bitmap.width(), bitmap.height()), + base::checked_cast<int>(bitmap.rowBytes()), + true, + std::vector<gfx::PNGCodec::Comment>(), + &png_data->data())) { + return scoped_refptr<base::RefCountedBytes>(); + } + return png_data; +} + } // namespace void SnapshotAsync::ScaleCopyOutputResult( @@ -55,15 +80,24 @@ base::Bind(&OnFrameScalingFinished, callback)); } -void SnapshotAsync::RunCallbackWithCopyOutputResult( - const GrabWindowSnapshotAsyncCallback& callback, +void SnapshotAsync::EncodeCopyOutputResult( + const GrabWindowSnapshotAsyncPNGCallback& callback, + scoped_refptr<base::TaskRunner> background_task_runner, std::unique_ptr<cc::CopyOutputResult> result) { if (result->IsEmpty()) { - callback.Run(gfx::Image()); + callback.Run(scoped_refptr<base::RefCountedBytes>()); return; } - callback.Run(gfx::Image::CreateFrom1xBitmap(*result->TakeBitmap())); + // TODO(sergeyu): Potentially images can be scaled on GPU before reading it + // from GPU. Image scaling is implemented in content::GlHelper, but it's can't + // be used here because it's not in content/public. Move the scaling code + // somewhere so that it can be reused here. + base::PostTaskAndReplyWithResult( + background_task_runner.get(), + FROM_HERE, + base::Bind(EncodeBitmap, *result->TakeBitmap()), + callback); } } // namespace ui
diff --git a/ui/snapshot/snapshot_async.h b/ui/snapshot/snapshot_async.h index 79928e0..364f76c2 100644 --- a/ui/snapshot/snapshot_async.h +++ b/ui/snapshot/snapshot_async.h
@@ -31,8 +31,9 @@ scoped_refptr<base::TaskRunner> background_task_runner, std::unique_ptr<cc::CopyOutputResult> result); - static void RunCallbackWithCopyOutputResult( - const GrabWindowSnapshotAsyncCallback& callback, + static void EncodeCopyOutputResult( + const GrabWindowSnapshotAsyncPNGCallback& callback, + scoped_refptr<base::TaskRunner> background_task_runner, std::unique_ptr<cc::CopyOutputResult> result); private:
diff --git a/ui/snapshot/snapshot_aura.cc b/ui/snapshot/snapshot_aura.cc index 0ff547c1..d2df3f08f 100644 --- a/ui/snapshot/snapshot_aura.cc +++ b/ui/snapshot/snapshot_aura.cc
@@ -22,14 +22,14 @@ namespace ui { bool GrabViewSnapshot(gfx::NativeView view, - const gfx::Rect& snapshot_bounds, - gfx::Image* image) { - return GrabWindowSnapshot(view, snapshot_bounds, image); + std::vector<unsigned char>* png_representation, + const gfx::Rect& snapshot_bounds) { + return GrabWindowSnapshot(view, png_representation, snapshot_bounds); } bool GrabWindowSnapshot(gfx::NativeWindow window, - const gfx::Rect& snapshot_bounds, - gfx::Image* image) { + std::vector<unsigned char>* png_representation, + const gfx::Rect& snapshot_bounds) { // Not supported in Aura. Callers should fall back to the async version. return false; } @@ -94,18 +94,22 @@ background_task_runner)); } -void GrabWindowSnapshotAsync(gfx::NativeWindow window, - const gfx::Rect& source_rect, - const GrabWindowSnapshotAsyncCallback& callback) { - MakeInitialAsyncCopyRequest( - window, source_rect, - base::Bind(&SnapshotAsync::RunCallbackWithCopyOutputResult, callback)); +void GrabWindowSnapshotAsync( + gfx::NativeWindow window, + const gfx::Rect& source_rect, + scoped_refptr<base::TaskRunner> background_task_runner, + const GrabWindowSnapshotAsyncPNGCallback& callback) { + MakeInitialAsyncCopyRequest(window, source_rect, + base::Bind(&SnapshotAsync::EncodeCopyOutputResult, + callback, background_task_runner)); } -void GrabViewSnapshotAsync(gfx::NativeView view, - const gfx::Rect& source_rect, - const GrabWindowSnapshotAsyncCallback& callback) { - GrabWindowSnapshotAsync(view, source_rect, callback); +void GrabViewSnapshotAsync( + gfx::NativeView view, + const gfx::Rect& source_rect, + scoped_refptr<base::TaskRunner> background_task_runner, + const GrabWindowSnapshotAsyncPNGCallback& callback) { + GrabWindowSnapshotAsync(view, source_rect, background_task_runner, callback); }
diff --git a/ui/snapshot/snapshot_aura_unittest.cc b/ui/snapshot/snapshot_aura_unittest.cc index 97d4ac44..984a231b 100644 --- a/ui/snapshot/snapshot_aura_unittest.cc +++ b/ui/snapshot/snapshot_aura_unittest.cc
@@ -141,14 +141,28 @@ aura::Window::ConvertRectToTarget( test_window(), root_window(), &source_rect); + scoped_refptr<base::TestSimpleTaskRunner> task_runner( + new base::TestSimpleTaskRunner()); scoped_refptr<SnapshotHolder> holder(new SnapshotHolder); ui::GrabWindowSnapshotAsync( - root_window(), source_rect, + root_window(), + source_rect, + task_runner, base::Bind(&SnapshotHolder::SnapshotCallback, holder)); - holder->WaitForSnapshot(); - DCHECK(holder->completed()); - return holder->image(); + // Wait for copy response. + WaitForDraw(); + // Run internal snapshot callback to scale/rotate response image. + task_runner->RunUntilIdle(); + // Run SnapshotHolder callback. + helper_->RunAllPendingInMessageLoop(); + + if (holder->completed()) + return holder->image(); + + // Callback never called. + NOTREACHED(); + return gfx::Image(); } private: @@ -156,13 +170,12 @@ public: SnapshotHolder() : completed_(false) {} - void SnapshotCallback(const gfx::Image& image) { + void SnapshotCallback(scoped_refptr<base::RefCountedBytes> png_data) { DCHECK(!completed_); - image_ = image; + image_ = gfx::Image::CreateFrom1xPNGBytes(&(png_data->data()[0]), + png_data->size()); completed_ = true; - run_loop_.Quit(); } - void WaitForSnapshot() { run_loop_.Run(); } bool completed() const { return completed_; }; @@ -173,7 +186,6 @@ virtual ~SnapshotHolder() {} - base::RunLoop run_loop_; gfx::Image image_; bool completed_; }; @@ -219,7 +231,7 @@ } TEST_F(SnapshotAuraTest, UIScale) { - const float kUIScale = 0.5f; + const float kUIScale = 1.25f; test_screen()->SetUIScale(kUIScale); gfx::Rect test_bounds(100, 100, 300, 200); @@ -228,12 +240,11 @@ // Snapshot always captures the physical pixels. gfx::SizeF snapshot_size(test_bounds.size()); - snapshot_size.Scale(1 / kUIScale); gfx::Image snapshot = GrabSnapshotForTestWindow(); EXPECT_EQ(gfx::ToRoundedSize(snapshot_size).ToString(), snapshot.Size().ToString()); - EXPECT_EQ(0u, GetFailedPixelsCountWithScaleFactor(snapshot, 1 / kUIScale)); + EXPECT_EQ(0u, GetFailedPixelsCount(snapshot)); } TEST_F(SnapshotAuraTest, DeviceScaleFactor) { @@ -254,7 +265,7 @@ } TEST_F(SnapshotAuraTest, RotateAndUIScale) { - const float kUIScale = 0.5f; + const float kUIScale = 1.25f; test_screen()->SetUIScale(kUIScale); test_screen()->SetDisplayRotation(display::Display::ROTATE_90); @@ -264,17 +275,16 @@ // Snapshot always captures the physical pixels. gfx::SizeF snapshot_size(test_bounds.size()); - snapshot_size.Scale(1 / kUIScale); gfx::Image snapshot = GrabSnapshotForTestWindow(); EXPECT_EQ(gfx::ToRoundedSize(snapshot_size).ToString(), snapshot.Size().ToString()); - EXPECT_EQ(0u, GetFailedPixelsCountWithScaleFactor(snapshot, 1 / kUIScale)); + EXPECT_EQ(0u, GetFailedPixelsCount(snapshot)); } TEST_F(SnapshotAuraTest, RotateAndUIScaleAndScaleFactor) { test_screen()->SetDeviceScaleFactor(2.0f); - const float kUIScale = 0.5f; + const float kUIScale = 1.25f; test_screen()->SetUIScale(kUIScale); test_screen()->SetDisplayRotation(display::Display::ROTATE_90); @@ -284,12 +294,12 @@ // Snapshot always captures the physical pixels. gfx::SizeF snapshot_size(test_bounds.size()); - snapshot_size.Scale(2.0f / kUIScale); + snapshot_size.Scale(2.0f); gfx::Image snapshot = GrabSnapshotForTestWindow(); EXPECT_EQ(gfx::ToRoundedSize(snapshot_size).ToString(), snapshot.Size().ToString()); - EXPECT_EQ(0u, GetFailedPixelsCountWithScaleFactor(snapshot, 2 / kUIScale)); + EXPECT_EQ(0u, GetFailedPixelsCountWithScaleFactor(snapshot, 2)); } } // namespace ui
diff --git a/ui/snapshot/snapshot_ios.mm b/ui/snapshot/snapshot_ios.mm index d239b71..d75f204 100644 --- a/ui/snapshot/snapshot_ios.mm +++ b/ui/snapshot/snapshot_ios.mm
@@ -11,15 +11,15 @@ namespace ui { bool GrabViewSnapshot(gfx::NativeView view, - const gfx::Rect& snapshot_bounds, - gfx::Image* image) { + std::vector<unsigned char>* png_representation, + const gfx::Rect& snapshot_bounds) { // TODO(bajones): Implement iOS snapshot functionality return false; } bool GrabWindowSnapshot(gfx::NativeWindow window, - const gfx::Rect& snapshot_bounds, - gfx::Image* image) { + std::vector<unsigned char>* png_representation, + const gfx::Rect& snapshot_bounds) { // TODO(bajones): Implement iOS snapshot functionality return false; } @@ -33,16 +33,20 @@ callback.Run(gfx::Image()); } -void GrabViewSnapshotAsync(gfx::NativeView view, - const gfx::Rect& source_rect, - const GrabWindowSnapshotAsyncCallback& callback) { - callback.Run(gfx::Image()); +void GrabViewSnapshotAsync( + gfx::NativeView view, + const gfx::Rect& source_rect, + scoped_refptr<base::TaskRunner> background_task_runner, + const GrabWindowSnapshotAsyncPNGCallback& callback) { + callback.Run(scoped_refptr<base::RefCountedBytes>()); } -void GrabWindowSnapshotAsync(gfx::NativeWindow window, - const gfx::Rect& source_rect, - const GrabWindowSnapshotAsyncCallback& callback) { - callback.Run(gfx::Image()); +void GrabWindowSnapshotAsync( + gfx::NativeWindow window, + const gfx::Rect& source_rect, + scoped_refptr<base::TaskRunner> background_task_runner, + const GrabWindowSnapshotAsyncPNGCallback& callback) { + callback.Run(scoped_refptr<base::RefCountedBytes>()); } } // namespace ui
diff --git a/ui/snapshot/snapshot_mac.mm b/ui/snapshot/snapshot_mac.mm index 40cfaaf..9761cb7 100644 --- a/ui/snapshot/snapshot_mac.mm +++ b/ui/snapshot/snapshot_mac.mm
@@ -9,6 +9,7 @@ #include "base/callback.h" #include "base/logging.h" #include "base/mac/scoped_cftyperef.h" +#include "base/mac/scoped_nsobject.h" #include "base/mac/sdk_forward_declarations.h" #include "base/task_runner.h" #include "ui/gfx/geometry/rect.h" @@ -17,8 +18,8 @@ namespace ui { bool GrabViewSnapshot(gfx::NativeView view, - const gfx::Rect& snapshot_bounds, - gfx::Image* image) { + std::vector<unsigned char>* png_representation, + const gfx::Rect& snapshot_bounds) { NSWindow* window = [view window]; NSScreen* screen = [[NSScreen screens] firstObject]; gfx::Rect screen_bounds = gfx::Rect(NSRectToCGRect([screen frame])); @@ -42,6 +43,8 @@ DCHECK_LE(screen_snapshot_bounds.right(), view_bounds.right()); DCHECK_LE(screen_snapshot_bounds.bottom(), view_bounds.bottom()); + png_representation->clear(); + base::ScopedCFTypeRef<CGImageRef> windowSnapshot( CGWindowListCreateImage(screen_snapshot_bounds.ToCGRect(), kCGWindowListOptionIncludingWindow, @@ -50,19 +53,27 @@ if (CGImageGetWidth(windowSnapshot) <= 0) return false; - NSImage* nsImage = - [[NSImage alloc] initWithCGImage:windowSnapshot size:NSZeroSize]; - *image = gfx::Image(nsImage); + base::scoped_nsobject<NSBitmapImageRep> rep( + [[NSBitmapImageRep alloc] initWithCGImage:windowSnapshot]); + NSData* data = [rep representationUsingType:NSPNGFileType properties:@{}]; + const unsigned char* buf = static_cast<const unsigned char*>([data bytes]); + NSUInteger length = [data length]; + if (buf == NULL || length == 0) + return false; + + png_representation->assign(buf, buf + length); + DCHECK(!png_representation->empty()); + return true; } bool GrabWindowSnapshot(gfx::NativeWindow window, - const gfx::Rect& snapshot_bounds, - gfx::Image* image) { + std::vector<unsigned char>* png_representation, + const gfx::Rect& snapshot_bounds) { // Make sure to grab the "window frame" view so we get current tab + // tabstrip. - return GrabViewSnapshot([[window contentView] superview], snapshot_bounds, - image); + return GrabViewSnapshot([[window contentView] superview], png_representation, + snapshot_bounds); } void GrabWindowSnapshotAndScaleAsync( @@ -74,17 +85,21 @@ callback.Run(gfx::Image()); } -void GrabViewSnapshotAsync(gfx::NativeView view, - const gfx::Rect& source_rect, - const GrabWindowSnapshotAsyncCallback& callback) { - callback.Run(gfx::Image()); +void GrabViewSnapshotAsync( + gfx::NativeView view, + const gfx::Rect& source_rect, + scoped_refptr<base::TaskRunner> background_task_runner, + const GrabWindowSnapshotAsyncPNGCallback& callback) { + callback.Run(scoped_refptr<base::RefCountedBytes>()); } -void GrabWindowSnapshotAsync(gfx::NativeWindow window, - const gfx::Rect& source_rect, - const GrabWindowSnapshotAsyncCallback& callback) { +void GrabWindowSnapshotAsync( + gfx::NativeWindow window, + const gfx::Rect& source_rect, + scoped_refptr<base::TaskRunner> background_task_runner, + const GrabWindowSnapshotAsyncPNGCallback& callback) { return GrabViewSnapshotAsync([[window contentView] superview], source_rect, - callback); + background_task_runner, callback); } } // namespace ui
diff --git a/ui/snapshot/snapshot_mac_unittest.mm b/ui/snapshot/snapshot_mac_unittest.mm index eea1067..d1d9250 100644 --- a/ui/snapshot/snapshot_mac_unittest.mm +++ b/ui/snapshot/snapshot_mac_unittest.mm
@@ -12,32 +12,34 @@ #include "base/mac/sdk_forward_declarations.h" #include "testing/platform_test.h" #include "ui/gfx/geometry/rect.h" -#include "ui/gfx/image/image.h" -#import "ui/gfx/test/ui_cocoa_test_helper.h" namespace ui { namespace { -typedef CocoaTest GrabWindowSnapshotTest; +typedef PlatformTest GrabWindowSnapshotTest; TEST_F(GrabWindowSnapshotTest, TestGrabWindowSnapshot) { // Launch a test window so we can take a snapshot. NSRect frame = NSMakeRect(0, 0, 400, 400); - NSWindow* window = test_window(); - [window setFrame:frame display:false]; + base::scoped_nsobject<NSWindow> window( + [[NSWindow alloc] initWithContentRect:frame + styleMask:NSBorderlessWindowMask + backing:NSBackingStoreBuffered + defer:NO]); [window setBackgroundColor:[NSColor whiteColor]]; [window makeKeyAndOrderFront:NSApp]; - [window display]; - gfx::Image image; + std::unique_ptr<std::vector<unsigned char>> png_representation( + new std::vector<unsigned char>); gfx::Rect bounds = gfx::Rect(0, 0, frame.size.width, frame.size.height); - EXPECT_TRUE(ui::GrabWindowSnapshot(window, bounds, &image)); + EXPECT_TRUE(ui::GrabWindowSnapshot(window, png_representation.get(), + bounds)); - NSImage* nsImage = image.ToNSImage(); - CGImageRef cgImage = - [nsImage CGImageForProposedRect:nil context:nil hints:nil]; - base::scoped_nsobject<NSBitmapImageRep> rep( - [[NSBitmapImageRep alloc] initWithCGImage:cgImage]); + // Copy png back into NSData object so we can make sure we grabbed a png. + base::scoped_nsobject<NSData> image_data( + [[NSData alloc] initWithBytes:&(*png_representation)[0] + length:png_representation->size()]); + NSBitmapImageRep* rep = [NSBitmapImageRep imageRepWithData:image_data.get()]; EXPECT_TRUE([rep isKindOfClass:[NSBitmapImageRep class]]); CGFloat scaleFactor = 1.0f; if ([window respondsToSelector:@selector(backingScaleFactor)])
diff --git a/ui/webui/resources/cr_elements/network/cr_network_icon.js b/ui/webui/resources/cr_elements/network/cr_network_icon.js index 75bbec19..1c4bd50 100644 --- a/ui/webui/resources/cr_elements/network/cr_network_icon.js +++ b/ui/webui/resources/cr_elements/network/cr_network_icon.js
@@ -84,14 +84,14 @@ * @private */ getTechnology_: function() { - let networkState = this.networkState; + var networkState = this.networkState; if (!networkState) return ''; - let type = networkState.Type; + var type = networkState.Type; if (type == CrOnc.Type.WI_MAX) return 'network:4g'; if (type == CrOnc.Type.CELLULAR && networkState.Cellular) { - let technology = + var technology = this.getTechnologyId_(networkState.Cellular.NetworkTechnology); if (technology != '') return 'network:' + technology; @@ -134,11 +134,11 @@ * @private */ showSecure_: function() { - let networkState = this.networkState; + var networkState = this.networkState; if (!this.networkState) return false; if (networkState.Type == CrOnc.Type.WI_FI && networkState.WiFi) { - let security = networkState.WiFi.Security; + var security = networkState.WiFi.Security; return !!security && security != 'None'; } return false;
diff --git a/ui/webui/resources/cr_elements/network/cr_network_list.js b/ui/webui/resources/cr_elements/network/cr_network_list.js index e5de1abd..26cddbe 100644 --- a/ui/webui/resources/cr_elements/network/cr_network_list.js +++ b/ui/webui/resources/cr_elements/network/cr_network_list.js
@@ -67,7 +67,7 @@ * @private */ getItems_: function() { - let customItems = this.customItems.slice(); + var customItems = this.customItems.slice(); // Flag the first custom item with isFirstCustomItem = true. if (customItems.length > 0) customItems[0].isFirstCustomItem = true;
diff --git a/ui/webui/resources/cr_elements/network/cr_network_list_item.js b/ui/webui/resources/cr_elements/network/cr_network_list_item.js index 8d3841d..a6946ca 100644 --- a/ui/webui/resources/cr_elements/network/cr_network_list_item.js +++ b/ui/webui/resources/cr_elements/network/cr_network_list_item.js
@@ -84,13 +84,13 @@ */ getItemName_: function() { if (this.item.hasOwnProperty('customItemName')) { - let item = /** @type {!CrNetworkList.CustomItemState} */ (this.item); - let name = item.customItemName || ''; + var item = /** @type {!CrNetworkList.CustomItemState} */ (this.item); + var name = item.customItemName || ''; if (CrOncStrings.hasOwnProperty(item.customItemName)) name = CrOncStrings[item.customItemName]; return name; } - let network = /** @type {!CrOnc.NetworkStateProperties} */ (this.item); + var network = /** @type {!CrOnc.NetworkStateProperties} */ (this.item); if (this.isListItem) return CrOnc.getNetworkName(network); return CrOncStrings['OncType' + network.Type];
diff --git a/ui/webui/resources/cr_elements/network/cr_onc_types.js b/ui/webui/resources/cr_elements/network/cr_onc_types.js index 138eebf..d3a5b758 100644 --- a/ui/webui/resources/cr_elements/network/cr_onc_types.js +++ b/ui/webui/resources/cr_elements/network/cr_onc_types.js
@@ -238,7 +238,8 @@ return undefined; var result = {}; var keys = Object.keys(properties); - for (let k of keys) { + for (var i = 0; i < keys.length; ++i) { + var k = keys[i]; var prop = CrOnc.getActiveValue(properties[k]); if (prop == undefined) { console.error( @@ -264,7 +265,7 @@ /** @type {!CrOnc.IPConfigProperties|undefined} */ var ipConfig = undefined; var ipConfigs = properties.IPConfigs; if (ipConfigs) { - for (let i = 0; i < ipConfigs.length; ++i) { + for (var i = 0; i < ipConfigs.length; ++i) { ipConfig = ipConfigs[i]; if (ipConfig.Type == type) break; @@ -355,14 +356,14 @@ CrOnc.getNetworkName = function(properties) { if (!properties) return ''; - let name = CrOnc.getStateOrActiveString(properties.Name); - let type = CrOnc.getStateOrActiveString(properties.Type); + var name = CrOnc.getStateOrActiveString(properties.Name); + var type = CrOnc.getStateOrActiveString(properties.Type); if (!name) return CrOncStrings['OncType' + type]; if (type == 'VPN' && properties.VPN) { - let vpnType = CrOnc.getStateOrActiveString(properties.VPN.Type); + var vpnType = CrOnc.getStateOrActiveString(properties.VPN.Type); if (vpnType == 'ThirdPartyVPN' && properties.VPN.ThirdPartyVPN) { - let providerName = properties.VPN.ThirdPartyVPN.ProviderName; + var providerName = properties.VPN.ThirdPartyVPN.ProviderName; if (providerName) { return CrOncStrings.vpnNameTemplate.replace('$1', providerName) .replace('$2', name); @@ -483,8 +484,8 @@ if (prefixLength < 0 || prefixLength > 32) return ''; var netmask = ''; - for (let i = 0; i < 4; ++i) { - let remainder = 8; + for (var i = 0; i < 4; ++i) { + var remainder = 8; if (prefixLength >= 8) { prefixLength -= 8; } else { @@ -493,7 +494,7 @@ } if (i > 0) netmask += '.'; - let value = 0; + var value = 0; if (remainder != 0) value = ((2 << (remainder - 1)) - 1) << (8 - remainder); netmask += value.toString(); @@ -512,8 +513,8 @@ var tokens = netmask.split('.'); if (tokens.length != 4) return -1; - for (let i = 0; i < tokens.length; ++i) { - let token = tokens[i]; + for (var i = 0; i < tokens.length; ++i) { + var token = tokens[i]; // If we already found the last mask and the current one is not // '0' then the netmask is invalid. For example, 255.224.255.0 if (prefixLength / 8 != i) { @@ -544,3 +545,12 @@ } return prefixLength; }; + +/** + * @param {!CrOnc.ProxyLocation} a + * @param {!CrOnc.ProxyLocation} b + * @return {boolean} + */ +CrOnc.proxyMatches = function(a, b) { + return a.Host == b.Host && a.Port == b.Port; +};