diff --git a/build/android/lint/suppressions.xml b/build/android/lint/suppressions.xml index e4ccbcb..0abc2963 100644 --- a/build/android/lint/suppressions.xml +++ b/build/android/lint/suppressions.xml
@@ -183,6 +183,7 @@ <issue id="NewApi"> <ignore regexp="Attribute `paddingStart` referenced here can result in a crash on some specific devices older than API 17"/> <ignore regexp="chrome/android/java/res/drawable/downloads_big.xml"/> + <ignore regexp="chrome/android/java/res/drawable/ic_bluetooth_connected.xml"/> <ignore regexp="chrome/android/java/res/values-v17/styles.xml"/> <ignore regexp="chromecast/internal"/> <ignore regexp="com/android/tv"/>
diff --git a/build/android/pylib/local/device/local_device_instrumentation_test_run.py b/build/android/pylib/local/device/local_device_instrumentation_test_run.py index a8d9f5e..c6a0c9df 100644 --- a/build/android/pylib/local/device/local_device_instrumentation_test_run.py +++ b/build/android/pylib/local/device/local_device_instrumentation_test_run.py
@@ -75,30 +75,40 @@ self._env.BlacklistDevice) @trace_event.traced def individual_device_set_up(dev, host_device_tuples): - def install_apk(): - if self._test_instance.apk_under_test: - if self._test_instance.apk_under_test_incremental_install_script: - local_device_test_run.IncrementalInstall( - dev, - self._test_instance.apk_under_test, - self._test_instance.apk_under_test_incremental_install_script) - else: - permissions = self._test_instance.apk_under_test.GetPermissions() - dev.Install(self._test_instance.apk_under_test, - permissions=permissions) + steps = [] + def install_helper(apk, permissions): + return lambda: dev.Install(apk, permissions=permissions) + def incremental_install_helper(dev, apk, script): + return lambda: local_device_test_run.IncrementalInstall( + dev, apk, script) - if self._test_instance.test_apk_incremental_install_script: - local_device_test_run.IncrementalInstall( - dev, - self._test_instance.test_apk, - self._test_instance.test_apk_incremental_install_script) + if self._test_instance.apk_under_test: + if self._test_instance.apk_under_test_incremental_install_script: + steps.append(incremental_install_helper( + dev, + self._test_instance.apk_under_test, + self._test_instance. + apk_under_test_incremental_install_script)) else: - permissions = self._test_instance.test_apk.GetPermissions() - dev.Install(self._test_instance.test_apk, permissions=permissions) + permissions = self._test_instance.apk_under_test.GetPermissions() + steps.append(install_helper(self._test_instance.apk_under_test, + permissions)) - for apk in self._test_instance.additional_apks: - dev.Install(apk) + if self._test_instance.test_apk_incremental_install_script: + steps.append(incremental_install_helper( + dev, + self._test_instance.test_apk, + self._test_instance. + test_apk_incremental_install_script)) + else: + permissions = self._test_instance.test_apk.GetPermissions() + steps.append(install_helper(self._test_instance.test_apk, + permissions)) + steps.extend(install_helper(apk, None) + for apk in self._test_instance.additional_apks) + + def set_debug_app(): # Set debug app in order to enable reading command line flags on user # builds if self._test_instance.flags: @@ -165,8 +175,8 @@ valgrind_tools.SetChromeTimeoutScale( dev, self._test_instance.timeout_scale) - steps = (install_apk, edit_shared_prefs, push_test_data, - create_flag_changer) + steps += [set_debug_app, edit_shared_prefs, push_test_data, + create_flag_changer] if self._env.concurrent_adb: reraiser_thread.RunAsync(steps) else:
diff --git a/cc/trees/property_tree.cc b/cc/trees/property_tree.cc index e5aba10..4d1ca75 100644 --- a/cc/trees/property_tree.cc +++ b/cc/trees/property_tree.cc
@@ -70,7 +70,7 @@ nodes_.push_back(T()); back()->id = kRootNodeId; back()->parent_id = kInvalidNodeId; - owning_layer_id_to_node_index.clear(); + owning_layer_id_to_node_index_.clear(); #if DCHECK_IS_ON() PropertyTree<T> tree; @@ -81,7 +81,7 @@ template <typename T> bool PropertyTree<T>::operator==(const PropertyTree<T>& other) const { return nodes_ == other.nodes() && needs_update_ == other.needs_update() && - owning_layer_id_to_node_index == other.owning_layer_id_to_node_index; + owning_layer_id_to_node_index_ == other.owning_layer_id_to_node_index_; } template <typename T>
diff --git a/cc/trees/property_tree.h b/cc/trees/property_tree.h index 86ee684..de5cc28 100644 --- a/cc/trees/property_tree.h +++ b/cc/trees/property_tree.h
@@ -11,6 +11,7 @@ #include <unordered_map> #include <vector> +#include "base/containers/flat_map.h" #include "cc/base/filter_operations.h" #include "cc/base/synced_property.h" #include "cc/cc_export.h" @@ -113,8 +114,8 @@ } int FindNodeIndexFromOwningLayerId(int id) const { - auto iter = owning_layer_id_to_node_index.find(id); - if (iter == owning_layer_id_to_node_index.end()) + auto iter = owning_layer_id_to_node_index_.find(id); + if (iter == owning_layer_id_to_node_index_.end()) return kInvalidNodeId; else return iter->second; @@ -122,19 +123,21 @@ void SetOwningLayerIdForNode(const T* node, int id) { if (!node) { - owning_layer_id_to_node_index[id] = kInvalidNodeId; + owning_layer_id_to_node_index_[id] = kInvalidNodeId; return; } DCHECK(node == Node(node->id)); - owning_layer_id_to_node_index[id] = node->id; + owning_layer_id_to_node_index_[id] = node->id; } private: std::vector<T> nodes_; - // These maps map from layer id to the property tree node index. - std::unordered_map<int, int> owning_layer_id_to_node_index; + // Maps from layer id to the property tree node index. This container is + // typically very small and the memory overhead of unordered_map will + // dominate so use a flat_map. See http://crbug.com/709243 + base::flat_map<int, int> owning_layer_id_to_node_index_; bool needs_update_; PropertyTrees* property_trees_;
diff --git a/chrome/android/java/res/color/item_chooser_row_icon_color.xml b/chrome/android/java/res/color/item_chooser_row_icon_color.xml new file mode 100644 index 0000000..28ed5c63 --- /dev/null +++ b/chrome/android/java/res/color/item_chooser_row_icon_color.xml
@@ -0,0 +1,10 @@ +<?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. +--> +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:color="@android:color/white" android:state_selected="true"/> + <item android:color="@color/primary_text_disabled_material_light" android:state_enabled="false"/> + <item android:color="@color/google_grey_600"/> +</selector>
diff --git a/chrome/android/java/res/drawable/ic_bluetooth_connected.xml b/chrome/android/java/res/drawable/ic_bluetooth_connected.xml new file mode 100644 index 0000000..6f44896 --- /dev/null +++ b/chrome/android/java/res/drawable/ic_bluetooth_connected.xml
@@ -0,0 +1,14 @@ +<?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. +--> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + <path + android:pathData="M7,12l-2,-2 -2,2 2,2 2,-2zM17.71,7.71L12,2h-1v7.59L6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 11,14.41L11,22h1l5.71,-5.71 -4.3,-4.29 4.3,-4.29zM13,5.83l1.88,1.88L13,9.59L13,5.83zM14.88,16.29L13,18.17v-3.76l1.88,1.88zM19,10l-2,2 2,2 2,-2 -2,-2z" + android:fillColor="#757575"/> +</vector>
diff --git a/chrome/android/java/res/layout/infobar_translate_compact_content.xml b/chrome/android/java/res/layout/infobar_translate_compact_content.xml index 8993213..f8e3ab2 100644 --- a/chrome/android/java/res/layout/infobar_translate_compact_content.xml +++ b/chrome/android/java/res/layout/infobar_translate_compact_content.xml
@@ -20,10 +20,11 @@ android:requiresFadingEdge="horizontal" android:fadingEdgeLength="@dimen/infobar_translate_fade_edge_length" app:tabIndicatorColor="@color/infobar_accent_blue" + app:tabSelectedTextColor="@color/infobar_accent_blue" app:tabGravity="fill" app:tabMode="scrollable" /> - <ImageButton + <org.chromium.chrome.browser.widget.TintedImageButton android:id="@+id/translate_infobar_menu_button" android:layout_width="wrap_content" android:layout_height="wrap_content" @@ -32,5 +33,6 @@ android:scaleType="center" android:background="?attr/selectableItemBackground" android:contentDescription="@null" - android:src="@drawable/btn_menu" /> + android:src="@drawable/btn_menu" + app:tint="@color/dark_mode_tint" /> </LinearLayout>
diff --git a/chrome/android/java/res/layout/item_chooser_dialog_row.xml b/chrome/android/java/res/layout/item_chooser_dialog_row.xml index a3543dc..dac2d11a 100644 --- a/chrome/android/java/res/layout/item_chooser_dialog_row.xml +++ b/chrome/android/java/res/layout/item_chooser_dialog_row.xml
@@ -8,12 +8,22 @@ android:paddingStart="16dp" android:paddingEnd="16dp" android:background="@drawable/item_chooser_row_background"> + <!-- contentDescription is added at runtime. --> + <ImageView + android:id="@+id/icon" + android:contentDescription="@null" + android:layout_width="24dp" + android:layout_height="24dp" + android:layout_centerVertical="true" + android:layout_marginEnd="16dp"/> <TextView android:id="@+id/description" android:layout_width="match_parent" android:layout_height="wrap_content" + android:layout_centerVertical="true" + android:layout_toEndOf="@id/icon" android:ellipsize="end" android:maxLines="1" - android:textColor="@color/item_chooser_row_text_color" - android:layout_centerVertical="true"/> + android:textSize="16sp" + android:textColor="@color/item_chooser_row_text_color"/> </RelativeLayout>
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/BluetoothChooserDialog.java b/chrome/android/java/src/org/chromium/chrome/browser/BluetoothChooserDialog.java index f5e21dd9..d4b0236 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/BluetoothChooserDialog.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/BluetoothChooserDialog.java
@@ -11,11 +11,16 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; +import android.content.res.Resources; +import android.graphics.drawable.Drawable; import android.location.LocationManager; +import android.support.graphics.drawable.VectorDrawableCompat; +import android.support.v4.graphics.drawable.DrawableCompat; import android.text.SpannableString; import android.text.TextUtils; import android.view.View; +import org.chromium.base.ApiCompatibilityUtils; import org.chromium.base.Log; import org.chromium.base.VisibleForTesting; import org.chromium.base.annotations.CalledByNative; @@ -67,6 +72,11 @@ // bluetooth devices. For valid values see SecurityStateModel::SecurityLevel. int mSecurityLevel; + @VisibleForTesting + Drawable mConnectedIcon; + @VisibleForTesting + String mConnectedIconDescription; + // A pointer back to the native part of the implementation for this dialog. long mNativeBluetoothChooserDialogPtr; @@ -117,6 +127,17 @@ mSecurityLevel = securityLevel; mNativeBluetoothChooserDialogPtr = nativeBluetoothChooserDialogPtr; mAdapter = BluetoothAdapter.getDefaultAdapter(); + + Resources res = mActivity.getResources(); + + // Initialize icons. + mConnectedIcon = VectorDrawableCompat.create( + res, R.drawable.ic_bluetooth_connected, mActivity.getTheme()); + DrawableCompat.setTintList(mConnectedIcon, + ApiCompatibilityUtils.getColorStateList(res, R.color.item_chooser_row_icon_color)); + + mConnectedIconDescription = mActivity.getString(R.string.bluetooth_device_connected); + if (mAdapter == null) { Log.i(TAG, "BluetoothChooserDialog: Default Bluetooth adapter not found."); } @@ -351,9 +372,21 @@ } @VisibleForTesting + Drawable getConnectedIcon() { + return mConnectedIcon.getConstantState().newDrawable().mutate(); + } + + @VisibleForTesting @CalledByNative - void addOrUpdateDevice(String deviceId, String deviceName) { - mItemChooserDialog.addOrUpdateItem(deviceId, deviceName); + void addOrUpdateDevice(String deviceId, String deviceName, boolean isGATTConnected) { + Drawable icon = null; + String iconDescription = null; + if (isGATTConnected) { + icon = getConnectedIcon(); + iconDescription = mConnectedIconDescription; + } + + mItemChooserDialog.addOrUpdateItem(deviceId, deviceName, icon, iconDescription); } @VisibleForTesting
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ItemChooserDialog.java b/chrome/android/java/src/org/chromium/chrome/browser/ItemChooserDialog.java index a0f3ebda..96a9e8c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ItemChooserDialog.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ItemChooserDialog.java
@@ -10,6 +10,8 @@ import android.content.DialogInterface; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; +import android.graphics.drawable.Drawable; +import android.support.annotation.Nullable; import android.text.TextUtils; import android.text.method.LinkMovementMethod; import android.view.Gravity; @@ -21,11 +23,13 @@ import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.Button; +import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.ListView; import android.widget.ProgressBar; import android.widget.TextView; +import org.chromium.base.ApiCompatibilityUtils; import org.chromium.base.VisibleForTesting; import org.chromium.chrome.R; import org.chromium.chrome.browser.util.MathUtils; @@ -64,10 +68,15 @@ public static class ItemChooserRow { private final String mKey; private String mDescription; + private Drawable mIcon; + private String mIconDescription; - public ItemChooserRow(String key, String description) { + public ItemChooserRow(String key, String description, @Nullable Drawable icon, + @Nullable String iconDescription) { mKey = key; mDescription = description; + mIcon = icon; + mIconDescription = iconDescription; } /** @@ -75,10 +84,14 @@ * * @param key Expected item unique identifier. * @param description Expected item description. + * @param icon Expected item icon. */ - public boolean hasSameContents(String key, String description) { + public boolean hasSameContents(String key, String description, @Nullable Drawable icon, + @Nullable String iconDescription) { if (!TextUtils.equals(mKey, key)) return false; if (!TextUtils.equals(mDescription, description)) return false; + if (!ApiCompatibilityUtils.objectEquals(mIcon, icon)) return false; + if (!TextUtils.equals(mIconDescription, iconDescription)) return false; return true; } } @@ -123,8 +136,10 @@ */ private static class ViewHolder { private TextView mTextView; + private ImageView mImageView; public ViewHolder(View view) { + mImageView = (ImageView) view.findViewById(R.id.icon); mTextView = (TextView) view.findViewById(R.id.description); } } @@ -154,6 +169,9 @@ // Map of keys to items so that we can access the items in O(1). private Map<String, ItemChooserRow> mKeyToItemMap = new HashMap<>(); + // True when there is at least one row with an icon. + private boolean mHasIcon; + public ItemAdapter(Context context, int resource) { super(context, resource); @@ -174,10 +192,20 @@ return isEmpty; } - public void addOrUpdate(String key, String description) { + /** + * Adds an item to the list to show in the dialog if the item + * was not in the chooser. Otherwise updates the items description, icon + * and icon description. + * @param key Unique identifier for that item. + * @param description Text in the row. + * @param icon Drawable to show next to the item. + * @param iconDescription Description of the icon. + */ + public void addOrUpdate(String key, String description, @Nullable Drawable icon, + @Nullable String iconDescription) { ItemChooserRow oldItem = mKeyToItemMap.get(key); if (oldItem != null) { - if (oldItem.hasSameContents(key, description)) { + if (oldItem.hasSameContents(key, description, icon, iconDescription)) { // No need to update anything. return; } @@ -188,12 +216,17 @@ addToDescriptionsMap(oldItem.mDescription); } + if (!ApiCompatibilityUtils.objectEquals(icon, oldItem.mIcon)) { + oldItem.mIcon = icon; + oldItem.mIconDescription = iconDescription; + } + notifyDataSetChanged(); return; } assert !mKeyToItemMap.containsKey(key); - ItemChooserRow newItem = new ItemChooserRow(key, description); + ItemChooserRow newItem = new ItemChooserRow(key, description, icon, iconDescription); mKeyToItemMap.put(key, newItem); addToDescriptionsMap(newItem.mDescription); @@ -307,10 +340,37 @@ row.mTextView.setEnabled(isEnabled(position)); row.mTextView.setText(getDisplayText(position)); + // If there is at least one item with an icon then we set mImageView's + // visibility to INVISIBLE for all items with no icons. We do this + // so that all items' desriptions are aligned. + if (!mHasIcon) { + row.mImageView.setVisibility(View.GONE); + } else { + ItemChooserRow item = getItem(position); + if (item.mIcon != null) { + row.mImageView.setContentDescription(item.mIconDescription); + row.mImageView.setImageDrawable(item.mIcon); + row.mImageView.setVisibility(View.VISIBLE); + } else { + row.mImageView.setVisibility(View.INVISIBLE); + row.mImageView.setImageDrawable(null); + row.mImageView.setContentDescription(null); + } + row.mImageView.setSelected(position == mSelectedItem); + } return convertView; } @Override + public void notifyDataSetChanged() { + mHasIcon = false; + for (ItemChooserRow row : mKeyToItemMap.values()) { + if (row.mIcon != null) mHasIcon = true; + } + super.notifyDataSetChanged(); + } + + @Override public void onItemClick(AdapterView<?> adapter, View view, int position, long id) { mSelectedItem = position; mConfirmButton.setEnabled(true); @@ -504,8 +564,24 @@ * @param description Text in the row. */ public void addOrUpdateItem(String key, String description) { + addOrUpdateItem(key, description, null /* icon */, null /* iconDescription */); + } + + /** + * Adds an item to the end of the list to show in the dialog if the item + * was not in the chooser. Otherwise updates the items description or icon. + * Note that as long as at least one item has an icon all rows will be inset + * with the icon dimensions. + * + * @param key Unique identifier for that item. + * @param description Text in the row. + * @param icon Drawable to show left of the description. + * @param iconDescription Description of the icon. + */ + public void addOrUpdateItem(String key, String description, @Nullable Drawable icon, + @Nullable String iconDescription) { mProgressBar.setVisibility(View.GONE); - mItemAdapter.addOrUpdate(key, description); + mItemAdapter.addOrUpdate(key, description, icon, iconDescription); setState(State.PROGRESS_UPDATE_AVAILABLE); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java index 88f1257..607b81b2 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java
@@ -1104,8 +1104,7 @@ mHasStartedNewOmniboxEditSession = false; mNewOmniboxEditSessionTimestamp = -1; Tab currentTab = getCurrentTab(); - if (mNativeInitialized && mBottomSheet == null && mUrlHasFocus && currentTab != null - && !currentTab.isIncognito()) { + if (mNativeInitialized && mBottomSheet == null && mUrlHasFocus && currentTab != null) { mAutocomplete.startZeroSuggest(currentTab.getProfile(), mUrlBar.getQueryText(), mToolbarDataProvider.getCurrentUrl(), mUrlFocusedFromFakebox); }
diff --git a/chrome/android/java/strings/android_chrome_strings.grd b/chrome/android/java/strings/android_chrome_strings.grd index ed07091..372e2fb8 100644 --- a/chrome/android/java/strings/android_chrome_strings.grd +++ b/chrome/android/java/strings/android_chrome_strings.grd
@@ -1376,6 +1376,9 @@ <message name="IDS_BLUETOOTH_NEED_LOCATION_PERMISSION_HELP" desc="The status message to get more information about why Chrome needs the Location permission in order to scan for Bluetooth devices."> <ph name="BEGIN_LINK"><link></ph>Get help<ph name="END_LINK"></link></ph> </message> + <message name="IDS_BLUETOOTH_DEVICE_CONNECTED" desc="Content description for the connected icon next to connected Bluetooth devices."> + Connected Device + </message> <!-- Hint of sync error solution strings --> <message name="IDS_SYNC_ERROR_CARD_TITLE" desc="Title of the Sync Error Card. [CHAR-LIMIT=32]">
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/BluetoothChooserDialogTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/BluetoothChooserDialogTest.java index 43d7d793..b66ff74 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/BluetoothChooserDialogTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/BluetoothChooserDialogTest.java
@@ -8,6 +8,7 @@ import android.app.Dialog; import android.content.Intent; import android.content.pm.PackageManager; +import android.graphics.drawable.Drawable; import android.location.LocationManager; import android.support.test.filters.LargeTest; import android.test.MoreAsserts; @@ -52,6 +53,11 @@ } @Override + Drawable getConnectedIcon() { + return super.mConnectedIcon; + } + + @Override void nativeOnDialogFinished( long nativeBluetoothChooserAndroid, int eventType, String deviceId) { assertEquals(nativeBluetoothChooserAndroid, mNativeBluetoothChooserDialogPtr); @@ -226,8 +232,8 @@ ThreadUtils.runOnUiThreadBlocking(new Runnable() { @Override public void run() { - mChooserDialog.addOrUpdateDevice("id-1", "Name 1"); - mChooserDialog.addOrUpdateDevice("id-2", "Name 2"); + mChooserDialog.addOrUpdateDevice("id-1", "Name 1", false /* isGATTConnected */); + mChooserDialog.addOrUpdateDevice("id-2", "Name 2", true /* isGATTConnected */); } }); @@ -241,6 +247,13 @@ assertEquals(View.VISIBLE, items.getVisibility()); assertEquals(View.GONE, progress.getVisibility()); + ItemChooserDialog.ItemAdapter itemAdapter = + mChooserDialog.mItemChooserDialog.getItemAdapterForTesting(); + assertTrue(itemAdapter.getItem(0).hasSameContents( + "id-1", "Name 1", null /* icon */, null /* iconDescription */)); + assertTrue(itemAdapter.getItem(1).hasSameContents("id-2", "Name 2", + mChooserDialog.getConnectedIcon(), mChooserDialog.mConnectedIconDescription)); + selectItem(mChooserDialog, 2); assertEquals(
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/ItemChooserDialogTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/ItemChooserDialogTest.java index c9561524..fdc2aecb 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/ItemChooserDialogTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/ItemChooserDialogTest.java
@@ -5,14 +5,18 @@ package org.chromium.chrome.browser; import android.app.Dialog; +import android.graphics.drawable.Drawable; +import android.support.graphics.drawable.VectorDrawableCompat; import android.support.test.filters.LargeTest; import android.test.UiThreadTest; import android.text.SpannableString; import android.view.View; import android.widget.Button; +import android.widget.ImageView; import android.widget.ListView; import android.widget.TextView; +import org.chromium.base.ApiCompatibilityUtils; import org.chromium.base.ThreadUtils; import org.chromium.base.test.util.RetryOnFailure; import org.chromium.chrome.R; @@ -35,6 +39,12 @@ String mLastSelectedId = "None"; + Drawable mTestDrawable1; + String mTestDrawableDescription1; + + Drawable mTestDrawable2; + String mTestDrawableDescription2; + public ItemChooserDialogTest() { super(ChromeActivity.class); } @@ -45,6 +55,14 @@ protected void setUp() throws Exception { super.setUp(); mChooserDialog = createDialog(); + + mTestDrawable1 = getNewTestDrawable(); + mTestDrawableDescription1 = "icon1 description"; + + mTestDrawable2 = getNewTestDrawable(); + mTestDrawableDescription2 = "icon2 description"; + + assertFalse(ApiCompatibilityUtils.objectEquals(mTestDrawable1, mTestDrawable2)); } @Override @@ -59,6 +77,15 @@ mLastSelectedId = id; } + private Drawable getNewTestDrawable() { + Drawable drawable = VectorDrawableCompat.create( + getActivity().getResources(), R.drawable.ic_bluetooth_connected, null); + // Calling mutate() on a Drawable should typically create a new ConstantState + // for that Drawable. Ensure the new drawable doesn't share a state with other + // drwables. + return drawable.mutate(); + } + private ItemChooserDialog createDialog() { SpannableString title = new SpannableString("title"); SpannableString searching = new SpannableString("searching"); @@ -118,17 +145,326 @@ })); } - private TextView getDescriptionTextView(Dialog dialog, int position) { - final ListView items = (ListView) dialog.findViewById(R.id.items); - CriteriaHelper.pollUiThread(new Criteria() { - @Override - public boolean isSatisfied() { - return items.getChildAt(0) != null; - } - }); + private View getRowView(Dialog dialog, int position) { + ListView items = (ListView) dialog.findViewById(R.id.items); + int actualPosition = position - 1; + int first = items.getFirstVisiblePosition(); + int last = items.getLastVisiblePosition(); - View item = items.getChildAt(position - 1); - return (TextView) item.findViewById(R.id.description); + if (actualPosition < first || actualPosition > last) { + return items.getAdapter().getView(actualPosition, null, items); + } else { + final int visiblePos = actualPosition - first; + return items.getChildAt(visiblePos); + } + } + + private ImageView getIconImageView(Dialog dialog, int position) { + return (ImageView) getRowView(dialog, position).findViewById(R.id.icon); + } + + private TextView getDescriptionTextView(Dialog dialog, int position) { + return (TextView) getRowView(dialog, position).findViewById(R.id.description); + } + + @LargeTest + @UiThreadTest + public void testAddItemsWithNoIcons() throws InterruptedException { + Dialog dialog = mChooserDialog.getDialogForTesting(); + assertTrue(dialog.isShowing()); + + { + // Add item 1 with no icon. + mChooserDialog.addOrUpdateItem("key1", "desc1"); + ImageView icon1 = getIconImageView(dialog, 1); + assertEquals(View.GONE, icon1.getVisibility()); + assertEquals(null, icon1.getDrawable()); + } + + { + // Add item 2 with no icon. + mChooserDialog.addOrUpdateItem("key2", "desc2"); + ImageView icon2 = getIconImageView(dialog, 1); + assertEquals(View.GONE, icon2.getVisibility()); + assertEquals(null, icon2.getDrawable()); + } + + mChooserDialog.setIdleState(); + mChooserDialog.dismiss(); + } + + @LargeTest + @UiThreadTest + public void testAddItemsWithIcons() throws InterruptedException { + Dialog dialog = mChooserDialog.getDialogForTesting(); + assertTrue(dialog.isShowing()); + + { + // Add item 1 with icon. + mChooserDialog.addOrUpdateItem( + "key1", "desc1", mTestDrawable1, mTestDrawableDescription1); + ImageView icon1 = getIconImageView(dialog, 1); + assertEquals(View.VISIBLE, icon1.getVisibility()); + assertEquals(mTestDrawable1, icon1.getDrawable()); + assertEquals(mTestDrawableDescription1, icon1.getContentDescription()); + } + + { + // Add item 2 with icon. + mChooserDialog.addOrUpdateItem( + "key2", "desc2", mTestDrawable2, mTestDrawableDescription2); + ImageView icon1 = getIconImageView(dialog, 1); + assertEquals(View.VISIBLE, icon1.getVisibility()); + assertEquals(mTestDrawable1, icon1.getDrawable()); + assertEquals(mTestDrawableDescription1, icon1.getContentDescription()); + ImageView icon2 = getIconImageView(dialog, 2); + assertEquals(View.VISIBLE, icon2.getVisibility()); + assertEquals(mTestDrawable2, icon2.getDrawable()); + assertEquals(mTestDrawableDescription2, icon2.getContentDescription()); + } + + mChooserDialog.setIdleState(); + mChooserDialog.dismiss(); + } + + @LargeTest + @UiThreadTest + public void testAddItemWithIconAfterItemWithNoIcon() throws InterruptedException { + Dialog dialog = mChooserDialog.getDialogForTesting(); + assertTrue(dialog.isShowing()); + + { + // Add item 1 with no icon. + mChooserDialog.addOrUpdateItem("key1", "desc1"); + ImageView icon1 = getIconImageView(dialog, 1); + assertEquals(View.GONE, icon1.getVisibility()); + assertEquals(null, icon1.getDrawable()); + } + + { + // Add item 2 with icon. + mChooserDialog.addOrUpdateItem( + "key2", "desc2", mTestDrawable2, mTestDrawableDescription2); + ImageView icon1 = getIconImageView(dialog, 1); + ImageView icon2 = getIconImageView(dialog, 2); + assertEquals(View.INVISIBLE, icon1.getVisibility()); + assertEquals(View.VISIBLE, icon2.getVisibility()); + assertEquals(mTestDrawable2, icon2.getDrawable()); + } + + mChooserDialog.setIdleState(); + mChooserDialog.dismiss(); + } + + @LargeTest + @UiThreadTest + public void testAddItemWithNoIconAfterItemWithIcon() throws InterruptedException { + Dialog dialog = mChooserDialog.getDialogForTesting(); + assertTrue(dialog.isShowing()); + + { + // Add item 1 with icon. + mChooserDialog.addOrUpdateItem( + "key1", "desc1", mTestDrawable1, mTestDrawableDescription1); + ImageView icon1 = getIconImageView(dialog, 1); + assertEquals(View.VISIBLE, icon1.getVisibility()); + assertEquals(mTestDrawable1, icon1.getDrawable()); + } + + { + // Add item 2 with no icon. + mChooserDialog.addOrUpdateItem("key2", "desc2"); + ImageView icon1 = getIconImageView(dialog, 1); + ImageView icon2 = getIconImageView(dialog, 2); + assertEquals(View.VISIBLE, icon1.getVisibility()); + assertEquals(mTestDrawable1, icon1.getDrawable()); + assertEquals(View.INVISIBLE, icon2.getVisibility()); + } + + mChooserDialog.setIdleState(); + mChooserDialog.dismiss(); + } + + @LargeTest + @UiThreadTest + public void testRemoveItemWithIconNoItemsWithIconsLeft() throws InterruptedException { + Dialog dialog = mChooserDialog.getDialogForTesting(); + assertTrue(dialog.isShowing()); + + { + // Add item 1 with icon. + mChooserDialog.addOrUpdateItem( + "key1", "desc1", mTestDrawable1, mTestDrawableDescription1); + ImageView icon1 = getIconImageView(dialog, 1); + assertEquals(View.VISIBLE, icon1.getVisibility()); + assertEquals(mTestDrawable1, icon1.getDrawable()); + } + + { + // Add item 2 with no icon. + mChooserDialog.addOrUpdateItem("key2", "desc2"); + ImageView icon1 = getIconImageView(dialog, 1); + ImageView icon2 = getIconImageView(dialog, 2); + assertEquals(View.VISIBLE, icon1.getVisibility()); + assertEquals(View.INVISIBLE, icon2.getVisibility()); + } + + { + // Remove item 1 with icon. No items with icons left. + mChooserDialog.removeItemFromList("key1"); + ImageView icon2 = getIconImageView(dialog, 1); + assertEquals(View.GONE, icon2.getVisibility()); + } + + mChooserDialog.setIdleState(); + mChooserDialog.dismiss(); + } + + @LargeTest + @UiThreadTest + public void testRemoveItemWithIconOneItemWithIconLeft() throws InterruptedException { + Dialog dialog = mChooserDialog.getDialogForTesting(); + assertTrue(dialog.isShowing()); + + { + // Add item 1 with icon. + mChooserDialog.addOrUpdateItem( + "key1", "desc1", mTestDrawable1, mTestDrawableDescription1); + ImageView icon1 = getIconImageView(dialog, 1); + assertEquals(View.VISIBLE, icon1.getVisibility()); + } + + { + // Add item 2 with icon. + mChooserDialog.addOrUpdateItem( + "key2", "desc2", mTestDrawable2, mTestDrawableDescription2); + ImageView icon1 = getIconImageView(dialog, 1); + ImageView icon2 = getIconImageView(dialog, 2); + assertEquals(View.VISIBLE, icon1.getVisibility()); + assertEquals(View.VISIBLE, icon2.getVisibility()); + } + + { + // Add item 3 with no icon. + mChooserDialog.addOrUpdateItem("key3", "desc3"); + ImageView icon1 = getIconImageView(dialog, 1); + ImageView icon2 = getIconImageView(dialog, 2); + ImageView icon3 = getIconImageView(dialog, 3); + assertEquals(View.VISIBLE, icon1.getVisibility()); + assertEquals(View.VISIBLE, icon2.getVisibility()); + assertEquals(View.INVISIBLE, icon3.getVisibility()); + } + + { + mChooserDialog.removeItemFromList("key1"); + ImageView icon2 = getIconImageView(dialog, 1); + ImageView icon3 = getIconImageView(dialog, 2); + assertEquals(View.VISIBLE, icon2.getVisibility()); + assertEquals(mTestDrawable2, icon2.getDrawable()); + assertEquals(View.INVISIBLE, icon3.getVisibility()); + } + + mChooserDialog.setIdleState(); + mChooserDialog.dismiss(); + } + + @LargeTest + @UiThreadTest + public void testUpdateItemWithIconToNoIcon() throws InterruptedException { + Dialog dialog = mChooserDialog.getDialogForTesting(); + assertTrue(dialog.isShowing()); + ItemChooserDialog.ItemAdapter itemAdapter = mChooserDialog.getItemAdapterForTesting(); + + { + // Add item 1 with icon. + mChooserDialog.addOrUpdateItem( + "key1", "desc1", mTestDrawable1, mTestDrawableDescription1); + ImageView icon1 = getIconImageView(dialog, 1); + assertEquals(View.VISIBLE, icon1.getVisibility()); + assertEquals(mTestDrawableDescription1, icon1.getContentDescription()); + assertTrue(itemAdapter.getItem(0).hasSameContents( + "key1", "desc1", mTestDrawable1, mTestDrawableDescription1)); + } + + { + // Update item 1 to no icon. + mChooserDialog.addOrUpdateItem("key1", "desc1"); + ImageView icon1 = getIconImageView(dialog, 1); + assertEquals(View.GONE, icon1.getVisibility()); + assertEquals(null, icon1.getContentDescription()); + assertTrue(itemAdapter.getItem(0).hasSameContents( + "key1", "desc1", null /* icon */, null /* iconDescription */)); + } + + mChooserDialog.setIdleState(); + mChooserDialog.dismiss(); + } + + @LargeTest + @UiThreadTest + public void testUpdateItemWithNoIconToIcon() throws InterruptedException { + Dialog dialog = mChooserDialog.getDialogForTesting(); + assertTrue(dialog.isShowing()); + ItemChooserDialog.ItemAdapter itemAdapter = mChooserDialog.getItemAdapterForTesting(); + + { + // Add item 1 to no icon. + mChooserDialog.addOrUpdateItem("key1", "desc1"); + ImageView icon1 = getIconImageView(dialog, 1); + assertEquals(View.GONE, icon1.getVisibility()); + assertTrue(itemAdapter.getItem(0).hasSameContents( + "key1", "desc1", null /* icon */, null /* iconDescription */)); + } + + { + // Update item 1 with icon. + mChooserDialog.addOrUpdateItem( + "key1", "desc1", mTestDrawable1, mTestDrawableDescription1); + ImageView icon1 = getIconImageView(dialog, 1); + assertEquals(View.VISIBLE, icon1.getVisibility()); + assertEquals(mTestDrawable1, icon1.getDrawable()); + assertEquals(mTestDrawableDescription1, icon1.getContentDescription()); + assertTrue(itemAdapter.getItem(0).hasSameContents( + "key1", "desc1", mTestDrawable1, mTestDrawableDescription1)); + } + + mChooserDialog.setIdleState(); + mChooserDialog.dismiss(); + } + + @LargeTest + @UiThreadTest + public void testUpdateItemIcon() throws InterruptedException { + Dialog dialog = mChooserDialog.getDialogForTesting(); + assertTrue(dialog.isShowing()); + ItemChooserDialog.ItemAdapter itemAdapter = mChooserDialog.getItemAdapterForTesting(); + + { + // Update item 1 with icon. + mChooserDialog.addOrUpdateItem( + "key1", "desc1", mTestDrawable1, mTestDrawableDescription1); + ImageView icon1 = getIconImageView(dialog, 1); + assertEquals(View.VISIBLE, icon1.getVisibility()); + assertEquals(mTestDrawable1, icon1.getDrawable()); + assertEquals(mTestDrawableDescription1, icon1.getContentDescription()); + assertTrue(itemAdapter.getItem(0).hasSameContents( + "key1", "desc1", mTestDrawable1, mTestDrawableDescription1)); + } + + { + // Update item 1 with different icon. + mChooserDialog.addOrUpdateItem( + "key1", "desc1", mTestDrawable2, mTestDrawableDescription2); + ImageView icon1 = getIconImageView(dialog, 1); + assertEquals(View.VISIBLE, icon1.getVisibility()); + assertEquals(mTestDrawable2, icon1.getDrawable()); + assertEquals(mTestDrawableDescription2, icon1.getContentDescription()); + assertTrue(itemAdapter.getItem(0).hasSameContents( + "key1", "desc1", mTestDrawable2, mTestDrawableDescription2)); + } + + mChooserDialog.setIdleState(); + mChooserDialog.dismiss(); } @LargeTest @@ -358,12 +694,14 @@ // Add item 1. mChooserDialog.addOrUpdateItem("key1", "desc1"); assertEquals(1, itemAdapter.getCount()); - assertTrue(itemAdapter.getItem(0).hasSameContents("key1", "desc1")); + assertTrue(itemAdapter.getItem(0).hasSameContents( + "key1", "desc1", null /* icon */, null /* iconDescription */)); // Update item 1 with different description. mChooserDialog.addOrUpdateItem("key1", "desc2"); assertEquals(1, itemAdapter.getCount()); - assertTrue(itemAdapter.getItem(0).hasSameContents("key1", "desc2")); + assertTrue(itemAdapter.getItem(0).hasSameContents( + "key1", "desc2", null /* icon */, null /* iconDescription */)); mChooserDialog.setIdleState(); @@ -406,13 +744,16 @@ // Add item 1. mChooserDialog.addOrUpdateItem("key1", "desc1"); assertEquals(1, itemAdapter.getCount()); - assertTrue(itemAdapter.getItem(0).hasSameContents("key1", "desc1")); + assertTrue(itemAdapter.getItem(0).hasSameContents( + "key1", "desc1", null /* icon */, null /* iconDescription */)); // Add item 2. mChooserDialog.addOrUpdateItem("key2", "desc2"); assertEquals(2, itemAdapter.getCount()); - assertTrue(itemAdapter.getItem(0).hasSameContents("key1", "desc1")); - assertTrue(itemAdapter.getItem(1).hasSameContents("key2", "desc2")); + assertTrue(itemAdapter.getItem(0).hasSameContents( + "key1", "desc1", null /* icon */, null /* iconDescription */)); + assertTrue(itemAdapter.getItem(1).hasSameContents( + "key2", "desc2", null /* icon */, null /* iconDescription */)); mChooserDialog.setIdleState(); @@ -423,7 +764,8 @@ // Remove item 2. mChooserDialog.removeItemFromList("key2"); assertEquals(1, itemAdapter.getCount()); - assertTrue(itemAdapter.getItem(0).hasSameContents("key1", "desc1")); + assertTrue(itemAdapter.getItem(0).hasSameContents( + "key1", "desc1", null /* icon */, null /* iconDescription */)); // The list should be visible with one item, it should not show // the empty view and the button should not be enabled. @@ -465,9 +807,12 @@ // Add item 3 with same description as item 1. mChooserDialog.addOrUpdateItem("key3", "desc1"); assertEquals(3, itemAdapter.getCount()); - assertTrue(itemAdapter.getItem(0).hasSameContents("key1", "desc1")); - assertTrue(itemAdapter.getItem(1).hasSameContents("key2", "desc2")); - assertTrue(itemAdapter.getItem(2).hasSameContents("key3", "desc1")); + assertTrue(itemAdapter.getItem(0).hasSameContents( + "key1", "desc1", null /* icon */, null /* iconDescription */)); + assertTrue(itemAdapter.getItem(1).hasSameContents( + "key2", "desc2", null /* icon */, null /* iconDescription */)); + assertTrue(itemAdapter.getItem(2).hasSameContents( + "key3", "desc1", null /* icon */, null /* iconDescription */)); // Since two items have the same name, their display text should have their unique // keys appended. @@ -479,8 +824,10 @@ mChooserDialog.removeItemFromList("key2"); assertEquals(2, itemAdapter.getCount()); // Make sure the remaining items are item 1 and item 3. - assertTrue(itemAdapter.getItem(0).hasSameContents("key1", "desc1")); - assertTrue(itemAdapter.getItem(1).hasSameContents("key3", "desc1")); + assertTrue(itemAdapter.getItem(0).hasSameContents( + "key1", "desc1", null /* icon */, null /* iconDescription */)); + assertTrue(itemAdapter.getItem(1).hasSameContents( + "key3", "desc1", null /* icon */, null /* iconDescription */)); assertEquals("desc1 (key1)", itemAdapter.getDisplayText(0)); assertEquals("desc1 (key3)", itemAdapter.getDisplayText(1)); @@ -488,7 +835,8 @@ mChooserDialog.removeItemFromList("key1"); assertEquals(1, itemAdapter.getCount()); // Make sure the remaining item is item 3. - assertTrue(itemAdapter.getItem(0).hasSameContents("key3", "desc1")); + assertTrue(itemAdapter.getItem(0).hasSameContents( + "key3", "desc1", null /* icon */, null /* iconDescription */)); // After removing item 1, item 3 is the only remaining item, so its display text // also changed to its original description. assertEquals("desc1", itemAdapter.getDisplayText(0));
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index 5cd608e3..39ab003 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn
@@ -569,8 +569,6 @@ "media/webrtc/desktop_streams_registry.h", "media/webrtc/media_capture_devices_dispatcher.cc", "media/webrtc/media_capture_devices_dispatcher.h", - "media/webrtc/media_permission.cc", - "media/webrtc/media_permission.h", "media/webrtc/media_stream_capture_indicator.cc", "media/webrtc/media_stream_capture_indicator.h", "media/webrtc/media_stream_device_permission_context.cc",
diff --git a/chrome/browser/media/webrtc/media_permission.cc b/chrome/browser/media/webrtc/media_permission.cc deleted file mode 100644 index e1171119..0000000 --- a/chrome/browser/media/webrtc/media_permission.cc +++ /dev/null
@@ -1,52 +0,0 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/media/webrtc/media_permission.h" - -#include "chrome/browser/permissions/permission_context_base.h" -#include "chrome/browser/permissions/permission_manager.h" -#include "chrome/browser/profiles/profile.h" -#include "chrome/common/pref_names.h" -#include "content/public/browser/permission_manager.h" -#include "content/public/browser/web_contents.h" -#include "content/public/common/url_constants.h" -#include "extensions/common/constants.h" - -MediaPermission::MediaPermission(ContentSettingsType content_type, - const GURL& requesting_origin, - const GURL& embedding_origin, - Profile* profile, - content::WebContents* web_contents) - : content_type_(content_type), - requesting_origin_(requesting_origin), - embedding_origin_(embedding_origin), - profile_(profile), - web_contents_(web_contents) { - // Currently |web_contents_| is only used on ChromeOS but it's not worth - // #ifdef'ing out all its usage, so just mark it used here. - (void)web_contents_; -} - -ContentSetting MediaPermission::GetPermissionStatus( - content::MediaStreamRequestResult* denial_reason) const { - DCHECK(!requesting_origin_.is_empty()); - - PermissionManager* permission_manager = PermissionManager::Get(profile_); - - // Find out if the kill switch is on. Set the denial reason to kill switch. - if (permission_manager->IsPermissionKillSwitchOn(content_type_)) { - *denial_reason = content::MEDIA_DEVICE_KILL_SWITCH_ON; - return CONTENT_SETTING_BLOCK; - } - - // Check policy and content settings. - ContentSetting content_setting = - permission_manager - ->GetPermissionStatus(content_type_, requesting_origin_, - embedding_origin_) - .content_setting; - if (content_setting == CONTENT_SETTING_BLOCK) - *denial_reason = content::MEDIA_DEVICE_PERMISSION_DENIED; - return content_setting; -}
diff --git a/chrome/browser/media/webrtc/media_permission.h b/chrome/browser/media/webrtc/media_permission.h deleted file mode 100644 index ef7a883..0000000 --- a/chrome/browser/media/webrtc/media_permission.h +++ /dev/null
@@ -1,50 +0,0 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_MEDIA_WEBRTC_MEDIA_PERMISSION_H_ -#define CHROME_BROWSER_MEDIA_WEBRTC_MEDIA_PERMISSION_H_ - -#include <string> - -#include "base/macros.h" -#include "components/content_settings/core/common/content_settings.h" -#include "components/content_settings/core/common/content_settings_types.h" -#include "content/public/common/media_stream_request.h" -#include "url/gurl.h" - -class Profile; - -namespace content { -class WebContents; -} - -// Represents a permission for microphone/camera access. -class MediaPermission { - public: - MediaPermission(ContentSettingsType content_type, - const GURL& requesting_origin, - const GURL& embedding_origin, - Profile* profile, - content::WebContents* web_contents); - - // Returns the status of the permission. If the setting is - // CONTENT_SETTING_BLOCK, |denial_reason| will output the reason for it being - // blocked. - ContentSetting GetPermissionStatus( - content::MediaStreamRequestResult* denial_reason) const; - - private: - bool HasAvailableDevices(const std::string& device_id) const; - - const ContentSettingsType content_type_; - const GURL requesting_origin_; - const GURL embedding_origin_; - const std::string device_id_; - Profile* const profile_; - content::WebContents* const web_contents_; - - DISALLOW_COPY_AND_ASSIGN(MediaPermission); -}; - -#endif // CHROME_BROWSER_MEDIA_WEBRTC_MEDIA_PERMISSION_H_
diff --git a/chrome/browser/media/webrtc/media_stream_devices_controller.cc b/chrome/browser/media/webrtc/media_stream_devices_controller.cc index 780fc5f8..8c210a4 100644 --- a/chrome/browser/media/webrtc/media_stream_devices_controller.cc +++ b/chrome/browser/media/webrtc/media_stream_devices_controller.cc
@@ -15,9 +15,10 @@ #include "chrome/browser/content_settings/host_content_settings_map_factory.h" #include "chrome/browser/content_settings/tab_specific_content_settings.h" #include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h" -#include "chrome/browser/media/webrtc/media_permission.h" #include "chrome/browser/media/webrtc/media_stream_capture_indicator.h" #include "chrome/browser/media/webrtc/media_stream_device_permissions.h" +#include "chrome/browser/permissions/permission_manager.h" +#include "chrome/browser/permissions/permission_result.h" #include "chrome/browser/permissions/permission_uma_util.h" #include "chrome/browser/permissions/permission_util.h" #include "chrome/browser/profiles/profile.h" @@ -718,6 +719,7 @@ content::MediaStreamRequestResult* denial_reason) const { DCHECK(content_type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC || content_type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA); + DCHECK(!request_.security_origin.is_empty()); DCHECK(content::IsOriginSecure(request_.security_origin) || request_.request_type == content::MEDIA_OPEN_DEVICE_PEPPER_ONLY); if (!was_requested) { @@ -735,10 +737,17 @@ return CONTENT_SETTING_BLOCK; } - MediaPermission permission(content_type, request.security_origin, - web_contents_->GetLastCommittedURL().GetOrigin(), - profile_, web_contents_); - return permission.GetPermissionStatus(denial_reason); + PermissionResult result = + PermissionManager::Get(profile_)->GetPermissionStatus( + content_type, request.security_origin, + web_contents_->GetLastCommittedURL().GetOrigin()); + if (result.content_setting == CONTENT_SETTING_BLOCK) { + *denial_reason = (result.source == PermissionStatusSource::KILL_SWITCH) + ? content::MEDIA_DEVICE_KILL_SWITCH_ON + : content::MEDIA_DEVICE_PERMISSION_DENIED; + } + + return result.content_setting; } ContentSetting MediaStreamDevicesController::GetNewSetting(
diff --git a/chrome/browser/media/webrtc/permission_bubble_media_access_handler.cc b/chrome/browser/media/webrtc/permission_bubble_media_access_handler.cc index 209f2c9..78e4f7fc 100644 --- a/chrome/browser/media/webrtc/permission_bubble_media_access_handler.cc +++ b/chrome/browser/media/webrtc/permission_bubble_media_access_handler.cc
@@ -7,9 +7,10 @@ #include <utility> #include "base/metrics/field_trial.h" -#include "chrome/browser/media/webrtc/media_permission.h" #include "chrome/browser/media/webrtc/media_stream_device_permissions.h" #include "chrome/browser/media/webrtc/media_stream_devices_controller.h" +#include "chrome/browser/permissions/permission_manager.h" +#include "chrome/browser/permissions/permission_result.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/pref_names.h" #include "components/content_settings/core/browser/host_content_settings_map.h" @@ -82,11 +83,13 @@ ? CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC : CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA; - MediaPermission permission(content_settings_type, security_origin, - web_contents->GetLastCommittedURL().GetOrigin(), - profile, web_contents); - content::MediaStreamRequestResult unused; - return permission.GetPermissionStatus(&unused) == CONTENT_SETTING_ALLOW; + DCHECK(!security_origin.is_empty()); + GURL embedding_origin = web_contents->GetLastCommittedURL().GetOrigin(); + PermissionManager* permission_manager = PermissionManager::Get(profile); + return permission_manager + ->GetPermissionStatus(content_settings_type, security_origin, + embedding_origin) + .content_setting == CONTENT_SETTING_ALLOW; } void PermissionBubbleMediaAccessHandler::HandleRequest(
diff --git a/chrome/browser/permissions/grouped_permission_infobar_delegate_android.cc b/chrome/browser/permissions/grouped_permission_infobar_delegate_android.cc index d06a8a33..31b01c9 100644 --- a/chrome/browser/permissions/grouped_permission_infobar_delegate_android.cc +++ b/chrome/browser/permissions/grouped_permission_infobar_delegate_android.cc
@@ -83,10 +83,6 @@ permission_prompt_->Closing(); } -void GroupedPermissionInfoBarDelegate::PermissionPromptDestroyed() { - permission_prompt_ = nullptr; -} - GroupedPermissionInfoBarDelegate::GroupedPermissionInfoBarDelegate( PermissionPromptAndroid* permission_prompt, const GURL& requesting_origin) @@ -124,3 +120,10 @@ return l10n_util::GetStringUTF16((button == BUTTON_OK) ? IDS_PERMISSION_ALLOW : IDS_PERMISSION_DENY); } + +bool GroupedPermissionInfoBarDelegate::EqualsDelegate( + infobars::InfoBarDelegate* delegate) const { + // The PermissionRequestManager doesn't create duplicate infobars so a pointer + // equality check is sufficient. + return this == delegate; +}
diff --git a/chrome/browser/permissions/grouped_permission_infobar_delegate_android.h b/chrome/browser/permissions/grouped_permission_infobar_delegate_android.h index 15839fb..148379c94 100644 --- a/chrome/browser/permissions/grouped_permission_infobar_delegate_android.h +++ b/chrome/browser/permissions/grouped_permission_infobar_delegate_android.h
@@ -50,8 +50,6 @@ bool Cancel() override; void InfoBarDismissed() override; - void PermissionPromptDestroyed(); - protected: bool GetAcceptState(size_t position); @@ -65,6 +63,9 @@ int GetButtons() const override; base::string16 GetButtonLabel(InfoBarButton button) const override; + // InfoBarDelegate: + bool EqualsDelegate(infobars::InfoBarDelegate* delegate) const override; + const GURL requesting_origin_; // Whether the accept/deny decision is persisted. bool persist_;
diff --git a/chrome/browser/permissions/permission_prompt_android.cc b/chrome/browser/permissions/permission_prompt_android.cc index 607b369d1..35e1d74d 100644 --- a/chrome/browser/permissions/permission_prompt_android.cc +++ b/chrome/browser/permissions/permission_prompt_android.cc
@@ -6,26 +6,16 @@ #include "base/memory/ptr_util.h" #include "chrome/browser/infobars/infobar_service.h" -#include "chrome/browser/media/webrtc/media_stream_devices_controller.h" #include "chrome/browser/permissions/grouped_permission_infobar_delegate_android.h" #include "chrome/browser/permissions/permission_request.h" -#include "chrome/browser/permissions/permission_request_id.h" -#include "components/infobars/core/infobar.h" -#include "content/public/browser/web_contents.h" PermissionPromptAndroid::PermissionPromptAndroid( content::WebContents* web_contents) - : web_contents_(web_contents), delegate_(nullptr), infobar_(nullptr) { + : web_contents_(web_contents), delegate_(nullptr) { DCHECK(web_contents); } -PermissionPromptAndroid::~PermissionPromptAndroid() { - if (infobar_) { - GroupedPermissionInfoBarDelegate* infobar_delegate = - static_cast<GroupedPermissionInfoBarDelegate*>(infobar_->delegate()); - infobar_delegate->PermissionPromptDestroyed(); - } -} +PermissionPromptAndroid::~PermissionPromptAndroid() {} void PermissionPromptAndroid::SetDelegate(Delegate* delegate) { delegate_ = delegate; @@ -40,25 +30,26 @@ return; requests_ = requests; - infobar_ = GroupedPermissionInfoBarDelegate::Create(this, infobar_service, - requests[0]->GetOrigin()); + GroupedPermissionInfoBarDelegate::Create(this, infobar_service, + requests[0]->GetOrigin()); } bool PermissionPromptAndroid::CanAcceptRequestUpdate() { return false; } +bool PermissionPromptAndroid::HidesAutomatically() { + return true; +} + void PermissionPromptAndroid::Hide() { - InfoBarService* infobar_service = - InfoBarService::FromWebContents(web_contents_); - if (infobar_ && infobar_service) { - infobar_service->RemoveInfoBar(infobar_); - } - infobar_ = nullptr; + // Hide() is only called if HidesAutomatically() returns false or + // CanAcceptRequestUpdate() return true. + NOTREACHED(); } bool PermissionPromptAndroid::IsVisible() { - return infobar_ != nullptr; + return !requests_.empty(); } void PermissionPromptAndroid::UpdateAnchorPosition() {
diff --git a/chrome/browser/permissions/permission_prompt_android.h b/chrome/browser/permissions/permission_prompt_android.h index 45c9ee6..021aaac 100644 --- a/chrome/browser/permissions/permission_prompt_android.h +++ b/chrome/browser/permissions/permission_prompt_android.h
@@ -17,10 +17,6 @@ class WebContents; } -namespace infobars { -class InfoBar; -} - class PermissionPromptAndroid : public PermissionPrompt { public: explicit PermissionPromptAndroid(content::WebContents* web_contents); @@ -31,6 +27,7 @@ void Show(const std::vector<PermissionRequest*>& requests, const std::vector<bool>& accept_state) override; bool CanAcceptRequestUpdate() override; + bool HidesAutomatically() override; void Hide() override; bool IsVisible() override; void UpdateAnchorPosition() override; @@ -53,9 +50,6 @@ content::WebContents* web_contents_; // |delegate_| is the PermissionRequestManager, which owns this object. Delegate* delegate_; - // |infobar_| is owned by the InfoBarService; we keep a pointer here so we can - // ask the service to remove the infobar after it is added. - infobars::InfoBar* infobar_; // The current request being displayed (if any). std::vector<PermissionRequest*> requests_;
diff --git a/chrome/browser/permissions/permission_request_manager.cc b/chrome/browser/permissions/permission_request_manager.cc index 35dc5ec8..ead3d56 100644 --- a/chrome/browser/permissions/permission_request_manager.cc +++ b/chrome/browser/permissions/permission_request_manager.cc
@@ -229,19 +229,14 @@ } void PermissionRequestManager::HideBubble() { -#if defined(ANDROID) - // The infobar system manages infobar lifetime and visibility so don't delete - // the PermissionPromptAndroid. - NOTREACHED(); -#else - // Disengage from the existing view if there is one. - if (!view_) + // Disengage from the existing view if there is one and it doesn't manage + // its own visibility. + if (!view_ || view_->HidesAutomatically()) return; view_->SetDelegate(nullptr); view_->Hide(); view_.reset(); -#endif } void PermissionRequestManager::DisplayPendingRequests() { @@ -412,7 +407,7 @@ } void PermissionRequestManager::FinalizeBubble() { - if (view_) + if (view_ && !view_->HidesAutomatically()) view_->Hide(); std::vector<PermissionRequest*>::iterator requests_iter;
diff --git a/chrome/browser/printing/print_view_manager.cc b/chrome/browser/printing/print_view_manager.cc index bce16741..29cb6876 100644 --- a/chrome/browser/printing/print_view_manager.cc +++ b/chrome/browser/printing/print_view_manager.cc
@@ -31,9 +31,8 @@ // Keeps track of pending scripted print preview closures. // No locking, only access on the UI thread. -base::LazyInstance<std::map<content::RenderProcessHost*, base::Closure>>:: - DestructorAtExit g_scripted_print_preview_closure_map = - LAZY_INSTANCE_INITIALIZER; +base::LazyInstance<std::map<content::RenderProcessHost*, base::Closure>>::Leaky + g_scripted_print_preview_closure_map = LAZY_INSTANCE_INITIALIZER; void EnableInternalPDFPluginForContents(int render_process_id, int render_frame_id) {
diff --git a/chrome/browser/resources/md_bookmarks/app.js b/chrome/browser/resources/md_bookmarks/app.js index 5a8cac2..ed59f5e 100644 --- a/chrome/browser/resources/md_bookmarks/app.js +++ b/chrome/browser/resources/md_bookmarks/app.js
@@ -82,18 +82,19 @@ var splitterTarget = this.$.sidebar; // The splitter persists the size of the left component in the local store. - if ('treeWidth' in window.localStorage) { - splitterTarget.style.width = window.localStorage['treeWidth']; - this.sidebarWidth_ = splitterTarget.getComputedStyleValue('width'); + if (LOCAL_STORAGE_TREE_WIDTH_KEY in window.localStorage) { + splitterTarget.style.width = + window.localStorage[LOCAL_STORAGE_TREE_WIDTH_KEY]; } + this.sidebarWidth_ = splitterTarget.getComputedStyleValue('width'); splitter.addEventListener('resize', function(e) { - window.localStorage['treeWidth'] = splitterTarget.style.width; - // TODO(calamity): This only fires when the resize is complete. This - // should be updated on every width change. + window.localStorage[LOCAL_STORAGE_TREE_WIDTH_KEY] = + splitterTarget.style.width; this.updateSidebarWidth_(); }.bind(this)); + splitter.addEventListener('dragmove', this.boundUpdateSidebarWidth_); window.addEventListener('resize', this.boundUpdateSidebarWidth_); },
diff --git a/chrome/browser/resources/md_bookmarks/constants.js b/chrome/browser/resources/md_bookmarks/constants.js index f6757aa..95949765 100644 --- a/chrome/browser/resources/md_bookmarks/constants.js +++ b/chrome/browser/resources/md_bookmarks/constants.js
@@ -16,7 +16,10 @@ }; /** @const */ -var LOCAL_STORAGE_CLOSED_FOLDERS_KEY = 'bookmarkManagerClosedState'; +var LOCAL_STORAGE_CLOSED_FOLDERS_KEY = 'closedState'; + +/** @const */ +var LOCAL_STORAGE_TREE_WIDTH_KEY = 'treeWidth'; /** @const */ var ROOT_NODE_ID = '0';
diff --git a/chrome/browser/resources/md_bookmarks/dnd_manager.js b/chrome/browser/resources/md_bookmarks/dnd_manager.js index 89d2662..9f3d089 100644 --- a/chrome/browser/resources/md_bookmarks/dnd_manager.js +++ b/chrome/browser/resources/md_bookmarks/dnd_manager.js
@@ -20,6 +20,14 @@ } /** + * @param {BookmarkElement} element + * @return {boolean} + */ + function isBookmarkList(element) { + return element.tagName == 'BOOKMARKS-LIST'; + } + + /** * @param {Array<!Element>|undefined} path * @return {BookmarkElement} */ @@ -28,7 +36,8 @@ return null; for (var i = 0; i < path.length; i++) { - if (isBookmarkItem(path[i]) || isBookmarkFolderNode(path[i])) + if (isBookmarkItem(path[i]) || isBookmarkFolderNode(path[i]) || + isBookmarkList(path[i])) return path[i]; } return null; @@ -342,6 +351,13 @@ * @return {{parentId: string, index: number}} */ calculateDropInfo_: function(dropDestination) { + if (isBookmarkList(dropDestination.element)) { + return { + index: 0, + parentId: bookmarks.Store.getInstance().data.selectedFolder, + }; + } + var node = getBookmarkNode(dropDestination.element); var position = dropDestination.position; var index = -1; @@ -502,18 +518,21 @@ calculateValidDropPositions_: function(overElement) { var dragInfo = this.dragInfo_; var state = bookmarks.Store.getInstance().data; + var itemId = overElement.itemId; // Drags aren't allowed onto the search result list. - if (isBookmarkItem(overElement) && + if ((isBookmarkList(overElement) || isBookmarkItem(overElement)) && bookmarks.util.isShowingSearch(state)) { return DropPosition.NONE; } + if (isBookmarkList(overElement)) + itemId = state.selectedFolder; + // Drags of a bookmark onto itself or of a folder into its children aren't // allowed. - if (dragInfo.isDraggingBookmark(overElement.itemId) || - dragInfo.isDraggingFolderToDescendant( - overElement.itemId, state.nodes)) { + if (dragInfo.isDraggingBookmark(itemId) || + dragInfo.isDraggingFolderToDescendant(itemId, state.nodes)) { return DropPosition.NONE; } @@ -533,6 +552,9 @@ var dragInfo = this.dragInfo_; var state = bookmarks.Store.getInstance().data; + if (isBookmarkList(overElement)) + return DropPosition.NONE; + // We cannot drop between Bookmarks bar and Other bookmarks. if (getBookmarkNode(overElement).parentId == ROOT_NODE_ID) return DropPosition.NONE; @@ -579,6 +601,13 @@ * target. */ canDropOn_: function(overElement) { + // Allow dragging onto empty bookmark lists. + if (isBookmarkList(overElement)) { + var state = bookmarks.Store.getInstance().data; + return state.selectedFolder && + state.nodes[state.selectedFolder].children.length == 0; + } + // We can only drop on a folder. if (getBookmarkNode(overElement).url) return false;
diff --git a/chrome/browser/resources/md_bookmarks/folder_node.js b/chrome/browser/resources/md_bookmarks/folder_node.js index e9e204e..2800bf0 100644 --- a/chrome/browser/resources/md_bookmarks/folder_node.js +++ b/chrome/browser/resources/md_bookmarks/folder_node.js
@@ -30,11 +30,14 @@ selectedFolder_: String, /** @private */ + searchActive_: Boolean, + + /** @private */ isSelectedFolder_: { type: Boolean, value: false, reflectToAttribute: true, - computed: 'computeIsSelected_(itemId, selectedFolder_)' + computed: 'computeIsSelected_(itemId, selectedFolder_, searchActive_)' }, }, @@ -49,6 +52,9 @@ this.watch('selectedFolder_', function(state) { return state.selectedFolder; }); + this.watch('searchActive_', function(state) { + return bookmarks.util.isShowingSearch(state); + }); this.updateFromStore(); }, @@ -88,8 +94,8 @@ * @param {string} selectedFolder * @return {boolean} */ - computeIsSelected_: function(itemId, selectedFolder) { - return itemId == selectedFolder; + computeIsSelected_: function(itemId, selectedFolder, searchActive) { + return itemId == selectedFolder && !searchActive; }, /**
diff --git a/chrome/browser/resources/md_bookmarks/item.html b/chrome/browser/resources/md_bookmarks/item.html index cf5fa27..1dba8c73 100644 --- a/chrome/browser/resources/md_bookmarks/item.html +++ b/chrome/browser/resources/md_bookmarks/item.html
@@ -66,7 +66,7 @@ [[item_.title]] </div> <button is="paper-icon-button-light" class="more-vert-button" - on-click="onMenuButtonOpenClick_"> + on-click="onMenuButtonClick_" on-dblclick="onMenuButtonDblClick_"> <div></div> <div></div> <div></div>
diff --git a/chrome/browser/resources/md_bookmarks/item.js b/chrome/browser/resources/md_bookmarks/item.js index 73b606a..d761f65 100644 --- a/chrome/browser/resources/md_bookmarks/item.js +++ b/chrome/browser/resources/md_bookmarks/item.js
@@ -61,14 +61,24 @@ * @param {Event} e * @private */ - onMenuButtonOpenClick_: function(e) { + onMenuButtonClick_: function(e) { e.stopPropagation(); + this.dispatch(bookmarks.actions.selectItem( + this.itemId, false, false, this.getState())); this.fire('open-item-menu', { target: e.target, item: this.item_, }); }, + /** + * @param {Event} e + * @private + */ + onMenuButtonDblClick_: function(e) { + e.stopPropagation(); + }, + /** @private */ onItemIdChanged_: function() { // TODO(tsergeant): Add a histogram to measure whether this assertion fails @@ -79,7 +89,7 @@ /** @private */ onItemChanged_: function() { - this.isFolder_ = !(this.item_.url); + this.isFolder_ = !this.item_.url; }, /**
diff --git a/chrome/browser/resources/md_bookmarks/list.html b/chrome/browser/resources/md_bookmarks/list.html index 0ff6604..bd48028 100644 --- a/chrome/browser/resources/md_bookmarks/list.html +++ b/chrome/browser/resources/md_bookmarks/list.html
@@ -53,7 +53,7 @@ </bookmarks-item> </template> </div> - <div class="centered-message" + <div id="message" class="centered-message" hidden$="[[!isEmptyList_(displayedList_.length)]]"> [[emptyListMessage_(searchTerm_)]] </div>
diff --git a/chrome/browser/resources/md_bookmarks/list.js b/chrome/browser/resources/md_bookmarks/list.js index 19e475d..6952696a 100644 --- a/chrome/browser/resources/md_bookmarks/list.js +++ b/chrome/browser/resources/md_bookmarks/list.js
@@ -42,6 +42,10 @@ this.updateFromStore(); }, + getDropTarget: function() { + return this.$.message; + }, + /** * @param {Event} e * @private
diff --git a/chrome/browser/resources/md_bookmarks/reducers.js b/chrome/browser/resources/md_bookmarks/reducers.js index b5cfabe..b0d0a926 100644 --- a/chrome/browser/resources/md_bookmarks/reducers.js +++ b/chrome/browser/resources/md_bookmarks/reducers.js
@@ -304,10 +304,10 @@ }; /** - * @param {?string} selectedFolder + * @param {string} selectedFolder * @param {Action} action * @param {NodeList} nodes - * @return {?string} + * @return {string} */ SelectedFolderState.updateSelectedFolder = function( selectedFolder, action, nodes) { @@ -324,12 +324,6 @@ return action.id; } return selectedFolder; - case 'finish-search': - return null; - case 'clear-search': - // TODO(tsergeant): Return to the folder that was selected before the - // search. - return nodes[ROOT_NODE_ID].children[0]; case 'remove-bookmark': // When deleting the selected folder (or its ancestor), select the // parent of the deleted node.
diff --git a/chrome/browser/resources/md_bookmarks/types.js b/chrome/browser/resources/md_bookmarks/types.js index 82302a9..8eb1a37 100644 --- a/chrome/browser/resources/md_bookmarks/types.js +++ b/chrome/browser/resources/md_bookmarks/types.js
@@ -51,7 +51,7 @@ /** * @typedef {{ * nodes: NodeList, - * selectedFolder: ?string, + * selectedFolder: string, * closedFolders: ClosedFolderState, * search: SearchState, * selection: SelectionState,
diff --git a/chrome/browser/resources/md_bookmarks/util.js b/chrome/browser/resources/md_bookmarks/util.js index a8e70f0..c6e4c00 100644 --- a/chrome/browser/resources/md_bookmarks/util.js +++ b/chrome/browser/resources/md_bookmarks/util.js
@@ -8,12 +8,14 @@ cr.define('bookmarks.util', function() { /** + * Returns the list of bookmark IDs to be displayed in the UI, taking into + * account search and the currently selected folder. * @param {!BookmarksPageState} state * @return {!Array<string>} */ function getDisplayedList(state) { if (!isShowingSearch(state)) - return assert(state.nodes[assert(state.selectedFolder)].children); + return assert(state.nodes[state.selectedFolder].children); return state.search.results; } @@ -82,10 +84,10 @@ /** * @param {BookmarksPageState} state - * @return boolean + * @return {boolean} */ function isShowingSearch(state) { - return !state.selectedFolder; + return !!state.search.term && !state.search.inProgress; } /**
diff --git a/chrome/browser/resources/md_history/compiled_resources2.gyp b/chrome/browser/resources/md_history/compiled_resources2.gyp index daf2ec50..e372e5a 100644 --- a/chrome/browser/resources/md_history/compiled_resources2.gyp +++ b/chrome/browser/resources/md_history/compiled_resources2.gyp
@@ -58,6 +58,7 @@ 'target_name': 'history_toolbar', 'dependencies': [ '<(DEPTH)/ui/webui/resources/cr_elements/cr_toolbar/compiled_resources2.gyp:cr_toolbar', + '<(DEPTH)/ui/webui/resources/cr_elements/cr_toolbar/compiled_resources2.gyp:cr_toolbar_selection_overlay', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:load_time_data', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:util', 'constants',
diff --git a/chrome/browser/resources/md_history/history_toolbar.html b/chrome/browser/resources/md_history/history_toolbar.html index 8cebe69..2a69ab5 100644 --- a/chrome/browser/resources/md_history/history_toolbar.html +++ b/chrome/browser/resources/md_history/history_toolbar.html
@@ -1,51 +1,43 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html"> -<link rel="import" href="chrome://resources/cr_elements/icons.html"> <link rel="import" href="chrome://resources/cr_elements/cr_lazy_render/cr_lazy_render.html"> <link rel="import" href="chrome://resources/cr_elements/cr_toolbar/cr_toolbar.html"> <link rel="import" href="chrome://history/browser_service.html"> <link rel="import" href="chrome://history/icons.html"> <link rel="import" href="chrome://history/shared_style.html"> -<!-- Lazy loaded: iron-dropdown, paper-button, paper-icon-button-light. --> +<!-- Lazy loaded: cr-toolbar-selection-overlay. --> <dom-module id="history-toolbar"> <template> <style include="shared-style"> :host { color: #fff; - display: block; + display: flex; transition: background-color 150ms; - width: 100%; } /* General toolbar layout. */ - cr-toolbar, - #overlay-buttons, - #overlay-wrapper, - #toolbar-container { - align-items: center; - display: flex; - width: 100%; - } - :host([items-selected_]) { background: var(--interactive-color); } - #toolbar-container { - height: var(--toolbar-height); - } - - cr-toolbar { + cr-toolbar, + cr-toolbar-selection-overlay { --cr-toolbar-field-margin: var(--side-bar-width); + flex: 1; } - :host([has-drawer]) cr-toolbar { + :host([has-drawer]) cr-toolbar, + :host([has-drawer]) cr-toolbar-selection-overlay { --cr-toolbar-field-margin: 0; } + cr-toolbar-selection-overlay { + --selection-overlay-max-width: var(--card-max-width); + } + /* Info button and dropdown. */ #info-button { @@ -79,83 +71,44 @@ } :host-context([dir=rtl]) #sync-notice { - right: auto; left: 24px; - } - - /* Selection overlay. */ - - :host(:not([has-drawer])) #overlay-wrapper { - -webkit-margin-start: var(--side-bar-width); - } - - #overlay-buttons { - margin: 0 auto; - max-width: var(--card-max-width); - padding: 0 var(--card-padding-side); - } - - paper-button { - font-weight: 500; - } - - #number-selected { - flex: 1; - } - - #cancel-icon-button { - -webkit-margin-end: 24px; - -webkit-margin-start: 2px; + right: auto; } </style> - <div id="toolbar-container"> - <cr-toolbar id="main-toolbar" - page-name="$i18n{title}" - clear-label="$i18n{clearSearch}" - search-prompt="$i18n{searchPrompt}" - hidden$="[[itemsSelected_]]" - spinner-active="[[spinnerActive]]" - show-menu="[[hasDrawer]]" - show-menu-promo="[[showMenuPromo]]" - menu-label="$i18n{historyMenuButton}" - menu-promo="$i18n{menuPromo}" - close-menu-promo="$i18n{closeMenuPromo}" - on-search-changed="onSearchChanged_"> - <div class="more-actions"> - <template is="dom-if" if="[[showSyncNotice]]"> - <button is="paper-icon-button-light" id="info-button" - on-click="onInfoButtonTap_" - aria-label="$i18n{hasSyncedResultsDescription}"> - <iron-icon icon="history:info-outline" id="info-button-icon"> - </iron-icon> - </button> - </template> - </div> - </cr-toolbar> - <div id="sync-notice" hidden="[[!syncNoticeVisible_]]"> - $i18nRaw{hasSyncedResults} + <cr-toolbar id="main-toolbar" + page-name="$i18n{title}" + clear-label="$i18n{clearSearch}" + search-prompt="$i18n{searchPrompt}" + hidden$="[[itemsSelected_]]" + spinner-active="[[spinnerActive]]" + show-menu="[[hasDrawer]]" + show-menu-promo="[[showMenuPromo]]" + menu-label="$i18n{historyMenuButton}" + menu-promo="$i18n{menuPromo}" + close-menu-promo="$i18n{closeMenuPromo}" + on-search-changed="onSearchChanged_"> + <div class="more-actions"> + <template is="dom-if" if="[[showSyncNotice]]"> + <button is="paper-icon-button-light" id="info-button" + on-click="onInfoButtonTap_" + aria-label="$i18n{hasSyncedResultsDescription}"> + <iron-icon icon="history:info-outline" id="info-button-icon"> + </iron-icon> + </button> + </template> </div> - <template is="dom-if" if="[[itemsSelected_]]"> - <div id="overlay-wrapper" hidden$="[[!itemsSelected_]]"> - <div id="overlay-buttons"> - <button is="paper-icon-button-light" - id="cancel-icon-button" - class="icon-button" - on-tap="onClearSelectionTap_" - title="$i18n{cancel}"> - <iron-icon icon="cr:clear"></iron-icon> - </button> - <div id="number-selected">[[numberOfItemsSelected_(count)]]</div> - <paper-button id="cancel-button" on-tap="onClearSelectionTap_"> - $i18n{cancel} - </paper-button> - <paper-button id="delete-button" on-tap="onDeleteTap_"> - $i18n{delete} - </paper-button> - </div> - </div> - </template> + </cr-toolbar> + <div id="sync-notice" hidden="[[!syncNoticeVisible_]]"> + $i18nRaw{hasSyncedResults} </div> + <template is="dom-if" if="[[itemsSelected_]]"> + <cr-toolbar-selection-overlay delete-label="$i18n{delete}" + cancel-label="$i18n{cancel}" + selection-label="[[numberOfItemsSelected_(count)]]" + on-clear-selected-items="clearSelectedItems" + on-delete-selected-items="deleteSelectedItems"> + </cr-toolbar-selection-overlay> + </template> </template> <script src="chrome://history/history_toolbar.js"></script> </dom-module>
diff --git a/chrome/browser/resources/md_history/history_toolbar.js b/chrome/browser/resources/md_history/history_toolbar.js index 2a42bd5..62da493 100644 --- a/chrome/browser/resources/md_history/history_toolbar.js +++ b/chrome/browser/resources/md_history/history_toolbar.js
@@ -96,6 +96,14 @@ this.searchField.showAndFocus(); }, + deleteSelectedItems: function() { + this.fire('delete-selected'); + }, + + clearSelectedItems: function() { + this.fire('unselect-all'); + }, + /** * Changes the toolbar background color depending on whether any history items * are currently selected. @@ -169,16 +177,6 @@ }, /** @private */ - onClearSelectionTap_: function() { - this.fire('unselect-all'); - }, - - /** @private */ - onDeleteTap_: function() { - this.fire('delete-selected'); - }, - - /** @private */ numberOfItemsSelected_: function(count) { return count > 0 ? loadTimeData.getStringF('itemsSelected', count) : ''; },
diff --git a/chrome/browser/resources/md_history/lazy_load.html b/chrome/browser/resources/md_history/lazy_load.html index 7a5a1c0a..666fd68 100644 --- a/chrome/browser/resources/md_history/lazy_load.html +++ b/chrome/browser/resources/md_history/lazy_load.html
@@ -2,5 +2,6 @@ <link rel="import" href="chrome://resources/cr_elements/cr_action_menu/cr_action_menu.html"> <link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html"> <link rel="import" href="chrome://resources/cr_elements/cr_drawer/cr_drawer.html"> +<link rel="import" href="chrome://resources/cr_elements/cr_toolbar/cr_toolbar_selection_overlay.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html">
diff --git a/chrome/browser/resources/settings/a11y_page/a11y_page.html b/chrome/browser/resources/settings/a11y_page/a11y_page.html index c37925e..2913814d 100644 --- a/chrome/browser/resources/settings/a11y_page/a11y_page.html +++ b/chrome/browser/resources/settings/a11y_page/a11y_page.html
@@ -16,7 +16,7 @@ <style include="settings-shared"></style> <if expr="chromeos"> <settings-animated-pages id="pages" current-route="{{currentRoute}}" - section="a11y"> + section="a11y" focus-config="[[focusConfig_]]"> <neon-animatable route-path="default"> <div class="settings-box"> <settings-toggle-button id="optionsInMenuToggle"
diff --git a/chrome/browser/resources/settings/a11y_page/a11y_page.js b/chrome/browser/resources/settings/a11y_page/a11y_page.js index be4d808..0bcbcbc 100644 --- a/chrome/browser/resources/settings/a11y_page/a11y_page.js +++ b/chrome/browser/resources/settings/a11y_page/a11y_page.js
@@ -27,6 +27,20 @@ type: Object, notify: true, }, + + /** @private {!Map<string, string>} */ + focusConfig_: { + type: Object, + value: function() { + var map = new Map(); +// <if expr="chromeos"> + map.set( + settings.Route.MANAGE_ACCESSIBILITY.path, + '#subpage-trigger .subpage-arrow'); +// </if> + return map; + }, + }, }, // <if expr="chromeos">
diff --git a/chrome/browser/resources/settings/appearance_page/appearance_page.html b/chrome/browser/resources/settings/appearance_page/appearance_page.html index f14c98e..1082903 100644 --- a/chrome/browser/resources/settings/appearance_page/appearance_page.html +++ b/chrome/browser/resources/settings/appearance_page/appearance_page.html
@@ -36,7 +36,8 @@ }; } </style> - <settings-animated-pages id="pages" section="appearance"> + <settings-animated-pages id="pages" section="appearance" + focus-config="[[focusConfig_]]"> <neon-animatable route-path="default"> <if expr="chromeos"> <div class="settings-box first two-line" id="wallpaperButton"
diff --git a/chrome/browser/resources/settings/appearance_page/appearance_page.js b/chrome/browser/resources/settings/appearance_page/appearance_page.js index 5518952b..9039741b3 100644 --- a/chrome/browser/resources/settings/appearance_page/appearance_page.js +++ b/chrome/browser/resources/settings/appearance_page/appearance_page.js
@@ -89,6 +89,18 @@ type: Boolean, value: false, // Can only be true on Linux, but value exists everywhere. }, + + /** @private {!Map<string, string>} */ + focusConfig_: { + type: Object, + value: function() { + var map = new Map(); + map.set( + settings.Route.FONTS.path, + '#customize-fonts-subpage-trigger .subpage-arrow'); + return map; + }, + }, }, /** @private {?settings.AppearanceBrowserProxy} */
diff --git a/chrome/browser/resources/settings/languages_page/languages_page.html b/chrome/browser/resources/settings/languages_page/languages_page.html index 93ea9f7..111cc244 100644 --- a/chrome/browser/resources/settings/languages_page/languages_page.html +++ b/chrome/browser/resources/settings/languages_page/languages_page.html
@@ -71,7 +71,8 @@ <settings-languages languages="{{languages}}" prefs="{{prefs}}" language-helper="{{languageHelper}}"> </settings-languages> - <settings-animated-pages id="pages" section="languages"> + <settings-animated-pages id="pages" section="languages" + focus-config="[[focusConfig_]]"> <neon-animatable route-path="default"> <div class$="settings-box first [[getLanguageListTwoLine_()]]" actionable on-tap="toggleExpandButton_">
diff --git a/chrome/browser/resources/settings/languages_page/languages_page.js b/chrome/browser/resources/settings/languages_page/languages_page.js index f5b0f3b..a04ef195 100644 --- a/chrome/browser/resources/settings/languages_page/languages_page.js +++ b/chrome/browser/resources/settings/languages_page/languages_page.js
@@ -58,6 +58,25 @@ /** @private */ showAddLanguagesDialog_: Boolean, + + /** @private {!Map<string, string>} */ + focusConfig_: { + type: Object, + value: function() { + var map = new Map(); +// <if expr="not is_macosx"> + map.set( + settings.Route.EDIT_DICTIONARY.path, + '#spellCheckCollapse .subpage-arrow'); +// </if> +// <if expr="chromeos"> + map.set( + settings.Route.INPUT_METHODS.path, + '#inputMethodsCollapse .subpage-arrow'); +// </if> + return map; + }, + }, }, /**
diff --git a/chrome/browser/resources/settings/people_page/people_page.html b/chrome/browser/resources/settings/people_page/people_page.html index 30ce4b1b..4d8794c5 100644 --- a/chrome/browser/resources/settings/people_page/people_page.html +++ b/chrome/browser/resources/settings/people_page/people_page.html
@@ -95,7 +95,8 @@ padding-top: 10px; } </style> - <settings-animated-pages id="pages" section="people"> + <settings-animated-pages id="pages" section="people" + focus-config="[[focusConfig_]]"> <neon-animatable route-path="default"> <div id="picture-subpage-trigger" class="settings-box first two-line"> <template is="dom-if" if="[[syncStatus]]"> @@ -213,8 +214,8 @@ prefs.settings.enable_screen_lock.value)]] </div> </div> - <button class="subpage-arrow" is="paper-icon-button-light" - aria-label="$i18n{lockScreenTitle}" + <button id="lockScreenSubpageTrigger" class="subpage-arrow" + is="paper-icon-button-light" aria-label="$i18n{lockScreenTitle}" aria-describedby="lockScrenSecondary"></button> </div> </template>
diff --git a/chrome/browser/resources/settings/people_page/people_page.js b/chrome/browser/resources/settings/people_page/people_page.js index c53125e2..e222cc4 100644 --- a/chrome/browser/resources/settings/people_page/people_page.js +++ b/chrome/browser/resources/settings/people_page/people_page.js
@@ -145,6 +145,32 @@ value: false, }, // </if> + + /** @private {!Map<string, string>} */ + focusConfig_: { + type: Object, + value: function() { + var map = new Map(); + map.set( + settings.Route.SYNC.path, '#sync-status .subpage-arrow'); +// <if expr="not chromeos"> + map.set( + settings.Route.MANAGE_PROFILE.path, + '#picture-subpage-trigger .subpage-arrow'); +// </if> +// <if expr="chromeos"> + map.set( + settings.Route.CHANGE_PICTURE.path, + '#picture-subpage-trigger .subpage-arrow'); + map.set( + settings.Route.LOCK_SCREEN.path, '#lockScreenSubpageTrigger'); + map.set( + settings.Route.ACCOUNTS.path, + '#manage-other-people-subpage-trigger .subpage-arrow'); +// </if> + return map; + }, + }, }, /** @override */
diff --git a/chrome/browser/resources/settings/printing_page/printing_page.html b/chrome/browser/resources/settings/printing_page/printing_page.html index dbfa5cf..29ebbe9f 100644 --- a/chrome/browser/resources/settings/printing_page/printing_page.html +++ b/chrome/browser/resources/settings/printing_page/printing_page.html
@@ -14,7 +14,8 @@ <dom-module id="settings-printing-page"> <template> <style include="settings-shared"></style> - <settings-animated-pages id="pages" section="printing"> + <settings-animated-pages id="pages" section="printing" + focus-config="[[focusConfig_]]"> <array-selector id="arraySelector" items="{{cupsPrinters}}" selected="{{detailPrinter_}}"> </array-selector>
diff --git a/chrome/browser/resources/settings/printing_page/printing_page.js b/chrome/browser/resources/settings/printing_page/printing_page.js index a58001fb..eb1bb21 100644 --- a/chrome/browser/resources/settings/printing_page/printing_page.js +++ b/chrome/browser/resources/settings/printing_page/printing_page.js
@@ -34,6 +34,22 @@ searchTerm: { type: String, }, + + /** @private {!Map<string, string>} */ + focusConfig_: { + type: Object, + value: function() { + var map = new Map(); + map.set( + settings.Route.CLOUD_PRINTERS.path, + '#cloudPrinters .subpage-arrow'); +// <if expr="chromeos"> + map.set( + settings.Route.CUPS_PRINTERS.path, '#cupsPrinters .subpage-arrow'); +// </if> + return map; + }, + }, }, listeners: {
diff --git a/chrome/browser/resources/settings/route.js b/chrome/browser/resources/settings/route.js index 9047a8b..8dfa435c 100644 --- a/chrome/browser/resources/settings/route.js +++ b/chrome/browser/resources/settings/route.js
@@ -225,7 +225,9 @@ // </if> r.ACCESSIBILITY = r.ADVANCED.createSection('/accessibility', 'a11y'); +// <if expr="chromeos"> r.MANAGE_ACCESSIBILITY = r.ACCESSIBILITY.createChild('/manageAccessibility'); +// </if> r.SYSTEM = r.ADVANCED.createSection('/system', 'system'); r.RESET = r.ADVANCED.createSection('/reset', 'reset');
diff --git a/chrome/browser/ui/android/bluetooth_chooser_android.cc b/chrome/browser/ui/android/bluetooth_chooser_android.cc index c81b2504..1aa6d18aa 100644 --- a/chrome/browser/ui/android/bluetooth_chooser_android.cc +++ b/chrome/browser/ui/android/bluetooth_chooser_android.cc
@@ -106,7 +106,7 @@ ScopedJavaLocalRef<jstring> java_device_name = ConvertUTF16ToJavaString(env, device_name); Java_BluetoothChooserDialog_addOrUpdateDevice( - env, java_dialog_, java_device_id, java_device_name); + env, java_dialog_, java_device_id, java_device_name, is_gatt_connected); } void BluetoothChooserAndroid::OnDialogFinished(
diff --git a/chrome/browser/ui/cocoa/permission_bubble/permission_bubble_cocoa.h b/chrome/browser/ui/cocoa/permission_bubble/permission_bubble_cocoa.h index a683ad3..d697a9ff 100644 --- a/chrome/browser/ui/cocoa/permission_bubble/permission_bubble_cocoa.h +++ b/chrome/browser/ui/cocoa/permission_bubble/permission_bubble_cocoa.h
@@ -30,6 +30,7 @@ bool IsVisible() override; void SetDelegate(Delegate* delegate) override; bool CanAcceptRequestUpdate() override; + bool HidesAutomatically() override; void UpdateAnchorPosition() override; gfx::NativeWindow GetNativeWindow() override;
diff --git a/chrome/browser/ui/cocoa/permission_bubble/permission_bubble_cocoa.mm b/chrome/browser/ui/cocoa/permission_bubble/permission_bubble_cocoa.mm index 88d5821..edca4541 100644 --- a/chrome/browser/ui/cocoa/permission_bubble/permission_bubble_cocoa.mm +++ b/chrome/browser/ui/cocoa/permission_bubble/permission_bubble_cocoa.mm
@@ -51,6 +51,10 @@ return ![[[bubbleController_ window] contentView] cr_isMouseInView]; } +bool PermissionBubbleCocoa::HidesAutomatically() { + return false; +} + void PermissionBubbleCocoa::UpdateAnchorPosition() { [bubbleController_ updateAnchorPosition]; }
diff --git a/chrome/browser/ui/permission_bubble/mock_permission_prompt.cc b/chrome/browser/ui/permission_bubble/mock_permission_prompt.cc index 48dd339..1f6ce0a 100644 --- a/chrome/browser/ui/permission_bubble/mock_permission_prompt.cc +++ b/chrome/browser/ui/permission_bubble/mock_permission_prompt.cc
@@ -27,6 +27,10 @@ return can_update_ui_; } +bool MockPermissionPrompt::HidesAutomatically() { + return false; +} + void MockPermissionPrompt::Hide() { if (is_visible_ && factory_) factory_->HideView(this);
diff --git a/chrome/browser/ui/permission_bubble/mock_permission_prompt.h b/chrome/browser/ui/permission_bubble/mock_permission_prompt.h index efe690fe..184ad4b 100644 --- a/chrome/browser/ui/permission_bubble/mock_permission_prompt.h +++ b/chrome/browser/ui/permission_bubble/mock_permission_prompt.h
@@ -23,6 +23,7 @@ void Show(const std::vector<PermissionRequest*>& requests, const std::vector<bool>& accept_state) override; bool CanAcceptRequestUpdate() override; + bool HidesAutomatically() override; void Hide() override; bool IsVisible() override; void UpdateAnchorPosition() override;
diff --git a/chrome/browser/ui/permission_bubble/permission_prompt.h b/chrome/browser/ui/permission_bubble/permission_prompt.h index ec5b65e..db7cf2a 100644 --- a/chrome/browser/ui/permission_bubble/permission_prompt.h +++ b/chrome/browser/ui/permission_bubble/permission_prompt.h
@@ -62,6 +62,10 @@ // is being shown and the mouse is not over the view area (!IsMouseHovered). virtual bool CanAcceptRequestUpdate() = 0; + // Returns true if the prompt UI will manage hiding itself when the user + // resolves the prompt, on page navigation/destruction, and on tab switching. + virtual bool HidesAutomatically() = 0; + // Hides the permission prompt. virtual void Hide() = 0;
diff --git a/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc b/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc index 5ce9165..4890eba 100644 --- a/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc +++ b/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc
@@ -4,6 +4,8 @@ #include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h" +#include <utility> + #include "base/memory/ptr_util.h" #include "chrome/browser/ui/views/chrome_constrained_window_views_client.h" #include "chrome/browser/ui/views/chrome_views_delegate.h" @@ -27,6 +29,10 @@ #endif // defined(USE_AURA) #if defined(OS_LINUX) && !defined(OS_CHROMEOS) +#include <sys/stat.h> +#include <sys/types.h> +#include <unistd.h> + #include "base/command_line.h" #include "chrome/browser/ui/simple_message_box.h" #include "chrome/grit/chromium_strings.h" @@ -96,6 +102,13 @@ if (geteuid() != 0) return; + // Allow running inside an unprivileged user namespace. In that case, the + // root directory will be owned by an unmapped UID and GID (although this + // may not be the case if a chroot is also being used). + struct stat st; + if (stat("/", &st) == 0 && st.st_uid != 0) + return; + const base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess(); if (command_line.HasSwitch(switches::kNoSandbox))
diff --git a/chrome/browser/ui/views/chrome_views_delegate.cc b/chrome/browser/ui/views/chrome_views_delegate.cc index 34b69dc..42f242b 100644 --- a/chrome/browser/ui/views/chrome_views_delegate.cc +++ b/chrome/browser/ui/views/chrome_views_delegate.cc
@@ -213,6 +213,9 @@ views::InsetsMetric metric) const { const LayoutDelegate* layout_delegate = LayoutDelegate::Get(); switch (metric) { + case views::InsetsMetric::BUBBLE_CONTENTS: + return gfx::Insets(layout_delegate->GetMetric( + LayoutDelegate::Metric::PANEL_CONTENT_MARGIN)); case views::InsetsMetric::DIALOG_BUTTON: { const int top = layout_delegate->GetMetric( LayoutDelegate::Metric::DIALOG_BUTTON_TOP_SPACING); @@ -220,7 +223,7 @@ LayoutDelegate::Metric::DIALOG_BUTTON_MARGIN); return gfx::Insets(top, margin, margin, margin); } - case views::InsetsMetric::DIALOG_FRAME_VIEW: { + case views::InsetsMetric::DIALOG_TITLE: { const int top = layout_delegate->GetMetric( LayoutDelegate::Metric::PANEL_CONTENT_MARGIN); const int side = layout_delegate->GetMetric( @@ -228,9 +231,6 @@ // Titles are inset at the top and sides, but not at the bottom. return gfx::Insets(top, side, 0, side); } - case views::InsetsMetric::BUBBLE_DIALOG: - return gfx::Insets(layout_delegate->GetMetric( - LayoutDelegate::Metric::PANEL_CONTENT_MARGIN)); case views::InsetsMetric::PANEL: return gfx::Insets(layout_delegate->GetMetric( LayoutDelegate::Metric::PANEL_CONTENT_MARGIN),
diff --git a/chrome/browser/ui/views/frame/browser_frame_mac.mm b/chrome/browser/ui/views/frame/browser_frame_mac.mm index 2c2da8b..a655841 100644 --- a/chrome/browser/ui/views/frame/browser_frame_mac.mm +++ b/chrome/browser/ui/views/frame/browser_frame_mac.mm
@@ -25,7 +25,7 @@ return false; // Ignore synthesized keyboard events. See http://crbug.com/23221. - if (event.type() == content::NativeWebKeyboardEvent::Char) + if (event.GetType() == content::NativeWebKeyboardEvent::kChar) return false; // If the event was not synthesized it should have an os_event.
diff --git a/chrome/browser/ui/views/location_bar/keyword_hint_view.cc b/chrome/browser/ui/views/location_bar/keyword_hint_view.cc index 1e1fed8a..2c0db47 100644 --- a/chrome/browser/ui/views/location_bar/keyword_hint_view.cc +++ b/chrome/browser/ui/views/location_bar/keyword_hint_view.cc
@@ -17,11 +17,14 @@ #include "components/search_engines/template_url_service.h" #include "ui/base/l10n/l10n_util.h" #include "ui/gfx/color_utils.h" -#include "ui/keyboard/keyboard_util.h" #include "ui/strings/grit/ui_strings.h" #include "ui/views/border.h" #include "ui/views/controls/label.h" +#if defined(USE_AURA) +#include "ui/keyboard/keyboard_util.h" +#endif + namespace { // This view looks somewhat like a keyboard key. @@ -37,6 +40,14 @@ DISALLOW_COPY_AND_ASSIGN(KeyboardKeyView); }; +bool IsVirtualKeyboardVisible() { +#if defined(USE_AURA) + return keyboard::IsKeyboardVisible(); +#else + return false; +#endif +} + KeyboardKeyView::KeyboardKeyView(const gfx::FontList& font_list) : views::Label(base::string16(), {font_list}) { SetBorder(views::CreateEmptyBorder( @@ -99,7 +110,7 @@ base::string16 short_name( url_service->GetKeywordShortName(keyword, &is_extension_keyword)); - if (keyboard::IsKeyboardVisible()) { + if (IsVirtualKeyboardVisible()) { int message_id = is_extension_keyword ? IDS_OMNIBOX_EXTENSION_KEYWORD_HINT_TOUCH : IDS_OMNIBOX_KEYWORD_HINT_TOUCH;
diff --git a/chrome/browser/ui/views/permission_bubble/permission_prompt_impl.cc b/chrome/browser/ui/views/permission_bubble/permission_prompt_impl.cc index f8544109..4969455 100644 --- a/chrome/browser/ui/views/permission_bubble/permission_prompt_impl.cc +++ b/chrome/browser/ui/views/permission_bubble/permission_prompt_impl.cc
@@ -438,6 +438,10 @@ return !(bubble_delegate_ && bubble_delegate_->IsMouseHovered()); } +bool PermissionPromptImpl::HidesAutomatically() { + return false; +} + void PermissionPromptImpl::Hide() { if (bubble_delegate_) { bubble_delegate_->CloseBubble();
diff --git a/chrome/browser/ui/views/permission_bubble/permission_prompt_impl.h b/chrome/browser/ui/views/permission_bubble/permission_prompt_impl.h index e84f22d..5061143 100644 --- a/chrome/browser/ui/views/permission_bubble/permission_prompt_impl.h +++ b/chrome/browser/ui/views/permission_bubble/permission_prompt_impl.h
@@ -32,6 +32,7 @@ void Show(const std::vector<PermissionRequest*>& requests, const std::vector<bool>& accept_state) override; bool CanAcceptRequestUpdate() override; + bool HidesAutomatically() override; void Hide() override; bool IsVisible() override; void UpdateAnchorPosition() override;
diff --git a/chrome/common/safe_browsing/mach_o_image_reader_mac.cc b/chrome/common/safe_browsing/mach_o_image_reader_mac.cc index 9805ee51..a204c891 100644 --- a/chrome/common/safe_browsing/mach_o_image_reader_mac.cc +++ b/chrome/common/safe_browsing/mach_o_image_reader_mac.cc
@@ -9,6 +9,7 @@ #include <mach-o/loader.h> #include "base/logging.h" +#include "base/memory/ptr_util.h" #include "base/numerics/safe_math.h" namespace safe_browsing { @@ -133,7 +134,7 @@ if (!slice.IsValid()) return false; - fat_images_.push_back(new MachOImageReader()); + fat_images_.push_back(base::MakeUnique<MachOImageReader>()); if (!fat_images_.back()->Initialize(slice.data(), slice.size())) return false; @@ -201,8 +202,8 @@ std::vector<MachOImageReader*> MachOImageReader::GetFatImages() { DCHECK(is_fat_); std::vector<MachOImageReader*> images; - for (auto it = fat_images_.begin(); it != fat_images_.end(); ++it) - images.push_back(*it); + for (const auto& image : fat_images_) + images.push_back(image.get()); return images; }
diff --git a/chrome/common/safe_browsing/mach_o_image_reader_mac.h b/chrome/common/safe_browsing/mach_o_image_reader_mac.h index 09411e4..5f93e62 100644 --- a/chrome/common/safe_browsing/mach_o_image_reader_mac.h +++ b/chrome/common/safe_browsing/mach_o_image_reader_mac.h
@@ -14,7 +14,6 @@ #include "base/logging.h" #include "base/macros.h" -#include "base/memory/scoped_vector.h" namespace safe_browsing { @@ -95,7 +94,7 @@ std::unique_ptr<ByteSlice> data_; bool is_fat_; - ScopedVector<MachOImageReader> fat_images_; + std::vector<std::unique_ptr<MachOImageReader>> fat_images_; bool is_64_bit_; std::vector<LoadCommand> commands_;
diff --git a/chrome/service/service_ipc_server.cc b/chrome/service/service_ipc_server.cc index bcd3726..b8e81ea 100644 --- a/chrome/service/service_ipc_server.cc +++ b/chrome/service/service_ipc_server.cc
@@ -4,6 +4,8 @@ #include "chrome/service/service_ipc_server.h" +#include <algorithm> + #include "base/metrics/histogram_delta_serialization.h" #include "build/build_config.h" #include "chrome/common/service_messages.h" @@ -75,7 +77,7 @@ void ServiceIPCServer::AddMessageHandler( std::unique_ptr<MessageHandler> handler) { - message_handlers_.push_back(handler.release()); + message_handlers_.push_back(std::move(handler)); } bool ServiceIPCServer::OnMessageReceived(const IPC::Message& msg) { @@ -90,7 +92,11 @@ if (!handled) { // Make a copy of the handlers to prevent modification during iteration. - std::vector<MessageHandler*> temp_handlers = message_handlers_.get(); + std::vector<MessageHandler*> temp_handlers; + temp_handlers.reserve(message_handlers_.size()); + for (const auto& handler : message_handlers_) + temp_handlers.push_back(handler.get()); + for (auto* handler : temp_handlers) { handled = handler->HandleMessage(msg); if (handled)
diff --git a/chrome/service/service_ipc_server.h b/chrome/service/service_ipc_server.h index 0afddfc..eb25ba28 100644 --- a/chrome/service/service_ipc_server.h +++ b/chrome/service/service_ipc_server.h
@@ -11,7 +11,6 @@ #include <vector> #include "base/macros.h" -#include "base/memory/scoped_vector.h" #include "base/single_thread_task_runner.h" #include "ipc/ipc_listener.h" #include "ipc/ipc_sender.h" @@ -93,7 +92,7 @@ scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; std::unique_ptr<IPC::SyncChannel> channel_; base::WaitableEvent* shutdown_event_; - ScopedVector<MessageHandler> message_handlers_; + std::vector<std::unique_ptr<MessageHandler>> message_handlers_; // Indicates whether an IPC client is currently connected to the channel. bool ipc_client_connected_ = false;
diff --git a/chrome/test/data/webui/md_bookmarks/app_test.js b/chrome/test/data/webui/md_bookmarks/app_test.js index 8ea1bc7..4a80959e 100644 --- a/chrome/test/data/webui/md_bookmarks/app_test.js +++ b/chrome/test/data/webui/md_bookmarks/app_test.js
@@ -27,15 +27,13 @@ } setup(function() { + window.localStorage.clear(); resetStore(); app = document.createElement('bookmarks-app'); replaceBody(app); }); - teardown(function() { - window.localStorage.clear(); - }); test('write and load closed folder state', function() { var closedFoldersList = ['1']; @@ -55,4 +53,20 @@ // Ensure closed folders are read from local storage. assertDeepEquals(closedFoldersList, normalizeSet(store.data.closedFolders)); }); + + test('write and load sidebar width', function() { + assertEquals( + app.$.sidebar.getComputedStyleValue('width'), app.sidebarWidth_); + + var sidebarWidth = '500px'; + app.$.sidebar.style.width = sidebarWidth; + cr.dispatchSimpleEvent(app.$.splitter, 'resize'); + assertEquals( + sidebarWidth, window.localStorage[LOCAL_STORAGE_TREE_WIDTH_KEY]); + + app = document.createElement('bookmarks-app'); + replaceBody(app); + + assertEquals(sidebarWidth, app.$.sidebar.style.width); + }); });
diff --git a/chrome/test/data/webui/md_bookmarks/dnd_manager_test.js b/chrome/test/data/webui/md_bookmarks/dnd_manager_test.js index 074f5d5b..25813ac 100644 --- a/chrome/test/data/webui/md_bookmarks/dnd_manager_test.js +++ b/chrome/test/data/webui/md_bookmarks/dnd_manager_test.js
@@ -338,6 +338,12 @@ assertEquals( DropPosition.ON | DropPosition.ABOVE | DropPosition.BELOW, dndManager.calculateValidDropPositions_(getFolderNode('112'))); + + // Drags onto an empty search list do nothing. + store.data.search.results = []; + store.notifyObservers(); + assertEquals( + DropPosition.NONE, dndManager.calculateValidDropPositions_(list)); }); test('calculateDropInfo_', function() { @@ -443,4 +449,35 @@ assertEquals(0, autoExpander.lastTimestamp_); assertEquals(null, autoExpander.lastElement_); }); + + test('drag onto empty list', function() { + store.data.selectedFolder = '14'; + store.notifyObservers(); + + var dragElement = getFolderNode('15'); + var dragTarget = list; + + // Dragging onto an empty list. + dispatchDragEvent('dragstart', dragElement); + dndManager.dragInfo_.handleChromeDragEnter(createDragData(draggedIds)); + + dispatchDragEvent('dragover', dragTarget); + assertEquals( + DropPosition.ON, dndManager.calculateValidDropPositions_(dragTarget)); + assertDragStyle(dragTarget, DRAG_STYLE.ON); + + dispatchDragEvent('dragend', dragTarget); + + // Dragging onto a non-empty list. + store.data.selectedFolder = '11'; + store.notifyObservers(); + + dispatchDragEvent('dragstart', dragElement); + dndManager.dragInfo_.handleChromeDragEnter(createDragData(draggedIds)); + + dispatchDragEvent('dragover', dragTarget); + assertEquals( + DropPosition.NONE, dndManager.calculateValidDropPositions_(dragTarget)); + assertDragStyle(dragTarget, DRAG_STYLE.NONE); + }); });
diff --git a/chrome/test/data/webui/md_bookmarks/item_test.js b/chrome/test/data/webui/md_bookmarks/item_test.js index 3c4ab5c1..5b39c7d6 100644 --- a/chrome/test/data/webui/md_bookmarks/item_test.js +++ b/chrome/test/data/webui/md_bookmarks/item_test.js
@@ -9,7 +9,12 @@ setup(function() { store = new bookmarks.TestStore({ - nodes: testTree(createFolder('1', [createItem(['2'])])), + nodes: testTree(createFolder( + '1', + [ + createItem(['2']), + createItem(['3']), + ])), }); bookmarks.Store.instance_ = store; @@ -36,4 +41,11 @@ assertFalse(item.$['folder-icon'].hidden); assertTrue(item.$.icon.hidden); }); + + test('pressing the menu button selects the item', function() { + MockInteractions.tap(item.$$('.more-vert-button')); + assertDeepEquals( + bookmarks.actions.selectItem('2', false, false, store.data), + store.lastAction); + }); });
diff --git a/chrome/test/data/webui/md_bookmarks/reducers_test.js b/chrome/test/data/webui/md_bookmarks/reducers_test.js index 5c779842..6d85e3a7 100644 --- a/chrome/test/data/webui/md_bookmarks/reducers_test.js +++ b/chrome/test/data/webui/md_bookmarks/reducers_test.js
@@ -377,8 +377,8 @@ assertEquals('test', state.search.term); assertTrue(state.search.inProgress); - // UI should not have changed yet: - assertEquals('2', state.selectedFolder); + // UI should not have changed yet. + assertFalse(bookmarks.util.isShowingSearch(state)); assertDeepEquals(['3'], bookmarks.util.getDisplayedList(state)); action = bookmarks.actions.setSearchResults(['2', '3']); @@ -386,8 +386,8 @@ assertFalse(searchedState.search.inProgress); - // UI changes once search results arrive: - assertEquals(null, searchedState.selectedFolder); + // UI changes once search results arrive. + assertTrue(bookmarks.util.isShowingSearch(searchedState)); assertDeepEquals( ['2', '3'], bookmarks.util.getDisplayedList(searchedState)); @@ -395,17 +395,21 @@ action = bookmarks.actions.setSearchTerm(''); var clearedState = bookmarks.reduceAction(searchedState, action); - assertEquals('1', clearedState.selectedFolder); - assertDeepEquals(['2'], bookmarks.util.getDisplayedList(clearedState)); + // Should go back to displaying the contents of '2', which was shown before + // the search. + assertEquals('2', clearedState.selectedFolder); + assertFalse(bookmarks.util.isShowingSearch(clearedState)); + assertDeepEquals(['3'], bookmarks.util.getDisplayedList(clearedState)); assertEquals('', clearedState.search.term); assertDeepEquals([], clearedState.search.results); // Case 2: Clear search by selecting a new folder. - action = bookmarks.actions.selectFolder('2'); + action = bookmarks.actions.selectFolder('1'); var selectedState = bookmarks.reduceAction(searchedState, action); - assertEquals('2', selectedState.selectedFolder); - assertDeepEquals(['3'], bookmarks.util.getDisplayedList(selectedState)); + assertEquals('1', selectedState.selectedFolder); + assertFalse(bookmarks.util.isShowingSearch(selectedState)); + assertDeepEquals(['2'], bookmarks.util.getDisplayedList(selectedState)); assertEquals('', selectedState.search.term); assertDeepEquals([], selectedState.search.results); });
diff --git a/chrome/test/data/webui/md_bookmarks/router_test.js b/chrome/test/data/webui/md_bookmarks/router_test.js index 68eabe1..cd624b0 100644 --- a/chrome/test/data/webui/md_bookmarks/router_test.js +++ b/chrome/test/data/webui/md_bookmarks/router_test.js
@@ -13,7 +13,7 @@ setup(function() { store = new bookmarks.TestStore({ - selectedId: '1', + selectedFolder: '1', search: { term: '', },
diff --git a/chrome/test/data/webui/md_bookmarks/sidebar_test.js b/chrome/test/data/webui/md_bookmarks/sidebar_test.js index 7906669..097ba79e 100644 --- a/chrome/test/data/webui/md_bookmarks/sidebar_test.js +++ b/chrome/test/data/webui/md_bookmarks/sidebar_test.js
@@ -70,5 +70,25 @@ assertEquals(2, f.depth); assertEquals('2', f.style.getPropertyValue('--node-depth')); }); - }) + }); + + test('doesn\'t highlight selected folder while searching', function() { + var rootFolders = + sidebar.$['folder-tree'].querySelectorAll('bookmarks-folder-node'); + + store.data.selectedFolder = '1'; + store.notifyObservers(); + + assertEquals('1', rootFolders['0'].itemId); + assertTrue(rootFolders['0'].isSelectedFolder_); + + store.data.search = { + term: 'test', + inProgress: false, + results: ['3'], + }; + store.notifyObservers(); + + assertFalse(rootFolders['0'].isSelectedFolder_); + }); });
diff --git a/chrome/test/data/webui/md_history/history_list_test.js b/chrome/test/data/webui/md_history/history_list_test.js index 41b2382..5a51a9a 100644 --- a/chrome/test/data/webui/md_history/history_list_test.js +++ b/chrome/test/data/webui/md_history/history_list_test.js
@@ -46,7 +46,7 @@ assertDeepEquals([true], element.historyData_.map(i => i.selected)); return PolymerTest.flushTasks(); }).then(function() { - MockInteractions.tap(app.$.toolbar.$$('#delete-button')); + toolbar.deleteSelectedItems(); var dialog = listContainer.$.dialog.get(); registerMessageCallback('removeVisits', this, function() { PolymerTest.flushTasks().then(function() { @@ -76,7 +76,7 @@ assertDeepEquals([false, false, true, true], element.historyData_.map(i => i.selected)); - toolbar.onClearSelectionTap_(); + toolbar.clearSelectedItems(); // Make sure that clearing the selection updates both the array and // the actual history-items affected. @@ -313,7 +313,7 @@ return PolymerTest.flushTasks(); }).then(function() { - MockInteractions.tap(app.$.toolbar.$$('#delete-button')); + toolbar.deleteSelectedItems(); var dialog = listContainer.$.dialog.get(); registerMessageCallback('removeVisits', this, function() { @@ -438,7 +438,7 @@ MockInteractions.tap(items[2].$.checkbox); return PolymerTest.flushTasks(); }).then(function() { - MockInteractions.tap(app.$.toolbar.$$('#delete-button')); + toolbar.deleteSelectedItems(); return PolymerTest.flushTasks(); }).then(function() { // Confirmation dialog should appear.
diff --git a/chrome/test/data/webui/md_history/history_metrics_test.js b/chrome/test/data/webui/md_history/history_metrics_test.js index ae0d8ae..4e8fb42 100644 --- a/chrome/test/data/webui/md_history/history_metrics_test.js +++ b/chrome/test/data/webui/md_history/history_metrics_test.js
@@ -116,13 +116,13 @@ MockInteractions.tap(items[4].$.checkbox); return PolymerTest.flushTasks(); }).then(() => { - MockInteractions.tap(app.$.toolbar.$$('#delete-button')); + app.$.toolbar.deleteSelectedItems(); assertEquals(1, actionMap['RemoveSelected']); return PolymerTest.flushTasks(); }).then(() => { MockInteractions.tap(app.$.history.$$('.cancel-button')); assertEquals(1, actionMap['CancelRemoveSelected']); - MockInteractions.tap(app.$.toolbar.$$('#delete-button')); + app.$.toolbar.deleteSelectedItems(); return PolymerTest.flushTasks(); }).then(() => { MockInteractions.tap(app.$.history.$$('.action-button'));
diff --git a/chrome/test/data/webui/md_history/history_supervised_user_test.js b/chrome/test/data/webui/md_history/history_supervised_user_test.js index 1d059a3..6e4e035 100644 --- a/chrome/test/data/webui/md_history/history_supervised_user_test.js +++ b/chrome/test/data/webui/md_history/history_supervised_user_test.js
@@ -38,7 +38,7 @@ }); historyList.historyData_[0].selected = true; - toolbar.onDeleteTap_(); + toolbar.deleteSelectedItems(); }); test('remove history menu button disabled', function() {
diff --git a/chrome/test/data/webui/settings/cr_settings_browsertest.js b/chrome/test/data/webui/settings/cr_settings_browsertest.js index 5b26a8b..092b6b9 100644 --- a/chrome/test/data/webui/settings/cr_settings_browsertest.js +++ b/chrome/test/data/webui/settings/cr_settings_browsertest.js
@@ -1162,7 +1162,7 @@ __proto__: CrSettingsBrowserTest.prototype, /** @override */ - browsePreload: 'chrome://md-settings/people?guid=a%2Fb&foo=42', + browsePreload: 'chrome://md-settings/search?guid=a%2Fb&foo=42', /** @override */ runAccessibilityChecks: false, @@ -1171,22 +1171,22 @@ TEST_F('CrSettingsRouteDynamicParametersTest', 'All', function() { suite('DynamicParameters', function() { test('get parameters from URL and navigation', function(done) { - assertEquals(settings.Route.PEOPLE, settings.getCurrentRoute()); + assertEquals(settings.Route.SEARCH, settings.getCurrentRoute()); assertEquals('a/b', settings.getQueryParameters().get('guid')); assertEquals('42', settings.getQueryParameters().get('foo')); var params = new URLSearchParams(); params.set('bar', 'b=z'); params.set('biz', '3'); - settings.navigateTo(settings.Route.SYNC, params); - assertEquals(settings.Route.SYNC, settings.getCurrentRoute()); + settings.navigateTo(settings.Route.SEARCH_ENGINES, params); + assertEquals(settings.Route.SEARCH_ENGINES, settings.getCurrentRoute()); assertEquals('b=z', settings.getQueryParameters().get('bar')); assertEquals('3', settings.getQueryParameters().get('biz')); assertEquals('?bar=b%3Dz&biz=3', window.location.search); window.addEventListener('popstate', function(event) { - assertEquals('/people', settings.getCurrentRoute().path); - assertEquals(settings.Route.PEOPLE, settings.getCurrentRoute()); + assertEquals('/search', settings.getCurrentRoute().path); + assertEquals(settings.Route.SEARCH, settings.getCurrentRoute()); assertEquals('a/b', settings.getQueryParameters().get('guid')); assertEquals('42', settings.getQueryParameters().get('foo')); done();
diff --git a/chrome/utility/chrome_content_utility_client.cc b/chrome/utility/chrome_content_utility_client.cc index 3dcf0ac..34fa868 100644 --- a/chrome/utility/chrome_content_utility_client.cc +++ b/chrome/utility/chrome_content_utility_client.cc
@@ -221,16 +221,16 @@ ChromeContentUtilityClient::ChromeContentUtilityClient() : utility_process_running_elevated_(false) { #if BUILDFLAG(ENABLE_EXTENSIONS) - handlers_.push_back(new extensions::ExtensionsHandler()); + handlers_.push_back(base::MakeUnique<extensions::ExtensionsHandler>()); #endif #if BUILDFLAG(ENABLE_PRINT_PREVIEW) || \ (BUILDFLAG(ENABLE_BASIC_PRINTING) && defined(OS_WIN)) - handlers_.push_back(new printing::PrintingHandler()); + handlers_.push_back(base::MakeUnique<printing::PrintingHandler>()); #endif #if defined(OS_WIN) - handlers_.push_back(new IPCShellHandler()); + handlers_.push_back(base::MakeUnique<IPCShellHandler>()); #endif } @@ -251,7 +251,7 @@ if (utility_process_running_elevated_) return false; - for (auto* handler : handlers_) { + for (const auto& handler : handlers_) { if (handler->OnMessageReceived(message)) return true; }
diff --git a/chrome/utility/chrome_content_utility_client.h b/chrome/utility/chrome_content_utility_client.h index 379d498..49374cb 100644 --- a/chrome/utility/chrome_content_utility_client.h +++ b/chrome/utility/chrome_content_utility_client.h
@@ -5,8 +5,10 @@ #ifndef CHROME_UTILITY_CHROME_CONTENT_UTILITY_CLIENT_H_ #define CHROME_UTILITY_CHROME_CONTENT_UTILITY_CLIENT_H_ +#include <memory> +#include <vector> + #include "base/macros.h" -#include "base/memory/scoped_vector.h" #include "content/public/utility/content_utility_client.h" class UtilityMessageHandler; @@ -26,7 +28,7 @@ private: // IPC message handlers. - typedef ScopedVector<UtilityMessageHandler> Handlers; + using Handlers = std::vector<std::unique_ptr<UtilityMessageHandler>>; Handlers handlers_; // True if the utility process runs with elevated privileges.
diff --git a/chrome/utility/safe_browsing/mac/dmg_iterator.cc b/chrome/utility/safe_browsing/mac/dmg_iterator.cc index d1e0192..75f0512 100644 --- a/chrome/utility/safe_browsing/mac/dmg_iterator.cc +++ b/chrome/utility/safe_browsing/mac/dmg_iterator.cc
@@ -39,7 +39,7 @@ // Iterate through all the HFS partitions in the DMG file. for (; current_partition_ < partitions_.size(); ++current_partition_) { if (!hfs_) { - hfs_.reset(new HFSIterator(partitions_[current_partition_])); + hfs_.reset(new HFSIterator(partitions_[current_partition_].get())); if (!hfs_->Open()) continue; }
diff --git a/chrome/utility/safe_browsing/mac/dmg_iterator.h b/chrome/utility/safe_browsing/mac/dmg_iterator.h index f4ebc0c..74f17b0 100644 --- a/chrome/utility/safe_browsing/mac/dmg_iterator.h +++ b/chrome/utility/safe_browsing/mac/dmg_iterator.h
@@ -8,9 +8,9 @@ #include <stddef.h> #include <memory> +#include <vector> #include "base/macros.h" -#include "base/memory/scoped_vector.h" #include "base/strings/string16.h" #include "chrome/utility/safe_browsing/mac/udif.h" @@ -49,7 +49,8 @@ private: UDIFParser udif_; // The UDIF parser that accesses the partitions. - ScopedVector<ReadStream> partitions_; // Streams for all the HFS partitions. + // Streams for all the HFS partitions. + std::vector<std::unique_ptr<ReadStream>> partitions_; size_t current_partition_; // The index in |partitions_| of the current one. std::unique_ptr<HFSIterator> hfs_; // The HFSIterator for |current_partition_|.
diff --git a/chrome/utility/safe_browsing/mac/udif.cc b/chrome/utility/safe_browsing/mac/udif.cc index daefe10..0c4be3f 100644 --- a/chrome/utility/safe_browsing/mac/udif.cc +++ b/chrome/utility/safe_browsing/mac/udif.cc
@@ -403,7 +403,7 @@ size_t part_number) { DCHECK_LT(part_number, blocks_.size()); return base::MakeUnique<UDIFPartitionReadStream>(stream_, block_size_, - blocks_[part_number]); + blocks_[part_number].get()); } bool UDIFParser::ParseBlkx() { @@ -509,7 +509,7 @@ } // Copy the block table out of the plist. - std::unique_ptr<UDIFBlock> block(new UDIFBlock()); + auto block = base::MakeUnique<UDIFBlock>(); if (!block->ParseBlockData( reinterpret_cast<const UDIFBlockData*>(CFDataGetBytePtr(data)), base::checked_cast<size_t>(CFDataGetLength(data)),
diff --git a/chrome/utility/safe_browsing/mac/udif.h b/chrome/utility/safe_browsing/mac/udif.h index 2b330bec..fbb17c9 100644 --- a/chrome/utility/safe_browsing/mac/udif.h +++ b/chrome/utility/safe_browsing/mac/udif.h
@@ -16,7 +16,6 @@ #include "base/mac/scoped_cftyperef.h" #include "base/macros.h" -#include "base/memory/scoped_vector.h" namespace safe_browsing { namespace dmg { @@ -77,7 +76,8 @@ ReadStream* const stream_; // The stream backing the UDIF image. Weak. std::vector<std::string> partition_names_; // The names of all partitions. - ScopedVector<const UDIFBlock> blocks_; // All blocks in the UDIF image. + // All blocks in the UDIF image. + std::vector<std::unique_ptr<const UDIFBlock>> blocks_; uint16_t block_size_; // The image's block size, in bytes. DISALLOW_COPY_AND_ASSIGN(UDIFParser);
diff --git a/components/content_settings/core/browser/content_settings_pref_provider.cc b/components/content_settings/core/browser/content_settings_pref_provider.cc index 3bd173e..4373861 100644 --- a/components/content_settings/core/browser/content_settings_pref_provider.cc +++ b/components/content_settings/core/browser/content_settings_pref_provider.cc
@@ -197,6 +197,8 @@ } void PrefProvider::DiscardObsoletePreferences() { + if (is_incognito_) + return; // These prefs were never stored on iOS/Android so they don't need to be // deleted. #if !defined(OS_IOS)
diff --git a/components/feature_engagement_tracker/internal/BUILD.gn b/components/feature_engagement_tracker/internal/BUILD.gn index 91ae0d2..662d630 100644 --- a/components/feature_engagement_tracker/internal/BUILD.gn +++ b/components/feature_engagement_tracker/internal/BUILD.gn
@@ -14,11 +14,24 @@ ] sources = [ + "condition_validator.h", + "configuration.cc", + "configuration.h", + "editable_configuration.cc", + "editable_configuration.h", "feature_constants.cc", "feature_engagement_tracker_impl.cc", "feature_engagement_tracker_impl.h", "feature_list.cc", "feature_list.h", + "in_memory_store.cc", + "in_memory_store.h", + "model.h", + "model_impl.cc", + "model_impl.h", + "once_condition_validator.cc", + "once_condition_validator.h", + "store.h", ] deps = [ @@ -44,7 +57,11 @@ visibility = [ "//components/feature_engagement_tracker:unit_tests" ] sources = [ + "editable_configuration_unittest.cc", "feature_engagement_tracker_impl_unittest.cc", + "in_memory_store_unittest.cc", + "model_impl_unittest.cc", + "once_condition_validator_unittest.cc", ] deps = [
diff --git a/components/feature_engagement_tracker/internal/android/feature_engagement_tracker_impl_android.cc b/components/feature_engagement_tracker/internal/android/feature_engagement_tracker_impl_android.cc index b50ecf2..9d8a362 100644 --- a/components/feature_engagement_tracker/internal/android/feature_engagement_tracker_impl_android.cc +++ b/components/feature_engagement_tracker/internal/android/feature_engagement_tracker_impl_android.cc
@@ -23,7 +23,7 @@ // Create mapping from feature name to base::Feature. FeatureEngagementTrackerImplAndroid::FeatureMap CreateMapFromNameToFeature( - FeatureEngagementTrackerImpl::FeatureVector features) { + FeatureVector features) { FeatureEngagementTrackerImplAndroid::FeatureMap feature_map; for (auto it = features.begin(); it != features.end(); ++it) { feature_map[(*it)->name] = *it; @@ -76,7 +76,7 @@ FeatureEngagementTrackerImplAndroid::FeatureEngagementTrackerImplAndroid( FeatureEngagementTrackerImpl* feature_engagement_tracker_impl, - FeatureEngagementTrackerImpl::FeatureVector features) + FeatureVector features) : features_(CreateMapFromNameToFeature(features)), feature_engagement_tracker_impl_(feature_engagement_tracker_impl) { JNIEnv* env = base::android::AttachCurrentThread();
diff --git a/components/feature_engagement_tracker/internal/android/feature_engagement_tracker_impl_android.h b/components/feature_engagement_tracker/internal/android/feature_engagement_tracker_impl_android.h index 72aa6ea7..1234ae8 100644 --- a/components/feature_engagement_tracker/internal/android/feature_engagement_tracker_impl_android.h +++ b/components/feature_engagement_tracker/internal/android/feature_engagement_tracker_impl_android.h
@@ -14,6 +14,7 @@ #include "base/macros.h" #include "base/supports_user_data.h" #include "components/feature_engagement_tracker/internal/feature_engagement_tracker_impl.h" +#include "components/feature_engagement_tracker/internal/feature_list.h" namespace base { struct Feature; @@ -34,7 +35,7 @@ FeatureEngagementTrackerImplAndroid( FeatureEngagementTrackerImpl* feature_engagement_tracker_impl, - FeatureEngagementTrackerImpl::FeatureVector features); + FeatureVector features); ~FeatureEngagementTrackerImplAndroid() override; base::android::ScopedJavaLocalRef<jobject> GetJavaObject();
diff --git a/components/feature_engagement_tracker/internal/condition_validator.h b/components/feature_engagement_tracker/internal/condition_validator.h new file mode 100644 index 0000000..295a6a0 --- /dev/null +++ b/components/feature_engagement_tracker/internal/condition_validator.h
@@ -0,0 +1,36 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_FEATURE_ENGAGEMENT_TRACKER_INTERNAL_CONDITION_VALIDATOR_H_ +#define COMPONENTS_FEATURE_ENGAGEMENT_TRACKER_INTERNAL_CONDITION_VALIDATOR_H_ + +#include "base/macros.h" +#include "components/feature_engagement_tracker/internal/model.h" + +namespace base { +struct Feature; +} // namespace base + +namespace feature_engagement_tracker { + +// A ConditionValidator checks the requred conditions for a given feature, +// and checks if all conditions are met. +class ConditionValidator { + public: + virtual ~ConditionValidator() = default; + + // Returns true iff all conditions for the given feature have been met. + virtual bool MeetsConditions(const base::Feature& feature, + const Model& model) = 0; + + protected: + ConditionValidator() = default; + + private: + DISALLOW_COPY_AND_ASSIGN(ConditionValidator); +}; + +} // namespace feature_engagement_tracker + +#endif // COMPONENTS_FEATURE_ENGAGEMENT_TRACKER_INTERNAL_CONDITION_VALIDATOR_H_
diff --git a/components/feature_engagement_tracker/internal/configuration.cc b/components/feature_engagement_tracker/internal/configuration.cc new file mode 100644 index 0000000..6e7b904 --- /dev/null +++ b/components/feature_engagement_tracker/internal/configuration.cc
@@ -0,0 +1,20 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/feature_engagement_tracker/internal/configuration.h" + +#include <string> + +namespace feature_engagement_tracker { + +FeatureConfig::FeatureConfig() : valid(false) {} + +FeatureConfig::~FeatureConfig() = default; + +bool operator==(const FeatureConfig& lhs, const FeatureConfig& rhs) { + return lhs.valid == rhs.valid && + lhs.feature_used_event == rhs.feature_used_event; +} + +} // namespace feature_engagement_tracker
diff --git a/components/feature_engagement_tracker/internal/configuration.h b/components/feature_engagement_tracker/internal/configuration.h new file mode 100644 index 0000000..2e470cb7 --- /dev/null +++ b/components/feature_engagement_tracker/internal/configuration.h
@@ -0,0 +1,59 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_FEATURE_ENGAGEMENT_TRACKER_INTERNAL_CONFIGURATION_H_ +#define COMPONENTS_FEATURE_ENGAGEMENT_TRACKER_INTERNAL_CONFIGURATION_H_ + +#include <map> +#include <string> + +#include "base/macros.h" + +namespace base { +struct Feature; +} + +namespace feature_engagement_tracker { + +// A FeatureConfig contains all the configuration for a given feature. +struct FeatureConfig { + public: + FeatureConfig(); + ~FeatureConfig(); + + // Whether the configuration has been successfully parsed. + bool valid; + + // The identifier for a particular event that will be searched for when + // counting how many times a particular feature has been used. + std::string feature_used_event; +}; + +bool operator==(const FeatureConfig& lhs, const FeatureConfig& rhs); + +// A Configuration contains the current set of runtime configurations. +// It is up to each implementation of Configuration to provide a way to +// register features and their configurations. +class Configuration { + public: + // Convenience alias for typical implementatinos of Configuration. + using ConfigMap = std::map<const base::Feature*, FeatureConfig>; + + virtual ~Configuration() = default; + + // Returns the FeatureConfig for the given |feature|. The |feature| must + // be registered with the Configuration instance. + virtual const FeatureConfig& GetFeatureConfig( + const base::Feature& feature) const = 0; + + protected: + Configuration() = default; + + private: + DISALLOW_COPY_AND_ASSIGN(Configuration); +}; + +} // namespace feature_engagement_tracker + +#endif // COMPONENTS_FEATURE_ENGAGEMENT_TRACKER_INTERNAL_CONFIGURATION_H_
diff --git a/components/feature_engagement_tracker/internal/editable_configuration.cc b/components/feature_engagement_tracker/internal/editable_configuration.cc new file mode 100644 index 0000000..f7a4cba5 --- /dev/null +++ b/components/feature_engagement_tracker/internal/editable_configuration.cc
@@ -0,0 +1,31 @@ +// 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 "components/feature_engagement_tracker/internal/editable_configuration.h" + +#include <map> + +#include "base/logging.h" +#include "components/feature_engagement_tracker/internal/configuration.h" + +namespace feature_engagement_tracker { + +EditableConfiguration::EditableConfiguration() = default; + +EditableConfiguration::~EditableConfiguration() = default; + +void EditableConfiguration::SetConfiguration( + const base::Feature* feature, + const FeatureConfig& feature_config) { + configs_[feature] = feature_config; +} + +const FeatureConfig& EditableConfiguration::GetFeatureConfig( + const base::Feature& feature) const { + auto it = configs_.find(&feature); + DCHECK(it != configs_.end()); + return it->second; +} + +} // namespace feature_engagement_tracker
diff --git a/components/feature_engagement_tracker/internal/editable_configuration.h b/components/feature_engagement_tracker/internal/editable_configuration.h new file mode 100644 index 0000000..2e01b721 --- /dev/null +++ b/components/feature_engagement_tracker/internal/editable_configuration.h
@@ -0,0 +1,43 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_FEATURE_ENGAGEMENT_TRACKER_INTERNAL_EDITABLE_CONFIGURATION_H_ +#define COMPONENTS_FEATURE_ENGAGEMENT_TRACKER_INTERNAL_EDITABLE_CONFIGURATION_H_ + +#include "base/macros.h" +#include "components/feature_engagement_tracker/internal/configuration.h" + +namespace base { +struct Feature; +} // namespace base + +namespace feature_engagement_tracker { + +// An EditableConfiguration provides a configuration that can be configured +// by calling SetConfiguration(...) for each feature, which makes it well +// suited for simple setup and tests. +class EditableConfiguration : public Configuration { + public: + EditableConfiguration(); + ~EditableConfiguration() override; + + // Configuration implementaiton. + const FeatureConfig& GetFeatureConfig( + const base::Feature& feature) const override; + + // Adds a new FeatureConfig to the current configurations. If it already + // exists, the contents are replaced. + void SetConfiguration(const base::Feature* feature, + const FeatureConfig& feature_config); + + private: + // The current configurations. + ConfigMap configs_; + + DISALLOW_COPY_AND_ASSIGN(EditableConfiguration); +}; + +} // namespace feature_engagement_tracker + +#endif // COMPONENTS_FEATURE_ENGAGEMENT_TRACKER_INTERNAL_EDITABLE_CONFIGURATION_H_
diff --git a/components/feature_engagement_tracker/internal/editable_configuration_unittest.cc b/components/feature_engagement_tracker/internal/editable_configuration_unittest.cc new file mode 100644 index 0000000..896e0381 --- /dev/null +++ b/components/feature_engagement_tracker/internal/editable_configuration_unittest.cc
@@ -0,0 +1,86 @@ +// 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 "components/feature_engagement_tracker/internal/editable_configuration.h" + +#include <string> + +#include "base/feature_list.h" +#include "base/metrics/field_trial.h" +#include "base/test/scoped_feature_list.h" +#include "components/feature_engagement_tracker/internal/configuration.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace feature_engagement_tracker { + +namespace { + +const base::Feature kTestFeatureFoo{"test_foo", + base::FEATURE_DISABLED_BY_DEFAULT}; +const base::Feature kTestFeatureBar{"test_bar", + base::FEATURE_DISABLED_BY_DEFAULT}; + +class EditableConfigurationTest : public ::testing::Test { + public: + FeatureConfig CreateFeatureConfig(const std::string& feature_used_event, + bool valid) { + FeatureConfig feature_config; + feature_config.valid = valid; + feature_config.feature_used_event = feature_used_event; + return feature_config; + } + + protected: + base::test::ScopedFeatureList scoped_feature_list_; + EditableConfiguration configuration_; +}; + +} // namespace + +TEST_F(EditableConfigurationTest, SingleConfigAddAndGet) { + scoped_feature_list_.InitWithFeatures({kTestFeatureFoo}, {}); + + FeatureConfig foo_config = CreateFeatureConfig("foo", true); + configuration_.SetConfiguration(&kTestFeatureFoo, foo_config); + const FeatureConfig& foo_config_result = + configuration_.GetFeatureConfig(kTestFeatureFoo); + + EXPECT_EQ(foo_config, foo_config_result); +} + +TEST_F(EditableConfigurationTest, TwoConfigAddAndGet) { + scoped_feature_list_.InitWithFeatures({kTestFeatureFoo, kTestFeatureBar}, {}); + + FeatureConfig foo_config = CreateFeatureConfig("foo", true); + configuration_.SetConfiguration(&kTestFeatureFoo, foo_config); + FeatureConfig bar_config = CreateFeatureConfig("bar", true); + configuration_.SetConfiguration(&kTestFeatureBar, bar_config); + + const FeatureConfig& foo_config_result = + configuration_.GetFeatureConfig(kTestFeatureFoo); + const FeatureConfig& bar_config_result = + configuration_.GetFeatureConfig(kTestFeatureBar); + + EXPECT_EQ(foo_config, foo_config_result); + EXPECT_EQ(bar_config, bar_config_result); +} + +TEST_F(EditableConfigurationTest, ConfigShouldBeEditable) { + scoped_feature_list_.InitWithFeatures({kTestFeatureFoo}, {}); + + FeatureConfig valid_foo_config = CreateFeatureConfig("foo", true); + configuration_.SetConfiguration(&kTestFeatureFoo, valid_foo_config); + + const FeatureConfig& valid_foo_config_result = + configuration_.GetFeatureConfig(kTestFeatureFoo); + EXPECT_EQ(valid_foo_config, valid_foo_config_result); + + FeatureConfig invalid_foo_config = CreateFeatureConfig("foo2", false); + configuration_.SetConfiguration(&kTestFeatureFoo, invalid_foo_config); + const FeatureConfig& invalid_foo_config_result = + configuration_.GetFeatureConfig(kTestFeatureFoo); + EXPECT_EQ(invalid_foo_config, invalid_foo_config_result); +} + +} // namespace feature_engagement_tracker
diff --git a/components/feature_engagement_tracker/internal/feature_engagement_tracker_impl.cc b/components/feature_engagement_tracker/internal/feature_engagement_tracker_impl.cc index fa7e1bd6..5b48c708 100644 --- a/components/feature_engagement_tracker/internal/feature_engagement_tracker_impl.cc +++ b/components/feature_engagement_tracker/internal/feature_engagement_tracker_impl.cc
@@ -4,12 +4,31 @@ #include "components/feature_engagement_tracker/internal/feature_engagement_tracker_impl.h" +#include "base/bind.h" #include "base/feature_list.h" +#include "base/memory/ptr_util.h" +#include "components/feature_engagement_tracker/internal/editable_configuration.h" #include "components/feature_engagement_tracker/internal/feature_list.h" -#include "components/feature_engagement_tracker/public/feature_constants.h" +#include "components/feature_engagement_tracker/internal/in_memory_store.h" +#include "components/feature_engagement_tracker/internal/model_impl.h" +#include "components/feature_engagement_tracker/internal/once_condition_validator.h" namespace feature_engagement_tracker { +// Set up all feature configurations. +// TODO(nyquist): Create FinchConfiguration to parse configuration. +std::unique_ptr<Configuration> CreateAndParseConfiguration() { + std::unique_ptr<EditableConfiguration> configuration = + base::MakeUnique<EditableConfiguration>(); + std::vector<const base::Feature*> features = GetAllFeatures(); + for (auto* it : features) { + FeatureConfig feature_config; + feature_config.valid = true; + configuration->SetConfiguration(it, feature_config); + } + return std::move(configuration); +} + // This method is declared in //components/feature_engagement_tracker/public/ // feature_engagement_tracker.h // and should be linked in to any binary using FeatureEngagementTracker::Create. @@ -17,12 +36,27 @@ FeatureEngagementTracker* FeatureEngagementTracker::Create( const base::FilePath& storage_dir, const scoped_refptr<base::SequencedTaskRunner>& background__task_runner) { - return new FeatureEngagementTrackerImpl(GetAllFeatures()); + std::unique_ptr<Store> store = base::MakeUnique<InMemoryStore>(); + std::unique_ptr<Configuration> configuration = CreateAndParseConfiguration(); + std::unique_ptr<ConditionValidator> validator = + base::MakeUnique<OnceConditionValidator>(); + + return new FeatureEngagementTrackerImpl( + std::move(store), std::move(configuration), std::move(validator)); } FeatureEngagementTrackerImpl::FeatureEngagementTrackerImpl( - FeatureVector features) - : features_(features), has_shown_enlightenment_(false) {} + std::unique_ptr<Store> store, + std::unique_ptr<Configuration> configuration, + std::unique_ptr<ConditionValidator> condition_validator) + : condition_validator_(std::move(condition_validator)), + weak_ptr_factory_(this) { + model_ = + base::MakeUnique<ModelImpl>(std::move(store), std::move(configuration)); + model_->Initialize( + base::Bind(&FeatureEngagementTrackerImpl::OnModelInitializationFinished, + weak_ptr_factory_.GetWeakPtr())); +} FeatureEngagementTrackerImpl::~FeatureEngagementTrackerImpl() = default; @@ -32,14 +66,16 @@ bool FeatureEngagementTrackerImpl::ShouldTriggerHelpUI( const base::Feature& feature) { - bool should_trigger = - !has_shown_enlightenment_ && base::FeatureList::IsEnabled(feature); - has_shown_enlightenment_ |= should_trigger; - return should_trigger; + // TODO(nyquist): Track this event. + bool result = condition_validator_->MeetsConditions(feature, *model_); + if (result) + model_->SetIsCurrentlyShowing(true); + return result; } void FeatureEngagementTrackerImpl::Dismissed() { // TODO(nyquist): Track this event. + model_->SetIsCurrentlyShowing(false); } void FeatureEngagementTrackerImpl::AddOnInitializedCallback( @@ -47,4 +83,8 @@ // TODO(nyquist): Add support for this. } +void FeatureEngagementTrackerImpl::OnModelInitializationFinished(bool result) { + // TODO(nyquist): Ensure that all OnInitializedCallbacks are invoked. +} + } // namespace feature_engagement_tracker
diff --git a/components/feature_engagement_tracker/internal/feature_engagement_tracker_impl.h b/components/feature_engagement_tracker/internal/feature_engagement_tracker_impl.h index c23879d0..b0088941 100644 --- a/components/feature_engagement_tracker/internal/feature_engagement_tracker_impl.h +++ b/components/feature_engagement_tracker/internal/feature_engagement_tracker_impl.h
@@ -10,18 +10,23 @@ #include "base/feature_list.h" #include "base/macros.h" +#include "base/memory/weak_ptr.h" #include "base/supports_user_data.h" +#include "components/feature_engagement_tracker/internal/condition_validator.h" +#include "components/feature_engagement_tracker/internal/model.h" #include "components/feature_engagement_tracker/public/feature_engagement_tracker.h" namespace feature_engagement_tracker { +class Store; // The internal implementation of the FeatureEngagementTracker. class FeatureEngagementTrackerImpl : public FeatureEngagementTracker, public base::SupportsUserData { public: - using FeatureVector = std::vector<const base::Feature*>; - - explicit FeatureEngagementTrackerImpl(FeatureVector features); + FeatureEngagementTrackerImpl( + std::unique_ptr<Store> store, + std::unique_ptr<Configuration> configuration, + std::unique_ptr<ConditionValidator> condition_validator); ~FeatureEngagementTrackerImpl() override; // FeatureEngagementTracker implementation. @@ -31,12 +36,17 @@ void AddOnInitializedCallback(OnInitializedCallback callback) override; private: - // The list of all registerd features. - FeatureVector features_; + // Invoked by the Model when it has been initialized. + void OnModelInitializationFinished(bool result); - // True iff at least one feature enlightenment has been shown within the - // current session. - bool has_shown_enlightenment_; + // The current model. + std::unique_ptr<Model> model_; + + // The ConditionValidator provides functionality for knowing when to trigger + // help UI. + std::unique_ptr<ConditionValidator> condition_validator_; + + base::WeakPtrFactory<FeatureEngagementTrackerImpl> weak_ptr_factory_; DISALLOW_COPY_AND_ASSIGN(FeatureEngagementTrackerImpl); };
diff --git a/components/feature_engagement_tracker/internal/feature_engagement_tracker_impl_unittest.cc b/components/feature_engagement_tracker/internal/feature_engagement_tracker_impl_unittest.cc index 2cbd89c..4917161 100644 --- a/components/feature_engagement_tracker/internal/feature_engagement_tracker_impl_unittest.cc +++ b/components/feature_engagement_tracker/internal/feature_engagement_tracker_impl_unittest.cc
@@ -4,77 +4,87 @@ #include "components/feature_engagement_tracker/internal/feature_engagement_tracker_impl.h" +#include <memory> + #include "base/feature_list.h" +#include "base/memory/ptr_util.h" #include "base/metrics/field_trial.h" #include "base/test/scoped_feature_list.h" +#include "components/feature_engagement_tracker/internal/editable_configuration.h" +#include "components/feature_engagement_tracker/internal/in_memory_store.h" +#include "components/feature_engagement_tracker/internal/once_condition_validator.h" #include "testing/gtest/include/gtest/gtest.h" namespace feature_engagement_tracker { namespace { - const base::Feature kTestFeatureFoo{"test_foo", base::FEATURE_DISABLED_BY_DEFAULT}; const base::Feature kTestFeatureBar{"test_bar", base::FEATURE_DISABLED_BY_DEFAULT}; +const base::Feature kTestFeatureQux{"test_qux", + base::FEATURE_DISABLED_BY_DEFAULT}; + +void RegisterFeatureConfig(EditableConfiguration* configuration, + const base::Feature& feature, + bool valid) { + FeatureConfig config; + config.valid = valid; + config.feature_used_event = feature.name; + configuration->SetConfiguration(&feature, config); +} + +class FeatureEngagementTrackerImplTest : public ::testing::Test { + public: + void SetUp() override { + std::unique_ptr<Store> store = base::MakeUnique<InMemoryStore>(); + std::unique_ptr<EditableConfiguration> configuration = + base::MakeUnique<EditableConfiguration>(); + std::unique_ptr<ConditionValidator> validator = + base::MakeUnique<OnceConditionValidator>(); + + RegisterFeatureConfig(configuration.get(), kTestFeatureFoo, true); + RegisterFeatureConfig(configuration.get(), kTestFeatureBar, true); + RegisterFeatureConfig(configuration.get(), kTestFeatureQux, false); + + scoped_feature_list_.InitWithFeatures( + {kTestFeatureFoo, kTestFeatureBar, kTestFeatureQux}, {}); + + tracker_.reset(new FeatureEngagementTrackerImpl( + std::move(store), std::move(configuration), std::move(validator))); + } + + protected: + std::unique_ptr<FeatureEngagementTrackerImpl> tracker_; + base::test::ScopedFeatureList scoped_feature_list_; +}; + } // namespace -TEST(FeatureEngagementTrackerImplTest, EnabledFeatureShouldTriggerOnce) { - base::test::ScopedFeatureList scoped_feature_list; - scoped_feature_list.InitWithFeatures({kTestFeatureFoo}, {}); +TEST_F(FeatureEngagementTrackerImplTest, TestTriggering) { + // The first time a feature triggers it should be shown. + EXPECT_TRUE(tracker_->ShouldTriggerHelpUI(kTestFeatureFoo)); + EXPECT_FALSE(tracker_->ShouldTriggerHelpUI(kTestFeatureFoo)); + EXPECT_FALSE(tracker_->ShouldTriggerHelpUI(kTestFeatureQux)); - // Initialize tracker with one enabled feature. - std::vector<const base::Feature*> features = {&kTestFeatureFoo}; - FeatureEngagementTrackerImpl tracker(features); + // While in-product help is currently showing, no other features should be + // shown. + EXPECT_FALSE(tracker_->ShouldTriggerHelpUI(kTestFeatureBar)); + EXPECT_FALSE(tracker_->ShouldTriggerHelpUI(kTestFeatureQux)); - // Only the first call to ShouldTriggerHelpUI() should lead to enlightenment. - EXPECT_TRUE(tracker.ShouldTriggerHelpUI(kTestFeatureFoo)); - EXPECT_FALSE(tracker.ShouldTriggerHelpUI(kTestFeatureFoo)); -} + // After dismissing the current in-product help, that feature can not be shown + // again, but a different feature should. + tracker_->Dismissed(); + EXPECT_FALSE(tracker_->ShouldTriggerHelpUI(kTestFeatureFoo)); + EXPECT_TRUE(tracker_->ShouldTriggerHelpUI(kTestFeatureBar)); + EXPECT_FALSE(tracker_->ShouldTriggerHelpUI(kTestFeatureQux)); -TEST(FeatureEngagementTrackerImplTest, OnlyEnabledFeaturesShouldTrigger) { - base::test::ScopedFeatureList scoped_feature_list; - scoped_feature_list.InitWithFeatures({kTestFeatureFoo}, {kTestFeatureBar}); - - // Initialize tracker with one enabled and one disabled feature. - std::vector<const base::Feature*> features = {&kTestFeatureFoo, - &kTestFeatureBar}; - FeatureEngagementTrackerImpl tracker(features); - - // Only the kTestFeatureFoo feature should lead to enlightenment, since - // kTestFeatureBar is disabled. Ordering disabled feature first to ensure this - // captures a different behavior than the - // OnlyOneFeatureShouldTriggerPerSession test below. - EXPECT_FALSE(tracker.ShouldTriggerHelpUI(kTestFeatureBar)); - EXPECT_TRUE(tracker.ShouldTriggerHelpUI(kTestFeatureFoo)); -} - -TEST(FeatureEngagementTrackerImplTest, OnlyOneFeatureShouldTriggerPerSession) { - base::test::ScopedFeatureList scoped_feature_list; - scoped_feature_list.InitWithFeatures({kTestFeatureFoo, kTestFeatureBar}, {}); - - // Initialize tracker with two enabled features. - std::vector<const base::Feature*> features = {&kTestFeatureFoo, - &kTestFeatureBar}; - FeatureEngagementTrackerImpl tracker(features); - - // Only one feature should get to show enlightenment. - EXPECT_TRUE(tracker.ShouldTriggerHelpUI(kTestFeatureFoo)); - EXPECT_FALSE(tracker.ShouldTriggerHelpUI(kTestFeatureBar)); -} - -TEST(FeatureEngagementTrackerImplTest, NeverTriggerWhenAllFeaturesDisabled) { - base::test::ScopedFeatureList scoped_feature_list; - scoped_feature_list.InitWithFeatures({}, {kTestFeatureFoo, kTestFeatureBar}); - - // Initialize tracker with two enabled features. - std::vector<const base::Feature*> features = {&kTestFeatureFoo, - &kTestFeatureBar}; - FeatureEngagementTrackerImpl tracker(features); - - // No features should get to show enlightenment. - EXPECT_FALSE(tracker.ShouldTriggerHelpUI(kTestFeatureFoo)); - EXPECT_FALSE(tracker.ShouldTriggerHelpUI(kTestFeatureBar)); + // After dismissing the second registered feature, no more in-product help + // should be shown, since kTestFeatureQux is invalid. + tracker_->Dismissed(); + EXPECT_FALSE(tracker_->ShouldTriggerHelpUI(kTestFeatureFoo)); + EXPECT_FALSE(tracker_->ShouldTriggerHelpUI(kTestFeatureBar)); + EXPECT_FALSE(tracker_->ShouldTriggerHelpUI(kTestFeatureQux)); } } // namespace feature_engagement_tracker
diff --git a/components/feature_engagement_tracker/internal/feature_list.h b/components/feature_engagement_tracker/internal/feature_list.h index 7ddd94a36..ba4a578 100644 --- a/components/feature_engagement_tracker/internal/feature_list.h +++ b/components/feature_engagement_tracker/internal/feature_list.h
@@ -10,9 +10,10 @@ #include "base/feature_list.h" namespace feature_engagement_tracker { +using FeatureVector = std::vector<const base::Feature*>; // Returns all the features that are in use for engagement tracking. -std::vector<const base::Feature*> GetAllFeatures(); +FeatureVector GetAllFeatures(); } // namespace feature_engagement_tracker
diff --git a/components/feature_engagement_tracker/internal/in_memory_store.cc b/components/feature_engagement_tracker/internal/in_memory_store.cc new file mode 100644 index 0000000..113fa037 --- /dev/null +++ b/components/feature_engagement_tracker/internal/in_memory_store.cc
@@ -0,0 +1,25 @@ +// 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 "components/feature_engagement_tracker/internal/in_memory_store.h" + +#include "base/feature_list.h" +#include "components/feature_engagement_tracker/internal/store.h" + +namespace feature_engagement_tracker { + +InMemoryStore::InMemoryStore() : Store(), ready_(false) {} + +InMemoryStore::~InMemoryStore() = default; + +void InMemoryStore::Load(const OnLoadedCallback& callback) { + // TODO(nyquist): Post result back to callback. + ready_ = true; +} + +bool InMemoryStore::IsReady() const { + return ready_; +} + +} // namespace feature_engagement_tracker
diff --git a/components/feature_engagement_tracker/internal/in_memory_store.h b/components/feature_engagement_tracker/internal/in_memory_store.h new file mode 100644 index 0000000..536c353 --- /dev/null +++ b/components/feature_engagement_tracker/internal/in_memory_store.h
@@ -0,0 +1,33 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_FEATURE_ENGAGEMENT_TRACKER_INTERNAL_IN_MEMORY_STORE_H_ +#define COMPONENTS_FEATURE_ENGAGEMENT_TRACKER_INTERNAL_IN_MEMORY_STORE_H_ + +#include "base/macros.h" +#include "components/feature_engagement_tracker/internal/store.h" + +namespace feature_engagement_tracker { + +// An InMemoryStore provides a DB layer that stores all data in-memory. +class InMemoryStore : public Store { + public: + InMemoryStore(); + ~InMemoryStore() override; + + // Store implementation. + void Load(const OnLoadedCallback& callback) override; + bool IsReady() const override; + + private: + // Whether the store is ready or not. It is true after Load(...) has been + // invoked. + bool ready_; + + DISALLOW_COPY_AND_ASSIGN(InMemoryStore); +}; + +} // namespace feature_engagement_tracker + +#endif // COMPONENTS_FEATURE_ENGAGEMENT_TRACKER_INTERNAL_IN_MEMORY_STORE_H_
diff --git a/components/feature_engagement_tracker/internal/in_memory_store_unittest.cc b/components/feature_engagement_tracker/internal/in_memory_store_unittest.cc new file mode 100644 index 0000000..0b1d880 --- /dev/null +++ b/components/feature_engagement_tracker/internal/in_memory_store_unittest.cc
@@ -0,0 +1,25 @@ +// 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 "components/feature_engagement_tracker/internal/in_memory_store.h" + +#include "base/bind.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace feature_engagement_tracker { + +namespace { +void NoOpCallback(bool success) {} + +class InMemoryStoreTest : public ::testing::Test {}; +} // namespace + +TEST_F(InMemoryStoreTest, LoadShouldMakeReady) { + InMemoryStore store; + EXPECT_FALSE(store.IsReady()); + store.Load(base::Bind(&NoOpCallback)); + EXPECT_TRUE(store.IsReady()); +} + +} // namespace feature_engagement_tracker
diff --git a/components/feature_engagement_tracker/internal/model.h b/components/feature_engagement_tracker/internal/model.h new file mode 100644 index 0000000..966fa2d --- /dev/null +++ b/components/feature_engagement_tracker/internal/model.h
@@ -0,0 +1,56 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_FEATURE_ENGAGEMENT_TRACKER_INTERNAL_MODEL_H_ +#define COMPONENTS_FEATURE_ENGAGEMENT_TRACKER_INTERNAL_MODEL_H_ + +#include <map> + +#include "base/callback.h" +#include "base/macros.h" +#include "components/feature_engagement_tracker/internal/configuration.h" + +namespace base { +struct Feature; +} // namespace base + +namespace feature_engagement_tracker { + +// A Model provides all necessary runtime state. +class Model { + public: + // Callback for when model initialization has finished. The bool argument + // denotes whether the model was successfully initialized. + using OnModelInitializationFinished = base::Callback<void(bool)>; + + virtual ~Model() = default; + + // Initialize the model, including all underlying sub systems. When all + // required operations have been finished, a callback is posted. + virtual void Initialize(const OnModelInitializationFinished& callback) = 0; + + // Returns whether the model is ready, i.e. whether it has been fully + // initialized. + virtual bool IsReady() const = 0; + + // Returns the FeatureConfig for the given |feature|. + virtual const FeatureConfig& GetFeatureConfig( + const base::Feature& feature) const = 0; + + // Update the state of whether any in-product help is currently showing. + virtual void SetIsCurrentlyShowing(bool is_showing) = 0; + + // Returns whether any in-product help is currently showing. + virtual bool IsCurrentlyShowing() const = 0; + + protected: + Model() = default; + + private: + DISALLOW_COPY_AND_ASSIGN(Model); +}; + +} // namespace feature_engagement_tracker + +#endif // COMPONENTS_FEATURE_ENGAGEMENT_TRACKER_INTERNAL_MODEL_H_
diff --git a/components/feature_engagement_tracker/internal/model_impl.cc b/components/feature_engagement_tracker/internal/model_impl.cc new file mode 100644 index 0000000..f0d4196e --- /dev/null +++ b/components/feature_engagement_tracker/internal/model_impl.cc
@@ -0,0 +1,49 @@ +// 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 "components/feature_engagement_tracker/internal/model_impl.h" + +#include <map> +#include <memory> + +#include "components/feature_engagement_tracker/internal/configuration.h" +#include "components/feature_engagement_tracker/internal/model.h" +#include "components/feature_engagement_tracker/internal/store.h" + +namespace feature_engagement_tracker { + +ModelImpl::ModelImpl(std::unique_ptr<Store> store, + std::unique_ptr<Configuration> configuration) + : Model(), + store_(std::move(store)), + configuration_(std::move(configuration)), + ready_(false), + currently_showing_(false) {} + +ModelImpl::~ModelImpl() = default; + +void ModelImpl::Initialize(const OnModelInitializationFinished& callback) { + // TODO(nyquist): Initialize Store and post result back to callback. + // Only set ready when Store has fully loaded. + ready_ = true; +} + +bool ModelImpl::IsReady() const { + return ready_; +} + +const FeatureConfig& ModelImpl::GetFeatureConfig( + const base::Feature& feature) const { + return configuration_->GetFeatureConfig(feature); +} + +void ModelImpl::SetIsCurrentlyShowing(bool is_showing) { + currently_showing_ = is_showing; +} + +bool ModelImpl::IsCurrentlyShowing() const { + return currently_showing_; +} + +} // namespace feature_engagement_tracker
diff --git a/components/feature_engagement_tracker/internal/model_impl.h b/components/feature_engagement_tracker/internal/model_impl.h new file mode 100644 index 0000000..dcbefa29 --- /dev/null +++ b/components/feature_engagement_tracker/internal/model_impl.h
@@ -0,0 +1,54 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_FEATURE_ENGAGEMENT_TRACKER_INTERNAL_MODEL_IMPL_H_ +#define COMPONENTS_FEATURE_ENGAGEMENT_TRACKER_INTERNAL_MODEL_IMPL_H_ + +#include <memory> + +#include "base/macros.h" +#include "components/feature_engagement_tracker/internal/configuration.h" +#include "components/feature_engagement_tracker/internal/model.h" + +namespace base { +struct Feature; +} + +namespace feature_engagement_tracker { +class Store; + +// A ModelImpl provides the default implementation of the Model. +class ModelImpl : public Model { + public: + ModelImpl(std::unique_ptr<Store> store, + std::unique_ptr<Configuration> configuration); + ~ModelImpl() override; + + // Model implementation. + void Initialize(const OnModelInitializationFinished& callback) override; + bool IsReady() const override; + const FeatureConfig& GetFeatureConfig( + const base::Feature& feature) const override; + void SetIsCurrentlyShowing(bool is_showing) override; + bool IsCurrentlyShowing() const override; + + private: + // The underlying store for all events. + std::unique_ptr<Store> store_; + + // The current configuration for all features. + std::unique_ptr<Configuration> configuration_; + + // Whether the model has been fully initialized. + bool ready_; + + // Whether the model is currently showing an in-product help. + bool currently_showing_; + + DISALLOW_COPY_AND_ASSIGN(ModelImpl); +}; + +} // namespace feature_engagement_tracker + +#endif // COMPONENTS_FEATURE_ENGAGEMENT_TRACKER_INTERNAL_MODEL_IMPL_H_
diff --git a/components/feature_engagement_tracker/internal/model_impl_unittest.cc b/components/feature_engagement_tracker/internal/model_impl_unittest.cc new file mode 100644 index 0000000..3651b58 --- /dev/null +++ b/components/feature_engagement_tracker/internal/model_impl_unittest.cc
@@ -0,0 +1,81 @@ +// 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 "components/feature_engagement_tracker/internal/model_impl.h" + +#include <memory> + +#include "base/bind.h" +#include "base/feature_list.h" +#include "base/memory/ptr_util.h" +#include "base/metrics/field_trial.h" +#include "base/test/scoped_feature_list.h" +#include "components/feature_engagement_tracker/internal/editable_configuration.h" +#include "components/feature_engagement_tracker/internal/in_memory_store.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace feature_engagement_tracker { + +namespace { +const base::Feature kTestFeatureFoo{"test_foo", + base::FEATURE_DISABLED_BY_DEFAULT}; +const base::Feature kTestFeatureBar{"test_bar", + base::FEATURE_DISABLED_BY_DEFAULT}; + +void NoOpCallback(bool success) {} + +void RegisterFeatureConfig(EditableConfiguration* configuration, + const base::Feature& feature, + bool valid) { + FeatureConfig config; + config.valid = valid; + config.feature_used_event = feature.name; + configuration->SetConfiguration(&feature, config); +} + +class ModelImplTest : public ::testing::Test { + public: + void SetUp() override { + std::unique_ptr<Store> store = base::MakeUnique<InMemoryStore>(); + std::unique_ptr<EditableConfiguration> configuration = + base::MakeUnique<EditableConfiguration>(); + + RegisterFeatureConfig(configuration.get(), kTestFeatureFoo, true); + RegisterFeatureConfig(configuration.get(), kTestFeatureBar, true); + + scoped_feature_list_.InitWithFeatures({kTestFeatureFoo, kTestFeatureBar}, + {}); + + model_.reset(new ModelImpl(std::move(store), std::move(configuration))); + } + + protected: + std::unique_ptr<ModelImpl> model_; + base::test::ScopedFeatureList scoped_feature_list_; +}; +} // namespace + +TEST_F(ModelImplTest, InitializationShouldMakeReady) { + EXPECT_FALSE(model_->IsReady()); + model_->Initialize(base::Bind(&NoOpCallback)); + EXPECT_TRUE(model_->IsReady()); +} + +TEST_F(ModelImplTest, ShowingState) { + model_->Initialize(base::Bind(&NoOpCallback)); + EXPECT_TRUE(model_->IsReady()); + + EXPECT_FALSE(model_->IsCurrentlyShowing()); + + model_->SetIsCurrentlyShowing(false); + EXPECT_FALSE(model_->IsCurrentlyShowing()); + + model_->SetIsCurrentlyShowing(true); + EXPECT_TRUE(model_->IsCurrentlyShowing()); + + model_->SetIsCurrentlyShowing(false); + EXPECT_FALSE(model_->IsCurrentlyShowing()); +} + +} // namespace feature_engagement_tracker
diff --git a/components/feature_engagement_tracker/internal/once_condition_validator.cc b/components/feature_engagement_tracker/internal/once_condition_validator.cc new file mode 100644 index 0000000..2e14015 --- /dev/null +++ b/components/feature_engagement_tracker/internal/once_condition_validator.cc
@@ -0,0 +1,40 @@ +// 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 "components/feature_engagement_tracker/internal/once_condition_validator.h" + +#include "base/feature_list.h" +#include "components/feature_engagement_tracker/internal/configuration.h" +#include "components/feature_engagement_tracker/internal/model.h" + +namespace feature_engagement_tracker { + +OnceConditionValidator::OnceConditionValidator() = default; + +OnceConditionValidator::~OnceConditionValidator() = default; + +bool OnceConditionValidator::MeetsConditions(const base::Feature& feature, + const Model& model) { + if (!base::FeatureList::IsEnabled(feature)) + return false; + + if (!model.IsReady()) + return false; + + if (model.IsCurrentlyShowing()) + return false; + + const FeatureConfig& config = model.GetFeatureConfig(feature); + if (!config.valid) + return false; + + if (shown_features_.find(&feature) == shown_features_.end()) { + shown_features_.insert(&feature); + return true; + } + + return false; +} + +} // namespace feature_engagement_tracker
diff --git a/components/feature_engagement_tracker/internal/once_condition_validator.h b/components/feature_engagement_tracker/internal/once_condition_validator.h new file mode 100644 index 0000000..9cc0d54 --- /dev/null +++ b/components/feature_engagement_tracker/internal/once_condition_validator.h
@@ -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. + +#ifndef COMPONENTS_FEATURE_ENGAGEMENT_TRACKER_INTERNAL_ONCE_CONDITION_VALIDATOR_H_ +#define COMPONENTS_FEATURE_ENGAGEMENT_TRACKER_INTERNAL_ONCE_CONDITION_VALIDATOR_H_ + +#include <unordered_set> + +#include "base/macros.h" +#include "components/feature_engagement_tracker/internal/condition_validator.h" +#include "components/feature_engagement_tracker/internal/model.h" + +namespace base { +struct Feature; +} // namespace base + +namespace feature_engagement_tracker { + +// An ConditionValidator that will ensure that each base::Feature will meet +// conditions maximum one time for any given session. +// It has the following requirements: +// - The base::Feature is enabled +// - The Model is ready. +// - No other in-product help is currently showing. +// - FeatureServerConfig for the feature is valid. +// - This is the first time the given base::Feature meets all above stated +// conditions. +// +// NOTE: This ConditionValidator fully ignores any other configuration specified +// in the FeatureServerConfig. In practice this leads this ConditionValidator +// to be well suited for a demonstration mode of in-product help. +class OnceConditionValidator : public ConditionValidator { + public: + OnceConditionValidator(); + ~OnceConditionValidator() override; + + // ConditionValidator implementation. + bool MeetsConditions(const base::Feature& feature, + const Model& model) override; + + private: + // Contains all features that have met conditions within the current session. + std::unordered_set<const base::Feature*> shown_features_; + + DISALLOW_COPY_AND_ASSIGN(OnceConditionValidator); +}; + +} // namespace feature_engagement_tracker + +#endif // COMPONENTS_FEATURE_ENGAGEMENT_TRACKER_INTERNAL_ONCE_CONDITION_VALIDATOR_H_
diff --git a/components/feature_engagement_tracker/internal/once_condition_validator_unittest.cc b/components/feature_engagement_tracker/internal/once_condition_validator_unittest.cc new file mode 100644 index 0000000..ecc58e4c --- /dev/null +++ b/components/feature_engagement_tracker/internal/once_condition_validator_unittest.cc
@@ -0,0 +1,149 @@ +// 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 "components/feature_engagement_tracker/internal/once_condition_validator.h" + +#include "base/feature_list.h" +#include "base/metrics/field_trial.h" +#include "base/test/scoped_feature_list.h" +#include "components/feature_engagement_tracker/internal/editable_configuration.h" +#include "components/feature_engagement_tracker/internal/model.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace feature_engagement_tracker { + +namespace { + +const base::Feature kTestFeatureFoo{"test_foo", + base::FEATURE_DISABLED_BY_DEFAULT}; +const base::Feature kTestFeatureBar{"test_bar", + base::FEATURE_DISABLED_BY_DEFAULT}; + +// A Model that is easily configurable at runtime. +class TestModel : public Model { + public: + TestModel() : ready_(false), is_showing_(false) {} + + void Initialize(const OnModelInitializationFinished& callback) override {} + + bool IsReady() const override { return ready_; } + + void SetIsReady(bool ready) { ready_ = ready; } + + const FeatureConfig& GetFeatureConfig( + const base::Feature& feature) const override { + return configuration_.GetFeatureConfig(feature); + } + + void SetIsCurrentlyShowing(bool is_showing) override { + is_showing_ = is_showing; + } + + bool IsCurrentlyShowing() const override { return is_showing_; } + + EditableConfiguration& GetConfiguration() { return configuration_; } + + private: + EditableConfiguration configuration_; + bool ready_; + bool is_showing_; +}; + +class OnceConditionValidatorTest : public ::testing::Test { + public: + void SetUp() override { + // By default, model should be ready. + model_.SetIsReady(true); + } + + void AddFeature(const base::Feature& feature, bool valid) { + FeatureConfig feature_config; + feature_config.valid = valid; + model_.GetConfiguration().SetConfiguration(&feature, feature_config); + } + + protected: + base::test::ScopedFeatureList scoped_feature_list_; + TestModel model_; + OnceConditionValidator validator_; +}; + +} // namespace + +TEST_F(OnceConditionValidatorTest, EnabledFeatureShouldTriggerOnce) { + scoped_feature_list_.InitWithFeatures({kTestFeatureFoo}, {}); + + // Initialize validator with one enabled and valid feature. + AddFeature(kTestFeatureFoo, true); + + // Only the first call to MeetsConditions() should lead to enlightenment. + EXPECT_TRUE(validator_.MeetsConditions(kTestFeatureFoo, model_)); + EXPECT_FALSE(validator_.MeetsConditions(kTestFeatureFoo, model_)); +} + +TEST_F(OnceConditionValidatorTest, OnlyEnabledFeaturesShouldTrigger) { + scoped_feature_list_.InitWithFeatures({kTestFeatureFoo}, {kTestFeatureBar}); + + // Initialize validator with one enabled and one disabled feature, both valid. + AddFeature(kTestFeatureFoo, true); + AddFeature(kTestFeatureBar, true); + + // Only the kTestFeatureFoo feature should lead to enlightenment, since + // kTestFeatureBar is disabled. Ordering disabled feature first to ensure this + // captures a different behavior than the + // OnlyOneFeatureShouldTriggerPerSession test below. + EXPECT_FALSE(validator_.MeetsConditions(kTestFeatureBar, model_)); + EXPECT_TRUE(validator_.MeetsConditions(kTestFeatureFoo, model_)); +} + +TEST_F(OnceConditionValidatorTest, NeverTriggerWhenAllFeaturesDisabled) { + scoped_feature_list_.InitWithFeatures({}, {kTestFeatureFoo, kTestFeatureBar}); + + // Initialize validator with two enabled features, both valid. + AddFeature(kTestFeatureFoo, true); + AddFeature(kTestFeatureBar, true); + + // No features should get to show enlightenment. + EXPECT_FALSE(validator_.MeetsConditions(kTestFeatureFoo, model_)); + EXPECT_FALSE(validator_.MeetsConditions(kTestFeatureBar, model_)); +} + +TEST_F(OnceConditionValidatorTest, OnlyTriggerWhenModelIsReady) { + scoped_feature_list_.InitWithFeatures({kTestFeatureFoo}, {}); + + // Initialize validator with a single valid feature. + AddFeature(kTestFeatureFoo, true); + + model_.SetIsReady(false); + EXPECT_FALSE(validator_.MeetsConditions(kTestFeatureFoo, model_)); + + model_.SetIsReady(true); + EXPECT_TRUE(validator_.MeetsConditions(kTestFeatureFoo, model_)); +} + +TEST_F(OnceConditionValidatorTest, OnlyTriggerIfNothingElseIsShowing) { + scoped_feature_list_.InitWithFeatures({kTestFeatureFoo}, {}); + + // Initialize validator with a single valid feature. + AddFeature(kTestFeatureFoo, true); + + model_.SetIsCurrentlyShowing(true); + EXPECT_FALSE(validator_.MeetsConditions(kTestFeatureFoo, model_)); + + model_.SetIsCurrentlyShowing(false); + EXPECT_TRUE(validator_.MeetsConditions(kTestFeatureFoo, model_)); +} + +TEST_F(OnceConditionValidatorTest, DoNotTriggerForInvalidConfig) { + scoped_feature_list_.InitWithFeatures({kTestFeatureFoo}, {}); + + AddFeature(kTestFeatureFoo, false); + EXPECT_FALSE(validator_.MeetsConditions(kTestFeatureFoo, model_)); + + // Override config to be valid. + AddFeature(kTestFeatureFoo, true); + EXPECT_TRUE(validator_.MeetsConditions(kTestFeatureFoo, model_)); +} + +} // namespace feature_engagement_tracker
diff --git a/components/feature_engagement_tracker/internal/store.h b/components/feature_engagement_tracker/internal/store.h new file mode 100644 index 0000000..9a1e2c9 --- /dev/null +++ b/components/feature_engagement_tracker/internal/store.h
@@ -0,0 +1,37 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_FEATURE_ENGAGEMENT_TRACKER_INTERNAL_STORE_H_ +#define COMPONENTS_FEATURE_ENGAGEMENT_TRACKER_INTERNAL_STORE_H_ + +#include "base/callback.h" +#include "base/macros.h" + +namespace feature_engagement_tracker { + +// Store represents the storage engine behind the FeatureEngagementTracker. +class Store { + public: + // TODO(nyquist): Add vector of all events to result callback. + using OnLoadedCallback = base::Callback<void(bool success)>; + + virtual ~Store() = default; + + // Loads the database from storage and asynchronously posts the result back. + virtual void Load(const OnLoadedCallback& callback) = 0; + + // Returns whether the database is ready, i.e. whether it has been fully + // loaded. + virtual bool IsReady() const = 0; + + protected: + Store() = default; + + private: + DISALLOW_COPY_AND_ASSIGN(Store); +}; + +} // namespace feature_engagement_tracker + +#endif // COMPONENTS_FEATURE_ENGAGEMENT_TRACKER_INTERNAL_STORE_H_
diff --git a/components/omnibox/browser/zero_suggest_provider.cc b/components/omnibox/browser/zero_suggest_provider.cc index 8ca495a..8a7dcf7 100644 --- a/components/omnibox/browser/zero_suggest_provider.cc +++ b/components/omnibox/browser/zero_suggest_provider.cc
@@ -104,7 +104,7 @@ bool minimal_changes) { TRACE_EVENT0("omnibox", "ZeroSuggestProvider::Start"); matches_.clear(); - if (!input.from_omnibox_focus() || + if (!input.from_omnibox_focus() || client()->IsOffTheRecord() || input.type() == metrics::OmniboxInputType::INVALID) return;
diff --git a/components/payments/content/payment_manifest_downloader.cc b/components/payments/content/payment_manifest_downloader.cc index ae3e64d..15a8783 100644 --- a/components/payments/content/payment_manifest_downloader.cc +++ b/components/payments/content/payment_manifest_downloader.cc
@@ -17,6 +17,7 @@ #include "net/http/http_response_headers.h" #include "net/http/http_status_code.h" #include "net/http/http_util.h" +#include "net/traffic_annotation/network_traffic_annotation.h" #include "net/url_request/url_request_context_getter.h" #include "url/url_constants.h" @@ -62,7 +63,28 @@ return; } - fetcher_ = net::URLFetcher::Create(0 /* id */, url, request_type, this); + net::NetworkTrafficAnnotationTag traffic_annotation = + net::DefineNetworkTrafficAnnotation("payment_manifest_downloader", R"( + semantics { + sender: "Web Payments" + description: + "Chromium downloads manifest files for web payments API to help " + "users make secure and convenient payments on the web." + trigger: + "A user that has a payment app visits a website that uses the web " + "payments API." + data: "None." + destination: WEBSITE + } + policy { + cookies_allowed: false + setting: + "This feature cannot be disabled in settings. Users can uninstall/" + "disable all payment apps to stop this feature." + policy_exception_justification: "Not implemented." + })"); + fetcher_ = net::URLFetcher::Create(0 /* id */, url, request_type, this, + traffic_annotation); data_use_measurement::DataUseUserData::AttachToFetcher( fetcher_.get(), data_use_measurement::DataUseUserData::PAYMENTS); fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES |
diff --git a/components/payments_strings.grdp b/components/payments_strings.grdp index b1e6220..bc1ba8f 100644 --- a/components/payments_strings.grdp +++ b/components/payments_strings.grdp
@@ -10,11 +10,11 @@ <message name="IDS_PAYMENTS_SAVE_CARD_TO_DEVICE_CHECKBOX" desc="The label for the checkbox that enables the user to save a credit card to their device, for example, on their phone." formatter_data="android_java"> Save this card to this device </message> - <message name="IDS_PAYMENTS_ACCEPTED_CARDS_LABEL" desc="The title for the section that displays the credit card types that the merchant accepts. Below the title, we show a row of icons indicating the accepted cards (Visa icon, Mastercard icon, etc.)." formatter_data="android_java"> - Accepted cards + <message name="IDS_PAYMENTS_ACCEPTED_CARDS_LABEL" desc="The title for the section that displays the credit card types that the merchant accepts." formatter_data="android_java"> + Cards accepted </message> <message name="IDS_PAYMENTS_METHOD_OF_PAYMENT_LABEL" desc="The title for the section that lets the user select the method of payment." formatter_data="android_java"> - Payment method + Payment </message> <message name="IDS_PAYMENTS_CONTACT_DETAILS_LABEL" desc="The title for the section that lets the user select how they can be contacted." formatter_data="android_java"> Contact info @@ -37,14 +37,14 @@ <message name="IDS_PAYMENTS_ADD_VALID_CARD_NUMBER" desc="The title of the dialog for user to add valid payment card number." formatter_data="android_java"> Add valid card number </message> - <message name="IDS_PAYMENTS_ADD_MORE_INFORMATION" desc="The title in the Android app title bar for user to add more information to payment card or shipping address or contact info." formatter_data="android_java"> + <message name="IDS_PAYMENTS_ADD_MORE_INFORMATION" desc="The title of the dialog for user to add more information to payment card or shipping address or contact info." formatter_data="android_java"> Add more information </message> <message name="IDS_PAYMENTS_EDIT_CARD" desc="The title of the dialog for user to edit payment card." formatter_data="android_java"> Edit card </message> <message name="IDS_PAYMENTS_CREDIT_CARD_EXPIRATION_DATE_ABBR" desc="Abbreviated label for credit card expiration date. [CHAR-LIMIT=32]" formatter_data="android_java"> - Expires <ph name="EXPIRATION_MONTH">%1$s<ex>06</ex></ph>/<ph name="EXPIRATION_YEAR">%2$s<ex>17</ex></ph> + Exp: <ph name="EXPIRATION_MONTH">%1$s<ex>06</ex></ph>/<ph name="EXPIRATION_YEAR">%2$s<ex>17</ex></ph> </message> <message name="IDS_PAYMENTS_ADD_PHONE_NUMBER" desc="The title of the dialog for user to add phone number to the shipping address or contact info. This phone number can be used, for example, if there's a problem with shipping a package to its destination." formatter_data="android_java"> Add phone number @@ -77,7 +77,7 @@ Processing </message> <message name="IDS_PAYMENTS_ERROR_MESSAGE_DIALOG_TITLE" desc="The title of the dialog that informs the user that there is error in verifying and charging the payment."> - Payment not completed + Payment Not Completed </message> <message name="IDS_PAYMENTS_ERROR_MESSAGE" desc="The text that informs the user that there is error in verifying and charging the payment." formatter_data="android_java"> There was an error processing your order. Please try again. @@ -101,10 +101,10 @@ You can manage cards and addresses in <ph name="BEGIN_LINK">BEGIN_LINK</ph>Settings<ph name="END_LINK">END_LINK</ph>. </message> <message name="IDS_PAYMENTS_CARD_AND_ADDRESS_SETTINGS_SIGNED_IN" desc="Label of the section containing the origin description and the link to go to the settings page for card and address options. This label is used when the user is signed in." formatter_data="android_java"> - Cards and addresses are from Chrome and your Google Account (<ph name="ACCOUNT_EMAIL">%1$s<ex>johndoe@gmail.com</ex></ph>). You can manage them in <ph name="BEGIN_LINK">BEGIN_LINK</ph>Settings<ph name="END_LINK">END_LINK</ph>. + Card and address options are from your Google Account (<ph name="ACCOUNT_EMAIL">%1$s<ex>johndoe@gmail.com</ex></ph>) and Chrome. You can manage these in <ph name="BEGIN_LINK">BEGIN_LINK</ph>Settings<ph name="END_LINK">END_LINK</ph>. </message> <message name="IDS_PAYMENTS_CARD_AND_ADDRESS_SETTINGS_SIGNED_OUT" desc="Label of the section containing the origin description and the link to go to the settings page for card and address options. This label is used when the user is not signed in." formatter_data="android_java"> - Cards and addresses are from Chrome. You can manage them in <ph name="BEGIN_LINK">BEGIN_LINK</ph>Settings<ph name="END_LINK">END_LINK</ph>. + Card and address options are from Chrome. You can manage these in <ph name="BEGIN_LINK">BEGIN_LINK</ph>Settings<ph name="END_LINK">END_LINK</ph>. </message> <!-- Credit Card form --> @@ -113,7 +113,7 @@ Card Number </message> <message name="IDS_PAYMENTS_NAME_ON_CARD" desc="Title of the field representing the full name of a credit card holder."> - Cardholder Name + Name on Card </message> <message name="IDS_PAYMENTS_EXP_MONTH" desc="Title of the field representing the expiration month of a credit card."> Expiration Month @@ -128,43 +128,43 @@ <!-- Validation --> <message name="IDS_PAYMENTS_VALIDATION_INVALID_NAME" desc="Message displayed to user when name validation fails."> - Enter a name + Invalid name </message> <message name="IDS_PAYMENTS_VALIDATION_INVALID_CREDIT_CARD_EXPIRATION_YEAR" desc="Message displayed to user when the credit card expiration year is in an invalid format."> - Enter a valid expiration year + Invalid expiration year </message> <message name="IDS_PAYMENTS_VALIDATION_INVALID_CREDIT_CARD_EXPIRATION_MONTH" desc="Message displayed to user when the credit card expiration month is in an invalid format."> - Enter a valid expiration month + Invalid expiration month </message> <message name="IDS_PAYMENTS_VALIDATION_INVALID_CREDIT_CARD_EXPIRED" desc="Message displayed to user when the credit card is expired."> - This card is expired + The card is expired </message> <message name="IDS_PAYMENTS_VALIDATION_UNSUPPORTED_CREDIT_CARD_TYPE" desc="Message displayed to user when the credit card type (e.g visa, mastercard) is not supported for this transaction."> - This type of card isn’t supported + Unsupported card type </message> <message name="IDS_PAYMENTS_REQUIRED_FIELD_MESSAGE" desc="The text that informs the user that '*' character indicates an input field that is required. The '*' character should not be changed." formatter_data="android_java"> - * Field is required + * indicates required field </message> - <message name="IDS_PAYMENTS_FIELD_REQUIRED_VALIDATION_MESSAGE" desc="The text that informs the user that an input field is required. “Required” is an adjective." formatter_data="android_java"> + <message name="IDS_PAYMENTS_FIELD_REQUIRED_VALIDATION_MESSAGE" desc="The text that informs the user that an input field is required." formatter_data="android_java"> Required field </message> <message name="IDS_PAYMENTS_PHONE_INVALID_VALIDATION_MESSAGE" desc="The text that informs the user that the phone number they have entered is not valid." formatter_data="android_java"> - Enter a valid phone number + Invalid phone number </message> <message name="IDS_PAYMENTS_EMAIL_INVALID_VALIDATION_MESSAGE" desc="The text that informs the user that the email address they have entered is not valid." formatter_data="android_java"> - Enter a valid email address + Invalid email address </message> <message name="IDS_PAYMENTS_CARD_NUMBER_INVALID_VALIDATION_MESSAGE" desc="The text that informs the user that the credit card number they have entered is not valid." formatter_data="android_java"> - Enter a valid card number + Invalid card number </message> <message name="IDS_PAYMENTS_CARD_EXPIRATION_INVALID_VALIDATION_MESSAGE" desc="The text that informs the user that the credit card expiration date they have entered is not valid." formatter_data="android_java"> - Enter a valid expiration date + Invalid expiration date </message> <message name="IDS_PAYMENTS_BILLING_ADDRESS_REQUIRED" desc="The label to indicate billing address is required for payment card." formatter_data="android_java"> Billing address required </message> - <message name="IDS_PAYMENTS_NAME_ON_CARD_REQUIRED" desc="The label to indicate the cardholder name (the name of the owner or “holder” of the credit card) must be entered." formatter_data="android_java"> - Cardholder name required + <message name="IDS_PAYMENTS_NAME_ON_CARD_REQUIRED" desc="The label to indicate name on card is required for payment card." formatter_data="android_java"> + Name on card required </message> <message name="IDS_PAYMENTS_MORE_INFORMATION_REQUIRED" desc="The label to indicate more information is required for payment card or shipping address or contact info." formatter_data="android_java"> More information required @@ -176,7 +176,7 @@ Name required </message> <message name="IDS_PAYMENTS_INVALID_ADDRESS" desc="The label to indicate the shipping address is invalid. For example, missing state or city name." formatter_data="android_java"> - Enter a valid address + Invalid address </message> <message name="IDS_PAYMENTS_EMAIL_REQUIRED" desc="The label to indicate email is required for the contact details. This email can be used to contact the payer." formatter_data="android_java"> Email required @@ -209,66 +209,66 @@ </message> <!-- Shipping address in web payments API --> - <message name="IDS_PAYMENTS_SHIPPING_SUMMARY_LABEL" desc="The title for the section of shipping information. Shipping is used for packages and things that are mailed. In American English, “shipping” is differentiated from “delivery”. “Delivery” is used, for example, for food delivery." formatter_data="android_java"> + <message name="IDS_PAYMENTS_SHIPPING_SUMMARY_LABEL" desc="The title for the section of shipping information. Shipping is typically used for packages." formatter_data="android_java"> Shipping </message> <message name="IDS_PAYMENTS_SHIPPING_ADDRESS_LABEL" desc="The title for the section that lets the user select the address where the product should be shipped. Shipping is typically used for packages." formatter_data="android_java"> Shipping address </message> <message name="IDS_PAYMENTS_SHIPPING_OPTION_LABEL" desc="The title for the section that lets the user select how the product should be shipped. Shipping is typically used for packages." formatter_data="android_java"> - Shipping method + Shipping option </message> <message name="IDS_PAYMENTS_SELECT_SHIPPING_ADDRESS_FOR_SHIPPING_METHODS" desc="Text implying that a user needs to pick a shipping address to see the shipping methods. Shipping is typically used for packages." formatter_data="android_java"> - To see shipping methods and requirements, select an address + Select a shipping address to check shipping methods and requirements. </message> - <message name="IDS_PAYMENTS_UNSUPPORTED_SHIPPING_ADDRESS" desc="Text implying that a user needs to pick a different shipping address, because the currently selected address is not supported. “Ship” is typically used for packages and items that are sent through the mail. In American English, we differentiate “ship” from “deliver." formatter_data="android_java"> - Can’t ship to this address. Select a different address. + <message name="IDS_PAYMENTS_UNSUPPORTED_SHIPPING_ADDRESS" desc="Text implying that a user needs to pick a different shipping address, because the currently selected address is not supported. Shipping is typically used for packages." formatter_data="android_java"> + Unsupported shipping address. Select a different address. </message> - <message name="IDS_PAYMENTS_UNSUPPORTED_SHIPPING_OPTION" desc="Text implying that a user needs to pick a different shipping option, because the currently selected option is not supported. “Ship” is typically used for packages and items that are sent through the mail. In American English, we differentiate “ship” from deliver." formatter_data="android_java"> - This shipping method isn’t available. Try a different method. + <message name="IDS_PAYMENTS_UNSUPPORTED_SHIPPING_OPTION" desc="Text implying that a user needs to pick a different shipping option, because the currently selected option is not supported. Shipping is typically used for packages." formatter_data="android_java"> + That shipping option isn’t available. Try a different option. </message> <!-- Delivery address in web payments API --> <message name="IDS_PAYMENTS_DELIVERY_SUMMARY_LABEL" desc="The title for the section of delivery information. Delivery is commonly faster than shipping. For example, it might be used for food delivery." formatter_data="android_java"> Delivery </message> - <message name="IDS_PAYMENTS_DELIVERY_ADDRESS_LABEL" desc="The title for the section that lets the user select the address where the product should be delivered. In English, “delivery” is differentiated from “shipping.” For example, “delivery” might be used for meals or meal items or items that need to be immediately sent to a recipient." formatter_data="android_java"> + <message name="IDS_PAYMENTS_DELIVERY_ADDRESS_LABEL" desc="The title for the section that lets the user select the address where the product should be delivered. Delivery is commonly faster than shipping. For example, it might be used for food delivery." formatter_data="android_java"> Delivery address </message> <message name="IDS_PAYMENTS_DELIVERY_OPTION_LABEL" desc="The title for the section that lets the user select how the product should be delivered. Delivery is commonly faster than shipping. For example, it might be used for food delivery." formatter_data="android_java"> - Delivery method + Delivery option </message> <message name="IDS_PAYMENTS_SELECT_DELIVERY_ADDRESS_FOR_DELIVERY_METHODS" desc="Text implying that a user needs to pick a delivery address to see the delivery methods. Delivery is commonly faster than shipping. For example, it might be used for food delivery." formatter_data="android_java"> - To see delivery methods and requirements, select an address + Select a delivery address to check delivery methods and requirements. </message> <message name="IDS_PAYMENTS_UNSUPPORTED_DELIVERY_ADDRESS" desc="Text implying that a user needs to pick a different delivery address, because the currently selected address is not supported. Delivery is commonly faster than shipping. For example, it might be used for food delivery." formatter_data="android_java"> - Can’t deliver to this address. Select a different address. + Unsupported delivery address. Select a different address. </message> <message name="IDS_PAYMENTS_UNSUPPORTED_DELIVERY_OPTION" desc="Text implying that a user needs to pick a different delivery option, because the currently selected option is not supported. Delivery is commonly faster than shipping. For example, it might be used for food delivery." formatter_data="android_java"> - This delivery method isn’t available. Try a different method. + That delivery option isn’t available. Try a different option. </message> <!-- Pickup address in web payments API --> - <message name="IDS_PAYMENTS_PICKUP_SUMMARY_LABEL" desc="The title for the section of information needed for a service to pick up items from a customer. For example, this could be the address for laundry pickup. “Pickup” is a noun." formatter_data="android_java"> + <message name="IDS_PAYMENTS_PICKUP_SUMMARY_LABEL" desc="The title for the section of pickup information. For example, this could be the address for laundry pickup." formatter_data="android_java"> Pickup </message> - <message name="IDS_PAYMENTS_PICKUP_ADDRESS_LABEL" desc="The title for the section that lets the user select the address where a service item should be picked up. For example, the pickup address is where a laundry service picks up a customer’s items to be laundered. “Pickup” functions as an adjective." formatter_data="android_java"> + <message name="IDS_PAYMENTS_PICKUP_ADDRESS_LABEL" desc="The title for the section that lets the user select the address where their item should be picked up. For example, this item could be laundry to be cleaned." formatter_data="android_java"> Pickup address </message> - <message name="IDS_PAYMENTS_PICKUP_OPTION_LABEL" desc="The title for the section that lets the user select how their service item should be picked up. This item can be laundry to be cleaned, for example. “Pickup” functions as an adjective." formatter_data="android_java"> - Pickup method + <message name="IDS_PAYMENTS_PICKUP_OPTION_LABEL" desc="The title for the section that lets the user select how their item should be picked up. This item can be laundry to be cleaned, for example." formatter_data="android_java"> + Pickup option </message> - <message name="IDS_PAYMENTS_SELECT_PICKUP_ADDRESS_FOR_PICKUP_METHODS" desc="Text implying that a user needs to choose a pickup address to see the pickup methods. For example, this could be the address for laundry pickup. “Pickup” functions as an adjective." formatter_data="android_java"> - To see pickup methods and requirements, select an address + <message name="IDS_PAYMENTS_SELECT_PICKUP_ADDRESS_FOR_PICKUP_METHODS" desc="Text implying that a user needs to choose a pickup address to see the pickup methods. For example, this could be the address for laundry pickup." formatter_data="android_java"> + Select a pickup address to check pickup methods and requirements. </message> - <message name="IDS_PAYMENTS_UNSUPPORTED_PICKUP_ADDRESS" desc="Text implying that a user needs to choose a different pickup address, because the service can’t pick up items from that address. This address can be used, for example, for laundry pickup. Note that here, “pick up” is a verb." formatter_data="android_java"> - Can’t pick up from this address. Select a different address. + <message name="IDS_PAYMENTS_UNSUPPORTED_PICKUP_ADDRESS" desc="Text implying that a user needs to choose a different pickup address, because the currently selected address is not supported. This address can be used, for example, for laundry pickup." formatter_data="android_java"> + Unsupported pickup address. Select a different address. </message> <message name="IDS_PAYMENTS_UNSUPPORTED_PICKUP_OPTION" desc="Text implying that a user needs to choose a different pickup option, because the currently selected option is not supported. This option can be used, for example, for laundry pickup." formatter_data="android_java"> - This pickup method isn’t available. Try a different method. + That pickup option isn’t available. Try a different option. </message> <message name="IDS_PAYMENTS_ANDROID_APP_ERROR" desc="Error message that is shown when an Android payment application fails to start." formatter_data="android_java"> - Can’t open payment app + Unable to launch payment app. </message> <message name="IDS_UTILITY_PROCESS_PAYMENT_MANIFEST_PARSER_NAME" desc="The name of the utility process used for parsing payment manifest files.">
diff --git a/components/translate/content/browser/content_translate_driver.cc b/components/translate/content/browser/content_translate_driver.cc index 0daeb0b..41ae73f 100644 --- a/components/translate/content/browser/content_translate_driver.cc +++ b/components/translate/content/browser/content_translate_driver.cc
@@ -126,7 +126,7 @@ it->second->RevertTranslation(); } -bool ContentTranslateDriver::IsOffTheRecord() { +bool ContentTranslateDriver::IsIncognito() { return navigation_controller_->GetBrowserContext()->IsOffTheRecord(); }
diff --git a/components/translate/content/browser/content_translate_driver.h b/components/translate/content/browser/content_translate_driver.h index fdf415e..e17fe73 100644 --- a/components/translate/content/browser/content_translate_driver.h +++ b/components/translate/content/browser/content_translate_driver.h
@@ -86,7 +86,7 @@ const std::string& source_lang, const std::string& target_lang) override; void RevertTranslation(int page_seq_no) override; - bool IsOffTheRecord() override; + bool IsIncognito() override; const std::string& GetContentsMimeType() override; const GURL& GetLastCommittedURL() override; const GURL& GetVisibleURL() override;
diff --git a/components/translate/core/browser/mock_translate_driver.cc b/components/translate/core/browser/mock_translate_driver.cc index bc4e8a7..f537e77 100644 --- a/components/translate/core/browser/mock_translate_driver.cc +++ b/components/translate/core/browser/mock_translate_driver.cc
@@ -34,7 +34,7 @@ } -bool MockTranslateDriver::IsOffTheRecord() { +bool MockTranslateDriver::IsIncognito() { return false; }
diff --git a/components/translate/core/browser/mock_translate_driver.h b/components/translate/core/browser/mock_translate_driver.h index fa3c4f7..c5a7c07 100644 --- a/components/translate/core/browser/mock_translate_driver.h +++ b/components/translate/core/browser/mock_translate_driver.h
@@ -38,7 +38,7 @@ void RevertTranslation(int page_seq_no) override {} - bool IsOffTheRecord() override; + bool IsIncognito() override; const std::string& GetContentsMimeType() override;
diff --git a/components/translate/core/browser/translate_driver.h b/components/translate/core/browser/translate_driver.h index 8842284..e58589f 100644 --- a/components/translate/core/browser/translate_driver.h +++ b/components/translate/core/browser/translate_driver.h
@@ -34,8 +34,8 @@ // Reverts the contents of the page to its original language. virtual void RevertTranslation(int page_seq_no) = 0; - // Returns whether the user is currently operating in off-the-record mode. - virtual bool IsOffTheRecord() = 0; + // Returns whether the user is currently operating in incognito mode. + virtual bool IsIncognito() = 0; // Returns the mime type of the current page. virtual const std::string& GetContentsMimeType() = 0;
diff --git a/components/translate/core/browser/translate_manager.cc b/components/translate/core/browser/translate_manager.cc index 8491a2ad..114a93fb 100644 --- a/components/translate/core/browser/translate_manager.cc +++ b/components/translate/core/browser/translate_manager.cc
@@ -281,7 +281,7 @@ // automatically translate. Note that in incognito mode we disable that // feature; the user will get an infobar, so they can control whether the // page's text is sent to the translate server. - if (!translate_driver_->IsOffTheRecord()) { + if (!translate_driver_->IsIncognito()) { std::string auto_target_lang = GetAutoTargetLanguage(language_code, translate_prefs.get()); if (!auto_target_lang.empty()) { @@ -441,7 +441,7 @@ // Notifies |g_callback_list_| of translate errors. void TranslateManager::NotifyTranslateError(TranslateErrors::Type error_type) { if (!g_callback_list_ || error_type == TranslateErrors::NONE || - translate_driver_->IsOffTheRecord()) { + translate_driver_->IsIncognito()) { return; }
diff --git a/components/translate/core/browser/translate_ui_delegate.cc b/components/translate/core/browser/translate_ui_delegate.cc index 7abb8dc..8a091212 100644 --- a/components/translate/core/browser/translate_ui_delegate.cc +++ b/components/translate/core/browser/translate_ui_delegate.cc
@@ -209,7 +209,7 @@ } void TranslateUIDelegate::Translate() { - if (!translate_driver_->IsOffTheRecord()) { + if (!translate_driver_->IsIncognito()) { prefs_->ResetTranslationDeniedCount(GetOriginalLanguageCode()); prefs_->ResetTranslationIgnoredCount(GetOriginalLanguageCode()); prefs_->IncrementTranslationAcceptedCount(GetOriginalLanguageCode()); @@ -232,7 +232,7 @@ } void TranslateUIDelegate::TranslationDeclined(bool explicitly_closed) { - if (!translate_driver_->IsOffTheRecord()) { + if (!translate_driver_->IsIncognito()) { const std::string& language = GetOriginalLanguageCode(); if (explicitly_closed) { prefs_->ResetTranslationAcceptedCount(language);
diff --git a/components/translate/ios/browser/ios_translate_driver.h b/components/translate/ios/browser/ios_translate_driver.h index 25deda2f..e9c0f08 100644 --- a/components/translate/ios/browser/ios_translate_driver.h +++ b/components/translate/ios/browser/ios_translate_driver.h
@@ -57,7 +57,7 @@ const std::string& source_lang, const std::string& target_lang) override; void RevertTranslation(int page_seq_no) override; - bool IsOffTheRecord() override; + bool IsIncognito() override; const std::string& GetContentsMimeType() override; const GURL& GetLastCommittedURL() override; const GURL& GetVisibleURL() override;
diff --git a/components/translate/ios/browser/ios_translate_driver.mm b/components/translate/ios/browser/ios_translate_driver.mm index 2bb266fd..dc5a9203 100644 --- a/components/translate/ios/browser/ios_translate_driver.mm +++ b/components/translate/ios/browser/ios_translate_driver.mm
@@ -148,7 +148,7 @@ translate_controller_->RevertTranslation(); } -bool IOSTranslateDriver::IsOffTheRecord() { +bool IOSTranslateDriver::IsIncognito() { return navigation_manager_->GetBrowserState()->IsOffTheRecord(); }
diff --git a/content/renderer/media_recorder/video_track_recorder.cc b/content/renderer/media_recorder/video_track_recorder.cc index de9ad322..49def8d1 100644 --- a/content/renderer/media_recorder/video_track_recorder.cc +++ b/content/renderer/media_recorder/video_track_recorder.cc
@@ -39,6 +39,22 @@ namespace content { +libyuv::RotationMode MediaVideoRotationToRotationMode( + media::VideoRotation rotation) { + switch (rotation) { + case media::VIDEO_ROTATION_0: + return libyuv::kRotate0; + case media::VIDEO_ROTATION_90: + return libyuv::kRotate90; + case media::VIDEO_ROTATION_180: + return libyuv::kRotate180; + case media::VIDEO_ROTATION_270: + return libyuv::kRotate270; + } + NOTREACHED() << rotation; + return libyuv::kRotate0; +} + namespace { using CodecId = VideoTrackRecorder::CodecId; @@ -219,10 +235,21 @@ DCHECK(video_frame->HasTextures()); DCHECK_EQ(media::PIXEL_FORMAT_ARGB, video_frame->format()); + const gfx::Size& old_visible_size = video_frame->visible_rect().size(); + gfx::Size new_visible_size = old_visible_size; + + media::VideoRotation video_rotation = media::VIDEO_ROTATION_0; + if (video_frame->metadata()->GetRotation( + media::VideoFrameMetadata::ROTATION, &video_rotation) && + (video_rotation == media::VIDEO_ROTATION_90 || + video_rotation == media::VIDEO_ROTATION_270)) { + new_visible_size.SetSize(old_visible_size.height(), + old_visible_size.width()); + } + frame = media::VideoFrame::CreateFrame( - media::PIXEL_FORMAT_I420, video_frame->coded_size(), - video_frame->visible_rect(), video_frame->natural_size(), - video_frame->timestamp()); + media::PIXEL_FORMAT_I420, new_visible_size, gfx::Rect(new_visible_size), + new_visible_size, video_frame->timestamp()); const SkImageInfo info = SkImageInfo::MakeN32( frame->visible_rect().width(), frame->visible_rect().height(), @@ -247,26 +274,22 @@ DLOG(ERROR) << "Error trying to map PaintSurface's pixels"; return; } - // TODO(mcasas): Use the incoming frame's rotation when - // https://bugs.chromium.org/p/webrtc/issues/detail?id=6069 is closed. - const libyuv::RotationMode source_rotation = libyuv::kRotate0; + const uint32 source_pixel_format = (kN32_SkColorType == kRGBA_8888_SkColorType) ? libyuv::FOURCC_ABGR : libyuv::FOURCC_ARGB; - if (libyuv::ConvertToI420(static_cast<uint8*>(pixmap.writable_addr()), - pixmap.getSafeSize(), - frame->visible_data(media::VideoFrame::kYPlane), - frame->stride(media::VideoFrame::kYPlane), - frame->visible_data(media::VideoFrame::kUPlane), - frame->stride(media::VideoFrame::kUPlane), - frame->visible_data(media::VideoFrame::kVPlane), - frame->stride(media::VideoFrame::kVPlane), - 0 /* crop_x */, 0 /* crop_y */, - pixmap.width(), pixmap.height(), - frame->visible_rect().width(), - frame->visible_rect().height(), - source_rotation, - source_pixel_format) != 0) { + if (libyuv::ConvertToI420( + static_cast<uint8*>(pixmap.writable_addr()), pixmap.getSafeSize(), + frame->visible_data(media::VideoFrame::kYPlane), + frame->stride(media::VideoFrame::kYPlane), + frame->visible_data(media::VideoFrame::kUPlane), + frame->stride(media::VideoFrame::kUPlane), + frame->visible_data(media::VideoFrame::kVPlane), + frame->stride(media::VideoFrame::kVPlane), 0 /* crop_x */, + 0 /* crop_y */, pixmap.width(), pixmap.height(), + old_visible_size.width(), old_visible_size.height(), + MediaVideoRotationToRotationMode(video_rotation), + source_pixel_format) != 0) { DLOG(ERROR) << "Error converting frame to I420"; return; }
diff --git a/ios/web_view/shell/BUILD.gn b/ios/web_view/shell/BUILD.gn index 46bcdd1d..c67526345 100644 --- a/ios/web_view/shell/BUILD.gn +++ b/ios/web_view/shell/BUILD.gn
@@ -56,6 +56,7 @@ "textfield_background@2x.png", "toolbar_back@2x.png", "toolbar_forward@2x.png", + "toolbar_more_horiz@2x.png", "toolbar_stop@2x.png", ] outputs = [
diff --git a/ios/web_view/shell/shell_view_controller.m b/ios/web_view/shell/shell_view_controller.m index 8e09be8..6ad86e2 100644 --- a/ios/web_view/shell/shell_view_controller.m +++ b/ios/web_view/shell/shell_view_controller.m
@@ -72,7 +72,7 @@ UIViewAutoresizingFlexibleHeight]; [self.view addSubview:_containerView]; - const int kButtonCount = 3; + const int kButtonCount = 4; const CGFloat kButtonSize = 44; // Text field. @@ -128,9 +128,21 @@ action:@selector(stopLoading) forControlEvents:UIControlEventTouchUpInside]; + // Menu. + UIButton* menu = [UIButton buttonWithType:UIButtonTypeCustom]; + [menu setImage:[UIImage imageNamed:@"toolbar_more_horiz"] + forState:UIControlStateNormal]; + [menu setFrame:CGRectMake(3 * kButtonSize, 0, kButtonSize, kButtonSize)]; + [menu setImageEdgeInsets:insets]; + [menu setAutoresizingMask:UIViewAutoresizingFlexibleRightMargin]; + [menu addTarget:self + action:@selector(showMenu) + forControlEvents:UIControlEventTouchUpInside]; + [_toolbar addSubview:back]; [_toolbar addSubview:forward]; [_toolbar addSubview:stop]; + [_toolbar addSubview:menu]; [_toolbar addSubview:_field]; self.webView = [CWV webViewWithFrame:[_containerView bounds]]; @@ -171,6 +183,22 @@ [_webView stopLoading]; } +- (void)showMenu { + UIAlertController* alertController = [UIAlertController + alertControllerWithTitle:@"" + message:@"" + preferredStyle:UIAlertControllerStyleActionSheet]; + + [alertController + addAction:[UIAlertAction actionWithTitle:@"Reload" + style:UIAlertActionStyleDefault + handler:^(UIAlertAction* action) { + [_webView reload]; + }]]; + + [self presentViewController:alertController animated:YES completion:nil]; +} + - (BOOL)textFieldShouldReturn:(UITextField*)field { NSURLRequest* request = [NSURLRequest requestWithURL:[NSURL URLWithString:[field text]]];
diff --git a/ios/web_view/shell/toolbar_more_horiz@2x.png b/ios/web_view/shell/toolbar_more_horiz@2x.png new file mode 100644 index 0000000..dbb87ca9 --- /dev/null +++ b/ios/web_view/shell/toolbar_more_horiz@2x.png Binary files differ
diff --git a/net/quic/chromium/quic_stream_factory.cc b/net/quic/chromium/quic_stream_factory.cc index 1fe0bf28..1172e14 100644 --- a/net/quic/chromium/quic_stream_factory.cc +++ b/net/quic/chromium/quic_stream_factory.cc
@@ -345,6 +345,8 @@ const QuicSessionKey& key() const { return key_; } + const NetLogWithSource& net_log() const { return net_log_; } + base::WeakPtr<Job> GetWeakPtr() { return weak_factory_.GetWeakPtr(); } private: @@ -1006,7 +1008,21 @@ } // Associate with active job to |server_id| if such exists. - if (HasActiveJob(server_id)) { + auto it = active_jobs_.find(server_id); + if (it != active_jobs_.end()) { + const JobSet& job_set = it->second; + // TODO(zhongyi): figure out how to link the NetLogs if there are more than + // one job serving the same server id, i.e., auxiliary job is also + // created. + if (job_set.size() == 1) { + const NetLogWithSource& job_net_log = job_set.begin()->first->net_log(); + job_net_log.AddEvent( + NetLogEventType::QUIC_STREAM_FACTORY_JOB_BOUND_TO_HTTP_STREAM_JOB, + net_log.source().ToEventParametersCallback()); + net_log.AddEvent( + NetLogEventType::HTTP_STREAM_JOB_BOUND_TO_QUIC_STREAM_FACTORY_JOB, + job_net_log.source().ToEventParametersCallback()); + } job_requests_map_[server_id].insert(request); return ERR_IO_PENDING; }
diff --git a/printing/print_settings.cc b/printing/print_settings.cc index aef18c3..98ce4d4 100644 --- a/printing/print_settings.cc +++ b/printing/print_settings.cc
@@ -12,7 +12,7 @@ namespace printing { -base::LazyInstance<std::string>::DestructorAtExit g_user_agent; +base::LazyInstance<std::string>::Leaky g_user_agent; void SetAgent(const std::string& user_agent) { g_user_agent.Get() = user_agent;
diff --git a/printing/printed_document.cc b/printing/printed_document.cc index bd62ff2..dc4f0f1 100644 --- a/printing/printed_document.cc +++ b/printing/printed_document.cc
@@ -37,7 +37,7 @@ namespace { -base::LazyInstance<base::FilePath>::DestructorAtExit g_debug_dump_info = +base::LazyInstance<base::FilePath>::Leaky g_debug_dump_info = LAZY_INSTANCE_INITIALIZER; void DebugDumpPageTask(const base::string16& doc_name,
diff --git a/third_party/WebKit/LayoutTests/SlowTests b/third_party/WebKit/LayoutTests/SlowTests index 32b60bb..4abba26 100644 --- a/third_party/WebKit/LayoutTests/SlowTests +++ b/third_party/WebKit/LayoutTests/SlowTests
@@ -24,7 +24,6 @@ crbug.com/24182 editing/selection/modify_move/move-by-word-visually-multi-space.html [ Slow ] crbug.com/24182 editing/selection/modify_move/move-by-word-visually-crash-test-5.html [ Slow ] crbug.com/24182 fast/dom/SelectorAPI/resig-SelectorsAPI-test.xhtml [ Slow ] -crbug.com/24182 virtual/sharedarraybuffer/fast/dom/SelectorAPI/resig-SelectorsAPI-test.xhtml [ Slow ] crbug.com/24182 fast/frames/cached-frame-counter.html [ Slow ] crbug.com/24182 fast/frames/frame-limit.html [ Slow ] crbug.com/24182 fast/overflow/lots-of-sibling-inline-boxes.html [ Slow ] # Particularly slow in Debug: >12x slower! @@ -36,7 +35,6 @@ crbug.com/24182 virtual/mojo-loading/http/tests/cache/subresource-expiration-2.html [ Slow ] crbug.com/24182 [ Release Win7 ] http/tests/media/media-source/mediasource-addsourcebuffer.html [ Slow ] crbug.com/24182 [ Release Win7 ] virtual/mojo-loading/http/tests/media/media-source/mediasource-addsourcebuffer.html [ Slow ] -crbug.com/24182 [ Release Win7 ] virtual/sharedarraybuffer/http/tests/media/media-source/mediasource-addsourcebuffer.html [ Slow ] crbug.com/24182 http/tests/misc/acid3.html [ Slow ] crbug.com/24182 virtual/mojo-loading/http/tests/misc/acid3.html [ Slow ] crbug.com/24182 http/tests/misc/object-embedding-svg-delayed-size-negotiation-2.htm [ Slow ] @@ -83,13 +81,10 @@ crbug.com/24182 virtual/gpu/fast/canvas/canvas-strokeRect-gradient-shadow.html [ Slow ] crbug.com/24182 virtual/gpu/fast/canvas/canvas-toDataURL-jpeg-crash.html [ Slow ] crbug.com/24182 fast/dom/timer-throttling-background-page-near-alignment-interval.html [ Slow ] -crbug.com/24182 virtual/sharedarraybuffer/fast/dom/timer-throttling-background-page-near-alignment-interval.html [ Slow ] crbug.com/24182 http/tests/perf/large-inlined-script.html [ Slow ] crbug.com/24182 virtual/mojo-loading/http/tests/perf/large-inlined-script.html [ Slow ] crbug.com/24182 fast/css/should-not-insert-stylesheet-into-detached-document.html [ Slow ] -crbug.com/24182 virtual/sharedarraybuffer/fast/css/should-not-insert-stylesheet-into-detached-document.html [ Slow ] crbug.com/24182 fast/dom/shadow/svg-style-in-shadow-tree-crash.html [ Slow ] -crbug.com/24182 virtual/sharedarraybuffer/fast/dom/shadow/svg-style-in-shadow-tree-crash.html [ Slow ] crbug.com/24182 fast/encoding/char-encoding.html [ Slow ] crbug.com/24182 fast/frames/sandboxed-iframe-navigation-targetlink.html [ Slow ] crbug.com/24182 html/marquee/marquee-destroyed-without-removed-from-crash.html [ Slow ] @@ -100,7 +95,6 @@ crbug.com/24182 svg/hixie/perf/005.xml [ Slow ] crbug.com/24182 svg/hixie/perf/006.xml [ Slow ] crbug.com/451577 [ Debug ] fast/dom/gc-treescope.html [ Slow ] -crbug.com/451577 [ Debug ] virtual/sharedarraybuffer/fast/dom/gc-treescope.html [ Slow ] crbug.com/451577 [ Debug ] fast/frames/calculate-round.html [ Slow ] crbug.com/451577 external/wpt/IndexedDB/idbindex-multientry-big.htm [ Slow ] crbug.com/451577 [ Mac ] inspector/extensions/extensions-reload.html [ Slow ] @@ -226,7 +220,6 @@ crbug.com/24182 http/tests/xmlhttprequest/simple-cross-origin-progress-events.html [ Slow ] crbug.com/24182 virtual/mojo-loading/http/tests/xmlhttprequest/simple-cross-origin-progress-events.html [ Slow ] crbug.com/237270 [ Win7 ] fast/css/custom-font-xheight.html [ Slow ] -crbug.com/237270 [ Win7 ] virtual/sharedarraybuffer/fast/css/custom-font-xheight.html [ Slow ] crbug.com/241576 [ Win ] http/tests/appcache/404-manifest.html [ Slow ] crbug.com/241576 [ Win ] virtual/mojo-loading/http/tests/appcache/404-manifest.html [ Slow ] crbug.com/241869 [ Debug ] css3/flexbox/multiline-justify-content.html [ Slow ] @@ -236,7 +229,6 @@ # This test takes 5+ seconds as intended because it tests connection throttling. crbug.com/459377 http/tests/websocket/multiple-connections-throttled.html [ Slow ] crbug.com/459377 virtual/mojo-loading/http/tests/websocket/multiple-connections-throttled.html [ Slow ] -crbug.com/459377 virtual/sharedarraybuffer/http/tests/websocket/multiple-connections-throttled.html [ Slow ] # These tests are slow to measure bounding box of every single Unicode character. #crbug.com/492664 external/csswg-test/css-writing-modes-3/text-orientation-script-001a.html [ Slow ] @@ -258,7 +250,6 @@ crbug.com/336481 inspector/jump-to-previous-editing-location.html [ Slow ] crbug.com/346259 http/tests/websocket/no-crash-on-cookie-flood.html [ Slow ] crbug.com/346259 virtual/mojo-loading/http/tests/websocket/no-crash-on-cookie-flood.html [ Slow ] -crbug.com/346259 virtual/sharedarraybuffer/http/tests/websocket/no-crash-on-cookie-flood.html [ Slow ] crbug.com/522646 http/tests/media/encrypted-media/encrypted-media-encrypted-event-different-origin.html [ Slow ] crbug.com/522646 virtual/mojo-loading/http/tests/media/encrypted-media/encrypted-media-encrypted-event-different-origin.html [ Slow ] @@ -286,7 +277,6 @@ crbug.com/548765 virtual/mojo-loading/http/tests/inspector/console-fetch-logging.html [ Slow ] crbug.com/419993 [ Debug ] fast/css/giant-stylesheet-crash.html [ Slow ] -crbug.com/419993 [ Debug ] virtual/sharedarraybuffer/fast/css/giant-stylesheet-crash.html [ Slow ] crbug.com/331186 [ Debug ] css3/flexbox/position-absolute-child.html [ Slow ] crbug.com/362509 [ Debug ] fast/parser/xml-error-adopted.xml [ Slow ] @@ -295,7 +285,6 @@ crbug.com/364225 virtual/gpu/fast/canvas/canvas-composite-text-alpha.html [ Slow ] crbug.com/372424 fast/dom/DOMImplementation/createDocument-with-used-doctype.html [ Slow ] -crbug.com/372424 virtual/sharedarraybuffer/fast/dom/DOMImplementation/createDocument-with-used-doctype.html [ Slow ] crbug.com/372424 http/tests/serviceworker/chromium/registration-stress.html [ Slow ] crbug.com/372424 virtual/mojo-loading/http/tests/serviceworker/chromium/registration-stress.html [ Slow ] @@ -306,7 +295,6 @@ # Most crypto/subtle tests are slow some or most of the time. crbug.com/459009 crypto/subtle/ [ Slow ] -crbug.com/459009 virtual/sharedarraybuffer/crypto/subtle/ [ Slow ] crbug.com/24182 [ Debug ] animations/interpolation/transform-interpolation.html [ Slow ] crbug.com/24182 [ Debug ] animations/interpolation/webkit-transform-interpolation.html [ Slow ] @@ -324,7 +312,6 @@ crbug.com/658211 [ Win7 Debug ] fast/text/line-break-ascii.html [ Slow ] crbug.com/445194 fast/dom/shadow/focus-controller-recursion-crash.html [ Slow ] -crbug.com/445194 virtual/sharedarraybuffer/fast/dom/shadow/focus-controller-recursion-crash.html [ Slow ] crbug.com/697735 external/wpt/editing/run/backcolor.html [ Slow ] crbug.com/697735 external/wpt/editing/run/bold.html [ Slow ] crbug.com/697735 external/wpt/editing/run/createlink.html [ Slow ] @@ -372,7 +359,6 @@ crbug.com/623798 virtual/disable-spinvalidation/paint/images/animated-gif-last-frame-crash.html [ Slow ] crbug.com/606649 fast/dom/gc-dom-tree-lifetime.html [ Slow ] -crbug.com/606649 virtual/sharedarraybuffer/fast/dom/gc-dom-tree-lifetime.html [ Slow ] # Slow on Win Debug in part due to incremental linking. crbug.com/647192 [ Win Debug ] fast/css3-text/css3-word-break/word-break-all-ascii.html [ Slow ]
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations index ce387ee..2227562 100644 --- a/third_party/WebKit/LayoutTests/TestExpectations +++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -734,11 +734,9 @@ crbug.com/280342 [ Linux Win ] http/tests/media/progress-events-generated-correctly.html [ Failure Pass ] crbug.com/280342 [ Linux Win ] virtual/mojo-loading/http/tests/media/progress-events-generated-correctly.html [ Failure Pass ] -crbug.com/705953 [ Linux ] virtual/mojo-loading/http/tests/origin_trials/sample-api-workers.html [ Failure Pass ] crbug.com/520739 [ Mac ] http/tests/websocket/close-code-and-reason.html [ Failure Pass Timeout ] crbug.com/520739 [ Mac ] virtual/mojo-loading/http/tests/websocket/close-code-and-reason.html [ Failure Pass Timeout ] -crbug.com/520739 [ Mac ] virtual/sharedarraybuffer/http/tests/websocket/close-code-and-reason.html [ Failure Pass Timeout ] #crbug.com/520737 [ Mac ] external/wpt/css/css-writing-modes-3/writing-mode-vertical-rl-001.xht [ Failure Pass Timeout ] crbug.com/520736 [ Win7 ] media/W3C/video/networkState/networkState_during_progress.html [ Failure Pass ] @@ -814,12 +812,10 @@ crbug.com/389648 crbug.com/517123 crbug.com/410145 fast/text-autosizing/table-inflation-crash.html [ Pass Crash Timeout ] crbug.com/636207 [ Win Debug ] fast/dom/HTMLImageElement/image-srcset-w-onerror.html [ Failure Pass ] -crbug.com/636207 [ Win Debug ] virtual/sharedarraybuffer/fast/dom/HTMLImageElement/image-srcset-w-onerror.html [ Failure Pass ] crbug.com/569139 fast/js/string-replace-2.html [ Failure ] crbug.com/569139 fast/js/regexp-caching.html [ Failure ] crbug.com/597221 fast/dom/Window/window-postmessage-clone-deep-array.html [ Failure ] -crbug.com/597221 virtual/sharedarraybuffer/fast/dom/Window/window-postmessage-clone-deep-array.html [ Failure ] crbug.com/498539 [ Win ] inspector/tracing/decode-resize.html [ Failure Timeout ] crbug.com/498539 inspector/tracing/timeline-misc/timeline-bound-function.html [ Pass Failure ] crbug.com/498539 virtual/threaded/inspector/tracing/timeline-misc/timeline-bound-function.html [ Pass Failure ] @@ -874,7 +870,6 @@ crbug.com/688613 external/wpt/mediacapture-streams/MediaStreamTrack-MediaElement-disabled-audio-is-silence.https.html [ Skip ] crbug.com/542660 fast/css/absolute-inline-alignment-2.html [ Failure ] -crbug.com/542660 virtual/sharedarraybuffer/fast/css/absolute-inline-alignment-2.html [ Failure ] # Ref tests that needs investigation. crbug.com/404597 [ Mac ] fast/css3-text/css3-text-justify/text-justify-crash.html [ Failure ] @@ -1092,7 +1087,6 @@ #crbug.com/571531 external/wpt/css/css-flexbox-1/css-flexbox-height-animation-stretch.html [ Pass Failure ] crbug.com/637055 fast/css/outline-offset-large.html [ Skip ] -crbug.com/637055 virtual/sharedarraybuffer/fast/css/outline-offset-large.html [ Skip ] # Either "combo" or split should run: http://testthewebforward.org/docs/css-naming.html #crbug.com/410320 external/wpt/css/css-writing-modes-3/orthogonal-parent-shrink-to-fit-001.html [ Skip ] @@ -1180,7 +1174,6 @@ crbug.com/381684 [ Mac Win ] fonts/family-fallback-gardiner.html [ Skip ] crbug.com/467635 fast/dom/HTMLImageElement/image-sizes-meta-viewport.html [ Skip ] -crbug.com/467635 virtual/sharedarraybuffer/fast/dom/HTMLImageElement/image-sizes-meta-viewport.html [ Skip ] crbug.com/636239 [ Win7 ] media/video-zoom-controls.html [ Failure ] @@ -1224,14 +1217,12 @@ crbug.com/524160 [ Debug ] http/tests/media/media-source/stream_memory_tests/mediasource-appendbuffer-quota-exceeded-default-buffers.html [ Timeout ] crbug.com/524160 [ Debug ] virtual/mojo-loading/http/tests/media/media-source/stream_memory_tests/mediasource-appendbuffer-quota-exceeded-default-buffers.html [ Timeout ] -crbug.com/524160 [ Debug ] virtual/sharedarraybuffer/http/tests/media/media-source/stream_memory_tests/mediasource-appendbuffer-quota-exceeded-default-buffers.html [ Timeout ] # Run the tests with the default MSE buffer sizes in the main test suite and the tests for 1MB buffers set via command line in a virtual test suite # with the --mse-audio-buffer-size-limit=1048576 and --mse-video-buffer-size-limit=1048576 command-line parameters. crbug.com/630342 virtual/mse-1mb-buffers/http/tests/media/media-source/stream_memory_tests/mediasource-appendbuffer-quota-exceeded-default-buffers.html [ Skip ] crbug.com/630342 http/tests/media/media-source/stream_memory_tests/mediasource-appendbuffer-quota-exceeded-1mb-buffers.html [ Skip ] crbug.com/630342 virtual/mojo-loading/http/tests/media/media-source/stream_memory_tests/mediasource-appendbuffer-quota-exceeded-1mb-buffers.html [ Skip ] -crbug.com/630342 virtual/sharedarraybuffer/http/tests/media/media-source/stream_memory_tests/mediasource-appendbuffer-quota-exceeded-1mb-buffers.html [ Skip ] # On these platforms (all but Android) media tests don't currently use gpu-accelerated (proprietary) codecs, so no # benefit to running them again with gpu acceleration enabled. @@ -1495,7 +1486,6 @@ # These need a rebaseline due crbug.com/504745 on Windows when they are activated again. crbug.com/521124 crbug.com/410145 [ Win7 ] fast/css/font-weight-1.html [ Pass Failure ] -crbug.com/521124 crbug.com/410145 [ Win7 ] virtual/sharedarraybuffer/fast/css/font-weight-1.html [ Pass Failure ] # Temporary, until we stop use_system_harfbuzz on Linux including non-official builds crbug.com/462689 [ Linux ] fast/text/unicode-variation-selector.html [ Failure ] @@ -1524,7 +1514,6 @@ # Ref tests that fail due to differences in inline box structure, even though they contain the same text. # This happens because inline box layout uses fixed-point measurements, which can cause rounding differences. crbug.com/321237 [ Mac ] fast/dom/shadow/shadow-insertion-point-rendering-multiple-shadow-roots.html [ Failure ] -crbug.com/321237 [ Mac ] virtual/sharedarraybuffer/fast/dom/shadow/shadow-insertion-point-rendering-multiple-shadow-roots.html [ Failure ] crbug.com/321237 [ Mac ] fast/selectors/007a.html [ Failure ] crbug.com/321237 [ Mac Win ] fast/text-autosizing/inherited-multiplier.html [ Failure ] crbug.com/321237 [ Mac ] virtual/stable/fast/css3-text/css3-text-decoration/stable/first-letter-text-decoration.html [ Failure ] @@ -1536,7 +1525,6 @@ crbug.com/501659 http/tests/security/xss-DENIED-xml-external-entity.xhtml [ Failure ] crbug.com/501659 virtual/mojo-loading/http/tests/security/xss-DENIED-xml-external-entity.xhtml [ Failure ] crbug.com/501659 fast/css/stylesheet-candidate-nodes-crash.xhtml [ Failure ] -crbug.com/501659 virtual/sharedarraybuffer/fast/css/stylesheet-candidate-nodes-crash.xhtml [ Failure ] crbug.com/686470 http/tests/security/xss-DENIED-window-name-navigator.html [ Pass Failure ] crbug.com/686470 virtual/mojo-loading/http/tests/security/xss-DENIED-window-name-navigator.html [ Pass Failure ] @@ -1546,7 +1534,6 @@ # If you see wider INPUT elements or narrower TEXTAREA elements, you may do just # rebaseline. See crbug.com/508768#c6 crbug.com/509025 [ Mac10.10 ] fast/css/css2-system-fonts.html [ Failure ] -crbug.com/509025 [ Mac10.10 ] virtual/sharedarraybuffer/fast/css/css2-system-fonts.html [ Failure ] crbug.com/509025 [ Mac10.10 ] fast/forms/select/hidden-listbox.html [ Failure ] crbug.com/509025 [ Mac10.10 ] fast/forms/textarea/textarea-newline.html [ Failure ] @@ -1618,7 +1605,6 @@ crbug.com/459056 [ Win7 ] fast/text/font-fallback-win.html [ Failure ] crbug.com/525296 fast/css/font-load-while-styleresolver-missing.html [ Crash Failure Pass ] -crbug.com/525296 virtual/sharedarraybuffer/fast/css/font-load-while-styleresolver-missing.html [ Crash Failure Pass ] crbug.com/240576 external/wpt/fullscreen/api/element-ready-check-containing-iframe-manual.html [ Timeout Failure Pass ] @@ -1632,12 +1618,10 @@ crbug.com/457273 [ Mac ] http/tests/websocket/close.html [ Pass Timeout ] crbug.com/457273 [ Mac ] virtual/mojo-loading/http/tests/websocket/close.html [ Pass Timeout ] -crbug.com/457273 [ Mac ] virtual/sharedarraybuffer/http/tests/websocket/close.html [ Pass Timeout ] crbug.com/596752 virtual/threaded/inspector/tracing/decode-resize.html [ Pass Failure ] crbug.com/524646 [ Mac10.10 ] fast/dom/shadow/shadowdom-for-button.html [ Failure ] -crbug.com/524646 [ Mac10.10 ] virtual/sharedarraybuffer/fast/dom/shadow/shadowdom-for-button.html [ Failure ] crbug.com/538717 [ Win Mac Linux ] http/tests/permissions/chromium/test-request-multiple-window.html [ Failure Pass Timeout ] crbug.com/538717 [ Win Mac Linux ] http/tests/permissions/chromium/test-request-multiple-worker.html [ Failure Pass Timeout ] @@ -1748,7 +1732,6 @@ # Note: this test was previously marked as slow on Debug builds. Skipping until crash is fixed crbug.com/619978 fast/css/giant-stylesheet-crash.html [ Skip ] -crbug.com/619978 virtual/sharedarraybuffer/fast/css/giant-stylesheet-crash.html [ Skip ] crbug.com/624430 [ Win10 ] fast/text/font-features/caps-casemapping.html [ Failure ] @@ -2552,7 +2535,6 @@ crbug.com/642376 virtual/gpu/fast/canvas/canvas-incremental-repaint.html [ NeedsManualRebaseline ] crbug.com/706375 virtual/gpu/fast/canvas/canvas-lost-gpu-context.html [ Failure ] crbug.com/706375 virtual/display_list_2d_canvas/fast/canvas/canvas-lost-gpu-context.html [ Failure ] -crbug.com/706375 virtual/sharedarraybuffer/fast/canvas/canvas-lost-gpu-context.html [ Failure ] # Added 2016-12-12 crbug.com/610835 http/tests/security/XFrameOptions/x-frame-options-deny-multiple-clients.html [ Failure Pass ] @@ -2566,7 +2548,6 @@ # Added 2016-12-22 crbug.com/676537 fast/css/imageTileOpacity.html [ Pass Failure ] -crbug.com/676537 virtual/sharedarraybuffer/fast/css/imageTileOpacity.html [ Pass Failure ] # ====== Random order flaky tests from here ====== # These tests are flaky when run in random order, which is the default on Linux & Mac since since 2016-12-16. @@ -2633,7 +2614,6 @@ crbug.com/676229 [ Linux ] plugins/mouse-click-plugin-clears-selection.html [ Failure Pass ] crbug.com/678346 [ Win7 Debug ] fast/dom/shadow/selections-in-shadow.html [ Pass Timeout ] -crbug.com/678346 [ Win7 Debug ] virtual/sharedarraybuffer/fast/dom/shadow/selections-in-shadow.html [ Pass Timeout ] crbug.com/678346 [ Win7 Debug ] storage/indexeddb/index-cursor.html [ Pass Timeout ] crbug.com/678346 [ Win7 Debug ] storage/indexeddb/mozilla/test_objectStore_openKeyCursor.html [ Pass Timeout ] crbug.com/678346 [ Win7 Debug ] storage/indexeddb/structured-clone.html [ Pass Timeout ] @@ -2652,7 +2632,6 @@ crbug.com/689781 http/tests/media/media-source/mediasource-duration.html [ Failure Pass ] crbug.com/689781 virtual/mojo-loading/http/tests/media/media-source/mediasource-duration.html [ Failure Pass ] -crbug.com/689781 virtual/sharedarraybuffer/http/tests/media/media-source/mediasource-duration.html [ Failure Pass ] crbug.com/701445 external/wpt/dom/events/EventListener-invoke-legacy.html [ Timeout Pass ] @@ -2702,7 +2681,6 @@ crbug.com/697342 http/tests/push_messaging/permission-state-granted-in-document.html [ Pass Failure ] crbug.com/697342 virtual/mojo-loading/http/tests/push_messaging/permission-state-granted-in-document.html [ Pass Failure ] -crbug.com/697342 virtual/sharedarraybuffer/http/tests/push_messaging/permission-state-granted-in-document.html [ Pass Failure ] crbug.com/698520 external/wpt/preload/fetch-destination.https.html [ Failure Pass ]
diff --git a/third_party/WebKit/LayoutTests/VirtualTestSuites b/third_party/WebKit/LayoutTests/VirtualTestSuites index c6c6d22..c782e8c 100644 --- a/third_party/WebKit/LayoutTests/VirtualTestSuites +++ b/third_party/WebKit/LayoutTests/VirtualTestSuites
@@ -216,101 +216,11 @@ }, { "prefix": "sharedarraybuffer", - "base": "fast/beacon", - "args": ["--js-flags=--harmony-sharedarraybuffer", - "--enable-blink-features=SharedArrayBuffer"] - }, - { - "prefix": "sharedarraybuffer", - "base": "fast/canvas", - "args": ["--js-flags=--harmony-sharedarraybuffer", - "--enable-blink-features=SharedArrayBuffer"] - }, - { - "prefix": "sharedarraybuffer", - "base": "fast/css", - "args": ["--js-flags=--harmony-sharedarraybuffer", - "--enable-blink-features=SharedArrayBuffer"] - }, - { - "prefix": "sharedarraybuffer", - "base": "fast/dom", - "args": ["--js-flags=--harmony-sharedarraybuffer", - "--enable-blink-features=SharedArrayBuffer"] - }, - { - "prefix": "sharedarraybuffer", - "base": "fast/encoding/api", - "args": ["--js-flags=--harmony-sharedarraybuffer", - "--enable-blink-features=SharedArrayBuffer"] - }, - { - "prefix": "sharedarraybuffer", - "base": "fast/events/constructors", - "args": ["--js-flags=--harmony-sharedarraybuffer", - "--enable-blink-features=SharedArrayBuffer"] - }, - { - "prefix": "sharedarraybuffer", - "base": "fast/files", - "args": ["--js-flags=--harmony-sharedarraybuffer", - "--enable-blink-features=SharedArrayBuffer"] - }, - { - "prefix": "sharedarraybuffer", - "base": "fast/peerconnection", - "args": ["--js-flags=--harmony-sharedarraybuffer", - "--enable-blink-features=SharedArrayBuffer"] - }, - { - "prefix": "sharedarraybuffer", "base": "fast/workers", "args": ["--js-flags=--harmony-sharedarraybuffer", "--enable-blink-features=SharedArrayBuffer"] }, { - "prefix": "sharedarraybuffer", - "base": "crypto", - "args": ["--js-flags=--harmony-sharedarraybuffer", - "--enable-blink-features=SharedArrayBuffer"] - }, - { - "prefix": "sharedarraybuffer", - "base": "http/tests/media/media-source", - "args": ["--js-flags=--harmony-sharedarraybuffer", - "--enable-blink-features=SharedArrayBuffer"] - }, - { - "prefix": "sharedarraybuffer", - "base": "http/tests/push_messaging", - "args": ["--js-flags=--harmony-sharedarraybuffer", - "--enable-blink-features=SharedArrayBuffer"] - }, - { - "prefix": "sharedarraybuffer", - "base": "http/tests/websocket", - "args": ["--js-flags=--harmony-sharedarraybuffer", - "--enable-blink-features=SharedArrayBuffer"] - }, - { - "prefix": "sharedarraybuffer", - "base": "sensor", - "args": ["--js-flags=--harmony-sharedarraybuffer", - "--enable-blink-features=SharedArrayBuffer"] - }, - { - "prefix": "sharedarraybuffer", - "base": "webaudio", - "args": ["--js-flags=--harmony-sharedarraybuffer", - "--enable-blink-features=SharedArrayBuffer"] - }, - { - "prefix": "sharedarraybuffer", - "base": "webmidi", - "args": ["--js-flags=--harmony-sharedarraybuffer", - "--enable-blink-features=SharedArrayBuffer"] - }, - { "prefix": "threaded", "base": "fast/idle-callback", "args": ["--enable-threaded-compositing"]
diff --git a/third_party/WebKit/LayoutTests/crypto/random-values.js b/third_party/WebKit/LayoutTests/crypto/random-values.js index f87e1ca..0fb26bd 100644 --- a/third_party/WebKit/LayoutTests/crypto/random-values.js +++ b/third_party/WebKit/LayoutTests/crypto/random-values.js
@@ -37,8 +37,4 @@ debug(ex); } -if (self.SharedArrayBuffer) { - shouldThrow("crypto.getRandomValues(new Uint8Array(new SharedArrayBuffer(100)))"); -} - finishJSTest();
diff --git a/third_party/WebKit/LayoutTests/crypto/subtle/importKey-badParameters-expected.txt b/third_party/WebKit/LayoutTests/crypto/subtle/importKey-badParameters-expected.txt index 73949bf..de9526d 100644 --- a/third_party/WebKit/LayoutTests/crypto/subtle/importKey-badParameters-expected.txt +++ b/third_party/WebKit/LayoutTests/crypto/subtle/importKey-badParameters-expected.txt
@@ -11,7 +11,6 @@ error is: TypeError: Invalid keyFormat argument error is: TypeError: HmacImportParams: hash: Missing or not an AlgorithmIdentifier error is: NotSupportedError: SHA-1: Unsupported operation: importKey -error is: SharedArrayBuffers not enabled. PASS successfullyParsed is true TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/crypto/subtle/importKey-badParameters.html b/third_party/WebKit/LayoutTests/crypto/subtle/importKey-badParameters.html index 303f4e2..9052c10 100644 --- a/third_party/WebKit/LayoutTests/crypto/subtle/importKey-badParameters.html +++ b/third_party/WebKit/LayoutTests/crypto/subtle/importKey-badParameters.html
@@ -62,16 +62,6 @@ return crypto.subtle.importKey('raw', new Uint8Array(20), {name: 'sha-1'}, extractable, ['sign']); }).then(failAndFinishJSTest, function(result) { logError(result); - - // SharedArrayBuffer-backed view is not allowed. - if (window.SharedArrayBuffer) { - var bytes = new Uint8Array(new SharedArrayBuffer(16)); - return crypto.subtle.importKey('raw', bytes, aesCbc, extractable, ['encrypt']); - } else { - return Promise.reject('SharedArrayBuffers not enabled.'); - } -}).then(failAndFinishJSTest, function(result) { - logError(result); }).then(finishJSTest, failAndFinishJSTest); </script>
diff --git a/third_party/WebKit/LayoutTests/editing/inserting/insert-paragraph-after-tab-span-and-text-expected.txt b/third_party/WebKit/LayoutTests/editing/inserting/insert-paragraph-after-tab-span-and-text-expected.txt deleted file mode 100644 index c8c813c4..0000000 --- a/third_party/WebKit/LayoutTests/editing/inserting/insert-paragraph-after-tab-span-and-text-expected.txt +++ /dev/null
@@ -1,19 +0,0 @@ -This test ensures WebKit inserts a paragraph separator properly at the end of a tab span. -| " -" -| <span> -| class="Apple-tab-span" -| style="white-space:pre" -| " hello" -| <div> -| <#selection-caret> -| <br> -| " -" -| <span> -| class="Apple-style-span" -| <span> -| class="Apple-tab-span" -| style="white-space: pre; " -| " " -| "world"
diff --git a/third_party/WebKit/LayoutTests/editing/pasteboard/5245519-expected.txt b/third_party/WebKit/LayoutTests/editing/pasteboard/5245519-expected.txt deleted file mode 100644 index 762b18d..0000000 --- a/third_party/WebKit/LayoutTests/editing/pasteboard/5245519-expected.txt +++ /dev/null
@@ -1,2 +0,0 @@ -This tests for a crash when pasting content that contains Apple-style-spans that don't have renderers.' You should see 'Hello World!' -Hello World!
diff --git a/third_party/WebKit/LayoutTests/editing/style/remove-styled-element-with-style-span-expected.txt b/third_party/WebKit/LayoutTests/editing/style/remove-styled-element-with-style-span-expected.txt deleted file mode 100644 index ab0f85f..0000000 --- a/third_party/WebKit/LayoutTests/editing/style/remove-styled-element-with-style-span-expected.txt +++ /dev/null
@@ -1,5 +0,0 @@ -This test ensures WebKit removes implicitly styled elements even if they had class="Apple-style-span". There should be no span below. -| <i> -| "<#selection-anchor>hello " -| "world" -| " WebKit<#selection-focus>"
diff --git a/third_party/WebKit/LayoutTests/fast/beacon/beacon-basic.html b/third_party/WebKit/LayoutTests/fast/beacon/beacon-basic.html index faa5fa2..6450c6ef 100644 --- a/third_party/WebKit/LayoutTests/fast/beacon/beacon-basic.html +++ b/third_party/WebKit/LayoutTests/fast/beacon/beacon-basic.html
@@ -8,9 +8,4 @@ shouldThrow("navigator.sendBeacon()"); shouldThrow("navigator.sendBeacon('http:')"); shouldThrow("navigator.sendBeacon('javascript:alert(1);')"); - -if (window.SharedArrayBuffer) { - shouldThrow("navigator.sendBeacon('https:', new Uint8Array(new SharedArrayBuffer(10)))"); -} - </script>
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-ImageData-constructor.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-ImageData-constructor.html index c5b0e58..16c788d6 100644 --- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-ImageData-constructor.html +++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-ImageData-constructor.html
@@ -74,10 +74,6 @@ assert_array_equals(getRGBA(imageDataFromData.data, 2), getRGBA(data, 2)); setRGBA(imageDataFromData.data, 2, testColor); assert_array_equals(getRGBA(imageDataFromData.data, 2), getRGBA(data, 2)); - - if (window.SharedArrayBuffer) { - assert_throws(null, function() {new ImageData(new Uint16Array(new SharedArrayBuffer(32)), 4, 2)}); - } }, 'Test ImageData constructor'); </script>
diff --git a/third_party/WebKit/LayoutTests/fast/css/fontface-arraybuffer.html b/third_party/WebKit/LayoutTests/fast/css/fontface-arraybuffer.html index 31457b6..1bbcd1ca 100644 --- a/third_party/WebKit/LayoutTests/fast/css/fontface-arraybuffer.html +++ b/third_party/WebKit/LayoutTests/fast/css/fontface-arraybuffer.html
@@ -23,16 +23,6 @@ shouldBeEqualToString('face2.status', 'loaded'); document.fonts.add(face2); -if (window.SharedArrayBuffer) { - try { - new FontFace('FontFromSharedArrayBufferView', - new Uint8Array(new SharedArrayBuffer(4))); - } catch (e) { - rejectionValue = e; - shouldBeEqualToString('rejectionValue.name', 'TypeError'); - } -} - var face3 = new FontFace('FontFromEmptyArrayBuffer', new ArrayBuffer(0)); shouldBeEqualToString('face3.status', 'error'); face3.load().catch(function(v) {
diff --git a/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-readonly.html b/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-readonly.html index 3aa6eb3..72c1c8fb 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-readonly.html +++ b/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-readonly.html
@@ -177,15 +177,6 @@ "fromFloat64Array function only accepts 1 Float64Array with 6 or 16 elements"); }, "DOMMatrixReadOnly fromFloat*Array - invalid array size"); -if (window.SharedArrayBuffer) { - test(() => { - assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat32Array(new Float32Array(new SharedArrayBuffer(24))); }, - ""); - assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat64Array(new Float64Array(new SharedArrayBuffer(32))); }, - ""); - }, "DOMMatrixReadOnly fromFloat*Array - can't use SharedArrayBuffer view"); -} - test(() => { var matrix = DOMMatrixReadOnly.fromMatrix(); assert_identity_2d_matrix(matrix);
diff --git a/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix.html b/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix.html index 525425f..998c3da 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix.html +++ b/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix.html
@@ -120,15 +120,6 @@ "fromFloat64Array function only accepts 1 Float64Array with 6 or 16 elements"); }, "DOMMatrix fromFloat*Array - invalid array size"); -if (window.SharedArrayBuffer) { - test(() => { - assert_throws(new TypeError(), () => { DOMMatrix.fromFloat32Array(new Float32Array(new SharedArrayBuffer(24))); }, - ""); - assert_throws(new TypeError(), () => { DOMMatrix.fromFloat64Array(new Float64Array(new SharedArrayBuffer(32))); }, - ""); - }, "DOMMatrix fromFloat*Array - can't use SharedArrayBuffer view"); -} - test(() => { assert_identity_2d_matrix(DOMMatrix.fromMatrix()); }, "DOMMatrix.fromMatrix() with no parameter");
diff --git a/third_party/WebKit/LayoutTests/fast/encoding/api/sharedarraybuffer.html b/third_party/WebKit/LayoutTests/fast/encoding/api/sharedarraybuffer.html deleted file mode 100644 index 161b546..0000000 --- a/third_party/WebKit/LayoutTests/fast/encoding/api/sharedarraybuffer.html +++ /dev/null
@@ -1,16 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script> - -if (window.SharedArrayBuffer) { - test(() => { - const decoder = new TextDecoder('utf-8'); - assert_throws(null, () => { - decoder.decode(new Uint8Array(new SharedArrayBuffer(4))); - }, 'constructing TextDecoder with SharedArrayBuffer view should throw'); - }, 'decoding SharedArrayBuffer'); -} -done(); - -</script>
diff --git a/third_party/WebKit/LayoutTests/fast/events/constructors/midi-message-event-constructor.html b/third_party/WebKit/LayoutTests/fast/events/constructors/midi-message-event-constructor.html index 46e2da7..0631a39 100644 --- a/third_party/WebKit/LayoutTests/fast/events/constructors/midi-message-event-constructor.html +++ b/third_party/WebKit/LayoutTests/fast/events/constructors/midi-message-event-constructor.html
@@ -31,11 +31,6 @@ shouldBe("new MIDIMessageEvent('eventType', { bubbles: true, cancelable: true, data: data }).cancelable", "true"); shouldEvaluateTo("new MIDIMessageEvent('eventType', { bubbles: true, cancelable: true, data: data }).data", data); -if (window.SharedArrayBuffer) { - data = new Uint8Array(new SharedArrayBuffer(3)); - shouldThrow("new MIDIMessageEvent('eventType', { data: data })"); -} - </script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/files/blob-constructor.html b/third_party/WebKit/LayoutTests/fast/files/blob-constructor.html index df34b9c..5261d19 100644 --- a/third_party/WebKit/LayoutTests/fast/files/blob-constructor.html +++ b/third_party/WebKit/LayoutTests/fast/files/blob-constructor.html
@@ -123,11 +123,6 @@ shouldBe("new Blob([(new Float64Array(100)).buffer, (new Int32Array(100)).buffer, (new Uint8Array(100)).buffer, (new DataView(new ArrayBuffer(100))).buffer]).size", "1400"); shouldBe("new Blob([new Blob([(new Int32Array(100)).buffer]), (new Uint8Array(100)).buffer, (new Float32Array(100)).buffer, (new DataView(new ArrayBuffer(100))).buffer]).size", "1000"); -if (window.SharedArrayBuffer) { - // Test SharedArrayBuffer parameters. - shouldThrow("new Blob([new Uint8Array(new SharedArrayBuffer(4))])", '"TypeError: Failed to construct \'Blob\': The provided ArrayBufferView value must not be shared."'); -} - // Test passing blob parts in objects with indexed properties. // (This depends on the bindings code handling of sequence<T>) shouldBe("new Blob({length: 0}).size", "0");
diff --git a/third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnection-datachannel.html b/third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnection-datachannel.html index 260f377..21e7dc6 100644 --- a/third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnection-datachannel.html +++ b/third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnection-datachannel.html
@@ -19,15 +19,6 @@ finishJSTest(); } -function dc_onmessage_sharedarraybuffer_view() { - if (window.SharedArrayBuffer) { - shouldThrow("dc.send(new Uint8Array(new SharedArrayBuffer(16)));"); - } - - dc.onclose = dc_onclose; - dc.close(); -} - function dc_onmessage_dataview(e) { testPassed("dc_onmessage_dataview was called"); data = e.data; @@ -36,7 +27,8 @@ shouldBe("array[0]", "1"); shouldBe("array[9]", "10"); - dc_onmessage_sharedarraybuffer_view(); + dc.onclose = dc_onclose; + dc.close(); } function dc_onmessage_arraybuffer(e) {
diff --git a/third_party/WebKit/LayoutTests/fast/xmlhttprequest/xmlhttprequest-send-sharedarraybuffer.html b/third_party/WebKit/LayoutTests/fast/xmlhttprequest/xmlhttprequest-send-sharedarraybuffer.html deleted file mode 100644 index 9f02118..0000000 --- a/third_party/WebKit/LayoutTests/fast/xmlhttprequest/xmlhttprequest-send-sharedarraybuffer.html +++ /dev/null
@@ -1,18 +0,0 @@ -<!DOCTYPE html> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> -<script> - -if (window.SharedArrayBuffer) { - test(() => { - const xhr = new XMLHttpRequest(); - xhr.open('POST', '/foo.html'); - - assert_throws(null, () => { - xhr.send(new Uint8Array(new SharedArrayBuffer(32))); - }, 'send() of SharedArrayBuffer view should throw'); - }, 'sending SharedArrayBuffer'); -} -done(); - -</script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-append-buffer.html b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-append-buffer.html index 1d25402..ce60447 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-append-buffer.html +++ b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-append-buffer.html
@@ -550,22 +550,6 @@ test.done(); }, 'Test appending null.'); - if (window.SharedArrayBuffer) { - mediasource_test(function(test, mediaElement, mediaSource) - { - var sourceBuffer = mediaSource.addSourceBuffer(MediaSourceUtil.VIDEO_ONLY_TYPE); - - test.expectEvent(sourceBuffer, 'updatestart', 'Append started.'); - test.expectEvent(sourceBuffer, 'update', 'Append success.'); - test.expectEvent(sourceBuffer, 'updateend', 'Append ended.'); - - assert_throws( { name: 'TypeError'} , - function() { sourceBuffer.appendBuffer(new Uint8Array(new SharedArrayBuffer(16))); }, - 'appendBuffer() of SharedArrayBuffer view throws an exception.'); - test.done(); - }, 'Test appending SharedArrayBuffer view.'); - } - mediasource_testafterdataloaded(function(test, mediaElement, mediaSource, segmentInfo, sourceBuffer, mediaData) { mediaSource.removeSourceBuffer(sourceBuffer);
diff --git a/third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/disabled-worker.js b/third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/disabled-worker.js index ccf8218..5c10f56 100644 --- a/third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/disabled-worker.js +++ b/third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/disabled-worker.js
@@ -1,24 +1,2 @@ -importScripts('/resources/testharness.js'); - -// Test whether the origin-trial-enabled attributes are *NOT* attached in a -// worker where the trial is not enabled. -// This is deliberately just a minimal set of tests to ensure that trials are -// available in a worker. The full suite of tests are in origin_trials.js. -test(() => { - var testObject = self.internals.originTrialsTest(); - assert_idl_attribute(testObject, 'throwingAttribute'); - assert_throws('NotSupportedError', () => { - testObject.throwingAttribute; - }, 'Accessing attribute should throw error'); -}, 'Accessing attribute should throw error in worker'); -test(() => { - var testObject = self.internals.originTrialsTest(); - assert_not_exists(testObject, 'normalAttribute'); - assert_equals(testObject.normalAttribute, undefined); -}, 'Attribute should not exist in worker'); -test(() => { - var testObject = self.internals.originTrialsTest(); - assert_not_exists(testObject, 'CONSTANT'); - assert_equals(testObject.CONSTANT, undefined); -}, 'Constant should not exist in worker'); -done(); +importScripts('origintrials-worker.js'); +expect_failure_worker();
diff --git a/third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/enabled-worker.js b/third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/enabled-worker.js index b3721694..08e5b50 100644 --- a/third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/enabled-worker.js +++ b/third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/enabled-worker.js
@@ -1,28 +1,2 @@ -importScripts('/resources/testharness.js'); - -// Test whether the origin-trial-enabled attributes are attached in a worker -// where the trial is enabled. -// This is deliberately just a minimal set of tests to ensure that trials are -// available in a worker. The full suite of tests are in origin_trials.js. -test(() => { - var testObject = self.internals.originTrialsTest(); - assert_idl_attribute(testObject, 'throwingAttribute'); - assert_true(testObject.throwingAttribute, 'Attribute should return boolean value'); - }, 'Attribute should exist and not throw exception in worker'); -test(() => { - var testObject = self.internals.originTrialsTest(); - assert_idl_attribute(testObject, 'normalAttribute'); - assert_true(testObject.normalAttribute, 'Attribute should return boolean value'); - }, 'Attribute should exist and return value in worker'); -test(() => { - var testObject = self.internals.originTrialsTest(); - assert_idl_attribute(testObject, 'CONSTANT'); - assert_equals(testObject.CONSTANT, 1, 'Constant should return integer value'); - }, 'Constant should exist and return value in worker'); -test(() => { - var testObject = self.internals.originTrialsTest(); - assert_idl_attribute(testObject, 'CONSTANT'); - testObject.CONSTANT = 10; - assert_equals(testObject.CONSTANT, 1, 'Constant should not be modifiable'); - }, 'Constant should exist and not be modifiable in worker'); -done(); +importScripts('origintrials-worker.js'); +expect_success_worker();
diff --git a/third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/origintrials-worker.js b/third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/origintrials-worker.js new file mode 100644 index 0000000..ec01b93 --- /dev/null +++ b/third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/origintrials-worker.js
@@ -0,0 +1,78 @@ +importScripts('/resources/testharness.js'); + +get_worker_type = () => { + var type = Object.prototype.toString.call(self); + if (type.indexOf('ServiceWorkerGlobalScope') !== -1) { + return 'service'; + } + if (type.indexOf('SharedWorkerGlobalScope') !== -1) { + if (self.name) { + return 'shared (' + self.name + ')'; + } + return 'shared'; + } + if (type.indexOf('DedicatedWorkerGlobalScope') !== -1) { + return 'dedicated'; + } + return 'unknown'; +} + +// Test whether the origin-trial-enabled attributes are *NOT* attached in a +// worker where the trial is not enabled. +// This is deliberately just a minimal set of tests to ensure that trials are +// available in a worker. The full suite of tests are in origintrials.js. +expect_failure_worker = () => { + // Use |worker_type| to make the test descriptions unique when multiple + // workers are created in a single test file. + var worker_type = get_worker_type(); + test(() => { + var testObject = self.internals.originTrialsTest(); + assert_idl_attribute(testObject, 'throwingAttribute'); + assert_throws('NotSupportedError', () => { + testObject.throwingAttribute; + }, 'Accessing attribute should throw error'); + }, 'Accessing attribute should throw error in ' + worker_type + ' worker'); + test(() => { + var testObject = self.internals.originTrialsTest(); + assert_not_exists(testObject, 'normalAttribute'); + assert_equals(testObject.normalAttribute, undefined); + }, 'Attribute should not exist in ' + worker_type + ' worker'); + test(() => { + var testObject = self.internals.originTrialsTest(); + assert_not_exists(testObject, 'CONSTANT'); + assert_equals(testObject.CONSTANT, undefined); + }, 'Constant should not exist in ' + worker_type + ' worker'); + done(); +} + +// Test whether the origin-trial-enabled attributes are attached in a worker +// where the trial is enabled. +// This is deliberately just a minimal set of tests to ensure that trials are +// available in a worker. The full suite of tests are in origintrials.js. +expect_success_worker = () => { + // Use |worker_type| to make the test descriptions unique when multiple + // workers are created in a single test file. + var worker_type = get_worker_type(); + test(() => { + var testObject = self.internals.originTrialsTest(); + assert_idl_attribute(testObject, 'throwingAttribute'); + assert_true(testObject.throwingAttribute, 'Attribute should return boolean value'); + }, 'Accessing attribute should return value and not throw exception in ' + worker_type + ' worker'); + test(() => { + var testObject = self.internals.originTrialsTest(); + assert_idl_attribute(testObject, 'normalAttribute'); + assert_true(testObject.normalAttribute, 'Attribute should return boolean value'); + }, 'Attribute should exist and return value in ' + worker_type + ' worker'); + test(() => { + var testObject = self.internals.originTrialsTest(); + assert_idl_attribute(testObject, 'CONSTANT'); + assert_equals(testObject.CONSTANT, 1, 'Constant should return integer value'); + }, 'Constant should exist and return value in ' + worker_type + ' worker'); + test(() => { + var testObject = self.internals.originTrialsTest(); + assert_idl_attribute(testObject, 'CONSTANT'); + testObject.CONSTANT = 10; + assert_equals(testObject.CONSTANT, 1, 'Constant should not be modifiable'); + }, 'Constant should exist and not be modifiable in ' + worker_type + ' worker'); + done(); +}
diff --git a/third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/origin_trials.js b/third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/origintrials.js similarity index 98% rename from third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/origin_trials.js rename to third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/origintrials.js index f4d5906d2..1ab0c07 100644 --- a/third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/origin_trials.js +++ b/third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/origintrials.js
@@ -100,7 +100,7 @@ var testObject = window.internals.originTrialsTest(); assert_idl_attribute(testObject, 'throwingAttribute'); assert_true(testObject.throwingAttribute, 'Attribute should return boolean value'); - }, 'Attribute should exist and return value'); + }, 'Accessing attribute should return value and not throw exception'); test(() => { assert_idl_attribute(window.internals, 'originTrialsTest');
diff --git a/third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/sample-api-enabled-worker.php b/third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/sample-api-enabled-worker.php index 41d72a9..f30bec94 100644 --- a/third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/sample-api-enabled-worker.php +++ b/third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/sample-api-enabled-worker.php
@@ -11,4 +11,3 @@ header("Origin-Trial: \"AlCoOPbezqtrGMzSzbLQC4c+oPqO6yuioemcBPjgcXajF8jtmZr4B8tJRPAARPbsX6hDeVyXCKHzEJfpBXvZgQEAAABReyJvcmlnaW4iOiAiaHR0cDovLzEyNy4wLjAuMTo4MDAwIiwgImZlYXR1cmUiOiAiRnJvYnVsYXRlIiwgImV4cGlyeSI6IDIwMDAwMDAwMDB9\", Avs0tgQGv771bXLAScGOi5VpjYdIW/nbb00qk3rH8T6/+7NVTlBosCz05fCg9Yb3N3P9h2IuadgfNtPTMMpirQwAAABYeyJvcmlnaW4iOiAiaHR0cDovLzEyNy4wLjAuMTo4MDAwIiwgImZlYXR1cmUiOiAiRW5hYmxlTWFycXVlZVRhZyIsICJleHBpcnkiOiAyMDAwMDAwMDAwfQ==", false); ?> importScripts('enabled-worker.js'); -
diff --git a/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-broken.html b/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-broken.html index de8fde3..e46ae8c 100644 --- a/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-broken.html +++ b/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-broken.html
@@ -4,7 +4,7 @@ <title>Test Sample API when trial is disabled (invalid token)</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> -<script src="resources/origin_trials.js"></script> +<script src="resources/origintrials.js"></script> <script> // The experiment is not enabled, as the provided token is invalid.
diff --git a/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-disabled.html b/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-disabled.html index 2db0b175..5b74c98 100644 --- a/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-disabled.html +++ b/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-disabled.html
@@ -3,7 +3,7 @@ <title>Test Sample API when trial is disabled (no token)</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> -<script src="resources/origin_trials.js"></script> +<script src="resources/origintrials.js"></script> <script> // The trial is not enabled, as no token is provided.
diff --git a/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-enabled-expected.txt b/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-enabled-expected.txt deleted file mode 100644 index 16eb99d..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-enabled-expected.txt +++ /dev/null
@@ -1,19 +0,0 @@ -This is a testharness.js-based test. -Harness Error. harness_status.status = 1 , harness_status.message = 1 duplicate test name: "Attribute should exist and return value" -PASS Attribute should exist and return value -PASS Attribute should exist and return value -PASS Constant should exist on interface and return value -PASS Constant should exist on interface and not be modifiable -PASS Attribute should exist on partial interface and return value -PASS Static attribute should exist on partial interface and return value -PASS Constant should exist on partial interface and return value -PASS Method should exist on partial interface and return value -PASS Static method should exist on partial interface and return value -PASS Attribute should exist on interface and return value -PASS Static attribute should exist on interface and return value -PASS Attribute should exist and not throw exception in worker -PASS Attribute should exist and return value in worker -PASS Constant should exist and return value in worker -PASS Constant should exist and not be modifiable in worker -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-enabled-header-expected.txt b/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-enabled-header-expected.txt deleted file mode 100644 index 16eb99d..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-enabled-header-expected.txt +++ /dev/null
@@ -1,19 +0,0 @@ -This is a testharness.js-based test. -Harness Error. harness_status.status = 1 , harness_status.message = 1 duplicate test name: "Attribute should exist and return value" -PASS Attribute should exist and return value -PASS Attribute should exist and return value -PASS Constant should exist on interface and return value -PASS Constant should exist on interface and not be modifiable -PASS Attribute should exist on partial interface and return value -PASS Static attribute should exist on partial interface and return value -PASS Constant should exist on partial interface and return value -PASS Method should exist on partial interface and return value -PASS Static method should exist on partial interface and return value -PASS Attribute should exist on interface and return value -PASS Static attribute should exist on interface and return value -PASS Attribute should exist and not throw exception in worker -PASS Attribute should exist and return value in worker -PASS Constant should exist and return value in worker -PASS Constant should exist and not be modifiable in worker -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-enabled-header.php b/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-enabled-header.php index 115608c2..7ba1ddd 100644 --- a/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-enabled-header.php +++ b/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-enabled-header.php
@@ -11,7 +11,7 @@ <title>Test Sample API when trial is enabled</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> -<script src="resources/origin_trials.js"></script> +<script src="resources/origintrials.js"></script> <script> // The trial is enabled by the token above in header.
diff --git a/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-enabled.html b/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-enabled.html index 43e0418..6af7eef 100644 --- a/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-enabled.html +++ b/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-enabled.html
@@ -9,7 +9,7 @@ <meta http-equiv="origin-trial" content="AlCoOPbezqtrGMzSzbLQC4c+oPqO6yuioemcBPjgcXajF8jtmZr4B8tJRPAARPbsX6hDeVyXCKHzEJfpBXvZgQEAAABReyJvcmlnaW4iOiAiaHR0cDovLzEyNy4wLjAuMTo4MDAwIiwgImZlYXR1cmUiOiAiRnJvYnVsYXRlIiwgImV4cGlyeSI6IDIwMDAwMDAwMDB9" /> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> -<script src="resources/origin_trials.js"></script> +<script src="resources/origintrials.js"></script> <script> // The trial is enabled by the token above in the meta tag.
diff --git a/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-expired.html b/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-expired.html index e5f8b9f..fca1109cb 100644 --- a/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-expired.html +++ b/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-expired.html
@@ -11,7 +11,7 @@ <title>Test Sample API when trial has expired</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> -<script src="resources/origin_trials.js"></script> +<script src="resources/origintrials.js"></script> <script> // The trial is not enabled, as the provided token is expired (although it has a
diff --git a/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-multiple-tokens-expected.txt b/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-multiple-tokens-expected.txt deleted file mode 100644 index 16eb99d..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-multiple-tokens-expected.txt +++ /dev/null
@@ -1,19 +0,0 @@ -This is a testharness.js-based test. -Harness Error. harness_status.status = 1 , harness_status.message = 1 duplicate test name: "Attribute should exist and return value" -PASS Attribute should exist and return value -PASS Attribute should exist and return value -PASS Constant should exist on interface and return value -PASS Constant should exist on interface and not be modifiable -PASS Attribute should exist on partial interface and return value -PASS Static attribute should exist on partial interface and return value -PASS Constant should exist on partial interface and return value -PASS Method should exist on partial interface and return value -PASS Static method should exist on partial interface and return value -PASS Attribute should exist on interface and return value -PASS Static attribute should exist on interface and return value -PASS Attribute should exist and not throw exception in worker -PASS Attribute should exist and return value in worker -PASS Constant should exist and return value in worker -PASS Constant should exist and not be modifiable in worker -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-multiple-tokens-header-expected.txt b/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-multiple-tokens-header-expected.txt deleted file mode 100644 index 16eb99d..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-multiple-tokens-header-expected.txt +++ /dev/null
@@ -1,19 +0,0 @@ -This is a testharness.js-based test. -Harness Error. harness_status.status = 1 , harness_status.message = 1 duplicate test name: "Attribute should exist and return value" -PASS Attribute should exist and return value -PASS Attribute should exist and return value -PASS Constant should exist on interface and return value -PASS Constant should exist on interface and not be modifiable -PASS Attribute should exist on partial interface and return value -PASS Static attribute should exist on partial interface and return value -PASS Constant should exist on partial interface and return value -PASS Method should exist on partial interface and return value -PASS Static method should exist on partial interface and return value -PASS Attribute should exist on interface and return value -PASS Static attribute should exist on interface and return value -PASS Attribute should exist and not throw exception in worker -PASS Attribute should exist and return value in worker -PASS Constant should exist and return value in worker -PASS Constant should exist and not be modifiable in worker -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-multiple-tokens-header.php b/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-multiple-tokens-header.php index 21034e4..722d43f7 100644 --- a/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-multiple-tokens-header.php +++ b/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-multiple-tokens-header.php
@@ -14,7 +14,7 @@ <title>Test Sample API when trial is enabled</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> -<script src="resources/origin_trials.js"></script> +<script src="resources/origintrials.js"></script> <script> // The trial is enabled by the token above in header.
diff --git a/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-multiple-tokens.html b/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-multiple-tokens.html index 6fa124c..b49423c 100644 --- a/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-multiple-tokens.html +++ b/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-multiple-tokens.html
@@ -14,7 +14,7 @@ <title>Test Sample API when trial is enabled and multiple tokens are present</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> -<script src="resources/origin_trials.js"></script> +<script src="resources/origintrials.js"></script> <script> // The trial is enabled, and the correct token can be found between two other
diff --git a/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-script-added-before-access-expected.txt b/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-script-added-before-access-expected.txt deleted file mode 100644 index 16eb99d..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-script-added-before-access-expected.txt +++ /dev/null
@@ -1,19 +0,0 @@ -This is a testharness.js-based test. -Harness Error. harness_status.status = 1 , harness_status.message = 1 duplicate test name: "Attribute should exist and return value" -PASS Attribute should exist and return value -PASS Attribute should exist and return value -PASS Constant should exist on interface and return value -PASS Constant should exist on interface and not be modifiable -PASS Attribute should exist on partial interface and return value -PASS Static attribute should exist on partial interface and return value -PASS Constant should exist on partial interface and return value -PASS Method should exist on partial interface and return value -PASS Static method should exist on partial interface and return value -PASS Attribute should exist on interface and return value -PASS Static attribute should exist on interface and return value -PASS Attribute should exist and not throw exception in worker -PASS Attribute should exist and return value in worker -PASS Constant should exist and return value in worker -PASS Constant should exist and not be modifiable in worker -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-script-added-before-access.html b/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-script-added-before-access.html index f0b1249a..f8f86467 100644 --- a/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-script-added-before-access.html +++ b/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-script-added-before-access.html
@@ -4,7 +4,7 @@ <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> <script src="../resources/origin-trials-helper.js"></script> -<script src="resources/origin_trials.js"></script> +<script src="resources/origintrials.js"></script> <script> // TODO(iclelland): Generate this sample token during the build. The token
diff --git a/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-script-added-expected.txt b/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-script-added-expected.txt deleted file mode 100644 index f5a187e..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-script-added-expected.txt +++ /dev/null
@@ -1,28 +0,0 @@ -This is a testharness.js-based test. -Harness Error. harness_status.status = 1 , harness_status.message = 1 duplicate test name: "Attribute should exist and return value" -PASS Accessing attribute should throw error -PASS Attribute should exist and return value, with trial disabled -PASS Attribute should not exist, with trial disabled -PASS Constant should not exist, with trial disabled -PASS Attribute should not exist on partial interface, with trial disabled -PASS Static attribute should not exist on partial interface, with trial disabled -PASS Constant should not exist on partial interface, with trial disabled -PASS Method should not exist on partial interface, with trial disabled -PASS Static method should not exist on partial interface, with trial disabled -PASS Attribute should exist and return value -PASS Attribute should exist and return value -PASS Constant should exist on interface and return value -PASS Constant should exist on interface and not be modifiable -PASS Attribute should exist on partial interface and return value -PASS Static attribute should exist on partial interface and return value -PASS Constant should exist on partial interface and return value -PASS Method should exist on partial interface and return value -PASS Static method should exist on partial interface and return value -PASS Attribute should exist on interface and return value -PASS Static attribute should exist on interface and return value -PASS Attribute should exist and not throw exception in worker -PASS Attribute should exist and return value in worker -PASS Constant should exist and return value in worker -PASS Constant should exist and not be modifiable in worker -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-script-added.html b/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-script-added.html index 8035d4d2..3d3a197 100644 --- a/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-script-added.html +++ b/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-script-added.html
@@ -4,7 +4,7 @@ <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> <script src="../resources/origin-trials-helper.js"></script> -<script src="resources/origin_trials.js"></script> +<script src="resources/origintrials.js"></script> <script> // TODO(iclelland): Generate this sample token during the build. The token
diff --git a/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-stolen.html b/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-stolen.html index d59e895..61673ff 100644 --- a/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-stolen.html +++ b/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-stolen.html
@@ -10,7 +10,7 @@ <title>Test Sample API when token is present for a different origin</title> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> -<script src="resources/origin_trials.js"></script> +<script src="resources/origintrials.js"></script> <script> // The trial is not enabled, as the provided token is signed for another origin,
diff --git a/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-workers-expected.txt b/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-workers-expected.txt deleted file mode 100644 index 4f672162..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-workers-expected.txt +++ /dev/null
@@ -1,20 +0,0 @@ -This is a testharness.js-based test. -Harness Error. harness_status.status = 1 , harness_status.message = 7 duplicate test names: "Attribute should exist and not throw exception in worker", "Attribute should exist and return value in worker", "Constant should exist and return value in worker", "Constant should exist and not be modifiable in worker", "Accessing attribute should throw error in worker", "Attribute should not exist in worker", "Constant should not exist in worker" -PASS Test Sample API when trial is enabled in shared and service workers -PASS Test Sample API when trial is enabled in shared and service workers 1 -PASS Accessing attribute should throw error in worker -PASS Attribute should not exist in worker -PASS Constant should not exist in worker -PASS Attribute should exist and not throw exception in worker -PASS Attribute should exist and return value in worker -PASS Constant should exist and return value in worker -PASS Constant should exist and not be modifiable in worker -PASS Attribute should exist and not throw exception in worker -PASS Attribute should exist and return value in worker -PASS Constant should exist and return value in worker -PASS Constant should exist and not be modifiable in worker -PASS Accessing attribute should throw error in worker -PASS Attribute should not exist in worker -PASS Constant should not exist in worker -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/http/tests/push_messaging/resources/pushmessagedata-worker.js b/third_party/WebKit/LayoutTests/http/tests/push_messaging/resources/pushmessagedata-worker.js index 6b9a49f..36fa4437 100644 --- a/third_party/WebKit/LayoutTests/http/tests/push_messaging/resources/pushmessagedata-worker.js +++ b/third_party/WebKit/LayoutTests/http/tests/push_messaging/resources/pushmessagedata-worker.js
@@ -108,11 +108,3 @@ assert_equals(data.text(), s, 'String should not be NFC-normalized.'); }, 'PushEventInit data is not normalized'); - -if (self.SharedArrayBuffer) { - test(function() { - assert_throws(null, () => { - createPushMessageData(new Uint8Array(new SharedArrayBuffer(16))); - }); - }, 'PushMessageData throws when passed SharedArrayBuffer view.'); -}
diff --git a/third_party/WebKit/LayoutTests/http/tests/websocket/send-arraybufferview.html b/third_party/WebKit/LayoutTests/http/tests/websocket/send-arraybufferview.html index a25a2468..b85476f8f 100644 --- a/third_party/WebKit/LayoutTests/http/tests/websocket/send-arraybufferview.html +++ b/third_party/WebKit/LayoutTests/http/tests/websocket/send-arraybufferview.html
@@ -40,11 +40,6 @@ return array; } -function createSharedArrayBufferView() -{ - return new Uint8Array(new SharedArrayBuffer(16)); -} - var url = "ws://127.0.0.1:8880/check-binary-messages"; var ws = new WebSocket(url); var closeEvent; @@ -54,10 +49,6 @@ ws.send(createArrayBufferViewContainingHelloWorld()); ws.send(createEmptyArrayBufferView()); ws.send(createArrayBufferViewContainingAllDistinctBytes()); - - if (window.SharedArrayBuffer) { - shouldThrow("ws.send(createSharedArrayBufferView())"); - } }; ws.onmessage = function(event)
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/mojo-loading/http/tests/origin_trials/sample-api-workers-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/mojo-loading/http/tests/origin_trials/sample-api-workers-expected.txt deleted file mode 100644 index 2e74541..0000000 --- a/third_party/WebKit/LayoutTests/platform/linux/virtual/mojo-loading/http/tests/origin_trials/sample-api-workers-expected.txt +++ /dev/null
@@ -1,20 +0,0 @@ -This is a testharness.js-based test. -Harness Error. harness_status.status = 1 , harness_status.message = 7 duplicate test names: "Attribute should exist and not throw exception in worker", "Attribute should exist and return value in worker", "Constant should exist and return value in worker", "Constant should exist and not be modifiable in worker", "Accessing attribute should throw error in worker", "Attribute should not exist in worker", "Constant should not exist in worker" -PASS Test Sample API when trial is enabled in shared and service workers -PASS Test Sample API when trial is enabled in shared and service workers 1 -PASS Attribute should exist and not throw exception in worker -PASS Attribute should exist and return value in worker -PASS Constant should exist and return value in worker -PASS Constant should exist and not be modifiable in worker -PASS Accessing attribute should throw error in worker -PASS Attribute should not exist in worker -PASS Constant should not exist in worker -PASS Attribute should exist and not throw exception in worker -PASS Attribute should exist and return value in worker -PASS Constant should exist and return value in worker -PASS Constant should exist and not be modifiable in worker -PASS Accessing attribute should throw error in worker -PASS Attribute should not exist in worker -PASS Constant should not exist in worker -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/sensor/absolute-orientation-sensor.html b/third_party/WebKit/LayoutTests/sensor/absolute-orientation-sensor.html index 4349d2b..90065cff 100644 --- a/third_party/WebKit/LayoutTests/sensor/absolute-orientation-sensor.html +++ b/third_party/WebKit/LayoutTests/sensor/absolute-orientation-sensor.html
@@ -48,11 +48,6 @@ // Throws if no orientation data available. assert_throws({ name: 'NotReadableError' }, () => sensorObject.populateMatrix(new Float32Array(16))); - if (window.SharedArrayBuffer) { - // Throws if passed SharedArrayBuffer view. - assert_throws({ name: 'TypeError' }, () => sensorObject.populateMatrix(new Float32Array(new SharedArrayBuffer(16)))); - } - sensorObject.start(); return sensor.mockSensorProvider.getCreatedSensor()
diff --git a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/crypto/README.txt b/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/crypto/README.txt deleted file mode 100644 index 51001f0f..0000000 --- a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/crypto/README.txt +++ /dev/null
@@ -1,3 +0,0 @@ -# This suite runs the tests in with --js-flags=--harmony-sharedarraybuffer -# This enables the SharedArrayBuffer language feature in V8. -# See https://github.com/tc39/ecmascript_sharedmem for more information.
diff --git a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/crypto/random-values-expected.txt b/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/crypto/random-values-expected.txt deleted file mode 100644 index 1334f1f..0000000 --- a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/crypto/random-values-expected.txt +++ /dev/null
@@ -1,14 +0,0 @@ -Tests crypto.randomValues. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - - -PASS 'crypto' in self is true -PASS 'getRandomValues' in self.crypto is true -PASS self.crypto.__proto__.hasOwnProperty('getRandomValues') is true -PASS matchingBytes < 100 is true -PASS crypto.getRandomValues(new Uint8Array(new SharedArrayBuffer(100))) threw exception TypeError: Failed to execute 'getRandomValues' on 'Crypto': The provided ArrayBufferView value must not be shared.. -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/crypto/subtle/importKey-badParameters-expected.txt b/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/crypto/subtle/importKey-badParameters-expected.txt deleted file mode 100644 index f3e09a7..0000000 --- a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/crypto/subtle/importKey-badParameters-expected.txt +++ /dev/null
@@ -1,18 +0,0 @@ -Tests calling cypto.subtle.importKey with bad parameters - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - - -error is: TypeError: Key data must be a BufferSource for non-JWK formats -error is: TypeError: Key data must be a BufferSource for non-JWK formats -error is: TypeError: Algorithm: Not an object -error is: TypeError: Invalid keyFormat argument -error is: TypeError: Invalid keyUsages argument -error is: TypeError: Invalid keyFormat argument -error is: TypeError: HmacImportParams: hash: Missing or not an AlgorithmIdentifier -error is: NotSupportedError: SHA-1: Unsupported operation: importKey -error is: TypeError: Failed to execute 'importKey' on 'SubtleCrypto': The provided ArrayBufferView value must not be shared. -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/crypto/worker-random-values-expected.txt b/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/crypto/worker-random-values-expected.txt deleted file mode 100644 index 47f33e1..0000000 --- a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/crypto/worker-random-values-expected.txt +++ /dev/null
@@ -1,15 +0,0 @@ -[Worker] Tests crypto.randomValues. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - - -Starting worker: random-values.js -PASS [Worker] 'crypto' in self is true -PASS [Worker] 'getRandomValues' in self.crypto is true -PASS [Worker] self.crypto.__proto__.hasOwnProperty('getRandomValues') is true -PASS [Worker] matchingBytes < 100 is true -PASS [Worker] crypto.getRandomValues(new Uint8Array(new SharedArrayBuffer(100))) threw exception TypeError: Failed to execute 'getRandomValues' on 'Crypto': The provided ArrayBufferView value must not be shared.. -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/beacon/README.txt b/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/beacon/README.txt deleted file mode 100644 index de49eb0..0000000 --- a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/beacon/README.txt +++ /dev/null
@@ -1,3 +0,0 @@ -# This suite runs the tests in --js-flags=--harmony-sharedarraybuffer -# This enables the SharedArrayBuffer language feature in V8. -# See https://github.com/tc39/ecmascript_sharedmem for more information.
diff --git a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/beacon/beacon-basic-expected.txt b/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/beacon/beacon-basic-expected.txt deleted file mode 100644 index 4353a79b..0000000 --- a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/beacon/beacon-basic-expected.txt +++ /dev/null
@@ -1,15 +0,0 @@ -Exercising the Beacon API - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - - -PASS Object.getPrototypeOf(navigator).hasOwnProperty('sendBeacon') is true -PASS typeof navigator.sendBeacon is "function" -PASS navigator.sendBeacon() threw exception TypeError: Failed to execute 'sendBeacon' on 'Navigator': 1 argument required, but only 0 present.. -PASS navigator.sendBeacon('http:') threw exception SyntaxError: Failed to execute 'sendBeacon' on 'Navigator': The URL argument is ill-formed or unsupported.. -PASS navigator.sendBeacon('javascript:alert(1);') threw exception SyntaxError: Failed to execute 'sendBeacon' on 'Navigator': Beacons are only supported over HTTP(S).. -PASS navigator.sendBeacon('https:', new Uint8Array(new SharedArrayBuffer(10))) threw exception TypeError: Failed to execute 'sendBeacon' on 'Navigator': The provided ArrayBufferView value must not be shared.. -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/canvas/README.txt b/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/canvas/README.txt deleted file mode 100644 index de49eb0..0000000 --- a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/canvas/README.txt +++ /dev/null
@@ -1,3 +0,0 @@ -# This suite runs the tests in --js-flags=--harmony-sharedarraybuffer -# This enables the SharedArrayBuffer language feature in V8. -# See https://github.com/tc39/ecmascript_sharedmem for more information.
diff --git a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/canvas/canvas-lost-gpu-context-expected.txt b/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/canvas/canvas-lost-gpu-context-expected.txt deleted file mode 100644 index 83502ff..0000000 --- a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/canvas/canvas-lost-gpu-context-expected.txt +++ /dev/null
@@ -1,13 +0,0 @@ -Test the behavior of canvas recovery after a gpu context loss - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - - -PASS contextLostTest is false -PASS ctx.isContextLost() is false -PASS ctx.isContextLost() is false -Aborting test: Graphics context loss did not destroy canvas contents. This is expected if canvas is not accelerated. -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/css/README.txt b/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/css/README.txt deleted file mode 100644 index de49eb0..0000000 --- a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/css/README.txt +++ /dev/null
@@ -1,3 +0,0 @@ -# This suite runs the tests in --js-flags=--harmony-sharedarraybuffer -# This enables the SharedArrayBuffer language feature in V8. -# See https://github.com/tc39/ecmascript_sharedmem for more information.
diff --git a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/css/fontface-arraybuffer-expected.txt b/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/css/fontface-arraybuffer-expected.txt deleted file mode 100644 index 26e246e5..0000000 --- a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/css/fontface-arraybuffer-expected.txt +++ /dev/null
@@ -1,18 +0,0 @@ -Tests ArrayBuffer / ArrayBufferView constructors of FontFace. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - - -PASS face1.status is "loaded" -PASS face2.status is "loaded" -PASS rejectionValue.name is "TypeError" -PASS face3.status is "error" -PASS rejectionValue.name is "SyntaxError" -PASS document.getElementById('FontFromArrayBuffer').offsetWidth is document.getElementById('ref').offsetWidth -PASS document.getElementById('FontFromArrayBufferView').offsetWidth is document.getElementById('ref').offsetWidth -PASS successfullyParsed is true - -TEST COMPLETE -abc -abc -abc
diff --git a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/dom/README.txt b/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/dom/README.txt deleted file mode 100644 index de49eb0..0000000 --- a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/dom/README.txt +++ /dev/null
@@ -1,3 +0,0 @@ -# This suite runs the tests in --js-flags=--harmony-sharedarraybuffer -# This enables the SharedArrayBuffer language feature in V8. -# See https://github.com/tc39/ecmascript_sharedmem for more information.
diff --git a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/dom/geometry-interfaces-dom-matrix-expected.txt b/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/dom/geometry-interfaces-dom-matrix-expected.txt deleted file mode 100644 index 9b8652c..0000000 --- a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/dom/geometry-interfaces-dom-matrix-expected.txt +++ /dev/null
@@ -1,31 +0,0 @@ -This is a testharness.js-based test. -Harness Error. harness_status.status = 1 , harness_status.message = 1 duplicate test name: "DOMMatrix(numberSequence) constructor" -PASS DOMMatrix() constructor -PASS DOMMatrix fromFloat32Array - 2D matrix -PASS DOMMatrix fromFloat64Array - 2D matrix -PASS DOMMatrix fromFloat32Array - 3D matrix -PASS DOMMatrix fromFloat64Array - 3D matrix -PASS DOMMatrix(transformList) - emptyString -PASS DOMMatrix(transformList) - transformList -PASS DOMMatrix(numberSequence) constructor -PASS DOMMatrix(numberSequence) constructor -PASS DOMMatrix attributes -PASS DOMMatrix.is2D can never be set to 'true' when it was set to 'false' before calling setMatrixValue() -PASS DOMMatrix fromFloat*Array - invalid array size of nearby 6 -PASS DOMMatrix fromFloat*Array - invalid array size of nearby 16 -PASS DOMMatrix fromFloat*Array - invalid array size -PASS DOMMatrix fromFloat*Array - can't use SharedArrayBuffer view -PASS DOMMatrix.fromMatrix() with no parameter -PASS DOMMatrix.fromMatrix() with null -PASS DOMMatrix.fromMatrix() with undefined -PASS DOMMatrix.fromMatrix() with empty object -PASS DOMMatrix.fromMatrix({a: 1, b: 2, c: 3, d: 4, e: 5, f: 6}) should create a 2D DOMMatrix -PASS DOMMatrix.fromMatrix({m11: 1, m22: 2, m33: 3, m44: 4, m23: 5, m43: 6}) should create a 3D DOMMatrix -PASS If 2d related properties don't be set, should set to fallback -PASS DOMMatrix.fromMatrix(): NaN test -PASS DOMMatrix toJSON() - identity matrix -PASS DOMMatrix toJSON() - 2D matrix -PASS DOMMatrix toJSON() - 3D matrix -PASS DOMMatrix.fromMatrix(): Exception test -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/encoding/api/README.txt b/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/encoding/api/README.txt deleted file mode 100644 index de49eb0..0000000 --- a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/encoding/api/README.txt +++ /dev/null
@@ -1,3 +0,0 @@ -# This suite runs the tests in --js-flags=--harmony-sharedarraybuffer -# This enables the SharedArrayBuffer language feature in V8. -# See https://github.com/tc39/ecmascript_sharedmem for more information.
diff --git a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/events/constructors/README.txt b/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/events/constructors/README.txt deleted file mode 100644 index de49eb0..0000000 --- a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/events/constructors/README.txt +++ /dev/null
@@ -1,3 +0,0 @@ -# This suite runs the tests in --js-flags=--harmony-sharedarraybuffer -# This enables the SharedArrayBuffer language feature in V8. -# See https://github.com/tc39/ecmascript_sharedmem for more information.
diff --git a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/events/constructors/midi-message-event-constructor-expected.txt b/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/events/constructors/midi-message-event-constructor-expected.txt deleted file mode 100644 index 14b8b2b..0000000 --- a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/events/constructors/midi-message-event-constructor-expected.txt +++ /dev/null
@@ -1,21 +0,0 @@ -This tests the constructor for the MIDIMessageEvent DOM class. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - - -PASS new MIDIMessageEvent('eventType').bubbles is false -PASS new MIDIMessageEvent('eventType').cancelable is false -PASS new MIDIMessageEvent('eventType').data is null -PASS new MIDIMessageEvent('eventType', { bubbles: false }).bubbles is false -PASS new MIDIMessageEvent('eventType', { bubbles: true }).bubbles is true -PASS new MIDIMessageEvent('eventType', { cancelable: false }).cancelable is false -PASS new MIDIMessageEvent('eventType', { cancelable: true }).cancelable is true -PASS new MIDIMessageEvent('eventType', { data: data }).data == '0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0' is true -PASS new MIDIMessageEvent('eventType', { bubbles: true, cancelable: true, data: data }).bubbles is true -PASS new MIDIMessageEvent('eventType', { bubbles: true, cancelable: true, data: data }).cancelable is true -PASS new MIDIMessageEvent('eventType', { bubbles: true, cancelable: true, data: data }).data == '0,0,0' is true -PASS new MIDIMessageEvent('eventType', { data: data }) threw exception TypeError: Failed to construct 'MIDIMessageEvent': The provided ArrayBufferView value must not be shared.. -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/files/README.txt b/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/files/README.txt deleted file mode 100644 index de49eb0..0000000 --- a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/files/README.txt +++ /dev/null
@@ -1,3 +0,0 @@ -# This suite runs the tests in --js-flags=--harmony-sharedarraybuffer -# This enables the SharedArrayBuffer language feature in V8. -# See https://github.com/tc39/ecmascript_sharedmem for more information.
diff --git a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/files/blob-constructor-expected.txt b/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/files/blob-constructor-expected.txt deleted file mode 100644 index 195ef38..0000000 --- a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/files/blob-constructor-expected.txt +++ /dev/null
@@ -1,96 +0,0 @@ -Test the Blob constructor. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - - -PASS (new Blob()) instanceof window.Blob is true -PASS (new Blob(undefined)) instanceof window.Blob is true -PASS (new Blob([])) instanceof window.Blob is true -PASS (new Blob(['hello'])) instanceof window.Blob is true -PASS (new Blob(['hello'], {})) instanceof window.Blob is true -PASS (new Blob(['hello'], {type:'text/html'})) instanceof window.Blob is true -PASS (new Blob(['hello'], {type:'text/html', endings:'native'})) instanceof window.Blob is true -PASS (new Blob(['hello'], {type:'text/html', endings:'transparent'})) instanceof window.Blob is true -PASS (new Blob()).size is 0 -PASS (new Blob(undefined)).size is 0 -PASS (new Blob()).type is "" -PASS (new Blob(undefined)).type is "" -PASS new Blob('hello') threw exception TypeError: Failed to construct 'Blob': The 1st argument is neither an array, nor does it have indexed properties.. -PASS new Blob(0) threw exception TypeError: Failed to construct 'Blob': The 1st argument is neither an array, nor does it have indexed properties.. -PASS new Blob(null) threw exception TypeError: Failed to construct 'Blob': The 1st argument is neither an array, nor does it have indexed properties.. -PASS (new Blob([])) instanceof window.Blob is true -PASS (new Blob(['stringPrimitive'])) instanceof window.Blob is true -PASS (new Blob([String('stringObject')])) instanceof window.Blob is true -PASS (new Blob([new Blob])) instanceof window.Blob is true -PASS (new Blob([new Blob([new Blob])])) instanceof window.Blob is true -PASS (new Blob([12])).size is 2 -PASS (new Blob([[]])).size is 0 -PASS (new Blob([{}])).size is 15 -PASS (new Blob([document])).size is 21 -PASS (new Blob([toStringingObj])).size is 8 -PASS new Blob([throwingObj]) threw exception Error. -PASS (new Blob([], {unknownKey:'value'})) instanceof window.Blob is true -PASS new Blob([], {endings:'illegalValue'}) threw exception TypeError: Failed to construct 'Blob': The provided value 'illegalValue' is not a valid enum value of type NormalizeLineEndings.. -PASS new Blob([], {endings:throwingObj}) threw exception Error. -PASS new Blob([], {type:throwingObj}) threw exception Error. -PASS new Blob([], {endings:throwingObj1, type:throwingObj2}) threw exception Error 1. -PASS new Blob([], {type:throwingObj2, endings:throwingObj1}) threw exception Error 1. -PASS new Blob([], {type:throwingObj2, endings:'illegal'}) threw exception TypeError: Failed to construct 'Blob': The provided value 'illegal' is not a valid enum value of type NormalizeLineEndings.. -PASS new Blob([], {type:'hello\u00EE'}).type is "" -PASS new Blob([], {type:'hello\u001F'}).type is "" -PASS new Blob([], {type:'hello\u007F'}).type is "" -PASS new Blob([], {type:'ABC/abc'}).type is "abc/abc" -PASS new Blob([], {type:'123ABCabc'}).type is "123abcabc" -PASS (new Blob([], null)) instanceof window.Blob is true -PASS (new Blob([], undefined)) instanceof window.Blob is true -PASS (new Blob([], 123)) instanceof window.Blob threw exception TypeError: Failed to construct 'Blob': parameter 2 ('options') is not an object.. -PASS (new Blob([], 123.4)) instanceof window.Blob threw exception TypeError: Failed to construct 'Blob': parameter 2 ('options') is not an object.. -PASS (new Blob([], true)) instanceof window.Blob threw exception TypeError: Failed to construct 'Blob': parameter 2 ('options') is not an object.. -PASS (new Blob([], 'abc')) instanceof window.Blob threw exception TypeError: Failed to construct 'Blob': parameter 2 ('options') is not an object.. -PASS (new Blob([], [])) instanceof window.Blob is true -PASS (new Blob([], /abc/)) instanceof window.Blob is true -PASS (new Blob([], function () {})) instanceof window.Blob is true -PASS (new Blob([], {type:'text/html'})).type is 'text/html' -PASS (new Blob([], {type:'text/html'})).size is 0 -PASS (new Blob([], {type:'text/plain;charset=UTF-8'})).type is 'text/plain;charset=utf-8' -PASS (new Blob([])).lastModified is undefined -PASS (new Blob([], {})).lastModified is undefined -PASS (new Blob([], {lastModified: new Date()})).lastModified is undefined -PASS window.Blob.length is 0 -PASS new Blob([new DataView(new ArrayBuffer(100))]).size is 100 -PASS new Blob([new Uint8Array(100)]).size is 100 -PASS new Blob([new Uint8ClampedArray(100)]).size is 100 -PASS new Blob([new Uint16Array(100)]).size is 200 -PASS new Blob([new Uint32Array(100)]).size is 400 -PASS new Blob([new Int8Array(100)]).size is 100 -PASS new Blob([new Int16Array(100)]).size is 200 -PASS new Blob([new Int32Array(100)]).size is 400 -PASS new Blob([new Float32Array(100)]).size is 400 -PASS new Blob([new Float64Array(100)]).size is 800 -PASS new Blob([new Float64Array(100), new Int32Array(100), new Uint8Array(100), new DataView(new ArrayBuffer(100))]).size is 1400 -PASS new Blob([new Blob([new Int32Array(100)]), new Uint8Array(100), new Float32Array(100), new DataView(new ArrayBuffer(100))]).size is 1000 -PASS new Blob([(new DataView(new ArrayBuffer(100))).buffer]).size is 100 -PASS new Blob([(new Uint8Array(100)).buffer]).size is 100 -PASS new Blob([(new Uint8ClampedArray(100)).buffer]).size is 100 -PASS new Blob([(new Uint16Array(100)).buffer]).size is 200 -PASS new Blob([(new Uint32Array(100)).buffer]).size is 400 -PASS new Blob([(new Int8Array(100)).buffer]).size is 100 -PASS new Blob([(new Int16Array(100)).buffer]).size is 200 -PASS new Blob([(new Int32Array(100)).buffer]).size is 400 -PASS new Blob([(new Float32Array(100)).buffer]).size is 400 -PASS new Blob([(new Float64Array(100)).buffer]).size is 800 -PASS new Blob([(new Float64Array(100)).buffer, (new Int32Array(100)).buffer, (new Uint8Array(100)).buffer, (new DataView(new ArrayBuffer(100))).buffer]).size is 1400 -PASS new Blob([new Blob([(new Int32Array(100)).buffer]), (new Uint8Array(100)).buffer, (new Float32Array(100)).buffer, (new DataView(new ArrayBuffer(100))).buffer]).size is 1000 -PASS new Blob([new Uint8Array(new SharedArrayBuffer(4))]) threw exception TypeError: Failed to construct 'Blob': The provided ArrayBufferView value must not be shared.. -PASS new Blob({length: 0}).size is 0 -PASS new Blob({length: 1, 0: 'string'}).size is 6 -PASS OMICRON_WITH_OXIA.charCodeAt(0) is 0x1F79 -PASS reader.result.charCodeAt(0) is 0x1F79 -PASS CONTAINS_UNPAIRED_SURROGATES.charCodeAt(3) is 0xDC00 -PASS CONTAINS_UNPAIRED_SURROGATES.charCodeAt(7) is 0xD800 -PASS reader.result.charCodeAt(3) is 0xFFFD -PASS reader.result.charCodeAt(7) is 0xFFFD -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/peerconnection/README.txt b/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/peerconnection/README.txt deleted file mode 100644 index de49eb0..0000000 --- a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/peerconnection/README.txt +++ /dev/null
@@ -1,3 +0,0 @@ -# This suite runs the tests in --js-flags=--harmony-sharedarraybuffer -# This enables the SharedArrayBuffer language feature in V8. -# See https://github.com/tc39/ecmascript_sharedmem for more information.
diff --git a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/peerconnection/RTCPeerConnection-datachannel-expected.txt b/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/peerconnection/RTCPeerConnection-datachannel-expected.txt deleted file mode 100644 index a625818..0000000 --- a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/peerconnection/RTCPeerConnection-datachannel-expected.txt +++ /dev/null
@@ -1,45 +0,0 @@ -Tests RTCDataChannel. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - - -PASS dc = pc.createDataChannel("label1"); did not throw exception. -PASS dc.reliable is true -PASS dc = pc.createDataChannel("label2", {}); did not throw exception. -PASS dc.reliable is true -PASS dc = pc.createDataChannel("label3", {ordered:true}); did not throw exception. -PASS dc.reliable is true -PASS dc = pc.createDataChannel("label3", {ordered:false}); did not throw exception. -PASS dc.reliable is false -PASS dc = pc.createDataChannel("label3", {maxRetransmits:0}); did not throw exception. -PASS dc.reliable is false -PASS dc = pc.createDataChannel("label3", {maxRetransmitTime:0}); did not throw exception. -PASS dc.reliable is false -PASS pc is connected -PASS dc = pc.createDataChannel("label"); did not throw exception. -PASS dc.readyState is 'connecting' -PASS pc_ondatachannel was called -PASS dc_onopen was called -PASS dc.readyState is 'open' -PASS dc.label is 'label' -PASS dc.send('xyzzy'); did not throw exception. -PASS dc_onmessage_string was called -PASS data is 'xyzzy' -PASS dc.send(buffer); did not throw exception. -PASS dc_onmessage_arraybuffer was called -PASS data.byteLength is 2 -PASS array[0] is 17 -PASS array[1] is 19 -PASS data.byteLength is 12 -PASS dc.send(shrunkView); did not throw exception. -PASS dc_onmessage_dataview was called -PASS data.byteLength is 10 -PASS array[0] is 1 -PASS array[9] is 10 -PASS dc.send(new Uint8Array(new SharedArrayBuffer(16))); threw exception TypeError: Failed to execute 'send' on 'RTCDataChannel': The provided ArrayBufferView value must not be shared.. -PASS dc_onclose was called -PASS dc.readyState is 'closed' -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/workers/README.txt b/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/workers/README.txt index de49eb0..cb3dbc97 100644 --- a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/workers/README.txt +++ b/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/workers/README.txt
@@ -1,3 +1,5 @@ -# This suite runs the tests in --js-flags=--harmony-sharedarraybuffer -# This enables the SharedArrayBuffer language feature in V8. -# See https://github.com/tc39/ecmascript_sharedmem for more information. +# This suite runs the tests in fast/workers with +# --js-flags=--harmony-sharedarraybuffer +# This enables the experimental SharedArrayBuffer language feature in V8. +# See +# https://github.com/lars-t-hansen/ecmascript_sharedmem for more information.
diff --git a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/http/tests/media/media-source/README.txt b/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/http/tests/media/media-source/README.txt deleted file mode 100644 index de49eb0..0000000 --- a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/http/tests/media/media-source/README.txt +++ /dev/null
@@ -1,3 +0,0 @@ -# This suite runs the tests in --js-flags=--harmony-sharedarraybuffer -# This enables the SharedArrayBuffer language feature in V8. -# See https://github.com/tc39/ecmascript_sharedmem for more information.
diff --git a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/http/tests/push_messaging/README.txt b/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/http/tests/push_messaging/README.txt deleted file mode 100644 index de49eb0..0000000 --- a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/http/tests/push_messaging/README.txt +++ /dev/null
@@ -1,3 +0,0 @@ -# This suite runs the tests in --js-flags=--harmony-sharedarraybuffer -# This enables the SharedArrayBuffer language feature in V8. -# See https://github.com/tc39/ecmascript_sharedmem for more information.
diff --git a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/http/tests/websocket/README.txt b/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/http/tests/websocket/README.txt deleted file mode 100644 index de49eb0..0000000 --- a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/http/tests/websocket/README.txt +++ /dev/null
@@ -1,3 +0,0 @@ -# This suite runs the tests in --js-flags=--harmony-sharedarraybuffer -# This enables the SharedArrayBuffer language feature in V8. -# See https://github.com/tc39/ecmascript_sharedmem for more information.
diff --git a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/http/tests/websocket/send-arraybufferview-expected.txt b/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/http/tests/websocket/send-arraybufferview-expected.txt deleted file mode 100644 index f4970fe..0000000 --- a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/http/tests/websocket/send-arraybufferview-expected.txt +++ /dev/null
@@ -1,13 +0,0 @@ -WebSocket: Send ArrayBufferViews. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS ws.send(createSharedArrayBufferView()) threw exception TypeError: Failed to execute 'send' on 'WebSocket': The provided ArrayBufferView value must not be shared.. -PASS PASS: Message #0. -PASS PASS: Message #1. -PASS PASS: Message #2. -PASS closeEvent.wasClean is true -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/sensor/README.txt b/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/sensor/README.txt deleted file mode 100644 index de49eb0..0000000 --- a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/sensor/README.txt +++ /dev/null
@@ -1,3 +0,0 @@ -# This suite runs the tests in --js-flags=--harmony-sharedarraybuffer -# This enables the SharedArrayBuffer language feature in V8. -# See https://github.com/tc39/ecmascript_sharedmem for more information.
diff --git a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/webaudio/README.txt b/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/webaudio/README.txt deleted file mode 100644 index de49eb0..0000000 --- a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/webaudio/README.txt +++ /dev/null
@@ -1,3 +0,0 @@ -# This suite runs the tests in --js-flags=--harmony-sharedarraybuffer -# This enables the SharedArrayBuffer language feature in V8. -# See https://github.com/tc39/ecmascript_sharedmem for more information.
diff --git a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/webaudio/dom-exceptions-expected.txt b/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/webaudio/dom-exceptions-expected.txt deleted file mode 100644 index 82728fbe..0000000 --- a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/webaudio/dom-exceptions-expected.txt +++ /dev/null
@@ -1,250 +0,0 @@ -CONSOLE WARNING: line 341: The provided value 'fancy' is not a valid enum value of type ChannelCountMode. -CONSOLE WARNING: line 347: The provided value 'undefined' is not a valid enum value of type ChannelInterpretation. -CONSOLE WARNING: line 502: The provided value '9x' is not a valid enum value of type OverSampleType. -CONSOLE WARNING: line 717: The provided value 'junk' is not a valid enum value of type ChannelCountMode. -CONSOLE WARNING: line 746: The provided value 'junk' is not a valid enum value of type ChannelCountMode. -This is a testharness.js-based test. -PASS # AUDIT TASK RUNNER STARTED. -PASS > [initialize] Initialize contexts for testing -PASS context = new AudioContext() did not throw an exception. -PASS otherContext = new AudioContext() did not throw an exception. -PASS < [initialize] All assertions passed. (total 2 assertions) -PASS > [createBuffer] -PASS context.createBuffer(99, 1, context.sampleRate) threw NotSupportedError: "Failed to execute 'createBuffer' on 'BaseAudioContext': The number of channels provided (99) is outside the range [1, 32].". -PASS context.createBuffer(0, 1, context.sampleRate) threw NotSupportedError: "Failed to execute 'createBuffer' on 'BaseAudioContext': The number of channels provided (0) is outside the range [1, 32].". -PASS context.createBuffer(1, 1, 1) threw NotSupportedError: "Failed to execute 'createBuffer' on 'BaseAudioContext': The sample rate provided (1) is outside the range [3000, 384000].". -PASS context.createBuffer(1, 1, 2999) threw NotSupportedError: "Failed to execute 'createBuffer' on 'BaseAudioContext': The sample rate provided (2999) is outside the range [3000, 384000].". -PASS context.createBuffer(1, 1, 384001) threw NotSupportedError: "Failed to execute 'createBuffer' on 'BaseAudioContext': The sample rate provided (384001) is outside the range [3000, 384000].". -PASS context.createBuffer(1, 1, 1e6) threw NotSupportedError: "Failed to execute 'createBuffer' on 'BaseAudioContext': The sample rate provided (1.00000e+6) is outside the range [3000, 384000].". -PASS context.createBuffer(1, 1, 3000) did not throw an exception. -PASS context.createBuffer(1, 1, 192000) did not throw an exception. -PASS context.createBuffer(1, 1, 384000) did not throw an exception. -PASS context.createBuffer(1, 0, context.sampleRate) threw NotSupportedError: "Failed to execute 'createBuffer' on 'BaseAudioContext': The number of frames provided (0) is less than or equal to the minimum bound (0).". -PASS context.createBuffer(new ArrayBuffer(100), true) threw TypeError: "Failed to execute 'createBuffer' on 'BaseAudioContext': 3 arguments required, but only 2 present.". -PASS < [createBuffer] All assertions passed. (total 11 assertions) -PASS > [createMediaElementSource] -PASS context.createMediaElementSource(null) threw TypeError: "Failed to execute 'createMediaElementSource' on 'BaseAudioContext': parameter 1 is not of type 'HTMLMediaElement'.". -PASS < [createMediaElementSource] All assertions passed. (total 1 assertions) -PASS > [createMediaStreamSource] -PASS context.createMediaStreamSource(null) threw TypeError: "Failed to execute 'createMediaStreamSource' on 'BaseAudioContext': parameter 1 is not of type 'MediaStream'.". -PASS < [createMediaStreamSource] All assertions passed. (total 1 assertions) -PASS > [createScriptProcessor] -PASS context.createScriptProcessor(1, 1, 1) threw IndexSizeError: "Failed to execute 'createScriptProcessor' on 'BaseAudioContext': buffer size (1) must be 0 or a power of two between 256 and 16384.". -PASS context.createScriptProcessor(4096, 100, 1) threw IndexSizeError: "Failed to execute 'createScriptProcessor' on 'BaseAudioContext': number of input channels (100) exceeds maximum (32).". -PASS context.createScriptProcessor(4096, 1, 100) threw IndexSizeError: "Failed to execute 'createScriptProcessor' on 'BaseAudioContext': number of output channels (100) exceeds maximum (32).". -PASS context.createScriptProcessor() did not throw an exception. -PASS context.createScriptProcessor(0) did not throw an exception. -PASS < [createScriptProcessor] All assertions passed. (total 5 assertions) -PASS > [createChannelSplitter] -PASS context.createChannelSplitter(0) threw IndexSizeError: "Failed to execute 'createChannelSplitter' on 'BaseAudioContext': The number of outputs provided (0) is outside the range [1, 32].". -PASS context.createChannelSplitter(99) threw IndexSizeError: "Failed to execute 'createChannelSplitter' on 'BaseAudioContext': The number of outputs provided (99) is outside the range [1, 32].". -PASS context.createChannelMerger(0) threw IndexSizeError: "Failed to execute 'createChannelMerger' on 'BaseAudioContext': The number of inputs provided (0) is outside the range [1, 32].". -PASS < [createChannelSplitter] All assertions passed. (total 3 assertions) -PASS > [createChannelMerger] -PASS context.createChannelMerger(99) threw IndexSizeError: "Failed to execute 'createChannelMerger' on 'BaseAudioContext': The number of inputs provided (99) is outside the range [1, 32].". -PASS < [createChannelMerger] All assertions passed. (total 1 assertions) -PASS > [createPeriodicWave] -PASS context.createPeriodicWave(null, null) threw TypeError: "Failed to execute 'createPeriodicWave' on 'BaseAudioContext': parameter 1 is not of type 'Float32Array'.". -PASS context.createPeriodicWave(new Float32Array(10), null) threw TypeError: "Failed to execute 'createPeriodicWave' on 'BaseAudioContext': parameter 2 is not of type 'Float32Array'.". -PASS context.createPeriodicWave(new Float32Array(4100), new Float32Array(4100)) did not throw an exception. -PASS context.createPeriodicWave(new Float32Array(8192), new Float32Array(8192)) did not throw an exception. -PASS context.createPeriodicWave(new Float32Array(10000), new Float32Array(10000)) did not throw an exception. -PASS context.createPeriodicWave(new Float32Array(10), new Float32Array(7)) threw IndexSizeError: "Failed to execute 'createPeriodicWave' on 'BaseAudioContext': length of real array (10) and length of imaginary array (7) must match.". -PASS context.createPeriodicWave(shared_view, nonshared_view) threw TypeError: "Failed to execute 'createPeriodicWave' on 'BaseAudioContext': The provided ArrayBufferView value must not be shared.". -PASS context.createPeriodicWave(nonshared_view, shared_view) threw TypeError: "Failed to execute 'createPeriodicWave' on 'BaseAudioContext': The provided ArrayBufferView value must not be shared.". -PASS < [createPeriodicWave] All assertions passed. (total 8 assertions) -PASS > [createAnalyser] -PASS AnalyserNode.fftSize = 42 threw IndexSizeError: "Failed to set the 'fftSize' property on 'AnalyserNode': The value provided (42) is not a power of two.". -PASS AnalyserNode.fftSize is not equal to 42. -PASS AnalyserNode.fftSize = 16 threw IndexSizeError: "Failed to set the 'fftSize' property on 'AnalyserNode': The FFT size provided (16) is outside the range [32, 32768].". -PASS AnalyserNode.fftSize is not equal to 16. -PASS AnalyserNode.fftSize = 32768 did not throw an exception. -PASS AnalyserNode.fftSize = 65536 threw IndexSizeError: "Failed to set the 'fftSize' property on 'AnalyserNode': The FFT size provided (65536) is outside the range [32, 32768].". -PASS AnalyserNode.fftSize is not equal to 65536. -PASS AnalyserNode.minDecibels = -10 threw IndexSizeError: "Failed to set the 'minDecibels' property on 'AnalyserNode': The minDecibels provided (-10) is greater than the maximum bound (-30).". -PASS AnalyserNode.minDecibels is not equal to -10. -PASS AnalyserNode.maxDecibels = -150 threw IndexSizeError: "Failed to set the 'maxDecibels' property on 'AnalyserNode': The maxDecibels provided (-150) is less than the minimum bound (-100).". -PASS AnalyserNode.maxDecibels is not equal to -150. -PASS AnalyserNode.minDecibels = -30 threw IndexSizeError: "Failed to set the 'minDecibels' property on 'AnalyserNode': The minDecibels provided (-30) is greater than or equal to the maximum bound (-30).". -PASS AnalyserNode.minDecibels is not equal to -30. -PASS AnalyserNode.maxDecibels = -100 threw IndexSizeError: "Failed to set the 'maxDecibels' property on 'AnalyserNode': The maxDecibels provided (-100) is less than or equal to the minimum bound (-100).". -PASS AnalyserNode.maxDecibels is not equal to -100. -PASS AnalyserNode.smoothingTimeConstant = -0.1 threw IndexSizeError: "Failed to set the 'smoothingTimeConstant' property on 'AnalyserNode': The smoothing value provided (-0.1) is outside the range [0, 1].". -PASS AnalyserNode.smoothingTimeConstant is not equal to -0.1. -PASS AnalyserNode.smoothingTimeConstant = 1.5 threw IndexSizeError: "Failed to set the 'smoothingTimeConstant' property on 'AnalyserNode': The smoothing value provided (1.5) is outside the range [0, 1].". -PASS AnalyserNode.smoothingTimeConstant is not equal to 1.5. -PASS AnalyserNode.getFloatFrequencyData(null) threw TypeError: "Failed to execute 'getFloatFrequencyData' on 'AnalyserNode': parameter 1 is not of type 'Float32Array'.". -PASS AnalyserNode.getByteFrequencyData(null) threw TypeError: "Failed to execute 'getByteFrequencyData' on 'AnalyserNode': parameter 1 is not of type 'Uint8Array'.". -PASS AnalyserNode.getFloatTimeDomainData(null) threw TypeError: "Failed to execute 'getFloatTimeDomainData' on 'AnalyserNode': parameter 1 is not of type 'Float32Array'.". -PASS AnalyserNode.getByteTimeDomainData(null) threw TypeError: "Failed to execute 'getByteTimeDomainData' on 'AnalyserNode': parameter 1 is not of type 'Uint8Array'.". -PASS AnalyserNode.getFloatFrequencyData(SharedArrayBuffer view) threw TypeError: "Failed to execute 'getFloatFrequencyData' on 'AnalyserNode': The provided ArrayBufferView value must not be shared.". -PASS AnalyserNode.getByteFrequencyData(SharedArrayBuffer view) threw TypeError: "Failed to execute 'getByteFrequencyData' on 'AnalyserNode': The provided ArrayBufferView value must not be shared.". -PASS AnalyserNode.getFloatTimeDomainData(SharedArrayBuffer view) threw TypeError: "Failed to execute 'getFloatTimeDomainData' on 'AnalyserNode': The provided ArrayBufferView value must not be shared.". -PASS AnalyserNode.getByteTimeDomainData(SharedArrayBuffer view) threw TypeError: "Failed to execute 'getByteTimeDomainData' on 'AnalyserNode': The provided ArrayBufferView value must not be shared.". -PASS AudioBuffer.getChannelData(2) threw IndexSizeError: "Failed to execute 'getChannelData' on 'AudioBuffer': channel index (2) exceeds number of channels (1)". -PASS < [createAnalyser] All assertions passed. (total 28 assertions) -PASS > [Init test nodes] Create test nodes for the following tests -PASS node = context.createGain() did not throw an exception. -PASS node2 = context.createGain() did not throw an exception. -PASS < [Init test nodes] All assertions passed. (total 2 assertions) -PASS > [connections] AudioNode connections -PASS node.connect(null, 0, 0) threw TypeError: "Failed to execute 'connect' on 'AudioNode': parameter 1 is not of type 'AudioNode'.". -PASS node.connect(context.destination, 100, 0) threw IndexSizeError: "Failed to execute 'connect' on 'AudioNode': output index (100) exceeds number of outputs (1).". -PASS node.connect(context.destination, 0, 100) threw IndexSizeError: "Failed to execute 'connect' on 'AudioNode': input index (100) exceeds number of inputs (1).". -PASS node.connect(node2.gain, 100) threw IndexSizeError: "Failed to execute 'connect' on 'AudioNode': output index (100) exceeds number of outputs (1).". -PASS node.disconnect(99) threw IndexSizeError: "Failed to execute 'disconnect' on 'AudioNode': The output index provided (99) is outside the range [0, 0].". -PASS node.connect(otherContext.destination) threw InvalidAccessError: "Failed to execute 'connect' on 'AudioNode': cannot connect to a destination belonging to a different audio context.". -PASS < [connections] All assertions passed. (total 6 assertions) -PASS > [channel-stuff] channelCount, channelCountMode, channelInterpretation -PASS GainNode.channelCount = 99 threw NotSupportedError: "Failed to set the 'channelCount' property on 'AudioNode': The channel count provided (99) is outside the range [1, 32].". -PASS GainNode.channelCount is not equal to 99. -PASS node.channelCountMode = "fancy" did not throw an exception. -PASS node.channelCountMode is equal to max. -PASS node.channelInterpretation = mode did not throw an exception. -PASS node.channelInterpretation is equal to speakers. -PASS context.destination.channelCount = 99 threw IndexSizeError: [error message omitted]. -PASS < [channel-stuff] All assertions passed. (total 7 assertions) -PASS > [audioparam] -PASS param.setValueCurveAtTime(null, 0, 0) threw TypeError: "Failed to execute 'setValueCurveAtTime' on 'AudioParam': parameter 1 is not of type 'Float32Array'.". -PASS param.setValueCurveAtTime(SharedArrayBuffer view, 0, 0) threw TypeError: "Failed to execute 'setValueCurveAtTime' on 'AudioParam': The provided ArrayBufferView value must not be shared.". -PASS node.gain.exponentialRampToValueAtTime(-1, 0.1) did not throw an exception. -PASS node.gain.exponentialRampToValueAtTime(0, 0.1) threw InvalidAccessError: "Failed to execute 'exponentialRampToValueAtTime' on 'AudioParam': The float target value provided (0) should not be in the range (-1.40130e-45, 1.40130e-45).". -PASS node.gain.exponentialRampToValueAtTime(1e-100, 0.1) threw InvalidAccessError: "Failed to execute 'exponentialRampToValueAtTime' on 'AudioParam': The float target value provided (0) should not be in the range (-1.40130e-45, 1.40130e-45).". -PASS node.gain.exponentialRampToValueAtTime(Math.pow(2, -149), 0.1) did not throw an exception. -PASS node.gain.exponentialRampToValueAtTime(Math.pow(2, -150), 0.1) threw InvalidAccessError: "Failed to execute 'exponentialRampToValueAtTime' on 'AudioParam': The float target value provided (0) should not be in the range (-1.40130e-45, 1.40130e-45).". -PASS < [audioparam] All assertions passed. (total 7 assertions) -PASS > [biquad] -PASS node.getFrequencyResponse(new Float32Array(1), new Float32Array(1), new Float32Array(1)) did not throw an exception. -PASS node.getFrequencyResponse(null, new Float32Array(1), new Float32Array(1)) threw TypeError: "Failed to execute 'getFrequencyResponse' on 'BiquadFilterNode': parameter 1 is not of type 'Float32Array'.". -PASS node.getFrequencyResponse(new Float32Array(1), null, new Float32Array(1)) threw TypeError: "Failed to execute 'getFrequencyResponse' on 'BiquadFilterNode': parameter 2 is not of type 'Float32Array'.". -PASS node.getFrequencyResponse(new Float32Array(1), new Float32Array(1), null) threw TypeError: "Failed to execute 'getFrequencyResponse' on 'BiquadFilterNode': parameter 3 is not of type 'Float32Array'.". -PASS node.getFrequencyResponse(shared_view, nonshared_view, nonshared_view) threw TypeError: "Failed to execute 'getFrequencyResponse' on 'BiquadFilterNode': The provided ArrayBufferView value must not be shared.". -PASS node.getFrequencyResponse(nonshared_view, shared_view, nonshared_view) threw TypeError: "Failed to execute 'getFrequencyResponse' on 'BiquadFilterNode': The provided ArrayBufferView value must not be shared.". -PASS node.getFrequencyResponse(nonshared_view, nonshared_view, shared_view) threw TypeError: "Failed to execute 'getFrequencyResponse' on 'BiquadFilterNode': The provided ArrayBufferView value must not be shared.". -PASS < [biquad] All assertions passed. (total 7 assertions) -PASS > [offline-audio-context] -PASS new OfflineAudioContext(32, 100, context.sampleRate) did not throw an exception. -PASS new OfflineAudioContext(0, 100, context.sampleRate) threw NotSupportedError: "Failed to construct 'OfflineAudioContext': The number of channels provided (0) is outside the range [1, 32].". -PASS new OfflineAudioContext(99, 100, context.sampleRate) threw NotSupportedError: "Failed to construct 'OfflineAudioContext': The number of channels provided (99) is outside the range [1, 32].". -PASS new OfflineAudioContext(1, 100, 1) threw NotSupportedError: "Failed to construct 'OfflineAudioContext': The sampleRate provided (1) is outside the range [3000, 384000].". -PASS new OfflineAudioContext(1, 100, 1e6) threw NotSupportedError: "Failed to construct 'OfflineAudioContext': The sampleRate provided (1.00000e+6) is outside the range [3000, 384000].". -PASS new OfflineAudioContext(1, -88200000000000, 44100) threw NotSupportedError: "Failed to construct 'OfflineAudioContext': OfflineAudioContext(1, 1448390656, 44100)". -PASS new OfflineAudioContext(1, 0, 44100) threw NotSupportedError: "Failed to construct 'OfflineAudioContext': The number of frames provided (0) is less than the minimum bound (1).". -PASS < [offline-audio-context] All assertions passed. (total 7 assertions) -PASS > [waveshaper] -PASS node.oversample = "9x" did not throw an exception. -PASS node.oversample is equal to none. -PASS node.curve = {} threw TypeError: "Failed to set the 'curve' property on 'WaveShaperNode': The provided value is not of type 'Float32Array'.". -PASS node.curve = new Float32Array(1) threw InvalidAccessError: "Failed to set the 'curve' property on 'WaveShaperNode': The curve length provided (1) is less than the minimum bound (2).". -PASS node.curve is equal to ${expected}. -PASS node.curve = new Float32Array(2) did not throw an exception. -PASS node.curve = null did not throw an exception. -PASS < [waveshaper] All assertions passed. (total 7 assertions) -PASS > [audio-buffer-source] AudioBufferSource start/stop -PASS source = context.createBufferSource() did not throw an exception. -PASS source.buffer = buffer did not throw an exception. -PASS source.buffer = context.createBuffer(1, 10, context.sampleRate) threw InvalidStateError: "Failed to set the 'buffer' property on 'AudioBufferSourceNode': Cannot set buffer after it has been already been set". -PASS source.start(-1) threw InvalidAccessError: "Failed to execute 'start' on 'AudioBufferSourceNode': The start time provided (-1) is less than the minimum bound (0).". -PASS source.start(Infinity) threw TypeError: "Failed to execute 'start' on 'AudioBufferSourceNode': The provided double value is non-finite.". -PASS source.start(-Infinity) threw TypeError: "Failed to execute 'start' on 'AudioBufferSourceNode': The provided double value is non-finite.". -PASS source.start(NaN) threw TypeError: "Failed to execute 'start' on 'AudioBufferSourceNode': The provided double value is non-finite.". -PASS source.start(1, Infinity) threw TypeError: "Failed to execute 'start' on 'AudioBufferSourceNode': The provided double value is non-finite.". -PASS source.start(1, -Infinity) threw TypeError: "Failed to execute 'start' on 'AudioBufferSourceNode': The provided double value is non-finite.". -PASS source.start(1, NaN) threw TypeError: "Failed to execute 'start' on 'AudioBufferSourceNode': The provided double value is non-finite.". -PASS source.start(1, -1) threw InvalidStateError: "Failed to execute 'start' on 'AudioBufferSourceNode': The offset provided (-1) is less than the minimum bound (0).". -PASS source.start(1, -Number.MIN_VALUE) threw InvalidStateError: "Failed to execute 'start' on 'AudioBufferSourceNode': The offset provided (-4.94066e-324) is less than the minimum bound (0).". -PASS source.start(1, 1, Infinity) threw TypeError: "Failed to execute 'start' on 'AudioBufferSourceNode': The provided double value is non-finite.". -PASS source.start(1, 1, -Infinity) threw TypeError: "Failed to execute 'start' on 'AudioBufferSourceNode': The provided double value is non-finite.". -PASS source.start(1, 1, NaN) threw TypeError: "Failed to execute 'start' on 'AudioBufferSourceNode': The provided double value is non-finite.". -PASS source.start(1, 1, -1) threw InvalidStateError: "Failed to execute 'start' on 'AudioBufferSourceNode': The duration provided (-1) is less than the minimum bound (0).". -PASS source.start(1, 1, -Number.MIN_VALUE) threw InvalidStateError: "Failed to execute 'start' on 'AudioBufferSourceNode': The duration provided (-4.94066e-324) is less than the minimum bound (0).". -PASS source.start() did not throw an exception. -PASS source.stop(-Number.MIN_VALUE) threw InvalidAccessError: "Failed to execute 'stop' on 'AudioScheduledSourceNode': The stop time provided (-4.94066e-324) is less than the minimum bound (0).". -PASS source.stop(Infinity) threw TypeError: "Failed to execute 'stop' on 'AudioScheduledSourceNode': The provided double value is non-finite.". -PASS source.stop(-Infinity) threw TypeError: "Failed to execute 'stop' on 'AudioScheduledSourceNode': The provided double value is non-finite.". -PASS source.stop(NaN) threw TypeError: "Failed to execute 'stop' on 'AudioScheduledSourceNode': The provided double value is non-finite.". -PASS source.stop() did not throw an exception. -PASS source2 = context.createBufferSource() did not throw an exception. -PASS source2.buffer = buffer did not throw an exception. -PASS source2.start(0, 0) did not throw an exception. -PASS source3 = context.createBufferSource() did not throw an exception. -PASS source3.buffer = buffer did not throw an exception. -PASS source3.start(0, -1/Infinity) did not throw an exception. -PASS source4 = context.createBufferSource() did not throw an exception. -PASS source4.start() did not throw an exception. -PASS source5 = context.createBufferSource() did not throw an exception. -PASS source5.buffer = buffer did not throw an exception. -PASS source5.stop() threw InvalidStateError: "Failed to execute 'stop' on 'AudioScheduledSourceNode': cannot call stop without calling start first.". -PASS source6 = context.createBufferSource() did not throw an exception. -PASS source6.buffer = buffer did not throw an exception. -PASS source6.start() did not throw an exception. -PASS source6.start() threw InvalidStateError: "Failed to execute 'start' on 'AudioBufferSourceNode': cannot call start more than once.". -PASS source7 = context.createBufferSource() did not throw an exception. -PASS source7.buffer = buffer did not throw an exception. -PASS source7.start() did not throw an exception. -PASS source7.stop() did not throw an exception. -PASS < [audio-buffer-source] All assertions passed. (total 42 assertions) -PASS > [oscillator] start/stop -PASS source8 = context.createOscillator() did not throw an exception. -PASS source8.start(-Number.MIN_VALUE) threw InvalidAccessError: "Failed to execute 'start' on 'AudioScheduledSourceNode': The start time provided (-4.94066e-324) is less than the minimum bound (0).". -PASS source8.start(Infinity) threw TypeError: "Failed to execute 'start' on 'AudioScheduledSourceNode': The provided double value is non-finite.". -PASS source8.start(-Infinity) threw TypeError: "Failed to execute 'start' on 'AudioScheduledSourceNode': The provided double value is non-finite.". -PASS source8.start(NaN) threw TypeError: "Failed to execute 'start' on 'AudioScheduledSourceNode': The provided double value is non-finite.". -PASS source8.start() did not throw an exception. -PASS source8.stop(-Number.MIN_VALUE) threw InvalidAccessError: "Failed to execute 'stop' on 'AudioScheduledSourceNode': The stop time provided (-4.94066e-324) is less than the minimum bound (0).". -PASS source8.stop(Infinity) threw TypeError: "Failed to execute 'stop' on 'AudioScheduledSourceNode': The provided double value is non-finite.". -PASS source8.stop(-Infinity) threw TypeError: "Failed to execute 'stop' on 'AudioScheduledSourceNode': The provided double value is non-finite.". -PASS source8.stop(NaN) threw TypeError: "Failed to execute 'stop' on 'AudioScheduledSourceNode': The provided double value is non-finite.". -PASS source8.stop() did not throw an exception. -PASS osc = context.createOscillator() did not throw an exception. -PASS osc.stop() threw InvalidStateError: "Failed to execute 'stop' on 'AudioScheduledSourceNode': cannot call stop without calling start first.". -PASS osc1 = context.createOscillator() did not throw an exception. -PASS osc1.start() did not throw an exception. -PASS osc1.stop() did not throw an exception. -PASS osc.setPeriodicWave(null) threw TypeError: "Failed to execute 'setPeriodicWave' on 'OscillatorNode': parameter 1 is not of type 'PeriodicWave'.". -PASS < [oscillator] All assertions passed. (total 17 assertions) -PASS > [convolver] -PASS oc = new OfflineAudioContext(1, 44100, 44100) did not throw an exception. -PASS conv = oc.createConvolver() did not throw an exception. -PASS conv.buffer = {} threw TypeError: "Failed to set the 'buffer' property on 'ConvolverNode': The provided value is not of type 'AudioBuffer'.". -PASS conv.buffer = oc.createBuffer(1, 100, 22050) threw NotSupportedError: "Failed to set the 'buffer' property on 'ConvolverNode': The buffer sample rate of 22050 does not match the context rate of 44100 Hz.". -PASS conv.buffer is equal to ${expected}. -PASS < [convolver] All assertions passed. (total 5 assertions) -PASS > [panner] -PASS panner.channelCount = 1 did not throw an exception. -PASS panner.channelCount = 2 did not throw an exception. -PASS PannerNode.channelCount = 0 threw NotSupportedError: "Failed to set the 'channelCount' property on 'AudioNode': The channelCount provided (0) is outside the range [1, 2].". -PASS PannerNode.channelCount is not equal to 0. -PASS PannerNode.channelCount = 3 threw NotSupportedError: "Failed to set the 'channelCount' property on 'AudioNode': The channelCount provided (3) is outside the range [1, 2].". -PASS PannerNode.channelCount is not equal to 3. -PASS PannerNode.channelCountMode = max threw NotSupportedError: "Failed to set the 'channelCountMode' property on 'AudioNode': Panner: 'max' is not allowed". -PASS PannerNode.channelCountMode is not equal to max. -PASS panner.channelCountMode = "explicit" did not throw an exception. -PASS panner.channelCountMode = "clamped-max" did not throw an exception. -PASS panner.channelCountMode = "junk" did not throw an exception. -PASS < [panner] All assertions passed. (total 11 assertions) -PASS > [script-processor] -PASS script = context.createScriptProcessor(256, 3) did not throw an exception. -PASS script.channelCount is equal to 3. -PASS script.channelCountMode is equal to explicit. -PASS script.channelCount = 3 did not throw an exception. -PASS ScriptProcessorNode.channelCount = 1 threw NotSupportedError: "Failed to set the 'channelCount' property on 'AudioNode': channelCount cannot be changed from 3 to 1". -PASS ScriptProcessorNode.channelCount is not equal to 1. -PASS ScriptProcessorNode.channelCount = 7 threw NotSupportedError: "Failed to set the 'channelCount' property on 'AudioNode': channelCount cannot be changed from 3 to 7". -PASS ScriptProcessorNode.channelCount is not equal to 7. -PASS script.channelCountMode = "explicit" did not throw an exception. -PASS ScriptProcessorNode.channelCountMode = max threw NotSupportedError: "Failed to set the 'channelCountMode' property on 'AudioNode': channelCountMode cannot be changed from 'explicit' to 'max'". -PASS ScriptProcessorNode.channelCountMode is not equal to max. -PASS ScriptProcessorNode.channelCountMode = clamped-max threw NotSupportedError: "Failed to set the 'channelCountMode' property on 'AudioNode': channelCountMode cannot be changed from 'explicit' to 'clamped-max'". -PASS ScriptProcessorNode.channelCountMode is not equal to clamped-max. -PASS script.channelCountMode = "junk" did not throw an exception. -PASS < [script-processor] All assertions passed. (total 14 assertions) -PASS > [misc] Miscellaneous tests -PASS osc.noteOn is equal to undefined. -PASS osc.noteOff is equal to undefined. -PASS source.noteOn is equal to undefined. -PASS source.noteOff is equal to undefined. -PASS < [misc] All assertions passed. (total 4 assertions) -PASS # AUDIT TASK RUNNER FINISHED: 22 tasks ran successfully. -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/webmidi/README.txt b/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/webmidi/README.txt deleted file mode 100644 index de49eb0..0000000 --- a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/webmidi/README.txt +++ /dev/null
@@ -1,3 +0,0 @@ -# This suite runs the tests in --js-flags=--harmony-sharedarraybuffer -# This enables the SharedArrayBuffer language feature in V8. -# See https://github.com/tc39/ecmascript_sharedmem for more information.
diff --git a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/webmidi/send-messages-expected.txt b/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/webmidi/send-messages-expected.txt deleted file mode 100644 index 27b298d..0000000 --- a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/webmidi/send-messages-expected.txt +++ /dev/null
@@ -1,48 +0,0 @@ -Test if various kinds of MIDI messages can be validated. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - - -PASS navigator.requestMIDIAccess is defined. -PASS output.send([0x00, 0x01]) threw exception TypeError: Failed to execute 'send' on 'MIDIOutput': Running status is not allowed at index 0 (0).. -PASS output.send([0xf7]) threw exception TypeError: Failed to execute 'send' on 'MIDIOutput': Unexpected end of system exclusive message at index 0 (247).. -PASS output.send([0xf4]) threw exception TypeError: Failed to execute 'send' on 'MIDIOutput': Reserved status is not allowed at index 0 (244).. -PASS output.send([0xf5]) threw exception TypeError: Failed to execute 'send' on 'MIDIOutput': Reserved status is not allowed at index 0 (245).. -PASS output.send([0xf9]) threw exception TypeError: Failed to execute 'send' on 'MIDIOutput': Reserved status is not allowed at index 0 (249).. -PASS output.send([0xfd]) threw exception TypeError: Failed to execute 'send' on 'MIDIOutput': Reserved status is not allowed at index 0 (253).. -PASS output.send([0x80]) threw exception TypeError: Failed to execute 'send' on 'MIDIOutput': Message is incomplete.. -PASS output.send([0x80, 0x00]) threw exception TypeError: Failed to execute 'send' on 'MIDIOutput': Message is incomplete.. -PASS output.send([0x90]) threw exception TypeError: Failed to execute 'send' on 'MIDIOutput': Message is incomplete.. -PASS output.send([0x90, 0x00]) threw exception TypeError: Failed to execute 'send' on 'MIDIOutput': Message is incomplete.. -PASS output.send([0xa0]) threw exception TypeError: Failed to execute 'send' on 'MIDIOutput': Message is incomplete.. -PASS output.send([0xa0, 0x00]) threw exception TypeError: Failed to execute 'send' on 'MIDIOutput': Message is incomplete.. -PASS output.send([0xb0]) threw exception TypeError: Failed to execute 'send' on 'MIDIOutput': Message is incomplete.. -PASS output.send([0xb0, 0x00]) threw exception TypeError: Failed to execute 'send' on 'MIDIOutput': Message is incomplete.. -PASS output.send([0xc0]) threw exception TypeError: Failed to execute 'send' on 'MIDIOutput': Message is incomplete.. -PASS output.send([0xd0]) threw exception TypeError: Failed to execute 'send' on 'MIDIOutput': Message is incomplete.. -PASS output.send([0xe0]) threw exception TypeError: Failed to execute 'send' on 'MIDIOutput': Message is incomplete.. -PASS output.send([0xe0, 0x00]) threw exception TypeError: Failed to execute 'send' on 'MIDIOutput': Message is incomplete.. -PASS output.send([0xf1]) threw exception TypeError: Failed to execute 'send' on 'MIDIOutput': Message is incomplete.. -PASS output.send([0xf2]) threw exception TypeError: Failed to execute 'send' on 'MIDIOutput': Message is incomplete.. -PASS output.send([0xf2, 0x00]) threw exception TypeError: Failed to execute 'send' on 'MIDIOutput': Message is incomplete.. -PASS output.send([0xf3]) threw exception TypeError: Failed to execute 'send' on 'MIDIOutput': Message is incomplete.. -PASS output.send([0x80, 0x80, 0x00]) threw exception TypeError: Failed to execute 'send' on 'MIDIOutput': Unexpected status byte at index 1 (128).. -PASS output.send([0x80, 0x00, 0x80]) threw exception TypeError: Failed to execute 'send' on 'MIDIOutput': Unexpected status byte at index 2 (128).. -PASS output.send([0xf0, 0x80, 0xf7]) threw exception TypeError: Failed to execute 'send' on 'MIDIOutput': System exclusive message contains a status byte at index 1 (128).. -PASS output.send([0xf0, 0xf0, 0xf7]) threw exception TypeError: Failed to execute 'send' on 'MIDIOutput': System exclusive message contains a status byte at index 1 (240).. -PASS output.send([0xf0, 0xff, 0xf7, 0xf7]) threw exception TypeError: Failed to execute 'send' on 'MIDIOutput': Unexpected end of system exclusive message at index 3 (247).. -PASS output.send([0xf4, 0x80, 0x00, 0x00]) threw exception TypeError: Failed to execute 'send' on 'MIDIOutput': Reserved status is not allowed at index 0 (244).. -PASS output.send([0x80, 0xf4, 0x00, 0x00]) threw exception TypeError: Failed to execute 'send' on 'MIDIOutput': Unexpected status byte at index 1 (244).. -PASS output.send([0x80, 0x00, 0xf4, 0x00]) threw exception TypeError: Failed to execute 'send' on 'MIDIOutput': Unexpected status byte at index 2 (244).. -PASS output.send([0x80, 0x00, 0x00, 0xf4]) threw exception TypeError: Failed to execute 'send' on 'MIDIOutput': Reserved status is not allowed at index 3 (244).. -PASS output.send([0xf0, 0xff, 0xf4, 0xf7]) threw exception TypeError: Failed to execute 'send' on 'MIDIOutput': System exclusive message contains a status byte at index 2 (244).. -PASS output.send([], NaN) threw exception TypeError: Failed to execute 'send' on 'MIDIOutput': The provided double value is non-finite.. -PASS output.send([], Infinity) threw exception TypeError: Failed to execute 'send' on 'MIDIOutput': The provided double value is non-finite.. -PASS output.send(new Uint8Array(), NaN) threw exception TypeError: Failed to execute 'send' on 'MIDIOutput': The provided double value is non-finite.. -PASS output.send(new Uint8Array(), Infinity) threw exception TypeError: Failed to execute 'send' on 'MIDIOutput': The provided double value is non-finite.. -PASS output.send(new Uint8Array(new SharedArrayBuffer(4))) threw exception TypeError: Failed to execute 'send' on 'MIDIOutput': The provided ArrayBufferView value must not be shared.. -PASS output.send(new Uint8Array(new SharedArrayBuffer(4), 0)) threw exception TypeError: Failed to execute 'send' on 'MIDIOutput': The provided ArrayBufferView value must not be shared.. -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/WebKit/LayoutTests/webaudio/AudioBuffer/audiobuffer-copy-channel.html b/third_party/WebKit/LayoutTests/webaudio/AudioBuffer/audiobuffer-copy-channel.html index dfd55bdd..2b1db0a 100644 --- a/third_party/WebKit/LayoutTests/webaudio/AudioBuffer/audiobuffer-copy-channel.html +++ b/third_party/WebKit/LayoutTests/webaudio/AudioBuffer/audiobuffer-copy-channel.html
@@ -146,19 +146,6 @@ }, "7: buffer.copyFromChannel(x, 3)") .throw("IndexSizeError"); - if (window.SharedArrayBuffer) { - var shared_buffer = new Float32Array(new SharedArrayBuffer(32)); - should(() => { - buffer.copyFromChannel(shared_buffer, 0); - }, "8: buffer.copyFromChannel(SharedArrayBuffer view, 0)") - .throw("TypeError"); - - should(() => { - buffer.copyFromChannel(shared_buffer, 0, 0); - }, "9: buffer.copyFromChannel(SharedArrayBuffer view, 0, 0)") - .throw("TypeError"); - } - task.done(); }); @@ -197,19 +184,6 @@ }, "6: buffer.copyToChannel(x, 3)") .throw("IndexSizeError"); - if (window.SharedArrayBuffer) { - var shared_buffer = new Float32Array(new SharedArrayBuffer(32)); - should(() => { - buffer.copyToChannel(shared_buffer, 0); - }, "7: buffer.copyToChannel(SharedArrayBuffer view, 0)") - .throw("TypeError"); - - should(() => { - buffer.copyToChannel(shared_buffer, 0, 0); - }, "8: buffer.copyToChannel(SharedArrayBuffer view, 0, 0)") - .throw("TypeError"); - } - task.done(); });
diff --git a/third_party/WebKit/LayoutTests/webaudio/IIRFilter/iirfilter-basic.html b/third_party/WebKit/LayoutTests/webaudio/IIRFilter/iirfilter-basic.html index 9c693e4..43ffe81 100644 --- a/third_party/WebKit/LayoutTests/webaudio/IIRFilter/iirfilter-basic.html +++ b/third_party/WebKit/LayoutTests/webaudio/IIRFilter/iirfilter-basic.html
@@ -188,27 +188,6 @@ 30)); }).notThrow() && success; - if (window.SharedArrayBuffer) { - var shared_view = new Float32Array(new SharedArrayBuffer(4)); - var nonshared_view = new Float32Array(1); - - success = Should( - "getFrequencyResponse(shared_view, nonshared_view, nonshared_view)", - function () { - f.getFrequencyResponse(shared_view, nonshared_view, nonshared_view); - }).throw("TypeError") && success; - success = Should( - "getFrequencyResponse(nonshared_view, shared_view, nonshared_view)", - function () { - f.getFrequencyResponse(nonshared_view, shared_view, nonshared_view); - }).throw("TypeError") && success; - success = Should( - "getFrequencyResponse(nonshared_view, nonshared_view, shared_view)", - function () { - f.getFrequencyResponse(nonshared_view, nonshared_view, shared_view); - }).throw("TypeError") && success; - } - Should("getFrequencyResponse exceptions handled", success) .summarize("correctly", "incorrectly"); done();
diff --git a/third_party/WebKit/LayoutTests/webaudio/constructor/waveshaper.html b/third_party/WebKit/LayoutTests/webaudio/constructor/waveshaper.html index 2968b1c..40c2624 100644 --- a/third_party/WebKit/LayoutTests/webaudio/constructor/waveshaper.html +++ b/third_party/WebKit/LayoutTests/webaudio/constructor/waveshaper.html
@@ -96,17 +96,6 @@ taskDone(); }); - if (window.SharedArrayBuffer) { - audit.defineTask("invalid setCurve", function (taskDone) { - var node = new WaveShaperNode(context); - - Should("WaveShaper.curve = SharedArrayBuffer view", function () { - node.curve = new Float32Array(new SharedArrayBuffer(16)); - }).throw("TypeError"); - taskDone(); - }); - } - audit.runTasks(); </script> </body>
diff --git a/third_party/WebKit/LayoutTests/webaudio/dom-exceptions-expected.txt b/third_party/WebKit/LayoutTests/webaudio/dom-exceptions-expected.txt index 34e9429b..b2b85c9 100644 --- a/third_party/WebKit/LayoutTests/webaudio/dom-exceptions-expected.txt +++ b/third_party/WebKit/LayoutTests/webaudio/dom-exceptions-expected.txt
@@ -1,8 +1,8 @@ -CONSOLE WARNING: line 341: The provided value 'fancy' is not a valid enum value of type ChannelCountMode. -CONSOLE WARNING: line 347: The provided value 'undefined' is not a valid enum value of type ChannelInterpretation. -CONSOLE WARNING: line 502: The provided value '9x' is not a valid enum value of type OverSampleType. -CONSOLE WARNING: line 717: The provided value 'junk' is not a valid enum value of type ChannelCountMode. -CONSOLE WARNING: line 746: The provided value 'junk' is not a valid enum value of type ChannelCountMode. +CONSOLE WARNING: line 308: The provided value 'fancy' is not a valid enum value of type ChannelCountMode. +CONSOLE WARNING: line 314: The provided value 'undefined' is not a valid enum value of type ChannelInterpretation. +CONSOLE WARNING: line 444: The provided value '9x' is not a valid enum value of type OverSampleType. +CONSOLE WARNING: line 659: The provided value 'junk' is not a valid enum value of type ChannelCountMode. +CONSOLE WARNING: line 688: The provided value 'junk' is not a valid enum value of type ChannelCountMode. This is a testharness.js-based test. PASS # AUDIT TASK RUNNER STARTED. PASS > [initialize] Initialize contexts for testing
diff --git a/third_party/WebKit/LayoutTests/webaudio/dom-exceptions.html b/third_party/WebKit/LayoutTests/webaudio/dom-exceptions.html index 72a36d1f..436fd83a 100644 --- a/third_party/WebKit/LayoutTests/webaudio/dom-exceptions.html +++ b/third_party/WebKit/LayoutTests/webaudio/dom-exceptions.html
@@ -2,7 +2,7 @@ <html> <head> <script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> +<script src="../resources/testharnessreport.js"></script> <script src="resources/audit-util.js"></script> <script src="resources/audit.js"></script> <script src="resources/biquad-testing.js"></script> @@ -197,20 +197,6 @@ 'context.createPeriodicWave(new Float32Array(10), new Float32Array(7))') .throw('IndexSizeError'); - if (window.SharedArrayBuffer) { - let shared_view = new Float32Array(new SharedArrayBuffer(4100 * 4)); - let nonshared_view = new Float32Array(4100); - should( - () => context.createPeriodicWave(shared_view, nonshared_view), - 'context.createPeriodicWave(shared_view, nonshared_view)') - .throw('TypeError'); - - should( - () => context.createPeriodicWave(nonshared_view, shared_view), - 'context.createPeriodicWave(nonshared_view, shared_view)') - .throw('TypeError'); - } - task.done(); }); @@ -248,25 +234,6 @@ node.constructor.name + '.getByteTimeDomainData(null)') .throw(); - if (window.SharedArrayBuffer) { - should( - () => node.getFloatFrequencyData(new Float32Array(new SharedArrayBuffer(16))), - 'AnalyserNode.getFloatFrequencyData(SharedArrayBuffer view)') - .throw(); - should( - () => node.getByteFrequencyData(new Uint8Array(new SharedArrayBuffer(16))), - node.constructor.name + '.getByteFrequencyData(SharedArrayBuffer view)') - .throw(); - should( - () => node.getFloatTimeDomainData(new Float32Array(new SharedArrayBuffer(16))), - node.constructor.name + '.getFloatTimeDomainData(SharedArrayBuffer view)') - .throw(); - should( - () => node.getByteTimeDomainData(new Uint8Array(new SharedArrayBuffer(16))), - node.constructor.name + '.getByteTimeDomainData(SharedArrayBuffer view)') - .throw(); - } - // AudioBuffers node = context.createBuffer(1, 1, context.sampleRate); // Invalid channel index: IndexSizeError @@ -369,13 +336,6 @@ 'param.setValueCurveAtTime(null, 0, 0)') .throw(); - if (window.SharedArrayBuffer) { - should( - () => param.setValueCurveAtTime(new Float32Array(new SharedArrayBuffer(16)), 0, 0), - 'param.setValueCurveAtTime(SharedArrayBuffer view, 0, 0)') - .throw(); - } - // exponentialRampToValue should throw only for "zero" target values. should( () => node.gain.exponentialRampToValueAtTime(-1, 0.1), @@ -436,24 +396,6 @@ 'node.getFrequencyResponse(new Float32Array(1), new Float32Array(1), null)') .throw(); - if (window.SharedArrayBuffer) { - let shared_view = new Float32Array(new SharedArrayBuffer(4)); - let nonshared_view = new Float32Array(1); - - should( - () => node.getFrequencyResponse(shared_view, nonshared_view, nonshared_view), - 'node.getFrequencyResponse(shared_view, nonshared_view, nonshared_view)') - .throw(); - should( - () => node.getFrequencyResponse(nonshared_view, shared_view, nonshared_view), - 'node.getFrequencyResponse(nonshared_view, shared_view, nonshared_view)') - .throw(); - should( - () => node.getFrequencyResponse(nonshared_view, nonshared_view, shared_view), - 'node.getFrequencyResponse(nonshared_view, nonshared_view, shared_view)') - .throw(); - } - task.done(); });
diff --git a/third_party/WebKit/LayoutTests/webmidi/send-messages.html b/third_party/WebKit/LayoutTests/webmidi/send-messages.html index 53d9367..2073dce 100644 --- a/third_party/WebKit/LayoutTests/webmidi/send-messages.html +++ b/third_party/WebKit/LayoutTests/webmidi/send-messages.html
@@ -98,11 +98,6 @@ shouldThrow('output.send(new Uint8Array(), NaN)'); shouldThrow('output.send(new Uint8Array(), Infinity)'); - if (window.SharedArrayBuffer) { - shouldThrow('output.send(new Uint8Array(new SharedArrayBuffer(4)))'); - shouldThrow('output.send(new Uint8Array(new SharedArrayBuffer(4), 0))'); - } - finishJSTest(); }).catch(function () { testFailed("requestMIDIAccess() return an error.");
diff --git a/third_party/WebKit/Source/bindings/core/v8/ToV8.h b/third_party/WebKit/Source/bindings/core/v8/ToV8.h index e96c472b..b443d20 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ToV8.h +++ b/third_party/WebKit/Source/bindings/core/v8/ToV8.h
@@ -17,7 +17,6 @@ #include "bindings/core/v8/ScriptWrappable.h" #include "bindings/core/v8/V8Binding.h" #include "core/CoreExport.h" -#include "core/dom/NotShared.h" #include "platform/heap/Handle.h" #include "platform/wtf/Forward.h" #include "v8/include/v8.h" @@ -276,13 +275,6 @@ return object; } -template <typename T> -inline v8::Local<v8::Value> ToV8(NotShared<T> value, - v8::Local<v8::Object> creation_context, - v8::Isolate* isolate) { - return ToV8(value.View(), creation_context, isolate); -} - template <typename Sequence> inline v8::Local<v8::Value> ToV8SequenceInternal( const Sequence& sequence,
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8Binding.h b/third_party/WebKit/Source/bindings/core/v8/V8Binding.h index a1f218f..208eee28 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8Binding.h +++ b/third_party/WebKit/Source/bindings/core/v8/V8Binding.h
@@ -47,7 +47,6 @@ #include "bindings/core/v8/V8ThrowException.h" #include "bindings/core/v8/V8ValueCache.h" #include "core/CoreExport.h" -#include "core/dom/NotShared.h" #include "platform/heap/Handle.h" #include "platform/wtf/text/AtomicString.h" #include "platform/wtf/text/StringView.h" @@ -217,12 +216,6 @@ V8SetReturnValue(callback_info, impl.Get()); } -template <typename CallbackInfo, typename T> -inline void V8SetReturnValue(const CallbackInfo& callbackInfo, - NotShared<T> notShared) { - V8SetReturnValue(callbackInfo, notShared.View()); -} - template <typename CallbackInfo> inline void V8SetReturnValueForMainWorld(const CallbackInfo& callback_info, ScriptWrappable* impl) { @@ -341,13 +334,6 @@ V8SetReturnValue(callback_info, handle); } -template <typename CallbackInfo, typename T> -inline void V8SetReturnValueFast(const CallbackInfo& callbackInfo, - NotShared<T> notShared, - const ScriptWrappable* wrappable) { - V8SetReturnValueFast(callbackInfo, notShared.View(), wrappable); -} - // Convert v8::String to a WTF::String. If the V8 string is not already // an external string then it is transformed into an external string at this // point to avoid repeated conversions. @@ -1177,25 +1163,6 @@ CORE_EXPORT v8::Local<v8::Value> FromJSONString(v8::Isolate*, const String& stringified_json, ExceptionState&); - -// Ensure that a typed array value is not backed by a SharedArrayBuffer. If it -// is, an exception will be thrown. The return value will use the NotShared -// wrapper type. -template <typename NotSharedType> -NotSharedType ToNotShared(v8::Isolate* isolate, - v8::Local<v8::Value> value, - ExceptionState& exception_state) { - using DOMTypedArray = typename NotSharedType::TypedArrayType; - DOMTypedArray* dom_typed_array = - V8TypeOf<DOMTypedArray>::Type::toImplWithTypeCheck(isolate, value); - if (dom_typed_array && dom_typed_array->IsShared()) { - exception_state.ThrowTypeError( - "The provided ArrayBufferView value must not be shared."); - return NotSharedType(); - } - return NotSharedType(dom_typed_array); -} - } // namespace blink #endif // V8Binding_h
diff --git a/third_party/WebKit/Source/bindings/scripts/v8_attributes.py b/third_party/WebKit/Source/bindings/scripts/v8_attributes.py index 2ab1aecf1..ecc6277f 100644 --- a/third_party/WebKit/Source/bindings/scripts/v8_attributes.py +++ b/third_party/WebKit/Source/bindings/scripts/v8_attributes.py
@@ -286,13 +286,8 @@ cpp_value, extended_attributes=extended_attributes, script_wrappable='impl', for_main_world=for_main_world, is_static=attribute.is_static) - cpp_value_to_script_wrappable = cpp_value - if idl_type.is_array_buffer_view_or_typed_array: - cpp_value_to_script_wrappable += '.View()' - context.update({ 'cpp_value': cpp_value, - 'cpp_value_to_script_wrappable': cpp_value_to_script_wrappable, 'cpp_value_to_v8_value': idl_type.cpp_value_to_v8_value( cpp_value=cpp_value, creation_context='holder', extended_attributes=extended_attributes), @@ -323,8 +318,7 @@ expression = '%s(%s)' % (getter_name, ', '.join(arguments)) # Needed to handle getter expressions returning Type& as the # use site for |expression| expects Type*. - if (attribute.idl_type.is_interface_type and len(arguments) == 0 and - not attribute.idl_type.is_array_buffer_view_or_typed_array): + if attribute.idl_type.is_interface_type and len(arguments) == 0: return 'WTF::GetPtr(%s)' % expression return expression
diff --git a/third_party/WebKit/Source/bindings/scripts/v8_dictionary.py b/third_party/WebKit/Source/bindings/scripts/v8_dictionary.py index 92d310d..66fd18f 100644 --- a/third_party/WebKit/Source/bindings/scripts/v8_dictionary.py +++ b/third_party/WebKit/Source/bindings/scripts/v8_dictionary.py
@@ -231,10 +231,6 @@ else: header_includes.update(idl_type.impl_includes_for_type(interfaces_info)) - setter_value = 'value' - if idl_type.is_array_buffer_view_or_typed_array: - setter_value += '.View()' - return { 'cpp_default_value': cpp_default_value, 'cpp_name': cpp_name, @@ -249,5 +245,4 @@ 'nullable_indicator_name': nullable_indicator_name, 'rvalue_cpp_type': idl_type.cpp_type_args(used_as_rvalue_type=True), 'setter_name': setter_name_for_dictionary_member(member), - 'setter_value': setter_value, }
diff --git a/third_party/WebKit/Source/bindings/scripts/v8_types.py b/third_party/WebKit/Source/bindings/scripts/v8_types.py index 32c6b85..3e3cf39 100644 --- a/third_party/WebKit/Source/bindings/scripts/v8_types.py +++ b/third_party/WebKit/Source/bindings/scripts/v8_types.py
@@ -74,9 +74,6 @@ 'Uint16Array', 'Uint32Array', ]) -ARRAY_BUFFER_VIEW_AND_TYPED_ARRAY_TYPES = TYPED_ARRAY_TYPES.union(frozenset([ - 'ArrayBufferView' -])) ARRAY_BUFFER_AND_VIEW_TYPES = TYPED_ARRAY_TYPES.union(frozenset([ 'ArrayBuffer', 'ArrayBufferView', @@ -88,9 +85,6 @@ IdlType.is_array_buffer_or_view = property( lambda self: self.base_type in ARRAY_BUFFER_AND_VIEW_TYPES) -IdlType.is_array_buffer_view_or_typed_array = property( - lambda self: self.base_type in ARRAY_BUFFER_VIEW_AND_TYPED_ARRAY_TYPES) - IdlType.is_typed_array = property( lambda self: self.base_type in TYPED_ARRAY_TYPES) @@ -208,9 +202,6 @@ return 'FlexibleArrayBufferView' if base_idl_type in TYPED_ARRAY_TYPES and 'FlexibleArrayBufferView' in extended_attributes: return 'Flexible' + base_idl_type + 'View' - if base_idl_type in ARRAY_BUFFER_VIEW_AND_TYPED_ARRAY_TYPES: - if not used_in_cpp_sequence: - return cpp_template_type('NotShared', idl_type.implemented_as) if idl_type.is_interface_type: implemented_as_class = idl_type.implemented_as if raw_type or (used_as_rvalue_type and idl_type.is_garbage_collected) or not used_in_cpp_sequence: @@ -352,7 +343,6 @@ INCLUDES_FOR_TYPE = { 'object': set(), 'ArrayBufferView': set(['bindings/core/v8/V8ArrayBufferView.h', - 'core/dom/NotShared.h', 'core/dom/FlexibleArrayBufferView.h']), 'Dictionary': set(['bindings/core/v8/Dictionary.h']), 'EventHandler': set(['bindings/core/v8/V8AbstractEventListener.h', @@ -469,8 +459,8 @@ includes_for_type.add(interface_info['include_path']) if base_idl_type in INCLUDES_FOR_TYPE: includes_for_type.update(INCLUDES_FOR_TYPE[base_idl_type]) - if idl_type.is_array_buffer_view_or_typed_array: - return set(['core/dom/DOMTypedArray.h', 'core/dom/NotShared.h']) + if idl_type.is_typed_array: + return set(['core/dom/DOMTypedArray.h']) return includes_for_type @@ -529,7 +519,6 @@ return (idl_type.is_numeric_type or idl_type.is_enum or idl_type.is_dictionary or - idl_type.is_array_buffer_view_or_typed_array or idl_type.name in ('Boolean', 'ByteString', 'Date', 'Dictionary', 'USVString', 'SerializedScriptValue')) IdlType.v8_conversion_needs_exception_state = property(v8_conversion_needs_exception_state) @@ -592,7 +581,7 @@ base_idl_type = idl_type.as_union_type.name if idl_type.is_union_type else idl_type.base_type if 'FlexibleArrayBufferView' in extended_attributes: - if base_idl_type not in ARRAY_BUFFER_VIEW_AND_TYPED_ARRAY_TYPES: + if base_idl_type not in TYPED_ARRAY_TYPES.union(set(['ArrayBufferView'])): raise ValueError("Unrecognized base type for extended attribute 'FlexibleArrayBufferView': %s" % (idl_type.base_type)) base_idl_type = 'FlexibleArrayBufferView' @@ -610,13 +599,10 @@ if base_idl_type in V8_VALUE_TO_CPP_VALUE: cpp_expression_format = V8_VALUE_TO_CPP_VALUE[base_idl_type] - elif idl_type.name == 'ArrayBuffer': + elif idl_type.is_array_buffer_or_view: cpp_expression_format = ( '{v8_value}->Is{idl_type}() ? ' 'V8{idl_type}::toImpl(v8::Local<v8::{idl_type}>::Cast({v8_value})) : 0') - elif idl_type.is_array_buffer_view_or_typed_array: - this_cpp_type = idl_type.cpp_type - cpp_expression_format = ('ToNotShared<%s>({isolate}, {v8_value}, exceptionState)' % this_cpp_type) elif idl_type.is_union_type: nullable = 'UnionTypeConversionMode::kNullable' if idl_type.includes_nullable_type \ else 'UnionTypeConversionMode::kNotNullable' @@ -691,11 +677,7 @@ # meaningful if 'check_expression' is not None. return_expression = bailout_return_value - if 'FlexibleArrayBufferView' in extended_attributes: - if idl_type.base_type not in ARRAY_BUFFER_VIEW_AND_TYPED_ARRAY_TYPES: - raise ValueError("Unrecognized base type for extended attribute 'FlexibleArrayBufferView': %s" % (idl_type.base_type)) - set_expression = cpp_value - elif idl_type.is_string_type or idl_type.v8_conversion_needs_exception_state: + if idl_type.is_string_type or idl_type.v8_conversion_needs_exception_state: # Types for which conversion can fail and that need error handling. check_expression = 'exceptionState.HadException()' @@ -717,6 +699,10 @@ return { 'error_message': 'no V8 -> C++ conversion for IDL type: %s' % idl_type.name } + elif 'FlexibleArrayBufferView' in extended_attributes: + if idl_type.base_type not in TYPED_ARRAY_TYPES.union(set(['ArrayBufferView'])): + raise ValueError("Unrecognized base type for extended attribute 'FlexibleArrayBufferView': %s" % (idl_type.base_type)) + set_expression = cpp_value else: assign_expression = cpp_value
diff --git a/third_party/WebKit/Source/bindings/scripts/v8_union.py b/third_party/WebKit/Source/bindings/scripts/v8_union.py index 1723495..35477a1a 100644 --- a/third_party/WebKit/Source/bindings/scripts/v8_union.py +++ b/third_party/WebKit/Source/bindings/scripts/v8_union.py
@@ -129,7 +129,7 @@ cpp_includes.update(interface_info.get( 'dependencies_include_paths', [])) # We need complete types for IDL dictionaries in union containers. - if member.is_dictionary or member.is_array_buffer_view_or_typed_array: + if member.is_dictionary or member.is_typed_array: header_includes.update(member.includes_for_type()) else: cpp_includes.update(member.includes_for_type()) @@ -161,7 +161,6 @@ creation_context='creationContext'), 'enum_values': member.enum_values, 'is_array_buffer_or_view_type': member.is_array_buffer_or_view, - 'is_array_buffer_view_or_typed_array': member.is_array_buffer_view_or_typed_array, 'is_traceable': member.is_traceable, 'rvalue_cpp_type': member.cpp_type_args(used_as_rvalue_type=True), 'specific_type_enum': 'SpecificType' + member.name,
diff --git a/third_party/WebKit/Source/bindings/templates/attributes.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/attributes.cpp.tmpl index 93dd7c8..55fa01b 100644 --- a/third_party/WebKit/Source/bindings/templates/attributes.cpp.tmpl +++ b/third_party/WebKit/Source/bindings/templates/attributes.cpp.tmpl
@@ -151,9 +151,9 @@ {% if attribute.is_keep_alive_for_gc %} // Keep the wrapper object for the return value alive as long as |this| // object is alive in order to save creation time of the wrapper object. - if ({{attribute.cpp_value}} && DOMDataStore::SetReturnValue{{world_suffix}}(info.GetReturnValue(), {{attribute.cpp_value_to_script_wrappable}})) + if ({{attribute.cpp_value}} && DOMDataStore::SetReturnValue{{world_suffix}}(info.GetReturnValue(), {{attribute.cpp_value}})) return; - v8::Local<v8::Value> v8Value(ToV8({{attribute.cpp_value_to_script_wrappable}}, holder, info.GetIsolate())); + v8::Local<v8::Value> v8Value(ToV8({{attribute.cpp_value}}, holder, info.GetIsolate())); V8PrivateProperty::GetSymbol( info.GetIsolate(), "KeepAlive#{{interface_name}}#{{attribute.name}}") .Set(holder, v8Value);
diff --git a/third_party/WebKit/Source/bindings/templates/dictionary_impl.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/dictionary_impl.cpp.tmpl index dc7b9af..f9865bb 100644 --- a/third_party/WebKit/Source/bindings/templates/dictionary_impl.cpp.tmpl +++ b/third_party/WebKit/Source/bindings/templates/dictionary_impl.cpp.tmpl
@@ -33,7 +33,7 @@ return {{member.getter_expression}}; } void {{cpp_class}}::{{member.setter_name}}({{member.rvalue_cpp_type}} value) { - m_{{member.cpp_name}} = {{member.setter_value}}; + m_{{member.cpp_name}} = value; {% if member.nullable_indicator_name %} {{member.nullable_indicator_name}} = true; {% endif %}
diff --git a/third_party/WebKit/Source/bindings/templates/union_container.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/union_container.cpp.tmpl index e361c1b..02dca6c 100644 --- a/third_party/WebKit/Source/bindings/templates/union_container.cpp.tmpl +++ b/third_party/WebKit/Source/bindings/templates/union_container.cpp.tmpl
@@ -7,13 +7,7 @@ {% else %} if (V8{{member.type_name}}::hasInstance(v8Value, isolate)) { {% endif %} -{% if member.is_array_buffer_view_or_typed_array %} - {{member.cpp_local_type}} cppValue = ToNotShared<{{member.cpp_local_type}}>(isolate, v8Value, exceptionState); - if (exceptionState.HadException()) - return; -{% else %} {{member.cpp_local_type}} cppValue = V8{{member.type_name}}::toImpl(v8::Local<v8::Object>::Cast(v8Value)); -{% endif %} impl.set{{member.type_name}}(cppValue); return; } @@ -47,11 +41,7 @@ return; } {% endif %} - {% if member.is_array_buffer_view_or_typed_array %} - m_{{member.cpp_name}} = {{member.cpp_type}}(value.View()); - {% else %} m_{{member.cpp_name}} = value; - {% endif %} m_type = {{member.specific_type_enum}}; }
diff --git a/third_party/WebKit/Source/bindings/tests/idls/core/TestObject.idl b/third_party/WebKit/Source/bindings/tests/idls/core/TestObject.idl index 704db79..3757b87 100644 --- a/third_party/WebKit/Source/bindings/tests/idls/core/TestObject.idl +++ b/third_party/WebKit/Source/bindings/tests/idls/core/TestObject.idl
@@ -285,7 +285,6 @@ // Typed arrays ArrayBuffer arrayBufferMethod(); ArrayBufferView arrayBufferViewMethod(); - [RaisesException] ArrayBufferView arrayBufferViewMethodRaisesException(); Float32Array float32ArrayMethod(); Int32Array int32ArrayMethod(); Uint8Array uint8ArrayMethod();
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/ArrayBufferOrArrayBufferViewOrDictionary.cpp b/third_party/WebKit/Source/bindings/tests/results/core/ArrayBufferOrArrayBufferViewOrDictionary.cpp index f38af45..ec2b13a3 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/ArrayBufferOrArrayBufferViewOrDictionary.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/ArrayBufferOrArrayBufferViewOrDictionary.cpp
@@ -14,6 +14,8 @@ #include "bindings/core/v8/Dictionary.h" #include "bindings/core/v8/ToV8.h" #include "bindings/core/v8/V8ArrayBuffer.h" +#include "bindings/core/v8/V8ArrayBufferView.h" +#include "core/dom/FlexibleArrayBufferView.h" namespace blink { @@ -36,18 +38,18 @@ return container; } -NotShared<TestArrayBufferView> ArrayBufferOrArrayBufferViewOrDictionary::getAsArrayBufferView() const { +TestArrayBufferView* ArrayBufferOrArrayBufferViewOrDictionary::getAsArrayBufferView() const { DCHECK(isArrayBufferView()); return m_arrayBufferView; } -void ArrayBufferOrArrayBufferViewOrDictionary::setArrayBufferView(NotShared<TestArrayBufferView> value) { +void ArrayBufferOrArrayBufferViewOrDictionary::setArrayBufferView(TestArrayBufferView* value) { DCHECK(isNull()); - m_arrayBufferView = Member<TestArrayBufferView>(value.View()); + m_arrayBufferView = value; m_type = SpecificTypeArrayBufferView; } -ArrayBufferOrArrayBufferViewOrDictionary ArrayBufferOrArrayBufferViewOrDictionary::fromArrayBufferView(NotShared<TestArrayBufferView> value) { +ArrayBufferOrArrayBufferViewOrDictionary ArrayBufferOrArrayBufferViewOrDictionary::fromArrayBufferView(TestArrayBufferView* value) { ArrayBufferOrArrayBufferViewOrDictionary container; container.setArrayBufferView(value); return container; @@ -93,9 +95,7 @@ } if (v8Value->IsArrayBufferView()) { - NotShared<TestArrayBufferView> cppValue = ToNotShared<NotShared<TestArrayBufferView>>(isolate, v8Value, exceptionState); - if (exceptionState.HadException()) - return; + TestArrayBufferView* cppValue = V8ArrayBufferView::toImpl(v8::Local<v8::Object>::Cast(v8Value)); impl.setArrayBufferView(cppValue); return; }
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/ArrayBufferOrArrayBufferViewOrDictionary.h b/third_party/WebKit/Source/bindings/tests/results/core/ArrayBufferOrArrayBufferViewOrDictionary.h index 826a920b..c81a1bd 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/ArrayBufferOrArrayBufferViewOrDictionary.h +++ b/third_party/WebKit/Source/bindings/tests/results/core/ArrayBufferOrArrayBufferViewOrDictionary.h
@@ -15,16 +15,14 @@ #include "bindings/core/v8/Dictionary.h" #include "bindings/core/v8/ExceptionState.h" #include "bindings/core/v8/NativeValueTraits.h" -#include "bindings/core/v8/V8ArrayBufferView.h" #include "bindings/core/v8/V8Binding.h" #include "core/CoreExport.h" -#include "core/dom/FlexibleArrayBufferView.h" -#include "core/dom/NotShared.h" #include "platform/heap/Handle.h" namespace blink { class TestArrayBuffer; +class TestArrayBufferView; class CORE_EXPORT ArrayBufferOrArrayBufferViewOrDictionary final { DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); @@ -38,9 +36,9 @@ static ArrayBufferOrArrayBufferViewOrDictionary fromArrayBuffer(TestArrayBuffer*); bool isArrayBufferView() const { return m_type == SpecificTypeArrayBufferView; } - NotShared<TestArrayBufferView> getAsArrayBufferView() const; - void setArrayBufferView(NotShared<TestArrayBufferView>); - static ArrayBufferOrArrayBufferViewOrDictionary fromArrayBufferView(NotShared<TestArrayBufferView>); + TestArrayBufferView* getAsArrayBufferView() const; + void setArrayBufferView(TestArrayBufferView*); + static ArrayBufferOrArrayBufferViewOrDictionary fromArrayBufferView(TestArrayBufferView*); bool isDictionary() const { return m_type == SpecificTypeDictionary; } Dictionary getAsDictionary() const;
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/StringOrArrayBufferOrArrayBufferView.cpp b/third_party/WebKit/Source/bindings/tests/results/core/StringOrArrayBufferOrArrayBufferView.cpp index 71fb6df1..82ca4fc 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/StringOrArrayBufferOrArrayBufferView.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/StringOrArrayBufferOrArrayBufferView.cpp
@@ -15,6 +15,8 @@ #include "bindings/core/v8/NativeValueTraitsImpl.h" #include "bindings/core/v8/ToV8.h" #include "bindings/core/v8/V8ArrayBuffer.h" +#include "bindings/core/v8/V8ArrayBufferView.h" +#include "core/dom/FlexibleArrayBufferView.h" namespace blink { @@ -37,18 +39,18 @@ return container; } -NotShared<TestArrayBufferView> StringOrArrayBufferOrArrayBufferView::getAsArrayBufferView() const { +TestArrayBufferView* StringOrArrayBufferOrArrayBufferView::getAsArrayBufferView() const { DCHECK(isArrayBufferView()); return m_arrayBufferView; } -void StringOrArrayBufferOrArrayBufferView::setArrayBufferView(NotShared<TestArrayBufferView> value) { +void StringOrArrayBufferOrArrayBufferView::setArrayBufferView(TestArrayBufferView* value) { DCHECK(isNull()); - m_arrayBufferView = Member<TestArrayBufferView>(value.View()); + m_arrayBufferView = value; m_type = SpecificTypeArrayBufferView; } -StringOrArrayBufferOrArrayBufferView StringOrArrayBufferOrArrayBufferView::fromArrayBufferView(NotShared<TestArrayBufferView> value) { +StringOrArrayBufferOrArrayBufferView StringOrArrayBufferOrArrayBufferView::fromArrayBufferView(TestArrayBufferView* value) { StringOrArrayBufferOrArrayBufferView container; container.setArrayBufferView(value); return container; @@ -94,9 +96,7 @@ } if (v8Value->IsArrayBufferView()) { - NotShared<TestArrayBufferView> cppValue = ToNotShared<NotShared<TestArrayBufferView>>(isolate, v8Value, exceptionState); - if (exceptionState.HadException()) - return; + TestArrayBufferView* cppValue = V8ArrayBufferView::toImpl(v8::Local<v8::Object>::Cast(v8Value)); impl.setArrayBufferView(cppValue); return; }
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/StringOrArrayBufferOrArrayBufferView.h b/third_party/WebKit/Source/bindings/tests/results/core/StringOrArrayBufferOrArrayBufferView.h index 9d3c93e..b04bab9 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/StringOrArrayBufferOrArrayBufferView.h +++ b/third_party/WebKit/Source/bindings/tests/results/core/StringOrArrayBufferOrArrayBufferView.h
@@ -15,16 +15,14 @@ #include "bindings/core/v8/Dictionary.h" #include "bindings/core/v8/ExceptionState.h" #include "bindings/core/v8/NativeValueTraits.h" -#include "bindings/core/v8/V8ArrayBufferView.h" #include "bindings/core/v8/V8Binding.h" #include "core/CoreExport.h" -#include "core/dom/FlexibleArrayBufferView.h" -#include "core/dom/NotShared.h" #include "platform/heap/Handle.h" namespace blink { class TestArrayBuffer; +class TestArrayBufferView; class CORE_EXPORT StringOrArrayBufferOrArrayBufferView final { DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); @@ -38,9 +36,9 @@ static StringOrArrayBufferOrArrayBufferView fromArrayBuffer(TestArrayBuffer*); bool isArrayBufferView() const { return m_type == SpecificTypeArrayBufferView; } - NotShared<TestArrayBufferView> getAsArrayBufferView() const; - void setArrayBufferView(NotShared<TestArrayBufferView>); - static StringOrArrayBufferOrArrayBufferView fromArrayBufferView(NotShared<TestArrayBufferView>); + TestArrayBufferView* getAsArrayBufferView() const; + void setArrayBufferView(TestArrayBufferView*); + static StringOrArrayBufferOrArrayBufferView fromArrayBufferView(TestArrayBufferView*); bool isString() const { return m_type == SpecificTypeString; } String getAsString() const;
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/TestDictionary.cpp b/third_party/WebKit/Source/bindings/tests/results/core/TestDictionary.cpp index 6d96d38b..69af3f64 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/TestDictionary.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/TestDictionary.cpp
@@ -400,11 +400,11 @@ bool TestDictionary::hasUint8ArrayMember() const { return m_uint8ArrayMember; } -NotShared<DOMUint8Array> TestDictionary::uint8ArrayMember() const { +DOMUint8Array* TestDictionary::uint8ArrayMember() const { return m_uint8ArrayMember; } -void TestDictionary::setUint8ArrayMember(NotShared<DOMUint8Array> value) { - m_uint8ArrayMember = value.View(); +void TestDictionary::setUint8ArrayMember(DOMUint8Array* value) { + m_uint8ArrayMember = value; } bool TestDictionary::hasUnionInRecordMember() const { return m_hasUnionInRecordMember;
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/TestDictionary.h b/third_party/WebKit/Source/bindings/tests/results/core/TestDictionary.h index 951f536..0c37adb0 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/TestDictionary.h +++ b/third_party/WebKit/Source/bindings/tests/results/core/TestDictionary.h
@@ -22,7 +22,6 @@ #include "bindings/tests/idls/core/TestInterface2.h" #include "core/CoreExport.h" #include "core/dom/DOMTypedArray.h" -#include "core/dom/NotShared.h" #include "core/testing/InternalDictionary.h" #include "platform/heap/Handle.h" #include "platform/wtf/Vector.h" @@ -187,8 +186,8 @@ void setTestObjectSequenceMember(const HeapVector<Member<TestObject>>&); bool hasUint8ArrayMember() const; - NotShared<DOMUint8Array> uint8ArrayMember() const; - void setUint8ArrayMember(NotShared<DOMUint8Array>); + DOMUint8Array* uint8ArrayMember() const; + void setUint8ArrayMember(DOMUint8Array*); bool hasUnionInRecordMember() const; const HeapVector<std::pair<String, LongOrBoolean>>& unionInRecordMember() const;
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/TestInterface2OrUint8Array.cpp b/third_party/WebKit/Source/bindings/tests/results/core/TestInterface2OrUint8Array.cpp index 2fef52b..daeda9dc 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/TestInterface2OrUint8Array.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/TestInterface2OrUint8Array.cpp
@@ -35,18 +35,18 @@ return container; } -NotShared<DOMUint8Array> TestInterface2OrUint8Array::getAsUint8Array() const { +DOMUint8Array* TestInterface2OrUint8Array::getAsUint8Array() const { DCHECK(isUint8Array()); return m_uint8Array; } -void TestInterface2OrUint8Array::setUint8Array(NotShared<DOMUint8Array> value) { +void TestInterface2OrUint8Array::setUint8Array(DOMUint8Array* value) { DCHECK(isNull()); - m_uint8Array = Member<DOMUint8Array>(value.View()); + m_uint8Array = value; m_type = SpecificTypeUint8Array; } -TestInterface2OrUint8Array TestInterface2OrUint8Array::fromUint8Array(NotShared<DOMUint8Array> value) { +TestInterface2OrUint8Array TestInterface2OrUint8Array::fromUint8Array(DOMUint8Array* value) { TestInterface2OrUint8Array container; container.setUint8Array(value); return container; @@ -75,9 +75,7 @@ } if (v8Value->IsUint8Array()) { - NotShared<DOMUint8Array> cppValue = ToNotShared<NotShared<DOMUint8Array>>(isolate, v8Value, exceptionState); - if (exceptionState.HadException()) - return; + DOMUint8Array* cppValue = V8Uint8Array::toImpl(v8::Local<v8::Object>::Cast(v8Value)); impl.setUint8Array(cppValue); return; }
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/TestInterface2OrUint8Array.h b/third_party/WebKit/Source/bindings/tests/results/core/TestInterface2OrUint8Array.h index ae0f637..4192249 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/TestInterface2OrUint8Array.h +++ b/third_party/WebKit/Source/bindings/tests/results/core/TestInterface2OrUint8Array.h
@@ -20,7 +20,6 @@ #include "bindings/core/v8/V8Uint8Array.h" #include "core/CoreExport.h" #include "core/dom/FlexibleArrayBufferView.h" -#include "core/dom/NotShared.h" #include "platform/heap/Handle.h" namespace blink { @@ -39,9 +38,9 @@ static TestInterface2OrUint8Array fromTestInterface2(TestInterface2*); bool isUint8Array() const { return m_type == SpecificTypeUint8Array; } - NotShared<DOMUint8Array> getAsUint8Array() const; - void setUint8Array(NotShared<DOMUint8Array>); - static TestInterface2OrUint8Array fromUint8Array(NotShared<DOMUint8Array>); + DOMUint8Array* getAsUint8Array() const; + void setUint8Array(DOMUint8Array*); + static TestInterface2OrUint8Array fromUint8Array(DOMUint8Array*); TestInterface2OrUint8Array(const TestInterface2OrUint8Array&); ~TestInterface2OrUint8Array();
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8DataView.h b/third_party/WebKit/Source/bindings/tests/results/core/V8DataView.h index e27504c3..c45d0b5 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8DataView.h +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8DataView.h
@@ -23,7 +23,6 @@ #include "bindings/tests/idls/core/TestDataView.h" #include "core/CoreExport.h" #include "core/dom/FlexibleArrayBufferView.h" -#include "core/dom/NotShared.h" #include "platform/heap/Handle.h" namespace blink {
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.cpp index f841653f..d41d7e2 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.cpp
@@ -26,7 +26,6 @@ #include "bindings/core/v8/V8TestObject.h" #include "bindings/core/v8/V8Uint8Array.h" #include "core/dom/FlexibleArrayBufferView.h" -#include "core/dom/NotShared.h" #include "core/frame/Deprecation.h" #include "platform/RuntimeEnabledFeatures.h" @@ -644,9 +643,7 @@ if (uint8ArrayMemberValue.IsEmpty() || uint8ArrayMemberValue->IsUndefined()) { // Do nothing. } else { - NotShared<DOMUint8Array> uint8ArrayMember = ToNotShared<NotShared<DOMUint8Array>>(isolate, uint8ArrayMemberValue, exceptionState); - if (exceptionState.HadException()) - return; + DOMUint8Array* uint8ArrayMember = uint8ArrayMemberValue->IsUint8Array() ? V8Uint8Array::toImpl(v8::Local<v8::Uint8Array>::Cast(uint8ArrayMemberValue)) : 0; if (!uint8ArrayMember) { exceptionState.ThrowTypeError("member uint8ArrayMember is not of type Uint8Array."); return;
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp index 78f97e6..b0e8d99 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp
@@ -61,7 +61,6 @@ #include "core/dom/DOMArrayBufferBase.h" #include "core/dom/Document.h" #include "core/dom/FlexibleArrayBufferView.h" -#include "core/dom/NotShared.h" #include "core/dom/TagCollection.h" #include "core/dom/custom/V0CustomElementProcessingStack.h" #include "core/frame/Deprecation.h" @@ -1100,7 +1099,7 @@ TestObject* impl = V8TestObject::toImpl(holder); - V8SetReturnValueFast(info, impl->float32ArrayAttribute(), impl); + V8SetReturnValueFast(info, WTF::GetPtr(impl->float32ArrayAttribute()), impl); } static void float32ArrayAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) { @@ -1113,9 +1112,7 @@ ExceptionState exceptionState(isolate, ExceptionState::kSetterContext, "TestObject", "float32ArrayAttribute"); // Prepare the value to be set. - NotShared<DOMFloat32Array> cppValue = ToNotShared<NotShared<DOMFloat32Array>>(info.GetIsolate(), v8Value, exceptionState); - if (exceptionState.HadException()) - return; + DOMFloat32Array* cppValue = v8Value->IsFloat32Array() ? V8Float32Array::toImpl(v8::Local<v8::Float32Array>::Cast(v8Value)) : 0; // Type check per: http://heycam.github.io/webidl/#es-interface if (!cppValue) { @@ -1131,7 +1128,7 @@ TestObject* impl = V8TestObject::toImpl(holder); - V8SetReturnValueFast(info, impl->uint8ArrayAttribute(), impl); + V8SetReturnValueFast(info, WTF::GetPtr(impl->uint8ArrayAttribute()), impl); } static void uint8ArrayAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) { @@ -1144,9 +1141,7 @@ ExceptionState exceptionState(isolate, ExceptionState::kSetterContext, "TestObject", "uint8ArrayAttribute"); // Prepare the value to be set. - NotShared<DOMUint8Array> cppValue = ToNotShared<NotShared<DOMUint8Array>>(info.GetIsolate(), v8Value, exceptionState); - if (exceptionState.HadException()) - return; + DOMUint8Array* cppValue = v8Value->IsUint8Array() ? V8Uint8Array::toImpl(v8::Local<v8::Uint8Array>::Cast(v8Value)) : 0; // Type check per: http://heycam.github.io/webidl/#es-interface if (!cppValue) { @@ -4668,18 +4663,6 @@ V8SetReturnValue(info, impl->arrayBufferViewMethod()); } -static void arrayBufferViewMethodRaisesExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { - ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kExecutionContext, "TestObject", "arrayBufferViewMethodRaisesException"); - - TestObject* impl = V8TestObject::toImpl(info.Holder()); - - NotShared<TestArrayBufferView> result = impl->arrayBufferViewMethodRaisesException(exceptionState); - if (exceptionState.HadException()) { - return; - } - V8SetReturnValue(info, result); -} - static void float32ArrayMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { TestObject* impl = V8TestObject::toImpl(info.Holder()); @@ -4726,7 +4709,7 @@ } TestArrayBuffer* arrayBufferArg; - arrayBufferArg = V8ArrayBuffer::toImplWithTypeCheck(info.GetIsolate(), info[0]); + arrayBufferArg = info[0]->IsArrayBuffer() ? V8ArrayBuffer::toImpl(v8::Local<v8::ArrayBuffer>::Cast(info[0])) : 0; if (!arrayBufferArg && !IsUndefinedOrNull(info[0])) { V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::FailedToExecute("voidMethodArrayBufferOrNullArg", "TestObject", "parameter 1 is not of type 'ArrayBuffer'.")); @@ -4737,21 +4720,17 @@ } static void voidMethodArrayBufferViewArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { - ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kExecutionContext, "TestObject", "voidMethodArrayBufferViewArg"); - TestObject* impl = V8TestObject::toImpl(info.Holder()); if (UNLIKELY(info.Length() < 1)) { - exceptionState.ThrowTypeError(ExceptionMessages::NotEnoughArguments(1, info.Length())); + V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::FailedToExecute("voidMethodArrayBufferViewArg", "TestObject", ExceptionMessages::NotEnoughArguments(1, info.Length()))); return; } - NotShared<TestArrayBufferView> arrayBufferViewArg; - arrayBufferViewArg = ToNotShared<NotShared<TestArrayBufferView>>(info.GetIsolate(), info[0], exceptionState); - if (exceptionState.HadException()) - return; + TestArrayBufferView* arrayBufferViewArg; + arrayBufferViewArg = info[0]->IsArrayBufferView() ? V8ArrayBufferView::toImpl(v8::Local<v8::ArrayBufferView>::Cast(info[0])) : 0; if (!arrayBufferViewArg) { - exceptionState.ThrowTypeError("parameter 1 is not of type 'ArrayBufferView'."); + V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::FailedToExecute("voidMethodArrayBufferViewArg", "TestObject", "parameter 1 is not of type 'ArrayBufferView'.")); return; } @@ -4760,19 +4739,17 @@ } static void voidMethodFlexibleArrayBufferViewArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { - ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kExecutionContext, "TestObject", "voidMethodFlexibleArrayBufferViewArg"); - TestObject* impl = V8TestObject::toImpl(info.Holder()); if (UNLIKELY(info.Length() < 1)) { - exceptionState.ThrowTypeError(ExceptionMessages::NotEnoughArguments(1, info.Length())); + V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::FailedToExecute("voidMethodFlexibleArrayBufferViewArg", "TestObject", ExceptionMessages::NotEnoughArguments(1, info.Length()))); return; } FlexibleArrayBufferView arrayBufferViewArg; ToFlexibleArrayBufferView(info.GetIsolate(), info[0], arrayBufferViewArg, allocateFlexibleArrayBufferViewStorage(info[0])); if (!arrayBufferViewArg) { - exceptionState.ThrowTypeError("parameter 1 is not of type 'ArrayBufferView'."); + V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::FailedToExecute("voidMethodFlexibleArrayBufferViewArg", "TestObject", "parameter 1 is not of type 'ArrayBufferView'.")); return; } @@ -4781,19 +4758,17 @@ } static void voidMethodFlexibleArrayBufferViewTypedArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { - ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kExecutionContext, "TestObject", "voidMethodFlexibleArrayBufferViewTypedArg"); - TestObject* impl = V8TestObject::toImpl(info.Holder()); if (UNLIKELY(info.Length() < 1)) { - exceptionState.ThrowTypeError(ExceptionMessages::NotEnoughArguments(1, info.Length())); + V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::FailedToExecute("voidMethodFlexibleArrayBufferViewTypedArg", "TestObject", ExceptionMessages::NotEnoughArguments(1, info.Length()))); return; } FlexibleFloat32ArrayView typedArrayBufferViewArg; ToFlexibleArrayBufferView(info.GetIsolate(), info[0], typedArrayBufferViewArg, allocateFlexibleArrayBufferViewStorage(info[0])); if (!typedArrayBufferViewArg) { - exceptionState.ThrowTypeError("parameter 1 is not of type 'Float32Array'."); + V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::FailedToExecute("voidMethodFlexibleArrayBufferViewTypedArg", "TestObject", "parameter 1 is not of type 'Float32Array'.")); return; } @@ -4802,21 +4777,17 @@ } static void voidMethodFloat32ArrayArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { - ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kExecutionContext, "TestObject", "voidMethodFloat32ArrayArg"); - TestObject* impl = V8TestObject::toImpl(info.Holder()); if (UNLIKELY(info.Length() < 1)) { - exceptionState.ThrowTypeError(ExceptionMessages::NotEnoughArguments(1, info.Length())); + V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::FailedToExecute("voidMethodFloat32ArrayArg", "TestObject", ExceptionMessages::NotEnoughArguments(1, info.Length()))); return; } - NotShared<DOMFloat32Array> float32ArrayArg; - float32ArrayArg = ToNotShared<NotShared<DOMFloat32Array>>(info.GetIsolate(), info[0], exceptionState); - if (exceptionState.HadException()) - return; + DOMFloat32Array* float32ArrayArg; + float32ArrayArg = info[0]->IsFloat32Array() ? V8Float32Array::toImpl(v8::Local<v8::Float32Array>::Cast(info[0])) : 0; if (!float32ArrayArg) { - exceptionState.ThrowTypeError("parameter 1 is not of type 'Float32Array'."); + V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::FailedToExecute("voidMethodFloat32ArrayArg", "TestObject", "parameter 1 is not of type 'Float32Array'.")); return; } @@ -4825,21 +4796,17 @@ } static void voidMethodInt32ArrayArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { - ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kExecutionContext, "TestObject", "voidMethodInt32ArrayArg"); - TestObject* impl = V8TestObject::toImpl(info.Holder()); if (UNLIKELY(info.Length() < 1)) { - exceptionState.ThrowTypeError(ExceptionMessages::NotEnoughArguments(1, info.Length())); + V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::FailedToExecute("voidMethodInt32ArrayArg", "TestObject", ExceptionMessages::NotEnoughArguments(1, info.Length()))); return; } - NotShared<DOMInt32Array> int32ArrayArg; - int32ArrayArg = ToNotShared<NotShared<DOMInt32Array>>(info.GetIsolate(), info[0], exceptionState); - if (exceptionState.HadException()) - return; + DOMInt32Array* int32ArrayArg; + int32ArrayArg = info[0]->IsInt32Array() ? V8Int32Array::toImpl(v8::Local<v8::Int32Array>::Cast(info[0])) : 0; if (!int32ArrayArg) { - exceptionState.ThrowTypeError("parameter 1 is not of type 'Int32Array'."); + V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::FailedToExecute("voidMethodInt32ArrayArg", "TestObject", "parameter 1 is not of type 'Int32Array'.")); return; } @@ -4848,21 +4815,17 @@ } static void voidMethodUint8ArrayArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { - ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kExecutionContext, "TestObject", "voidMethodUint8ArrayArg"); - TestObject* impl = V8TestObject::toImpl(info.Holder()); if (UNLIKELY(info.Length() < 1)) { - exceptionState.ThrowTypeError(ExceptionMessages::NotEnoughArguments(1, info.Length())); + V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::FailedToExecute("voidMethodUint8ArrayArg", "TestObject", ExceptionMessages::NotEnoughArguments(1, info.Length()))); return; } - NotShared<DOMUint8Array> uint8ArrayArg; - uint8ArrayArg = ToNotShared<NotShared<DOMUint8Array>>(info.GetIsolate(), info[0], exceptionState); - if (exceptionState.HadException()) - return; + DOMUint8Array* uint8ArrayArg; + uint8ArrayArg = info[0]->IsUint8Array() ? V8Uint8Array::toImpl(v8::Local<v8::Uint8Array>::Cast(info[0])) : 0; if (!uint8ArrayArg) { - exceptionState.ThrowTypeError("parameter 1 is not of type 'Uint8Array'."); + V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::FailedToExecute("voidMethodUint8ArrayArg", "TestObject", "parameter 1 is not of type 'Uint8Array'.")); return; } @@ -10941,10 +10904,6 @@ TestObjectV8Internal::arrayBufferViewMethodMethod(info); } -void V8TestObject::arrayBufferViewMethodRaisesExceptionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { - TestObjectV8Internal::arrayBufferViewMethodRaisesExceptionMethod(info); -} - void V8TestObject::float32ArrayMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { TestObjectV8Internal::float32ArrayMethodMethod(info); } @@ -12051,7 +12010,6 @@ {"voidMethodNodeArg", V8TestObject::voidMethodNodeArgMethodCallback, 1, v8::None, V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kDoNotCheckAccess, V8DOMConfiguration::kAllWorlds}, {"arrayBufferMethod", V8TestObject::arrayBufferMethodMethodCallback, 0, v8::None, V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kDoNotCheckAccess, V8DOMConfiguration::kAllWorlds}, {"arrayBufferViewMethod", V8TestObject::arrayBufferViewMethodMethodCallback, 0, v8::None, V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kDoNotCheckAccess, V8DOMConfiguration::kAllWorlds}, - {"arrayBufferViewMethodRaisesException", V8TestObject::arrayBufferViewMethodRaisesExceptionMethodCallback, 0, v8::None, V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kDoNotCheckAccess, V8DOMConfiguration::kAllWorlds}, {"float32ArrayMethod", V8TestObject::float32ArrayMethodMethodCallback, 0, v8::None, V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kDoNotCheckAccess, V8DOMConfiguration::kAllWorlds}, {"int32ArrayMethod", V8TestObject::int32ArrayMethodMethodCallback, 0, v8::None, V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kDoNotCheckAccess, V8DOMConfiguration::kAllWorlds}, {"uint8ArrayMethod", V8TestObject::uint8ArrayMethodMethodCallback, 0, v8::None, V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kDoNotCheckAccess, V8DOMConfiguration::kAllWorlds},
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.h b/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.h index b4e77b9..39b5333 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.h +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.h
@@ -425,7 +425,6 @@ CORE_EXPORT static void voidMethodNodeArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&); CORE_EXPORT static void arrayBufferMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&); CORE_EXPORT static void arrayBufferViewMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&); - CORE_EXPORT static void arrayBufferViewMethodRaisesExceptionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&); CORE_EXPORT static void float32ArrayMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&); CORE_EXPORT static void int32ArrayMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&); CORE_EXPORT static void uint8ArrayMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&);
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8Uint8ClampedArray.h b/third_party/WebKit/Source/bindings/tests/results/core/V8Uint8ClampedArray.h index 806bac0..5595eed 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8Uint8ClampedArray.h +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8Uint8ClampedArray.h
@@ -23,7 +23,6 @@ #include "core/CoreExport.h" #include "core/dom/DOMTypedArray.h" #include "core/dom/FlexibleArrayBufferView.h" -#include "core/dom/NotShared.h" #include "platform/heap/Handle.h" namespace blink {
diff --git a/third_party/WebKit/Source/build/scripts/templates/EventFactory.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/EventFactory.cpp.tmpl index b552329..28189d1 100644 --- a/third_party/WebKit/Source/build/scripts/templates/EventFactory.cpp.tmpl +++ b/third_party/WebKit/Source/build/scripts/templates/EventFactory.cpp.tmpl
@@ -16,7 +16,7 @@ {{namespace}}* {{namespace}}{{suffix}}Factory::Create(ExecutionContext* executionContext, const String& type) { {% for event in events if event|script_name|create_event_whitelist or event|script_name|create_event_measure_whitelist %} {% if event|script_name|create_event_whitelist or event|script_name|create_event_measure_whitelist %} - if (EqualIgnoringCase(type, "{{event|script_name}}"){% if event.RuntimeEnabled %} && RuntimeEnabledFeatures::{{event.RuntimeEnabled|lower_first}}(){% endif %}) { + if (DeprecatedEqualIgnoringCase(type, "{{event|script_name}}"){% if event.RuntimeEnabled %} && RuntimeEnabledFeatures::{{event.RuntimeEnabled|lower_first}}(){% endif %}) { {% else %} if (type == "{{event|script_name}}"{% if event.RuntimeEnabled %} && RuntimeEnabledFeatures::{{event.RuntimeEnabled|lower_first}}(){% endif %}) { {% endif %}
diff --git a/third_party/WebKit/Source/core/animation/AnimationTest.cpp b/third_party/WebKit/Source/core/animation/AnimationTest.cpp index 97c798e7..1f653a58 100644 --- a/third_party/WebKit/Source/core/animation/AnimationTest.cpp +++ b/third_party/WebKit/Source/core/animation/AnimationTest.cpp
@@ -705,7 +705,7 @@ SimulateFrame(0); timeline->ServiceAnimations(kTimingUpdateForAnimationFrame); EXPECT_EQ( - 1U, element->GetElementAnimations()->Animations().Find(animation)->value); + 1U, element->GetElementAnimations()->Animations().find(animation)->value); ThreadState::Current()->CollectAllGarbage(); EXPECT_TRUE(element->GetElementAnimations()->Animations().IsEmpty());
diff --git a/third_party/WebKit/Source/core/clipboard/DataTransfer.cpp b/third_party/WebKit/Source/core/clipboard/DataTransfer.cpp index f4e1d0b..558c0b7e 100644 --- a/third_party/WebKit/Source/core/clipboard/DataTransfer.cpp +++ b/third_party/WebKit/Source/core/clipboard/DataTransfer.cpp
@@ -449,7 +449,8 @@ for (size_t i = 0; i < data_object_->length(); ++i) { if (data_object_->Item(i)->Kind() == DataObjectItem::kFileKind) { Blob* blob = data_object_->Item(i)->GetAsFile(); - if (blob && blob->IsFile() && EqualIgnoringCase(blob->type(), type)) + if (blob && blob->IsFile() && + DeprecatedEqualIgnoringCase(blob->type(), type)) return true; } }
diff --git a/third_party/WebKit/Source/core/css/FontFace.cpp b/third_party/WebKit/Source/core/css/FontFace.cpp index 59fe9ddf..01fca723 100644 --- a/third_party/WebKit/Source/core/css/FontFace.cpp +++ b/third_party/WebKit/Source/core/css/FontFace.cpp
@@ -81,10 +81,8 @@ return Create(context, family, source.getAsString(), descriptors); if (source.isArrayBuffer()) return Create(context, family, source.getAsArrayBuffer(), descriptors); - if (source.isArrayBufferView()) { - return Create(context, family, source.getAsArrayBufferView().View(), - descriptors); - } + if (source.isArrayBufferView()) + return Create(context, family, source.getAsArrayBufferView(), descriptors); NOTREACHED(); return nullptr; }
diff --git a/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp b/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp index c2eeb25..bd7edfd4 100644 --- a/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp +++ b/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp
@@ -102,8 +102,9 @@ bool MediaQueryEvaluator::MediaTypeMatch( const String& media_type_to_match) const { return media_type_to_match.IsEmpty() || - EqualIgnoringCase(media_type_to_match, MediaTypeNames::all) || - EqualIgnoringCase(media_type_to_match, MediaType()); + DeprecatedEqualIgnoringCase(media_type_to_match, + MediaTypeNames::all) || + DeprecatedEqualIgnoringCase(media_type_to_match, MediaType()); } static bool ApplyRestrictor(MediaQuery::RestrictorType r, bool value) { @@ -330,10 +331,11 @@ // this method only got called if this media type matches the one defined // in the query. Thus, if if the document's media type is "print", the // media type of the query will either be "print" or "all". - if (EqualIgnoringCase(media_values.MediaType(), MediaTypeNames::screen)) { + if (DeprecatedEqualIgnoringCase(media_values.MediaType(), + MediaTypeNames::screen)) { actual_resolution = clampTo<float>(media_values.DevicePixelRatio()); - } else if (EqualIgnoringCase(media_values.MediaType(), - MediaTypeNames::print)) { + } else if (DeprecatedEqualIgnoringCase(media_values.MediaType(), + MediaTypeNames::print)) { // The resolution of images while printing should not depend on the DPI // of the screen. Until we support proper ways of querying this info // we use 300px which is considered minimum for current printers. @@ -739,7 +741,8 @@ MediaFeaturePrefix, const MediaValues& media_values) { // Scan only applies to 'tv' media. - if (!EqualIgnoringCase(media_values.MediaType(), MediaTypeNames::tv)) + if (!DeprecatedEqualIgnoringCase(media_values.MediaType(), + MediaTypeNames::tv)) return false; if (!value.IsValid())
diff --git a/third_party/WebKit/Source/core/css/PropertySetCSSStyleDeclaration.cpp b/third_party/WebKit/Source/core/css/PropertySetCSSStyleDeclaration.cpp index 29066a37..ecb2c85d 100644 --- a/third_party/WebKit/Source/core/css/PropertySetCSSStyleDeclaration.cpp +++ b/third_party/WebKit/Source/core/css/PropertySetCSSStyleDeclaration.cpp
@@ -244,7 +244,7 @@ if (!property_id) return; - bool important = EqualIgnoringCase(priority, "important"); + bool important = DeprecatedEqualIgnoringCase(priority, "important"); if (!important && !priority.IsEmpty()) return;
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp b/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp index 3d8ea3d..c25dc30 100644 --- a/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp +++ b/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
@@ -2009,7 +2009,7 @@ if (FrameView* view = GetDocument().View()) { bool was_print = print_media_type_; print_media_type_ = - EqualIgnoringCase(view->MediaType(), MediaTypeNames::print); + DeprecatedEqualIgnoringCase(view->MediaType(), MediaTypeNames::print); if (was_print != print_media_type_) matched_properties_cache_.ClearViewportDependent(); }
diff --git a/third_party/WebKit/Source/core/dom/AttributeCollection.h b/third_party/WebKit/Source/core/dom/AttributeCollection.h index ddf40ee..30f1cb59 100644 --- a/third_party/WebKit/Source/core/dom/AttributeCollection.h +++ b/third_party/WebKit/Source/core/dom/AttributeCollection.h
@@ -204,7 +204,7 @@ // and all HTML/SVG attributes have a null namespace! if (!it->GetName().HasPrefix()) { if (should_ignore_attribute_case && - EqualIgnoringCase(name, it->LocalName())) + DeprecatedEqualIgnoringCase(name, it->LocalName())) return index; } else { // FIXME: Would be faster to do this comparison without calling toString,
diff --git a/third_party/WebKit/Source/core/dom/CompositorProxy.cpp b/third_party/WebKit/Source/core/dom/CompositorProxy.cpp index ad9ccd337..5608b02a 100644 --- a/third_party/WebKit/Source/core/dom/CompositorProxy.cpp +++ b/third_party/WebKit/Source/core/dom/CompositorProxy.cpp
@@ -32,7 +32,7 @@ static uint32_t CompositorMutablePropertyForName(const String& attribute_name) { for (const auto& mapping : kAllowedProperties) { - if (EqualIgnoringCase(mapping.name, attribute_name)) + if (DeprecatedEqualIgnoringCase(mapping.name, attribute_name)) return mapping.property; } return CompositorMutableProperty::kNone;
diff --git a/third_party/WebKit/Source/core/dom/DOMArrayPiece.cpp b/third_party/WebKit/Source/core/dom/DOMArrayPiece.cpp index f95b19e..30f25b6dd 100644 --- a/third_party/WebKit/Source/core/dom/DOMArrayPiece.cpp +++ b/third_party/WebKit/Source/core/dom/DOMArrayPiece.cpp
@@ -16,7 +16,7 @@ InitWithData(array_buffer->Data(), array_buffer->ByteLength()); } else if (array_buffer_or_view.isArrayBufferView()) { DOMArrayBufferView* array_buffer_view = - array_buffer_or_view.getAsArrayBufferView().View(); + array_buffer_or_view.getAsArrayBufferView(); InitWithData(array_buffer_view->BaseAddress(), array_buffer_view->byteLength()); } else if (array_buffer_or_view.isNull() &&
diff --git a/third_party/WebKit/Source/core/dom/DOMImplementation.cpp b/third_party/WebKit/Source/core/dom/DOMImplementation.cpp index 110064e..38f1ca3 100644 --- a/third_party/WebKit/Source/core/dom/DOMImplementation.cpp +++ b/third_party/WebKit/Source/core/dom/DOMImplementation.cpp
@@ -113,9 +113,9 @@ } bool DOMImplementation::IsXMLMIMEType(const String& mime_type) { - if (EqualIgnoringCase(mime_type, "text/xml") || - EqualIgnoringCase(mime_type, "application/xml") || - EqualIgnoringCase(mime_type, "text/xsl")) + if (DeprecatedEqualIgnoringCase(mime_type, "text/xml") || + DeprecatedEqualIgnoringCase(mime_type, "application/xml") || + DeprecatedEqualIgnoringCase(mime_type, "text/xsl")) return true; // Per RFCs 3023 and 2045, an XML MIME type is of the form: @@ -191,9 +191,9 @@ static bool IsTextPlainType(const String& mime_type) { return mime_type.StartsWith("text/", kTextCaseASCIIInsensitive) && - !(EqualIgnoringCase(mime_type, "text/html") || - EqualIgnoringCase(mime_type, "text/xml") || - EqualIgnoringCase(mime_type, "text/xsl")); + !(DeprecatedEqualIgnoringCase(mime_type, "text/html") || + DeprecatedEqualIgnoringCase(mime_type, "text/xml") || + DeprecatedEqualIgnoringCase(mime_type, "text/xsl")); } bool DOMImplementation::IsTextMIMEType(const String& mime_type) {
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp index a465d2cd..2f287b3 100644 --- a/third_party/WebKit/Source/core/dom/Document.cpp +++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -4529,7 +4529,7 @@ if (event) { // createEvent for TouchEvent should throw DOM exception if touch event // feature detection is not enabled. See crbug.com/392584#c22 - if (EqualIgnoringCase(event_type, "TouchEvent") && + if (DeprecatedEqualIgnoringCase(event_type, "TouchEvent") && !RuntimeEnabledFeatures::touchEventFeatureDetectionEnabled()) break; return event; @@ -5144,8 +5144,9 @@ Traversal<HTMLLinkElement>::FirstChild(*head()); link_element; link_element = Traversal<HTMLLinkElement>::NextSibling(*link_element)) { - if (!EqualIgnoringCase(link_element->GetType(), kOpenSearchMIMEType) || - !EqualIgnoringCase(link_element->Rel(), kOpenSearchRelation)) + if (!DeprecatedEqualIgnoringCase(link_element->GetType(), + kOpenSearchMIMEType) || + !DeprecatedEqualIgnoringCase(link_element->Rel(), kOpenSearchRelation)) continue; if (link_element->Href().IsEmpty()) continue; @@ -5198,10 +5199,10 @@ void Document::setDesignMode(const String& value) { bool new_value = design_mode_; - if (EqualIgnoringCase(value, "on")) { + if (DeprecatedEqualIgnoringCase(value, "on")) { new_value = true; UseCounter::Count(*this, UseCounter::kDocumentDesignModeEnabeld); - } else if (EqualIgnoringCase(value, "off")) { + } else if (DeprecatedEqualIgnoringCase(value, "off")) { new_value = false; } if (new_value == design_mode_) @@ -5469,7 +5470,7 @@ for (HTMLMetaElement& meta_element : Traversal<HTMLMetaElement>::DescendantsOf(*root_element)) { Color color = Color::kTransparent; - if (EqualIgnoringCase(meta_element.GetName(), "theme-color") && + if (DeprecatedEqualIgnoringCase(meta_element.GetName(), "theme-color") && CSSParser::ParseColor( color, meta_element.Content().GetString().StripWhiteSpace(), true)) return color; @@ -5795,7 +5796,7 @@ void Document::ParseDNSPrefetchControlHeader( const String& dns_prefetch_control) { - if (EqualIgnoringCase(dns_prefetch_control, "on") && + if (DeprecatedEqualIgnoringCase(dns_prefetch_control, "on") && !have_explicitly_disabled_dns_prefetch_) { is_dns_prefetch_enabled_ = true; return;
diff --git a/third_party/WebKit/Source/core/dom/DocumentStatisticsCollector.cpp b/third_party/WebKit/Source/core/dom/DocumentStatisticsCollector.cpp index 7c1e83d..7264792 100644 --- a/third_party/WebKit/Source/core/dom/DocumentStatisticsCollector.cpp +++ b/third_party/WebKit/Source/core/dom/DocumentStatisticsCollector.cpp
@@ -174,7 +174,7 @@ if (meta.GetName() == og_type || meta.getAttribute(property_attr) == og_type) { - if (EqualIgnoringCase(meta.Content(), "article")) { + if (DeprecatedEqualIgnoringCase(meta.Content(), "article")) { return true; } }
diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp index 30353d64..a2390f6 100644 --- a/third_party/WebKit/Source/core/dom/Element.cpp +++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -2949,7 +2949,7 @@ Node* Element::InsertAdjacent(const String& where, Node* new_child, ExceptionState& exception_state) { - if (EqualIgnoringCase(where, "beforeBegin")) { + if (DeprecatedEqualIgnoringCase(where, "beforeBegin")) { if (ContainerNode* parent = this->parentNode()) { parent->InsertBefore(new_child, this, exception_state); if (!exception_state.HadException()) @@ -2958,17 +2958,17 @@ return nullptr; } - if (EqualIgnoringCase(where, "afterBegin")) { + if (DeprecatedEqualIgnoringCase(where, "afterBegin")) { InsertBefore(new_child, FirstChild(), exception_state); return exception_state.HadException() ? nullptr : new_child; } - if (EqualIgnoringCase(where, "beforeEnd")) { + if (DeprecatedEqualIgnoringCase(where, "beforeEnd")) { AppendChild(new_child, exception_state); return exception_state.HadException() ? nullptr : new_child; } - if (EqualIgnoringCase(where, "afterEnd")) { + if (DeprecatedEqualIgnoringCase(where, "afterEnd")) { if (ContainerNode* parent = this->parentNode()) { parent->InsertBefore(new_child, nextSibling(), exception_state); if (!exception_state.HadException()) @@ -3017,8 +3017,8 @@ static Element* ContextElementForInsertion(const String& where, Element* element, ExceptionState& exception_state) { - if (EqualIgnoringCase(where, "beforeBegin") || - EqualIgnoringCase(where, "afterEnd")) { + if (DeprecatedEqualIgnoringCase(where, "beforeBegin") || + DeprecatedEqualIgnoringCase(where, "afterEnd")) { Element* parent = element->parentElement(); if (!parent) { exception_state.ThrowDOMException(kNoModificationAllowedError, @@ -3027,8 +3027,8 @@ } return parent; } - if (EqualIgnoringCase(where, "afterBegin") || - EqualIgnoringCase(where, "beforeEnd")) + if (DeprecatedEqualIgnoringCase(where, "afterBegin") || + DeprecatedEqualIgnoringCase(where, "beforeEnd")) return element; exception_state.ThrowDOMException( kSyntaxError, "The value provided ('" + where + @@ -3661,9 +3661,10 @@ const AtomicString& value = FastGetAttribute(spellcheckAttr); if (value == g_null_atom) return kSpellcheckAttributeDefault; - if (EqualIgnoringCase(value, "true") || EqualIgnoringCase(value, "")) + if (DeprecatedEqualIgnoringCase(value, "true") || + DeprecatedEqualIgnoringCase(value, "")) return kSpellcheckAttributeTrue; - if (EqualIgnoringCase(value, "false")) + if (DeprecatedEqualIgnoringCase(value, "false")) return kSpellcheckAttributeFalse; return kSpellcheckAttributeDefault;
diff --git a/third_party/WebKit/Source/core/dom/NotShared.h b/third_party/WebKit/Source/core/dom/NotShared.h deleted file mode 100644 index 69173aa..0000000 --- a/third_party/WebKit/Source/core/dom/NotShared.h +++ /dev/null
@@ -1,68 +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. - -#ifndef NotShared_h -#define NotShared_h - -// A wrapper template type that is used to ensure that a TypedArray is not -// backed by a SharedArrayBuffer. -// -// Typically this is used as an annotation on C++ functions that are called by -// the bindings layer, e.g.: -// -// void Foo(NotShared<DOMUint32Array> param) { -// DOMUint32Array* array = param.View(); -// ... -// } - -#include "platform/heap/Handle.h" - -namespace blink { - -template <typename T> -class NotShared { - STACK_ALLOCATED(); - - public: - using TypedArrayType = T; - - NotShared() {} - - explicit NotShared(T* typedArray) : typed_array_(typedArray) { - DCHECK(!(typedArray && typedArray->View()->IsShared())); - } - NotShared(const NotShared& other) = default; - template <typename U> - NotShared(const NotShared<U>& other) : typed_array_(other.View()) {} - template <typename U> - NotShared(const Member<U>& other) { - DCHECK(!other->View()->IsShared()); - typed_array_ = other.Get(); - } - - NotShared& operator=(const NotShared& other) = default; - template <typename U> - NotShared& operator=(const NotShared<U>& other) { - typed_array_ = other.View(); - return *this; - } - - T* View() const { return typed_array_.Get(); } - - bool operator!() const { return !typed_array_; } - explicit operator bool() const { return !!typed_array_; } - - private: - // Must use an untraced member here since this object may be constructed on a - // thread without a ThreadState (e.g. an Audio worklet). It is safe in that - // case because the pointed-to ArrayBuffer is being kept alive another way - // (e.g. CrossThreadPersistent). - // - // TODO(binji): update to using Member, see crbug.com/710295. - UntracedMember<T> typed_array_; -}; - -} // namespace blink - -#endif // NotShared_h
diff --git a/third_party/WebKit/Source/core/dom/SandboxFlags.cpp b/third_party/WebKit/Source/core/dom/SandboxFlags.cpp index 12816e5a..cca7772 100644 --- a/third_party/WebKit/Source/core/dom/SandboxFlags.cpp +++ b/third_party/WebKit/Source/core/dom/SandboxFlags.cpp
@@ -45,30 +45,34 @@ for (unsigned index = 0; index < length; index++) { // Turn off the corresponding sandbox flag if it's set as "allowed". String sandbox_token(policy[index]); - if (EqualIgnoringCase(sandbox_token, "allow-same-origin")) { + if (DeprecatedEqualIgnoringCase(sandbox_token, "allow-same-origin")) { flags &= ~kSandboxOrigin; - } else if (EqualIgnoringCase(sandbox_token, "allow-forms")) { + } else if (DeprecatedEqualIgnoringCase(sandbox_token, "allow-forms")) { flags &= ~kSandboxForms; - } else if (EqualIgnoringCase(sandbox_token, "allow-scripts")) { + } else if (DeprecatedEqualIgnoringCase(sandbox_token, "allow-scripts")) { flags &= ~kSandboxScripts; flags &= ~kSandboxAutomaticFeatures; - } else if (EqualIgnoringCase(sandbox_token, "allow-top-navigation")) { + } else if (DeprecatedEqualIgnoringCase(sandbox_token, + "allow-top-navigation")) { flags &= ~kSandboxTopNavigation; - } else if (EqualIgnoringCase(sandbox_token, "allow-popups")) { + } else if (DeprecatedEqualIgnoringCase(sandbox_token, "allow-popups")) { flags &= ~kSandboxPopups; - } else if (EqualIgnoringCase(sandbox_token, "allow-pointer-lock")) { + } else if (DeprecatedEqualIgnoringCase(sandbox_token, + "allow-pointer-lock")) { flags &= ~kSandboxPointerLock; - } else if (EqualIgnoringCase(sandbox_token, "allow-orientation-lock")) { + } else if (DeprecatedEqualIgnoringCase(sandbox_token, + "allow-orientation-lock")) { flags &= ~kSandboxOrientationLock; - } else if (EqualIgnoringCase(sandbox_token, - "allow-popups-to-escape-sandbox")) { + } else if (DeprecatedEqualIgnoringCase(sandbox_token, + "allow-popups-to-escape-sandbox")) { flags &= ~kSandboxPropagatesToAuxiliaryBrowsingContexts; - } else if (EqualIgnoringCase(sandbox_token, "allow-modals")) { + } else if (DeprecatedEqualIgnoringCase(sandbox_token, "allow-modals")) { flags &= ~kSandboxModals; - } else if (EqualIgnoringCase(sandbox_token, "allow-presentation")) { + } else if (DeprecatedEqualIgnoringCase(sandbox_token, + "allow-presentation")) { flags &= ~kSandboxPresentation; - } else if (EqualIgnoringCase(sandbox_token, - "allow-top-navigation-by-user-activation") && + } else if (DeprecatedEqualIgnoringCase( + sandbox_token, "allow-top-navigation-by-user-activation") && RuntimeEnabledFeatures:: topNavByUserActivationInSandboxEnabled()) { flags &= ~kSandboxTopNavigationByUserActivation;
diff --git a/third_party/WebKit/Source/core/dom/ScriptLoader.cpp b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp index 67f55ced..4622be44 100644 --- a/third_party/WebKit/Source/core/dom/ScriptLoader.cpp +++ b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
@@ -838,14 +838,14 @@ // 4. "If for is not an ASCII case-insensitive match for the string // "window", // then abort these steps at this point. The script is not executed." - if (!EqualIgnoringCase(for_attribute, "window")) + if (!DeprecatedEqualIgnoringCase(for_attribute, "window")) return false; event_attribute = event_attribute.StripWhiteSpace(); // 5. "If event is not an ASCII case-insensitive match for either the // string "onload" or the string "onload()", // then abort these steps at this point. The script is not executed. - return EqualIgnoringCase(event_attribute, "onload") || - EqualIgnoringCase(event_attribute, "onload()"); + return DeprecatedEqualIgnoringCase(event_attribute, "onload") || + DeprecatedEqualIgnoringCase(event_attribute, "onload()"); } String ScriptLoader::ScriptContent() const {
diff --git a/third_party/WebKit/Source/core/dom/StyleElement.cpp b/third_party/WebKit/Source/core/dom/StyleElement.cpp index a12a197a..5f8bd08 100644 --- a/third_party/WebKit/Source/core/dom/StyleElement.cpp +++ b/third_party/WebKit/Source/core/dom/StyleElement.cpp
@@ -39,9 +39,9 @@ namespace blink { static bool IsCSS(const Element& element, const AtomicString& type) { - return type.IsEmpty() || - (element.IsHTMLElement() ? EqualIgnoringCase(type, "text/css") - : (type == "text/css")); + return type.IsEmpty() || (element.IsHTMLElement() + ? DeprecatedEqualIgnoringCase(type, "text/css") + : (type == "text/css")); } StyleElement::StyleElement(Document* document, bool created_by_parser)
diff --git a/third_party/WebKit/Source/core/dom/TreeScope.cpp b/third_party/WebKit/Source/core/dom/TreeScope.cpp index 3128ab9..f71ab868 100644 --- a/third_party/WebKit/Source/core/dom/TreeScope.cpp +++ b/third_party/WebKit/Source/core/dom/TreeScope.cpp
@@ -333,7 +333,7 @@ Traversal<HTMLAnchorElement>::StartsAfter(RootNode())) { if (RootNode().GetDocument().InQuirksMode()) { // Quirks mode, case insensitive comparison of names. - if (EqualIgnoringCase(anchor.GetName(), name)) + if (DeprecatedEqualIgnoringCase(anchor.GetName(), name)) return &anchor; } else { // Strict mode, names need to match exactly. @@ -503,7 +503,8 @@ Element* result = nullptr; Node& root = RootNode(); for (Element& element : ElementTraversal::DescendantsOf(root)) { - if (EqualIgnoringCase(element.FastGetAttribute(accesskeyAttr), key)) + if (DeprecatedEqualIgnoringCase(element.FastGetAttribute(accesskeyAttr), + key)) result = &element; for (ShadowRoot* shadow_root = element.YoungestShadowRoot(); shadow_root; shadow_root = shadow_root->OlderShadowRoot()) {
diff --git a/third_party/WebKit/Source/core/editing/DOMSelection.cpp b/third_party/WebKit/Source/core/editing/DOMSelection.cpp index 4dd9d83..24e9035 100644 --- a/third_party/WebKit/Source/core/editing/DOMSelection.cpp +++ b/third_party/WebKit/Source/core/editing/DOMSelection.cpp
@@ -401,43 +401,43 @@ return; FrameSelection::EAlteration alter; - if (EqualIgnoringCase(alter_string, "extend")) + if (DeprecatedEqualIgnoringCase(alter_string, "extend")) alter = FrameSelection::kAlterationExtend; - else if (EqualIgnoringCase(alter_string, "move")) + else if (DeprecatedEqualIgnoringCase(alter_string, "move")) alter = FrameSelection::kAlterationMove; else return; SelectionDirection direction; - if (EqualIgnoringCase(direction_string, "forward")) + if (DeprecatedEqualIgnoringCase(direction_string, "forward")) direction = kDirectionForward; - else if (EqualIgnoringCase(direction_string, "backward")) + else if (DeprecatedEqualIgnoringCase(direction_string, "backward")) direction = kDirectionBackward; - else if (EqualIgnoringCase(direction_string, "left")) + else if (DeprecatedEqualIgnoringCase(direction_string, "left")) direction = kDirectionLeft; - else if (EqualIgnoringCase(direction_string, "right")) + else if (DeprecatedEqualIgnoringCase(direction_string, "right")) direction = kDirectionRight; else return; TextGranularity granularity; - if (EqualIgnoringCase(granularity_string, "character")) + if (DeprecatedEqualIgnoringCase(granularity_string, "character")) granularity = kCharacterGranularity; - else if (EqualIgnoringCase(granularity_string, "word")) + else if (DeprecatedEqualIgnoringCase(granularity_string, "word")) granularity = kWordGranularity; - else if (EqualIgnoringCase(granularity_string, "sentence")) + else if (DeprecatedEqualIgnoringCase(granularity_string, "sentence")) granularity = kSentenceGranularity; - else if (EqualIgnoringCase(granularity_string, "line")) + else if (DeprecatedEqualIgnoringCase(granularity_string, "line")) granularity = kLineGranularity; - else if (EqualIgnoringCase(granularity_string, "paragraph")) + else if (DeprecatedEqualIgnoringCase(granularity_string, "paragraph")) granularity = kParagraphGranularity; - else if (EqualIgnoringCase(granularity_string, "lineboundary")) + else if (DeprecatedEqualIgnoringCase(granularity_string, "lineboundary")) granularity = kLineBoundary; - else if (EqualIgnoringCase(granularity_string, "sentenceboundary")) + else if (DeprecatedEqualIgnoringCase(granularity_string, "sentenceboundary")) granularity = kSentenceBoundary; - else if (EqualIgnoringCase(granularity_string, "paragraphboundary")) + else if (DeprecatedEqualIgnoringCase(granularity_string, "paragraphboundary")) granularity = kParagraphBoundary; - else if (EqualIgnoringCase(granularity_string, "documentboundary")) + else if (DeprecatedEqualIgnoringCase(granularity_string, "documentboundary")) granularity = kDocumentBoundary; else return;
diff --git a/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp b/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp index c9c5492..533efbb 100644 --- a/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
@@ -696,10 +696,10 @@ Event*, EditorCommandSource, const String& value) { - if (EqualIgnoringCase(value, "div")) + if (DeprecatedEqualIgnoringCase(value, "div")) frame.GetEditor().SetDefaultParagraphSeparator( kEditorParagraphSeparatorIsDiv); - else if (EqualIgnoringCase(value, "p")) + else if (DeprecatedEqualIgnoringCase(value, "p")) frame.GetEditor().SetDefaultParagraphSeparator( kEditorParagraphSeparatorIsP); @@ -1823,7 +1823,8 @@ Event*, EditorCommandSource, const String& value) { - frame.GetEditor().SetShouldStyleWithCSS(!EqualIgnoringCase(value, "false")); + frame.GetEditor().SetShouldStyleWithCSS( + !DeprecatedEqualIgnoringCase(value, "false")); return true; } @@ -1831,7 +1832,8 @@ Event*, EditorCommandSource, const String& value) { - frame.GetEditor().SetShouldStyleWithCSS(EqualIgnoringCase(value, "false")); + frame.GetEditor().SetShouldStyleWithCSS( + DeprecatedEqualIgnoringCase(value, "false")); return true; }
diff --git a/third_party/WebKit/Source/core/fileapi/Blob.cpp b/third_party/WebKit/Source/core/fileapi/Blob.cpp index cc2abf3e..3ced27e 100644 --- a/third_party/WebKit/Source/core/fileapi/Blob.cpp +++ b/third_party/WebKit/Source/core/fileapi/Blob.cpp
@@ -132,8 +132,7 @@ DOMArrayBuffer* array_buffer = item.getAsArrayBuffer(); blob_data->AppendBytes(array_buffer->Data(), array_buffer->ByteLength()); } else if (item.isArrayBufferView()) { - DOMArrayBufferView* array_buffer_view = - item.getAsArrayBufferView().View(); + DOMArrayBufferView* array_buffer_view = item.getAsArrayBufferView(); blob_data->AppendBytes(array_buffer_view->BaseAddress(), array_buffer_view->byteLength()); } else if (item.isBlob()) {
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp index f38a80e..ab683ed 100644 --- a/third_party/WebKit/Source/core/frame/FrameView.cpp +++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -1918,7 +1918,8 @@ // Implement the rule that "" and "top" both mean top of page as in other // browsers. - if (!anchor_node && !(name.IsEmpty() || EqualIgnoringCase(name, "top"))) + if (!anchor_node && + !(name.IsEmpty() || DeprecatedEqualIgnoringCase(name, "top"))) return false; if (behavior == kUrlFragmentScroll)
diff --git a/third_party/WebKit/Source/core/frame/ImageBitmapTest.cpp b/third_party/WebKit/Source/core/frame/ImageBitmapTest.cpp index 96ebafa3..a59e6a6e 100644 --- a/third_party/WebKit/Source/core/frame/ImageBitmapTest.cpp +++ b/third_party/WebKit/Source/core/frame/ImageBitmapTest.cpp
@@ -498,8 +498,7 @@ TEST_F(ImageBitmapTest, ImageBitmapColorSpaceConversionImageData) { unsigned char data_buffer[4] = {255, 0, 0, 255}; DOMUint8ClampedArray* data = DOMUint8ClampedArray::Create(data_buffer, 4); - ImageData* image_data = - ImageData::Create(IntSize(1, 1), NotShared<DOMUint8ClampedArray>(data)); + ImageData* image_data = ImageData::Create(IntSize(1, 1), data); std::unique_ptr<uint8_t[]> src_pixel(new uint8_t[4]()); memcpy(src_pixel.get(), image_data->data()->Data(), 4);
diff --git a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp index f2437d92b..264ef204 100644 --- a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp +++ b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
@@ -199,7 +199,7 @@ static void RemoveUnloadEventListener(LocalDOMWindow* dom_window) { DOMWindowSet& set = WindowsWithUnloadEventListeners(); - DOMWindowSet::iterator it = set.Find(dom_window); + DOMWindowSet::iterator it = set.find(dom_window); if (it == set.end()) return; set.erase(it); @@ -211,7 +211,7 @@ static void RemoveAllUnloadEventListeners(LocalDOMWindow* dom_window) { DOMWindowSet& set = WindowsWithUnloadEventListeners(); - DOMWindowSet::iterator it = set.Find(dom_window); + DOMWindowSet::iterator it = set.find(dom_window); if (it == set.end()) return; set.RemoveAll(it); @@ -233,7 +233,7 @@ static void RemoveBeforeUnloadEventListener(LocalDOMWindow* dom_window) { DOMWindowSet& set = WindowsWithBeforeUnloadEventListeners(); - DOMWindowSet::iterator it = set.Find(dom_window); + DOMWindowSet::iterator it = set.find(dom_window); if (it == set.end()) return; set.erase(it); @@ -245,7 +245,7 @@ static void RemoveAllBeforeUnloadEventListeners(LocalDOMWindow* dom_window) { DOMWindowSet& set = WindowsWithBeforeUnloadEventListeners(); - DOMWindowSet::iterator it = set.Find(dom_window); + DOMWindowSet::iterator it = set.find(dom_window); if (it == set.end()) return; set.RemoveAll(it); @@ -264,7 +264,7 @@ } unsigned LocalDOMWindow::PendingUnloadEventListeners() const { - return WindowsWithUnloadEventListeners().Count( + return WindowsWithUnloadEventListeners().count( const_cast<LocalDOMWindow*>(this)); }
diff --git a/third_party/WebKit/Source/core/frame/SmartClip.cpp b/third_party/WebKit/Source/core/frame/SmartClip.cpp index c5a7d5d..357b3a2a 100644 --- a/third_party/WebKit/Source/core/frame/SmartClip.cpp +++ b/third_party/WebKit/Source/core/frame/SmartClip.cpp
@@ -171,7 +171,7 @@ IntRect node_rect = node->PixelSnappedBoundingBox(); if (node->IsElementNode() && - EqualIgnoringCase( + DeprecatedEqualIgnoringCase( ToElement(node)->FastGetAttribute(HTMLNames::aria_hiddenAttr), "true")) { node = NodeTraversal::NextSkippingChildren(*node, root_node);
diff --git a/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp b/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp index 21722f6..053ddde 100644 --- a/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp +++ b/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp
@@ -1054,9 +1054,9 @@ if (token_begin < position) { String token = String(token_begin, position - token_begin); - if (EqualIgnoringCase(token, "script")) { + if (DeprecatedEqualIgnoringCase(token, "script")) { require_sri_for_ |= RequireSRIForToken::kScript; - } else if (EqualIgnoringCase(token, "style")) { + } else if (DeprecatedEqualIgnoringCase(token, "style")) { require_sri_for_ |= RequireSRIForToken::kStyle; } else { if (number_of_token_errors)
diff --git a/third_party/WebKit/Source/core/frame/csp/CSPSource.cpp b/third_party/WebKit/Source/core/frame/csp/CSPSource.cpp index 6e075efc8..9bcd80a 100644 --- a/third_party/WebKit/Source/core/frame/csp/CSPSource.cpp +++ b/third_party/WebKit/Source/core/frame/csp/CSPSource.cpp
@@ -129,8 +129,9 @@ } bool is_scheme_http; // needed for detecting an upgrade when the port is 0 - is_scheme_http = scheme_.IsEmpty() ? policy_->ProtocolEqualsSelf("http") - : EqualIgnoringCase("http", scheme_); + is_scheme_http = scheme_.IsEmpty() + ? policy_->ProtocolEqualsSelf("http") + : DeprecatedEqualIgnoringCase("http", scheme_); if ((port_ == 80 || (port_ == 0 && is_scheme_http)) && (port == 443 || (port == 0 && DefaultPortForProtocol(protocol) == 443)))
diff --git a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp index d708cfe3..be7f3e81 100644 --- a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp +++ b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp
@@ -1315,11 +1315,11 @@ String message = "Unrecognized Content-Security-Policy directive '" + name + "'.\n"; MessageLevel level = kErrorMessageLevel; - if (EqualIgnoringCase(name, kAllow)) { + if (DeprecatedEqualIgnoringCase(name, kAllow)) { message = kAllowMessage; - } else if (EqualIgnoringCase(name, kOptions)) { + } else if (DeprecatedEqualIgnoringCase(name, kOptions)) { message = kOptionsMessage; - } else if (EqualIgnoringCase(name, kPolicyURI)) { + } else if (DeprecatedEqualIgnoringCase(name, kPolicyURI)) { message = kPolicyURIMessage; } else if (GetDirectiveType(name) != DirectiveType::kUndefined) { message = "The Content-Security-Policy directive '" + name + @@ -1417,7 +1417,7 @@ String message = "The source list for Content Security Policy directive '" + directive_name + "' contains an invalid source: '" + source + "'. It will be ignored."; - if (EqualIgnoringCase(source, "'none'")) + if (DeprecatedEqualIgnoringCase(source, "'none'")) message = message + " Note that 'none' has no effect unless it is the only " "expression in the source list."; @@ -1470,7 +1470,7 @@ } bool ContentSecurityPolicy::ProtocolEqualsSelf(const String& protocol) const { - return EqualIgnoringCase(protocol, self_protocol_); + return DeprecatedEqualIgnoringCase(protocol, self_protocol_); } const String& ContentSecurityPolicy::GetSelfProtocol() const {
diff --git a/third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp b/third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp index d39082b..48a671a 100644 --- a/third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp +++ b/third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp
@@ -41,7 +41,8 @@ const UChar* position = begin; skipWhile<UChar, IsSourceCharacter>(position, end); - if (!EqualIgnoringCase("'none'", StringView(begin, position - begin))) + if (!DeprecatedEqualIgnoringCase("'none'", + StringView(begin, position - begin))) return false; skipWhile<UChar, IsASCIISpace>(position, end); @@ -178,7 +179,7 @@ StringView token(begin, end - begin); - if (EqualIgnoringCase("'none'", token)) + if (DeprecatedEqualIgnoringCase("'none'", token)) return false; if (end - begin == 1 && *begin == '*') { @@ -186,32 +187,32 @@ return true; } - if (EqualIgnoringCase("'self'", token)) { + if (DeprecatedEqualIgnoringCase("'self'", token)) { AddSourceSelf(); return true; } - if (EqualIgnoringCase("'unsafe-inline'", token)) { + if (DeprecatedEqualIgnoringCase("'unsafe-inline'", token)) { AddSourceUnsafeInline(); return true; } - if (EqualIgnoringCase("'unsafe-eval'", token)) { + if (DeprecatedEqualIgnoringCase("'unsafe-eval'", token)) { AddSourceUnsafeEval(); return true; } - if (EqualIgnoringCase("'strict-dynamic'", token)) { + if (DeprecatedEqualIgnoringCase("'strict-dynamic'", token)) { AddSourceStrictDynamic(); return true; } - if (EqualIgnoringCase("'unsafe-hashed-attributes'", token)) { + if (DeprecatedEqualIgnoringCase("'unsafe-hashed-attributes'", token)) { AddSourceUnsafeHashedAttributes(); return true; } - if (EqualIgnoringCase("'report-sample'", token)) { + if (DeprecatedEqualIgnoringCase("'report-sample'", token)) { AddReportSample(); return true; } @@ -323,7 +324,7 @@ // TODO(esprehn): Should be StringView(begin, nonceLength).startsWith(prefix). if (nonce_length <= prefix.length() || - !EqualIgnoringCase(prefix, StringView(begin, prefix.length()))) + !DeprecatedEqualIgnoringCase(prefix, StringView(begin, prefix.length()))) return true; const UChar* position = begin + prefix.length(); @@ -373,7 +374,8 @@ // TODO(esprehn): Should be StringView(begin, end - // begin).startsWith(prefix). if (hash_length > prefix.length() && - EqualIgnoringCase(prefix, StringView(begin, prefix.length()))) { + DeprecatedEqualIgnoringCase(prefix, + StringView(begin, prefix.length()))) { hash_algorithm = algorithm.type; break; }
diff --git a/third_party/WebKit/Source/core/geometry/DOMMatrix.cpp b/third_party/WebKit/Source/core/geometry/DOMMatrix.cpp index 3dc15d7..799107e0 100644 --- a/third_party/WebKit/Source/core/geometry/DOMMatrix.cpp +++ b/third_party/WebKit/Source/core/geometry/DOMMatrix.cpp
@@ -39,30 +39,26 @@ return new DOMMatrix(sequence, sequence.size()); } -DOMMatrix* DOMMatrix::fromFloat32Array(NotShared<DOMFloat32Array> float32_array, +DOMMatrix* DOMMatrix::fromFloat32Array(DOMFloat32Array* float32_array, ExceptionState& exception_state) { - if (float32_array.View()->length() != 6 && - float32_array.View()->length() != 16) { + if (float32_array->length() != 6 && float32_array->length() != 16) { exception_state.ThrowTypeError( "The sequence must contain 6 elements for a 2D matrix or 16 elements " "for a 3D matrix."); return nullptr; } - return new DOMMatrix(float32_array.View()->Data(), - float32_array.View()->length()); + return new DOMMatrix(float32_array->Data(), float32_array->length()); } -DOMMatrix* DOMMatrix::fromFloat64Array(NotShared<DOMFloat64Array> float64_array, +DOMMatrix* DOMMatrix::fromFloat64Array(DOMFloat64Array* float64_array, ExceptionState& exception_state) { - if (float64_array.View()->length() != 6 && - float64_array.View()->length() != 16) { + if (float64_array->length() != 6 && float64_array->length() != 16) { exception_state.ThrowTypeError( "The sequence must contain 6 elements for a 2D matrix or 16 elements " "for a 3D matrix."); return nullptr; } - return new DOMMatrix(float64_array.View()->Data(), - float64_array.View()->length()); + return new DOMMatrix(float64_array->Data(), float64_array->length()); } template <typename T>
diff --git a/third_party/WebKit/Source/core/geometry/DOMMatrix.h b/third_party/WebKit/Source/core/geometry/DOMMatrix.h index eede89ef..eb0a338 100644 --- a/third_party/WebKit/Source/core/geometry/DOMMatrix.h +++ b/third_party/WebKit/Source/core/geometry/DOMMatrix.h
@@ -6,7 +6,6 @@ #define DOMMatrix_h #include "bindings/core/v8/ExceptionState.h" -#include "core/dom/NotShared.h" #include "core/geometry/DOMMatrixInit.h" #include "core/geometry/DOMMatrixReadOnly.h" @@ -22,10 +21,8 @@ static DOMMatrix* Create(const SkMatrix44&, ExceptionState&); static DOMMatrix* Create(const String&, ExceptionState&); static DOMMatrix* Create(Vector<double>, ExceptionState&); - static DOMMatrix* fromFloat32Array(NotShared<DOMFloat32Array>, - ExceptionState&); - static DOMMatrix* fromFloat64Array(NotShared<DOMFloat64Array>, - ExceptionState&); + static DOMMatrix* fromFloat32Array(DOMFloat32Array*, ExceptionState&); + static DOMMatrix* fromFloat64Array(DOMFloat64Array*, ExceptionState&); static DOMMatrix* fromMatrix(DOMMatrixInit&, ExceptionState&); void setA(double value) { matrix_->SetM11(value); }
diff --git a/third_party/WebKit/Source/core/geometry/DOMMatrixReadOnly.cpp b/third_party/WebKit/Source/core/geometry/DOMMatrixReadOnly.cpp index fd09781..0d788c76 100644 --- a/third_party/WebKit/Source/core/geometry/DOMMatrixReadOnly.cpp +++ b/third_party/WebKit/Source/core/geometry/DOMMatrixReadOnly.cpp
@@ -115,31 +115,27 @@ } DOMMatrixReadOnly* DOMMatrixReadOnly::fromFloat32Array( - NotShared<DOMFloat32Array> float32_array, + DOMFloat32Array* float32_array, ExceptionState& exception_state) { - if (float32_array.View()->length() != 6 && - float32_array.View()->length() != 16) { + if (float32_array->length() != 6 && float32_array->length() != 16) { exception_state.ThrowTypeError( "The sequence must contain 6 elements for a 2D matrix or 16 elements a " "for 3D matrix."); return nullptr; } - return new DOMMatrixReadOnly(float32_array.View()->Data(), - float32_array.View()->length()); + return new DOMMatrixReadOnly(float32_array->Data(), float32_array->length()); } DOMMatrixReadOnly* DOMMatrixReadOnly::fromFloat64Array( - NotShared<DOMFloat64Array> float64_array, + DOMFloat64Array* float64_array, ExceptionState& exception_state) { - if (float64_array.View()->length() != 6 && - float64_array.View()->length() != 16) { + if (float64_array->length() != 6 && float64_array->length() != 16) { exception_state.ThrowTypeError( "The sequence must contain 6 elements for a 2D matrix or 16 elements " "for a 3D matrix."); return nullptr; } - return new DOMMatrixReadOnly(float64_array.View()->Data(), - float64_array.View()->length()); + return new DOMMatrixReadOnly(float64_array->Data(), float64_array->length()); } DOMMatrixReadOnly* DOMMatrixReadOnly::fromMatrix( @@ -279,7 +275,7 @@ is2d_ = is2d; } -NotShared<DOMFloat32Array> DOMMatrixReadOnly::toFloat32Array() const { +DOMFloat32Array* DOMMatrixReadOnly::toFloat32Array() const { float array[] = { static_cast<float>(matrix_->M11()), static_cast<float>(matrix_->M12()), static_cast<float>(matrix_->M13()), static_cast<float>(matrix_->M14()), @@ -290,17 +286,17 @@ static_cast<float>(matrix_->M41()), static_cast<float>(matrix_->M42()), static_cast<float>(matrix_->M43()), static_cast<float>(matrix_->M44())}; - return NotShared<DOMFloat32Array>(DOMFloat32Array::Create(array, 16)); + return DOMFloat32Array::Create(array, 16); } -NotShared<DOMFloat64Array> DOMMatrixReadOnly::toFloat64Array() const { +DOMFloat64Array* DOMMatrixReadOnly::toFloat64Array() const { double array[] = { matrix_->M11(), matrix_->M12(), matrix_->M13(), matrix_->M14(), matrix_->M21(), matrix_->M22(), matrix_->M23(), matrix_->M24(), matrix_->M31(), matrix_->M32(), matrix_->M33(), matrix_->M34(), matrix_->M41(), matrix_->M42(), matrix_->M43(), matrix_->M44()}; - return NotShared<DOMFloat64Array>(DOMFloat64Array::Create(array, 16)); + return DOMFloat64Array::Create(array, 16); } const String DOMMatrixReadOnly::toString() const {
diff --git a/third_party/WebKit/Source/core/geometry/DOMMatrixReadOnly.h b/third_party/WebKit/Source/core/geometry/DOMMatrixReadOnly.h index 708a07e..dcb42ea 100644 --- a/third_party/WebKit/Source/core/geometry/DOMMatrixReadOnly.h +++ b/third_party/WebKit/Source/core/geometry/DOMMatrixReadOnly.h
@@ -9,7 +9,6 @@ #include "bindings/core/v8/ExceptionState.h" #include "bindings/core/v8/ScriptWrappable.h" #include "core/dom/DOMTypedArray.h" -#include "core/dom/NotShared.h" #include "platform/heap/Handle.h" #include "platform/transforms/TransformationMatrix.h" @@ -29,10 +28,8 @@ static DOMMatrixReadOnly* Create(ExceptionState&); static DOMMatrixReadOnly* Create(const String&, ExceptionState&); static DOMMatrixReadOnly* Create(Vector<double>, ExceptionState&); - static DOMMatrixReadOnly* fromFloat32Array(NotShared<DOMFloat32Array>, - ExceptionState&); - static DOMMatrixReadOnly* fromFloat64Array(NotShared<DOMFloat64Array>, - ExceptionState&); + static DOMMatrixReadOnly* fromFloat32Array(DOMFloat32Array*, ExceptionState&); + static DOMMatrixReadOnly* fromFloat64Array(DOMFloat64Array*, ExceptionState&); static DOMMatrixReadOnly* fromMatrix(DOMMatrixInit&, ExceptionState&); virtual ~DOMMatrixReadOnly(); @@ -92,8 +89,8 @@ DOMPoint* transformPoint(const DOMPointInit&); - NotShared<DOMFloat32Array> toFloat32Array() const; - NotShared<DOMFloat64Array> toFloat64Array() const; + DOMFloat32Array* toFloat32Array() const; + DOMFloat64Array* toFloat64Array() const; const String toString() const;
diff --git a/third_party/WebKit/Source/core/html/CrossOriginAttribute.cpp b/third_party/WebKit/Source/core/html/CrossOriginAttribute.cpp index c3adb9f..d56a722 100644 --- a/third_party/WebKit/Source/core/html/CrossOriginAttribute.cpp +++ b/third_party/WebKit/Source/core/html/CrossOriginAttribute.cpp
@@ -9,7 +9,7 @@ CrossOriginAttributeValue GetCrossOriginAttributeValue(const String& value) { if (value.IsNull()) return kCrossOriginAttributeNotSet; - if (EqualIgnoringCase(value, "use-credentials")) + if (DeprecatedEqualIgnoringCase(value, "use-credentials")) return kCrossOriginAttributeUseCredentials; return kCrossOriginAttributeAnonymous; }
diff --git a/third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp b/third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp index aa070a2..1abf5d0 100644 --- a/third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp
@@ -240,9 +240,9 @@ bool HTMLAnchorElement::draggable() const { // Should be draggable if we have an href attribute. const AtomicString& value = getAttribute(draggableAttr); - if (EqualIgnoringCase(value, "true")) + if (DeprecatedEqualIgnoringCase(value, "true")) return true; - if (EqualIgnoringCase(value, "false")) + if (DeprecatedEqualIgnoringCase(value, "false")) return false; return hasAttribute(hrefAttr); }
diff --git a/third_party/WebKit/Source/core/html/HTMLBRElement.cpp b/third_party/WebKit/Source/core/html/HTMLBRElement.cpp index 76cc5fc..85eed16a 100644 --- a/third_party/WebKit/Source/core/html/HTMLBRElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLBRElement.cpp
@@ -51,7 +51,7 @@ // <br clear> and <br clear=""> are just treated like <br> by Gecko, Mac IE, // etc. -dwh if (!value.IsEmpty()) { - if (EqualIgnoringCase(value, "all")) + if (DeprecatedEqualIgnoringCase(value, "all")) AddPropertyToPresentationAttributeStyle(style, CSSPropertyClear, CSSValueBoth); else
diff --git a/third_party/WebKit/Source/core/html/HTMLButtonElement.cpp b/third_party/WebKit/Source/core/html/HTMLButtonElement.cpp index fb3ec665..8df534c 100644 --- a/third_party/WebKit/Source/core/html/HTMLButtonElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLButtonElement.cpp
@@ -88,9 +88,9 @@ void HTMLButtonElement::ParseAttribute( const AttributeModificationParams& params) { if (params.name == typeAttr) { - if (EqualIgnoringCase(params.new_value, "reset")) + if (DeprecatedEqualIgnoringCase(params.new_value, "reset")) type_ = RESET; - else if (EqualIgnoringCase(params.new_value, "button")) + else if (DeprecatedEqualIgnoringCase(params.new_value, "button")) type_ = BUTTON; else type_ = SUBMIT;
diff --git a/third_party/WebKit/Source/core/html/HTMLDivElement.cpp b/third_party/WebKit/Source/core/html/HTMLDivElement.cpp index 7bac9806..2586970e 100644 --- a/third_party/WebKit/Source/core/html/HTMLDivElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLDivElement.cpp
@@ -40,14 +40,14 @@ const AtomicString& value, MutableStylePropertySet* style) { if (name == alignAttr) { - if (EqualIgnoringCase(value, "middle") || - EqualIgnoringCase(value, "center")) + if (DeprecatedEqualIgnoringCase(value, "middle") || + DeprecatedEqualIgnoringCase(value, "center")) AddPropertyToPresentationAttributeStyle(style, CSSPropertyTextAlign, CSSValueWebkitCenter); - else if (EqualIgnoringCase(value, "left")) + else if (DeprecatedEqualIgnoringCase(value, "left")) AddPropertyToPresentationAttributeStyle(style, CSSPropertyTextAlign, CSSValueWebkitLeft); - else if (EqualIgnoringCase(value, "right")) + else if (DeprecatedEqualIgnoringCase(value, "right")) AddPropertyToPresentationAttributeStyle(style, CSSPropertyTextAlign, CSSValueWebkitRight); else
diff --git a/third_party/WebKit/Source/core/html/HTMLElement.cpp b/third_party/WebKit/Source/core/html/HTMLElement.cpp index a5c665d6..30e18d2 100644 --- a/third_party/WebKit/Source/core/html/HTMLElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLElement.cpp
@@ -205,7 +205,7 @@ first_separator = ui_language.Find('_'); if (first_separator != kNotFound) ui_language = ui_language.Left(first_separator); - if (!EqualIgnoringCase(html_language, ui_language)) + if (!DeprecatedEqualIgnoringCase(html_language, ui_language)) UseCounter::Count(GetDocument(), UseCounter::kLangAttributeDoesNotMatchToUILocale); } else { @@ -224,8 +224,9 @@ } static inline bool IsValidDirAttribute(const AtomicString& value) { - return EqualIgnoringCase(value, "auto") || EqualIgnoringCase(value, "ltr") || - EqualIgnoringCase(value, "rtl"); + return DeprecatedEqualIgnoringCase(value, "auto") || + DeprecatedEqualIgnoringCase(value, "ltr") || + DeprecatedEqualIgnoringCase(value, "rtl"); } void HTMLElement::CollectStyleForPresentationAttribute( @@ -233,14 +234,14 @@ const AtomicString& value, MutableStylePropertySet* style) { if (name == alignAttr) { - if (EqualIgnoringCase(value, "middle")) + if (DeprecatedEqualIgnoringCase(value, "middle")) AddPropertyToPresentationAttributeStyle(style, CSSPropertyTextAlign, CSSValueCenter); else AddPropertyToPresentationAttributeStyle(style, CSSPropertyTextAlign, value); } else if (name == contenteditableAttr) { - if (value.IsEmpty() || EqualIgnoringCase(value, "true")) { + if (value.IsEmpty() || DeprecatedEqualIgnoringCase(value, "true")) { AddPropertyToPresentationAttributeStyle( style, CSSPropertyWebkitUserModify, CSSValueReadWrite); AddPropertyToPresentationAttributeStyle(style, CSSPropertyWordWrap, @@ -251,7 +252,7 @@ if (HasTagName(htmlTag)) UseCounter::Count(GetDocument(), UseCounter::kContentEditableTrueOnHTML); - } else if (EqualIgnoringCase(value, "plaintext-only")) { + } else if (DeprecatedEqualIgnoringCase(value, "plaintext-only")) { AddPropertyToPresentationAttributeStyle( style, CSSPropertyWebkitUserModify, CSSValueReadWritePlaintextOnly); AddPropertyToPresentationAttributeStyle(style, CSSPropertyWordWrap, @@ -260,7 +261,7 @@ CSSValueAfterWhiteSpace); UseCounter::Count(GetDocument(), UseCounter::kContentEditablePlainTextOnly); - } else if (EqualIgnoringCase(value, "false")) { + } else if (DeprecatedEqualIgnoringCase(value, "false")) { AddPropertyToPresentationAttributeStyle( style, CSSPropertyWebkitUserModify, CSSValueReadOnly); } @@ -269,17 +270,17 @@ CSSValueNone); } else if (name == draggableAttr) { UseCounter::Count(GetDocument(), UseCounter::kDraggableAttribute); - if (EqualIgnoringCase(value, "true")) { + if (DeprecatedEqualIgnoringCase(value, "true")) { AddPropertyToPresentationAttributeStyle(style, CSSPropertyWebkitUserDrag, CSSValueElement); AddPropertyToPresentationAttributeStyle(style, CSSPropertyUserSelect, CSSValueNone); - } else if (EqualIgnoringCase(value, "false")) { + } else if (DeprecatedEqualIgnoringCase(value, "false")) { AddPropertyToPresentationAttributeStyle(style, CSSPropertyWebkitUserDrag, CSSValueNone); } } else if (name == dirAttr) { - if (EqualIgnoringCase(value, "auto")) { + if (DeprecatedEqualIgnoringCase(value, "auto")) { AddPropertyToPresentationAttributeStyle( style, CSSPropertyUnicodeBidi, UnicodeBidiAttributeForDirAuto(this)); } else { @@ -591,25 +592,25 @@ CSSValueID float_value = CSSValueInvalid; CSSValueID vertical_align_value = CSSValueInvalid; - if (EqualIgnoringCase(alignment, "absmiddle")) { + if (DeprecatedEqualIgnoringCase(alignment, "absmiddle")) { vertical_align_value = CSSValueMiddle; - } else if (EqualIgnoringCase(alignment, "absbottom")) { + } else if (DeprecatedEqualIgnoringCase(alignment, "absbottom")) { vertical_align_value = CSSValueBottom; - } else if (EqualIgnoringCase(alignment, "left")) { + } else if (DeprecatedEqualIgnoringCase(alignment, "left")) { float_value = CSSValueLeft; vertical_align_value = CSSValueTop; - } else if (EqualIgnoringCase(alignment, "right")) { + } else if (DeprecatedEqualIgnoringCase(alignment, "right")) { float_value = CSSValueRight; vertical_align_value = CSSValueTop; - } else if (EqualIgnoringCase(alignment, "top")) { + } else if (DeprecatedEqualIgnoringCase(alignment, "top")) { vertical_align_value = CSSValueTop; - } else if (EqualIgnoringCase(alignment, "middle")) { + } else if (DeprecatedEqualIgnoringCase(alignment, "middle")) { vertical_align_value = CSSValueWebkitBaselineMiddle; - } else if (EqualIgnoringCase(alignment, "center")) { + } else if (DeprecatedEqualIgnoringCase(alignment, "center")) { vertical_align_value = CSSValueMiddle; - } else if (EqualIgnoringCase(alignment, "bottom")) { + } else if (DeprecatedEqualIgnoringCase(alignment, "bottom")) { vertical_align_value = CSSValueBaseline; - } else if (EqualIgnoringCase(alignment, "texttop")) { + } else if (DeprecatedEqualIgnoringCase(alignment, "texttop")) { vertical_align_value = CSSValueTextTop; } @@ -631,11 +632,11 @@ if (value.IsNull()) return "inherit"; - if (value.IsEmpty() || EqualIgnoringCase(value, "true")) + if (value.IsEmpty() || DeprecatedEqualIgnoringCase(value, "true")) return "true"; - if (EqualIgnoringCase(value, "false")) + if (DeprecatedEqualIgnoringCase(value, "false")) return "false"; - if (EqualIgnoringCase(value, "plaintext-only")) + if (DeprecatedEqualIgnoringCase(value, "plaintext-only")) return "plaintext-only"; return "inherit"; @@ -643,13 +644,13 @@ void HTMLElement::setContentEditable(const String& enabled, ExceptionState& exception_state) { - if (EqualIgnoringCase(enabled, "true")) + if (DeprecatedEqualIgnoringCase(enabled, "true")) setAttribute(contenteditableAttr, "true"); - else if (EqualIgnoringCase(enabled, "false")) + else if (DeprecatedEqualIgnoringCase(enabled, "false")) setAttribute(contenteditableAttr, "false"); - else if (EqualIgnoringCase(enabled, "plaintext-only")) + else if (DeprecatedEqualIgnoringCase(enabled, "plaintext-only")) setAttribute(contenteditableAttr, "plaintext-only"); - else if (EqualIgnoringCase(enabled, "inherit")) + else if (DeprecatedEqualIgnoringCase(enabled, "inherit")) removeAttribute(contenteditableAttr); else exception_state.ThrowDOMException(kSyntaxError, @@ -663,7 +664,7 @@ } bool HTMLElement::draggable() const { - return EqualIgnoringCase(getAttribute(draggableAttr), "true"); + return DeprecatedEqualIgnoringCase(getAttribute(draggableAttr), "true"); } void HTMLElement::setDraggable(bool value) { @@ -703,9 +704,10 @@ if (value == g_null_atom) return kTranslateAttributeInherit; - if (EqualIgnoringCase(value, "yes") || EqualIgnoringCase(value, "")) + if (DeprecatedEqualIgnoringCase(value, "yes") || + DeprecatedEqualIgnoringCase(value, "")) return kTranslateAttributeYes; - if (EqualIgnoringCase(value, "no")) + if (DeprecatedEqualIgnoringCase(value, "no")) return kTranslateAttributeNo; return kTranslateAttributeInherit; @@ -740,11 +742,11 @@ DEFINE_STATIC_LOCAL(const AtomicString, rtl_value, ("rtl")); DEFINE_STATIC_LOCAL(const AtomicString, auto_value, ("auto")); - if (EqualIgnoringCase(value, ltr_value)) + if (DeprecatedEqualIgnoringCase(value, ltr_value)) return ltr_value; - if (EqualIgnoringCase(value, rtl_value)) + if (DeprecatedEqualIgnoringCase(value, rtl_value)) return rtl_value; - if (EqualIgnoringCase(value, auto_value)) + if (DeprecatedEqualIgnoringCase(value, auto_value)) return auto_value; return g_null_atom; } @@ -776,7 +778,7 @@ // https://html.spec.whatwg.org/multipage/semantics.html#the-bdi-element const AtomicString& direction = FastGetAttribute(dirAttr); return (isHTMLBDIElement(*this) && direction == g_null_atom) || - EqualIgnoringCase(direction, "auto"); + DeprecatedEqualIgnoringCase(direction, "auto"); } TextDirection HTMLElement::DirectionalityIfhasDirAutoAttribute( @@ -804,7 +806,7 @@ Node* node = FlatTreeTraversal::FirstChild(*this); while (node) { // Skip bdi, script, style and text form controls. - if (EqualIgnoringCase(node->nodeName(), "bdi") || + if (DeprecatedEqualIgnoringCase(node->nodeName(), "bdi") || isHTMLScriptElement(*node) || isHTMLStyleElement(*node) || (node->IsElementNode() && ToElement(node)->IsTextControl()) || (node->IsElementNode() && @@ -861,7 +863,7 @@ ToHTMLElement(parent) ->AdjustDirectionalityIfNeededAfterChildAttributeChanged(this); - if (EqualIgnoringCase(value, "auto")) + if (DeprecatedEqualIgnoringCase(value, "auto")) CalculateAndAdjustDirectionality(); } @@ -1009,7 +1011,7 @@ String color_string = attribute_value.StripWhiteSpace(); // "transparent" doesn't apply a color either. - if (EqualIgnoringCase(color_string, "transparent")) + if (DeprecatedEqualIgnoringCase(color_string, "transparent")) return false; // If the string is a 3/6-digit hex color or a named CSS color, use that. @@ -1106,10 +1108,10 @@ if (FastHasAttribute(contenteditableAttr)) { const AtomicString& value = FastGetAttribute(contenteditableAttr); - if (value.IsEmpty() || EqualIgnoringCase(value, "true") || - EqualIgnoringCase(value, "plaintext-only")) + if (value.IsEmpty() || DeprecatedEqualIgnoringCase(value, "true") || + DeprecatedEqualIgnoringCase(value, "plaintext-only")) return true; - if (EqualIgnoringCase(value, "false")) + if (DeprecatedEqualIgnoringCase(value, "false")) return false; // All other values should be treated as "inherit". }
diff --git a/third_party/WebKit/Source/core/html/HTMLEmbedElement.cpp b/third_party/WebKit/Source/core/html/HTMLEmbedElement.cpp index 720401dc..8fb05dc 100644 --- a/third_party/WebKit/Source/core/html/HTMLEmbedElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLEmbedElement.cpp
@@ -81,7 +81,8 @@ const AtomicString& value, MutableStylePropertySet* style) { if (name == hiddenAttr) { - if (EqualIgnoringCase(value, "yes") || EqualIgnoringCase(value, "true")) { + if (DeprecatedEqualIgnoringCase(value, "yes") || + DeprecatedEqualIgnoringCase(value, "true")) { AddPropertyToPresentationAttributeStyle( style, CSSPropertyWidth, 0, CSSPrimitiveValue::UnitType::kPixels); AddPropertyToPresentationAttributeStyle(
diff --git a/third_party/WebKit/Source/core/html/HTMLFormElement.cpp b/third_party/WebKit/Source/core/html/HTMLFormElement.cpp index ce81ebe..d14303a9 100644 --- a/third_party/WebKit/Source/core/html/HTMLFormElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLFormElement.cpp
@@ -771,7 +771,8 @@ } bool HTMLFormElement::ShouldAutocomplete() const { - return !EqualIgnoringCase(FastGetAttribute(autocompleteAttr), "off"); + return !DeprecatedEqualIgnoringCase(FastGetAttribute(autocompleteAttr), + "off"); } void HTMLFormElement::FinishParsingChildren() {
diff --git a/third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp b/third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp index ca3bb0fb..6c41556 100644 --- a/third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp +++ b/third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp
@@ -149,9 +149,10 @@ } else if (name == scrollingAttr) { // Auto and yes both simply mean "allow scrolling." No means "don't allow // scrolling." - if (EqualIgnoringCase(value, "auto") || EqualIgnoringCase(value, "yes")) + if (DeprecatedEqualIgnoringCase(value, "auto") || + DeprecatedEqualIgnoringCase(value, "yes")) SetScrollingMode(kScrollbarAuto); - else if (EqualIgnoringCase(value, "no")) + else if (DeprecatedEqualIgnoringCase(value, "no")) SetScrollingMode(kScrollbarAlwaysOff); } else if (name == onbeforeunloadAttr) { // FIXME: should <frame> elements have beforeunload handlers?
diff --git a/third_party/WebKit/Source/core/html/HTMLFrameSetElement.cpp b/third_party/WebKit/Source/core/html/HTMLFrameSetElement.cpp index ae215b0..ba1fbf4 100644 --- a/third_party/WebKit/Source/core/html/HTMLFrameSetElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLFrameSetElement.cpp
@@ -88,11 +88,12 @@ } } else if (name == frameborderAttr) { if (!value.IsNull()) { - if (EqualIgnoringCase(value, "no") || EqualIgnoringCase(value, "0")) { + if (DeprecatedEqualIgnoringCase(value, "no") || + DeprecatedEqualIgnoringCase(value, "0")) { frameborder_ = false; frameborder_set_ = true; - } else if (EqualIgnoringCase(value, "yes") || - EqualIgnoringCase(value, "1")) { + } else if (DeprecatedEqualIgnoringCase(value, "yes") || + DeprecatedEqualIgnoringCase(value, "1")) { frameborder_set_ = true; } } else {
diff --git a/third_party/WebKit/Source/core/html/HTMLHRElement.cpp b/third_party/WebKit/Source/core/html/HTMLHRElement.cpp index adbbe3b..a2fd9af1 100644 --- a/third_party/WebKit/Source/core/html/HTMLHRElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLHRElement.cpp
@@ -52,13 +52,13 @@ const AtomicString& value, MutableStylePropertySet* style) { if (name == alignAttr) { - if (EqualIgnoringCase(value, "left")) { + if (DeprecatedEqualIgnoringCase(value, "left")) { AddPropertyToPresentationAttributeStyle( style, CSSPropertyMarginLeft, 0, CSSPrimitiveValue::UnitType::kPixels); AddPropertyToPresentationAttributeStyle(style, CSSPropertyMarginRight, CSSValueAuto); - } else if (EqualIgnoringCase(value, "right")) { + } else if (DeprecatedEqualIgnoringCase(value, "right")) { AddPropertyToPresentationAttributeStyle(style, CSSPropertyMarginLeft, CSSValueAuto); AddPropertyToPresentationAttributeStyle(
diff --git a/third_party/WebKit/Source/core/html/HTMLImageElement.cpp b/third_party/WebKit/Source/core/html/HTMLImageElement.cpp index b601f1c..dc56d4c7 100644 --- a/third_party/WebKit/Source/core/html/HTMLImageElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLImageElement.cpp
@@ -555,7 +555,7 @@ bool HTMLImageElement::draggable() const { // Image elements are draggable by default. - return !EqualIgnoringCase(getAttribute(draggableAttr), "false"); + return !DeprecatedEqualIgnoringCase(getAttribute(draggableAttr), "false"); } void HTMLImageElement::setHeight(unsigned value) {
diff --git a/third_party/WebKit/Source/core/html/HTMLInputElement.cpp b/third_party/WebKit/Source/core/html/HTMLInputElement.cpp index ffdbb3fa..31abd515 100644 --- a/third_party/WebKit/Source/core/html/HTMLInputElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLInputElement.cpp
@@ -699,7 +699,7 @@ AddToRadioButtonGroup(); TextControlElement::ParseAttribute(params); } else if (name == autocompleteAttr) { - if (EqualIgnoringCase(value, "off")) { + if (DeprecatedEqualIgnoringCase(value, "off")) { autocomplete_ = kOff; } else { if (value.IsEmpty())
diff --git a/third_party/WebKit/Source/core/html/HTMLLIElement.cpp b/third_party/WebKit/Source/core/html/HTMLLIElement.cpp index e1bfc1cc..5bb7beb 100644 --- a/third_party/WebKit/Source/core/html/HTMLLIElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLLIElement.cpp
@@ -56,13 +56,13 @@ return CSSValueUpperRoman; if (value == "1") return CSSValueDecimal; - if (EqualIgnoringCase(value, "disc")) + if (DeprecatedEqualIgnoringCase(value, "disc")) return CSSValueDisc; - if (EqualIgnoringCase(value, "circle")) + if (DeprecatedEqualIgnoringCase(value, "circle")) return CSSValueCircle; - if (EqualIgnoringCase(value, "square")) + if (DeprecatedEqualIgnoringCase(value, "square")) return CSSValueSquare; - if (EqualIgnoringCase(value, "none")) + if (DeprecatedEqualIgnoringCase(value, "none")) return CSSValueNone; return CSSValueInvalid; }
diff --git a/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp b/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp index 109d2892..48ca73f 100644 --- a/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
@@ -322,7 +322,7 @@ const QualifiedName& HTMLLinkElement::SubResourceAttributeName() const { // If the link element is not css, ignore it. - if (EqualIgnoringCase(getAttribute(typeAttr), "text/css")) { + if (DeprecatedEqualIgnoringCase(getAttribute(typeAttr), "text/css")) { // FIXME: Add support for extracting links of sub-resources which // are inside style-sheet such as @import, @font-face, url(), etc. return hrefAttr;
diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp index e200c38..fd0253d4 100644 --- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
@@ -2229,7 +2229,7 @@ WebMediaPlayer::Preload HTMLMediaElement::PreloadType() const { const AtomicString& preload = FastGetAttribute(preloadAttr); - if (EqualIgnoringCase(preload, "none")) { + if (DeprecatedEqualIgnoringCase(preload, "none")) { UseCounter::Count(GetDocument(), UseCounter::kHTMLMediaElementPreloadNone); return WebMediaPlayer::kPreloadNone; } @@ -2246,7 +2246,7 @@ return WebMediaPlayer::kPreloadNone; } - if (EqualIgnoringCase(preload, "metadata")) { + if (DeprecatedEqualIgnoringCase(preload, "metadata")) { UseCounter::Count(GetDocument(), UseCounter::kHTMLMediaElementPreloadMetadata); return WebMediaPlayer::kPreloadMetaData; @@ -2259,7 +2259,7 @@ return WebMediaPlayer::kPreloadMetaData; } - if (EqualIgnoringCase(preload, "auto")) { + if (DeprecatedEqualIgnoringCase(preload, "auto")) { UseCounter::Count(GetDocument(), UseCounter::kHTMLMediaElementPreloadAuto); return WebMediaPlayer::kPreloadAuto; } @@ -3864,7 +3864,7 @@ const AtomicString& cross_origin_mode = FastGetAttribute(crossoriginAttr); if (cross_origin_mode.IsNull()) return WebMediaPlayer::kCORSModeUnspecified; - if (EqualIgnoringCase(cross_origin_mode, "use-credentials")) + if (DeprecatedEqualIgnoringCase(cross_origin_mode, "use-credentials")) return WebMediaPlayer::kCORSModeUseCredentials; return WebMediaPlayer::kCORSModeAnonymous; }
diff --git a/third_party/WebKit/Source/core/html/HTMLMenuItemElement.cpp b/third_party/WebKit/Source/core/html/HTMLMenuItemElement.cpp index 5bbec3e..20502c4 100644 --- a/third_party/WebKit/Source/core/html/HTMLMenuItemElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLMenuItemElement.cpp
@@ -32,12 +32,13 @@ void HTMLMenuItemElement::DefaultEventHandler(Event* event) { if (event->type() == EventTypeNames::click) { - if (EqualIgnoringCase(FastGetAttribute(typeAttr), "checkbox")) { + if (DeprecatedEqualIgnoringCase(FastGetAttribute(typeAttr), "checkbox")) { if (FastHasAttribute(checkedAttr)) removeAttribute(checkedAttr); else setAttribute(checkedAttr, "checked"); - } else if (EqualIgnoringCase(FastGetAttribute(typeAttr), "radio")) { + } else if (DeprecatedEqualIgnoringCase(FastGetAttribute(typeAttr), + "radio")) { if (Element* parent = parentElement()) { AtomicString group = FastGetAttribute(radiogroupAttr); for (HTMLMenuItemElement& menu_item :
diff --git a/third_party/WebKit/Source/core/html/HTMLMetaElement.cpp b/third_party/WebKit/Source/core/html/HTMLMetaElement.cpp index 5f4b37ebc..a583f61c 100644 --- a/third_party/WebKit/Source/core/html/HTMLMetaElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLMetaElement.cpp
@@ -182,9 +182,9 @@ // 3) device-width and device-height are used as keywords. // 4) Other keywords and unknown values translate to 0.0. - if (EqualIgnoringCase(value_string, "device-width")) + if (DeprecatedEqualIgnoringCase(value_string, "device-width")) return Length(kDeviceWidth); - if (EqualIgnoringCase(value_string, "device-height")) + if (DeprecatedEqualIgnoringCase(value_string, "device-height")) return Length(kDeviceHeight); float value = @@ -210,13 +210,13 @@ // 5) no and unknown values are translated to 0.0 computed_value_matches_parsed_value = false; - if (EqualIgnoringCase(value_string, "yes")) + if (DeprecatedEqualIgnoringCase(value_string, "yes")) return 1; - if (EqualIgnoringCase(value_string, "no")) + if (DeprecatedEqualIgnoringCase(value_string, "no")) return 0; - if (EqualIgnoringCase(value_string, "device-width")) + if (DeprecatedEqualIgnoringCase(value_string, "device-width")) return 10; - if (EqualIgnoringCase(value_string, "device-height")) + if (DeprecatedEqualIgnoringCase(value_string, "device-height")) return 10; float value = @@ -251,17 +251,17 @@ // Numbers in the range <-1, 1>, and unknown values, are mapped to no. computed_value_matches_parsed_value = false; - if (EqualIgnoringCase(value_string, "yes")) { + if (DeprecatedEqualIgnoringCase(value_string, "yes")) { computed_value_matches_parsed_value = true; return true; } - if (EqualIgnoringCase(value_string, "no")) { + if (DeprecatedEqualIgnoringCase(value_string, "no")) { computed_value_matches_parsed_value = true; return false; } - if (EqualIgnoringCase(value_string, "device-width")) + if (DeprecatedEqualIgnoringCase(value_string, "device-width")) return true; - if (EqualIgnoringCase(value_string, "device-height")) + if (DeprecatedEqualIgnoringCase(value_string, "device-height")) return true; float value = @@ -276,13 +276,13 @@ bool report_warnings, const String& key_string, const String& value_string) { - if (EqualIgnoringCase(value_string, "device-dpi")) + if (DeprecatedEqualIgnoringCase(value_string, "device-dpi")) return ViewportDescription::kValueDeviceDPI; - if (EqualIgnoringCase(value_string, "low-dpi")) + if (DeprecatedEqualIgnoringCase(value_string, "low-dpi")) return ViewportDescription::kValueLowDPI; - if (EqualIgnoringCase(value_string, "medium-dpi")) + if (DeprecatedEqualIgnoringCase(value_string, "medium-dpi")) return ViewportDescription::kValueMediumDPI; - if (EqualIgnoringCase(value_string, "high-dpi")) + if (DeprecatedEqualIgnoringCase(value_string, "high-dpi")) return ViewportDescription::kValueHighDPI; bool ok; @@ -473,21 +473,21 @@ const AtomicString& name_value = FastGetAttribute(nameAttr); if (!name_value.IsEmpty()) { - if (EqualIgnoringCase(name_value, "viewport")) + if (DeprecatedEqualIgnoringCase(name_value, "viewport")) ProcessViewportContentAttribute(content_value, ViewportDescription::kViewportMeta); - else if (EqualIgnoringCase(name_value, "referrer")) + else if (DeprecatedEqualIgnoringCase(name_value, "referrer")) GetDocument().ParseAndSetReferrerPolicy( content_value, true /* support legacy keywords */); - else if (EqualIgnoringCase(name_value, "handheldfriendly") && - EqualIgnoringCase(content_value, "true")) + else if (DeprecatedEqualIgnoringCase(name_value, "handheldfriendly") && + DeprecatedEqualIgnoringCase(content_value, "true")) ProcessViewportContentAttribute( "width=device-width", ViewportDescription::kHandheldFriendlyMeta); - else if (EqualIgnoringCase(name_value, "mobileoptimized")) + else if (DeprecatedEqualIgnoringCase(name_value, "mobileoptimized")) ProcessViewportContentAttribute( "width=device-width, initial-scale=1", ViewportDescription::kMobileOptimizedMeta); - else if (EqualIgnoringCase(name_value, "theme-color") && + else if (DeprecatedEqualIgnoringCase(name_value, "theme-color") && GetDocument().GetFrame()) GetDocument() .GetFrame()
diff --git a/third_party/WebKit/Source/core/html/HTMLObjectElement.cpp b/third_party/WebKit/Source/core/html/HTMLObjectElement.cpp index df19edc8..016cc6f 100644 --- a/third_party/WebKit/Source/core/html/HTMLObjectElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLObjectElement.cpp
@@ -133,9 +133,9 @@ // Real and WMP require "src" attribute). int src_index = -1, data_index = -1; for (unsigned i = 0; i < param_names->size(); ++i) { - if (EqualIgnoringCase((*param_names)[i], "src")) + if (DeprecatedEqualIgnoringCase((*param_names)[i], "src")) src_index = i; - else if (EqualIgnoringCase((*param_names)[i], "data")) + else if (DeprecatedEqualIgnoringCase((*param_names)[i], "data")) data_index = i; } @@ -169,12 +169,14 @@ // TODO(schenney): crbug.com/572908 url adjustment does not belong in this // function. if (url.IsEmpty() && url_parameter.IsEmpty() && - (EqualIgnoringCase(name, "src") || EqualIgnoringCase(name, "movie") || - EqualIgnoringCase(name, "code") || EqualIgnoringCase(name, "url"))) + (DeprecatedEqualIgnoringCase(name, "src") || + DeprecatedEqualIgnoringCase(name, "movie") || + DeprecatedEqualIgnoringCase(name, "code") || + DeprecatedEqualIgnoringCase(name, "url"))) url_parameter = StripLeadingAndTrailingHTMLSpaces(p->Value()); // TODO(schenney): crbug.com/572908 serviceType calculation does not belong // in this function. - if (service_type.IsEmpty() && EqualIgnoringCase(name, "type")) { + if (service_type.IsEmpty() && DeprecatedEqualIgnoringCase(name, "type")) { service_type = p->Value(); size_t pos = service_type.Find(";"); if (pos != kNotFound) @@ -428,7 +430,7 @@ for (HTMLElement& child : Traversal<HTMLElement>::ChildrenOf(*this)) { if (isHTMLParamElement(child) && - EqualIgnoringCase(child.GetNameAttribute(), "type") && + DeprecatedEqualIgnoringCase(child.GetNameAttribute(), "type") && MIMETypeRegistry::IsJavaAppletMIMEType( child.getAttribute(valueAttr).GetString())) return true;
diff --git a/third_party/WebKit/Source/core/html/HTMLParagraphElement.cpp b/third_party/WebKit/Source/core/html/HTMLParagraphElement.cpp index bd0821f5..94b9b8b 100644 --- a/third_party/WebKit/Source/core/html/HTMLParagraphElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLParagraphElement.cpp
@@ -40,14 +40,14 @@ const AtomicString& value, MutableStylePropertySet* style) { if (name == alignAttr) { - if (EqualIgnoringCase(value, "middle") || - EqualIgnoringCase(value, "center")) + if (DeprecatedEqualIgnoringCase(value, "middle") || + DeprecatedEqualIgnoringCase(value, "center")) AddPropertyToPresentationAttributeStyle(style, CSSPropertyTextAlign, CSSValueWebkitCenter); - else if (EqualIgnoringCase(value, "left")) + else if (DeprecatedEqualIgnoringCase(value, "left")) AddPropertyToPresentationAttributeStyle(style, CSSPropertyTextAlign, CSSValueWebkitLeft); - else if (EqualIgnoringCase(value, "right")) + else if (DeprecatedEqualIgnoringCase(value, "right")) AddPropertyToPresentationAttributeStyle(style, CSSPropertyTextAlign, CSSValueWebkitRight); else
diff --git a/third_party/WebKit/Source/core/html/HTMLParamElement.cpp b/third_party/WebKit/Source/core/html/HTMLParamElement.cpp index a168088..e2c9771 100644 --- a/third_party/WebKit/Source/core/html/HTMLParamElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLParamElement.cpp
@@ -46,8 +46,9 @@ } bool HTMLParamElement::IsURLParameter(const String& name) { - return EqualIgnoringCase(name, "data") || EqualIgnoringCase(name, "movie") || - EqualIgnoringCase(name, "src"); + return DeprecatedEqualIgnoringCase(name, "data") || + DeprecatedEqualIgnoringCase(name, "movie") || + DeprecatedEqualIgnoringCase(name, "src"); } bool HTMLParamElement::IsURLAttribute(const Attribute& attribute) const {
diff --git a/third_party/WebKit/Source/core/html/HTMLTableElement.cpp b/third_party/WebKit/Source/core/html/HTMLTableElement.cpp index 89a9080a..abae97aa 100644 --- a/third_party/WebKit/Source/core/html/HTMLTableElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLTableElement.cpp
@@ -277,22 +277,22 @@ border_bottom = false; border_left = false; - if (EqualIgnoringCase(value, "above")) + if (DeprecatedEqualIgnoringCase(value, "above")) border_top = true; - else if (EqualIgnoringCase(value, "below")) + else if (DeprecatedEqualIgnoringCase(value, "below")) border_bottom = true; - else if (EqualIgnoringCase(value, "hsides")) + else if (DeprecatedEqualIgnoringCase(value, "hsides")) border_top = border_bottom = true; - else if (EqualIgnoringCase(value, "vsides")) + else if (DeprecatedEqualIgnoringCase(value, "vsides")) border_left = border_right = true; - else if (EqualIgnoringCase(value, "lhs")) + else if (DeprecatedEqualIgnoringCase(value, "lhs")) border_left = true; - else if (EqualIgnoringCase(value, "rhs")) + else if (DeprecatedEqualIgnoringCase(value, "rhs")) border_right = true; - else if (EqualIgnoringCase(value, "box") || - EqualIgnoringCase(value, "border")) + else if (DeprecatedEqualIgnoringCase(value, "box") || + DeprecatedEqualIgnoringCase(value, "border")) border_top = border_bottom = border_left = border_right = true; - else if (!EqualIgnoringCase(value, "void")) + else if (!DeprecatedEqualIgnoringCase(value, "void")) return false; return true; } @@ -337,7 +337,7 @@ } } else if (name == alignAttr) { if (!value.IsEmpty()) { - if (EqualIgnoringCase(value, "center")) { + if (DeprecatedEqualIgnoringCase(value, "center")) { AddPropertyToPresentationAttributeStyle( style, CSSPropertyWebkitMarginStart, CSSValueAuto); AddPropertyToPresentationAttributeStyle( @@ -411,15 +411,15 @@ params.new_value, border_top, border_right, border_bottom, border_left); } else if (name == rulesAttr) { rules_attr_ = kUnsetRules; - if (EqualIgnoringCase(params.new_value, "none")) + if (DeprecatedEqualIgnoringCase(params.new_value, "none")) rules_attr_ = kNoneRules; - else if (EqualIgnoringCase(params.new_value, "groups")) + else if (DeprecatedEqualIgnoringCase(params.new_value, "groups")) rules_attr_ = kGroupsRules; - else if (EqualIgnoringCase(params.new_value, "rows")) + else if (DeprecatedEqualIgnoringCase(params.new_value, "rows")) rules_attr_ = kRowsRules; - else if (EqualIgnoringCase(params.new_value, "cols")) + else if (DeprecatedEqualIgnoringCase(params.new_value, "cols")) rules_attr_ = kColsRules; - else if (EqualIgnoringCase(params.new_value, "all")) + else if (DeprecatedEqualIgnoringCase(params.new_value, "all")) rules_attr_ = kAllRules; } else if (params.name == cellpaddingAttr) { if (!params.new_value.IsEmpty())
diff --git a/third_party/WebKit/Source/core/html/HTMLTablePartElement.cpp b/third_party/WebKit/Source/core/html/HTMLTablePartElement.cpp index 90880a6d..fbd48978 100644 --- a/third_party/WebKit/Source/core/html/HTMLTablePartElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLTablePartElement.cpp
@@ -67,33 +67,33 @@ style->SetProperty(CSSProperty(CSSPropertyBackgroundImage, *image_value)); } } else if (name == valignAttr) { - if (EqualIgnoringCase(value, "top")) + if (DeprecatedEqualIgnoringCase(value, "top")) AddPropertyToPresentationAttributeStyle(style, CSSPropertyVerticalAlign, CSSValueTop); - else if (EqualIgnoringCase(value, "middle")) + else if (DeprecatedEqualIgnoringCase(value, "middle")) AddPropertyToPresentationAttributeStyle(style, CSSPropertyVerticalAlign, CSSValueMiddle); - else if (EqualIgnoringCase(value, "bottom")) + else if (DeprecatedEqualIgnoringCase(value, "bottom")) AddPropertyToPresentationAttributeStyle(style, CSSPropertyVerticalAlign, CSSValueBottom); - else if (EqualIgnoringCase(value, "baseline")) + else if (DeprecatedEqualIgnoringCase(value, "baseline")) AddPropertyToPresentationAttributeStyle(style, CSSPropertyVerticalAlign, CSSValueBaseline); else AddPropertyToPresentationAttributeStyle(style, CSSPropertyVerticalAlign, value); } else if (name == alignAttr) { - if (EqualIgnoringCase(value, "middle") || - EqualIgnoringCase(value, "center")) + if (DeprecatedEqualIgnoringCase(value, "middle") || + DeprecatedEqualIgnoringCase(value, "center")) AddPropertyToPresentationAttributeStyle(style, CSSPropertyTextAlign, CSSValueWebkitCenter); - else if (EqualIgnoringCase(value, "absmiddle")) + else if (DeprecatedEqualIgnoringCase(value, "absmiddle")) AddPropertyToPresentationAttributeStyle(style, CSSPropertyTextAlign, CSSValueCenter); - else if (EqualIgnoringCase(value, "left")) + else if (DeprecatedEqualIgnoringCase(value, "left")) AddPropertyToPresentationAttributeStyle(style, CSSPropertyTextAlign, CSSValueWebkitLeft); - else if (EqualIgnoringCase(value, "right")) + else if (DeprecatedEqualIgnoringCase(value, "right")) AddPropertyToPresentationAttributeStyle(style, CSSPropertyTextAlign, CSSValueWebkitRight); else
diff --git a/third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp b/third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp index f17c368e..57410aa 100644 --- a/third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp
@@ -179,10 +179,11 @@ // deprecated. The soft/hard /off values are a recommendation for HTML 4 // extension by IE and NS 4. WrapMethod wrap; - if (EqualIgnoringCase(value, "physical") || - EqualIgnoringCase(value, "hard") || EqualIgnoringCase(value, "on")) + if (DeprecatedEqualIgnoringCase(value, "physical") || + DeprecatedEqualIgnoringCase(value, "hard") || + DeprecatedEqualIgnoringCase(value, "on")) wrap = kHardWrap; - else if (EqualIgnoringCase(value, "off")) + else if (DeprecatedEqualIgnoringCase(value, "off")) wrap = kNoWrap; else wrap = kSoftWrap;
diff --git a/third_party/WebKit/Source/core/html/HTMLUListElement.cpp b/third_party/WebKit/Source/core/html/HTMLUListElement.cpp index c815669..85f3d947 100644 --- a/third_party/WebKit/Source/core/html/HTMLUListElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLUListElement.cpp
@@ -46,16 +46,16 @@ const AtomicString& value, MutableStylePropertySet* style) { if (name == typeAttr) { - if (EqualIgnoringCase(value, "disc")) + if (DeprecatedEqualIgnoringCase(value, "disc")) AddPropertyToPresentationAttributeStyle(style, CSSPropertyListStyleType, CSSValueDisc); - else if (EqualIgnoringCase(value, "circle")) + else if (DeprecatedEqualIgnoringCase(value, "circle")) AddPropertyToPresentationAttributeStyle(style, CSSPropertyListStyleType, CSSValueCircle); - else if (EqualIgnoringCase(value, "square")) + else if (DeprecatedEqualIgnoringCase(value, "square")) AddPropertyToPresentationAttributeStyle(style, CSSPropertyListStyleType, CSSValueSquare); - else if (EqualIgnoringCase(value, "none")) + else if (DeprecatedEqualIgnoringCase(value, "none")) AddPropertyToPresentationAttributeStyle(style, CSSPropertyListStyleType, CSSValueNone); } else {
diff --git a/third_party/WebKit/Source/core/html/ImageData.cpp b/third_party/WebKit/Source/core/html/ImageData.cpp index b42e161b..91a16a09 100644 --- a/third_party/WebKit/Source/core/html/ImageData.cpp +++ b/third_party/WebKit/Source/core/html/ImageData.cpp
@@ -229,13 +229,12 @@ } ImageData* ImageData::Create(const IntSize& size, - NotShared<DOMArrayBufferView> data_array, + DOMArrayBufferView* data_array, const ImageDataColorSettings* color_settings) { - if (!ImageData::ValidateConstructorArguments(kParamSize | kParamData, &size, - 0, 0, data_array.View(), - color_settings)) + if (!ImageData::ValidateConstructorArguments( + kParamSize | kParamData, &size, 0, 0, data_array, color_settings)) return nullptr; - return new ImageData(size, data_array.View(), color_settings); + return new ImageData(size, data_array, color_settings); } ImageData* ImageData::Create(unsigned width, @@ -252,28 +251,28 @@ : nullptr; } -ImageData* ImageData::Create(NotShared<DOMUint8ClampedArray> data, +ImageData* ImageData::Create(DOMUint8ClampedArray* data, unsigned width, ExceptionState& exception_state) { if (!ImageData::ValidateConstructorArguments(kParamData | kParamWidth, - nullptr, width, 0, data.View(), - nullptr, &exception_state)) + nullptr, width, 0, data, nullptr, + &exception_state)) return nullptr; - unsigned height = data.View()->length() / (width * 4); - return new ImageData(IntSize(width, height), data.View()); + unsigned height = data->length() / (width * 4); + return new ImageData(IntSize(width, height), data); } -ImageData* ImageData::Create(NotShared<DOMUint8ClampedArray> data, +ImageData* ImageData::Create(DOMUint8ClampedArray* data, unsigned width, unsigned height, ExceptionState& exception_state) { if (!ImageData::ValidateConstructorArguments( - kParamData | kParamWidth | kParamHeight, nullptr, width, height, - data.View(), nullptr, &exception_state)) + kParamData | kParamWidth | kParamHeight, nullptr, width, height, data, + nullptr, &exception_state)) return nullptr; - return new ImageData(IntSize(width, height), data.View()); + return new ImageData(IntSize(width, height), data); } ImageData* ImageData::createImageData( @@ -309,13 +308,13 @@ String storage_format_name; if (data.isUint8ClampedArray()) { - buffer_view = data.getAsUint8ClampedArray().View(); + buffer_view = data.getAsUint8ClampedArray(); storage_format_name = kUint8ClampedArrayStorageFormatName; } else if (data.isUint16Array()) { - buffer_view = data.getAsUint16Array().View(); + buffer_view = data.getAsUint16Array(); storage_format_name = kUint16ArrayStorageFormatName; } else if (data.isFloat32Array()) { - buffer_view = data.getAsFloat32Array().View(); + buffer_view = data.getAsFloat32Array(); storage_format_name = kFloat32ArrayStorageFormatName; } else { NOTREACHED();
diff --git a/third_party/WebKit/Source/core/html/ImageData.h b/third_party/WebKit/Source/core/html/ImageData.h index 86f5a59..e0ffd1d2 100644 --- a/third_party/WebKit/Source/core/html/ImageData.h +++ b/third_party/WebKit/Source/core/html/ImageData.h
@@ -33,7 +33,6 @@ #include "bindings/core/v8/Uint8ClampedArrayOrUint16ArrayOrFloat32Array.h" #include "core/CoreExport.h" #include "core/dom/DOMTypedArray.h" -#include "core/dom/NotShared.h" #include "core/html/ImageDataColorSettings.h" #include "core/html/canvas/CanvasRenderingContext.h" #include "core/imagebitmap/ImageBitmapSource.h" @@ -78,14 +77,14 @@ static ImageData* Create(const IntSize&, const ImageDataColorSettings* = nullptr); static ImageData* Create(const IntSize&, - NotShared<DOMArrayBufferView>, + DOMArrayBufferView*, const ImageDataColorSettings* = nullptr); static ImageData* Create(unsigned width, unsigned height, ExceptionState&); - static ImageData* Create(NotShared<DOMUint8ClampedArray>, + static ImageData* Create(DOMUint8ClampedArray*, unsigned width, ExceptionState&); - static ImageData* Create(NotShared<DOMUint8ClampedArray>, + static ImageData* Create(DOMUint8ClampedArray*, unsigned width, unsigned height, ExceptionState&);
diff --git a/third_party/WebKit/Source/core/html/LinkRelAttribute.cpp b/third_party/WebKit/Source/core/html/LinkRelAttribute.cpp index 8e29187e..1c48426 100644 --- a/third_party/WebKit/Source/core/html/LinkRelAttribute.cpp +++ b/third_party/WebKit/Source/core/html/LinkRelAttribute.cpp
@@ -53,40 +53,41 @@ Vector<String> list; rel_copy.Split(' ', list); for (const String& link_type : list) { - if (EqualIgnoringCase(link_type, "stylesheet")) { + if (DeprecatedEqualIgnoringCase(link_type, "stylesheet")) { if (!is_import_) is_style_sheet_ = true; - } else if (EqualIgnoringCase(link_type, "import")) { + } else if (DeprecatedEqualIgnoringCase(link_type, "import")) { if (!is_style_sheet_) is_import_ = true; - } else if (EqualIgnoringCase(link_type, "alternate")) { + } else if (DeprecatedEqualIgnoringCase(link_type, "alternate")) { is_alternate_ = true; - } else if (EqualIgnoringCase(link_type, "icon")) { + } else if (DeprecatedEqualIgnoringCase(link_type, "icon")) { // This also allows "shortcut icon" since we just ignore the non-standard // "shortcut" token. // FIXME: This doesn't really follow the spec that requires "shortcut // icon" to be the entire string // http://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#rel-icon icon_type_ = kFavicon; - } else if (EqualIgnoringCase(link_type, "prefetch")) { + } else if (DeprecatedEqualIgnoringCase(link_type, "prefetch")) { is_link_prefetch_ = true; - } else if (EqualIgnoringCase(link_type, "dns-prefetch")) { + } else if (DeprecatedEqualIgnoringCase(link_type, "dns-prefetch")) { is_dns_prefetch_ = true; - } else if (EqualIgnoringCase(link_type, "preconnect")) { + } else if (DeprecatedEqualIgnoringCase(link_type, "preconnect")) { is_preconnect_ = true; - } else if (EqualIgnoringCase(link_type, "preload")) { + } else if (DeprecatedEqualIgnoringCase(link_type, "preload")) { is_link_preload_ = true; - } else if (EqualIgnoringCase(link_type, "prerender")) { + } else if (DeprecatedEqualIgnoringCase(link_type, "prerender")) { is_link_prerender_ = true; - } else if (EqualIgnoringCase(link_type, "next")) { + } else if (DeprecatedEqualIgnoringCase(link_type, "next")) { is_link_next_ = true; - } else if (EqualIgnoringCase(link_type, "apple-touch-icon")) { + } else if (DeprecatedEqualIgnoringCase(link_type, "apple-touch-icon")) { icon_type_ = kTouchIcon; - } else if (EqualIgnoringCase(link_type, "apple-touch-icon-precomposed")) { + } else if (DeprecatedEqualIgnoringCase(link_type, + "apple-touch-icon-precomposed")) { icon_type_ = kTouchPrecomposedIcon; - } else if (EqualIgnoringCase(link_type, "manifest")) { + } else if (DeprecatedEqualIgnoringCase(link_type, "manifest")) { is_manifest_ = true; - } else if (EqualIgnoringCase(link_type, "serviceworker")) { + } else if (DeprecatedEqualIgnoringCase(link_type, "serviceworker")) { is_service_worker_ = true; } // Adding or removing a value here requires you to update
diff --git a/third_party/WebKit/Source/core/html/TextControlElement.cpp b/third_party/WebKit/Source/core/html/TextControlElement.cpp index 955b426..ade35db 100644 --- a/third_party/WebKit/Source/core/html/TextControlElement.cpp +++ b/third_party/WebKit/Source/core/html/TextControlElement.cpp
@@ -648,13 +648,14 @@ DEFINE_STATIC_LOCAL(const AtomicString, sentences, ("sentences")); const AtomicString& value = FastGetAttribute(autocapitalizeAttr); - if (EqualIgnoringCase(value, none) || EqualIgnoringCase(value, off)) + if (DeprecatedEqualIgnoringCase(value, none) || + DeprecatedEqualIgnoringCase(value, off)) return none; - if (EqualIgnoringCase(value, characters)) + if (DeprecatedEqualIgnoringCase(value, characters)) return characters; - if (EqualIgnoringCase(value, words)) + if (DeprecatedEqualIgnoringCase(value, words)) return words; - if (EqualIgnoringCase(value, sentences)) + if (DeprecatedEqualIgnoringCase(value, sentences)) return sentences; // Invalid or missing value. @@ -936,11 +937,11 @@ if (dir_attribute_value.IsNull()) continue; - if (EqualIgnoringCase(dir_attribute_value, "rtl") || - EqualIgnoringCase(dir_attribute_value, "ltr")) + if (DeprecatedEqualIgnoringCase(dir_attribute_value, "rtl") || + DeprecatedEqualIgnoringCase(dir_attribute_value, "ltr")) return dir_attribute_value; - if (EqualIgnoringCase(dir_attribute_value, "auto")) { + if (DeprecatedEqualIgnoringCase(dir_attribute_value, "auto")) { bool is_auto; TextDirection text_direction = element->DirectionalityIfhasDirAutoAttribute(is_auto);
diff --git a/third_party/WebKit/Source/core/html/forms/ColorInputType.cpp b/third_party/WebKit/Source/core/html/forms/ColorInputType.cpp index eda3781..d294cd8e 100644 --- a/third_party/WebKit/Source/core/html/forms/ColorInputType.cpp +++ b/third_party/WebKit/Source/core/html/forms/ColorInputType.cpp
@@ -173,7 +173,7 @@ } void ColorInputType::WarnIfValueIsInvalid(const String& value) const { - if (!EqualIgnoringCase(value, GetElement().SanitizeValue(value))) + if (!DeprecatedEqualIgnoringCase(value, GetElement().SanitizeValue(value))) AddWarningToConsole( "The specified value %s does not conform to the required format. The " "format is \"#rrggbb\" where rr, gg, bb are two-digit hexadecimal "
diff --git a/third_party/WebKit/Source/core/html/forms/HiddenInputType.cpp b/third_party/WebKit/Source/core/html/forms/HiddenInputType.cpp index 7640fe2..6365ef8 100644 --- a/third_party/WebKit/Source/core/html/forms/HiddenInputType.cpp +++ b/third_party/WebKit/Source/core/html/forms/HiddenInputType.cpp
@@ -99,7 +99,7 @@ } void HiddenInputType::AppendToFormData(FormData& form_data) const { - if (EqualIgnoringCase(GetElement().GetName(), "_charset_")) { + if (DeprecatedEqualIgnoringCase(GetElement().GetName(), "_charset_")) { form_data.append(GetElement().GetName(), String(form_data.Encoding().GetName())); return;
diff --git a/third_party/WebKit/Source/core/html/forms/InputType.cpp b/third_party/WebKit/Source/core/html/forms/InputType.cpp index 40d4fac..6832d73 100644 --- a/third_party/WebKit/Source/core/html/forms/InputType.cpp +++ b/third_party/WebKit/Source/core/html/forms/InputType.cpp
@@ -717,7 +717,7 @@ EventQueueScope scope; Decimal new_value = current; const AtomicString& step_string = GetElement().FastGetAttribute(stepAttr); - if (!EqualIgnoringCase(step_string, "any") && + if (!DeprecatedEqualIgnoringCase(step_string, "any") && step_range.StepMismatch(current)) { // Snap-to-step / clamping steps // If the current value is not matched to step value: @@ -738,7 +738,7 @@ } new_value = new_value + step_range.Step() * Decimal::FromDouble(count); - if (!EqualIgnoringCase(step_string, "any")) + if (!DeprecatedEqualIgnoringCase(step_string, "any")) new_value = step_range.AlignValueForStep(current, new_value); // 7. If the element has a minimum, and value is less than that minimum,
diff --git a/third_party/WebKit/Source/core/html/forms/NumberInputType.cpp b/third_party/WebKit/Source/core/html/forms/NumberInputType.cpp index 6ac6bfeae..39671d84 100644 --- a/third_party/WebKit/Source/core/html/forms/NumberInputType.cpp +++ b/third_party/WebKit/Source/core/html/forms/NumberInputType.cpp
@@ -157,7 +157,7 @@ preferred_size = default_size; const String step_string = GetElement().FastGetAttribute(stepAttr); - if (EqualIgnoringCase(step_string, "any")) + if (DeprecatedEqualIgnoringCase(step_string, "any")) return false; const Decimal minimum =
diff --git a/third_party/WebKit/Source/core/html/forms/RangeInputType.cpp b/third_party/WebKit/Source/core/html/forms/RangeInputType.cpp index 5a6458f..511eeb4 100644 --- a/third_party/WebKit/Source/core/html/forms/RangeInputType.cpp +++ b/third_party/WebKit/Source/core/html/forms/RangeInputType.cpp
@@ -184,10 +184,10 @@ // FIXME: We can't use stepUp() for the step value "any". So, we increase // or decrease the value by 1/100 of the value range. Is it reasonable? - const Decimal step = - EqualIgnoringCase(GetElement().FastGetAttribute(stepAttr), "any") - ? (step_range.Maximum() - step_range.Minimum()) / 100 - : step_range.Step(); + const Decimal step = DeprecatedEqualIgnoringCase( + GetElement().FastGetAttribute(stepAttr), "any") + ? (step_range.Maximum() - step_range.Minimum()) / 100 + : step_range.Step(); const Decimal big_step = std::max((step_range.Maximum() - step_range.Minimum()) / 10, step);
diff --git a/third_party/WebKit/Source/core/html/forms/StepRange.cpp b/third_party/WebKit/Source/core/html/forms/StepRange.cpp index 2d6674f..d0344df 100644 --- a/third_party/WebKit/Source/core/html/forms/StepRange.cpp +++ b/third_party/WebKit/Source/core/html/forms/StepRange.cpp
@@ -109,7 +109,7 @@ if (step_string.IsEmpty()) return step_description.DefaultValue(); - if (EqualIgnoringCase(step_string, "any")) { + if (DeprecatedEqualIgnoringCase(step_string, "any")) { switch (any_step_handling) { case kRejectAny: return Decimal::Nan();
diff --git a/third_party/WebKit/Source/core/html/forms/TextInputType.cpp b/third_party/WebKit/Source/core/html/forms/TextInputType.cpp index 3f72974..141837c 100644 --- a/third_party/WebKit/Source/core/html/forms/TextInputType.cpp +++ b/third_party/WebKit/Source/core/html/forms/TextInputType.cpp
@@ -46,9 +46,9 @@ if (GetElement().FastHasAttribute(maxlengthAttr)) CountUsageIfVisible(UseCounter::kInputTypeTextMaxLength); const AtomicString& type = GetElement().FastGetAttribute(typeAttr); - if (EqualIgnoringCase(type, InputTypeNames::datetime)) + if (DeprecatedEqualIgnoringCase(type, InputTypeNames::datetime)) CountUsageIfVisible(UseCounter::kInputTypeDateTimeFallback); - else if (EqualIgnoringCase(type, InputTypeNames::week)) + else if (DeprecatedEqualIgnoringCase(type, InputTypeNames::week)) CountUsageIfVisible(UseCounter::kInputTypeWeekFallback); }
diff --git a/third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.cpp b/third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.cpp index edfffe96..5020505 100644 --- a/third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.cpp +++ b/third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.cpp
@@ -234,7 +234,7 @@ } void CSSPreloadScanner::EmitRule(const SegmentedString& source) { - if (EqualIgnoringCase(rule_, "import")) { + if (DeprecatedEqualIgnoringCase(rule_, "import")) { String url = ParseCSSStringOrURL(rule_value_.ToString()); TextPosition position = TextPosition(source.CurrentLine(), source.CurrentColumn()); @@ -247,7 +247,7 @@ requests_->push_back(std::move(request)); } state_ = kInitial; - } else if (EqualIgnoringCase(rule_, "charset")) + } else if (DeprecatedEqualIgnoringCase(rule_, "charset")) state_ = kInitial; else state_ = kDoneParsingImportRules;
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp b/third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp index 5866b14..728aae8 100644 --- a/third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp +++ b/third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp
@@ -572,14 +572,16 @@ kTextCaseASCIIInsensitive) || public_id.StartsWith("-//W3O//DTD W3 HTML 3.0//", kTextCaseASCIIInsensitive) || - EqualIgnoringCase(public_id, "-//W3O//DTD W3 HTML Strict 3.0//EN//") || + DeprecatedEqualIgnoringCase(public_id, + "-//W3O//DTD W3 HTML Strict 3.0//EN//") || public_id.StartsWith("-//WebTechs//DTD Mozilla HTML 2.0//", kTextCaseASCIIInsensitive) || public_id.StartsWith("-//WebTechs//DTD Mozilla HTML//", kTextCaseASCIIInsensitive) || - EqualIgnoringCase(public_id, "-/W3C/DTD HTML 4.0 Transitional/EN") || - EqualIgnoringCase(public_id, "HTML") || - EqualIgnoringCase( + DeprecatedEqualIgnoringCase(public_id, + "-/W3C/DTD HTML 4.0 Transitional/EN") || + DeprecatedEqualIgnoringCase(public_id, "HTML") || + DeprecatedEqualIgnoringCase( system_id, "http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd") || (system_id.IsEmpty() &&
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLElementStack.cpp b/third_party/WebKit/Source/core/html/parser/HTMLElementStack.cpp index 2c1bf45..22a78725 100644 --- a/third_party/WebKit/Source/core/html/parser/HTMLElementStack.cpp +++ b/third_party/WebKit/Source/core/html/parser/HTMLElementStack.cpp
@@ -245,8 +245,8 @@ item->GetAttributeItem(MathMLNames::encodingAttr); if (encoding_attr) { const String& encoding = encoding_attr->Value(); - return EqualIgnoringCase(encoding, "text/html") || - EqualIgnoringCase(encoding, "application/xhtml+xml"); + return DeprecatedEqualIgnoringCase(encoding, "text/html") || + DeprecatedEqualIgnoringCase(encoding, "application/xhtml+xml"); } return false; }
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLParserIdioms.cpp b/third_party/WebKit/Source/core/html/parser/HTMLParserIdioms.cpp index eb9ed56..8c77004 100644 --- a/third_party/WebKit/Source/core/html/parser/HTMLParserIdioms.cpp +++ b/third_party/WebKit/Source/core/html/parser/HTMLParserIdioms.cpp
@@ -418,7 +418,7 @@ const String& attribute_value = AtomicString(html_attribute.second); if (ThreadSafeMatch(attribute_name, http_equivAttr)) { - if (EqualIgnoringCase(attribute_value, "content-type")) + if (DeprecatedEqualIgnoringCase(attribute_value, "content-type")) got_pragma = true; } else if (charset.IsEmpty()) { if (ThreadSafeMatch(attribute_name, charsetAttr)) {
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp b/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp index 69667fd8..cee44198 100644 --- a/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp +++ b/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp
@@ -372,11 +372,12 @@ void ProcessInputAttribute(const NameType& attribute_name, const String& attribute_value) { // FIXME - Don't set type multiple times. - if (Match(attribute_name, srcAttr)) + if (Match(attribute_name, srcAttr)) { SetUrlToLoad(attribute_value, kDisallowURLReplacement); - else if (Match(attribute_name, typeAttr)) + } else if (Match(attribute_name, typeAttr)) { input_is_image_ = - EqualIgnoringCase(attribute_value, InputTypeNames::image); + DeprecatedEqualIgnoringCase(attribute_value, InputTypeNames::image); + } } template <typename NameType> @@ -681,13 +682,13 @@ return; String content_attribute_value(content_attribute->Value()); - if (EqualIgnoringCase(name_attribute_value, "viewport")) { + if (DeprecatedEqualIgnoringCase(name_attribute_value, "viewport")) { HandleMetaViewport(content_attribute_value, document_parameters, media_values, viewport); return; } - if (EqualIgnoringCase(name_attribute_value, "referrer")) { + if (DeprecatedEqualIgnoringCase(name_attribute_value, "referrer")) { HandleMetaReferrer(content_attribute_value, document_parameters, css_scanner); } @@ -819,10 +820,11 @@ token.GetAttributeItem(http_equivAttr); if (equiv_attribute) { String equiv_attribute_value(equiv_attribute->Value()); - if (EqualIgnoringCase(equiv_attribute_value, - "content-security-policy")) { + if (DeprecatedEqualIgnoringCase(equiv_attribute_value, + "content-security-policy")) { *is_csp_meta_tag = true; - } else if (EqualIgnoringCase(equiv_attribute_value, "accept-ch")) { + } else if (DeprecatedEqualIgnoringCase(equiv_attribute_value, + "accept-ch")) { const typename Token::Attribute* content_attribute = token.GetAttributeItem(contentAttr); if (content_attribute)
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.cpp b/third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.cpp index 432fa8d5..cbb0958 100644 --- a/third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.cpp +++ b/third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.cpp
@@ -723,7 +723,7 @@ Attribute* type_attribute = token->GetAttributeItem(typeAttr); bool disable_frameset = !type_attribute || - !EqualIgnoringCase(type_attribute->Value(), "hidden"); + !DeprecatedEqualIgnoringCase(type_attribute->Value(), "hidden"); tree_.ReconstructTheActiveFormattingElements(); tree_.InsertSelfClosingHTMLElementDestroyingToken(token); @@ -965,7 +965,7 @@ if (token->GetName() == inputTag) { Attribute* type_attribute = token->GetAttributeItem(typeAttr); if (type_attribute && - EqualIgnoringCase(type_attribute->Value(), "hidden")) { + DeprecatedEqualIgnoringCase(type_attribute->Value(), "hidden")) { ParseError(token); tree_.InsertSelfClosingHTMLElementDestroyingToken(token); return;
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLTreeBuilderSimulator.cpp b/third_party/WebKit/Source/core/html/parser/HTMLTreeBuilderSimulator.cpp index b20b813..2ad260b 100644 --- a/third_party/WebKit/Source/core/html/parser/HTMLTreeBuilderSimulator.cpp +++ b/third_party/WebKit/Source/core/html/parser/HTMLTreeBuilderSimulator.cpp
@@ -85,8 +85,8 @@ static bool TokenExitsSVG(const CompactHTMLToken& token) { // FIXME: It's very fragile that we special case foreignObject here to be // case-insensitive. - return EqualIgnoringCase(token.Data(), - SVGNames::foreignObjectTag.LocalName()); + return DeprecatedEqualIgnoringCase(token.Data(), + SVGNames::foreignObjectTag.LocalName()); } static bool TokenExitsMath(const CompactHTMLToken& token) {
diff --git a/third_party/WebKit/Source/core/html/parser/TextResourceDecoder.cpp b/third_party/WebKit/Source/core/html/parser/TextResourceDecoder.cpp index cb9093c..d2666ee2 100644 --- a/third_party/WebKit/Source/core/html/parser/TextResourceDecoder.cpp +++ b/third_party/WebKit/Source/core/html/parser/TextResourceDecoder.cpp
@@ -119,9 +119,9 @@ TextResourceDecoder::ContentType TextResourceDecoder::DetermineContentType( const String& mime_type) { - if (EqualIgnoringCase(mime_type, "text/css")) + if (DeprecatedEqualIgnoringCase(mime_type, "text/css")) return kCSSContent; - if (EqualIgnoringCase(mime_type, "text/html")) + if (DeprecatedEqualIgnoringCase(mime_type, "text/html")) return kHTMLContent; if (DOMImplementation::IsXMLMIMEType(mime_type)) return kXMLContent;
diff --git a/third_party/WebKit/Source/core/html/parser/XSSAuditor.cpp b/third_party/WebKit/Source/core/html/parser/XSSAuditor.cpp index c9c8bec..3a2e2fd 100644 --- a/third_party/WebKit/Source/core/html/parser/XSSAuditor.cpp +++ b/third_party/WebKit/Source/core/html/parser/XSSAuditor.cpp
@@ -174,8 +174,8 @@ static bool IsDangerousHTTPEquiv(const String& value) { String equiv = value.StripWhiteSpace(); - return EqualIgnoringCase(equiv, "refresh") || - EqualIgnoringCase(equiv, "set-cookie"); + return DeprecatedEqualIgnoringCase(equiv, "refresh") || + DeprecatedEqualIgnoringCase(equiv, "set-cookie"); } static inline String Decode16BitUnicodeEscapeSequences(const String& string) {
diff --git a/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp index b4e3583..fb59d84 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp
@@ -1011,7 +1011,7 @@ (node->nodeName().FindIgnoringCase(tag_name_query) != kNotFound)) || (start_tag_found && end_tag_found && - EqualIgnoringCase(node->nodeName(), tag_name_query)) || + DeprecatedEqualIgnoringCase(node->nodeName(), tag_name_query)) || (start_tag_found && !end_tag_found && node->nodeName().StartsWith(tag_name_query, kTextCaseUnicodeInsensitive)) ||
diff --git a/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp index da77e15..6d7112c 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp
@@ -150,7 +150,7 @@ decoder->UseLenientXMLDecoding(); return decoder; } - if (EqualIgnoringCase(mime_type, "text/html")) + if (DeprecatedEqualIgnoringCase(mime_type, "text/html")) return TextResourceDecoder::Create("text/html", "UTF-8"); if (MIMETypeRegistry::IsSupportedJavaScriptMIMEType(mime_type) || DOMImplementation::IsJSONMIMEType(mime_type))
diff --git a/third_party/WebKit/Source/core/layout/LayoutText.cpp b/third_party/WebKit/Source/core/layout/LayoutText.cpp index e31a90b0..b26375c 100644 --- a/third_party/WebKit/Source/core/layout/LayoutText.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutText.cpp
@@ -1720,10 +1720,10 @@ MakeCapitalized(&text, previous_character); break; case ETextTransform::kUppercase: - text = text.Upper(style->Locale()); + text = text.UpperUnicode(style->Locale()); break; case ETextTransform::kLowercase: - text = text.Lower(style->Locale()); + text = text.LowerUnicode(style->Locale()); break; } }
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm_test.cc b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm_test.cc index 52cba6cf..6e57962e 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm_test.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm_test.cc
@@ -787,7 +787,7 @@ EXPECT_EQ(LayoutUnit(kWidth + kPaddingLeft), frag->Width()); EXPECT_EQ(NGPhysicalFragment::kFragmentBox, frag->Type()); - EXPECT_EQ(LayoutUnit(kWidth + kPaddingLeft), frag->WidthOverflow()); + EXPECT_EQ(LayoutUnit(kWidth + kPaddingLeft), frag->OverflowSize().width); ASSERT_EQ(1UL, frag->Children().size()); const NGPhysicalFragment* child = frag->Children()[0].Get();
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_block_node.cc b/third_party/WebKit/Source/core/layout/ng/ng_block_node.cc index fa2a58e..35c80b68 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_block_node.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_block_node.cc
@@ -175,7 +175,7 @@ layout_result->PhysicalFragment().Get(); NGBoxFragment min_fragment(FromPlatformWritingMode(Style().GetWritingMode()), ToNGPhysicalBoxFragment(physical_fragment)); - sizes.min_content = min_fragment.InlineOverflow(); + sizes.min_content = min_fragment.OverflowSize().inline_size; // Now, redo with infinite space for max_content constraint_space = @@ -190,7 +190,7 @@ physical_fragment = layout_result->PhysicalFragment().Get(); NGBoxFragment max_fragment(FromPlatformWritingMode(Style().GetWritingMode()), ToNGPhysicalBoxFragment(physical_fragment)); - sizes.max_content = max_fragment.InlineOverflow(); + sizes.max_content = max_fragment.OverflowSize().inline_size; return sizes; } @@ -280,8 +280,8 @@ ComputePadding(constraint_space, Style()); LayoutUnit intrinsic_logical_height = layout_box_->Style()->IsHorizontalWritingMode() - ? fragment->HeightOverflow() - : fragment->WidthOverflow(); + ? fragment->OverflowSize().height + : fragment->OverflowSize().width; intrinsic_logical_height -= border_and_padding.BlockSum(); layout_box_->SetIntrinsicContentLogicalHeight(intrinsic_logical_height);
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_box_fragment.cc b/third_party/WebKit/Source/core/layout/ng/ng_box_fragment.cc index 0d3d20c..9eb7a508 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_box_fragment.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_box_fragment.cc
@@ -9,16 +9,9 @@ namespace blink { -LayoutUnit NGBoxFragment::InlineOverflow() const { - return writing_mode_ == kHorizontalTopBottom - ? ToNGPhysicalBoxFragment(physical_fragment_)->WidthOverflow() - : ToNGPhysicalBoxFragment(physical_fragment_)->HeightOverflow(); -} - -LayoutUnit NGBoxFragment::BlockOverflow() const { - return writing_mode_ == kHorizontalTopBottom - ? ToNGPhysicalBoxFragment(physical_fragment_)->HeightOverflow() - : ToNGPhysicalBoxFragment(physical_fragment_)->WidthOverflow(); +NGLogicalSize NGBoxFragment::OverflowSize() const { + auto* physical_fragment = ToNGPhysicalBoxFragment(physical_fragment_); + return physical_fragment->OverflowSize().ConvertToLogical(WritingMode()); } const WTF::Optional<NGLogicalOffset>& NGBoxFragment::BfcOffset() const {
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_box_fragment.h b/third_party/WebKit/Source/core/layout/ng/ng_box_fragment.h index bbf296f..4e2e4c57 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_box_fragment.h +++ b/third_party/WebKit/Source/core/layout/ng/ng_box_fragment.h
@@ -12,6 +12,8 @@ namespace blink { +struct NGLogicalSize; + class CORE_EXPORT NGBoxFragment final : public NGFragment { public: NGBoxFragment(NGWritingMode writing_mode, @@ -19,8 +21,7 @@ : NGFragment(writing_mode, physical_fragment) {} // Returns the total size, including the contents outside of the border-box. - LayoutUnit InlineOverflow() const; - LayoutUnit BlockOverflow() const; + NGLogicalSize OverflowSize() const; const WTF::Optional<NGLogicalOffset>& BfcOffset() const;
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_physical_box_fragment.h b/third_party/WebKit/Source/core/layout/ng/ng_physical_box_fragment.h index 0afd0c66..4a4a9675 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_physical_box_fragment.h +++ b/third_party/WebKit/Source/core/layout/ng/ng_physical_box_fragment.h
@@ -29,8 +29,7 @@ RefPtr<NGBreakToken> break_token = nullptr); // Returns the total size, including the contents outside of the border-box. - LayoutUnit WidthOverflow() const { return overflow_.width; } - LayoutUnit HeightOverflow() const { return overflow_.height; } + NGPhysicalSize OverflowSize() const { return overflow_; } const Vector<RefPtr<NGPhysicalFragment>>& Children() const { return children_;
diff --git a/third_party/WebKit/Source/core/loader/DocumentLoader.cpp b/third_party/WebKit/Source/core/loader/DocumentLoader.cpp index 221b5d1..7056497 100644 --- a/third_party/WebKit/Source/core/loader/DocumentLoader.cpp +++ b/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
@@ -86,7 +86,7 @@ namespace blink { static bool IsArchiveMIMEType(const String& mime_type) { - return EqualIgnoringCase("multipart/related", mime_type); + return DeprecatedEqualIgnoringCase("multipart/related", mime_type); } static bool ShouldInheritSecurityOriginFromOwner(const KURL& url) {
diff --git a/third_party/WebKit/Source/core/loader/FormSubmission.cpp b/third_party/WebKit/Source/core/loader/FormSubmission.cpp index 9689878..5247244 100644 --- a/third_party/WebKit/Source/core/loader/FormSubmission.cpp +++ b/third_party/WebKit/Source/core/loader/FormSubmission.cpp
@@ -67,7 +67,7 @@ const String& encoding_type) { String body = data.FlattenToString(); - if (EqualIgnoringCase(encoding_type, "text/plain")) { + if (DeprecatedEqualIgnoringCase(encoding_type, "text/plain")) { // Convention seems to be to decode, and s/&/\r\n/. Also, spaces are encoded // as %20. body = DecodeURLEscapeSequences( @@ -94,9 +94,9 @@ } AtomicString FormSubmission::Attributes::ParseEncodingType(const String& type) { - if (EqualIgnoringCase(type, "multipart/form-data")) + if (DeprecatedEqualIgnoringCase(type, "multipart/form-data")) return AtomicString("multipart/form-data"); - if (EqualIgnoringCase(type, "text/plain")) + if (DeprecatedEqualIgnoringCase(type, "text/plain")) return AtomicString("text/plain"); return AtomicString("application/x-www-form-urlencoded"); } @@ -108,9 +108,9 @@ FormSubmission::SubmitMethod FormSubmission::Attributes::ParseMethodType( const String& type) { - if (EqualIgnoringCase(type, "post")) + if (DeprecatedEqualIgnoringCase(type, "post")) return FormSubmission::kPostMethod; - if (EqualIgnoringCase(type, "dialog")) + if (DeprecatedEqualIgnoringCase(type, "dialog")) return FormSubmission::kDialogMethod; return FormSubmission::kGetMethod; }
diff --git a/third_party/WebKit/Source/core/loader/FrameLoader.cpp b/third_party/WebKit/Source/core/loader/FrameLoader.cpp index 981e6b7..832657b 100644 --- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp +++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
@@ -705,7 +705,7 @@ // was created, then the navigation must be done with replacement enabled." if (request.ReplacesCurrentItem() || (!state_machine_.CommittedMultipleRealLoads() && - EqualIgnoringCase(frame_->GetDocument()->Url(), BlankURL()))) + DeprecatedEqualIgnoringCase(frame_->GetDocument()->Url(), BlankURL()))) return kFrameLoadTypeReplaceCurrentItem; if (request.GetResourceRequest().Url() == document_loader_->UrlForHistory()) { @@ -1264,7 +1264,7 @@ // We don't do this if we are submitting a form with method other than "GET", // explicitly reloading, currently displaying a frameset, or if the URL does // not have a fragment. - return EqualIgnoringCase(http_method, HTTPNames::GET) && + return DeprecatedEqualIgnoringCase(http_method, HTTPNames::GET) && !IsReloadLoadType(load_type) && load_type != kFrameLoadTypeBackForward && url.HasFragmentIdentifier() &&
diff --git a/third_party/WebKit/Source/core/loader/HistoryItem.cpp b/third_party/WebKit/Source/core/loader/HistoryItem.cpp index 961755b..ad722d15 100644 --- a/third_party/WebKit/Source/core/loader/HistoryItem.cpp +++ b/third_party/WebKit/Source/core/loader/HistoryItem.cpp
@@ -137,7 +137,7 @@ } void HistoryItem::SetFormInfoFromRequest(const ResourceRequest& request) { - if (EqualIgnoringCase(request.HttpMethod(), "POST")) { + if (DeprecatedEqualIgnoringCase(request.HttpMethod(), "POST")) { // FIXME: Eventually we have to make this smart enough to handle the case // where we have a stream for the body to handle the "data interspersed with // files" feature.
diff --git a/third_party/WebKit/Source/core/loader/resource/CSSStyleSheetResource.cpp b/third_party/WebKit/Source/core/loader/resource/CSSStyleSheetResource.cpp index 1d4cca58..fbf781a 100644 --- a/third_party/WebKit/Source/core/loader/resource/CSSStyleSheetResource.cpp +++ b/third_party/WebKit/Source/core/loader/resource/CSSStyleSheetResource.cpp
@@ -201,8 +201,9 @@ return true; AtomicString content_type = HttpContentType(); return content_type.IsEmpty() || - EqualIgnoringCase(content_type, "text/css") || - EqualIgnoringCase(content_type, "application/x-unknown-content-type"); + DeprecatedEqualIgnoringCase(content_type, "text/css") || + DeprecatedEqualIgnoringCase(content_type, + "application/x-unknown-content-type"); } StyleSheetContents* CSSStyleSheetResource::RestoreParsedStyleSheet(
diff --git a/third_party/WebKit/Source/core/loader/resource/ImageResourceContent.cpp b/third_party/WebKit/Source/core/loader/resource/ImageResourceContent.cpp index b8edde4b..3c6bb37 100644 --- a/third_party/WebKit/Source/core/loader/resource/ImageResourceContent.cpp +++ b/third_party/WebKit/Source/core/loader/resource/ImageResourceContent.cpp
@@ -98,7 +98,7 @@ ImageResourceObserver* observer) { ProhibitAddRemoveObserverInScope prohibit_add_remove_observer_in_scope(this); - auto it = observers_.Find(observer); + auto it = observers_.find(observer); if (it == observers_.end()) return; observers_.erase(it); @@ -135,11 +135,11 @@ CHECK(!is_add_remove_observer_prohibited_); ProhibitAddRemoveObserverInScope prohibit_add_remove_observer_in_scope(this); - auto it = observers_.Find(observer); + auto it = observers_.find(observer); if (it != observers_.end()) { observers_.erase(it); } else { - it = finished_observers_.Find(observer); + it = finished_observers_.find(observer); DCHECK(it != finished_observers_.end()); finished_observers_.erase(it); }
diff --git a/third_party/WebKit/Source/core/mojo/MojoHandle.cpp b/third_party/WebKit/Source/core/mojo/MojoHandle.cpp index 7516a64..14ac6bd 100644 --- a/third_party/WebKit/Source/core/mojo/MojoHandle.cpp +++ b/third_party/WebKit/Source/core/mojo/MojoHandle.cpp
@@ -61,7 +61,7 @@ bytes = array->Data(); num_bytes = array->ByteLength(); } else { - DOMArrayBufferView* view = buffer.getAsArrayBufferView().View(); + DOMArrayBufferView* view = buffer.getAsArrayBufferView(); bytes = view->BaseAddress(); num_bytes = view->byteLength(); } @@ -117,7 +117,7 @@ elements = array->Data(); num_bytes = array->ByteLength(); } else { - DOMArrayBufferView* view = buffer.getAsArrayBufferView().View(); + DOMArrayBufferView* view = buffer.getAsArrayBufferView(); elements = view->BaseAddress(); num_bytes = view->byteLength(); } @@ -165,7 +165,7 @@ elements = array->Data(); num_bytes = array->ByteLength(); } else { - DOMArrayBufferView* view = buffer.getAsArrayBufferView().View(); + DOMArrayBufferView* view = buffer.getAsArrayBufferView(); elements = view->BaseAddress(); num_bytes = view->byteLength(); }
diff --git a/third_party/WebKit/Source/core/page/ContextMenuController.cpp b/third_party/WebKit/Source/core/page/ContextMenuController.cpp index ef4a278..dcc485df 100644 --- a/third_party/WebKit/Source/core/page/ContextMenuController.cpp +++ b/third_party/WebKit/Source/core/page/ContextMenuController.cpp
@@ -91,8 +91,8 @@ HTMLElement& element = ToHTMLElement(*node); HTMLMenuElement* menu_element = element.AssignedContextMenu(); - if (!menu_element || - !EqualIgnoringCase(menu_element->FastGetAttribute(typeAttr), "context")) + if (!menu_element || !DeprecatedEqualIgnoringCase( + menu_element->FastGetAttribute(typeAttr), "context")) return; RelatedEvent* related_event = RelatedEvent::Create(EventTypeNames::show, true, true, node);
diff --git a/third_party/WebKit/Source/core/page/CustomContextMenuProvider.cpp b/third_party/WebKit/Source/core/page/CustomContextMenuProvider.cpp index 70dd710..2a80d465 100644 --- a/third_party/WebKit/Source/core/page/CustomContextMenuProvider.cpp +++ b/third_party/WebKit/Source/core/page/CustomContextMenuProvider.cpp
@@ -86,8 +86,10 @@ } ContextMenuAction action = static_cast<ContextMenuAction>( kContextMenuItemBaseCustomTag + menu_items_.size() - 1); - if (EqualIgnoringCase(menu_item->FastGetAttribute(typeAttr), "checkbox") || - EqualIgnoringCase(menu_item->FastGetAttribute(typeAttr), "radio")) + if (DeprecatedEqualIgnoringCase(menu_item->FastGetAttribute(typeAttr), + "checkbox") || + DeprecatedEqualIgnoringCase(menu_item->FastGetAttribute(typeAttr), + "radio")) context_menu.AppendItem( ContextMenuItem(kCheckableActionType, action, label_string, icon, enabled, menu_item->FastHasAttribute(checkedAttr)));
diff --git a/third_party/WebKit/Source/core/svg/SVGElementProxy.cpp b/third_party/WebKit/Source/core/svg/SVGElementProxy.cpp index f462c61b..e700762 100644 --- a/third_party/WebKit/Source/core/svg/SVGElementProxy.cpp +++ b/third_party/WebKit/Source/core/svg/SVGElementProxy.cpp
@@ -29,7 +29,7 @@ void TransferClients(IdObserver& observer) { for (const auto& client : clients_) observer.clients_.insert(client.key, client.value); - clients_.Clear(); + clients_.clear(); } DEFINE_INLINE_VIRTUAL_TRACE() {
diff --git a/third_party/WebKit/Source/core/testing/InternalSettings.cpp b/third_party/WebKit/Source/core/testing/InternalSettings.cpp index 0d21ae0..3968155 100644 --- a/third_party/WebKit/Source/core/testing/InternalSettings.cpp +++ b/third_party/WebKit/Source/core/testing/InternalSettings.cpp
@@ -197,11 +197,11 @@ void InternalSettings::setViewportStyle(const String& style, ExceptionState& exception_state) { InternalSettingsGuardForSettings(); - if (EqualIgnoringCase(style, "default")) + if (DeprecatedEqualIgnoringCase(style, "default")) GetSettings()->SetViewportStyle(WebViewportStyle::kDefault); - else if (EqualIgnoringCase(style, "mobile")) + else if (DeprecatedEqualIgnoringCase(style, "mobile")) GetSettings()->SetViewportStyle(WebViewportStyle::kMobile); - else if (EqualIgnoringCase(style, "television")) + else if (DeprecatedEqualIgnoringCase(style, "television")) GetSettings()->SetViewportStyle(WebViewportStyle::kTelevision); else exception_state.ThrowDOMException( @@ -342,13 +342,13 @@ void InternalSettings::setEditingBehavior(const String& editing_behavior, ExceptionState& exception_state) { InternalSettingsGuardForSettings(); - if (EqualIgnoringCase(editing_behavior, "win")) + if (DeprecatedEqualIgnoringCase(editing_behavior, "win")) GetSettings()->SetEditingBehaviorType(kEditingWindowsBehavior); - else if (EqualIgnoringCase(editing_behavior, "mac")) + else if (DeprecatedEqualIgnoringCase(editing_behavior, "mac")) GetSettings()->SetEditingBehaviorType(kEditingMacBehavior); - else if (EqualIgnoringCase(editing_behavior, "unix")) + else if (DeprecatedEqualIgnoringCase(editing_behavior, "unix")) GetSettings()->SetEditingBehaviorType(kEditingUnixBehavior); - else if (EqualIgnoringCase(editing_behavior, "android")) + else if (DeprecatedEqualIgnoringCase(editing_behavior, "android")) GetSettings()->SetEditingBehaviorType(kEditingAndroidBehavior); else exception_state.ThrowDOMException(kSyntaxError, @@ -492,11 +492,11 @@ const String& policy, ExceptionState& exception_state) { InternalSettingsGuardForSettings(); - if (EqualIgnoringCase(policy, "allowed")) + if (DeprecatedEqualIgnoringCase(policy, "allowed")) GetSettings()->SetImageAnimationPolicy(kImageAnimationPolicyAllowed); - else if (EqualIgnoringCase(policy, "once")) + else if (DeprecatedEqualIgnoringCase(policy, "once")) GetSettings()->SetImageAnimationPolicy(kImageAnimationPolicyAnimateOnce); - else if (EqualIgnoringCase(policy, "none")) + else if (DeprecatedEqualIgnoringCase(policy, "none")) GetSettings()->SetImageAnimationPolicy(kImageAnimationPolicyNoAnimation); else exception_state.ThrowDOMException(
diff --git a/third_party/WebKit/Source/core/testing/Internals.cpp b/third_party/WebKit/Source/core/testing/Internals.cpp index 553081d..a7a8ac7 100644 --- a/third_party/WebKit/Source/core/testing/Internals.cpp +++ b/third_party/WebKit/Source/core/testing/Internals.cpp
@@ -191,18 +191,18 @@ static WTF::Optional<DocumentMarker::MarkerType> MarkerTypeFrom( const String& marker_type) { - if (EqualIgnoringCase(marker_type, "Spelling")) + if (DeprecatedEqualIgnoringCase(marker_type, "Spelling")) return DocumentMarker::kSpelling; - if (EqualIgnoringCase(marker_type, "Grammar")) + if (DeprecatedEqualIgnoringCase(marker_type, "Grammar")) return DocumentMarker::kGrammar; - if (EqualIgnoringCase(marker_type, "TextMatch")) + if (DeprecatedEqualIgnoringCase(marker_type, "TextMatch")) return DocumentMarker::kTextMatch; return WTF::kNullopt; } static WTF::Optional<DocumentMarker::MarkerTypes> MarkerTypesFrom( const String& marker_type) { - if (marker_type.IsEmpty() || EqualIgnoringCase(marker_type, "all")) + if (marker_type.IsEmpty() || DeprecatedEqualIgnoringCase(marker_type, "all")) return DocumentMarker::AllMarkers(); WTF::Optional<DocumentMarker::MarkerType> type = MarkerTypeFrom(marker_type); if (!type)
diff --git a/third_party/WebKit/Source/core/xml/XPathFunctions.cpp b/third_party/WebKit/Source/core/xml/XPathFunctions.cpp index c720247..93c7493 100644 --- a/third_party/WebKit/Source/core/xml/XPathFunctions.cpp +++ b/third_party/WebKit/Source/core/xml/XPathFunctions.cpp
@@ -642,7 +642,7 @@ String lang_value = language_attribute->Value(); while (true) { - if (EqualIgnoringCase(lang_value, lang)) + if (DeprecatedEqualIgnoringCase(lang_value, lang)) return true; // Remove suffixes one by one.
diff --git a/third_party/WebKit/Source/core/xml/XPathStep.cpp b/third_party/WebKit/Source/core/xml/XPathStep.cpp index 7942936..68a1d1d 100644 --- a/third_party/WebKit/Source/core/xml/XPathStep.cpp +++ b/third_party/WebKit/Source/core/xml/XPathStep.cpp
@@ -217,7 +217,7 @@ // Paths without namespaces should match HTML elements in HTML // documents despite those having an XHTML namespace. Names are // compared case-insensitively. - return EqualIgnoringCase(element.localName(), name) && + return DeprecatedEqualIgnoringCase(element.localName(), name) && (namespace_uri.IsNull() || namespace_uri == element.namespaceURI()); }
diff --git a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp index 656a5d00..fc9b2d6 100644 --- a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp +++ b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp
@@ -714,7 +714,7 @@ } if (body.isArrayBufferView()) { - send(body.getAsArrayBufferView().View(), exception_state); + send(body.getAsArrayBufferView(), exception_state); return; } @@ -1482,7 +1482,7 @@ } bool XMLHttpRequest::ResponseIsHTML() const { - return EqualIgnoringCase(FinalResponseMIMEType(), "text/html"); + return DeprecatedEqualIgnoringCase(FinalResponseMIMEType(), "text/html"); } int XMLHttpRequest::status() const {
diff --git a/third_party/WebKit/Source/modules/beacon/NavigatorBeacon.cpp b/third_party/WebKit/Source/modules/beacon/NavigatorBeacon.cpp index 8acd932b..829cf3c 100644 --- a/third_party/WebKit/Source/modules/beacon/NavigatorBeacon.cpp +++ b/third_party/WebKit/Source/modules/beacon/NavigatorBeacon.cpp
@@ -118,7 +118,7 @@ if (data.isArrayBufferView()) { allowed = PingLoader::SendBeacon(GetSupplementable()->GetFrame(), allowance, url, - data.getAsArrayBufferView().View(), beacon_size); + data.getAsArrayBufferView(), beacon_size); } else if (data.isBlob()) { Blob* blob = data.getAsBlob(); if (!FetchUtils::IsSimpleContentType(AtomicString(blob->type()))) {
diff --git a/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp b/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp index ccc37be..9653160 100644 --- a/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp +++ b/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp
@@ -9,7 +9,6 @@ #include "bindings/core/v8/ScriptState.h" #include "core/css/cssom/CSSURLImageValue.h" #include "core/css/parser/CSSParser.h" -#include "core/dom/NotShared.h" #include "core/frame/ImageBitmap.h" #include "core/html/HTMLCanvasElement.h" #include "core/html/HTMLImageElement.h" @@ -1613,10 +1612,9 @@ NeedsFinalizeFrame(); DOMArrayBuffer* array_buffer = DOMArrayBuffer::Create(contents); - return ImageData::Create( - image_data_rect.size(), - NotShared<DOMUint8ClampedArray>(DOMUint8ClampedArray::Create( - array_buffer, 0, array_buffer->ByteLength()))); + return ImageData::Create(image_data_rect.size(), + DOMUint8ClampedArray::Create( + array_buffer, 0, array_buffer->ByteLength())); } void BaseRenderingContext2D::putImageData(ImageData* data,
diff --git a/third_party/WebKit/Source/modules/canvas2d/CanvasStyle.cpp b/third_party/WebKit/Source/modules/canvas2d/CanvasStyle.cpp index 811721f..8b260e78 100644 --- a/third_party/WebKit/Source/modules/canvas2d/CanvasStyle.cpp +++ b/third_party/WebKit/Source/modules/canvas2d/CanvasStyle.cpp
@@ -51,7 +51,7 @@ static ColorParseResult ParseColor(Color& parsed_color, const String& color_string) { - if (EqualIgnoringCase(color_string, "currentcolor")) + if (DeprecatedEqualIgnoringCase(color_string, "currentcolor")) return kParsedCurrentColor; const bool kUseStrictParsing = true; if (CSSParser::ParseColor(parsed_color, color_string, kUseStrictParsing))
diff --git a/third_party/WebKit/Source/modules/crypto/Crypto.cpp b/third_party/WebKit/Source/modules/crypto/Crypto.cpp index 0c98fda..96b5e47 100644 --- a/third_party/WebKit/Source/modules/crypto/Crypto.cpp +++ b/third_party/WebKit/Source/modules/crypto/Crypto.cpp
@@ -50,29 +50,27 @@ } // namespace -NotShared<DOMArrayBufferView> Crypto::getRandomValues( - NotShared<DOMArrayBufferView> array, - ExceptionState& exception_state) { - DCHECK(array); - if (!IsIntegerArray(array.View())) { +DOMArrayBufferView* Crypto::getRandomValues(DOMArrayBufferView* array, + ExceptionState& exception_state) { + ASSERT(array); + if (!IsIntegerArray(array)) { exception_state.ThrowDOMException( kTypeMismatchError, String::Format("The provided ArrayBufferView is of type '%s', which is " "not an integer array type.", - array.View()->TypeName())); - return NotShared<DOMArrayBufferView>(nullptr); + array->TypeName())); + return nullptr; } - if (array.View()->byteLength() > 65536) { + if (array->byteLength() > 65536) { exception_state.ThrowDOMException( kQuotaExceededError, String::Format("The ArrayBufferView's byte length (%u) exceeds the " "number of bytes of entropy available via this API " "(65536).", - array.View()->byteLength())); - return NotShared<DOMArrayBufferView>(nullptr); + array->byteLength())); + return nullptr; } - CryptographicallyRandomValues(array.View()->BaseAddress(), - array.View()->byteLength()); + CryptographicallyRandomValues(array->BaseAddress(), array->byteLength()); return array; }
diff --git a/third_party/WebKit/Source/modules/crypto/Crypto.h b/third_party/WebKit/Source/modules/crypto/Crypto.h index 0591217..b60f2d11 100644 --- a/third_party/WebKit/Source/modules/crypto/Crypto.h +++ b/third_party/WebKit/Source/modules/crypto/Crypto.h
@@ -44,8 +44,7 @@ public: static Crypto* Create() { return new Crypto(); } - NotShared<DOMArrayBufferView> getRandomValues(NotShared<DOMArrayBufferView>, - ExceptionState&); + DOMArrayBufferView* getRandomValues(DOMArrayBufferView*, ExceptionState&); SubtleCrypto* subtle();
diff --git a/third_party/WebKit/Source/modules/crypto/NormalizeAlgorithm.cpp b/third_party/WebKit/Source/modules/crypto/NormalizeAlgorithm.cpp index e69483c7..a5f1d15 100644 --- a/third_party/WebKit/Source/modules/crypto/NormalizeAlgorithm.cpp +++ b/third_party/WebKit/Source/modules/crypto/NormalizeAlgorithm.cpp
@@ -194,7 +194,7 @@ return false; if (it->algorithm_name_length != algorithm_name.length() || - !EqualIgnoringCase(algorithm_name, it->algorithm_name)) + !DeprecatedEqualIgnoringCase(algorithm_name, it->algorithm_name)) return false; id = it->algorithm_id;
diff --git a/third_party/WebKit/Source/modules/crypto/SubtleCrypto.cpp b/third_party/WebKit/Source/modules/crypto/SubtleCrypto.cpp index d45a653..c774ea3 100644 --- a/third_party/WebKit/Source/modules/crypto/SubtleCrypto.cpp +++ b/third_party/WebKit/Source/modules/crypto/SubtleCrypto.cpp
@@ -457,7 +457,7 @@ if (raw_key_data.isArrayBuffer()) { key_data = CopyBytes(raw_key_data.getAsArrayBuffer()); } else if (raw_key_data.isArrayBufferView()) { - key_data = CopyBytes(raw_key_data.getAsArrayBufferView().View()); + key_data = CopyBytes(raw_key_data.getAsArrayBufferView()); } else { result->CompleteWithError( kWebCryptoErrorTypeType,
diff --git a/third_party/WebKit/Source/modules/encoding/TextDecoder.cpp b/third_party/WebKit/Source/modules/encoding/TextDecoder.cpp index b8f14ac..07e86a1 100644 --- a/third_party/WebKit/Source/modules/encoding/TextDecoder.cpp +++ b/third_party/WebKit/Source/modules/encoding/TextDecoder.cpp
@@ -81,9 +81,9 @@ ExceptionState& exception_state) { ASSERT(!input.isNull()); if (input.isArrayBufferView()) { - const char* start = static_cast<const char*>( - input.getAsArrayBufferView().View()->BaseAddress()); - size_t length = input.getAsArrayBufferView().View()->byteLength(); + const char* start = + static_cast<const char*>(input.getAsArrayBufferView()->BaseAddress()); + size_t length = input.getAsArrayBufferView()->byteLength(); return decode(start, length, options, exception_state); } ASSERT(input.isArrayBuffer());
diff --git a/third_party/WebKit/Source/modules/encoding/TextEncoder.cpp b/third_party/WebKit/Source/modules/encoding/TextEncoder.cpp index a836b6c..e63c3a6 100644 --- a/third_party/WebKit/Source/modules/encoding/TextEncoder.cpp +++ b/third_party/WebKit/Source/modules/encoding/TextEncoder.cpp
@@ -58,7 +58,7 @@ return name; } -NotShared<DOMUint8Array> TextEncoder::encode(const String& input) { +DOMUint8Array* TextEncoder::encode(const String& input) { CString result; if (input.Is8Bit()) result = codec_->Encode(input.Characters8(), input.length(), @@ -71,8 +71,7 @@ const unsigned char* unsigned_buffer = reinterpret_cast<const unsigned char*>(buffer); - return NotShared<DOMUint8Array>( - DOMUint8Array::Create(unsigned_buffer, result.length())); + return DOMUint8Array::Create(unsigned_buffer, result.length()); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/encoding/TextEncoder.h b/third_party/WebKit/Source/modules/encoding/TextEncoder.h index 6c9671048..2f63a48 100644 --- a/third_party/WebKit/Source/modules/encoding/TextEncoder.h +++ b/third_party/WebKit/Source/modules/encoding/TextEncoder.h
@@ -31,14 +31,13 @@ #ifndef TextEncoder_h #define TextEncoder_h -#include <memory> #include "bindings/core/v8/ScriptWrappable.h" #include "core/dom/DOMTypedArray.h" -#include "core/dom/NotShared.h" #include "platform/heap/Handle.h" #include "wtf/text/TextCodec.h" #include "wtf/text/TextEncoding.h" #include "wtf/text/WTFString.h" +#include <memory> namespace blink { @@ -55,7 +54,7 @@ // Implement the IDL String encoding() const; - NotShared<DOMUint8Array> encode(const String&); + DOMUint8Array* encode(const String&); DEFINE_INLINE_TRACE() {}
diff --git a/third_party/WebKit/Source/modules/eventsource/EventSource.cpp b/third_party/WebKit/Source/modules/eventsource/EventSource.cpp index c7019c7..114fbd5 100644 --- a/third_party/WebKit/Source/modules/eventsource/EventSource.cpp +++ b/third_party/WebKit/Source/modules/eventsource/EventSource.cpp
@@ -253,7 +253,7 @@ const String& charset = response.TextEncodingName(); // If we have a charset, the only allowed value is UTF-8 (case-insensitive). response_is_valid = - charset.IsEmpty() || EqualIgnoringCase(charset, "UTF-8"); + charset.IsEmpty() || DeprecatedEqualIgnoringCase(charset, "UTF-8"); if (!response_is_valid) { StringBuilder message; message.Append("EventSource's response has a charset (\"");
diff --git a/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp b/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp index ff7bade..8ac5648a 100644 --- a/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp +++ b/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp
@@ -360,15 +360,13 @@ data->ByteLength(), exception_state); } -void SourceBuffer::appendBuffer(NotShared<DOMArrayBufferView> data, +void SourceBuffer::appendBuffer(DOMArrayBufferView* data, ExceptionState& exception_state) { - BLINK_SBLOG << __func__ << " this=" << this - << " size=" << data.View()->byteLength(); + BLINK_SBLOG << __func__ << " this=" << this << " size=" << data->byteLength(); // Section 3.2 appendBuffer() // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html#widl-SourceBuffer-appendBuffer-void-ArrayBufferView-data - AppendBufferInternal( - static_cast<const unsigned char*>(data.View()->BaseAddress()), - data.View()->byteLength(), exception_state); + AppendBufferInternal(static_cast<const unsigned char*>(data->BaseAddress()), + data->byteLength(), exception_state); } void SourceBuffer::abort(ExceptionState& exception_state) {
diff --git a/third_party/WebKit/Source/modules/mediasource/SourceBuffer.h b/third_party/WebKit/Source/modules/mediasource/SourceBuffer.h index 74d4a35..2002e6f 100644 --- a/third_party/WebKit/Source/modules/mediasource/SourceBuffer.h +++ b/third_party/WebKit/Source/modules/mediasource/SourceBuffer.h
@@ -31,9 +31,7 @@ #ifndef SourceBuffer_h #define SourceBuffer_h -#include <memory> #include "bindings/core/v8/ActiveScriptWrappable.h" -#include "core/dom/NotShared.h" #include "core/dom/SuspendableObject.h" #include "modules/EventTargetModules.h" #include "modules/mediasource/TrackDefaultList.h" @@ -41,6 +39,7 @@ #include "platform/weborigin/KURL.h" #include "public/platform/WebSourceBufferClient.h" #include "wtf/text/WTFString.h" +#include <memory> namespace blink { @@ -79,7 +78,7 @@ double timestampOffset() const; void setTimestampOffset(double, ExceptionState&); void appendBuffer(DOMArrayBuffer* data, ExceptionState&); - void appendBuffer(NotShared<DOMArrayBufferView> data, ExceptionState&); + void appendBuffer(DOMArrayBufferView* data, ExceptionState&); void abort(ExceptionState&); void remove(double start, double end, ExceptionState&); double appendWindowStart() const;
diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCDataChannel.cpp b/third_party/WebKit/Source/modules/peerconnection/RTCDataChannel.cpp index d30cc48..0041bd24 100644 --- a/third_party/WebKit/Source/modules/peerconnection/RTCDataChannel.cpp +++ b/third_party/WebKit/Source/modules/peerconnection/RTCDataChannel.cpp
@@ -227,11 +227,10 @@ } } -void RTCDataChannel::send(NotShared<DOMArrayBufferView> data, +void RTCDataChannel::send(DOMArrayBufferView* data, ExceptionState& exception_state) { - if (!handler_->SendRawData( - static_cast<const char*>(data.View()->BaseAddress()), - data.View()->byteLength())) { + if (!handler_->SendRawData(static_cast<const char*>(data->BaseAddress()), + data->byteLength())) { // FIXME: This should not throw an exception but instead forcefully close // the data channel. ThrowCouldNotSendDataException(exception_state);
diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCDataChannel.h b/third_party/WebKit/Source/modules/peerconnection/RTCDataChannel.h index c0150fb..fcde42d9 100644 --- a/third_party/WebKit/Source/modules/peerconnection/RTCDataChannel.h +++ b/third_party/WebKit/Source/modules/peerconnection/RTCDataChannel.h
@@ -25,10 +25,8 @@ #ifndef RTCDataChannel_h #define RTCDataChannel_h -#include <memory> #include "base/gtest_prod_util.h" #include "bindings/core/v8/ActiveScriptWrappable.h" -#include "core/dom/NotShared.h" #include "core/dom/SuspendableObject.h" #include "modules/EventTargetModules.h" #include "platform/Timer.h" @@ -36,6 +34,7 @@ #include "public/platform/WebRTCDataChannelHandler.h" #include "public/platform/WebRTCDataChannelHandlerClient.h" #include "wtf/Compiler.h" +#include <memory> namespace blink { @@ -90,7 +89,7 @@ void send(const String&, ExceptionState&); void send(DOMArrayBuffer*, ExceptionState&); - void send(NotShared<DOMArrayBufferView>, ExceptionState&); + void send(DOMArrayBufferView*, ExceptionState&); void send(Blob*, ExceptionState&); void close();
diff --git a/third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp b/third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp index eb045a6..a4d35a3 100644 --- a/third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp +++ b/third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp
@@ -282,14 +282,13 @@ HandleMessageQueue(); } -void PresentationConnection::send( - NotShared<DOMArrayBufferView> array_buffer_view, - ExceptionState& exception_state) { - DCHECK(array_buffer_view); +void PresentationConnection::send(DOMArrayBufferView* array_buffer_view, + ExceptionState& exception_state) { + ASSERT(array_buffer_view); if (!CanSendMessage(exception_state)) return; - messages_.push_back(new Message(array_buffer_view.View()->buffer())); + messages_.push_back(new Message(array_buffer_view->buffer())); HandleMessageQueue(); }
diff --git a/third_party/WebKit/Source/modules/presentation/PresentationConnection.h b/third_party/WebKit/Source/modules/presentation/PresentationConnection.h index 3cbb57e..c50f5dd 100644 --- a/third_party/WebKit/Source/modules/presentation/PresentationConnection.h +++ b/third_party/WebKit/Source/modules/presentation/PresentationConnection.h
@@ -7,7 +7,6 @@ #include <memory> #include "core/dom/ContextLifecycleObserver.h" -#include "core/dom/NotShared.h" #include "core/events/EventTarget.h" #include "core/fileapi/Blob.h" #include "core/fileapi/FileError.h" @@ -61,7 +60,7 @@ void send(const String& message, ExceptionState&); void send(DOMArrayBuffer*, ExceptionState&); - void send(NotShared<DOMArrayBufferView>, ExceptionState&); + void send(DOMArrayBufferView*, ExceptionState&); void send(Blob*, ExceptionState&); void close(); void terminate();
diff --git a/third_party/WebKit/Source/modules/push_messaging/PushMessageData.cpp b/third_party/WebKit/Source/modules/push_messaging/PushMessageData.cpp index d8b76c55..f6965ea 100644 --- a/third_party/WebKit/Source/modules/push_messaging/PushMessageData.cpp +++ b/third_party/WebKit/Source/modules/push_messaging/PushMessageData.cpp
@@ -32,10 +32,9 @@ PushMessageData* PushMessageData::Create( const ArrayBufferOrArrayBufferViewOrUSVString& message_data) { if (message_data.isArrayBuffer() || message_data.isArrayBufferView()) { - DOMArrayBuffer* buffer = - message_data.isArrayBufferView() - ? message_data.getAsArrayBufferView().View()->buffer() - : message_data.getAsArrayBuffer(); + DOMArrayBuffer* buffer = message_data.isArrayBufferView() + ? message_data.getAsArrayBufferView()->buffer() + : message_data.getAsArrayBuffer(); return new PushMessageData(static_cast<const char*>(buffer->Data()), buffer->ByteLength());
diff --git a/third_party/WebKit/Source/modules/push_messaging/PushSubscriptionOptions.cpp b/third_party/WebKit/Source/modules/push_messaging/PushSubscriptionOptions.cpp index 3700e53..9c25e43 100644 --- a/third_party/WebKit/Source/modules/push_messaging/PushSubscriptionOptions.cpp +++ b/third_party/WebKit/Source/modules/push_messaging/PushSubscriptionOptions.cpp
@@ -31,11 +31,9 @@ length = application_server_key.getAsArrayBuffer()->ByteLength(); } else if (application_server_key.isArrayBufferView()) { input = static_cast<unsigned char*>( - application_server_key.getAsArrayBufferView().View()->buffer()->Data()); - length = application_server_key.getAsArrayBufferView() - .View() - ->buffer() - ->ByteLength(); + application_server_key.getAsArrayBufferView()->buffer()->Data()); + length = + application_server_key.getAsArrayBufferView()->buffer()->ByteLength(); } else { NOTREACHED(); return String();
diff --git a/third_party/WebKit/Source/modules/sensor/OrientationSensor.cpp b/third_party/WebKit/Source/modules/sensor/OrientationSensor.cpp index fd8a29cb..3d1cc15 100644 --- a/third_party/WebKit/Source/modules/sensor/OrientationSensor.cpp +++ b/third_party/WebKit/Source/modules/sensor/OrientationSensor.cpp
@@ -107,9 +107,9 @@ Float32ArrayOrFloat64ArrayOrDOMMatrix& matrix, ExceptionState& exception_state) { if (matrix.isFloat32Array()) - PopulateMatrixInternal(matrix.getAsFloat32Array().View(), exception_state); + PopulateMatrixInternal(matrix.getAsFloat32Array(), exception_state); else if (matrix.isFloat64Array()) - PopulateMatrixInternal(matrix.getAsFloat64Array().View(), exception_state); + PopulateMatrixInternal(matrix.getAsFloat64Array(), exception_state); else if (matrix.isDOMMatrix()) PopulateMatrixInternal(matrix.getAsDOMMatrix(), exception_state); else
diff --git a/third_party/WebKit/Source/modules/webaudio/AnalyserNode.cpp b/third_party/WebKit/Source/modules/webaudio/AnalyserNode.cpp index 55a3109..822e811 100644 --- a/third_party/WebKit/Source/modules/webaudio/AnalyserNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/AnalyserNode.cpp
@@ -265,22 +265,20 @@ return GetAnalyserHandler().SmoothingTimeConstant(); } -void AnalyserNode::getFloatFrequencyData(NotShared<DOMFloat32Array> array) { - GetAnalyserHandler().GetFloatFrequencyData(array.View(), - context()->currentTime()); +void AnalyserNode::getFloatFrequencyData(DOMFloat32Array* array) { + GetAnalyserHandler().GetFloatFrequencyData(array, context()->currentTime()); } -void AnalyserNode::getByteFrequencyData(NotShared<DOMUint8Array> array) { - GetAnalyserHandler().GetByteFrequencyData(array.View(), - context()->currentTime()); +void AnalyserNode::getByteFrequencyData(DOMUint8Array* array) { + GetAnalyserHandler().GetByteFrequencyData(array, context()->currentTime()); } -void AnalyserNode::getFloatTimeDomainData(NotShared<DOMFloat32Array> array) { - GetAnalyserHandler().GetFloatTimeDomainData(array.View()); +void AnalyserNode::getFloatTimeDomainData(DOMFloat32Array* array) { + GetAnalyserHandler().GetFloatTimeDomainData(array); } -void AnalyserNode::getByteTimeDomainData(NotShared<DOMUint8Array> array) { - GetAnalyserHandler().GetByteTimeDomainData(array.View()); +void AnalyserNode::getByteTimeDomainData(DOMUint8Array* array) { + GetAnalyserHandler().GetByteTimeDomainData(array); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/webaudio/AnalyserNode.h b/third_party/WebKit/Source/modules/webaudio/AnalyserNode.h index e124487..b0dc0da 100644 --- a/third_party/WebKit/Source/modules/webaudio/AnalyserNode.h +++ b/third_party/WebKit/Source/modules/webaudio/AnalyserNode.h
@@ -27,7 +27,6 @@ #define AnalyserNode_h #include "core/dom/DOMTypedArray.h" -#include "core/dom/NotShared.h" #include "modules/webaudio/AudioBasicInspectorNode.h" #include "modules/webaudio/RealtimeAnalyser.h" @@ -112,10 +111,10 @@ double maxDecibels() const; void setSmoothingTimeConstant(double, ExceptionState&); double smoothingTimeConstant() const; - void getFloatFrequencyData(NotShared<DOMFloat32Array>); - void getByteFrequencyData(NotShared<DOMUint8Array>); - void getFloatTimeDomainData(NotShared<DOMFloat32Array>); - void getByteTimeDomainData(NotShared<DOMUint8Array>); + void getFloatFrequencyData(DOMFloat32Array*); + void getByteFrequencyData(DOMUint8Array*); + void getFloatTimeDomainData(DOMFloat32Array*); + void getByteTimeDomainData(DOMUint8Array*); private: AnalyserNode(BaseAudioContext&);
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioBuffer.cpp b/third_party/WebKit/Source/modules/webaudio/AudioBuffer.cpp index 71be1f1..08f092de 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioBuffer.cpp +++ b/third_party/WebKit/Source/modules/webaudio/AudioBuffer.cpp
@@ -185,34 +185,33 @@ } } -NotShared<DOMFloat32Array> AudioBuffer::getChannelData( - unsigned channel_index, - ExceptionState& exception_state) { +DOMFloat32Array* AudioBuffer::getChannelData(unsigned channel_index, + ExceptionState& exception_state) { if (channel_index >= channels_.size()) { exception_state.ThrowDOMException( kIndexSizeError, "channel index (" + String::Number(channel_index) + ") exceeds number of channels (" + String::Number(channels_.size()) + ")"); - return NotShared<DOMFloat32Array>(nullptr); + return nullptr; } return getChannelData(channel_index); } -NotShared<DOMFloat32Array> AudioBuffer::getChannelData(unsigned channel_index) { +DOMFloat32Array* AudioBuffer::getChannelData(unsigned channel_index) { if (channel_index >= channels_.size()) - return NotShared<DOMFloat32Array>(nullptr); + return nullptr; - return NotShared<DOMFloat32Array>(channels_[channel_index].Get()); + return channels_[channel_index].Get(); } -void AudioBuffer::copyFromChannel(NotShared<DOMFloat32Array> destination, +void AudioBuffer::copyFromChannel(DOMFloat32Array* destination, long channel_number, ExceptionState& exception_state) { return copyFromChannel(destination, channel_number, 0, exception_state); } -void AudioBuffer::copyFromChannel(NotShared<DOMFloat32Array> destination, +void AudioBuffer::copyFromChannel(DOMFloat32Array* destination, long channel_number, unsigned long start_in_channel, ExceptionState& exception_state) { @@ -224,7 +223,6 @@ ExceptionMessages::kInclusiveBound, static_cast<long>(channels_.size() - 1), ExceptionMessages::kInclusiveBound)); - return; } @@ -242,10 +240,10 @@ } unsigned count = channel_data->length() - start_in_channel; - count = std::min(destination.View()->length(), count); + count = std::min(destination->length(), count); const float* src = channel_data->Data(); - float* dst = destination.View()->Data(); + float* dst = destination->Data(); DCHECK(src); DCHECK(dst); @@ -253,13 +251,13 @@ memcpy(dst, src + start_in_channel, count * sizeof(*src)); } -void AudioBuffer::copyToChannel(NotShared<DOMFloat32Array> source, +void AudioBuffer::copyToChannel(DOMFloat32Array* source, long channel_number, ExceptionState& exception_state) { return copyToChannel(source, channel_number, 0, exception_state); } -void AudioBuffer::copyToChannel(NotShared<DOMFloat32Array> source, +void AudioBuffer::copyToChannel(DOMFloat32Array* source, long channel_number, unsigned long start_in_channel, ExceptionState& exception_state) { @@ -288,9 +286,9 @@ } unsigned count = channel_data->length() - start_in_channel; - count = std::min(source.View()->length(), count); + count = std::min(source->length(), count); - const float* src = source.View()->Data(); + const float* src = source->Data(); float* dst = channel_data->Data(); DCHECK(src); @@ -301,8 +299,8 @@ void AudioBuffer::Zero() { for (unsigned i = 0; i < channels_.size(); ++i) { - if (NotShared<DOMFloat32Array> array = getChannelData(i)) { - float* data = array.View()->Data(); + if (DOMFloat32Array* array = getChannelData(i)) { + float* data = array->Data(); memset(data, 0, length() * sizeof(*data)); } }
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioBuffer.h b/third_party/WebKit/Source/modules/webaudio/AudioBuffer.h index 510431c0..d946994 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioBuffer.h +++ b/third_party/WebKit/Source/modules/webaudio/AudioBuffer.h
@@ -31,7 +31,6 @@ #include "bindings/core/v8/ScriptWrappable.h" #include "core/dom/DOMTypedArray.h" -#include "core/dom/NotShared.h" #include "modules/ModulesExport.h" #include "wtf/PassRefPtr.h" #include "wtf/RefPtr.h" @@ -75,20 +74,15 @@ // Channel data access unsigned numberOfChannels() const { return channels_.size(); } - NotShared<DOMFloat32Array> getChannelData(unsigned channel_index, - ExceptionState&); - NotShared<DOMFloat32Array> getChannelData(unsigned channel_index); - void copyFromChannel(NotShared<DOMFloat32Array>, - long channel_number, - ExceptionState&); - void copyFromChannel(NotShared<DOMFloat32Array>, + DOMFloat32Array* getChannelData(unsigned channel_index, ExceptionState&); + DOMFloat32Array* getChannelData(unsigned channel_index); + void copyFromChannel(DOMFloat32Array*, long channel_number, ExceptionState&); + void copyFromChannel(DOMFloat32Array*, long channel_number, unsigned long start_in_channel, ExceptionState&); - void copyToChannel(NotShared<DOMFloat32Array>, - long channel_number, - ExceptionState&); - void copyToChannel(NotShared<DOMFloat32Array>, + void copyToChannel(DOMFloat32Array*, long channel_number, ExceptionState&); + void copyToChannel(DOMFloat32Array*, long channel_number, unsigned long start_in_channel, ExceptionState&);
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.cpp b/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.cpp index 0b83224..d0904f9 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.cpp
@@ -425,7 +425,7 @@ destination_channels_ = WrapArrayUnique(new float*[number_of_channels]); for (unsigned i = 0; i < number_of_channels; ++i) - source_channels_[i] = buffer->getChannelData(i).View()->Data(); + source_channels_[i] = buffer->getChannelData(i)->Data(); // If this is a grain (as set by a previous call to start()), validate the // grain parameters now since it wasn't validated when start was called
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioParam.cpp b/third_party/WebKit/Source/modules/webaudio/AudioParam.cpp index c775d5a5..00465aa 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioParam.cpp +++ b/third_party/WebKit/Source/modules/webaudio/AudioParam.cpp
@@ -469,17 +469,17 @@ return this; } -AudioParam* AudioParam::setValueCurveAtTime(NotShared<DOMFloat32Array> curve, +AudioParam* AudioParam::setValueCurveAtTime(DOMFloat32Array* curve, double time, double duration, ExceptionState& exception_state) { - float* curve_data = curve.View()->Data(); + float* curve_data = curve->Data(); float min = minValue(); float max = maxValue(); // First, find any non-finite value in the curve and throw an exception if // there are any. - for (unsigned k = 0; k < curve.View()->length(); ++k) { + for (unsigned k = 0; k < curve->length(); ++k) { float value = curve_data[k]; if (!std::isfinite(value)) { @@ -494,7 +494,7 @@ // Second, find the first value in the curve (if any) that is outside the // nominal range. It's probably not necessary to produce a warning on every // value outside the nominal range. - for (unsigned k = 0; k < curve.View()->length(); ++k) { + for (unsigned k = 0; k < curve->length(); ++k) { float value = curve_data[k]; if (value < min || value > max) { @@ -503,7 +503,7 @@ } } - Handler().Timeline().SetValueCurveAtTime(curve.View(), time, duration, + Handler().Timeline().SetValueCurveAtTime(curve, time, duration, exception_state); // We could update the histogram with every value in the curve, due to
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioParam.h b/third_party/WebKit/Source/modules/webaudio/AudioParam.h index 48550745..cd4e8647 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioParam.h +++ b/third_party/WebKit/Source/modules/webaudio/AudioParam.h
@@ -29,16 +29,15 @@ #ifndef AudioParam_h #define AudioParam_h -#include <sys/types.h> #include "bindings/core/v8/ScriptWrappable.h" #include "core/dom/DOMTypedArray.h" -#include "core/dom/NotShared.h" #include "modules/webaudio/AudioParamTimeline.h" #include "modules/webaudio/AudioSummingJunction.h" #include "modules/webaudio/BaseAudioContext.h" #include "wtf/PassRefPtr.h" #include "wtf/ThreadSafeRefCounted.h" #include "wtf/text/WTFString.h" +#include <sys/types.h> namespace blink { @@ -247,7 +246,7 @@ double time, double time_constant, ExceptionState&); - AudioParam* setValueCurveAtTime(NotShared<DOMFloat32Array> curve, + AudioParam* setValueCurveAtTime(DOMFloat32Array* curve, double time, double duration, ExceptionState&);
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioWorkletGlobalScopeTest.cpp b/third_party/WebKit/Source/modules/webaudio/AudioWorkletGlobalScopeTest.cpp index 6e4e965..0f25c173 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioWorkletGlobalScopeTest.cpp +++ b/third_party/WebKit/Source/modules/webaudio/AudioWorkletGlobalScopeTest.cpp
@@ -218,12 +218,10 @@ AudioBuffer::Create(1, kRenderQuantumFrames, kTestingSampleRate); AudioBuffer* output_buffer = AudioBuffer::Create(1, kRenderQuantumFrames, kTestingSampleRate); - DOMFloat32Array* input_channel_data = - input_buffer->getChannelData(0).View(); + DOMFloat32Array* input_channel_data = input_buffer->getChannelData(0); float* input_array_data = input_channel_data->Data(); EXPECT_TRUE(input_array_data); - DOMFloat32Array* output_channel_data = - output_buffer->getChannelData(0).View(); + DOMFloat32Array* output_channel_data = output_buffer->getChannelData(0); float* output_array_data = output_channel_data->Data(); EXPECT_TRUE(output_array_data);
diff --git a/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp b/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp index 4b8c470..769e600 100644 --- a/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp +++ b/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp
@@ -523,8 +523,8 @@ } PeriodicWave* BaseAudioContext::createPeriodicWave( - NotShared<DOMFloat32Array> real, - NotShared<DOMFloat32Array> imag, + DOMFloat32Array* real, + DOMFloat32Array* imag, ExceptionState& exception_state) { DCHECK(IsMainThread()); @@ -532,8 +532,8 @@ } PeriodicWave* BaseAudioContext::createPeriodicWave( - NotShared<DOMFloat32Array> real, - NotShared<DOMFloat32Array> imag, + DOMFloat32Array* real, + DOMFloat32Array* imag, const PeriodicWaveConstraints& options, ExceptionState& exception_state) { DCHECK(IsMainThread());
diff --git a/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.h b/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.h index f17a75c1..dd0af87 100644 --- a/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.h +++ b/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.h
@@ -30,7 +30,6 @@ #include "bindings/core/v8/ScriptPromise.h" #include "bindings/core/v8/ScriptPromiseResolver.h" #include "core/dom/DOMTypedArray.h" -#include "core/dom/NotShared.h" #include "core/dom/SuspendableObject.h" #include "core/events/EventListener.h" #include "modules/EventTargetModules.h" @@ -221,11 +220,11 @@ ChannelMergerNode* createChannelMerger(size_t number_of_inputs, ExceptionState&); OscillatorNode* createOscillator(ExceptionState&); - PeriodicWave* createPeriodicWave(NotShared<DOMFloat32Array> real, - NotShared<DOMFloat32Array> imag, + PeriodicWave* createPeriodicWave(DOMFloat32Array* real, + DOMFloat32Array* imag, ExceptionState&); - PeriodicWave* createPeriodicWave(NotShared<DOMFloat32Array> real, - NotShared<DOMFloat32Array> imag, + PeriodicWave* createPeriodicWave(DOMFloat32Array* real, + DOMFloat32Array* imag, const PeriodicWaveConstraints&, ExceptionState&);
diff --git a/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.cpp b/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.cpp index 4812592..964211a 100644 --- a/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.cpp
@@ -172,22 +172,18 @@ return true; } -void BiquadFilterNode::getFrequencyResponse( - NotShared<const DOMFloat32Array> frequency_hz, - NotShared<DOMFloat32Array> mag_response, - NotShared<DOMFloat32Array> phase_response) { +void BiquadFilterNode::getFrequencyResponse(const DOMFloat32Array* frequency_hz, + DOMFloat32Array* mag_response, + DOMFloat32Array* phase_response) { DCHECK(frequency_hz); DCHECK(mag_response); DCHECK(phase_response); - int n = std::min( - frequency_hz.View()->length(), - std::min(mag_response.View()->length(), phase_response.View()->length())); - if (n) { - GetBiquadProcessor()->GetFrequencyResponse(n, frequency_hz.View()->Data(), - mag_response.View()->Data(), - phase_response.View()->Data()); - } + int n = std::min(frequency_hz->length(), + std::min(mag_response->length(), phase_response->length())); + if (n) + GetBiquadProcessor()->GetFrequencyResponse( + n, frequency_hz->Data(), mag_response->Data(), phase_response->Data()); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.h b/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.h index b83c5c7..4ca7a35 100644 --- a/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.h +++ b/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.h
@@ -27,7 +27,6 @@ #define BiquadFilterNode_h #include "core/dom/DOMTypedArray.h" -#include "core/dom/NotShared.h" #include "modules/webaudio/AudioNode.h" #include "modules/webaudio/BiquadProcessor.h" @@ -71,9 +70,9 @@ // Get the magnitude and phase response of the filter at the given // set of frequencies (in Hz). The phase response is in radians. - void getFrequencyResponse(NotShared<const DOMFloat32Array> frequency_hz, - NotShared<DOMFloat32Array> mag_response, - NotShared<DOMFloat32Array> phase_response); + void getFrequencyResponse(const DOMFloat32Array* frequency_hz, + DOMFloat32Array* mag_response, + DOMFloat32Array* phase_response); private: BiquadFilterNode(BaseAudioContext&);
diff --git a/third_party/WebKit/Source/modules/webaudio/ConvolverNode.cpp b/third_party/WebKit/Source/modules/webaudio/ConvolverNode.cpp index bc730d5..e0b5dc1 100644 --- a/third_party/WebKit/Source/modules/webaudio/ConvolverNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/ConvolverNode.cpp
@@ -131,7 +131,7 @@ RefPtr<AudioBus> buffer_bus = AudioBus::Create(number_of_channels, buffer_length, false); for (unsigned i = 0; i < number_of_channels; ++i) - buffer_bus->SetChannelMemory(i, buffer->getChannelData(i).View()->Data(), + buffer_bus->SetChannelMemory(i, buffer->getChannelData(i)->Data(), buffer_length); buffer_bus->SetSampleRate(buffer->sampleRate());
diff --git a/third_party/WebKit/Source/modules/webaudio/IIRFilterNode.cpp b/third_party/WebKit/Source/modules/webaudio/IIRFilterNode.cpp index 349120a..140a6fc 100644 --- a/third_party/WebKit/Source/modules/webaudio/IIRFilterNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/IIRFilterNode.cpp
@@ -126,52 +126,49 @@ static_cast<AudioBasicProcessorHandler&>(Handler()).Processor()); } -void IIRFilterNode::getFrequencyResponse( - NotShared<const DOMFloat32Array> frequency_hz, - NotShared<DOMFloat32Array> mag_response, - NotShared<DOMFloat32Array> phase_response, - ExceptionState& exception_state) { - if (!frequency_hz.View()) { +void IIRFilterNode::getFrequencyResponse(const DOMFloat32Array* frequency_hz, + DOMFloat32Array* mag_response, + DOMFloat32Array* phase_response, + ExceptionState& exception_state) { + if (!frequency_hz) { exception_state.ThrowDOMException(kNotSupportedError, "frequencyHz array cannot be null"); return; } - if (!mag_response.View()) { + if (!mag_response) { exception_state.ThrowDOMException(kNotSupportedError, "magResponse array cannot be null"); return; } - if (!phase_response.View()) { + if (!phase_response) { exception_state.ThrowDOMException(kNotSupportedError, "phaseResponse array cannot be null"); return; } - unsigned frequency_hz_length = frequency_hz.View()->length(); + unsigned frequency_hz_length = frequency_hz->length(); - if (mag_response.View()->length() < frequency_hz_length) { + if (mag_response->length() < frequency_hz_length) { exception_state.ThrowDOMException( kNotSupportedError, ExceptionMessages::IndexExceedsMinimumBound( - "magResponse length", mag_response.View()->length(), - frequency_hz_length)); + "magResponse length", mag_response->length(), frequency_hz_length)); return; } - if (phase_response.View()->length() < frequency_hz_length) { + if (phase_response->length() < frequency_hz_length) { exception_state.ThrowDOMException( - kNotSupportedError, - ExceptionMessages::IndexExceedsMinimumBound( - "phaseResponse length", phase_response.View()->length(), - frequency_hz_length)); + kNotSupportedError, ExceptionMessages::IndexExceedsMinimumBound( + "phaseResponse length", + phase_response->length(), frequency_hz_length)); return; } IirProcessor()->GetFrequencyResponse( - frequency_hz_length, frequency_hz.View()->Data(), - mag_response.View()->Data(), phase_response.View()->Data()); + frequency_hz_length, frequency_hz->Data(), mag_response->Data(), + phase_response->Data()); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/webaudio/IIRFilterNode.h b/third_party/WebKit/Source/modules/webaudio/IIRFilterNode.h index 826bd67a..e16b8db 100644 --- a/third_party/WebKit/Source/modules/webaudio/IIRFilterNode.h +++ b/third_party/WebKit/Source/modules/webaudio/IIRFilterNode.h
@@ -6,7 +6,6 @@ #define IIRFilterNode_h #include "core/dom/DOMTypedArray.h" -#include "core/dom/NotShared.h" #include "modules/webaudio/AudioNode.h" #include "modules/webaudio/IIRProcessor.h" @@ -33,9 +32,9 @@ // Get the magnitude and phase response of the filter at the given // set of frequencies (in Hz). The phase response is in radians. - void getFrequencyResponse(NotShared<const DOMFloat32Array> frequency_hz, - NotShared<DOMFloat32Array> mag_response, - NotShared<DOMFloat32Array> phase_response, + void getFrequencyResponse(const DOMFloat32Array* frequency_hz, + DOMFloat32Array* mag_response, + DOMFloat32Array* phase_response, ExceptionState&); private:
diff --git a/third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp b/third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp index c784b9c..564c69f 100644 --- a/third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp
@@ -201,7 +201,7 @@ ++channel_index) { const float* source = render_bus_->Channel(channel_index)->Data(); float* destination = - render_target_->getChannelData(channel_index).View()->Data(); + render_target_->getChannelData(channel_index)->Data(); memcpy(destination + frames_processed_, source, sizeof(float) * frames_available_to_copy); }
diff --git a/third_party/WebKit/Source/modules/webaudio/PeriodicWave.cpp b/third_party/WebKit/Source/modules/webaudio/PeriodicWave.cpp index 73b97ce..6bce59b 100644 --- a/third_party/WebKit/Source/modules/webaudio/PeriodicWave.cpp +++ b/third_party/WebKit/Source/modules/webaudio/PeriodicWave.cpp
@@ -83,15 +83,14 @@ } PeriodicWave* PeriodicWave::Create(BaseAudioContext& context, - NotShared<DOMFloat32Array> real, - NotShared<DOMFloat32Array> imag, + DOMFloat32Array* real, + DOMFloat32Array* imag, bool disable_normalization, ExceptionState& exception_state) { DCHECK(IsMainThread()); - return Create(context, real.View()->length(), real.View()->Data(), - imag.View()->length(), imag.View()->Data(), - disable_normalization, exception_state); + return Create(context, real->length(), real->Data(), imag->length(), + imag->Data(), disable_normalization, exception_state); } PeriodicWave* PeriodicWave::Create(BaseAudioContext* context,
diff --git a/third_party/WebKit/Source/modules/webaudio/PeriodicWave.h b/third_party/WebKit/Source/modules/webaudio/PeriodicWave.h index 9f38d61..fcc26b6b 100644 --- a/third_party/WebKit/Source/modules/webaudio/PeriodicWave.h +++ b/third_party/WebKit/Source/modules/webaudio/PeriodicWave.h
@@ -29,13 +29,12 @@ #ifndef PeriodicWave_h #define PeriodicWave_h -#include <memory> #include "bindings/core/v8/ScriptWrappable.h" #include "core/dom/DOMTypedArray.h" -#include "core/dom/NotShared.h" #include "platform/audio/AudioArray.h" #include "wtf/Forward.h" #include "wtf/Vector.h" +#include <memory> namespace blink { @@ -64,8 +63,8 @@ ExceptionState&); static PeriodicWave* Create(BaseAudioContext&, - NotShared<DOMFloat32Array> real, - NotShared<DOMFloat32Array> imag, + DOMFloat32Array* real, + DOMFloat32Array* imag, bool normalize, ExceptionState&);
diff --git a/third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.cpp b/third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.cpp index 4fbd133..b2d7256 100644 --- a/third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.cpp
@@ -174,21 +174,17 @@ for (unsigned i = 0; i < number_of_input_channels; ++i) internal_input_bus_->SetChannelMemory( - i, - input_buffer->getChannelData(i).View()->Data() + - buffer_read_write_index_, + i, input_buffer->getChannelData(i)->Data() + buffer_read_write_index_, frames_to_process); if (number_of_input_channels) internal_input_bus_->CopyFrom(*input_bus); // Copy from the output buffer to the output. - for (unsigned i = 0; i < number_of_output_channels; ++i) { + for (unsigned i = 0; i < number_of_output_channels; ++i) memcpy(output_bus->Channel(i)->MutableData(), - output_buffer->getChannelData(i).View()->Data() + - buffer_read_write_index_, + output_buffer->getChannelData(i)->Data() + buffer_read_write_index_, sizeof(float) * frames_to_process); - } // Update the buffering index. buffer_read_write_index_ =
diff --git a/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.cpp b/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.cpp index 0a594ab..a80dd5d 100644 --- a/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.cpp
@@ -92,12 +92,12 @@ GetWaveShaperProcessor()->SetCurve(curve_data, curve_length); } -void WaveShaperNode::setCurve(NotShared<DOMFloat32Array> curve, +void WaveShaperNode::setCurve(DOMFloat32Array* curve, ExceptionState& exception_state) { DCHECK(IsMainThread()); if (curve) - SetCurveImpl(curve.View()->Data(), curve.View()->length(), exception_state); + SetCurveImpl(curve->Data(), curve->length(), exception_state); else SetCurveImpl(nullptr, 0, exception_state); } @@ -109,18 +109,17 @@ SetCurveImpl(curve.Data(), curve.size(), exception_state); } -NotShared<DOMFloat32Array> WaveShaperNode::curve() { +DOMFloat32Array* WaveShaperNode::curve() { Vector<float>* curve = GetWaveShaperProcessor()->Curve(); if (!curve) - return NotShared<DOMFloat32Array>(nullptr); + return nullptr; unsigned size = curve->size(); RefPtr<WTF::Float32Array> new_curve = WTF::Float32Array::Create(size); memcpy(new_curve->Data(), curve->Data(), sizeof(float) * size); - return NotShared<DOMFloat32Array>( - DOMFloat32Array::Create(new_curve.Release())); + return DOMFloat32Array::Create(new_curve.Release()); } void WaveShaperNode::setOversample(const String& type) {
diff --git a/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.h b/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.h index 3773781..6fd05b2 100644 --- a/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.h +++ b/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.h
@@ -27,7 +27,6 @@ #define WaveShaperNode_h #include "core/dom/DOMTypedArray.h" -#include "core/dom/NotShared.h" #include "modules/webaudio/AudioNode.h" #include "modules/webaudio/WaveShaperProcessor.h" @@ -47,9 +46,9 @@ ExceptionState&); // setCurve() is called on the main thread. - void setCurve(NotShared<DOMFloat32Array>, ExceptionState&); + void setCurve(DOMFloat32Array*, ExceptionState&); void setCurve(const Vector<float>&, ExceptionState&); - NotShared<DOMFloat32Array> curve(); + DOMFloat32Array* curve(); void setOversample(const String&); String oversample() const;
diff --git a/third_party/WebKit/Source/modules/webdatabase/DatabaseAuthorizer.cpp b/third_party/WebKit/Source/modules/webdatabase/DatabaseAuthorizer.cpp index 11304a2..b38b0b6 100644 --- a/third_party/WebKit/Source/modules/webdatabase/DatabaseAuthorizer.cpp +++ b/third_party/WebKit/Source/modules/webdatabase/DatabaseAuthorizer.cpp
@@ -244,7 +244,7 @@ return kSQLAuthDeny; // Allow only the FTS3 extension - if (!EqualIgnoringCase(module_name, "fts3")) + if (!DeprecatedEqualIgnoringCase(module_name, "fts3")) return kSQLAuthDeny; last_action_changed_database_ = true; @@ -257,7 +257,7 @@ return kSQLAuthDeny; // Allow only the FTS3 extension - if (!EqualIgnoringCase(module_name, "fts3")) + if (!DeprecatedEqualIgnoringCase(module_name, "fts3")) return kSQLAuthDeny; return UpdateDeletesBasedOnTableName(table_name); @@ -355,7 +355,7 @@ // equalIgnoringCase(tableName, Database::databaseInfoTableName())) // return SQLAuthDeny; - if (EqualIgnoringCase(table_name, database_info_table_name_)) + if (DeprecatedEqualIgnoringCase(table_name, database_info_table_name_)) return kSQLAuthDeny; return kSQLAuthAllow;
diff --git a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp index 75537ecf..47eae64 100644 --- a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp +++ b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
@@ -248,17 +248,16 @@ WebGLRenderingContextBase::InitializeNewContext(); } -void WebGL2RenderingContextBase::bufferData( - GLenum target, - NotShared<DOMArrayBufferView> src_data, - GLenum usage, - GLuint src_offset, - GLuint length) { +void WebGL2RenderingContextBase::bufferData(GLenum target, + DOMArrayBufferView* src_data, + GLenum usage, + GLuint src_offset, + GLuint length) { if (isContextLost()) return; void* sub_base_address = nullptr; long long sub_byte_length = 0; - if (!ValidateSubSourceAndGetData(src_data.View(), src_offset, length, + if (!ValidateSubSourceAndGetData(src_data, src_offset, length, &sub_base_address, &sub_byte_length)) { SynthesizeGLError(GL_INVALID_VALUE, "bufferData", "srcOffset + length too large"); @@ -280,22 +279,21 @@ } void WebGL2RenderingContextBase::bufferData(GLenum target, - NotShared<DOMArrayBufferView> data, + DOMArrayBufferView* data, GLenum usage) { WebGLRenderingContextBase::bufferData(target, data, usage); } -void WebGL2RenderingContextBase::bufferSubData( - GLenum target, - GLintptr dst_byte_offset, - NotShared<DOMArrayBufferView> src_data, - GLuint src_offset, - GLuint length) { +void WebGL2RenderingContextBase::bufferSubData(GLenum target, + GLintptr dst_byte_offset, + DOMArrayBufferView* src_data, + GLuint src_offset, + GLuint length) { if (isContextLost()) return; void* sub_base_address = nullptr; long long sub_byte_length = 0; - if (!ValidateSubSourceAndGetData(src_data.View(), src_offset, length, + if (!ValidateSubSourceAndGetData(src_data, src_offset, length, &sub_base_address, &sub_byte_length)) { SynthesizeGLError(GL_INVALID_VALUE, "bufferSubData", "srcOffset + length too large"); @@ -367,18 +365,17 @@ static_cast<GLintptr>(write_offset), static_cast<GLsizeiptr>(size)); } -void WebGL2RenderingContextBase::getBufferSubData( - GLenum target, - long long src_byte_offset, - NotShared<DOMArrayBufferView> dst_data, - GLuint dst_offset, - GLuint length) { +void WebGL2RenderingContextBase::getBufferSubData(GLenum target, + long long src_byte_offset, + DOMArrayBufferView* dst_data, + GLuint dst_offset, + GLuint length) { WebGLBuffer* source_buffer = nullptr; void* destination_data_ptr = nullptr; long long destination_byte_length = 0; const char* message = ValidateGetBufferSubData( - __FUNCTION__, target, src_byte_offset, dst_data.View(), dst_offset, - length, &source_buffer, &destination_data_ptr, &destination_byte_length); + __FUNCTION__, target, src_byte_offset, dst_data, dst_offset, length, + &source_buffer, &destination_data_ptr, &destination_byte_length); if (message) { // If there was a GL error, it was already synthesized in // validateGetBufferSubData, so it's not done here. @@ -752,14 +749,13 @@ ContextGL()->PixelStorei(pname, param); } -void WebGL2RenderingContextBase::readPixels( - GLint x, - GLint y, - GLsizei width, - GLsizei height, - GLenum format, - GLenum type, - NotShared<DOMArrayBufferView> pixels) { +void WebGL2RenderingContextBase::readPixels(GLint x, + GLint y, + GLsizei width, + GLsizei height, + GLenum format, + GLenum type, + DOMArrayBufferView* pixels) { if (isContextLost()) return; if (bound_pixel_pack_buffer_.Get()) { @@ -768,18 +764,17 @@ return; } - ReadPixelsHelper(x, y, width, height, format, type, pixels.View(), 0); + ReadPixelsHelper(x, y, width, height, format, type, pixels, 0); } -void WebGL2RenderingContextBase::readPixels( - GLint x, - GLint y, - GLsizei width, - GLsizei height, - GLenum format, - GLenum type, - NotShared<DOMArrayBufferView> pixels, - GLuint offset) { +void WebGL2RenderingContextBase::readPixels(GLint x, + GLint y, + GLsizei width, + GLsizei height, + GLenum format, + GLenum type, + DOMArrayBufferView* pixels, + GLuint offset) { if (isContextLost()) return; if (bound_pixel_pack_buffer_.Get()) { @@ -788,7 +783,7 @@ return; } - ReadPixelsHelper(x, y, width, height, format, type, pixels.View(), offset); + ReadPixelsHelper(x, y, width, height, format, type, pixels, offset); } void WebGL2RenderingContextBase::readPixels(GLint x, @@ -1130,16 +1125,15 @@ reinterpret_cast<const void*>(offset)); } -void WebGL2RenderingContextBase::texImage2D( - GLenum target, - GLint level, - GLint internalformat, - GLsizei width, - GLsizei height, - GLint border, - GLenum format, - GLenum type, - NotShared<DOMArrayBufferView> data) { +void WebGL2RenderingContextBase::texImage2D(GLenum target, + GLint level, + GLint internalformat, + GLsizei width, + GLsizei height, + GLint border, + GLenum format, + GLenum type, + DOMArrayBufferView* data) { if (isContextLost()) return; if (bound_pixel_unpack_buffer_) { @@ -1159,7 +1153,7 @@ GLint border, GLenum format, GLenum type, - NotShared<DOMArrayBufferView> data, + DOMArrayBufferView* data, GLuint src_offset) { if (isContextLost()) return; @@ -1168,9 +1162,9 @@ "a buffer is bound to PIXEL_UNPACK_BUFFER"); return; } - TexImageHelperDOMArrayBufferView( - kTexImage2D, target, level, internalformat, width, height, 1, border, - format, type, 0, 0, 0, data.View(), kNullNotReachable, src_offset); + TexImageHelperDOMArrayBufferView(kTexImage2D, target, level, internalformat, + width, height, 1, border, format, type, 0, 0, + 0, data, kNullNotReachable, src_offset); } void WebGL2RenderingContextBase::texImage2D(GLenum target, @@ -1374,16 +1368,15 @@ type, image_bit_map, exception_state); } -void WebGL2RenderingContextBase::texSubImage2D( - GLenum target, - GLint level, - GLint xoffset, - GLint yoffset, - GLsizei width, - GLsizei height, - GLenum format, - GLenum type, - NotShared<DOMArrayBufferView> pixels) { +void WebGL2RenderingContextBase::texSubImage2D(GLenum target, + GLint level, + GLint xoffset, + GLint yoffset, + GLsizei width, + GLsizei height, + GLenum format, + GLenum type, + DOMArrayBufferView* pixels) { if (isContextLost()) return; if (bound_pixel_unpack_buffer_) { @@ -1395,17 +1388,16 @@ width, height, format, type, pixels); } -void WebGL2RenderingContextBase::texSubImage2D( - GLenum target, - GLint level, - GLint xoffset, - GLint yoffset, - GLsizei width, - GLsizei height, - GLenum format, - GLenum type, - NotShared<DOMArrayBufferView> pixels, - GLuint src_offset) { +void WebGL2RenderingContextBase::texSubImage2D(GLenum target, + GLint level, + GLint xoffset, + GLint yoffset, + GLsizei width, + GLsizei height, + GLenum format, + GLenum type, + DOMArrayBufferView* pixels, + GLuint src_offset) { if (isContextLost()) return; if (bound_pixel_unpack_buffer_) { @@ -1413,9 +1405,9 @@ "a buffer is bound to PIXEL_UNPACK_BUFFER"); return; } - TexImageHelperDOMArrayBufferView( - kTexSubImage2D, target, level, 0, width, height, 1, 0, format, type, - xoffset, yoffset, 0, pixels.View(), kNullNotReachable, src_offset); + TexImageHelperDOMArrayBufferView(kTexSubImage2D, target, level, 0, width, + height, 1, 0, format, type, xoffset, yoffset, + 0, pixels, kNullNotReachable, src_offset); } void WebGL2RenderingContextBase::texSubImage2D(GLenum target, @@ -1656,34 +1648,32 @@ depth); } -void WebGL2RenderingContextBase::texImage3D( - GLenum target, - GLint level, - GLint internalformat, - GLsizei width, - GLsizei height, - GLsizei depth, - GLint border, - GLenum format, - GLenum type, - NotShared<DOMArrayBufferView> pixels) { +void WebGL2RenderingContextBase::texImage3D(GLenum target, + GLint level, + GLint internalformat, + GLsizei width, + GLsizei height, + GLsizei depth, + GLint border, + GLenum format, + GLenum type, + DOMArrayBufferView* pixels) { TexImageHelperDOMArrayBufferView(kTexImage3D, target, level, internalformat, width, height, depth, border, format, type, - 0, 0, 0, pixels.View(), kNullAllowed, 0); + 0, 0, 0, pixels, kNullAllowed, 0); } -void WebGL2RenderingContextBase::texImage3D( - GLenum target, - GLint level, - GLint internalformat, - GLsizei width, - GLsizei height, - GLsizei depth, - GLint border, - GLenum format, - GLenum type, - NotShared<DOMArrayBufferView> pixels, - GLuint src_offset) { +void WebGL2RenderingContextBase::texImage3D(GLenum target, + GLint level, + GLint internalformat, + GLsizei width, + GLsizei height, + GLsizei depth, + GLint border, + GLenum format, + GLenum type, + DOMArrayBufferView* pixels, + GLuint src_offset) { if (isContextLost()) return; if (bound_pixel_unpack_buffer_) { @@ -1693,7 +1683,7 @@ } TexImageHelperDOMArrayBufferView( kTexImage3D, target, level, internalformat, width, height, depth, border, - format, type, 0, 0, 0, pixels.View(), kNullNotReachable, src_offset); + format, type, 0, 0, 0, pixels, kNullNotReachable, src_offset); } void WebGL2RenderingContextBase::texImage3D(GLenum target, @@ -1844,19 +1834,18 @@ unpack_image_height_, exception_state); } -void WebGL2RenderingContextBase::texSubImage3D( - GLenum target, - GLint level, - GLint xoffset, - GLint yoffset, - GLint zoffset, - GLsizei width, - GLsizei height, - GLsizei depth, - GLenum format, - GLenum type, - NotShared<DOMArrayBufferView> pixels, - GLuint src_offset) { +void WebGL2RenderingContextBase::texSubImage3D(GLenum target, + GLint level, + GLint xoffset, + GLint yoffset, + GLint zoffset, + GLsizei width, + GLsizei height, + GLsizei depth, + GLenum format, + GLenum type, + DOMArrayBufferView* pixels, + GLuint src_offset) { if (isContextLost()) return; if (bound_pixel_unpack_buffer_) { @@ -1866,7 +1855,7 @@ } TexImageHelperDOMArrayBufferView( kTexSubImage3D, target, level, 0, width, height, depth, 0, format, type, - xoffset, yoffset, zoffset, pixels.View(), kNullNotReachable, src_offset); + xoffset, yoffset, zoffset, pixels, kNullNotReachable, src_offset); } void WebGL2RenderingContextBase::texSubImage3D(GLenum target, @@ -2061,7 +2050,7 @@ GLsizei width, GLsizei height, GLint border, - NotShared<DOMArrayBufferView> data) { + DOMArrayBufferView* data) { if (isContextLost()) return; if (bound_pixel_unpack_buffer_) { @@ -2080,7 +2069,7 @@ GLsizei width, GLsizei height, GLint border, - NotShared<DOMArrayBufferView> data, + DOMArrayBufferView* data, GLuint src_offset, GLuint src_length_override) { if (isContextLost()) @@ -2094,21 +2083,21 @@ return; if (!ValidateCompressedTexFormat("compressedTexImage2D", internalformat)) return; - if (src_offset > data.View()->byteLength()) { + if (src_offset > data->byteLength()) { SynthesizeGLError(GL_INVALID_VALUE, "compressedTexImage2D", "srcOffset is out of range"); return; } if (src_length_override == 0) { - src_length_override = data.View()->byteLength() - src_offset; - } else if (src_length_override > data.View()->byteLength() - src_offset) { + src_length_override = data->byteLength() - src_offset; + } else if (src_length_override > data->byteLength() - src_offset) { SynthesizeGLError(GL_INVALID_VALUE, "compressedTexImage2D", "srcLengthOverride is out of range"); return; } ContextGL()->CompressedTexImage2D( target, level, internalformat, width, height, border, src_length_override, - static_cast<uint8_t*>(data.View()->BaseAddress()) + src_offset); + static_cast<uint8_t*>(data->BaseAddress()) + src_offset); } void WebGL2RenderingContextBase::compressedTexImage2D(GLenum target, @@ -2139,7 +2128,7 @@ GLsizei width, GLsizei height, GLenum format, - NotShared<DOMArrayBufferView> data) { + DOMArrayBufferView* data) { if (isContextLost()) return; if (bound_pixel_unpack_buffer_) { @@ -2159,7 +2148,7 @@ GLsizei width, GLsizei height, GLenum format, - NotShared<DOMArrayBufferView> data, + DOMArrayBufferView* data, GLuint src_offset, GLuint src_length_override) { if (isContextLost()) @@ -2173,14 +2162,14 @@ return; if (!ValidateCompressedTexFormat("compressedTexSubImage2D", format)) return; - if (src_offset > data.View()->byteLength()) { + if (src_offset > data->byteLength()) { SynthesizeGLError(GL_INVALID_VALUE, "compressedTexSubImage2D", "srcOffset is out of range"); return; } if (src_length_override == 0) { - src_length_override = data.View()->byteLength() - src_offset; - } else if (src_length_override > data.View()->byteLength() - src_offset) { + src_length_override = data->byteLength() - src_offset; + } else if (src_length_override > data->byteLength() - src_offset) { SynthesizeGLError(GL_INVALID_VALUE, "compressedTexImage2D", "srcLengthOverride is out of range"); return; @@ -2188,7 +2177,7 @@ ContextGL()->CompressedTexSubImage2D( target, level, xoffset, yoffset, width, height, format, src_length_override, - static_cast<uint8_t*>(data.View()->BaseAddress()) + src_offset); + static_cast<uint8_t*>(data->BaseAddress()) + src_offset); } void WebGL2RenderingContextBase::compressedTexSubImage2D(GLenum target, @@ -2220,7 +2209,7 @@ GLsizei height, GLsizei depth, GLint border, - NotShared<DOMArrayBufferView> data, + DOMArrayBufferView* data, GLuint src_offset, GLuint src_length_override) { if (isContextLost()) @@ -2234,14 +2223,14 @@ return; if (!ValidateCompressedTexFormat("compressedTexImage3D", internalformat)) return; - if (src_offset > data.View()->byteLength()) { + if (src_offset > data->byteLength()) { SynthesizeGLError(GL_INVALID_VALUE, "compressedTexImage3D", "srcOffset is out of range"); return; } if (src_length_override == 0) { - src_length_override = data.View()->byteLength() - src_offset; - } else if (src_length_override > data.View()->byteLength() - src_offset) { + src_length_override = data->byteLength() - src_offset; + } else if (src_length_override > data->byteLength() - src_offset) { SynthesizeGLError(GL_INVALID_VALUE, "compressedTexImage3D", "srcLengthOverride is out of range"); return; @@ -2249,7 +2238,7 @@ ContextGL()->CompressedTexImage3D( target, level, internalformat, width, height, depth, border, src_length_override, - static_cast<uint8_t*>(data.View()->BaseAddress()) + src_offset); + static_cast<uint8_t*>(data->BaseAddress()) + src_offset); } void WebGL2RenderingContextBase::compressedTexImage3D(GLenum target, @@ -2283,7 +2272,7 @@ GLsizei height, GLsizei depth, GLenum format, - NotShared<DOMArrayBufferView> data, + DOMArrayBufferView* data, GLuint src_offset, GLuint src_length_override) { if (isContextLost()) @@ -2297,14 +2286,14 @@ return; if (!ValidateCompressedTexFormat("compressedTexSubImage3D", format)) return; - if (src_offset > data.View()->byteLength()) { + if (src_offset > data->byteLength()) { SynthesizeGLError(GL_INVALID_VALUE, "compressedTexSubImage3D", "srcOffset is out of range"); return; } if (src_length_override == 0) { - src_length_override = data.View()->byteLength() - src_offset; - } else if (src_length_override > data.View()->byteLength() - src_offset) { + src_length_override = data->byteLength() - src_offset; + } else if (src_length_override > data->byteLength() - src_offset) { SynthesizeGLError(GL_INVALID_VALUE, "compressedTexSubImage3D", "srcLengthOverride is out of range"); return; @@ -2312,7 +2301,7 @@ ContextGL()->CompressedTexSubImage3D( target, level, xoffset, yoffset, zoffset, width, height, depth, format, src_length_override, - static_cast<uint8_t*>(data.View()->BaseAddress()) + src_offset); + static_cast<uint8_t*>(data->BaseAddress()) + src_offset); } void WebGL2RenderingContextBase::compressedTexSubImage3D(GLenum target, @@ -2795,17 +2784,17 @@ void WebGL2RenderingContextBase::uniformMatrix2fv( const WebGLUniformLocation* location, GLboolean transpose, - NotShared<DOMFloat32Array> v, + DOMFloat32Array* v, GLuint src_offset, GLuint src_length) { if (isContextLost() || !ValidateUniformMatrixParameters("uniformMatrix2fv", location, transpose, - v.View(), 4, src_offset, src_length)) + v, 4, src_offset, src_length)) return; ContextGL()->UniformMatrix2fv( location->Location(), - (src_length ? src_length : (v.View()->length() - src_offset)) >> 2, - transpose, v.View()->Data() + src_offset); + (src_length ? src_length : (v->length() - src_offset)) >> 2, transpose, + v->Data() + src_offset); } void WebGL2RenderingContextBase::uniformMatrix2fv( @@ -2827,17 +2816,17 @@ void WebGL2RenderingContextBase::uniformMatrix3fv( const WebGLUniformLocation* location, GLboolean transpose, - NotShared<DOMFloat32Array> v, + DOMFloat32Array* v, GLuint src_offset, GLuint src_length) { if (isContextLost() || !ValidateUniformMatrixParameters("uniformMatrix3fv", location, transpose, - v.View(), 9, src_offset, src_length)) + v, 9, src_offset, src_length)) return; ContextGL()->UniformMatrix3fv( location->Location(), - (src_length ? src_length : (v.View()->length() - src_offset)) / 9, - transpose, v.View()->Data() + src_offset); + (src_length ? src_length : (v->length() - src_offset)) / 9, transpose, + v->Data() + src_offset); } void WebGL2RenderingContextBase::uniformMatrix3fv( @@ -2859,17 +2848,17 @@ void WebGL2RenderingContextBase::uniformMatrix4fv( const WebGLUniformLocation* location, GLboolean transpose, - NotShared<DOMFloat32Array> v, + DOMFloat32Array* v, GLuint src_offset, GLuint src_length) { if (isContextLost() || !ValidateUniformMatrixParameters("uniformMatrix4fv", location, transpose, - v.View(), 16, src_offset, src_length)) + v, 16, src_offset, src_length)) return; ContextGL()->UniformMatrix4fv( location->Location(), - (src_length ? src_length : (v.View()->length() - src_offset)) >> 4, - transpose, v.View()->Data() + src_offset); + (src_length ? src_length : (v->length() - src_offset)) >> 4, transpose, + v->Data() + src_offset); } void WebGL2RenderingContextBase::uniformMatrix4fv( @@ -2891,17 +2880,17 @@ void WebGL2RenderingContextBase::uniformMatrix2x3fv( const WebGLUniformLocation* location, GLboolean transpose, - NotShared<DOMFloat32Array> value, + DOMFloat32Array* value, GLuint src_offset, GLuint src_length) { if (isContextLost() || !ValidateUniformMatrixParameters( - "uniformMatrix2x3fv", location, transpose, - value.View(), 6, src_offset, src_length)) + "uniformMatrix2x3fv", location, transpose, value, + 6, src_offset, src_length)) return; ContextGL()->UniformMatrix2x3fv( location->Location(), - (src_length ? src_length : (value.View()->length() - src_offset)) / 6, - transpose, value.View()->Data() + src_offset); + (src_length ? src_length : (value->length() - src_offset)) / 6, transpose, + value->Data() + src_offset); } void WebGL2RenderingContextBase::uniformMatrix2x3fv( @@ -2924,17 +2913,17 @@ void WebGL2RenderingContextBase::uniformMatrix3x2fv( const WebGLUniformLocation* location, GLboolean transpose, - NotShared<DOMFloat32Array> value, + DOMFloat32Array* value, GLuint src_offset, GLuint src_length) { if (isContextLost() || !ValidateUniformMatrixParameters( - "uniformMatrix3x2fv", location, transpose, - value.View(), 6, src_offset, src_length)) + "uniformMatrix3x2fv", location, transpose, value, + 6, src_offset, src_length)) return; ContextGL()->UniformMatrix3x2fv( location->Location(), - (src_length ? src_length : (value.View()->length() - src_offset)) / 6, - transpose, value.View()->Data() + src_offset); + (src_length ? src_length : (value->length() - src_offset)) / 6, transpose, + value->Data() + src_offset); } void WebGL2RenderingContextBase::uniformMatrix3x2fv( @@ -2957,17 +2946,17 @@ void WebGL2RenderingContextBase::uniformMatrix2x4fv( const WebGLUniformLocation* location, GLboolean transpose, - NotShared<DOMFloat32Array> value, + DOMFloat32Array* value, GLuint src_offset, GLuint src_length) { if (isContextLost() || !ValidateUniformMatrixParameters( - "uniformMatrix2x4fv", location, transpose, - value.View(), 8, src_offset, src_length)) + "uniformMatrix2x4fv", location, transpose, value, + 8, src_offset, src_length)) return; ContextGL()->UniformMatrix2x4fv( location->Location(), - (src_length ? src_length : (value.View()->length() - src_offset)) >> 3, - transpose, value.View()->Data() + src_offset); + (src_length ? src_length : (value->length() - src_offset)) >> 3, + transpose, value->Data() + src_offset); } void WebGL2RenderingContextBase::uniformMatrix2x4fv( @@ -2990,17 +2979,17 @@ void WebGL2RenderingContextBase::uniformMatrix4x2fv( const WebGLUniformLocation* location, GLboolean transpose, - NotShared<DOMFloat32Array> value, + DOMFloat32Array* value, GLuint src_offset, GLuint src_length) { if (isContextLost() || !ValidateUniformMatrixParameters( - "uniformMatrix4x2fv", location, transpose, - value.View(), 8, src_offset, src_length)) + "uniformMatrix4x2fv", location, transpose, value, + 8, src_offset, src_length)) return; ContextGL()->UniformMatrix4x2fv( location->Location(), - (src_length ? src_length : (value.View()->length() - src_offset)) >> 3, - transpose, value.View()->Data() + src_offset); + (src_length ? src_length : (value->length() - src_offset)) >> 3, + transpose, value->Data() + src_offset); } void WebGL2RenderingContextBase::uniformMatrix4x2fv( @@ -3023,17 +3012,17 @@ void WebGL2RenderingContextBase::uniformMatrix3x4fv( const WebGLUniformLocation* location, GLboolean transpose, - NotShared<DOMFloat32Array> value, + DOMFloat32Array* value, GLuint src_offset, GLuint src_length) { if (isContextLost() || !ValidateUniformMatrixParameters( - "uniformMatrix3x4fv", location, transpose, - value.View(), 12, src_offset, src_length)) + "uniformMatrix3x4fv", location, transpose, value, + 12, src_offset, src_length)) return; ContextGL()->UniformMatrix3x4fv( location->Location(), - (src_length ? src_length : (value.View()->length() - src_offset)) / 12, - transpose, value.View()->Data() + src_offset); + (src_length ? src_length : (value->length() - src_offset)) / 12, + transpose, value->Data() + src_offset); } void WebGL2RenderingContextBase::uniformMatrix3x4fv( @@ -3056,17 +3045,17 @@ void WebGL2RenderingContextBase::uniformMatrix4x3fv( const WebGLUniformLocation* location, GLboolean transpose, - NotShared<DOMFloat32Array> value, + DOMFloat32Array* value, GLuint src_offset, GLuint src_length) { if (isContextLost() || !ValidateUniformMatrixParameters( - "uniformMatrix4x3fv", location, transpose, - value.View(), 12, src_offset, src_length)) + "uniformMatrix4x3fv", location, transpose, value, + 12, src_offset, src_length)) return; ContextGL()->UniformMatrix4x3fv( location->Location(), - (src_length ? src_length : (value.View()->length() - src_offset)) / 12, - transpose, value.View()->Data() + src_offset); + (src_length ? src_length : (value->length() - src_offset)) / 12, + transpose, value->Data() + src_offset); } void WebGL2RenderingContextBase::uniformMatrix4x3fv( @@ -3185,7 +3174,7 @@ void WebGL2RenderingContextBase::uniformMatrix2fv( const WebGLUniformLocation* location, GLboolean transpose, - NotShared<DOMFloat32Array> v) { + DOMFloat32Array* v) { WebGLRenderingContextBase::uniformMatrix2fv(location, transpose, v); } @@ -3199,7 +3188,7 @@ void WebGL2RenderingContextBase::uniformMatrix3fv( const WebGLUniformLocation* location, GLboolean transpose, - NotShared<DOMFloat32Array> v) { + DOMFloat32Array* v) { WebGLRenderingContextBase::uniformMatrix3fv(location, transpose, v); } @@ -3213,7 +3202,7 @@ void WebGL2RenderingContextBase::uniformMatrix4fv( const WebGLUniformLocation* location, GLboolean transpose, - NotShared<DOMFloat32Array> v) { + DOMFloat32Array* v) { WebGLRenderingContextBase::uniformMatrix4fv(location, transpose, v); } @@ -3235,16 +3224,15 @@ SetVertexAttribType(index, kInt32ArrayType); } -void WebGL2RenderingContextBase::vertexAttribI4iv( - GLuint index, - NotShared<const DOMInt32Array> v) { +void WebGL2RenderingContextBase::vertexAttribI4iv(GLuint index, + const DOMInt32Array* v) { if (isContextLost()) return; - if (!v.View() || v.View()->length() < 4) { + if (!v || v->length() < 4) { SynthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4iv", "invalid array"); return; } - ContextGL()->VertexAttribI4iv(index, v.View()->Data()); + ContextGL()->VertexAttribI4iv(index, v->Data()); SetVertexAttribType(index, kInt32ArrayType); } @@ -3271,16 +3259,15 @@ SetVertexAttribType(index, kUint32ArrayType); } -void WebGL2RenderingContextBase::vertexAttribI4uiv( - GLuint index, - NotShared<const DOMUint32Array> v) { +void WebGL2RenderingContextBase::vertexAttribI4uiv(GLuint index, + const DOMUint32Array* v) { if (isContextLost()) return; - if (!v.View() || v.View()->length() < 4) { + if (!v || v->length() < 4) { SynthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4uiv", "invalid array"); return; } - ContextGL()->VertexAttribI4uiv(index, v.View()->Data()); + ContextGL()->VertexAttribI4uiv(index, v->Data()); SetVertexAttribType(index, kUint32ArrayType); } @@ -3498,12 +3485,12 @@ void WebGL2RenderingContextBase::clearBufferiv(GLenum buffer, GLint drawbuffer, - NotShared<DOMInt32Array> value) { + DOMInt32Array* value) { if (isContextLost() || - !ValidateClearBuffer("clearBufferiv", buffer, value.View()->length())) + !ValidateClearBuffer("clearBufferiv", buffer, value->length())) return; - ContextGL()->ClearBufferiv(buffer, drawbuffer, value.View()->Data()); + ContextGL()->ClearBufferiv(buffer, drawbuffer, value->Data()); } void WebGL2RenderingContextBase::clearBufferiv(GLenum buffer, @@ -3516,15 +3503,14 @@ ContextGL()->ClearBufferiv(buffer, drawbuffer, value.Data()); } -void WebGL2RenderingContextBase::clearBufferuiv( - GLenum buffer, - GLint drawbuffer, - NotShared<DOMUint32Array> value) { +void WebGL2RenderingContextBase::clearBufferuiv(GLenum buffer, + GLint drawbuffer, + DOMUint32Array* value) { if (isContextLost() || - !ValidateClearBuffer("clearBufferuiv", buffer, value.View()->length())) + !ValidateClearBuffer("clearBufferuiv", buffer, value->length())) return; - ContextGL()->ClearBufferuiv(buffer, drawbuffer, value.View()->Data()); + ContextGL()->ClearBufferuiv(buffer, drawbuffer, value->Data()); } void WebGL2RenderingContextBase::clearBufferuiv(GLenum buffer, @@ -3537,15 +3523,14 @@ ContextGL()->ClearBufferuiv(buffer, drawbuffer, value.Data()); } -void WebGL2RenderingContextBase::clearBufferfv( - GLenum buffer, - GLint drawbuffer, - NotShared<DOMFloat32Array> value) { +void WebGL2RenderingContextBase::clearBufferfv(GLenum buffer, + GLint drawbuffer, + DOMFloat32Array* value) { if (isContextLost() || - !ValidateClearBuffer("clearBufferfv", buffer, value.View()->length())) + !ValidateClearBuffer("clearBufferfv", buffer, value->length())) return; - ContextGL()->ClearBufferfv(buffer, drawbuffer, value.View()->Data()); + ContextGL()->ClearBufferfv(buffer, drawbuffer, value->Data()); } void WebGL2RenderingContextBase::clearBufferfv(GLenum buffer,
diff --git a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.h b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.h index 52b1d744..086ede6a 100644 --- a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.h +++ b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.h
@@ -31,35 +31,21 @@ void DestroyContext() override; /* Buffer objects */ - void bufferData(GLenum, - NotShared<DOMArrayBufferView>, - GLenum, - GLuint, - GLuint); - void bufferSubData(GLenum, - GLintptr, - NotShared<DOMArrayBufferView>, - GLuint, - GLuint); + void bufferData(GLenum, DOMArrayBufferView*, GLenum, GLuint, GLuint); + void bufferSubData(GLenum, GLintptr, DOMArrayBufferView*, GLuint, GLuint); // Have to re-declare/re-define the following buffer{Sub}Data functions from // base class. This is because the above buffer{Sub}Data() hides the name // from base class. void bufferData(GLenum target, long long size, GLenum usage); void bufferData(GLenum target, DOMArrayBuffer* data, GLenum usage); - void bufferData(GLenum target, - NotShared<DOMArrayBufferView> data, - GLenum usage); + void bufferData(GLenum target, DOMArrayBufferView* data, GLenum usage); void bufferSubData(GLenum target, long long offset, DOMArrayBuffer* data); void bufferSubData(GLenum target, long long offset, const FlexibleArrayBufferView& data); void copyBufferSubData(GLenum, GLenum, long long, long long, long long); - void getBufferSubData(GLenum, - long long, - NotShared<DOMArrayBufferView>, - GLuint, - GLuint); + void getBufferSubData(GLenum, long long, DOMArrayBufferView*, GLuint, GLuint); void RegisterGetBufferSubDataAsyncCallback( WebGLGetBufferSubDataAsyncCallback*); @@ -163,7 +149,7 @@ GLint, GLenum, GLenum, - NotShared<DOMArrayBufferView>, + DOMArrayBufferView*, GLuint); void texSubImage2D(GLenum, @@ -232,7 +218,7 @@ GLsizei, GLenum, GLenum, - NotShared<DOMArrayBufferView>, + DOMArrayBufferView*, GLuint); // Have to re-declare/re-define the following tex{Sub}Image2D functions from @@ -312,7 +298,7 @@ GLint, GLenum, GLenum, - NotShared<DOMArrayBufferView>); + DOMArrayBufferView*); void texImage3D(GLenum, GLint, GLint, @@ -322,7 +308,7 @@ GLint, GLenum, GLenum, - NotShared<DOMArrayBufferView>, + DOMArrayBufferView*, GLuint); void texImage3D(GLenum, GLint, @@ -398,7 +384,7 @@ GLsizei, GLenum, GLenum, - NotShared<DOMArrayBufferView>, + DOMArrayBufferView*, GLuint); void texSubImage3D(GLenum, GLint, @@ -479,7 +465,7 @@ GLint, GLenum, GLenum, - NotShared<DOMArrayBufferView>); + DOMArrayBufferView*); void texSubImage2D(GLenum, GLint, GLint, @@ -488,7 +474,7 @@ GLsizei, GLenum, GLenum, - NotShared<DOMArrayBufferView>); + DOMArrayBufferView*); void copyTexSubImage3D(GLenum, GLint, @@ -506,7 +492,7 @@ GLsizei width, GLsizei height, GLint border, - NotShared<DOMArrayBufferView> data, + DOMArrayBufferView* data, GLuint src_offset, GLuint src_length_override); void compressedTexSubImage2D(GLenum target, @@ -516,7 +502,7 @@ GLsizei width, GLsizei height, GLenum format, - NotShared<DOMArrayBufferView> data, + DOMArrayBufferView* data, GLuint src_offset, GLuint src_length_override); void compressedTexImage3D(GLenum, @@ -526,7 +512,7 @@ GLsizei, GLsizei, GLint, - NotShared<DOMArrayBufferView>, + DOMArrayBufferView*, GLuint, GLuint); void compressedTexSubImage3D(GLenum, @@ -538,7 +524,7 @@ GLsizei, GLsizei, GLenum, - NotShared<DOMArrayBufferView>, + DOMArrayBufferView*, GLuint, GLuint); void compressedTexImage2D(GLenum target, @@ -588,7 +574,7 @@ GLsizei width, GLsizei height, GLint border, - NotShared<DOMArrayBufferView> data); + DOMArrayBufferView* data); void compressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, @@ -596,7 +582,7 @@ GLsizei width, GLsizei height, GLenum format, - NotShared<DOMArrayBufferView> data); + DOMArrayBufferView* data); /* Programs and shaders */ GLint getFragDataLocation(WebGLProgram*, const String&); @@ -692,7 +678,7 @@ GLuint); void uniformMatrix2fv(const WebGLUniformLocation*, GLboolean, - NotShared<DOMFloat32Array>, + DOMFloat32Array*, GLuint, GLuint); void uniformMatrix2fv(const WebGLUniformLocation*, @@ -702,7 +688,7 @@ GLuint); void uniformMatrix3fv(const WebGLUniformLocation*, GLboolean, - NotShared<DOMFloat32Array>, + DOMFloat32Array*, GLuint, GLuint); void uniformMatrix3fv(const WebGLUniformLocation*, @@ -712,7 +698,7 @@ GLuint); void uniformMatrix4fv(const WebGLUniformLocation*, GLboolean, - NotShared<DOMFloat32Array>, + DOMFloat32Array*, GLuint, GLuint); void uniformMatrix4fv(const WebGLUniformLocation*, @@ -722,7 +708,7 @@ GLuint); void uniformMatrix2x3fv(const WebGLUniformLocation*, GLboolean, - NotShared<DOMFloat32Array>, + DOMFloat32Array*, GLuint, GLuint); void uniformMatrix2x3fv(const WebGLUniformLocation*, @@ -732,7 +718,7 @@ GLuint); void uniformMatrix3x2fv(const WebGLUniformLocation*, GLboolean, - NotShared<DOMFloat32Array>, + DOMFloat32Array*, GLuint, GLuint); void uniformMatrix3x2fv(const WebGLUniformLocation*, @@ -742,7 +728,7 @@ GLuint); void uniformMatrix2x4fv(const WebGLUniformLocation*, GLboolean, - NotShared<DOMFloat32Array>, + DOMFloat32Array*, GLuint, GLuint); void uniformMatrix2x4fv(const WebGLUniformLocation*, @@ -752,7 +738,7 @@ GLuint); void uniformMatrix4x2fv(const WebGLUniformLocation*, GLboolean, - NotShared<DOMFloat32Array>, + DOMFloat32Array*, GLuint, GLuint); void uniformMatrix4x2fv(const WebGLUniformLocation*, @@ -762,7 +748,7 @@ GLuint); void uniformMatrix3x4fv(const WebGLUniformLocation*, GLboolean, - NotShared<DOMFloat32Array>, + DOMFloat32Array*, GLuint, GLuint); void uniformMatrix3x4fv(const WebGLUniformLocation*, @@ -772,7 +758,7 @@ GLuint); void uniformMatrix4x3fv(const WebGLUniformLocation*, GLboolean, - NotShared<DOMFloat32Array>, + DOMFloat32Array*, GLuint, GLuint); void uniformMatrix4x3fv(const WebGLUniformLocation*, @@ -801,28 +787,28 @@ void uniform4iv(const WebGLUniformLocation*, Vector<GLint>&); void uniformMatrix2fv(const WebGLUniformLocation*, GLboolean transpose, - NotShared<DOMFloat32Array> value); + DOMFloat32Array* value); void uniformMatrix2fv(const WebGLUniformLocation*, GLboolean transpose, Vector<GLfloat>& value); void uniformMatrix3fv(const WebGLUniformLocation*, GLboolean transpose, - NotShared<DOMFloat32Array> value); + DOMFloat32Array* value); void uniformMatrix3fv(const WebGLUniformLocation*, GLboolean transpose, Vector<GLfloat>& value); void uniformMatrix4fv(const WebGLUniformLocation*, GLboolean transpose, - NotShared<DOMFloat32Array> value); + DOMFloat32Array* value); void uniformMatrix4fv(const WebGLUniformLocation*, GLboolean transpose, Vector<GLfloat>& value); void vertexAttribI4i(GLuint, GLint, GLint, GLint, GLint); - void vertexAttribI4iv(GLuint, NotShared<const DOMInt32Array>); + void vertexAttribI4iv(GLuint, const DOMInt32Array*); void vertexAttribI4iv(GLuint, const Vector<GLint>&); void vertexAttribI4ui(GLuint, GLuint, GLuint, GLuint, GLuint); - void vertexAttribI4uiv(GLuint, NotShared<const DOMUint32Array>); + void vertexAttribI4uiv(GLuint, const DOMUint32Array*); void vertexAttribI4uiv(GLuint, const Vector<GLuint>&); void vertexAttribIPointer(GLuint index, GLint size, @@ -843,11 +829,11 @@ /* Multiple Render Targets */ void drawBuffers(const Vector<GLenum>&); - void clearBufferiv(GLenum, GLint, NotShared<DOMInt32Array>); + void clearBufferiv(GLenum, GLint, DOMInt32Array*); void clearBufferiv(GLenum, GLint, const Vector<GLint>&); - void clearBufferuiv(GLenum, GLint, NotShared<DOMUint32Array>); + void clearBufferuiv(GLenum, GLint, DOMUint32Array*); void clearBufferuiv(GLenum, GLint, const Vector<GLuint>&); - void clearBufferfv(GLenum, GLint, NotShared<DOMFloat32Array>); + void clearBufferfv(GLenum, GLint, DOMFloat32Array*); void clearBufferfv(GLenum, GLint, const Vector<GLfloat>&); void clearBufferfi(GLenum, GLint, GLfloat, GLint); @@ -922,7 +908,7 @@ GLsizei height, GLenum format, GLenum type, - NotShared<DOMArrayBufferView> pixels, + DOMArrayBufferView* pixels, GLuint offset); void readPixels(GLint x, GLint y, @@ -951,7 +937,7 @@ GLsizei height, GLenum format, GLenum type, - NotShared<DOMArrayBufferView> pixels) override; + DOMArrayBufferView* pixels) override; void RestoreCurrentFramebuffer() override; DECLARE_VIRTUAL_TRACE();
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLGetBufferSubDataAsync.cpp b/third_party/WebKit/Source/modules/webgl/WebGLGetBufferSubDataAsync.cpp index 268e507d..a55e8ee 100644 --- a/third_party/WebKit/Source/modules/webgl/WebGLGetBufferSubDataAsync.cpp +++ b/third_party/WebKit/Source/modules/webgl/WebGLGetBufferSubDataAsync.cpp
@@ -36,7 +36,7 @@ ScriptState* script_state, GLenum target, GLintptr src_byte_offset, - NotShared<DOMArrayBufferView> dst_data, + DOMArrayBufferView* dst_data, GLuint dst_offset, GLuint length) { ScriptPromiseResolver* resolver = ScriptPromiseResolver::Create(script_state); @@ -61,8 +61,8 @@ void* destination_data_ptr = nullptr; long long destination_byte_length = 0; const char* message = context->ValidateGetBufferSubData( - __FUNCTION__, target, src_byte_offset, dst_data.View(), dst_offset, - length, &source_buffer, &destination_data_ptr, &destination_byte_length); + __FUNCTION__, target, src_byte_offset, dst_data, dst_offset, length, + &source_buffer, &destination_data_ptr, &destination_byte_length); if (message) { // If there was a GL error, it was already synthesized in // validateGetBufferSubData, so it's not done here. @@ -83,7 +83,7 @@ // If the length of the copy is zero, this is a no-op. if (!destination_byte_length) { - resolver->Resolve(dst_data.View()); + resolver->Resolve(dst_data); return promise; } @@ -101,8 +101,8 @@ } auto callback_object = new WebGLGetBufferSubDataAsyncCallback( - context, resolver, mapped_data, query_id, dst_data.View(), - destination_data_ptr, destination_byte_length); + context, resolver, mapped_data, query_id, dst_data, destination_data_ptr, + destination_byte_length); context->RegisterGetBufferSubDataAsyncCallback(callback_object); auto callback = WTF::Bind(&WebGLGetBufferSubDataAsyncCallback::Resolve, WrapPersistent(callback_object));
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLGetBufferSubDataAsync.h b/third_party/WebKit/Source/modules/webgl/WebGLGetBufferSubDataAsync.h index d0f8ec9..82f738b 100644 --- a/third_party/WebKit/Source/modules/webgl/WebGLGetBufferSubDataAsync.h +++ b/third_party/WebKit/Source/modules/webgl/WebGLGetBufferSubDataAsync.h
@@ -6,7 +6,6 @@ #define WebGLGetBufferSubDataAsync_h #include "bindings/core/v8/ScriptPromise.h" -#include "core/dom/NotShared.h" #include "modules/webgl/WebGLExtension.h" namespace blink { @@ -26,7 +25,7 @@ ScriptPromise getBufferSubDataAsync(ScriptState*, GLenum target, GLintptr src_byte_offset, - NotShared<DOMArrayBufferView>, + DOMArrayBufferView*, GLuint dst_offset, GLuint length);
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp index 3934d5f..46adea0 100644 --- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp +++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
@@ -1562,8 +1562,8 @@ return ImageData::Create( IntSize(width, height), - NotShared<DOMUint8ClampedArray>(DOMUint8ClampedArray::Create( - image_data_pixels, 0, image_data_pixels->ByteLength()))); + DOMUint8ClampedArray::Create(image_data_pixels, 0, + image_data_pixels->ByteLength())); } void WebGLRenderingContextBase::Reshape(int width, int height) { @@ -1903,13 +1903,12 @@ } void WebGLRenderingContextBase::bufferData(GLenum target, - NotShared<DOMArrayBufferView> data, + DOMArrayBufferView* data, GLenum usage) { if (isContextLost()) return; DCHECK(data); - BufferDataImpl(target, data.View()->byteLength(), data.View()->BaseAddress(), - usage); + BufferDataImpl(target, data->byteLength(), data->BaseAddress(), usage); } void WebGLRenderingContextBase::BufferSubDataImpl(GLenum target, @@ -2076,14 +2075,13 @@ ContextGL()->CompileShader(ObjectOrZero(shader)); } -void WebGLRenderingContextBase::compressedTexImage2D( - GLenum target, - GLint level, - GLenum internalformat, - GLsizei width, - GLsizei height, - GLint border, - NotShared<DOMArrayBufferView> data) { +void WebGLRenderingContextBase::compressedTexImage2D(GLenum target, + GLint level, + GLenum internalformat, + GLsizei width, + GLsizei height, + GLint border, + DOMArrayBufferView* data) { if (isContextLost()) return; if (!ValidateTexture2DBinding("compressedTexImage2D", target)) @@ -2091,8 +2089,8 @@ if (!ValidateCompressedTexFormat("compressedTexImage2D", internalformat)) return; ContextGL()->CompressedTexImage2D(target, level, internalformat, width, - height, border, data.View()->byteLength(), - data.View()->BaseAddress()); + height, border, data->byteLength(), + data->BaseAddress()); } void WebGLRenderingContextBase::compressedTexSubImage2D( @@ -2103,16 +2101,16 @@ GLsizei width, GLsizei height, GLenum format, - NotShared<DOMArrayBufferView> data) { + DOMArrayBufferView* data) { if (isContextLost()) return; if (!ValidateTexture2DBinding("compressedTexSubImage2D", target)) return; if (!ValidateCompressedTexFormat("compressedTexSubImage2D", format)) return; - ContextGL()->CompressedTexSubImage2D( - target, level, xoffset, yoffset, width, height, format, - data.View()->byteLength(), data.View()->BaseAddress()); + ContextGL()->CompressedTexSubImage2D(target, level, xoffset, yoffset, width, + height, format, data->byteLength(), + data->BaseAddress()); } bool WebGLRenderingContextBase::ValidateSettableTexFormat( @@ -2817,7 +2815,7 @@ const char* const* prefix_set = Prefixes(); for (; *prefix_set; ++prefix_set) { String prefixed_name = String(*prefix_set) + ExtensionName(); - if (EqualIgnoringCase(prefixed_name, name)) { + if (DeprecatedEqualIgnoringCase(prefixed_name, name)) { return true; } } @@ -4108,15 +4106,14 @@ return true; } -void WebGLRenderingContextBase::readPixels( - GLint x, - GLint y, - GLsizei width, - GLsizei height, - GLenum format, - GLenum type, - NotShared<DOMArrayBufferView> pixels) { - ReadPixelsHelper(x, y, width, height, format, type, pixels.View(), 0); +void WebGLRenderingContextBase::readPixels(GLint x, + GLint y, + GLsizei width, + GLsizei height, + GLenum format, + GLenum type, + DOMArrayBufferView* pixels) { + ReadPixelsHelper(x, y, width, height, format, type, pixels, 0); } void WebGLRenderingContextBase::ReadPixelsHelper(GLint x, @@ -4723,19 +4720,18 @@ format, type, data); } -void WebGLRenderingContextBase::texImage2D( - GLenum target, - GLint level, - GLint internalformat, - GLsizei width, - GLsizei height, - GLint border, - GLenum format, - GLenum type, - NotShared<DOMArrayBufferView> pixels) { +void WebGLRenderingContextBase::texImage2D(GLenum target, + GLint level, + GLint internalformat, + GLsizei width, + GLsizei height, + GLint border, + GLenum format, + GLenum type, + DOMArrayBufferView* pixels) { TexImageHelperDOMArrayBufferView(kTexImage2D, target, level, internalformat, width, height, 1, border, format, type, 0, 0, - 0, pixels.View(), kNullAllowed, 0); + 0, pixels, kNullAllowed, 0); } void WebGLRenderingContextBase::TexImageHelperImageData( @@ -5558,19 +5554,18 @@ TexParameter(target, pname, 0, param, false); } -void WebGLRenderingContextBase::texSubImage2D( - GLenum target, - GLint level, - GLint xoffset, - GLint yoffset, - GLsizei width, - GLsizei height, - GLenum format, - GLenum type, - NotShared<DOMArrayBufferView> pixels) { +void WebGLRenderingContextBase::texSubImage2D(GLenum target, + GLint level, + GLint xoffset, + GLint yoffset, + GLsizei width, + GLsizei height, + GLenum format, + GLenum type, + DOMArrayBufferView* pixels) { TexImageHelperDOMArrayBufferView(kTexSubImage2D, target, level, 0, width, height, 1, 0, format, type, xoffset, yoffset, - 0, pixels.View(), kNullNotAllowed, 0); + 0, pixels, kNullNotAllowed, 0); } void WebGLRenderingContextBase::texSubImage2D(GLenum target, @@ -5924,13 +5919,13 @@ void WebGLRenderingContextBase::uniformMatrix2fv( const WebGLUniformLocation* location, GLboolean transpose, - NotShared<DOMFloat32Array> v) { + DOMFloat32Array* v) { if (isContextLost() || !ValidateUniformMatrixParameters("uniformMatrix2fv", location, transpose, - v.View(), 4, 0, v.View()->length())) + v, 4, 0, v->length())) return; - ContextGL()->UniformMatrix2fv(location->Location(), v.View()->length() >> 2, - transpose, v.View()->Data()); + ContextGL()->UniformMatrix2fv(location->Location(), v->length() >> 2, + transpose, v->Data()); } void WebGLRenderingContextBase::uniformMatrix2fv( @@ -5948,13 +5943,13 @@ void WebGLRenderingContextBase::uniformMatrix3fv( const WebGLUniformLocation* location, GLboolean transpose, - NotShared<DOMFloat32Array> v) { + DOMFloat32Array* v) { if (isContextLost() || !ValidateUniformMatrixParameters("uniformMatrix3fv", location, transpose, - v.View(), 9, 0, v.View()->length())) + v, 9, 0, v->length())) return; - ContextGL()->UniformMatrix3fv(location->Location(), v.View()->length() / 9, - transpose, v.View()->Data()); + ContextGL()->UniformMatrix3fv(location->Location(), v->length() / 9, + transpose, v->Data()); } void WebGLRenderingContextBase::uniformMatrix3fv( @@ -5972,13 +5967,13 @@ void WebGLRenderingContextBase::uniformMatrix4fv( const WebGLUniformLocation* location, GLboolean transpose, - NotShared<DOMFloat32Array> v) { + DOMFloat32Array* v) { if (isContextLost() || !ValidateUniformMatrixParameters("uniformMatrix4fv", location, transpose, - v.View(), 16, 0, v.View()->length())) + v, 16, 0, v->length())) return; - ContextGL()->UniformMatrix4fv(location->Location(), v.View()->length() >> 4, - transpose, v.View()->Data()); + ContextGL()->UniformMatrix4fv(location->Location(), v->length() >> 4, + transpose, v->Data()); } void WebGLRenderingContextBase::uniformMatrix4fv( @@ -6034,16 +6029,15 @@ SetVertexAttribType(index, kFloat32ArrayType); } -void WebGLRenderingContextBase::vertexAttrib1fv( - GLuint index, - NotShared<const DOMFloat32Array> v) { +void WebGLRenderingContextBase::vertexAttrib1fv(GLuint index, + const DOMFloat32Array* v) { if (isContextLost()) return; - if (!v.View() || v.View()->length() < 1) { + if (!v || v->length() < 1) { SynthesizeGLError(GL_INVALID_VALUE, "vertexAttrib1fv", "invalid array"); return; } - ContextGL()->VertexAttrib1fv(index, v.View()->Data()); + ContextGL()->VertexAttrib1fv(index, v->Data()); SetVertexAttribType(index, kFloat32ArrayType); } @@ -6068,16 +6062,15 @@ SetVertexAttribType(index, kFloat32ArrayType); } -void WebGLRenderingContextBase::vertexAttrib2fv( - GLuint index, - NotShared<const DOMFloat32Array> v) { +void WebGLRenderingContextBase::vertexAttrib2fv(GLuint index, + const DOMFloat32Array* v) { if (isContextLost()) return; - if (!v.View() || v.View()->length() < 2) { + if (!v || v->length() < 2) { SynthesizeGLError(GL_INVALID_VALUE, "vertexAttrib2fv", "invalid array"); return; } - ContextGL()->VertexAttrib2fv(index, v.View()->Data()); + ContextGL()->VertexAttrib2fv(index, v->Data()); SetVertexAttribType(index, kFloat32ArrayType); } @@ -6103,16 +6096,15 @@ SetVertexAttribType(index, kFloat32ArrayType); } -void WebGLRenderingContextBase::vertexAttrib3fv( - GLuint index, - NotShared<const DOMFloat32Array> v) { +void WebGLRenderingContextBase::vertexAttrib3fv(GLuint index, + const DOMFloat32Array* v) { if (isContextLost()) return; - if (!v.View() || v.View()->length() < 3) { + if (!v || v->length() < 3) { SynthesizeGLError(GL_INVALID_VALUE, "vertexAttrib3fv", "invalid array"); return; } - ContextGL()->VertexAttrib3fv(index, v.View()->Data()); + ContextGL()->VertexAttrib3fv(index, v->Data()); SetVertexAttribType(index, kFloat32ArrayType); } @@ -6139,16 +6131,15 @@ SetVertexAttribType(index, kFloat32ArrayType); } -void WebGLRenderingContextBase::vertexAttrib4fv( - GLuint index, - NotShared<const DOMFloat32Array> v) { +void WebGLRenderingContextBase::vertexAttrib4fv(GLuint index, + const DOMFloat32Array* v) { if (isContextLost()) return; - if (!v.View() || v.View()->length() < 4) { + if (!v || v->length() < 4) { SynthesizeGLError(GL_INVALID_VALUE, "vertexAttrib4fv", "invalid array"); return; } - ContextGL()->VertexAttrib4fv(index, v.View()->Data()); + ContextGL()->VertexAttrib4fv(index, v->Data()); SetVertexAttribType(index, kFloat32ArrayType); }
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h index 5c34932..45a8a20 100644 --- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h +++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h
@@ -26,8 +26,6 @@ #ifndef WebGLRenderingContextBase_h #define WebGLRenderingContextBase_h -#include <memory> -#include <set> #include "bindings/core/v8/Nullable.h" #include "bindings/core/v8/ScriptState.h" #include "bindings/core/v8/ScriptValue.h" @@ -35,7 +33,6 @@ #include "bindings/core/v8/ScriptWrappableVisitor.h" #include "core/CoreExport.h" #include "core/dom/DOMTypedArray.h" -#include "core/dom/NotShared.h" #include "core/dom/TypedFlexibleArrayBufferView.h" #include "core/html/canvas/CanvasContextCreationAttributes.h" #include "core/html/canvas/CanvasRenderingContext.h" @@ -54,6 +51,8 @@ #include "third_party/khronos/GLES2/gl2.h" #include "wtf/CheckedNumeric.h" #include "wtf/text/WTFString.h" +#include <memory> +#include <set> namespace blink { class WebLayer; @@ -167,9 +166,7 @@ void bufferData(GLenum target, long long size, GLenum usage); void bufferData(GLenum target, DOMArrayBuffer* data, GLenum usage); - void bufferData(GLenum target, - NotShared<DOMArrayBufferView> data, - GLenum usage); + void bufferData(GLenum target, DOMArrayBufferView* data, GLenum usage); void bufferSubData(GLenum target, long long offset, DOMArrayBuffer* data); void bufferSubData(GLenum target, long long offset, @@ -192,7 +189,7 @@ GLsizei width, GLsizei height, GLint border, - NotShared<DOMArrayBufferView> data); + DOMArrayBufferView* data); void compressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, @@ -200,7 +197,7 @@ GLsizei width, GLsizei height, GLenum format, - NotShared<DOMArrayBufferView> data); + DOMArrayBufferView* data); void copyTexImage2D(GLenum target, GLint level, @@ -325,7 +322,7 @@ GLsizei height, GLenum format, GLenum type, - NotShared<DOMArrayBufferView> pixels); + DOMArrayBufferView* pixels); void renderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, @@ -348,7 +345,7 @@ GLint border, GLenum format, GLenum type, - NotShared<DOMArrayBufferView>); + DOMArrayBufferView*); void texImage2D(GLenum target, GLint level, GLint internalformat, @@ -395,7 +392,7 @@ GLsizei height, GLenum format, GLenum type, - NotShared<DOMArrayBufferView>); + DOMArrayBufferView*); void texSubImage2D(GLenum target, GLint level, GLint xoffset, @@ -470,19 +467,19 @@ void uniform4iv(const WebGLUniformLocation*, Vector<GLint>&); void uniformMatrix2fv(const WebGLUniformLocation*, GLboolean transpose, - NotShared<DOMFloat32Array> value); + DOMFloat32Array* value); void uniformMatrix2fv(const WebGLUniformLocation*, GLboolean transpose, Vector<GLfloat>& value); void uniformMatrix3fv(const WebGLUniformLocation*, GLboolean transpose, - NotShared<DOMFloat32Array> value); + DOMFloat32Array* value); void uniformMatrix3fv(const WebGLUniformLocation*, GLboolean transpose, Vector<GLfloat>& value); void uniformMatrix4fv(const WebGLUniformLocation*, GLboolean transpose, - NotShared<DOMFloat32Array> value); + DOMFloat32Array* value); void uniformMatrix4fv(const WebGLUniformLocation*, GLboolean transpose, Vector<GLfloat>& value); @@ -491,16 +488,16 @@ void validateProgram(WebGLProgram*); void vertexAttrib1f(GLuint index, GLfloat x); - void vertexAttrib1fv(GLuint index, NotShared<const DOMFloat32Array> values); + void vertexAttrib1fv(GLuint index, const DOMFloat32Array* values); void vertexAttrib1fv(GLuint index, const Vector<GLfloat>& values); void vertexAttrib2f(GLuint index, GLfloat x, GLfloat y); - void vertexAttrib2fv(GLuint index, NotShared<const DOMFloat32Array> values); + void vertexAttrib2fv(GLuint index, const DOMFloat32Array* values); void vertexAttrib2fv(GLuint index, const Vector<GLfloat>& values); void vertexAttrib3f(GLuint index, GLfloat x, GLfloat y, GLfloat z); - void vertexAttrib3fv(GLuint index, NotShared<const DOMFloat32Array> values); + void vertexAttrib3fv(GLuint index, const DOMFloat32Array* values); void vertexAttrib3fv(GLuint index, const Vector<GLfloat>& values); void vertexAttrib4f(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); - void vertexAttrib4fv(GLuint index, NotShared<const DOMFloat32Array> values); + void vertexAttrib4fv(GLuint index, const DOMFloat32Array* values); void vertexAttrib4fv(GLuint index, const Vector<GLfloat>& values); void vertexAttribPointer(GLuint index, GLint size,
diff --git a/third_party/WebKit/Source/modules/webmidi/MIDIMessageEvent.cpp b/third_party/WebKit/Source/modules/webmidi/MIDIMessageEvent.cpp index e12dd9a..f4a1075 100644 --- a/third_party/WebKit/Source/modules/webmidi/MIDIMessageEvent.cpp +++ b/third_party/WebKit/Source/modules/webmidi/MIDIMessageEvent.cpp
@@ -12,7 +12,7 @@ const MIDIMessageEventInit& initializer) : Event(type, initializer) { if (initializer.hasData()) - data_ = initializer.data().View(); + data_ = initializer.data(); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/webmidi/MIDIOutput.cpp b/third_party/WebKit/Source/modules/webmidi/MIDIOutput.cpp index e287267..9070fad 100644 --- a/third_party/WebKit/Source/modules/webmidi/MIDIOutput.cpp +++ b/third_party/WebKit/Source/modules/webmidi/MIDIOutput.cpp
@@ -221,7 +221,7 @@ MIDIOutput::~MIDIOutput() {} -void MIDIOutput::send(NotShared<DOMUint8Array> array, +void MIDIOutput::send(DOMUint8Array* array, double timestamp, ExceptionState& exception_state) { DCHECK(array); @@ -233,11 +233,10 @@ // This should be performed even if |array| is invalid. open(); - if (MessageValidator::Validate(array.View(), exception_state, - midiAccess()->sysexEnabled())) { - midiAccess()->SendMIDIData(port_index_, array.View()->Data(), - array.View()->length(), timestamp); - } + if (MessageValidator::Validate(array, exception_state, + midiAccess()->sysexEnabled())) + midiAccess()->SendMIDIData(port_index_, array->Data(), array->length(), + timestamp); } void MIDIOutput::send(Vector<unsigned> unsigned_data, @@ -261,11 +260,10 @@ array_data[i] = unsigned_data[i] & 0xff; } - send(NotShared<DOMUint8Array>(array), timestamp, exception_state); + send(array, timestamp, exception_state); } -void MIDIOutput::send(NotShared<DOMUint8Array> data, - ExceptionState& exception_state) { +void MIDIOutput::send(DOMUint8Array* data, ExceptionState& exception_state) { DCHECK(data); send(data, 0.0, exception_state); }
diff --git a/third_party/WebKit/Source/modules/webmidi/MIDIOutput.h b/third_party/WebKit/Source/modules/webmidi/MIDIOutput.h index 74d4fca..3bd59ed 100644 --- a/third_party/WebKit/Source/modules/webmidi/MIDIOutput.h +++ b/third_party/WebKit/Source/modules/webmidi/MIDIOutput.h
@@ -32,7 +32,6 @@ #define MIDIOutput_h #include "core/dom/DOMTypedArray.h" -#include "core/dom/NotShared.h" #include "modules/webmidi/MIDIPort.h" namespace blink { @@ -53,11 +52,11 @@ midi::mojom::PortState); ~MIDIOutput() override; - void send(NotShared<DOMUint8Array>, double timestamp, ExceptionState&); + void send(DOMUint8Array*, double timestamp, ExceptionState&); void send(Vector<unsigned>, double timestamp, ExceptionState&); // send() without optional |timestamp|. - void send(NotShared<DOMUint8Array>, ExceptionState&); + void send(DOMUint8Array*, ExceptionState&); void send(Vector<unsigned>, ExceptionState&); DECLARE_VIRTUAL_TRACE();
diff --git a/third_party/WebKit/Source/modules/websockets/DOMWebSocket.cpp b/third_party/WebKit/Source/modules/websockets/DOMWebSocket.cpp index 8dde310d..e8480f5 100644 --- a/third_party/WebKit/Source/modules/websockets/DOMWebSocket.cpp +++ b/third_party/WebKit/Source/modules/websockets/DOMWebSocket.cpp
@@ -477,27 +477,26 @@ channel_->Send(*binary_data, 0, binary_data->ByteLength()); } -void DOMWebSocket::send(NotShared<DOMArrayBufferView> array_buffer_view, +void DOMWebSocket::send(DOMArrayBufferView* array_buffer_view, ExceptionState& exception_state) { NETWORK_DVLOG(1) << "WebSocket " << this << " send() Sending ArrayBufferView " - << array_buffer_view.View(); + << array_buffer_view; DCHECK(array_buffer_view); if (state_ == kConnecting) { SetInvalidStateErrorForSendMethod(exception_state); return; } if (state_ == kClosing || state_ == kClosed) { - UpdateBufferedAmountAfterClose(array_buffer_view.View()->byteLength()); + UpdateBufferedAmountAfterClose(array_buffer_view->byteLength()); return; } RecordSendTypeHistogram(kWebSocketSendTypeArrayBufferView); RecordSendMessageSizeHistogram(kWebSocketSendTypeArrayBufferView, - array_buffer_view.View()->byteLength()); + array_buffer_view->byteLength()); DCHECK(channel_); - buffered_amount_ += array_buffer_view.View()->byteLength(); - channel_->Send(*array_buffer_view.View()->buffer(), - array_buffer_view.View()->byteOffset(), - array_buffer_view.View()->byteLength()); + buffered_amount_ += array_buffer_view->byteLength(); + channel_->Send(*array_buffer_view->buffer(), array_buffer_view->byteOffset(), + array_buffer_view->byteLength()); } void DOMWebSocket::send(Blob* binary_data, ExceptionState& exception_state) {
diff --git a/third_party/WebKit/Source/modules/websockets/DOMWebSocket.h b/third_party/WebKit/Source/modules/websockets/DOMWebSocket.h index 7775690..a1eeae0 100644 --- a/third_party/WebKit/Source/modules/websockets/DOMWebSocket.h +++ b/third_party/WebKit/Source/modules/websockets/DOMWebSocket.h
@@ -31,12 +31,8 @@ #ifndef DOMWebSocket_h #define DOMWebSocket_h -#include <stddef.h> -#include <stdint.h> -#include <memory> #include "bindings/core/v8/ActiveScriptWrappable.h" #include "bindings/core/v8/ScriptWrappable.h" -#include "core/dom/NotShared.h" #include "core/dom/SuspendableObject.h" #include "core/events/EventListener.h" #include "core/events/EventTarget.h" @@ -52,6 +48,9 @@ #include "wtf/PassRefPtr.h" #include "wtf/RefPtr.h" #include "wtf/text/WTFString.h" +#include <memory> +#include <stddef.h> +#include <stdint.h> namespace blink { @@ -91,7 +90,7 @@ void send(const String& message, ExceptionState&); void send(DOMArrayBuffer*, ExceptionState&); - void send(NotShared<DOMArrayBufferView>, ExceptionState&); + void send(DOMArrayBufferView*, ExceptionState&); void send(Blob*, ExceptionState&); // To distinguish close method call with the code parameter from one
diff --git a/third_party/WebKit/Source/modules/webusb/USBDevice.cpp b/third_party/WebKit/Source/modules/webusb/USBDevice.cpp index 675b7a1..c0e999c 100644 --- a/third_party/WebKit/Source/modules/webusb/USBDevice.cpp +++ b/third_party/WebKit/Source/modules/webusb/USBDevice.cpp
@@ -85,9 +85,9 @@ vector.Append(static_cast<uint8_t*>(buffer.getAsArrayBuffer()->Data()), buffer.getAsArrayBuffer()->ByteLength()); else - vector.Append(static_cast<uint8_t*>( - buffer.getAsArrayBufferView().View()->BaseAddress()), - buffer.getAsArrayBufferView().View()->byteLength()); + vector.Append( + static_cast<uint8_t*>(buffer.getAsArrayBufferView()->BaseAddress()), + buffer.getAsArrayBufferView()->byteLength()); return vector; }
diff --git a/third_party/WebKit/Source/platform/exported/WebServiceWorkerRequest.cpp b/third_party/WebKit/Source/platform/exported/WebServiceWorkerRequest.cpp index aa9478f6..20404131 100644 --- a/third_party/WebKit/Source/platform/exported/WebServiceWorkerRequest.cpp +++ b/third_party/WebKit/Source/platform/exported/WebServiceWorkerRequest.cpp
@@ -69,14 +69,14 @@ void WebServiceWorkerRequest::SetHeader(const WebString& key, const WebString& value) { - if (EqualIgnoringCase(key, "referer")) + if (DeprecatedEqualIgnoringCase(key, "referer")) return; private_->headers_.Set(key, value); } void WebServiceWorkerRequest::AppendHeader(const WebString& key, const WebString& value) { - if (EqualIgnoringCase(key, "referer")) + if (DeprecatedEqualIgnoringCase(key, "referer")) return; HTTPHeaderMap::AddResult result = private_->headers_.Add(key, value); if (!result.is_new_entry)
diff --git a/third_party/WebKit/Source/platform/exported/WebURLRequest.cpp b/third_party/WebKit/Source/platform/exported/WebURLRequest.cpp index 158ac2c1..0fbd502 100644 --- a/third_party/WebKit/Source/platform/exported/WebURLRequest.cpp +++ b/third_party/WebKit/Source/platform/exported/WebURLRequest.cpp
@@ -162,7 +162,7 @@ void WebURLRequest::SetHTTPHeaderField(const WebString& name, const WebString& value) { - RELEASE_ASSERT(!EqualIgnoringCase(name, "referer")); + RELEASE_ASSERT(!DeprecatedEqualIgnoringCase(name, "referer")); resource_request_->SetHTTPHeaderField(name, value); }
diff --git a/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp b/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp index 19e263f..5440bc8 100644 --- a/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp +++ b/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp
@@ -93,7 +93,7 @@ String target_string; for (size_t j = 0; j < targets->size(); ++j) { if (targets->at(j)->AsString(&target_string)) { - if (EqualIgnoringCase(target_string, "self")) { + if (DeprecatedEqualIgnoringCase(target_string, "self")) { if (!origin->IsUnique()) origins.push_back(origin); } else if (target_string == "*") {
diff --git a/third_party/WebKit/Source/platform/fonts/AlternateFontFamily.h b/third_party/WebKit/Source/platform/fonts/AlternateFontFamily.h index 36cbe4e..c5b17a9 100644 --- a/third_party/WebKit/Source/platform/fonts/AlternateFontFamily.h +++ b/third_party/WebKit/Source/platform/fonts/AlternateFontFamily.h
@@ -48,14 +48,14 @@ // using 'Courier New' on windows. DEFINE_STATIC_LOCAL(AtomicString, courier, ("Courier")); DEFINE_STATIC_LOCAL(AtomicString, courier_new, ("Courier New")); - if (EqualIgnoringCase(family_name, courier)) + if (DeprecatedEqualIgnoringCase(family_name, courier)) return courier_new; // Alias 'MS Sans Serif' (bitmap font) -> 'Microsoft Sans Serif' // (truetype font). DEFINE_STATIC_LOCAL(AtomicString, ms_sans, ("MS Sans Serif")); DEFINE_STATIC_LOCAL(AtomicString, microsoft_sans, ("Microsoft Sans Serif")); - if (EqualIgnoringCase(family_name, ms_sans)) + if (DeprecatedEqualIgnoringCase(family_name, ms_sans)) return microsoft_sans; // Alias 'MS Serif' (bitmap) -> 'Times New Roman' (truetype font). @@ -64,8 +64,8 @@ DEFINE_STATIC_LOCAL(AtomicString, ms_serif, ("MS Serif")); DEFINE_STATIC_LOCAL(AtomicString, times, ("Times")); DEFINE_STATIC_LOCAL(AtomicString, times_new_roman, ("Times New Roman")); - if (EqualIgnoringCase(family_name, ms_serif) || - EqualIgnoringCase(family_name, times)) + if (DeprecatedEqualIgnoringCase(family_name, ms_serif) || + DeprecatedEqualIgnoringCase(family_name, times)) return times_new_roman; #endif @@ -77,30 +77,30 @@ // Alias Courier <-> Courier New DEFINE_STATIC_LOCAL(AtomicString, courier, ("Courier")); DEFINE_STATIC_LOCAL(AtomicString, courier_new, ("Courier New")); - if (EqualIgnoringCase(family_name, courier)) + if (DeprecatedEqualIgnoringCase(family_name, courier)) return courier_new; #if !OS(WIN) // On Windows, Courier New (truetype font) is always present and // Courier is a bitmap font. So, we don't want to map Courier New to // Courier. - if (EqualIgnoringCase(family_name, courier_new)) + if (DeprecatedEqualIgnoringCase(family_name, courier_new)) return courier; #endif // Alias Times and Times New Roman. DEFINE_STATIC_LOCAL(AtomicString, times, ("Times")); DEFINE_STATIC_LOCAL(AtomicString, times_new_roman, ("Times New Roman")); - if (EqualIgnoringCase(family_name, times)) + if (DeprecatedEqualIgnoringCase(family_name, times)) return times_new_roman; - if (EqualIgnoringCase(family_name, times_new_roman)) + if (DeprecatedEqualIgnoringCase(family_name, times_new_roman)) return times; // Alias Arial and Helvetica DEFINE_STATIC_LOCAL(AtomicString, arial, ("Arial")); DEFINE_STATIC_LOCAL(AtomicString, helvetica, ("Helvetica")); - if (EqualIgnoringCase(family_name, arial)) + if (DeprecatedEqualIgnoringCase(family_name, arial)) return helvetica; - if (EqualIgnoringCase(family_name, helvetica)) + if (DeprecatedEqualIgnoringCase(family_name, helvetica)) return arial; return g_empty_atom;
diff --git a/third_party/WebKit/Source/platform/fonts/FontCustomPlatformData.cpp b/third_party/WebKit/Source/platform/fonts/FontCustomPlatformData.cpp index eb62630..b131898 100644 --- a/third_party/WebKit/Source/platform/fonts/FontCustomPlatformData.cpp +++ b/third_party/WebKit/Source/platform/fonts/FontCustomPlatformData.cpp
@@ -121,8 +121,8 @@ } bool FontCustomPlatformData::SupportsFormat(const String& format) { - return EqualIgnoringCase(format, "truetype") || - EqualIgnoringCase(format, "opentype") || + return DeprecatedEqualIgnoringCase(format, "truetype") || + DeprecatedEqualIgnoringCase(format, "opentype") || WebFontDecoder::SupportsFormat(format); }
diff --git a/third_party/WebKit/Source/platform/fonts/FontFaceCreationParams.h b/third_party/WebKit/Source/platform/fonts/FontFaceCreationParams.h index 2f66538..d899883 100644 --- a/third_party/WebKit/Source/platform/fonts/FontFaceCreationParams.h +++ b/third_party/WebKit/Source/platform/fonts/FontFaceCreationParams.h
@@ -119,7 +119,7 @@ bool operator==(const FontFaceCreationParams& other) const { return creation_type_ == other.creation_type_ && - EqualIgnoringCase(family_, other.family_) && + DeprecatedEqualIgnoringCase(family_, other.family_) && filename_ == other.filename_ && fontconfig_interface_id_ == other.fontconfig_interface_id_ && ttc_index_ == other.ttc_index_;
diff --git a/third_party/WebKit/Source/platform/fonts/WebFontDecoder.cpp b/third_party/WebKit/Source/platform/fonts/WebFontDecoder.cpp index dd96948d..ebfbb928 100644 --- a/third_party/WebKit/Source/platform/fonts/WebFontDecoder.cpp +++ b/third_party/WebKit/Source/platform/fonts/WebFontDecoder.cpp
@@ -176,8 +176,8 @@ // static bool WebFontDecoder::SupportsFormat(const String& format) { - return EqualIgnoringCase(format, "woff") || - EqualIgnoringCase(format, "woff2"); + return DeprecatedEqualIgnoringCase(format, "woff") || + DeprecatedEqualIgnoringCase(format, "woff2"); } sk_sp<SkTypeface> WebFontDecoder::Decode(SharedBuffer* buffer) {
diff --git a/third_party/WebKit/Source/platform/fonts/shaping/CaseMappingHarfBuzzBufferFiller.cpp b/third_party/WebKit/Source/platform/fonts/shaping/CaseMappingHarfBuzzBufferFiller.cpp index eedae86e..1a4e830 100644 --- a/third_party/WebKit/Source/platform/fonts/shaping/CaseMappingHarfBuzzBufferFiller.cpp +++ b/third_party/WebKit/Source/platform/fonts/shaping/CaseMappingHarfBuzzBufferFiller.cpp
@@ -32,9 +32,9 @@ } else { String case_mapped_text; if (case_map_intend == CaseMapIntend::kUpperCase) { - case_mapped_text = String(buffer, buffer_length).Upper(locale); + case_mapped_text = String(buffer, buffer_length).UpperUnicode(locale); } else { - case_mapped_text = String(buffer, buffer_length).Lower(locale); + case_mapped_text = String(buffer, buffer_length).LowerUnicode(locale); } if (case_mapped_text.length() != buffer_length) { @@ -71,9 +71,9 @@ String char_by_char(&buffer[char_index], new_char_index - char_index); String case_mapped_char; if (case_map_intend == CaseMapIntend::kUpperCase) - case_mapped_char = char_by_char.Upper(locale); + case_mapped_char = char_by_char.UpperUnicode(locale); else - case_mapped_char = char_by_char.Lower(locale); + case_mapped_char = char_by_char.LowerUnicode(locale); for (unsigned j = 0; j < case_mapped_char.length();) { UChar32 codepoint = 0;
diff --git a/third_party/WebKit/Source/platform/fonts/win/FontCacheSkiaWin.cpp b/third_party/WebKit/Source/platform/fonts/win/FontCacheSkiaWin.cpp index 63514bf5..d230a9a 100644 --- a/third_party/WebKit/Source/platform/fonts/win/FontCacheSkiaWin.cpp +++ b/third_party/WebKit/Source/platform/fonts/win/FontCacheSkiaWin.cpp
@@ -221,8 +221,9 @@ return nullptr; } -static inline bool EqualIgnoringCase(const AtomicString& a, const SkString& b) { - return EqualIgnoringCase(a, ToAtomicString(b)); +static inline bool DeprecatedEqualIgnoringCase(const AtomicString& a, + const SkString& b) { + return DeprecatedEqualIgnoringCase(a, ToAtomicString(b)); } static bool TypefacesMatchesFamily(const SkTypeface* tf, @@ -233,7 +234,7 @@ SkTypeface::LocalizedString actual_family; while (actual_families->next(&actual_family)) { - if (EqualIgnoringCase(family, actual_family.fString)) { + if (DeprecatedEqualIgnoringCase(family, actual_family.fString)) { matches_requested_family = true; break; } @@ -248,7 +249,7 @@ if (!matches_requested_family) { SkString family_name; tf->getFamilyName(&family_name); - if (EqualIgnoringCase(family, family_name)) + if (DeprecatedEqualIgnoringCase(family, family_name)) matches_requested_family = true; }
diff --git a/third_party/WebKit/Source/platform/fonts/win/FontFallbackWin.cpp b/third_party/WebKit/Source/platform/fonts/win/FontFallbackWin.cpp index 18f7bae3c..26b7bca3 100644 --- a/third_party/WebKit/Source/platform/fonts/win/FontFallbackWin.cpp +++ b/third_party/WebKit/Source/platform/fonts/win/FontFallbackWin.cpp
@@ -59,7 +59,7 @@ bool matches_requested_family = false; SkTypeface::LocalizedString actual_family; while (actual_families->next(&actual_family)) { - if (EqualIgnoringCase( + if (DeprecatedEqualIgnoringCase( family, AtomicString::FromUTF8(actual_family.fString.c_str()))) { matches_requested_family = true; break;
diff --git a/third_party/WebKit/Source/platform/heap/HeapTest.cpp b/third_party/WebKit/Source/platform/heap/HeapTest.cpp index 1ed1d40..37e9aaef 100644 --- a/third_party/WebKit/Source/platform/heap/HeapTest.cpp +++ b/third_party/WebKit/Source/platform/heap/HeapTest.cpp
@@ -2569,9 +2569,9 @@ cset2.Swap(*set2); MemberCountedSet& c_counted_set = container->set3; - set3->Swap(c_counted_set); + set3->swap(c_counted_set); EXPECT_EQ(0u, set3->size()); - set3->Swap(c_counted_set); + set3->swap(c_counted_set); // Triple swap. container->map.Swap(*member_member2); @@ -2661,7 +2661,7 @@ EXPECT_FALSE(set->Contains(one_b)); EXPECT_TRUE(set2->Contains(one_b)); EXPECT_TRUE(set3->Contains(one_b)); - EXPECT_EQ(2u, set3->Find(one_b)->value); + EXPECT_EQ(2u, set3->find(one_b)->value); EXPECT_EQ(3, vector->at(0)->Value()); EXPECT_EQ(4, vector->at(1)->Value()); EXPECT_EQ(3, deque->begin()->Get()->Value()); @@ -3019,9 +3019,9 @@ EXPECT_EQ(2u, weak_weak->size()); EXPECT_EQ(4u, weak_set->size()); EXPECT_EQ(4u, weak_counted_set->size()); - EXPECT_EQ(3u, weak_counted_set->Find(two)->value); + EXPECT_EQ(3u, weak_counted_set->find(two)->value); weak_counted_set->erase(two); - EXPECT_EQ(2u, weak_counted_set->Find(two)->value); + EXPECT_EQ(2u, weak_counted_set->find(two)->value); } keep_numbers_alive[0] = nullptr;
diff --git a/third_party/WebKit/Source/platform/loader/fetch/CrossOriginAccessControl.cpp b/third_party/WebKit/Source/platform/loader/fetch/CrossOriginAccessControl.cpp index d15cf03..f5eb494d 100644 --- a/third_party/WebKit/Source/platform/loader/fetch/CrossOriginAccessControl.cpp +++ b/third_party/WebKit/Source/platform/loader/fetch/CrossOriginAccessControl.cpp
@@ -62,7 +62,7 @@ // Exclude simple headers. continue; } - if (EqualIgnoringCase(header.key, "referer")) { + if (DeprecatedEqualIgnoringCase(header.key, "referer")) { // When the request is from a Worker, referrer header was added by // WorkerThreadableLoader. But it should not be added to // Access-Control-Request-Headers header. @@ -353,7 +353,7 @@ response.HttpHeaderField(HTTPNames::Access_Control_Allow_External); if (result.IsNull()) return kPreflightMissingAllowExternal; - if (!EqualIgnoringCase(result, "true")) + if (!DeprecatedEqualIgnoringCase(result, "true")) return kPreflightInvalidAllowExternal; return kPreflightSuccess; }
diff --git a/third_party/WebKit/Source/platform/loader/fetch/FetchUtils.cpp b/third_party/WebKit/Source/platform/loader/fetch/FetchUtils.cpp index fb53d4c..a4d5e4c 100644 --- a/third_party/WebKit/Source/platform/loader/fetch/FetchUtils.cpp +++ b/third_party/WebKit/Source/platform/loader/fetch/FetchUtils.cpp
@@ -95,16 +95,16 @@ // Treat inspector headers as a simple headers, since they are added by blink // when the inspector is open. - if (EqualIgnoringCase(name, "accept") || - EqualIgnoringCase(name, "accept-language") || - EqualIgnoringCase(name, "content-language") || - EqualIgnoringCase( + if (DeprecatedEqualIgnoringCase(name, "accept") || + DeprecatedEqualIgnoringCase(name, "accept-language") || + DeprecatedEqualIgnoringCase(name, "content-language") || + DeprecatedEqualIgnoringCase( name, HTTPNames::X_DevTools_Emulate_Network_Conditions_Client_Id) || - EqualIgnoringCase(name, HTTPNames::X_DevTools_Request_Id) || - EqualIgnoringCase(name, "save-data")) + DeprecatedEqualIgnoringCase(name, HTTPNames::X_DevTools_Request_Id) || + DeprecatedEqualIgnoringCase(name, "save-data")) return true; - if (EqualIgnoringCase(name, "content-type")) + if (DeprecatedEqualIgnoringCase(name, "content-type")) return IsSimpleContentType(value); return false; @@ -112,9 +112,10 @@ bool FetchUtils::IsSimpleContentType(const AtomicString& media_type) { AtomicString mime_type = ExtractMIMETypeFromMediaType(media_type); - return EqualIgnoringCase(mime_type, "application/x-www-form-urlencoded") || - EqualIgnoringCase(mime_type, "multipart/form-data") || - EqualIgnoringCase(mime_type, "text/plain"); + return DeprecatedEqualIgnoringCase(mime_type, + "application/x-www-form-urlencoded") || + DeprecatedEqualIgnoringCase(mime_type, "multipart/form-data") || + DeprecatedEqualIgnoringCase(mime_type, "text/plain"); } bool FetchUtils::IsSimpleRequest(const String& method, @@ -136,9 +137,9 @@ // http://fetch.spec.whatwg.org/#forbidden-method // "A forbidden method is a method that is a byte case-insensitive match" // for one of `CONNECT`, `TRACE`, and `TRACK`." - return EqualIgnoringCase(method, "TRACE") || - EqualIgnoringCase(method, "TRACK") || - EqualIgnoringCase(method, "CONNECT"); + return DeprecatedEqualIgnoringCase(method, "TRACE") || + DeprecatedEqualIgnoringCase(method, "TRACK") || + DeprecatedEqualIgnoringCase(method, "CONNECT"); } bool FetchUtils::IsForbiddenHeaderName(const String& name) { @@ -160,8 +161,8 @@ // "A forbidden response header name is a header name that is one of: // `Set-Cookie`, `Set-Cookie2`" - return EqualIgnoringCase(name, "set-cookie") || - EqualIgnoringCase(name, "set-cookie2"); + return DeprecatedEqualIgnoringCase(name, "set-cookie") || + DeprecatedEqualIgnoringCase(name, "set-cookie2"); } bool FetchUtils::IsSimpleOrForbiddenRequest(const String& method, @@ -188,7 +189,7 @@ }; for (const auto& known : kMethods) { - if (EqualIgnoringCase(method, known)) { + if (DeprecatedEqualIgnoringCase(method, known)) { // Don't bother allocating a new string if it's already all // uppercase. return method == known ? method : known;
diff --git a/third_party/WebKit/Source/platform/loader/fetch/Resource.cpp b/third_party/WebKit/Source/platform/loader/fetch/Resource.cpp index 65a55ae..0f40021 100644 --- a/third_party/WebKit/Source/platform/loader/fetch/Resource.cpp +++ b/third_party/WebKit/Source/platform/loader/fetch/Resource.cpp
@@ -88,7 +88,8 @@ const AtomicString& header) { for (size_t i = 0; i < WTF_ARRAY_LENGTH(kHeadersToIgnoreAfterRevalidation); i++) { - if (EqualIgnoringCase(header, kHeadersToIgnoreAfterRevalidation[i])) + if (DeprecatedEqualIgnoringCase(header, + kHeadersToIgnoreAfterRevalidation[i])) return false; } for (size_t i = 0;
diff --git a/third_party/WebKit/Source/platform/loader/fetch/ResourceResponse.cpp b/third_party/WebKit/Source/platform/loader/fetch/ResourceResponse.cpp index cd7d761a..4018d23 100644 --- a/third_party/WebKit/Source/platform/loader/fetch/ResourceResponse.cpp +++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceResponse.cpp
@@ -348,16 +348,16 @@ static const char kExpiresHeader[] = "expires"; static const char kLastModifiedHeader[] = "last-modified"; - if (EqualIgnoringCase(name, kAgeHeader)) + if (DeprecatedEqualIgnoringCase(name, kAgeHeader)) have_parsed_age_header_ = false; - else if (EqualIgnoringCase(name, kCacheControlHeader) || - EqualIgnoringCase(name, kPragmaHeader)) + else if (DeprecatedEqualIgnoringCase(name, kCacheControlHeader) || + DeprecatedEqualIgnoringCase(name, kPragmaHeader)) cache_control_header_ = CacheControlHeader(); - else if (EqualIgnoringCase(name, kDateHeader)) + else if (DeprecatedEqualIgnoringCase(name, kDateHeader)) have_parsed_date_header_ = false; - else if (EqualIgnoringCase(name, kExpiresHeader)) + else if (DeprecatedEqualIgnoringCase(name, kExpiresHeader)) have_parsed_expires_header_ = false; - else if (EqualIgnoringCase(name, kLastModifiedHeader)) + else if (DeprecatedEqualIgnoringCase(name, kLastModifiedHeader)) have_parsed_last_modified_header_ = false; } @@ -517,7 +517,7 @@ if (loc != kNotFound) value = value.Left(loc); value = value.StripWhiteSpace(); - return EqualIgnoringCase(value, kAttachmentString); + return DeprecatedEqualIgnoringCase(value, kAttachmentString); } AtomicString ResourceResponse::HttpContentType() const {
diff --git a/third_party/WebKit/Source/platform/network/EncodedFormData.h b/third_party/WebKit/Source/platform/network/EncodedFormData.h index be4d9322a5..120d189 100644 --- a/third_party/WebKit/Source/platform/network/EncodedFormData.h +++ b/third_party/WebKit/Source/platform/network/EncodedFormData.h
@@ -152,9 +152,9 @@ } static EncodingType ParseEncodingType(const String& type) { - if (EqualIgnoringCase(type, "text/plain")) + if (DeprecatedEqualIgnoringCase(type, "text/plain")) return kTextPlain; - if (EqualIgnoringCase(type, "multipart/form-data")) + if (DeprecatedEqualIgnoringCase(type, "multipart/form-data")) return kMultipartFormData; return kFormURLEncoded; }
diff --git a/third_party/WebKit/Source/platform/network/HTTPParsers.cpp b/third_party/WebKit/Source/platform/network/HTTPParsers.cpp index 64c819ea..76b8839a 100644 --- a/third_party/WebKit/Source/platform/network/HTTPParsers.cpp +++ b/third_party/WebKit/Source/platform/network/HTTPParsers.cpp
@@ -281,7 +281,7 @@ String disposition_type = parameters[0]; disposition_type.StripWhiteSpace(); - if (EqualIgnoringCase(disposition_type, "inline")) + if (DeprecatedEqualIgnoringCase(disposition_type, "inline")) return kContentDispositionInline; // Some broken sites just send bogus headers like @@ -717,15 +717,17 @@ for (size_t i = 0; i < directives_size; ++i) { // RFC2616 14.9.1: A no-cache directive with a value is only meaningful // for proxy caches. It should be ignored by a browser level cache. - if (EqualIgnoringCase(directives[i].first, kNoCacheDirective) && + if (DeprecatedEqualIgnoringCase(directives[i].first, kNoCacheDirective) && directives[i].second.IsEmpty()) { cache_control_header.contains_no_cache = true; - } else if (EqualIgnoringCase(directives[i].first, kNoStoreDirective)) { + } else if (DeprecatedEqualIgnoringCase(directives[i].first, + kNoStoreDirective)) { cache_control_header.contains_no_store = true; - } else if (EqualIgnoringCase(directives[i].first, - kMustRevalidateDirective)) { + } else if (DeprecatedEqualIgnoringCase(directives[i].first, + kMustRevalidateDirective)) { cache_control_header.contains_must_revalidate = true; - } else if (EqualIgnoringCase(directives[i].first, kMaxAgeDirective)) { + } else if (DeprecatedEqualIgnoringCase(directives[i].first, + kMaxAgeDirective)) { if (!std::isnan(cache_control_header.max_age)) { // First max-age directive wins if there are multiple ones. continue;
diff --git a/third_party/WebKit/Source/platform/network/mime/MIMETypeRegistry.cpp b/third_party/WebKit/Source/platform/network/mime/MIMETypeRegistry.cpp index f26a25e..bdb38ae 100644 --- a/third_party/WebKit/Source/platform/network/mime/MIMETypeRegistry.cpp +++ b/third_party/WebKit/Source/platform/network/mime/MIMETypeRegistry.cpp
@@ -113,10 +113,10 @@ bool MIMETypeRegistry::IsSupportedImageMIMETypeForEncoding( const String& mime_type) { - if (EqualIgnoringCase(mime_type, "image/jpeg") || - EqualIgnoringCase(mime_type, "image/png")) + if (DeprecatedEqualIgnoringCase(mime_type, "image/jpeg") || + DeprecatedEqualIgnoringCase(mime_type, "image/png")) return true; - if (EqualIgnoringCase(mime_type, "image/webp")) + if (DeprecatedEqualIgnoringCase(mime_type, "image/webp")) return true; return false; } @@ -197,7 +197,7 @@ } bool MIMETypeRegistry::IsSupportedStyleSheetMIMEType(const String& mime_type) { - return EqualIgnoringCase(mime_type, "text/css"); + return DeprecatedEqualIgnoringCase(mime_type, "text/css"); } bool MIMETypeRegistry::IsSupportedFontMIMEType(const String& mime_type) { @@ -210,7 +210,7 @@ } bool MIMETypeRegistry::IsSupportedTextTrackMIMEType(const String& mime_type) { - return EqualIgnoringCase(mime_type, "text/vtt"); + return DeprecatedEqualIgnoringCase(mime_type, "text/vtt"); } } // namespace blink
diff --git a/third_party/WebKit/Source/platform/text/LocaleMac.mm b/third_party/WebKit/Source/platform/text/LocaleMac.mm index eb144daa..c393454 100644 --- a/third_party/WebKit/Source/platform/text/LocaleMac.mm +++ b/third_party/WebKit/Source/platform/text/LocaleMac.mm
@@ -57,7 +57,7 @@ String current_locale_language = LanguageFromLocale(String([current_locale.Get() localeIdentifier])); String locale_language = LanguageFromLocale(locale); - if (EqualIgnoringCase(current_locale_language, locale_language)) + if (DeprecatedEqualIgnoringCase(current_locale_language, locale_language)) return current_locale; } // It seems initWithLocaleIdentifier accepts dash-separated locale identifier.
diff --git a/third_party/WebKit/Source/platform/text/LocaleWin.cpp b/third_party/WebKit/Source/platform/text/LocaleWin.cpp index 6926e94..27fc7bd 100644 --- a/third_party/WebKit/Source/platform/text/LocaleWin.cpp +++ b/third_party/WebKit/Source/platform/text/LocaleWin.cpp
@@ -57,7 +57,8 @@ const String& user_default_language_code, const String& locale) { String locale_language_code = ExtractLanguageCode(locale); - if (EqualIgnoringCase(locale_language_code, user_default_language_code)) + if (DeprecatedEqualIgnoringCase(locale_language_code, + user_default_language_code)) return user_default_lcid; if (locale.length() >= LOCALE_NAME_MAX_LENGTH) return 0;
diff --git a/third_party/WebKit/Source/platform/wtf/HashCountedSet.h b/third_party/WebKit/Source/platform/wtf/HashCountedSet.h index 4e30c60..2d10c675 100644 --- a/third_party/WebKit/Source/platform/wtf/HashCountedSet.h +++ b/third_party/WebKit/Source/platform/wtf/HashCountedSet.h
@@ -63,10 +63,10 @@ "HeapHashCountedSet<Member<T>> instead."); } - void Swap(HashCountedSet& other) { impl_.Swap(other.impl_); } + void swap(HashCountedSet& other) { impl_.Swap(other.impl_); } unsigned size() const { return impl_.size(); } - unsigned Capacity() const { return impl_.Capacity(); } + unsigned capacity() const { return impl_.capacity(); } bool IsEmpty() const { return impl_.IsEmpty(); } // Iterators iterate over pairs of values (called key) and counts (called @@ -76,12 +76,12 @@ const_iterator begin() const { return impl_.begin(); } const_iterator end() const { return impl_.end(); } - iterator Find(const ValueType& value) { return impl_.Find(value); } - const_iterator Find(const ValueType& value) const { - return impl_.Find(value); + iterator find(const ValueType& value) { return impl_.Find(value); } + const_iterator find(const ValueType& value) const { + return impl_.find(value); } bool Contains(const ValueType& value) const { return impl_.Contains(value); } - unsigned Count(const ValueType& value) const { return impl_.at(value); } + unsigned count(const ValueType& value) const { return impl_.at(value); } // Increases the count if an equal value is already present the return value // is a pair of an iterator to the new value's location, and a bool that is @@ -93,15 +93,15 @@ // Reduces the count of the value, and removes it if count goes down to // zero, returns true if the value is removed. - bool erase(const ValueType& value) { return erase(Find(value)); } + bool erase(const ValueType& value) { return erase(find(value)); } bool erase(iterator); // Removes the value, regardless of its count. - void RemoveAll(const ValueType& value) { RemoveAll(Find(value)); } + void RemoveAll(const ValueType& value) { RemoveAll(find(value)); } void RemoveAll(iterator); // Clears the whole set. - void Clear() { impl_.Clear(); } + void clear() { impl_.Clear(); } Vector<Value> AsVector() const;
diff --git a/third_party/WebKit/Source/platform/wtf/text/AtomicString.cpp b/third_party/WebKit/Source/platform/wtf/text/AtomicString.cpp index 4985247..5fbe3ab 100644 --- a/third_party/WebKit/Source/platform/wtf/text/AtomicString.cpp +++ b/third_party/WebKit/Source/platform/wtf/text/AtomicString.cpp
@@ -71,7 +71,7 @@ StringImpl* impl = this->Impl(); if (UNLIKELY(!impl)) return *this; - RefPtr<StringImpl> new_impl = impl->Lower(); + RefPtr<StringImpl> new_impl = impl->LowerUnicode(); if (LIKELY(new_impl == impl)) return *this; return AtomicString(new_impl.Release());
diff --git a/third_party/WebKit/Source/platform/wtf/text/StringBuilder.h b/third_party/WebKit/Source/platform/wtf/text/StringBuilder.h index c9ae4b3..20e1745 100644 --- a/third_party/WebKit/Source/platform/wtf/text/StringBuilder.h +++ b/third_party/WebKit/Source/platform/wtf/text/StringBuilder.h
@@ -235,24 +235,27 @@ } template <typename CharType> -bool EqualIgnoringCase(const StringBuilder& s, - const CharType* buffer, - unsigned length) { +bool DeprecatedEqualIgnoringCase(const StringBuilder& s, + const CharType* buffer, + unsigned length) { if (s.length() != length) return false; if (s.Is8Bit()) - return EqualIgnoringCase(s.Characters8(), buffer, length); + return DeprecatedEqualIgnoringCase(s.Characters8(), buffer, length); - return EqualIgnoringCase(s.Characters16(), buffer, length); + return DeprecatedEqualIgnoringCase(s.Characters16(), buffer, length); } // Unicode aware case insensitive string matching. Non-ASCII characters might // match to ASCII characters. This function is rarely used to implement web // platform features. -inline bool EqualIgnoringCase(const StringBuilder& s, const char* string) { - return EqualIgnoringCase(s, reinterpret_cast<const LChar*>(string), - strlen(string)); +// This function is deprecated. We should introduce EqualIgnoringASCIICase() or +// EqualIgnoringUnicodeCase(). See crbug.com/627682 +inline bool DeprecatedEqualIgnoringCase(const StringBuilder& s, + const char* string) { + return DeprecatedEqualIgnoringCase(s, reinterpret_cast<const LChar*>(string), + strlen(string)); } template <typename StringType>
diff --git a/third_party/WebKit/Source/platform/wtf/text/StringHash.h b/third_party/WebKit/Source/platform/wtf/text/StringHash.h index 734518c..486e546 100644 --- a/third_party/WebKit/Source/platform/wtf/text/StringHash.h +++ b/third_party/WebKit/Source/platform/wtf/text/StringHash.h
@@ -100,7 +100,7 @@ // Save one branch inside each StringView by derefing the StringImpl, // and another branch inside the compare function by skipping the null // checks. - return EqualIgnoringCaseAndNullity(*a, *b); + return DeprecatedEqualIgnoringCaseAndNullity(*a, *b); } static unsigned GetHash(const RefPtr<StringImpl>& key) {
diff --git a/third_party/WebKit/Source/platform/wtf/text/StringImpl.cpp b/third_party/WebKit/Source/platform/wtf/text/StringImpl.cpp index bca6443e..1e9deaa 100644 --- a/third_party/WebKit/Source/platform/wtf/text/StringImpl.cpp +++ b/third_party/WebKit/Source/platform/wtf/text/StringImpl.cpp
@@ -633,7 +633,7 @@ return new_impl.Release(); } -PassRefPtr<StringImpl> StringImpl::Lower() { +PassRefPtr<StringImpl> StringImpl::LowerUnicode() { // Note: This is a hot function in the Dromaeo benchmark, specifically the // no-op code path up through the first 'return' statement. @@ -710,9 +710,9 @@ return new_impl.Release(); } -PassRefPtr<StringImpl> StringImpl::Upper() { - // This function could be optimized for no-op cases the way lower() is, - // but in empirical testing, few actual calls to upper() are no-ops, so +PassRefPtr<StringImpl> StringImpl::UpperUnicode() { + // This function could be optimized for no-op cases the way LowerUnicode() is, + // but in empirical testing, few actual calls to UpperUnicode() are no-ops, so // it wouldn't be worth the extra time for pre-scanning. RELEASE_ASSERT(length_ <= @@ -871,7 +871,7 @@ } while (true); } -PassRefPtr<StringImpl> StringImpl::Lower( +PassRefPtr<StringImpl> StringImpl::LowerUnicode( const AtomicString& locale_identifier) { // Use the more optimized code path most of the time. // Only Turkic (tr and az) languages and Lithuanian requires @@ -886,7 +886,7 @@ else if (LocaleIdMatchesLang(locale_identifier, "lt")) locale_for_conversion = "lt"; else - return Lower(); + return LowerUnicode(); if (length_ > static_cast<unsigned>(numeric_limits<int32_t>::max())) CRASH(); @@ -898,7 +898,7 @@ this); } -PassRefPtr<StringImpl> StringImpl::Upper( +PassRefPtr<StringImpl> StringImpl::UpperUnicode( const AtomicString& locale_identifier) { // Use the more-optimized code path most of the time. // Only Turkic (tr and az) languages, Greek and Lithuanian require @@ -912,7 +912,7 @@ else if (LocaleIdMatchesLang(locale_identifier, "lt")) locale_for_conversion = "lt"; else - return Upper(); + return UpperUnicode(); if (length_ > static_cast<unsigned>(numeric_limits<int32_t>::max())) CRASH(); @@ -1286,7 +1286,9 @@ 0x00fc, 0x00fd, 0x00fe, 0x00ff, }; -bool EqualIgnoringCase(const LChar* a, const LChar* b, unsigned length) { +bool DeprecatedEqualIgnoringCase(const LChar* a, + const LChar* b, + unsigned length) { DCHECK_GE(length, 0u); if (a == b) return true; @@ -1298,14 +1300,18 @@ return true; } -bool EqualIgnoringCase(const UChar* a, const UChar* b, unsigned length) { +bool DeprecatedEqualIgnoringCase(const UChar* a, + const UChar* b, + unsigned length) { DCHECK_GE(length, 0u); if (a == b) return true; return !Unicode::Umemcasecmp(a, b, length); } -bool EqualIgnoringCase(const UChar* a, const LChar* b, unsigned length) { +bool DeprecatedEqualIgnoringCase(const UChar* a, + const LChar* b, + unsigned length) { while (length--) { if (FoldCase(*a++) != StringImpl::kLatin1CaseFoldTable[*b++]) return false; @@ -1405,8 +1411,8 @@ unsigned i = 0; // keep looping until we match - while (!EqualIgnoringCase(search_characters + i, match_characters, - match_length)) { + while (!DeprecatedEqualIgnoringCase(search_characters + i, match_characters, + match_length)) { if (i == delta) return kNotFound; ++i; @@ -1599,17 +1605,19 @@ if (prefix.length() > length()) return false; if (Is8Bit()) { - if (prefix.Is8Bit()) - return EqualIgnoringCase(Characters8(), prefix.Characters8(), - prefix.length()); - return EqualIgnoringCase(Characters8(), prefix.Characters16(), - prefix.length()); + if (prefix.Is8Bit()) { + return DeprecatedEqualIgnoringCase(Characters8(), prefix.Characters8(), + prefix.length()); + } + return DeprecatedEqualIgnoringCase(Characters8(), prefix.Characters16(), + prefix.length()); } - if (prefix.Is8Bit()) - return EqualIgnoringCase(Characters16(), prefix.Characters8(), - prefix.length()); - return EqualIgnoringCase(Characters16(), prefix.Characters16(), - prefix.length()); + if (prefix.Is8Bit()) { + return DeprecatedEqualIgnoringCase(Characters16(), prefix.Characters8(), + prefix.length()); + } + return DeprecatedEqualIgnoringCase(Characters16(), prefix.Characters16(), + prefix.length()); } bool StringImpl::StartsWithIgnoringASCIICase(const StringView& prefix) const { @@ -1656,17 +1664,19 @@ return false; unsigned start_offset = length() - suffix.length(); if (Is8Bit()) { - if (suffix.Is8Bit()) - return EqualIgnoringCase(Characters8() + start_offset, - suffix.Characters8(), suffix.length()); - return EqualIgnoringCase(Characters8() + start_offset, - suffix.Characters16(), suffix.length()); + if (suffix.Is8Bit()) { + return DeprecatedEqualIgnoringCase(Characters8() + start_offset, + suffix.Characters8(), suffix.length()); + } + return DeprecatedEqualIgnoringCase(Characters8() + start_offset, + suffix.Characters16(), suffix.length()); } - if (suffix.Is8Bit()) - return EqualIgnoringCase(Characters16() + start_offset, - suffix.Characters8(), suffix.length()); - return EqualIgnoringCase(Characters16() + start_offset, suffix.Characters16(), - suffix.length()); + if (suffix.Is8Bit()) { + return DeprecatedEqualIgnoringCase(Characters16() + start_offset, + suffix.Characters8(), suffix.length()); + } + return DeprecatedEqualIgnoringCase(Characters16() + start_offset, + suffix.Characters16(), suffix.length()); } bool StringImpl::EndsWithIgnoringASCIICase(const StringView& suffix) const {
diff --git a/third_party/WebKit/Source/platform/wtf/text/StringImpl.h b/third_party/WebKit/Source/platform/wtf/text/StringImpl.h index be9864e..9b0d504 100644 --- a/third_party/WebKit/Source/platform/wtf/text/StringImpl.h +++ b/third_party/WebKit/Source/platform/wtf/text/StringImpl.h
@@ -378,12 +378,12 @@ double ToDouble(bool* ok = 0); float ToFloat(bool* ok = 0); - PassRefPtr<StringImpl> Lower(); + PassRefPtr<StringImpl> LowerUnicode(); PassRefPtr<StringImpl> LowerASCII(); - PassRefPtr<StringImpl> Upper(); + PassRefPtr<StringImpl> UpperUnicode(); PassRefPtr<StringImpl> UpperASCII(); - PassRefPtr<StringImpl> Lower(const AtomicString& locale_identifier); - PassRefPtr<StringImpl> Upper(const AtomicString& locale_identifier); + PassRefPtr<StringImpl> LowerUnicode(const AtomicString& locale_identifier); + PassRefPtr<StringImpl> UpperUnicode(const AtomicString& locale_identifier); PassRefPtr<StringImpl> Fill(UChar); // FIXME: Do we need fill(char) or can we just do the right thing if UChar is @@ -599,12 +599,22 @@ // Unicode aware case insensitive string matching. Non-ASCII characters might // match to ASCII characters. These functions are rarely used to implement web // platform features. -WTF_EXPORT bool EqualIgnoringCase(const LChar*, const LChar*, unsigned length); -WTF_EXPORT bool EqualIgnoringCase(const UChar*, const LChar*, unsigned length); -inline bool EqualIgnoringCase(const LChar* a, const UChar* b, unsigned length) { - return EqualIgnoringCase(b, a, length); +// These functions are deprecated. Use EqualIgnoringASCIICase(), or introduce +// EqualIgnoringUnicodeCase(). See crbug.com/627682 +WTF_EXPORT bool DeprecatedEqualIgnoringCase(const LChar*, + const LChar*, + unsigned length); +WTF_EXPORT bool DeprecatedEqualIgnoringCase(const UChar*, + const LChar*, + unsigned length); +inline bool DeprecatedEqualIgnoringCase(const LChar* a, + const UChar* b, + unsigned length) { + return DeprecatedEqualIgnoringCase(b, a, length); } -WTF_EXPORT bool EqualIgnoringCase(const UChar*, const UChar*, unsigned length); +WTF_EXPORT bool DeprecatedEqualIgnoringCase(const UChar*, + const UChar*, + unsigned length); WTF_EXPORT bool EqualIgnoringNullity(StringImpl*, StringImpl*);
diff --git a/third_party/WebKit/Source/platform/wtf/text/StringImplTest.cpp b/third_party/WebKit/Source/platform/wtf/text/StringImplTest.cpp index 0879f97..bff44b29 100644 --- a/third_party/WebKit/Source/platform/wtf/text/StringImplTest.cpp +++ b/third_party/WebKit/Source/platform/wtf/text/StringImplTest.cpp
@@ -55,9 +55,9 @@ EXPECT_TRUE(Equal(test_string_impl.Get(), StringImpl::Create("lInk")->LowerASCII().Get())); - EXPECT_TRUE(Equal(StringImpl::Create("LINK")->Lower().Get(), + EXPECT_TRUE(Equal(StringImpl::Create("LINK")->LowerUnicode().Get(), StringImpl::Create("LINK")->LowerASCII().Get())); - EXPECT_TRUE(Equal(StringImpl::Create("lInk")->Lower().Get(), + EXPECT_TRUE(Equal(StringImpl::Create("lInk")->LowerUnicode().Get(), StringImpl::Create("lInk")->LowerASCII().Get())); EXPECT_TRUE(Equal(StringImpl::Create("a\xE1").Get(), @@ -112,9 +112,9 @@ EXPECT_TRUE(Equal(test_string_impl.Get(), StringImpl::Create("lInk")->UpperASCII().Get())); - EXPECT_TRUE(Equal(StringImpl::Create("LINK")->Upper().Get(), + EXPECT_TRUE(Equal(StringImpl::Create("LINK")->UpperUnicode().Get(), StringImpl::Create("LINK")->UpperASCII().Get())); - EXPECT_TRUE(Equal(StringImpl::Create("lInk")->Upper().Get(), + EXPECT_TRUE(Equal(StringImpl::Create("lInk")->UpperUnicode().Get(), StringImpl::Create("lInk")->UpperASCII().Get())); EXPECT_TRUE(Equal(StringImpl::Create("A\xE1").Get(),
diff --git a/third_party/WebKit/Source/platform/wtf/text/StringView.cpp b/third_party/WebKit/Source/platform/wtf/text/StringView.cpp index 778303a..349f396 100644 --- a/third_party/WebKit/Source/platform/wtf/text/StringView.cpp +++ b/third_party/WebKit/Source/platform/wtf/text/StringView.cpp
@@ -61,23 +61,30 @@ return Equal(a.Characters16(), b.Characters16(), a.length()); } -bool EqualIgnoringCaseAndNullity(const StringView& a, const StringView& b) { +bool DeprecatedEqualIgnoringCaseAndNullity(const StringView& a, + const StringView& b) { if (a.length() != b.length()) return false; if (a.Is8Bit()) { - if (b.Is8Bit()) - return EqualIgnoringCase(a.Characters8(), b.Characters8(), a.length()); - return EqualIgnoringCase(a.Characters8(), b.Characters16(), a.length()); + if (b.Is8Bit()) { + return DeprecatedEqualIgnoringCase(a.Characters8(), b.Characters8(), + a.length()); + } + return DeprecatedEqualIgnoringCase(a.Characters8(), b.Characters16(), + a.length()); } - if (b.Is8Bit()) - return EqualIgnoringCase(a.Characters16(), b.Characters8(), a.length()); - return EqualIgnoringCase(a.Characters16(), b.Characters16(), a.length()); + if (b.Is8Bit()) { + return DeprecatedEqualIgnoringCase(a.Characters16(), b.Characters8(), + a.length()); + } + return DeprecatedEqualIgnoringCase(a.Characters16(), b.Characters16(), + a.length()); } -bool EqualIgnoringCase(const StringView& a, const StringView& b) { +bool DeprecatedEqualIgnoringCase(const StringView& a, const StringView& b) { if (a.IsNull() || b.IsNull()) return a.IsNull() == b.IsNull(); - return EqualIgnoringCaseAndNullity(a, b); + return DeprecatedEqualIgnoringCaseAndNullity(a, b); } bool EqualIgnoringASCIICase(const StringView& a, const StringView& b) {
diff --git a/third_party/WebKit/Source/platform/wtf/text/StringView.h b/third_party/WebKit/Source/platform/wtf/text/StringView.h index 3c4d2fbc..9c4876a 100644 --- a/third_party/WebKit/Source/platform/wtf/text/StringView.h +++ b/third_party/WebKit/Source/platform/wtf/text/StringView.h
@@ -221,9 +221,12 @@ // Unicode aware case insensitive string matching. Non-ASCII characters might // match to ASCII characters. These functions are rarely used to implement web // platform features. -WTF_EXPORT bool EqualIgnoringCase(const StringView&, const StringView&); -WTF_EXPORT bool EqualIgnoringCaseAndNullity(const StringView&, +// These functions are deprecated. Use EqualIgnoringASCIICase(), or introduce +// EqualIgnoringUnicodeCase(). See crbug.com/627682 +WTF_EXPORT bool DeprecatedEqualIgnoringCase(const StringView&, const StringView&); +WTF_EXPORT bool DeprecatedEqualIgnoringCaseAndNullity(const StringView&, + const StringView&); WTF_EXPORT bool EqualIgnoringASCIICase(const StringView&, const StringView&); @@ -266,7 +269,7 @@ using WTF::StringView; using WTF::EqualIgnoringASCIICase; -using WTF::EqualIgnoringCase; +using WTF::DeprecatedEqualIgnoringCase; using WTF::IsAllSpecialCharacters; #endif
diff --git a/third_party/WebKit/Source/platform/wtf/text/WTFString.cpp b/third_party/WebKit/Source/platform/wtf/text/WTFString.cpp index c7565c0..9eb60a78 100644 --- a/third_party/WebKit/Source/platform/wtf/text/WTFString.cpp +++ b/third_party/WebKit/Source/platform/wtf/text/WTFString.cpp
@@ -273,25 +273,25 @@ String String::DeprecatedLower() const { if (!impl_) return String(); - return impl_->Lower(); + return impl_->LowerUnicode(); } String String::DeprecatedUpper() const { if (!impl_) return String(); - return impl_->Upper(); + return impl_->UpperUnicode(); } -String String::Lower(const AtomicString& locale_identifier) const { +String String::LowerUnicode(const AtomicString& locale_identifier) const { if (!impl_) return String(); - return impl_->Lower(locale_identifier); + return impl_->LowerUnicode(locale_identifier); } -String String::Upper(const AtomicString& locale_identifier) const { +String String::UpperUnicode(const AtomicString& locale_identifier) const { if (!impl_) return String(); - return impl_->Upper(locale_identifier); + return impl_->UpperUnicode(locale_identifier); } String String::UpperASCII() const {
diff --git a/third_party/WebKit/Source/platform/wtf/text/WTFString.h b/third_party/WebKit/Source/platform/wtf/text/WTFString.h index 73f0cd0..2c3efa37 100644 --- a/third_party/WebKit/Source/platform/wtf/text/WTFString.h +++ b/third_party/WebKit/Source/platform/wtf/text/WTFString.h
@@ -294,8 +294,8 @@ String DeprecatedLower() const; String DeprecatedUpper() const; - String Lower(const AtomicString& locale_identifier) const; - String Upper(const AtomicString& locale_identifier) const; + String LowerUnicode(const AtomicString& locale_identifier) const; + String UpperUnicode(const AtomicString& locale_identifier) const; // Returns a uppercase version of the string. // This function converts ASCII characters only. @@ -475,7 +475,7 @@ inline bool EqualPossiblyIgnoringCase(const String& a, const String& b, bool ignore_case) { - return ignore_case ? EqualIgnoringCase(a, b) : (a == b); + return ignore_case ? DeprecatedEqualIgnoringCase(a, b) : (a == b); } inline bool EqualIgnoringNullity(const String& a, const String& b) {
diff --git a/third_party/WebKit/Source/platform/wtf/text/WTFStringTest.cpp b/third_party/WebKit/Source/platform/wtf/text/WTFStringTest.cpp index 3c834ade..2748761 100644 --- a/third_party/WebKit/Source/platform/wtf/text/WTFStringTest.cpp +++ b/third_party/WebKit/Source/platform/wtf/text/WTFStringTest.cpp
@@ -275,7 +275,7 @@ String source = String::FromUTF8(test_data_list[i].source); for (size_t j = 0; j < test_data_list[i].locale_list_length; ++j) { const char* locale = test_data_list[i].locale_list[j]; - EXPECT_STREQ(expected, source.Upper(locale).Utf8().Data()) + EXPECT_STREQ(expected, source.UpperUnicode(locale).Utf8().Data()) << test_data_list[i].source_description << "; locale=" << locale; } } @@ -335,7 +335,7 @@ String source = String::FromUTF8(test_data_list[i].source); for (size_t j = 0; j < test_data_list[i].locale_list_length; ++j) { const char* locale = test_data_list[i].locale_list[j]; - EXPECT_STREQ(expected, source.Lower(locale).Utf8().Data()) + EXPECT_STREQ(expected, source.LowerUnicode(locale).Utf8().Data()) << test_data_list[i].source_description << "; locale=" << locale; } }
diff --git a/tools/licenses.py b/tools/licenses.py index 75d9f1ba..97600d4 100755 --- a/tools/licenses.py +++ b/tools/licenses.py
@@ -18,8 +18,10 @@ import argparse import cgi import os +import shutil import subprocess import sys +import tempfile # TODO(agrieve): Move build_utils.WriteDepFile into a non-android directory. _REPOSITORY_ROOT = os.path.dirname(os.path.dirname(__file__)) @@ -482,9 +484,22 @@ if not gn_out_dir: raise RuntimeError("--gn-out-dir is required if --gn-target is used.") - gn_deps = subprocess.check_output([_GnBinary(), "desc", gn_out_dir, - gn_target, - "deps", "--as=buildfile", "--all"]) + # Generate gn project in temp directory and use it to find dependencies. + # Current gn directory cannot be used when we run this script in a gn action + # rule, because gn doesn't allow recursive invocations due to potential side + # effects. + tmp_dir = None + try: + tmp_dir = tempfile.mkdtemp(dir = gn_out_dir) + shutil.copy(os.path.join(gn_out_dir, "args.gn"), tmp_dir) + subprocess.check_output([_GnBinary(), "gen", tmp_dir]) + gn_deps = subprocess.check_output([ + _GnBinary(), "desc", tmp_dir, gn_target, + "deps", "--as=buildfile", "--all"]) + finally: + if tmp_dir and os.path.exists(tmp_dir): + shutil.rmtree(tmp_dir) + third_party_deps = set() for build_dep in gn_deps.split(): if ("third_party" in build_dep and @@ -614,6 +629,53 @@ return True +def _ReadFile(path): + """Reads a file from disk. + Args: + path: The path of the file to read, relative to the root of the + repository. + Returns: + The contents of the file as a string. + """ + with open(os.path.join(_REPOSITORY_ROOT, path), 'rb') as f: + return f.read() + + +def GenerateLicenseFile(output_file, gn_out_dir, gn_target): + """Generate a plain-text LICENSE file which can be used when you ship a part + of Chromium code (specified by gn_target) as a stand-alone library + (e.g., //ios/web_view). + + The LICENSE file contains licenses of both Chromium and third-party + libraries which gn_target depends on. """ + + third_party_dirs = FindThirdPartyDeps(gn_out_dir, gn_target) + + # Start with Chromium's LICENSE file. + content = [_ReadFile('LICENSE')] + + # Add necessary third_party. + for directory in sorted(third_party_dirs): + metadata = ParseDir( + directory, _REPOSITORY_ROOT, require_license_file=True) + content.append('-' * 20) + content.append(directory.split('/')[-1]) + content.append('-' * 20) + license_file = metadata['License File'] + if license_file and license_file != NOT_SHIPPED: + content.append(_ReadFile(license_file)) + + content_text = '\n'.join(content) + + if output_file: + with open(output_file, 'w') as output: + output.write(content_text) + else: + print content_text + + return True + + def main(): parser = argparse.ArgumentParser() parser.add_argument('--file-template', @@ -626,7 +688,8 @@ help='GN output directory for scanning dependencies.') parser.add_argument('--gn-target', help='GN target to scan for dependencies.') - parser.add_argument('command', choices=['help', 'scan', 'credits']) + parser.add_argument('command', + choices=['help', 'scan', 'credits', 'license_file']) parser.add_argument('output_file', nargs='?') build_utils.AddDepfileOption(parser) args = parser.parse_args() @@ -639,6 +702,10 @@ args.output_file, args.target_os, args.gn_out_dir, args.gn_target, args.depfile): return 1 + elif args.command == 'license_file': + if not GenerateLicenseFile( + args.output_file, args.gn_out_dir, args.gn_target): + return 1 else: print __doc__ return 1
diff --git a/ui/views/bubble/bubble_dialog_delegate.cc b/ui/views/bubble/bubble_dialog_delegate.cc index c32f4c3..4820775 100644 --- a/ui/views/bubble/bubble_dialog_delegate.cc +++ b/ui/views/bubble/bubble_dialog_delegate.cc
@@ -216,9 +216,8 @@ adjust_if_offscreen_(true), parent_window_(NULL) { ViewsDelegate* views_delegate = ViewsDelegate::GetInstance(); - margins_ = views_delegate->GetInsetsMetric(InsetsMetric::BUBBLE_DIALOG); - title_margins_ = - views_delegate->GetInsetsMetric(InsetsMetric::DIALOG_FRAME_VIEW); + margins_ = views_delegate->GetInsetsMetric(InsetsMetric::BUBBLE_CONTENTS); + title_margins_ = views_delegate->GetInsetsMetric(InsetsMetric::DIALOG_TITLE); if (anchor_view) SetAnchorView(anchor_view); UpdateColorsFromTheme(GetNativeTheme());
diff --git a/ui/views/views_delegate.cc b/ui/views/views_delegate.cc index 8b099e7c..e1dda80 100644 --- a/ui/views/views_delegate.cc +++ b/ui/views/views_delegate.cc
@@ -128,14 +128,14 @@ gfx::Insets ViewsDelegate::GetInsetsMetric(InsetsMetric metric) const { switch (metric) { + case InsetsMetric::BUBBLE_CONTENTS: + return gfx::Insets(kPanelVertMargin, kPanelHorizMargin); case InsetsMetric::DIALOG_BUTTON: return gfx::Insets(0, kButtonHEdgeMarginNew, kButtonVEdgeMarginNew, kButtonHEdgeMarginNew); - case InsetsMetric::DIALOG_FRAME_VIEW: + case InsetsMetric::DIALOG_TITLE: return gfx::Insets(kPanelVertMargin, kButtonHEdgeMarginNew, 0, kButtonHEdgeMarginNew); - case InsetsMetric::BUBBLE_DIALOG: - return gfx::Insets(kPanelVertMargin, kPanelHorizMargin); case InsetsMetric::PANEL: return gfx::Insets(kPanelVertMargin, kButtonHEdgeMarginNew); case InsetsMetric::VECTOR_IMAGE_BUTTON_PADDING:
diff --git a/ui/views/views_delegate.h b/ui/views/views_delegate.h index 220417a2..c9d6a1fb 100644 --- a/ui/views/views_delegate.h +++ b/ui/views/views_delegate.h
@@ -63,14 +63,12 @@ } enum class InsetsMetric { - // The margins that should be applied around a bubble dialog. - BUBBLE_DIALOG, - // The insets that should be applied around a DialogClientView. Note that - // the top inset is used for the distance between the buttons and the - // DialogClientView's content view. + // The margins around the contents area of a bubble (popover)-style dialog. + BUBBLE_CONTENTS, + // The margins around the button row of a dialog. DIALOG_BUTTON, - // The insets that should be applied around a dialog's frame view. - DIALOG_FRAME_VIEW, + // The margins around the icon/title of a dialog. + DIALOG_TITLE, // The margins that should be applied around a panel GridLayout. PANEL, // Padding to add to vector image buttons to increase their click and touch
diff --git a/ui/views/window/dialog_delegate.cc b/ui/views/window/dialog_delegate.cc index 9122b10..05689655 100644 --- a/ui/views/window/dialog_delegate.cc +++ b/ui/views/window/dialog_delegate.cc
@@ -200,10 +200,9 @@ NonClientFrameView* DialogDelegate::CreateDialogFrameView( Widget* widget, const gfx::Insets& content_margins) { - BubbleFrameView* frame = - new BubbleFrameView(ViewsDelegate::GetInstance()->GetInsetsMetric( - InsetsMetric::DIALOG_FRAME_VIEW), - content_margins); + BubbleFrameView* frame = new BubbleFrameView( + ViewsDelegate::GetInstance()->GetInsetsMetric(InsetsMetric::DIALOG_TITLE), + content_margins); const BubbleBorder::Shadow kShadow = BubbleBorder::SMALL_SHADOW; std::unique_ptr<BubbleBorder> border( new BubbleBorder(BubbleBorder::FLOAT, kShadow, gfx::kPlaceholderColor));
diff --git a/ui/webui/resources/cr_elements/cr_toolbar/compiled_resources2.gyp b/ui/webui/resources/cr_elements/cr_toolbar/compiled_resources2.gyp index cbfb5f3..412222a 100644 --- a/ui/webui/resources/cr_elements/cr_toolbar/compiled_resources2.gyp +++ b/ui/webui/resources/cr_elements/cr_toolbar/compiled_resources2.gyp
@@ -11,6 +11,10 @@ 'includes': ['../../../../../third_party/closure_compiler/compile_js2.gypi'], }, { + 'target_name': 'cr_toolbar_selection_overlay', + 'includes': ['../../../../../third_party/closure_compiler/compile_js2.gypi'], + }, + { 'target_name': 'cr_toolbar', 'dependencies': [ '<(EXTERNS_GYP):web_animations',
diff --git a/ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar_selection_overlay.html b/ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar_selection_overlay.html new file mode 100644 index 0000000..1ea425b7 --- /dev/null +++ b/ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar_selection_overlay.html
@@ -0,0 +1,60 @@ +<link rel="import" href="chrome://resources/html/polymer.html"> +<link rel="import" href="chrome://resources/cr_elements/icons.html"> +<link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> +<link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html"> + +<dom-module id="cr-toolbar-selection-overlay"> + <template> + <style> + :host { + -webkit-padding-start: var(--cr-toolbar-field-margin, 0); + height: 56px; + display: flex; + } + + #overlay-content { + align-items: center; + display: flex; + flex: 1; + margin: 0 auto; + max-width: var(--selection-overlay-max-width, initial); + padding: 0 var(--selection-overlay-padding, 24px); + } + + paper-button { + font-weight: 500; + } + + #number-selected { + flex: 1; + } + + button { + -webkit-margin-end: 24px; + -webkit-margin-start: 2px; + height: 36px; + width: 36px; + } + + button iron-icon { + height: 20px; + width: 20px; + } + </style> + <div id="overlay-content"> + <button is="paper-icon-button-light" + on-tap="onClearSelectionTap_" + title="[[cancelLabel]]"> + <iron-icon icon="cr:clear"></iron-icon> + </button> + <div id="number-selected">[[selectionLabel]]</div> + <paper-button on-tap="onClearSelectionTap_"> + [[cancelLabel]] + </paper-button> + <paper-button on-tap="onDeleteTap_"> + [[deleteLabel]] + </paper-button> + </div> + </template> + <script src="cr_toolbar_selection_overlay.js"></script> +</dom-module>
diff --git a/ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar_selection_overlay.js b/ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar_selection_overlay.js new file mode 100644 index 0000000..f9f7547 --- /dev/null +++ b/ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar_selection_overlay.js
@@ -0,0 +1,31 @@ +// 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. + +/** + * @fileoverview Element which displays the number of selected items with + * Cancel/Delete buttons, designed to be used as an overlay on top of + * <cr-toolbar>. See <history-toolbar> for an example usage. + */ + +Polymer({ + is: 'cr-toolbar-selection-overlay', + + properties: { + deleteLabel: String, + + cancelLabel: String, + + selectionLabel: String, + }, + + /** @private */ + onClearSelectionTap_: function() { + this.fire('clear-selected-items'); + }, + + /** @private */ + onDeleteTap_: function() { + this.fire('delete-selected-items'); + }, +});
diff --git a/ui/webui/resources/cr_elements_resources.grdp b/ui/webui/resources/cr_elements_resources.grdp index ae098c7f..8d96278 100644 --- a/ui/webui/resources/cr_elements_resources.grdp +++ b/ui/webui/resources/cr_elements_resources.grdp
@@ -161,4 +161,10 @@ <structure name="IDR_CR_ELEMENTS_CR_TOOLBAR_SEARCH_FIELD_JS" file="../../webui/resources/cr_elements/cr_toolbar/cr_toolbar_search_field.js" type="chrome_html" /> + <structure name="IDR_CR_ELEMENTS_CR_TOOLBAR_SELECTION_OVERLAY_HTML" + file="../../webui/resources/cr_elements/cr_toolbar/cr_toolbar_selection_overlay.html" + type="chrome_html" /> + <structure name="IDR_CR_ELEMENTS_CR_TOOLBAR_SELECTION_OVERLAY_JS" + file="../../webui/resources/cr_elements/cr_toolbar/cr_toolbar_selection_overlay.js" + type="chrome_html" /> </grit-part>
diff --git a/ui/webui/resources/js/cr/ui/splitter.js b/ui/webui/resources/js/cr/ui/splitter.js index 6b659bc..b4260e1 100644 --- a/ui/webui/resources/js/cr/ui/splitter.js +++ b/ui/webui/resources/js/cr/ui/splitter.js
@@ -249,6 +249,7 @@ var targetElement = this.getResizeTarget_(); var newWidth = this.startWidth_ + this.calcDeltaX_(deltaX); targetElement.style.width = newWidth + 'px'; + cr.dispatchSimpleEvent(this, 'dragmove'); }, /**