diff --git a/.vpython b/.vpython index 15e36fc..890229f7 100644 --- a/.vpython +++ b/.vpython
@@ -117,6 +117,10 @@ version: "version:1.10.0" > wheel: < - name: "infra/python/wheels/tlslite-py2_py3" - version: "version:0.4.9" + name: "infra/python/wheels/pyftpdlib-py2_py3" + version: "version:0.7.0" +> +wheel: < + name: "infra/python/wheels/simplejson/${vpython_platform}" + version: "version:3.13.2" >
diff --git a/DEPS b/DEPS index f314726..d031f80 100644 --- a/DEPS +++ b/DEPS
@@ -83,7 +83,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. - 'v8_revision': '73c55f57fe8506011ff854b15026ca765b669700', + 'v8_revision': '7199784766ca3b3926eefc39ab7d748e954acc24', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling swarming_client # and whatever else without interference from each other. @@ -103,7 +103,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling PDFium # and whatever else without interference from each other. - 'pdfium_revision': '28cb9a764765ed3e3fc981ff6f4e9e0519033954', + 'pdfium_revision': '27d718ebb2989631d6b4d3425e1fceb4b3bc795b', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling openmax_dl # and whatever else without interference from each other. @@ -323,7 +323,7 @@ # For Linux and Chromium OS. 'src/third_party/cros_system_api': { - 'url': Var('chromium_git') + '/chromiumos/platform/system_api.git' + '@' + '15e1a468124f5a215680bb335f87a118497acb59', + 'url': Var('chromium_git') + '/chromiumos/platform/system_api.git' + '@' + '1b879ee32f68c5e41c105868f7a60e644f949f40', 'condition': 'checkout_linux', }, @@ -352,7 +352,7 @@ }, 'src/third_party/ffmpeg': - Var('chromium_git') + '/chromium/third_party/ffmpeg.git' + '@' + 'b64dedac9d1d70148a50791d127eede2e7eb93ba', + Var('chromium_git') + '/chromium/third_party/ffmpeg.git' + '@' + '3e444ad8860b5d90d40a5c6e19947aba376a976b', 'src/third_party/findbugs': { 'url': Var('chromium_git') + '/chromium/deps/findbugs.git' + '@' + '4275d9ac8610db6b1bc9a5e887f97e41b33fac67', @@ -481,7 +481,7 @@ }, 'src/third_party/libvpx/source/libvpx': - Var('chromium_git') + '/webm/libvpx.git' + '@' + 'bed28a55f593efd3a71a3a9d05cf8bb25d15fa44', + Var('chromium_git') + '/webm/libvpx.git' + '@' + '373e08f921e5bfd5a96963fabbbbe16ec793d44e', 'src/third_party/libwebm/source': Var('chromium_git') + '/webm/libwebm.git' + '@' + 'b03c65468b06d097f27235d93d76bfc45f490ede',
diff --git a/android_webview/browser/aw_browser_context.cc b/android_webview/browser/aw_browser_context.cc index 8faa2c3e..c032bcf 100644 --- a/android_webview/browser/aw_browser_context.cc +++ b/android_webview/browser/aw_browser_context.cc
@@ -233,6 +233,7 @@ base::MakeRefCounted<InMemoryPrefStore>()); pref_service_factory.set_managed_prefs( base::MakeRefCounted<policy::ConfigurationPolicyPrefStore>( + browser_policy_connector_.get(), browser_policy_connector_->GetPolicyService(), browser_policy_connector_->GetHandlerList(), policy::POLICY_LEVEL_MANDATORY));
diff --git a/android_webview/browser/aw_field_trial_creator.cc b/android_webview/browser/aw_field_trial_creator.cc index be43ef35..09c3d27 100644 --- a/android_webview/browser/aw_field_trial_creator.cc +++ b/android_webview/browser/aw_field_trial_creator.cc
@@ -11,6 +11,7 @@ #include "base/feature_list.h" #include "base/path_service.h" #include "base/strings/string_split.h" +#include "base/time/time.h" #include "cc/base/switches.h" #include "components/prefs/in_memory_pref_store.h" #include "components/prefs/pref_registry_simple.h" @@ -58,9 +59,10 @@ base::MakeRefCounted<PrefRegistrySimple>(); // Register the variations prefs with default values that must be overridden. - pref_registry->RegisterInt64Pref(variations::prefs::kVariationsSeedDate, 0); - pref_registry->RegisterInt64Pref(variations::prefs::kVariationsLastFetchTime, - 0); + pref_registry->RegisterTimePref(variations::prefs::kVariationsSeedDate, + base::Time()); + pref_registry->RegisterTimePref(variations::prefs::kVariationsLastFetchTime, + base::Time()); pref_registry->RegisterStringPref(variations::prefs::kVariationsCountry, std::string()); pref_registry->RegisterStringPref(
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java index bb2a0ca..565e8fb 100644 --- a/android_webview/java/src/org/chromium/android_webview/AwContents.java +++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -70,6 +70,7 @@ import org.chromium.content_public.browser.ChildProcessImportance; import org.chromium.content_public.browser.GestureListenerManager; import org.chromium.content_public.browser.GestureStateListener; +import org.chromium.content_public.browser.ImeAdapter; import org.chromium.content_public.browser.ImeEventObserver; import org.chromium.content_public.browser.JavaScriptCallback; import org.chromium.content_public.browser.JavascriptInjector; @@ -888,13 +889,7 @@ // Listen for dpad events from IMEs (e.g. Samsung Cursor Control) so we know to enable // spatial navigation mode to allow these events to move focus out of the WebView. - contentViewCore.addImeEventObserver(new ImeEventObserver() { - @Override - public void onImeEvent() {} - - @Override - public void onNodeAttributeUpdated(boolean editable, boolean password) {} - + ImeAdapter.fromWebContents(webContents).addEventObserver(new ImeEventObserver() { @Override public void onBeforeSendKeyEvent(KeyEvent event) { if (AwContents.isDpadEvent(event)) { @@ -3313,8 +3308,9 @@ @Override public InputConnection onCreateInputConnection(EditorInfo outAttrs) { - return isDestroyedOrNoOperation(NO_WARN) ? null - : mContentViewCore.onCreateInputConnection(outAttrs); + return isDestroyedOrNoOperation(NO_WARN) + ? null + : ImeAdapter.fromWebContents(mWebContents).onCreateInputConnection(outAttrs); } @Override
diff --git a/android_webview/javatests/DEPS b/android_webview/javatests/DEPS index 4630fc0..cbb105a 100644 --- a/android_webview/javatests/DEPS +++ b/android_webview/javatests/DEPS
@@ -13,7 +13,6 @@ "!content/public/android/java/src/org/chromium/content/browser/ContentVideoView.java", "!content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java", "!content/public/android/java/src/org/chromium/content/browser/ContentViewStatics.java", - "!content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java", "!content/public/android/java/src/org/chromium/content/common/ContentSwitches.java", "-content/public/android/javatests",
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientOnUnhandledKeyEventTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientOnUnhandledKeyEventTest.java index c0d45cf..fad61107 100644 --- a/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientOnUnhandledKeyEventTest.java +++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientOnUnhandledKeyEventTest.java
@@ -19,7 +19,7 @@ import org.chromium.base.test.util.DisabledTest; import org.chromium.base.test.util.Feature; import org.chromium.base.test.util.MinAndroidSdkLevel; -import org.chromium.content.browser.input.ImeAdapter; +import org.chromium.content_public.browser.ImeAdapter; import java.util.ArrayList; import java.util.Arrays; @@ -160,4 +160,3 @@ mHelper.clearUnhandledKeyEventList(); } } -
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsGarbageCollectionTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsGarbageCollectionTest.java index 8a7af08..8cab0a6 100644 --- a/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsGarbageCollectionTest.java +++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsGarbageCollectionTest.java
@@ -29,6 +29,7 @@ import org.chromium.base.test.util.Feature; import org.chromium.content.browser.test.util.Criteria; import org.chromium.content.browser.test.util.CriteriaHelper; +import org.chromium.content_public.browser.ImeAdapter; import org.chromium.content_public.common.ContentUrlConstants; /** @@ -142,8 +143,8 @@ // Instead, we simply emulate Android's behavior by keeping strong references. // See crbug.com/595613 for details. resultReceivers[i] = ThreadUtils.runOnUiThreadBlocking( - () -> containerView.getContentViewCore() - .getImeAdapterForTest() + () + -> ImeAdapter.fromWebContents(containerView.getWebContents()) .getNewShowKeyboardReceiver()); }
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwImeTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwImeTest.java index 600e71a..2eb5d6e1 100644 --- a/android_webview/javatests/src/org/chromium/android_webview/test/AwImeTest.java +++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwImeTest.java
@@ -24,6 +24,7 @@ import org.chromium.content.browser.test.util.Criteria; import org.chromium.content.browser.test.util.CriteriaHelper; import org.chromium.content.browser.test.util.TestInputMethodManagerWrapper; +import org.chromium.content_public.browser.ImeAdapter; /** * Tests for IME (input method editor) on Android WebView. @@ -65,10 +66,9 @@ mTestContainerView.getAwContents().addJavascriptInterface( mTestJavascriptInterface, "test"); // Let's not test against real input method. - mInputMethodManagerWrapper = new TestInputMethodManagerWrapper( - mTestContainerView.getContentViewCore()); - mTestContainerView.getContentViewCore().getImeAdapterForTest() - .setInputMethodManagerWrapperForTest(mInputMethodManagerWrapper); + ImeAdapter imeAdapter = ImeAdapter.fromWebContents(mTestContainerView.getWebContents()); + imeAdapter.setInputMethodManagerWrapperForTest( + TestInputMethodManagerWrapper.create(imeAdapter)); }); } @@ -114,8 +114,7 @@ } private InputConnection getInputConnection() { - return mTestContainerView.getContentViewCore() - .getImeAdapterForTest() + return ImeAdapter.fromWebContents(mTestContainerView.getWebContents()) .getInputConnectionForTest(); }
diff --git a/ash/frame/custom_frame_view_ash.cc b/ash/frame/custom_frame_view_ash.cc index 368a1b7..dd09771 100644 --- a/ash/frame/custom_frame_view_ash.cc +++ b/ash/frame/custom_frame_view_ash.cc
@@ -402,6 +402,8 @@ void CustomFrameViewAsh::ActivationChanged(bool active) { // The icons differ between active and inactive. header_view_->SchedulePaint(); + + frame_->non_client_view()->Layout(); } ////////////////////////////////////////////////////////////////////////////////
diff --git a/ash/frame/custom_frame_view_ash_unittest.cc b/ash/frame/custom_frame_view_ash_unittest.cc index d3009f3..c6e6db28 100644 --- a/ash/frame/custom_frame_view_ash_unittest.cc +++ b/ash/frame/custom_frame_view_ash_unittest.cc
@@ -263,7 +263,7 @@ // Verify that when in tablet mode with a non maximized window, the height of // the header is non zero. TEST_F(CustomFrameViewAshTest, FrameShownInTabletModeForNonMaximizedWindows) { - CustomFrameTestWidgetDelegate* delegate = new CustomFrameTestWidgetDelegate; + auto* delegate = new CustomFrameTestWidgetDelegate(); std::unique_ptr<views::Widget> widget(CreateWidget(delegate)); Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true); @@ -288,12 +288,8 @@ } TEST_F(CustomFrameViewAshTest, OpeningAppsInTabletMode) { - CustomFrameTestWidgetDelegate* delegate = new CustomFrameTestWidgetDelegate; - views::Widget* widget = new views::Widget(); - views::Widget::InitParams params; - params.context = CurrentContext(); - params.delegate = delegate; - widget->Init(params); + auto* delegate = new CustomFrameTestWidgetDelegate(); + std::unique_ptr<views::Widget> widget(CreateWidget(delegate)); widget->Show(); widget->Maximize(); @@ -320,13 +316,26 @@ delegate->GetCustomFrameViewTopBorderHeight()); } +// Verify windows that are minimized and then entered into tablet mode will have +// no header when unminimized in tablet mode. +TEST_F(CustomFrameViewAshTest, MinimizedWindowsInTabletMode) { + std::unique_ptr<views::Widget> widget( + CreateWidget(new CustomFrameTestWidgetDelegate)); + widget->GetNativeWindow()->SetProperty(aura::client::kResizeBehaviorKey, + ui::mojom::kResizeBehaviorCanMaximize); + widget->Show(); + widget->Maximize(); + widget->Minimize(); + Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true); + + widget->Show(); + EXPECT_EQ(widget->non_client_view()->bounds(), + widget->client_view()->bounds()); +} + TEST_F(CustomFrameViewAshTest, HeaderVisibilityInOverviewMode) { auto* delegate = new CustomFrameTestWidgetDelegate(); - auto* widget = new views::Widget(); - views::Widget::InitParams params; - params.context = CurrentContext(); - params.delegate = delegate; - widget->Init(params); + std::unique_ptr<views::Widget> widget(CreateWidget(delegate)); widget->Show(); // Verify the header is not painted in overview mode and painted when not in @@ -339,26 +348,21 @@ } TEST_F(CustomFrameViewAshTest, HeaderVisibilityInSplitview) { - auto set_up_widget = [this](CustomFrameTestWidgetDelegate* delegate, - views::Widget* widget) { - views::Widget::InitParams params; - params.context = CurrentContext(); - params.delegate = delegate; - widget->Init(params); + auto create_widget = [this](CustomFrameTestWidgetDelegate* delegate) { + std::unique_ptr<views::Widget> widget(CreateWidget(delegate)); widget->Show(); // Windows need to be resizable and maximizable to be used in splitview. widget->GetNativeWindow()->SetProperty( aura::client::kResizeBehaviorKey, ui::mojom::kResizeBehaviorCanMaximize | ui::mojom::kResizeBehaviorCanResize); + return widget; }; auto* delegate1 = new CustomFrameTestWidgetDelegate(); - auto* widget1 = new views::Widget(); + auto widget1 = create_widget(delegate1); auto* delegate2 = new CustomFrameTestWidgetDelegate(); - auto* widget2 = new views::Widget(); - set_up_widget(delegate1, widget1); - set_up_widget(delegate2, widget2); + auto widget2 = create_widget(delegate2); // Verify that when one window is snapped, the header is drawn for the snapped // window, but not drawn for the window still in overview. @@ -415,12 +419,8 @@ ash::AcceleratorController* controller = ash::Shell::Get()->accelerator_controller(); - CustomFrameTestWidgetDelegate* delegate = new CustomFrameTestWidgetDelegate; - views::Widget* widget = new views::Widget(); - views::Widget::InitParams params; - params.context = CurrentContext(); - params.delegate = delegate; - widget->Init(params); + auto* delegate = new CustomFrameTestWidgetDelegate(); + std::unique_ptr<views::Widget> widget(CreateWidget(delegate)); widget->Show(); ui::Accelerator accelerator_back_press(ui::VKEY_BROWSER_BACK, ui::EF_NONE); @@ -455,7 +455,8 @@ // Back button is now enabled, so clicking on it should generate // back key sequence. - generator.MoveMouseTo(header_view->GetBoundsInScreen().CenterPoint()); + generator.MoveMouseTo( + header_view->back_button()->GetBoundsInScreen().CenterPoint()); generator.ClickLeftButton(); EXPECT_EQ(1u, target_back_press.count()); EXPECT_EQ(1u, target_back_release.count());
diff --git a/ash/public/cpp/shelf_item.h b/ash/public/cpp/shelf_item.h index 49e312c..ac238bd 100644 --- a/ash/public/cpp/shelf_item.h +++ b/ash/public/cpp/shelf_item.h
@@ -38,6 +38,9 @@ // Whether the item is pinned by a policy preference (ie. user cannot un-pin). bool pinned_by_policy = false; + + // Whether the item has a notification. + bool has_notification = false; }; typedef std::vector<ShelfItem> ShelfItems;
diff --git a/ash/public/cpp/shelf_model.cc b/ash/public/cpp/shelf_model.cc index cf84071..f2cd139 100644 --- a/ash/public/cpp/shelf_model.cc +++ b/ash/public/cpp/shelf_model.cc
@@ -129,6 +129,8 @@ DCHECK_EQ(ItemIndexByID(item.id), -1) << " The id is not unique: " << item.id; index = ValidateInsertionIndex(item.type, index); items_.insert(items_.begin() + index, item); + items_[index].has_notification = + app_id_to_notification_id_.count(item.id.app_id) > 0; for (auto& observer : observers_) observer.ShelfItemAdded(index); return index; @@ -185,6 +187,53 @@ } } +void ShelfModel::RemoveNotificationRecord(const std::string& notification_id) { + auto notification_id_it = notification_id_to_app_id_.find(notification_id); + + // Two maps are required here because when this notification has been + // delivered, the MessageCenter has already deleted the notification, so we + // can't fetch the corresponding App Id. + // If we have a record of this notification, erase it from both maps. + if (notification_id_it == notification_id_to_app_id_.end()) + return; + + // Save the AppId so the app can be updated. + const std::string app_id = notification_id_it->second; + + auto app_id_it = app_id_to_notification_id_.find(app_id); + + // Remove the notification_id. + app_id_it->second.erase(notification_id); + + // If the set is empty erase the pair. + if (app_id_it->second.empty()) + app_id_to_notification_id_.erase(app_id_it); + + // Erase the pair in the NotificationId -> AppId map. + notification_id_to_app_id_.erase(notification_id_it); + + UpdateItemNotificationsAndNotifyObservers(app_id); +} + +void ShelfModel::AddNotificationRecord(const std::string& app_id, + const std::string& notification_id) { + auto it = app_id_to_notification_id_.find(app_id); + if (it != app_id_to_notification_id_.end()) { + // The app_id exists in the map, modify the set. + it->second.insert(notification_id); + } else { + // The app_id hasn't been recorded yet, create a set. + app_id_to_notification_id_.insert( + std::pair<std::string, std::set<std::string>>(app_id, + {notification_id})); + } + + notification_id_to_app_id_.insert( + std::pair<std::string, std::string>(notification_id, app_id)); + + UpdateItemNotificationsAndNotifyObservers(app_id); +} + int ShelfModel::ItemIndexByID(const ShelfID& shelf_id) const { ShelfItems::const_iterator i = ItemByID(shelf_id); return i == items_.end() ? -1 : static_cast<int>(i - items_.begin()); @@ -206,6 +255,14 @@ return items_.end(); } +int ShelfModel::ItemIndexByAppID(const std::string& app_id) const { + for (size_t i = 0; i < items_.size(); ++i) { + if (!app_id.compare(items_[i].id.app_id)) + return i; + } + return -1; +} + int ShelfModel::FirstRunningAppIndex() const { ShelfItem weight_dummy; weight_dummy.type = TYPE_APP; @@ -275,4 +332,21 @@ return index; } +void ShelfModel::UpdateItemNotificationsAndNotifyObservers( + const std::string& app_id) { + int index = ItemIndexByAppID(app_id); + // If the item is not pinned or active on the shelf. + if (index == -1) + return; + + const bool has_notification = app_id_to_notification_id_.count(app_id) > 0; + if (items_[index].has_notification == has_notification) + return; + + items_[index].has_notification = has_notification; + + for (auto& observer : observers_) + observer.ShelfItemChanged(index, items_[index]); +} + } // namespace ash
diff --git a/ash/public/cpp/shelf_model.h b/ash/public/cpp/shelf_model.h index df86bb4..1f098a5 100644 --- a/ash/public/cpp/shelf_model.h +++ b/ash/public/cpp/shelf_model.h
@@ -63,6 +63,14 @@ // Resets the item at the specified index. The item's id should not change. void Set(int index, const ShelfItem& item); + // Adds a record of the notification with this app id and notifies observers. + void AddNotificationRecord(const std::string& app_id, + const std::string& notification_id); + + // Removes the record of the notification with matching ID and notifies + // observers. + void RemoveNotificationRecord(const std::string& notification_id); + // Returns the index of the item with id |shelf_id|, or -1 if none exists. int ItemIndexByID(const ShelfID& shelf_id) const; @@ -83,6 +91,10 @@ // items().end() if there is no item with the specified id. ShelfItems::const_iterator ItemByID(const ShelfID& shelf_id) const; + // Returns the index of the matching ShelfItem or -1 if the |app_id| doesn't + // match a ShelfItem. + int ItemIndexByAppID(const std::string& app_id) const; + const ShelfItems& items() const { return items_; } int item_count() const { return static_cast<int>(items_.size()); } @@ -102,7 +114,17 @@ // returns the new value. int ValidateInsertionIndex(ShelfItemType type, int index) const; + // Finds the app corresponding to |app_id|, sets ShelfItem.has_notification, + // and notifies observers. + void UpdateItemNotificationsAndNotifyObservers(const std::string& app_id); + ShelfItems items_; + + // Maps one app id to a set of all matching notification ids. + std::map<std::string, std::set<std::string>> app_id_to_notification_id_; + // Maps one notification id to one app id. + std::map<std::string, std::string> notification_id_to_app_id_; + base::ObserverList<ShelfModelObserver> observers_; std::map<ShelfID, std::unique_ptr<ShelfItemDelegate>>
diff --git a/ash/public/cpp/shelf_model_unittest.cc b/ash/public/cpp/shelf_model_unittest.cc index c69e26b..7eda9ce 100644 --- a/ash/public/cpp/shelf_model_unittest.cc +++ b/ash/public/cpp/shelf_model_unittest.cc
@@ -432,4 +432,114 @@ EXPECT_EQ(item.id, model_->items()[index].id); } +// Tests that apps are updated properly when notifications are added or removed. +TEST_F(ShelfModelTest, AddRemoveNotification) { + const std::string app_id("app_id"); + const std::string notification_id("notification_id"); + + // Add an example running app. + ShelfItem item; + item.type = TYPE_APP; + item.status = STATUS_RUNNING; + item.id = ShelfID(app_id); + const int index = model_->Add(item); + + EXPECT_FALSE(model_->items()[index].has_notification); + + // Add a notification for the app. + model_->AddNotificationRecord(app_id, notification_id); + + EXPECT_TRUE(model_->items()[index].has_notification); + + // Remove the notification. + model_->RemoveNotificationRecord(notification_id); + + EXPECT_FALSE(model_->items()[index].has_notification); +} + +// Tests that apps pick up their notifications when they are added. +TEST_F(ShelfModelTest, AddAppAfterNotification) { + const std::string app_id("app_id"); + const std::string notification_id("notification_id"); + + ShelfItem item; + item.type = TYPE_APP; + item.status = STATUS_RUNNING; + item.id = ShelfID(app_id); + + // Add a notification for the app. + model_->AddNotificationRecord(app_id, notification_id); + + // Add an app with a matching app id. + const int index = model_->Add(item); + + EXPECT_TRUE(model_->items()[index].has_notification); + + // Remove and re-add the app. + model_->RemoveItemAt(index); + EXPECT_EQ(index, model_->Add(item)); + + // Test that the notification persists. + EXPECT_TRUE(model_->items()[index].has_notification); +} + +// Tests that pinned apps pick up their notifications if they were recieved +// before the app existed on the shelf. +TEST_F(ShelfModelTest, PinAppAfterNotification) { + const std::string app_id("app_id"); + const std::string notification_id("notification_id"); + + // Add an example app, but don't pin it. + ShelfItem item; + item.type = TYPE_APP; + item.status = STATUS_RUNNING; + item.id = ShelfID(app_id); + + // Add a notification for the app. + model_->AddNotificationRecord(app_id, notification_id); + + // Pin the app after the notification posts. + model_->PinAppWithID(app_id); + + const int index = model_->ItemIndexByAppID(app_id); + EXPECT_TRUE(model_->items()[index].has_notification); + + // Un-pin and re-pin the app. + model_->UnpinAppWithID(app_id); + model_->PinAppWithID(app_id); + EXPECT_EQ(index, model_->ItemIndexByAppID(app_id)); + + // Test that the notification persists. + EXPECT_TRUE(model_->items()[index].has_notification); +} + +// Tests that the ShelfItem.has_notification is set to false only when there are +// 0 notifications. +TEST_F(ShelfModelTest, MultipleNotificationsPerAppBasic) { + const std::string app_id("app_id"); + const std::string notification_id_0("notification_id_0"); + // Add an example app. + ShelfItem item; + item.type = TYPE_APP; + item.status = STATUS_RUNNING; + item.id = ShelfID(app_id); + const int index = model_->Add(item); + EXPECT_EQ(index, model_->ItemIndexByAppID(app_id)); + + // Add the first notification for this app. + model_->AddNotificationRecord(app_id, notification_id_0); + // Add the second notification on the same app. + const std::string notification_id_1("notification_id_1"); + model_->AddNotificationRecord(app_id, notification_id_1); + EXPECT_TRUE(model_->items()[index].has_notification); + + // Remove one notification. + model_->RemoveNotificationRecord(notification_id_1); + EXPECT_TRUE(model_->items()[index].has_notification); + + // Remove the last notification. + model_->RemoveNotificationRecord(notification_id_0); + EXPECT_FALSE(model_->items()[index].has_notification); +} + } // namespace ash
diff --git a/ash/shelf/shelf_button.cc b/ash/shelf/shelf_button.cc index 2dd33f7..3293adbc 100644 --- a/ash/shelf/shelf_button.cc +++ b/ash/shelf/shelf_button.cc
@@ -17,6 +17,7 @@ #include "base/time/time.h" #include "skia/ext/image_operations.h" #include "ui/accessibility/ax_node_data.h" +#include "ui/app_list/app_list_features.h" #include "ui/compositor/layer.h" #include "ui/compositor/scoped_layer_animation_settings.h" #include "ui/gfx/animation/animation_delegate.h" @@ -35,10 +36,13 @@ namespace { constexpr int kIconSize = 32; -constexpr int kAttentionThrobDurationMS = 800; -constexpr int kMaxAnimationSeconds = 10; -constexpr int kIndicatorOffsetFromBottom = 3; -constexpr int kIndicatorRadiusDip = 2; +constexpr int kStatusIndicatorAttentionThrobDurationMS = 800; +constexpr int kStatusIndicatorMaxAnimationSeconds = 10; +constexpr int kStatusIndicatorOffsetFromBottom = 3; +constexpr int kStatusIndicatorRadiusDip = 2; +constexpr int kNotificationIndicatorRadiusDip = 7; +constexpr int kNotificationIndicatorOffset = 12; +constexpr SkColor kIndicatorBorderColor = SkColorSetA(SK_ColorBLACK, 0x4D); constexpr SkColor kIndicatorColor = SK_ColorWHITE; // Shelf item ripple constants. @@ -97,7 +101,7 @@ private: ShelfButtonAnimation() : animation_(this) { - animation_.SetThrobDuration(kAttentionThrobDurationMS); + animation_.SetThrobDuration(kStatusIndicatorAttentionThrobDurationMS); animation_.SetTweenType(gfx::Tween::SMOOTH_IN_OUT); } @@ -152,14 +156,15 @@ void OnPaint(gfx::Canvas* canvas) override { gfx::ScopedCanvas scoped(canvas); if (show_attention_) { - SkAlpha alpha = ShelfButtonAnimation::GetInstance()->HasObserver(this) - ? ShelfButtonAnimation::GetInstance()->GetAlpha() - : SK_AlphaOPAQUE; + const SkAlpha alpha = + ShelfButtonAnimation::GetInstance()->HasObserver(this) + ? ShelfButtonAnimation::GetInstance()->GetAlpha() + : SK_AlphaOPAQUE; canvas->SaveLayerAlpha(alpha); } DCHECK_EQ(width(), height()); - DCHECK_EQ(kIndicatorRadiusDip, width() / 2); + DCHECK_EQ(kStatusIndicatorRadiusDip, width() / 2); const float dsf = canvas->UndoDeviceScaleFactor(); const int kStrokeWidthPx = 1; gfx::PointF center = gfx::RectF(GetLocalBounds()).CenterPoint(); @@ -169,14 +174,14 @@ cc::PaintFlags flags; flags.setColor(kIndicatorColor); flags.setAntiAlias(true); - canvas->DrawCircle(center, dsf * kIndicatorRadiusDip - kStrokeWidthPx, + canvas->DrawCircle(center, dsf * kStatusIndicatorRadiusDip - kStrokeWidthPx, flags); // Stroke the border. - flags.setColor(SkColorSetA(SK_ColorBLACK, 0x4D)); + flags.setColor(kIndicatorBorderColor); flags.setStyle(cc::PaintFlags::kStroke_Style); canvas->DrawCircle( - center, dsf * kIndicatorRadiusDip - kStrokeWidthPx / 2.0f, flags); + center, dsf * kStatusIndicatorRadiusDip - kStrokeWidthPx / 2.0f, flags); } // ShelfButtonAnimation::Observer @@ -191,8 +196,9 @@ show_attention_ = show; if (show_attention_) { - animation_end_time_ = base::TimeTicks::Now() + - base::TimeDelta::FromSeconds(kMaxAnimationSeconds); + animation_end_time_ = + base::TimeTicks::Now() + + base::TimeDelta::FromSeconds(kStatusIndicatorMaxAnimationSeconds); ShelfButtonAnimation::GetInstance()->AddObserver(this); } else { ShelfButtonAnimation::GetInstance()->RemoveObserver(this); @@ -224,7 +230,9 @@ icon_view_(new views::ImageView()), indicator_(new AppStatusIndicatorView()), state_(STATE_NORMAL), - destroyed_flag_(nullptr) { + destroyed_flag_(nullptr), + is_touchable_app_context_menu_enabled_( + app_list::features::IsTouchableAppContextMenuEnabled()) { SetFocusBehavior(FocusBehavior::ACCESSIBLE_ONLY); SetInkDropMode(InkDropMode::ON); set_ink_drop_base_color(kShelfInkDropBaseColor); @@ -298,6 +306,9 @@ if (state & STATE_ATTENTION) indicator_->ShowAttention(true); + if (is_touchable_app_context_menu_enabled_ && (state & STATE_NOTIFICATION)) + SchedulePaint(); + if (state & STATE_DRAGGING) ScaleAppIcon(true); } @@ -310,6 +321,9 @@ if (state & STATE_ATTENTION) indicator_->ShowAttention(false); + if (is_touchable_app_context_menu_enabled_ && (state & STATE_NOTIFICATION)) + SchedulePaint(); + if (state & STATE_DRAGGING) ScaleAppIcon(false); } @@ -447,21 +461,23 @@ switch (shelf->alignment()) { case SHELF_ALIGNMENT_BOTTOM: case SHELF_ALIGNMENT_BOTTOM_LOCKED: - indicator_midpoint.set_y(button_bounds.bottom() - kIndicatorRadiusDip - - kIndicatorOffsetFromBottom); + indicator_midpoint.set_y(button_bounds.bottom() - + kStatusIndicatorRadiusDip - + kStatusIndicatorOffsetFromBottom); break; case SHELF_ALIGNMENT_LEFT: - indicator_midpoint.set_x(button_bounds.x() + kIndicatorRadiusDip + - kIndicatorOffsetFromBottom); + indicator_midpoint.set_x(button_bounds.x() + kStatusIndicatorRadiusDip + + kStatusIndicatorOffsetFromBottom); break; case SHELF_ALIGNMENT_RIGHT: - indicator_midpoint.set_x(button_bounds.right() - kIndicatorRadiusDip - - kIndicatorOffsetFromBottom); + indicator_midpoint.set_x(button_bounds.right() - + kStatusIndicatorRadiusDip - + kStatusIndicatorOffsetFromBottom); break; } gfx::Rect indicator_bounds(indicator_midpoint, gfx::Size()); - indicator_bounds.Inset(gfx::Insets(-kIndicatorRadiusDip)); + indicator_bounds.Inset(gfx::Insets(-kStatusIndicatorRadiusDip)); indicator_->SetBoundsRect(indicator_bounds); UpdateState(); @@ -548,6 +564,41 @@ listener_->ButtonPressed(this, event, GetInkDrop()); } +void ShelfButton::PaintButtonContents(gfx::Canvas* canvas) { + // TODO(newcomer): Implement the notification indicator as a view because + // PaintButtonContents always paints behind the icon + // (https://crbug.com/803629). + if (!is_touchable_app_context_menu_enabled_) + return; + + if (~state_ & STATE_NOTIFICATION) + return; + + gfx::ScopedCanvas scoped(canvas); + + canvas->SaveLayerAlpha(SK_AlphaOPAQUE); + + const float dsf = canvas->UndoDeviceScaleFactor(); + const int kStrokeWidthPx = 1; + gfx::PointF center = gfx::RectF(GetLocalBounds()).top_right(); + center.Offset(-kNotificationIndicatorOffset, kNotificationIndicatorOffset); + center.Scale(dsf); + + // Fill the center. + cc::PaintFlags flags; + flags.setColor(kIndicatorColor); + flags.setAntiAlias(true); + canvas->DrawCircle( + center, dsf * kNotificationIndicatorRadiusDip - kStrokeWidthPx, flags); + + // Stroke the border. + flags.setColor(kIndicatorBorderColor); + flags.setStyle(cc::PaintFlags::kStroke_Style); + canvas->DrawCircle( + center, dsf * kNotificationIndicatorRadiusDip - kStrokeWidthPx / 2.0f, + flags); +} + void ShelfButton::UpdateState() { indicator_->SetVisible(!(state_ & STATE_HIDDEN) && (state_ & STATE_ATTENTION || state_ & STATE_RUNNING));
diff --git a/ash/shelf/shelf_button.h b/ash/shelf/shelf_button.h index 6701c79a..c3c052c 100644 --- a/ash/shelf/shelf_button.h +++ b/ash/shelf/shelf_button.h
@@ -39,6 +39,8 @@ STATE_HIDDEN = 1 << 3, // Button is being dragged. STATE_DRAGGING = 1 << 4, + // App has at least 1 notification. + STATE_NOTIFICATION = 1 << 5, }; ShelfButton(InkDropButtonListener* listener, ShelfView* shelf_view); @@ -88,6 +90,7 @@ bool ShouldEnterPushedState(const ui::Event& event) override; std::unique_ptr<views::InkDrop> CreateInkDrop() override; void NotifyClick(const ui::Event& event) override; + void PaintButtonContents(gfx::Canvas* canvas) override; // Sets the icon image with a shadow. void SetShadowedImage(const gfx::ImageSkia& bitmap); @@ -127,6 +130,9 @@ // showing and used to detect if the menu was deleted while running. bool* destroyed_flag_; + // Whether the touchable context menu is enabled. + const bool is_touchable_app_context_menu_enabled_; + // A timer to defer showing drag UI when the shelf button is pressed. base::OneShotTimer drag_timer_;
diff --git a/ash/shelf/shelf_controller.cc b/ash/shelf/shelf_controller.cc index d08afcc..55c8c327 100644 --- a/ash/shelf/shelf_controller.cc +++ b/ash/shelf/shelf_controller.cc
@@ -25,10 +25,12 @@ #include "components/prefs/pref_change_registrar.h" #include "components/prefs/pref_registry_simple.h" #include "components/prefs/pref_service.h" +#include "ui/app_list/app_list_features.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/models/simple_menu_model.h" #include "ui/display/display.h" #include "ui/display/screen.h" +#include "ui/message_center/message_center.h" namespace ash { @@ -97,7 +99,10 @@ } // namespace -ShelfController::ShelfController() { +ShelfController::ShelfController() + : is_touchable_app_context_menu_enabled_( + app_list::features::IsTouchableAppContextMenuEnabled()), + message_center_observer_(this) { // Synchronization is required in the Mash config, since Chrome and Ash run in // separate processes; it's optional via kAshDisableShelfModelSynchronization // in the Classic Ash config, where Chrome can uses Ash's ShelfModel directly. @@ -126,6 +131,8 @@ Shell::Get()->session_controller()->AddObserver(this); Shell::Get()->tablet_mode_controller()->AddObserver(this); Shell::Get()->window_tree_host_manager()->AddObserver(this); + if (is_touchable_app_context_menu_enabled_) + message_center_observer_.Add(message_center::MessageCenter::Get()); } ShelfController::~ShelfController() { @@ -376,4 +383,28 @@ SetShelfBehaviorsFromPrefs(); } +void ShelfController::OnNotificationAdded(const std::string& notification_id) { + if (!is_touchable_app_context_menu_enabled_) + return; + + message_center::Notification* notification = + message_center::MessageCenter::Get()->FindVisibleNotificationById( + notification_id); + // If the notification is for an ARC app, return early. + // TODO(newcomer): Support ARC app notifications. + if (notification->notifier_id().type != + message_center::NotifierId::APPLICATION) + return; + + model_.AddNotificationRecord(notification->notifier_id().id, notification_id); +} + +void ShelfController::OnNotificationRemoved(const std::string& notification_id, + bool by_user) { + if (!is_touchable_app_context_menu_enabled_) + return; + + model_.RemoveNotificationRecord(notification_id); +} + } // namespace ash
diff --git a/ash/shelf/shelf_controller.h b/ash/shelf/shelf_controller.h index 374275c3..43f9800 100644 --- a/ash/shelf/shelf_controller.h +++ b/ash/shelf/shelf_controller.h
@@ -14,17 +14,24 @@ #include "ash/public/interfaces/shelf.mojom.h" #include "ash/session/session_observer.h" #include "ash/wm/tablet_mode/tablet_mode_observer.h" +#include "base/scoped_observer.h" #include "mojo/public/cpp/bindings/binding_set.h" #include "mojo/public/cpp/bindings/interface_ptr_set.h" +#include "ui/message_center/message_center_observer.h" class PrefChangeRegistrar; class PrefRegistrySimple; +namespace message_center { +class MessageCenter; +} + namespace ash { // Ash's ShelfController owns the ShelfModel and implements interface functions // that allow Chrome to modify and observe the Shelf and ShelfModel state. -class ASH_EXPORT ShelfController : public mojom::ShelfController, +class ASH_EXPORT ShelfController : public message_center::MessageCenterObserver, + public mojom::ShelfController, public ShelfModelObserver, public SessionObserver, public TabletModeObserver, @@ -62,6 +69,11 @@ ShelfItemDelegate* old_delegate, ShelfItemDelegate* delegate) override; + // MessageCenterObserver: + void OnNotificationAdded(const std::string& notification_id) override; + void OnNotificationRemoved(const std::string& notification_id, + bool by_user) override; + void FlushForTesting(); private: @@ -93,6 +105,14 @@ // Changes to the local ShelfModel should not be reported during this time. bool applying_remote_shelf_model_changes_ = false; + // Whether touchable context menus have been enabled for app icons on the + // shelf. + const bool is_touchable_app_context_menu_enabled_; + + ScopedObserver<message_center::MessageCenter, + message_center::MessageCenterObserver> + message_center_observer_; + // The set of shelf observers notified about state and model changes. mojo::AssociatedInterfacePtrSet<mojom::ShelfObserver> observers_;
diff --git a/ash/shelf/shelf_controller_unittest.cc b/ash/shelf/shelf_controller_unittest.cc index c1bd993..a647b752 100644 --- a/ash/shelf/shelf_controller_unittest.cc +++ b/ash/shelf/shelf_controller_unittest.cc
@@ -22,9 +22,15 @@ #include "ash/test_shell_delegate.h" #include "ash/wm/tablet_mode/tablet_mode_controller.h" #include "base/run_loop.h" +#include "base/strings/utf_string_conversions.h" +#include "base/test/scoped_feature_list.h" #include "components/prefs/pref_service.h" #include "mojo/public/cpp/bindings/associated_binding.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "ui/app_list/app_list_features.h" #include "ui/gfx/image/image_unittest_util.h" +#include "ui/message_center/message_center.h" +#include "ui/message_center/notifier_id.h" namespace ash { namespace { @@ -33,6 +39,21 @@ return Shell::GetRootWindowControllerWithDisplayId(display_id)->shelf(); } +void BuildAndSendNotification(message_center::MessageCenter* message_center, + const std::string& app_id, + const std::string& notification_id) { + const message_center::NotifierId notifier_id( + message_center::NotifierId::APPLICATION, app_id); + std::unique_ptr<message_center::Notification> notification = + std::make_unique<message_center::Notification>( + message_center::NOTIFICATION_TYPE_SIMPLE, notification_id, + base::ASCIIToUTF16("Test Web Notification"), + base::ASCIIToUTF16("Notification message body."), gfx::Image(), + base::ASCIIToUTF16("www.test.org"), GURL(), notifier_id, + message_center::RichNotificationData(), nullptr /* delegate */); + message_center->AddNotification(std::move(notification)); +} + // A test implementation of the ShelfObserver mojo interface. class TestShelfObserver : public mojom::ShelfObserver { public: @@ -219,6 +240,53 @@ EXPECT_FALSE(controller->model()->items()[index].image.isNull()); } +class ShelfControllerTouchableContextMenuTest : public AshTestBase { + public: + ShelfControllerTouchableContextMenuTest() = default; + ~ShelfControllerTouchableContextMenuTest() override = default; + + void SetUp() override { + scoped_feature_list_.InitAndEnableFeature( + app_list::features::kEnableTouchableAppContextMenu); + AshTestBase::SetUp(); + } + + private: + base::test::ScopedFeatureList scoped_feature_list_; + + DISALLOW_COPY_AND_ASSIGN(ShelfControllerTouchableContextMenuTest); +}; + +// Tests that the ShelfController keeps the ShelfModel updated on new +// notifications. +TEST_F(ShelfControllerTouchableContextMenuTest, HasNotificationBasic) { + ShelfController* controller = Shell::Get()->shelf_controller(); + const std::string app_id("app_id"); + ShelfItem item; + item.type = TYPE_APP; + item.id = ShelfID(app_id); + const int index = controller->model()->Add(item); + EXPECT_FALSE(controller->model()->items()[index].has_notification); + + // Add a notification for |item|. + message_center::MessageCenter* message_center = + message_center::MessageCenter::Get(); + const std::string notification_id("notification_id"); + BuildAndSendNotification(message_center, app_id, notification_id); + + EXPECT_TRUE(controller->model()->items()[index].has_notification); + + // Remove the app and pin it, the notification should persist. + controller->model()->RemoveItemAt(index); + controller->model()->PinAppWithID(app_id); + + EXPECT_TRUE(controller->model()->items()[index].has_notification); + + message_center->RemoveNotification(notification_id, true); + + EXPECT_FALSE(controller->model()->items()[index].has_notification); +} + class ShelfControllerPrefsTest : public AshTestBase { public: ShelfControllerPrefsTest() = default;
diff --git a/ash/shelf/shelf_view.cc b/ash/shelf/shelf_view.cc index 547ade4..3e4181b 100644 --- a/ash/shelf/shelf_view.cc +++ b/ash/shelf/shelf_view.cc
@@ -203,6 +203,13 @@ button->AddState(ShelfButton::STATE_ATTENTION); break; } + + if (app_list::features::IsTouchableAppContextMenuEnabled()) { + if (item.has_notification) + button->AddState(ShelfButton::STATE_NOTIFICATION); + else + button->ClearState(ShelfButton::STATE_NOTIFICATION); + } } // Returns the id of the display on which |view| is shown.
diff --git a/ash/shelf/shelf_view_unittest.cc b/ash/shelf/shelf_view_unittest.cc index 0feb2b8..a65af1d1 100644 --- a/ash/shelf/shelf_view_unittest.cc +++ b/ash/shelf/shelf_view_unittest.cc
@@ -48,10 +48,12 @@ #include "base/strings/utf_string_conversions.h" #include "base/test/histogram_tester.h" #include "base/test/icu_test_util.h" +#include "base/test/scoped_feature_list.h" #include "base/test/scoped_mock_time_message_loop_task_runner.h" #include "base/test/user_action_tester.h" #include "base/time/time.h" #include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" #include "ui/app_list/app_list_features.h" #include "ui/app_list/presenter/app_list.h" #include "ui/app_list/presenter/test/test_app_list_presenter.h" @@ -277,6 +279,8 @@ AshTestBase::TearDown(); } + std::string GetNextAppId() { return base::IntToString(id_); } + protected: // Add shelf items of various types, and optionally wait for animations. ShelfID AddItem(ShelfItemType type, bool wait_for_animations) { @@ -285,8 +289,7 @@ if (type == TYPE_APP || type == TYPE_APP_PANEL) item.status = STATUS_RUNNING; - static int id = 0; - item.id = ShelfID(base::IntToString(id++)); + item.id = ShelfID(base::IntToString(id_++)); model_->Add(item); // Set a delegate; some tests require one to select the item. model_->SetShelfItemDelegate(item.id, @@ -655,6 +658,7 @@ ShelfModel* model_ = nullptr; ShelfView* shelf_view_ = nullptr; + int id_ = 0; std::unique_ptr<ShelfViewTestAPI> test_api_; @@ -2133,6 +2137,93 @@ ASSERT_EQ(1u, test_app_list_presenter.process_mouse_wheel_offset_count()); } +class ShelfViewTouchableContextMenuTest : public ShelfViewTest { + public: + ShelfViewTouchableContextMenuTest() = default; + ~ShelfViewTouchableContextMenuTest() override = default; + + void SetUp() override { + scoped_feature_list_.InitAndEnableFeature( + app_list::features::kEnableTouchableAppContextMenu); + + ShelfViewTest::SetUp(); + } + + private: + base::test::ScopedFeatureList scoped_feature_list_; + + DISALLOW_COPY_AND_ASSIGN(ShelfViewTouchableContextMenuTest); +}; + +// Tests that an item has a notification indicator when it recieves a +// notification. +TEST_F(ShelfViewTouchableContextMenuTest, AddedItemHasNotificationIndicator) { + const ShelfID id_0 = AddApp(); + const std::string notification_id_0("notification_id_0"); + const ShelfButton* button_0 = GetButtonByID(id_0); + + EXPECT_FALSE(GetItemByID(id_0).has_notification); + EXPECT_FALSE(button_0->state() & ShelfButton::STATE_NOTIFICATION); + + // Post a test notification after the item was added. + model_->AddNotificationRecord(id_0.app_id, notification_id_0); + + EXPECT_TRUE(GetItemByID(id_0).has_notification); + EXPECT_TRUE(button_0->state() & ShelfButton::STATE_NOTIFICATION); + + // Post another notification for a non existing item. + const std::string next_app_id(GetNextAppId()); + const std::string notification_id_1("notification_id_1"); + model_->AddNotificationRecord(next_app_id, notification_id_1); + + // Add an item with matching app id. + const ShelfID id_1 = AddApp(); + + // Ensure that the app id assigned to |id_1| is the same as |next_app_id|. + EXPECT_EQ(next_app_id, id_1.app_id); + const ShelfButton* button_1 = GetButtonByID(id_1); + EXPECT_TRUE(GetItemByID(id_1).has_notification); + EXPECT_TRUE(button_1->state() & ShelfButton::STATE_NOTIFICATION); + + // Remove all notifications. + model_->RemoveNotificationRecord(notification_id_0); + model_->RemoveNotificationRecord(notification_id_1); + + EXPECT_FALSE(GetItemByID(id_0).has_notification); + EXPECT_FALSE(button_0->state() & ShelfButton::STATE_NOTIFICATION); + EXPECT_FALSE(GetItemByID(id_1).has_notification); + EXPECT_FALSE(button_1->state() & ShelfButton::STATE_NOTIFICATION); +} + +// Tests that the notification indicator is active until all notifications have +// been removed. +TEST_F(ShelfViewTouchableContextMenuTest, + NotificationIndicatorStaysActiveUntilNotificationsAreGone) { + const ShelfID app = AddApp(); + const ShelfButton* button = GetButtonByID(app); + + // Add two notifications for the same app. + const std::string notification_id_0("notification_id_0"); + model_->AddNotificationRecord(app.app_id, notification_id_0); + const std::string notification_id_1("notification_id_1"); + model_->AddNotificationRecord(app.app_id, notification_id_1); + + EXPECT_TRUE(GetItemByID(app).has_notification); + EXPECT_TRUE(button->state() & ShelfButton::STATE_NOTIFICATION); + + // Remove one notification, indicator should stay active. + model_->RemoveNotificationRecord(notification_id_0); + + EXPECT_TRUE(GetItemByID(app).has_notification); + EXPECT_TRUE(button->state() & ShelfButton::STATE_NOTIFICATION); + + // Remove the last notification, indicator should not be active. + model_->RemoveNotificationRecord(notification_id_1); + + EXPECT_FALSE(GetItemByID(app).has_notification); + EXPECT_FALSE(button->state() & ShelfButton::STATE_NOTIFICATION); +} + class ShelfViewVisibleBoundsTest : public ShelfViewTest, public testing::WithParamInterface<bool> { public:
diff --git a/base/BUILD.gn b/base/BUILD.gn index f0961037..744ec15 100644 --- a/base/BUILD.gn +++ b/base/BUILD.gn
@@ -608,6 +608,7 @@ "nix/mime_util_xdg.h", "nix/xdg_util.cc", "nix/xdg_util.h", + "no_destructor.h", "observer_list.h", "observer_list_threadsafe.cc", "observer_list_threadsafe.h", @@ -2191,6 +2192,7 @@ "metrics/sparse_histogram_unittest.cc", "metrics/statistics_recorder_unittest.cc", "native_library_unittest.cc", + "no_destructor_unittest.cc", "observer_list_unittest.cc", "optional_unittest.cc", "os_compat_android_unittest.cc",
diff --git a/base/lazy_instance.h b/base/lazy_instance.h index 828eb44..2d150a2 100644 --- a/base/lazy_instance.h +++ b/base/lazy_instance.h
@@ -1,7 +1,17 @@ // Copyright (c) 2012 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. - +// +// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! DEPRECATED !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +// Please don't introduce new instances of LazyInstance<T>. Use a function-local +// static of type base::NoDestructor<T> instead: +// +// Factory& Factory::GetInstance() { +// static base::NoDestructor<Factory> instance; +// return *instance; +// } +// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +// // The LazyInstance<Type, Traits> class manages a single instance of Type, // which will be lazily created on the first time it's accessed. This class is // useful for places you would normally use a function-level static, but you
diff --git a/base/macros.h b/base/macros.h index b1c5fe7..ca5ed5f 100644 --- a/base/macros.h +++ b/base/macros.h
@@ -70,6 +70,16 @@ // Use these to declare and define a static local variable (static T;) so that // it is leaked so that its destructors are not called at exit. This is // thread-safe. +// +// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! DEPRECATED !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +// Please don't use this macro. Use a function-local static of type +// base::NoDestructor<T> instead: +// +// Factory& Factory::GetInstance() { +// static base::NoDestructor<Factory> instance; +// return *instance; +// } +// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! #define CR_DEFINE_STATIC_LOCAL(type, name, arguments) \ static type& name = *new type arguments
diff --git a/base/memory/singleton.h b/base/memory/singleton.h index 8b568e38..ba1190d 100644 --- a/base/memory/singleton.h +++ b/base/memory/singleton.h
@@ -1,8 +1,16 @@ // Copyright (c) 2011 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. - -// PLEASE READ: Do you really need a singleton? +// +// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +// PLEASE READ: Do you really need a singleton? If possible, use a +// function-local static of type base::NoDestructor<T> instead: +// +// Factory& Factory::GetInstance() { +// static base::NoDestructor<Factory> instance; +// return *instance; +// } +// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // // Singletons make it hard to determine the lifetime of an object, which can // lead to buggy code and spurious crashes.
diff --git a/base/no_destructor.h b/base/no_destructor.h new file mode 100644 index 0000000..f4ca04b --- /dev/null +++ b/base/no_destructor.h
@@ -0,0 +1,72 @@ +// Copyright 2018 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 BASE_NO_DESTRUCTOR_H_ +#define BASE_NO_DESTRUCTOR_H_ + +#include <utility> + +namespace base { + +// A wrapper that makes it easy to create an object of type T with static +// storage duration that: +// - is only constructed on first access +// - never invokes the destructor +// in order to satisfy the styleguide ban on global constructors and +// destructors. +// +// Runtime constant example: +// const std::string& GetLineSeparator() { +// // Forwards to std::string(size_t, char, const Allocator&) constructor. +// static const base::NoDestructor<std::string> s(5, '-'); +// return s; +// } +// +// More complex initialization with a lambda: +// const std::string& GetSessionNonce() { +// static const base::NoDestructor<std::string> nonce([] { +// std::string s(16); +// crypto::RandString(s.data(), s.size()); +// return s; +// })()); +// return *nonce; +// } +// +// NoDestructor<T> stores the object inline, so it also avoids a pointer +// indirection and a malloc. Code should prefer to use NoDestructor<T> over: +// - The CR_DEFINE_STATIC_LOCAL() helper macro. +// - A function scoped static T* or T& that is dynamically initialized. +// - A global base::LazyInstance<T>. +// +// Note that since the destructor is never run, this *will* leak memory if used +// as a stack or member variable. Furthermore, a NoDestructor<T> should never +// have global scope as that may require a static initializer. +template <typename T> +class NoDestructor { + public: + // Not constexpr; just write static constexpr T x = ...; if the value should + // be a constexpr. + template <typename... Args> + explicit NoDestructor(Args&&... args) { + new (get()) T(std::forward<Args>(args)...); + } + + ~NoDestructor() = default; + + const T& operator*() const { return *get(); } + T& operator*() { return *get(); } + + const T* operator->() const { return get(); } + T* operator->() { return get(); } + + const T* get() const { return reinterpret_cast<const T*>(&storage_); } + T* get() { return reinterpret_cast<T*>(&storage_); } + + private: + alignas(T) char storage_[sizeof(T)]; +}; + +} // namespace base + +#endif // BASE_NO_DESTRUCTOR_H_
diff --git a/base/no_destructor_unittest.cc b/base/no_destructor_unittest.cc new file mode 100644 index 0000000..0cb1338 --- /dev/null +++ b/base/no_destructor_unittest.cc
@@ -0,0 +1,67 @@ +// Copyright 2018 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 "base/no_destructor.h" + +#include <string> +#include <utility> + +#include "base/logging.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace base { + +namespace { + +struct CheckOnDestroy { + ~CheckOnDestroy() { CHECK(false); } +}; + +TEST(NoDestructorTest, SkipsDestructors) { + NoDestructor<CheckOnDestroy> destructor_should_not_run; +} + +struct CopyOnly { + CopyOnly() = default; + + CopyOnly(const CopyOnly&) = default; + CopyOnly& operator=(const CopyOnly&) = default; + + CopyOnly(CopyOnly&&) = delete; + CopyOnly& operator=(CopyOnly&&) = delete; +}; + +struct MoveOnly { + MoveOnly() = default; + + MoveOnly(const MoveOnly&) = delete; + MoveOnly& operator=(const MoveOnly&) = delete; + + MoveOnly(MoveOnly&&) = default; + MoveOnly& operator=(MoveOnly&&) = default; +}; + +struct ForwardingTestStruct { + ForwardingTestStruct(const CopyOnly&, MoveOnly&&) {} +}; + +TEST(NoDestructorTest, ForwardsArguments) { + CopyOnly copy_only; + MoveOnly move_only; + + static NoDestructor<ForwardingTestStruct> test_forwarding( + copy_only, std::move(move_only)); +} + +TEST(NoDestructorTest, Accessors) { + static NoDestructor<std::string> awesome("awesome"); + + EXPECT_EQ("awesome", *awesome); + EXPECT_EQ(0, awesome->compare("awesome")); + EXPECT_EQ(0, awesome.get()->compare("awesome")); +} + +} // namespace + +} // namespace base
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 7970ea53..664bb8d 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
@@ -204,16 +204,19 @@ def set_debug_app(dev): # Set debug app in order to enable reading command line flags on user # builds - if not self._test_instance.package_info: - logging.error("Couldn't set debug app: no package info") - elif not self._test_instance.package_info.package: - logging.error("Couldn't set debug app: no package defined") + package_name = None + if self._test_instance.apk_under_test: + package_name = self._test_instance.apk_under_test.GetPackageName() + elif self._test_instance.test_apk: + package_name = self._test_instance.test_apk.GetPackageName() else: - cmd = ['am', 'set-debug-app', '--persistent'] - if self._test_instance.wait_for_java_debugger: - cmd.append('-w') - cmd.append(self._test_instance.package_info.package) - dev.RunShellCommand(cmd, check_return=True) + logging.error("Couldn't set debug app: no package name found") + return + cmd = ['am', 'set-debug-app', '--persistent'] + if self._test_instance.wait_for_java_debugger: + cmd.append('-w') + cmd.append(package_name) + dev.RunShellCommand(cmd, check_return=True) @trace_event.traced def edit_shared_prefs(dev): @@ -301,7 +304,7 @@ if self._test_instance.wait_for_java_debugger: logging.warning('*' * 80) logging.warning('Waiting for debugger to attach to process: %s', - self._test_instance.package_info.package) + self._test_instance.apk_under_test.GetPackageName()) logging.warning('*' * 80) #override
diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc index bbb998f3..6b9a3458 100644 --- a/cc/layers/picture_layer_impl.cc +++ b/cc/layers/picture_layer_impl.cc
@@ -466,8 +466,9 @@ quad->SetNew( shared_quad_state, offset_geometry_rect, offset_visible_geometry_rect, needs_blending, - draw_info.resource_id(), texture_rect, draw_info.resource_size(), - draw_info.contents_swizzled(), nearest_neighbor_, + draw_info.resource_id_for_export(), texture_rect, + draw_info.resource_size(), draw_info.contents_swizzled(), + nearest_neighbor_, !layer_tree_impl()->settings().enable_edge_anti_aliasing); ValidateQuadResources(quad); has_draw_quad = true; @@ -1035,7 +1036,7 @@ return; } - *resource_id = draw_info.resource_id(); + *resource_id = draw_info.resource_id_for_export(); *resource_size = draw_info.resource_size(); // |resource_uv_size| represents the range of UV coordinates that map to the // content being drawn. Typically, we draw to the entire texture, so these
diff --git a/cc/layers/picture_layer_impl_unittest.cc b/cc/layers/picture_layer_impl_unittest.cc index e2e2f949..34e4f19 100644 --- a/cc/layers/picture_layer_impl_unittest.cc +++ b/cc/layers/picture_layer_impl_unittest.cc
@@ -4615,21 +4615,25 @@ ASSERT_TRUE(active_layer()->tilings()); ASSERT_GT(active_layer()->tilings()->num_tilings(), 0u); std::vector<Tile*> tiles = - active_layer()->tilings()->tiling_at(0)->AllTilesForTesting(); - EXPECT_FALSE(tiles.empty()); - host_impl()->tile_manager()->InitializeTilesWithResourcesForTesting(tiles); - } - - if (partial_opaque) { - std::vector<Tile*> high_res_tiles = active_layer()->HighResTiling()->AllTilesForTesting(); - size_t i = 0; - for (std::vector<Tile*>::iterator tile_it = high_res_tiles.begin(); - tile_it != high_res_tiles.end() && i < 5; ++tile_it, ++i) { - Tile* tile = *tile_it; - TileDrawInfo& draw_info = tile->draw_info(); - draw_info.SetSolidColorForTesting(0); + EXPECT_FALSE(tiles.empty()); + + std::vector<Tile*> resource_tiles; + if (!partial_opaque) { + resource_tiles = tiles; + } else { + size_t i = 0; + for (auto it = tiles.begin(); it != tiles.end(); ++it, ++i) { + if (i < 5) { + TileDrawInfo& draw_info = (*it)->draw_info(); + draw_info.SetSolidColorForTesting(0); + } else { + resource_tiles.push_back(*it); + } + } } + host_impl()->tile_manager()->InitializeTilesWithResourcesForTesting( + resource_tiles); } std::unique_ptr<viz::RenderPass> render_pass = viz::RenderPass::Create();
diff --git a/cc/raster/bitmap_raster_buffer_provider.cc b/cc/raster/bitmap_raster_buffer_provider.cc index 6af8d61..b60f1c4 100644 --- a/cc/raster/bitmap_raster_buffer_provider.cc +++ b/cc/raster/bitmap_raster_buffer_provider.cc
@@ -25,11 +25,13 @@ class BitmapRasterBufferImpl : public RasterBuffer { public: BitmapRasterBufferImpl(LayerTreeResourceProvider* resource_provider, - const Resource* resource, + const ResourcePool::InUsePoolResource& in_use_resource, uint64_t resource_content_id, uint64_t previous_content_id) - : lock_(resource_provider, resource->id()), - resource_(resource), + : lock_(resource_provider, + in_use_resource.software_backing_resource_id()), + resource_format_(in_use_resource.format()), + resource_size_(in_use_resource.size()), resource_has_previous_content_( resource_content_id && resource_content_id == previous_content_id) { } @@ -52,14 +54,15 @@ size_t stride = 0u; RasterBufferProvider::PlaybackToMemory( - lock_.sk_bitmap().getPixels(), resource_->format(), resource_->size(), - stride, raster_source, raster_full_rect, playback_rect, transform, + lock_.sk_bitmap().getPixels(), resource_format_, resource_size_, stride, + raster_source, raster_full_rect, playback_rect, transform, lock_.color_space_for_raster(), playback_settings); } private: LayerTreeResourceProvider::ScopedWriteLockSoftware lock_; - const Resource* resource_; + const viz::ResourceFormat resource_format_; + const gfx::Size resource_size_; bool resource_has_previous_content_; DISALLOW_COPY_AND_ASSIGN(BitmapRasterBufferImpl); @@ -82,11 +85,11 @@ std::unique_ptr<RasterBuffer> BitmapRasterBufferProvider::AcquireBufferForRaster( - const Resource* resource, + const ResourcePool::InUsePoolResource& resource, uint64_t resource_content_id, uint64_t previous_content_id) { - return std::unique_ptr<RasterBuffer>(new BitmapRasterBufferImpl( - resource_provider_, resource, resource_content_id, previous_content_id)); + return std::make_unique<BitmapRasterBufferImpl>( + resource_provider_, resource, resource_content_id, previous_content_id); } void BitmapRasterBufferProvider::OrderingBarrier() { @@ -110,13 +113,13 @@ } bool BitmapRasterBufferProvider::IsResourceReadyToDraw( - viz::ResourceId resource_id) const { + const ResourcePool::InUsePoolResource& resource) const { // Bitmap resources are immediately ready to draw. return true; } uint64_t BitmapRasterBufferProvider::SetReadyToDrawCallback( - const ResourceProvider::ResourceIdArray& resource_ids, + const std::vector<const ResourcePool::InUsePoolResource*>& resources, const base::Closure& callback, uint64_t pending_callback_id) const { // Bitmap resources are immediately ready to draw.
diff --git a/cc/raster/bitmap_raster_buffer_provider.h b/cc/raster/bitmap_raster_buffer_provider.h index 4647c28..0e5318f 100644 --- a/cc/raster/bitmap_raster_buffer_provider.h +++ b/cc/raster/bitmap_raster_buffer_provider.h
@@ -29,7 +29,7 @@ // Overridden from RasterBufferProvider: std::unique_ptr<RasterBuffer> AcquireBufferForRaster( - const Resource* resource, + const ResourcePool::InUsePoolResource& resource, uint64_t resource_content_id, uint64_t previous_content_id) override; void OrderingBarrier() override; @@ -37,9 +37,10 @@ viz::ResourceFormat GetResourceFormat(bool must_support_alpha) const override; bool IsResourceSwizzleRequired(bool must_support_alpha) const override; bool CanPartialRasterIntoProvidedResource() const override; - bool IsResourceReadyToDraw(viz::ResourceId id) const override; + bool IsResourceReadyToDraw( + const ResourcePool::InUsePoolResource& resource) const override; uint64_t SetReadyToDrawCallback( - const ResourceProvider::ResourceIdArray& resource_ids, + const std::vector<const ResourcePool::InUsePoolResource*>& resources, const base::Closure& callback, uint64_t pending_callback_id) const override; void Shutdown() override;
diff --git a/cc/raster/gpu_raster_buffer_provider.cc b/cc/raster/gpu_raster_buffer_provider.cc index f6fe0f54a..f98568ce 100644 --- a/cc/raster/gpu_raster_buffer_provider.cc +++ b/cc/raster/gpu_raster_buffer_provider.cc
@@ -188,13 +188,14 @@ } std::unique_ptr<RasterBuffer> GpuRasterBufferProvider::AcquireBufferForRaster( - const Resource* resource, + const ResourcePool::InUsePoolResource& resource, uint64_t resource_content_id, uint64_t previous_content_id) { bool resource_has_previous_content = resource_content_id && resource_content_id == previous_content_id; - return std::make_unique<RasterBufferImpl>( - this, resource_provider_, resource->id(), resource_has_previous_content); + return std::make_unique<RasterBufferImpl>(this, resource_provider_, + resource.gpu_backing_resource_id(), + resource_has_previous_content); } void GpuRasterBufferProvider::OrderingBarrier() { @@ -238,9 +239,9 @@ } bool GpuRasterBufferProvider::IsResourceReadyToDraw( - viz::ResourceId resource_id) const { - gpu::SyncToken sync_token = - resource_provider_->GetSyncTokenForResources({resource_id}); + const ResourcePool::InUsePoolResource& resource) const { + gpu::SyncToken sync_token = resource_provider_->GetSyncTokenForResources( + {resource.gpu_backing_resource_id()}); if (!sync_token.HasData()) return true; @@ -250,9 +251,13 @@ } uint64_t GpuRasterBufferProvider::SetReadyToDrawCallback( - const ResourceProvider::ResourceIdArray& resource_ids, + const std::vector<const ResourcePool::InUsePoolResource*>& resources, const base::Closure& callback, uint64_t pending_callback_id) const { + std::vector<viz::ResourceId> resource_ids; + resource_ids.reserve(resources.size()); + for (auto* resource : resources) + resource_ids.push_back(resource->gpu_backing_resource_id()); gpu::SyncToken sync_token = resource_provider_->GetSyncTokenForResources(resource_ids); uint64_t callback_id = sync_token.release_count();
diff --git a/cc/raster/gpu_raster_buffer_provider.h b/cc/raster/gpu_raster_buffer_provider.h index fe7c1cb..074cc55 100644 --- a/cc/raster/gpu_raster_buffer_provider.h +++ b/cc/raster/gpu_raster_buffer_provider.h
@@ -32,7 +32,7 @@ // Overridden from RasterBufferProvider: std::unique_ptr<RasterBuffer> AcquireBufferForRaster( - const Resource* resource, + const ResourcePool::InUsePoolResource& resource, uint64_t resource_content_id, uint64_t previous_content_id) override; void OrderingBarrier() override; @@ -40,9 +40,10 @@ viz::ResourceFormat GetResourceFormat(bool must_support_alpha) const override; bool IsResourceSwizzleRequired(bool must_support_alpha) const override; bool CanPartialRasterIntoProvidedResource() const override; - bool IsResourceReadyToDraw(viz::ResourceId id) const override; + bool IsResourceReadyToDraw( + const ResourcePool::InUsePoolResource& resource) const override; uint64_t SetReadyToDrawCallback( - const ResourceProvider::ResourceIdArray& resource_ids, + const std::vector<const ResourcePool::InUsePoolResource*>& resources, const base::Closure& callback, uint64_t pending_callback_id) const override; void Shutdown() override;
diff --git a/cc/raster/one_copy_raster_buffer_provider.cc b/cc/raster/one_copy_raster_buffer_provider.cc index abc64e3..1636cca 100644 --- a/cc/raster/one_copy_raster_buffer_provider.cc +++ b/cc/raster/one_copy_raster_buffer_provider.cc
@@ -41,11 +41,12 @@ OneCopyRasterBufferProvider::RasterBufferImpl::RasterBufferImpl( OneCopyRasterBufferProvider* client, LayerTreeResourceProvider* resource_provider, - const Resource* resource, + const ResourcePool::InUsePoolResource& in_use_resource, uint64_t previous_content_id) : client_(client), - resource_(resource), - lock_(resource_provider, resource->id()), + resource_size_(in_use_resource.size()), + resource_format_(in_use_resource.format()), + lock_(resource_provider, in_use_resource.gpu_backing_resource_id()), previous_content_id_(previous_content_id) { client_->pending_raster_buffers_.insert(this); lock_.CreateMailbox(); @@ -64,9 +65,9 @@ const RasterSource::PlaybackSettings& playback_settings) { TRACE_EVENT0("cc", "OneCopyRasterBuffer::Playback"); client_->PlaybackAndCopyOnWorkerThread( - resource_, &lock_, sync_token_, raster_source, raster_full_rect, - raster_dirty_rect, transform, playback_settings, previous_content_id_, - new_content_id); + &lock_, sync_token_, raster_source, raster_full_rect, raster_dirty_rect, + transform, resource_size_, resource_format_, playback_settings, + previous_content_id_, new_content_id); } OneCopyRasterBufferProvider::OneCopyRasterBufferProvider( @@ -104,7 +105,7 @@ std::unique_ptr<RasterBuffer> OneCopyRasterBufferProvider::AcquireBufferForRaster( - const Resource* resource, + const ResourcePool::InUsePoolResource& resource, uint64_t resource_content_id, uint64_t previous_content_id) { // TODO(danakj): If resource_content_id != 0, we only need to copy/upload @@ -152,9 +153,9 @@ } bool OneCopyRasterBufferProvider::IsResourceReadyToDraw( - viz::ResourceId resource_id) const { - gpu::SyncToken sync_token = - resource_provider_->GetSyncTokenForResources({resource_id}); + const ResourcePool::InUsePoolResource& resource) const { + gpu::SyncToken sync_token = resource_provider_->GetSyncTokenForResources( + {resource.gpu_backing_resource_id()}); if (!sync_token.HasData()) return true; @@ -164,9 +165,13 @@ } uint64_t OneCopyRasterBufferProvider::SetReadyToDrawCallback( - const ResourceProvider::ResourceIdArray& resource_ids, + const std::vector<const ResourcePool::InUsePoolResource*>& resources, const base::Closure& callback, uint64_t pending_callback_id) const { + std::vector<viz::ResourceId> resource_ids; + resource_ids.reserve(resources.size()); + for (auto* resource : resources) + resource_ids.push_back(resource->gpu_backing_resource_id()); gpu::SyncToken sync_token = resource_provider_->GetSyncTokenForResources(resource_ids); uint64_t callback_id = sync_token.release_count(); @@ -191,24 +196,26 @@ } void OneCopyRasterBufferProvider::PlaybackAndCopyOnWorkerThread( - const Resource* resource, LayerTreeResourceProvider::ScopedWriteLockRaster* resource_lock, const gpu::SyncToken& sync_token, const RasterSource* raster_source, const gfx::Rect& raster_full_rect, const gfx::Rect& raster_dirty_rect, const gfx::AxisTransform2d& transform, + const gfx::Size& resource_size, + viz::ResourceFormat resource_format, const RasterSource::PlaybackSettings& playback_settings, uint64_t previous_content_id, uint64_t new_content_id) { WaitSyncToken(sync_token); std::unique_ptr<StagingBuffer> staging_buffer = - staging_pool_.AcquireStagingBuffer(resource, previous_content_id); + staging_pool_.AcquireStagingBuffer(resource_size, resource_format, + previous_content_id); PlaybackToStagingBuffer( - staging_buffer.get(), resource, raster_source, raster_full_rect, - raster_dirty_rect, transform, resource_lock->color_space_for_raster(), + staging_buffer.get(), raster_source, raster_full_rect, raster_dirty_rect, + transform, resource_format, resource_lock->color_space_for_raster(), playback_settings, previous_content_id, new_content_id); CopyOnWorkerThread(staging_buffer.get(), resource_lock, raster_source, @@ -229,11 +236,11 @@ void OneCopyRasterBufferProvider::PlaybackToStagingBuffer( StagingBuffer* staging_buffer, - const Resource* resource, const RasterSource* raster_source, const gfx::Rect& raster_full_rect, const gfx::Rect& raster_dirty_rect, const gfx::AxisTransform2d& transform, + viz::ResourceFormat format, const gfx::ColorSpace& dst_color_space, const RasterSource::PlaybackSettings& playback_settings, uint64_t previous_content_id, @@ -243,8 +250,8 @@ if (!staging_buffer->gpu_memory_buffer) { staging_buffer->gpu_memory_buffer = resource_provider_->gpu_memory_buffer_manager()->CreateGpuMemoryBuffer( - staging_buffer->size, BufferFormat(resource->format()), - StagingBufferUsage(), gpu::kNullSurfaceHandle); + staging_buffer->size, BufferFormat(format), StagingBufferUsage(), + gpu::kNullSurfaceHandle); } gfx::Rect playback_rect = raster_full_rect; @@ -281,9 +288,9 @@ DCHECK(!playback_rect.IsEmpty()) << "Why are we rastering a tile that's not dirty?"; RasterBufferProvider::PlaybackToMemory( - buffer->memory(0), resource->format(), staging_buffer->size, - buffer->stride(0), raster_source, raster_full_rect, playback_rect, - transform, dst_color_space, playback_settings); + buffer->memory(0), format, staging_buffer->size, buffer->stride(0), + raster_source, raster_full_rect, playback_rect, transform, + dst_color_space, playback_settings); buffer->Unmap(); staging_buffer->content_id = new_content_id; }
diff --git a/cc/raster/one_copy_raster_buffer_provider.h b/cc/raster/one_copy_raster_buffer_provider.h index 9c09b3553..c33cdfa 100644 --- a/cc/raster/one_copy_raster_buffer_provider.h +++ b/cc/raster/one_copy_raster_buffer_provider.h
@@ -37,7 +37,7 @@ // Overridden from RasterBufferProvider: std::unique_ptr<RasterBuffer> AcquireBufferForRaster( - const Resource* resource, + const ResourcePool::InUsePoolResource& resource, uint64_t resource_content_id, uint64_t previous_content_id) override; void OrderingBarrier() override; @@ -45,22 +45,24 @@ viz::ResourceFormat GetResourceFormat(bool must_support_alpha) const override; bool IsResourceSwizzleRequired(bool must_support_alpha) const override; bool CanPartialRasterIntoProvidedResource() const override; - bool IsResourceReadyToDraw(viz::ResourceId id) const override; + bool IsResourceReadyToDraw( + const ResourcePool::InUsePoolResource& resource) const override; uint64_t SetReadyToDrawCallback( - const ResourceProvider::ResourceIdArray& resource_ids, + const std::vector<const ResourcePool::InUsePoolResource*>& resources, const base::Closure& callback, uint64_t pending_callback_id) const override; void Shutdown() override; // Playback raster source and copy result into |resource|. void PlaybackAndCopyOnWorkerThread( - const Resource* resource, LayerTreeResourceProvider::ScopedWriteLockRaster* resource_lock, const gpu::SyncToken& sync_token, const RasterSource* raster_source, const gfx::Rect& raster_full_rect, const gfx::Rect& raster_dirty_rect, const gfx::AxisTransform2d& transform, + const gfx::Size& resource_size, + viz::ResourceFormat resource_format, const RasterSource::PlaybackSettings& playback_settings, uint64_t previous_content_id, uint64_t new_content_id); @@ -70,7 +72,7 @@ public: RasterBufferImpl(OneCopyRasterBufferProvider* client, LayerTreeResourceProvider* resource_provider, - const Resource* resource, + const ResourcePool::InUsePoolResource& in_use_resource, uint64_t previous_content_id); ~RasterBufferImpl() override; @@ -88,10 +90,11 @@ } private: - OneCopyRasterBufferProvider* client_; - const Resource* resource_; + OneCopyRasterBufferProvider* const client_; + const gfx::Size resource_size_; + const viz::ResourceFormat resource_format_; LayerTreeResourceProvider::ScopedWriteLockRaster lock_; - uint64_t previous_content_id_; + const uint64_t previous_content_id_; gpu::SyncToken sync_token_; @@ -101,11 +104,11 @@ void WaitSyncToken(const gpu::SyncToken& sync_token); void PlaybackToStagingBuffer( StagingBuffer* staging_buffer, - const Resource* resource, const RasterSource* raster_source, const gfx::Rect& raster_full_rect, const gfx::Rect& raster_dirty_rect, const gfx::AxisTransform2d& transform, + viz::ResourceFormat format, const gfx::ColorSpace& dst_color_space, const RasterSource::PlaybackSettings& playback_settings, uint64_t previous_content_id,
diff --git a/cc/raster/raster_buffer_provider.h b/cc/raster/raster_buffer_provider.h index 4561971..27591147 100644 --- a/cc/raster/raster_buffer_provider.h +++ b/cc/raster/raster_buffer_provider.h
@@ -11,6 +11,7 @@ #include "cc/raster/raster_source.h" #include "cc/raster/task_graph_runner.h" #include "cc/raster/tile_task.h" +#include "cc/resources/resource_pool.h" #include "cc/resources/resource_provider.h" #include "components/viz/common/resources/resource_format.h" #include "ui/gfx/geometry/rect.h" @@ -44,7 +45,7 @@ // Acquire raster buffer. virtual std::unique_ptr<RasterBuffer> AcquireBufferForRaster( - const Resource* resource, + const ResourcePool::InUsePoolResource& resource, uint64_t resource_content_id, uint64_t previous_content_id) = 0; @@ -67,7 +68,8 @@ virtual bool CanPartialRasterIntoProvidedResource() const = 0; // Returns true if the indicated resource is ready to draw. - virtual bool IsResourceReadyToDraw(viz::ResourceId id) const = 0; + virtual bool IsResourceReadyToDraw( + const ResourcePool::InUsePoolResource& resource) const = 0; // Calls the provided |callback| when the provided |resources| are ready to // draw. Returns a callback ID which can be used to track this callback. @@ -76,7 +78,7 @@ // avoid creating a new callback unnecessarily. If the caller does not // have a pending callback, 0 should be passed for |pending_callback_id|. virtual uint64_t SetReadyToDrawCallback( - const ResourceProvider::ResourceIdArray& resource_ids, + const std::vector<const ResourcePool::InUsePoolResource*>& resources, const base::Callback<void()>& callback, uint64_t pending_callback_id) const = 0;
diff --git a/cc/raster/raster_buffer_provider_perftest.cc b/cc/raster/raster_buffer_provider_perftest.cc index 457e261..c45ab46 100644 --- a/cc/raster/raster_buffer_provider_perftest.cc +++ b/cc/raster/raster_buffer_provider_perftest.cc
@@ -199,31 +199,37 @@ class PerfRasterBufferProviderHelper { public: virtual std::unique_ptr<RasterBuffer> AcquireBufferForRaster( - const Resource* resource, + const ResourcePool::InUsePoolResource& resource, uint64_t resource_content_id, uint64_t previous_content_id) = 0; }; class PerfRasterTaskImpl : public PerfTileTask { public: - PerfRasterTaskImpl(std::unique_ptr<ScopedResource> resource, + PerfRasterTaskImpl(ResourcePool* pool, + ResourcePool::InUsePoolResource in_use_resource, std::unique_ptr<RasterBuffer> raster_buffer, TileTask::Vector* dependencies) : PerfTileTask(dependencies), - resource_(std::move(resource)), + pool_(pool), + resource_(std::move(in_use_resource)), raster_buffer_(std::move(raster_buffer)) {} // Overridden from Task: void RunOnWorkerThread() override {} // Overridden from TileTask: - void OnTaskCompleted() override { raster_buffer_ = nullptr; } + void OnTaskCompleted() override { + raster_buffer_ = nullptr; + pool_->ReleaseResource(std::move(resource_)); + } protected: ~PerfRasterTaskImpl() override = default; private: - std::unique_ptr<ScopedResource> resource_; + ResourcePool* const pool_; + ResourcePool::InUsePoolResource resource_; std::unique_ptr<RasterBuffer> raster_buffer_; DISALLOW_COPY_AND_ASSIGN(PerfRasterTaskImpl); @@ -258,18 +264,18 @@ const gfx::Size size(1, 1); for (unsigned i = 0; i < num_raster_tasks; ++i) { - auto resource = - std::make_unique<ScopedResource>(resource_provider_.get()); - resource->AllocateGpuTexture(size, viz::ResourceTextureHint::kDefault, - viz::RGBA_8888, gfx::ColorSpace()); + ResourcePool::InUsePoolResource in_use_resource = + resource_pool_->AcquireResource(size, viz::RGBA_8888, + gfx::ColorSpace()); // No tile ids are given to support partial updates. std::unique_ptr<RasterBuffer> raster_buffer; if (helper) - raster_buffer = helper->AcquireBufferForRaster(resource.get(), 0, 0); + raster_buffer = helper->AcquireBufferForRaster(in_use_resource, 0, 0); TileTask::Vector dependencies = image_decode_tasks; raster_tasks->push_back(new PerfRasterTaskImpl( - std::move(resource), std::move(raster_buffer), &dependencies)); + resource_pool_.get(), std::move(in_use_resource), + std::move(raster_buffer), &dependencies)); } } @@ -326,6 +332,7 @@ scoped_refptr<viz::RasterContextProvider> worker_context_provider_; std::unique_ptr<LayerTreeResourceProvider> resource_provider_; scoped_refptr<base::TestSimpleTaskRunner> task_runner_; + std::unique_ptr<ResourcePool> resource_pool_; std::unique_ptr<SynchronousTaskGraphRunner> task_graph_runner_; LapTimer timer_; }; @@ -342,6 +349,10 @@ Create3dResourceProvider(); raster_buffer_provider_ = ZeroCopyRasterBufferProvider::Create( resource_provider_.get(), viz::PlatformColor::BestTextureFormat()); + resource_pool_ = std::make_unique<ResourcePool>( + resource_provider_.get(), task_runner_, + gfx::BufferUsage::GPU_READ_CPU_READ_WRITE, + ResourcePool::kDefaultExpirationDelay, false); break; case RASTER_BUFFER_PROVIDER_TYPE_ONE_COPY: Create3dResourceProvider(); @@ -351,6 +362,10 @@ std::numeric_limits<int>::max(), false, std::numeric_limits<int>::max(), viz::PlatformColor::BestTextureFormat()); + resource_pool_ = std::make_unique<ResourcePool>( + resource_provider_.get(), task_runner_, + viz::ResourceTextureHint::kDefault, + ResourcePool::kDefaultExpirationDelay, false); break; case RASTER_BUFFER_PROVIDER_TYPE_GPU: Create3dResourceProvider(); @@ -358,11 +373,18 @@ compositor_context_provider_.get(), worker_context_provider_.get(), resource_provider_.get(), false, 0, viz::PlatformColor::BestTextureFormat(), false); + resource_pool_ = std::make_unique<ResourcePool>( + resource_provider_.get(), task_runner_, + viz::ResourceTextureHint::kFramebuffer, + ResourcePool::kDefaultExpirationDelay, false); break; case RASTER_BUFFER_PROVIDER_TYPE_BITMAP: CreateSoftwareResourceProvider(); raster_buffer_provider_ = BitmapRasterBufferProvider::Create(resource_provider_.get()); + resource_pool_ = std::make_unique<ResourcePool>( + resource_provider_.get(), task_runner_, + ResourcePool::kDefaultExpirationDelay, false); break; } @@ -379,7 +401,7 @@ // Overridden from PerfRasterBufferProviderHelper: std::unique_ptr<RasterBuffer> AcquireBufferForRaster( - const Resource* resource, + const ResourcePool::InUsePoolResource& resource, uint64_t resource_content_id, uint64_t previous_content_id) override { return raster_buffer_provider_->AcquireBufferForRaster(
diff --git a/cc/raster/raster_buffer_provider_unittest.cc b/cc/raster/raster_buffer_provider_unittest.cc index e44b898..6014b80 100644 --- a/cc/raster/raster_buffer_provider_unittest.cc +++ b/cc/raster/raster_buffer_provider_unittest.cc
@@ -159,6 +159,9 @@ Create3dResourceProvider(); raster_buffer_provider_ = ZeroCopyRasterBufferProvider::Create( resource_provider_.get(), viz::PlatformColor::BestTextureFormat()); + pool_ = std::make_unique<ResourcePool>( + resource_provider_.get(), base::ThreadTaskRunnerHandle::Get(), + gfx::BufferUsage::GPU_READ_CPU_READ_WRITE, base::TimeDelta(), true); break; case RASTER_BUFFER_PROVIDER_TYPE_ONE_COPY: Create3dResourceProvider(); @@ -167,6 +170,9 @@ worker_context_provider_.get(), resource_provider_.get(), kMaxBytesPerCopyOperation, false, kMaxStagingBuffers, viz::PlatformColor::BestTextureFormat()); + pool_ = std::make_unique<ResourcePool>( + resource_provider_.get(), base::ThreadTaskRunnerHandle::Get(), + viz::ResourceTextureHint::kDefault, base::TimeDelta(), true); break; case RASTER_BUFFER_PROVIDER_TYPE_GPU: Create3dResourceProvider(); @@ -174,11 +180,17 @@ context_provider_.get(), worker_context_provider_.get(), resource_provider_.get(), false, 0, viz::PlatformColor::BestTextureFormat(), false); + pool_ = std::make_unique<ResourcePool>( + resource_provider_.get(), base::ThreadTaskRunnerHandle::Get(), + viz::ResourceTextureHint::kFramebuffer, base::TimeDelta(), true); break; case RASTER_BUFFER_PROVIDER_TYPE_BITMAP: CreateSoftwareResourceProvider(); raster_buffer_provider_ = BitmapRasterBufferProvider::Create(resource_provider_.get()); + pool_ = std::make_unique<ResourcePool>( + resource_provider_.get(), base::ThreadTaskRunnerHandle::Get(), + base::TimeDelta(), true); break; } @@ -188,11 +200,15 @@ } void TearDown() override { + for (auto& resource : resources_) + pool_->ReleaseResource(std::move(resource)); resources_.clear(); tile_task_manager_->Shutdown(); tile_task_manager_->CheckForCompletedTasks(); raster_buffer_provider_->Shutdown(); + pool_.reset(); + resource_provider_.reset(); } void AllTileTasksFinished() { @@ -220,27 +236,16 @@ tile_task_manager_->ScheduleTasks(&graph_); } - std::unique_ptr<ScopedResource> AllocateResource(const gfx::Size& size) { - auto resource = std::make_unique<ScopedResource>(resource_provider_.get()); - if (GetParam() == RASTER_BUFFER_PROVIDER_TYPE_ZERO_COPY) { - resource->AllocateGpuMemoryBuffer( - size, viz::RGBA_8888, gfx::BufferUsage::GPU_READ_CPU_READ_WRITE, - gfx::ColorSpace()); - } else if (GetParam() == RASTER_BUFFER_PROVIDER_TYPE_BITMAP) { - resource->AllocateSoftware(size, gfx::ColorSpace()); - } else { - resource->AllocateGpuTexture(size, viz::ResourceTextureHint::kDefault, - viz::RGBA_8888, gfx::ColorSpace()); - } - return resource; + ResourcePool::InUsePoolResource AllocateResource(const gfx::Size& size) { + return pool_->AcquireResource(size, viz::RGBA_8888, gfx::ColorSpace()); } void AppendTask(unsigned id, const gfx::Size& size) { - auto resource = AllocateResource(size); + ResourcePool::InUsePoolResource resource = AllocateResource(size); // The raster buffer has no tile ids associated with it for partial update, // so doesn't need to provide a valid dirty rect. std::unique_ptr<RasterBuffer> raster_buffer = - raster_buffer_provider_->AcquireBufferForRaster(resource.get(), 0, 0); + raster_buffer_provider_->AcquireBufferForRaster(resource, 0, 0); TileTask::Vector empty; tasks_.push_back( new TestRasterTaskImpl(this, id, std::move(raster_buffer), &empty)); @@ -250,9 +255,10 @@ void AppendTask(unsigned id) { AppendTask(id, gfx::Size(1, 1)); } void AppendBlockingTask(unsigned id, base::Lock* lock) { - auto resource = AllocateResource(gfx::Size(1, 1)); + ResourcePool::InUsePoolResource resource = + AllocateResource(gfx::Size(1, 1)); std::unique_ptr<RasterBuffer> raster_buffer = - raster_buffer_provider_->AcquireBufferForRaster(resource.get(), 0, 0); + raster_buffer_provider_->AcquireBufferForRaster(resource, 0, 0); TileTask::Vector empty; tasks_.push_back(new BlockingTestRasterTaskImpl( this, id, std::move(raster_buffer), lock, &empty)); @@ -313,6 +319,7 @@ protected: scoped_refptr<TestContextProvider> context_provider_; scoped_refptr<TestContextProvider> worker_context_provider_; + std::unique_ptr<ResourcePool> pool_; std::unique_ptr<LayerTreeResourceProvider> resource_provider_; std::unique_ptr<TileTaskManager> tile_task_manager_; std::unique_ptr<RasterBufferProvider> raster_buffer_provider_; @@ -325,7 +332,7 @@ bool timed_out_; RasterTaskVector tasks_; std::vector<RasterTaskResult> completed_tasks_; - std::vector<std::unique_ptr<ScopedResource>> resources_; + std::vector<ResourcePool::InUsePoolResource> resources_; TaskGraph graph_; }; @@ -401,10 +408,10 @@ ScheduleTasks(); RunMessageLoopUntilAllTasksHaveCompleted(); - ResourceProvider::ResourceIdArray array; - for (const auto& resource : resources_) { - array.push_back(resource->id()); - } + std::vector<const ResourcePool::InUsePoolResource*> array; + for (const auto& resource : resources_) + array.push_back(&resource); + base::RunLoop run_loop; uint64_t callback_id = raster_buffer_provider_->SetReadyToDrawCallback( array, @@ -426,10 +433,9 @@ ScheduleTasks(); RunMessageLoopUntilAllTasksHaveCompleted(); - ResourceProvider::ResourceIdArray array; - for (const auto& resource : resources_) { - array.push_back(resource->id()); - } + std::vector<const ResourcePool::InUsePoolResource*> array; + for (const auto& resource : resources_) + array.push_back(&resource); uint64_t callback_id = raster_buffer_provider_->SetReadyToDrawCallback( array, base::Bind([]() {}), 0);
diff --git a/cc/raster/staging_buffer_pool.cc b/cc/raster/staging_buffer_pool.cc index 582af58b..4ffe040 100644 --- a/cc/raster/staging_buffer_pool.cc +++ b/cc/raster/staging_buffer_pool.cc
@@ -248,7 +248,8 @@ } std::unique_ptr<StagingBuffer> StagingBufferPool::AcquireStagingBuffer( - const Resource* resource, + const gfx::Size& size, + viz::ResourceFormat format, uint64_t previous_content_id) { base::AutoLock lock(lock_); @@ -310,12 +311,11 @@ // Find staging buffer of correct size and format. if (!staging_buffer) { - StagingBufferDeque::iterator it = - std::find_if(free_buffers_.begin(), free_buffers_.end(), - [resource](const std::unique_ptr<StagingBuffer>& buffer) { - return buffer->size == resource->size() && - buffer->format == resource->format(); - }); + StagingBufferDeque::iterator it = std::find_if( + free_buffers_.begin(), free_buffers_.end(), + [&size, format](const std::unique_ptr<StagingBuffer>& buffer) { + return buffer->size == size && buffer->format == format; + }); if (it != free_buffers_.end()) { staging_buffer = std::move(*it); free_buffers_.erase(it); @@ -325,9 +325,8 @@ // Create new staging buffer if necessary. if (!staging_buffer) { - staging_buffer = - std::make_unique<StagingBuffer>(resource->size(), resource->format()); - AddStagingBuffer(staging_buffer.get(), resource->format()); + staging_buffer = std::make_unique<StagingBuffer>(size, format); + AddStagingBuffer(staging_buffer.get(), format); } // Release enough free buffers to stay within the limit.
diff --git a/cc/raster/staging_buffer_pool.h b/cc/raster/staging_buffer_pool.h index 25db0e7..559657f 100644 --- a/cc/raster/staging_buffer_pool.h +++ b/cc/raster/staging_buffer_pool.h
@@ -31,7 +31,6 @@ } // namespace viz namespace cc { -class Resource; struct StagingBuffer { StagingBuffer(const gfx::Size& size, viz::ResourceFormat format); @@ -70,7 +69,8 @@ base::trace_event::ProcessMemoryDump* pmd) override; std::unique_ptr<StagingBuffer> AcquireStagingBuffer( - const Resource* resource, + const gfx::Size& size, + viz::ResourceFormat format, uint64_t previous_content_id); void ReleaseStagingBuffer(std::unique_ptr<StagingBuffer> staging_buffer);
diff --git a/cc/raster/zero_copy_raster_buffer_provider.cc b/cc/raster/zero_copy_raster_buffer_provider.cc index 49ef21e..4cff236 100644 --- a/cc/raster/zero_copy_raster_buffer_provider.cc +++ b/cc/raster/zero_copy_raster_buffer_provider.cc
@@ -25,9 +25,12 @@ class ZeroCopyRasterBufferImpl : public RasterBuffer { public: - ZeroCopyRasterBufferImpl(LayerTreeResourceProvider* resource_provider, - const Resource* resource) - : lock_(resource_provider, resource->id()), resource_(resource) {} + ZeroCopyRasterBufferImpl( + LayerTreeResourceProvider* resource_provider, + const ResourcePool::InUsePoolResource& in_use_resource) + : lock_(resource_provider, in_use_resource.gpu_backing_resource_id()), + resource_size_(in_use_resource.size()), + resource_format_(in_use_resource.format()) {} // Overridden from RasterBuffer: void Playback( @@ -51,15 +54,16 @@ // TODO(danakj): Implement partial raster with raster_dirty_rect. RasterBufferProvider::PlaybackToMemory( - buffer->memory(0), resource_->format(), resource_->size(), - buffer->stride(0), raster_source, raster_full_rect, raster_full_rect, - transform, lock_.color_space_for_raster(), playback_settings); + buffer->memory(0), resource_format_, resource_size_, buffer->stride(0), + raster_source, raster_full_rect, raster_full_rect, transform, + lock_.color_space_for_raster(), playback_settings); buffer->Unmap(); } private: LayerTreeResourceProvider::ScopedWriteLockGpuMemoryBuffer lock_; - const Resource* resource_; + gfx::Size resource_size_; + viz::ResourceFormat resource_format_; DISALLOW_COPY_AND_ASSIGN(ZeroCopyRasterBufferImpl); }; @@ -85,11 +89,11 @@ std::unique_ptr<RasterBuffer> ZeroCopyRasterBufferProvider::AcquireBufferForRaster( - const Resource* resource, + const ResourcePool::InUsePoolResource& resource, uint64_t resource_content_id, uint64_t previous_content_id) { - return base::WrapUnique<RasterBuffer>( - new ZeroCopyRasterBufferImpl(resource_provider_, resource)); + return std::make_unique<ZeroCopyRasterBufferImpl>(resource_provider_, + resource); } void ZeroCopyRasterBufferProvider::OrderingBarrier() { @@ -120,13 +124,13 @@ } bool ZeroCopyRasterBufferProvider::IsResourceReadyToDraw( - viz::ResourceId resource_id) const { + const ResourcePool::InUsePoolResource& resource) const { // Zero-copy resources are immediately ready to draw. return true; } uint64_t ZeroCopyRasterBufferProvider::SetReadyToDrawCallback( - const ResourceProvider::ResourceIdArray& resource_ids, + const std::vector<const ResourcePool::InUsePoolResource*>& resources, const base::Closure& callback, uint64_t pending_callback_id) const { // Zero-copy resources are immediately ready to draw.
diff --git a/cc/raster/zero_copy_raster_buffer_provider.h b/cc/raster/zero_copy_raster_buffer_provider.h index 7ddf8f1..d78e24c109 100644 --- a/cc/raster/zero_copy_raster_buffer_provider.h +++ b/cc/raster/zero_copy_raster_buffer_provider.h
@@ -31,7 +31,7 @@ // Overridden from RasterBufferProvider: std::unique_ptr<RasterBuffer> AcquireBufferForRaster( - const Resource* resource, + const ResourcePool::InUsePoolResource& resource, uint64_t resource_content_id, uint64_t previous_content_id) override; void OrderingBarrier() override; @@ -39,9 +39,10 @@ viz::ResourceFormat GetResourceFormat(bool must_support_alpha) const override; bool IsResourceSwizzleRequired(bool must_support_alpha) const override; bool CanPartialRasterIntoProvidedResource() const override; - bool IsResourceReadyToDraw(viz::ResourceId id) const override; + bool IsResourceReadyToDraw( + const ResourcePool::InUsePoolResource& resource) const override; uint64_t SetReadyToDrawCallback( - const ResourceProvider::ResourceIdArray& resource_ids, + const std::vector<const ResourcePool::InUsePoolResource*>& resources, const base::Closure& callback, uint64_t pending_callback_id) const override; void Shutdown() override;
diff --git a/cc/resources/resource_pool.cc b/cc/resources/resource_pool.cc index 3b2a05d..bcc07aa4 100644 --- a/cc/resources/resource_pool.cc +++ b/cc/resources/resource_pool.cc
@@ -58,32 +58,6 @@ constexpr base::TimeDelta ResourcePool::kDefaultExpirationDelay; -void ResourcePool::PoolResource::OnMemoryDump( - base::trace_event::ProcessMemoryDump* pmd, - const LayerTreeResourceProvider* resource_provider, - bool is_free) const { - // Resource IDs are not process-unique, so log with the - // LayerTreeResourceProvider's unique id. - std::string parent_node = - base::StringPrintf("cc/resource_memory/provider_%d/resource_%d", - resource_provider->tracing_id(), id()); - - std::string dump_name = - base::StringPrintf("cc/tile_memory/provider_%d/resource_%d", - resource_provider->tracing_id(), id()); - MemoryAllocatorDump* dump = pmd->CreateAllocatorDump(dump_name); - pmd->AddSuballocation(dump->guid(), parent_node); - - uint64_t total_bytes = - ResourceUtil::UncheckedSizeInBytesAligned<size_t>(size(), format()); - dump->AddScalar(MemoryAllocatorDump::kNameSize, - MemoryAllocatorDump::kUnitsBytes, total_bytes); - - if (is_free) { - dump->AddScalar("free_size", MemoryAllocatorDump::kUnitsBytes, total_bytes); - } -} - ResourcePool::ResourcePool( LayerTreeResourceProvider* resource_provider, scoped_refptr<base::SingleThreadTaskRunner> task_runner, @@ -161,16 +135,17 @@ DCHECK_EQ(0u, total_resource_count_); } -Resource* ResourcePool::ReuseResource(const gfx::Size& size, - viz::ResourceFormat format, - const gfx::ColorSpace& color_space) { +ResourcePool::PoolResource* ResourcePool::ReuseResource( + const gfx::Size& size, + viz::ResourceFormat format, + const gfx::ColorSpace& color_space) { // Finding resources in |unused_resources_| from MRU to LRU direction, touches // LRU resources only if needed, which increases possibility of expiring more // LRU resources within kResourceExpirationDelayMs. - for (ResourceDeque::iterator it = unused_resources_.begin(); - it != unused_resources_.end(); ++it) { - ScopedResource* resource = it->get(); - DCHECK(resource_provider_->CanLockForWrite(resource->id())); + for (auto it = unused_resources_.begin(); it != unused_resources_.end(); + ++it) { + PoolResource* resource = it->get(); + DCHECK(resource_provider_->CanLockForWrite(resource->resource_id())); if (resource->format() != format) continue; @@ -181,7 +156,7 @@ continue; // Transfer resource to |in_use_resources_|. - in_use_resources_[resource->id()] = std::move(*it); + in_use_resources_[resource->unique_id()] = std::move(*it); unused_resources_.erase(it); in_use_memory_usage_bytes_ += ResourceUtil::UncheckedSizeInBytes<size_t>( resource->size(), resource->format()); @@ -190,48 +165,47 @@ return nullptr; } -Resource* ResourcePool::CreateResource(const gfx::Size& size, - viz::ResourceFormat format, - const gfx::ColorSpace& color_space) { - std::unique_ptr<PoolResource> pool_resource = - PoolResource::Create(resource_provider_); +ResourcePool::PoolResource* ResourcePool::CreateResource( + const gfx::Size& size, + viz::ResourceFormat format, + const gfx::ColorSpace& color_space) { + DCHECK(ResourceUtil::VerifySizeInBytes<size_t>(size, format)); + viz::ResourceId resource_id; if (use_gpu_memory_buffers_) { - pool_resource->AllocateGpuMemoryBuffer(size, format, usage_, color_space); + resource_id = resource_provider_->CreateGpuMemoryBufferResource( + size, viz::ResourceTextureHint::kDefault, format, usage_, color_space); } else if (use_gpu_resources_) { - pool_resource->AllocateGpuTexture(size, hint_, format, color_space); + resource_id = resource_provider_->CreateGpuTextureResource( + size, hint_, format, color_space); } else { DCHECK_EQ(format, viz::RGBA_8888); - pool_resource->AllocateSoftware(size, color_space); + resource_id = resource_provider_->CreateBitmapResource(size, color_space); } + auto pool_resource = std::make_unique<PoolResource>( + next_resource_unique_id_++, size, format, color_space, resource_id); - DCHECK(ResourceUtil::VerifySizeInBytes<size_t>(pool_resource->size(), - pool_resource->format())); - total_memory_usage_bytes_ += ResourceUtil::UncheckedSizeInBytes<size_t>( - pool_resource->size(), pool_resource->format()); + total_memory_usage_bytes_ += + ResourceUtil::UncheckedSizeInBytes<size_t>(size, format); ++total_resource_count_; - // Clear the invalidated rect and content ID, as we are about to raster new - // content. These will be re-set when rasterization completes successfully. - pool_resource->set_invalidated_rect(gfx::Rect()); - pool_resource->set_content_id(0); - - Resource* resource = pool_resource.get(); - in_use_resources_[resource->id()] = std::move(pool_resource); - in_use_memory_usage_bytes_ += ResourceUtil::UncheckedSizeInBytes<size_t>( - resource->size(), resource->format()); + PoolResource* resource = pool_resource.get(); + in_use_resources_[resource->unique_id()] = std::move(pool_resource); + in_use_memory_usage_bytes_ += + ResourceUtil::UncheckedSizeInBytes<size_t>(size, format); return resource; } -Resource* ResourcePool::AcquireResource(const gfx::Size& size, - viz::ResourceFormat format, - const gfx::ColorSpace& color_space) { - Resource* reused_resource = ReuseResource(size, format, color_space); - if (reused_resource) - return reused_resource; - - return CreateResource(size, format, color_space); +ResourcePool::InUsePoolResource ResourcePool::AcquireResource( + const gfx::Size& size, + viz::ResourceFormat format, + const gfx::ColorSpace& color_space) { + PoolResource* resource = ReuseResource(size, format, color_space); + if (!resource) + resource = CreateResource(size, format, color_space); + return InUsePoolResource(resource, + use_gpu_resources_ || use_gpu_memory_buffers_); } // Iterate over all three resource lists (unused, in-use, and busy), updating @@ -244,7 +218,8 @@ // invalidations can can be used safely. Note that we could improve raster // performance at the cost of search time if we found the resource with the // smallest invalidation ID to raster in to. -Resource* ResourcePool::TryAcquireResourceForPartialRaster( +ResourcePool::InUsePoolResource +ResourcePool::TryAcquireResourceForPartialRaster( uint64_t new_content_id, const gfx::Rect& new_invalidated_rect, uint64_t previous_content_id, @@ -253,7 +228,7 @@ DCHECK(previous_content_id); *total_invalidated_rect = gfx::Rect(); - ResourceDeque::iterator resource_to_return = unused_resources_.end(); + auto iter_resource_to_return = unused_resources_.end(); int minimum_area = 0; // First update all unused resources. While updating, track the resource with @@ -267,9 +242,9 @@ // Return the resource with the smallest invalidation. int area = resource->invalidated_rect().size().GetArea(); - if (resource_to_return == unused_resources_.end() || + if (iter_resource_to_return == unused_resources_.end() || area < minimum_area) { - resource_to_return = it; + iter_resource_to_return = it; minimum_area = area; } } @@ -292,13 +267,14 @@ // If we found an unused resource to return earlier, move it to // |in_use_resources_| and return it. - if (resource_to_return != unused_resources_.end()) { - PoolResource* resource = resource_to_return->get(); - DCHECK(resource_provider_->CanLockForWrite(resource->id())); + if (iter_resource_to_return != unused_resources_.end()) { + PoolResource* resource = iter_resource_to_return->get(); + DCHECK(resource_provider_->CanLockForWrite(resource->resource_id())); // Transfer resource to |in_use_resources_|. - in_use_resources_[resource->id()] = std::move(*resource_to_return); - unused_resources_.erase(resource_to_return); + in_use_resources_[resource->unique_id()] = + std::move(*iter_resource_to_return); + unused_resources_.erase(iter_resource_to_return); in_use_memory_usage_bytes_ += ResourceUtil::UncheckedSizeInBytes<size_t>( resource->size(), resource->format()); *total_invalidated_rect = resource->invalidated_rect(); @@ -307,20 +283,23 @@ // These will be updated when raster completes successfully. resource->set_invalidated_rect(gfx::Rect()); resource->set_content_id(0); - return resource; + return InUsePoolResource(resource, + use_gpu_resources_ || use_gpu_memory_buffers_); } - return nullptr; + return InUsePoolResource(); } -void ResourcePool::ReleaseResource(Resource* resource) { +void ResourcePool::ReleaseResource(InUsePoolResource in_use_resource) { + PoolResource* pool_resource = in_use_resource.resource_; + in_use_resource.SetWasFreedByResourcePool(); + // Ensure that the provided resource is valid. // TODO(ericrk): Remove this once we've investigated further. // crbug.com/598286. - CHECK(resource); - CHECK(resource->id()); + CHECK(pool_resource); - auto it = in_use_resources_.find(resource->id()); + auto it = in_use_resources_.find(pool_resource->unique_id()); if (it == in_use_resources_.end()) { // We should never hit this. Do some digging to try to determine the cause. // TODO(ericrk): Remove this once we've investigated further. @@ -330,16 +309,16 @@ // list. auto found_busy = std::find_if( busy_resources_.begin(), busy_resources_.end(), - [resource](const std::unique_ptr<PoolResource>& busy_resource) { - return busy_resource->id() == resource->id(); + [pool_resource](const std::unique_ptr<PoolResource>& busy_resource) { + return busy_resource->unique_id() == pool_resource->unique_id(); }); CHECK(found_busy == busy_resources_.end()); // Also check if the resource exists in our unused resources list. auto found_unused = std::find_if( unused_resources_.begin(), unused_resources_.end(), - [resource](const std::unique_ptr<PoolResource>& pool_resource) { - return pool_resource->id() == resource->id(); + [pool_resource](const std::unique_ptr<PoolResource>& unused_resource) { + return unused_resource->unique_id() == pool_resource->unique_id(); }); CHECK(found_unused == unused_resources_.end()); @@ -352,7 +331,6 @@ // crbug.com/598286. CHECK(it->second.get()); - PoolResource* pool_resource = it->second.get(); pool_resource->set_last_usage(base::TimeTicks::Now()); // Transfer resource to |busy_resources_|. @@ -366,12 +344,13 @@ ScheduleEvictExpiredResourcesIn(resource_expiration_delay_); } -void ResourcePool::OnContentReplaced(viz::ResourceId resource_id, - uint64_t content_id) { - auto found = in_use_resources_.find(resource_id); - DCHECK(found != in_use_resources_.end()); - found->second->set_content_id(content_id); - found->second->set_invalidated_rect(gfx::Rect()); +void ResourcePool::OnContentReplaced( + const ResourcePool::InUsePoolResource& in_use_resource, + uint64_t content_id) { + PoolResource* resource = in_use_resource.resource_; + DCHECK(resource); + resource->set_content_id(content_id); + resource->set_invalidated_rect(gfx::Rect()); } void ResourcePool::SetResourceUsageLimits(size_t max_memory_usage_bytes, @@ -411,6 +390,7 @@ resource->size(), resource->format()); total_memory_usage_bytes_ -= resource_bytes; --total_resource_count_; + resource_provider_->DeleteResource(resource->resource_id()); } void ResourcePool::UpdateResourceContentIdAndInvalidation( @@ -426,19 +406,18 @@ } void ResourcePool::CheckBusyResources() { - for (size_t i = 0; i < busy_resources_.size();) { - ResourceDeque::iterator it(busy_resources_.begin() + i); + for (auto it = busy_resources_.begin(); it != busy_resources_.end();) { PoolResource* resource = it->get(); - if (resource_provider_->CanLockForWrite(resource->id())) { + if (resource_provider_->CanLockForWrite(resource->resource_id())) { DidFinishUsingResource(std::move(*it)); - busy_resources_.erase(it); - } else if (resource_provider_->IsLost(resource->id())) { + it = busy_resources_.erase(it); + } else if (resource_provider_->IsLost(resource->resource_id())) { // Remove lost resources from pool. DeleteResource(std::move(*it)); - busy_resources_.erase(it); + it = busy_resources_.erase(it); } else { - ++i; + ++it; } } } @@ -544,4 +523,43 @@ EvictResourcesNotUsedSince(base::TimeTicks() + base::TimeDelta::Max()); } +ResourcePool::PoolResource::PoolResource(size_t unique_id, + const gfx::Size& size, + viz::ResourceFormat format, + const gfx::ColorSpace& color_space, + viz::ResourceId resource_id) + : unique_id_(unique_id), + size_(size), + format_(format), + color_space_(color_space), + resource_id_(resource_id) {} + +ResourcePool::PoolResource::~PoolResource() = default; + +void ResourcePool::PoolResource::OnMemoryDump( + base::trace_event::ProcessMemoryDump* pmd, + const LayerTreeResourceProvider* resource_provider, + bool is_free) const { + // Resource IDs are not process-unique, so log with the + // LayerTreeResourceProvider's unique id. + std::string parent_node = + base::StringPrintf("cc/resource_memory/provider_%d/resource_%d", + resource_provider->tracing_id(), resource_id_); + + std::string dump_name = + base::StringPrintf("cc/tile_memory/provider_%d/resource_%d", + resource_provider->tracing_id(), resource_id_); + MemoryAllocatorDump* dump = pmd->CreateAllocatorDump(dump_name); + pmd->AddSuballocation(dump->guid(), parent_node); + + uint64_t total_bytes = + ResourceUtil::UncheckedSizeInBytesAligned<size_t>(size_, format_); + dump->AddScalar(MemoryAllocatorDump::kNameSize, + MemoryAllocatorDump::kUnitsBytes, total_bytes); + + if (is_free) { + dump->AddScalar("free_size", MemoryAllocatorDump::kUnitsBytes, total_bytes); + } +} + } // namespace cc
diff --git a/cc/resources/resource_pool.h b/cc/resources/resource_pool.h index 6a06bb6..687155b 100644 --- a/cc/resources/resource_pool.h +++ b/cc/resources/resource_pool.h
@@ -16,6 +16,7 @@ #include "base/memory/memory_coordinator_client.h" #include "base/memory/ptr_util.h" #include "base/memory/weak_ptr.h" +#include "base/optional.h" #include "base/trace_event/memory_dump_provider.h" #include "cc/cc_export.h" #include "cc/resources/resource.h" @@ -31,11 +32,69 @@ class CC_EXPORT ResourcePool : public base::trace_event::MemoryDumpProvider, public base::MemoryCoordinatorClient { + class PoolResource; + public: // Delay before a resource is considered expired. static constexpr base::TimeDelta kDefaultExpirationDelay = base::TimeDelta::FromSeconds(5); + // Scoped move-only object returned when getting a resource from the pool. + // Ownership must be given back to the pool to release the resource. + class InUsePoolResource { + public: + InUsePoolResource() = default; + ~InUsePoolResource() { + DCHECK(!resource_) << "Must be returned to ResourcePool to be freed."; + } + + InUsePoolResource(InUsePoolResource&& other) { + is_gpu_ = other.is_gpu_; + resource_ = other.resource_; + other.resource_ = nullptr; + } + InUsePoolResource& operator=(InUsePoolResource&& other) { + is_gpu_ = other.is_gpu_; + resource_ = other.resource_; + other.resource_ = nullptr; + return *this; + } + + InUsePoolResource(const InUsePoolResource&) = delete; + InUsePoolResource& operator=(const InUsePoolResource&) = delete; + + explicit operator bool() const { return !!resource_; } + + const gfx::Size& size() const { return resource_->size(); } + const viz::ResourceFormat& format() const { return resource_->format(); } + // The ResourceId when the backing is given to the ResourceProvider for + // export to the display compositor. + const viz::ResourceId& resource_id_for_export() const { + return resource_->resource_id(); + } + + // Only valid when the ResourcePool is vending software-backed resources. + const viz::ResourceId& software_backing_resource_id() const { + DCHECK(!is_gpu_); + return resource_->resource_id(); + } + + // Only valid when the ResourcePool is vending gpu-backed resources. + const viz::ResourceId& gpu_backing_resource_id() const { + DCHECK(is_gpu_); + return resource_->resource_id(); + } + + private: + friend ResourcePool; + explicit InUsePoolResource(PoolResource* resource, bool is_gpu) + : is_gpu_(is_gpu), resource_(resource) {} + void SetWasFreedByResourcePool() { resource_ = nullptr; } + + bool is_gpu_ = false; + PoolResource* resource_ = nullptr; + }; + // Constructor for creating Gpu memory buffer resources. ResourcePool(LayerTreeResourceProvider* resource_provider, scoped_refptr<base::SingleThreadTaskRunner> task_runner, @@ -59,14 +118,14 @@ ~ResourcePool() override; // Tries to reuse a resource. If none are available, makes a new one. - Resource* AcquireResource(const gfx::Size& size, - viz::ResourceFormat format, - const gfx::ColorSpace& color_space); + InUsePoolResource AcquireResource(const gfx::Size& size, + viz::ResourceFormat format, + const gfx::ColorSpace& color_space); // Tries to acquire the resource with |previous_content_id| for us in partial // raster. If successful, this function will retun the invalidated rect which // must be re-rastered in |total_invalidated_rect|. - Resource* TryAcquireResourceForPartialRaster( + InUsePoolResource TryAcquireResourceForPartialRaster( uint64_t new_content_id, const gfx::Rect& new_invalidated_rect, uint64_t previous_content_id, @@ -74,8 +133,9 @@ // Called when a resource's content has been fully replaced (and is completely // valid). Updates the resource's content ID to its new value. - void OnContentReplaced(viz::ResourceId resource_id, uint64_t content_id); - void ReleaseResource(Resource* resource); + void OnContentReplaced(const ResourcePool::InUsePoolResource& in_use_resource, + uint64_t content_id); + void ReleaseResource(InUsePoolResource resource); void SetResourceUsageLimits(size_t max_memory_usage_bytes, size_t max_resource_count); @@ -112,15 +172,20 @@ private: FRIEND_TEST_ALL_PREFIXES(ResourcePoolTest, ReuseResource); FRIEND_TEST_ALL_PREFIXES(ResourcePoolTest, ExactRequestsRespected); - class PoolResource : public ScopedResource { + class PoolResource { public: - static std::unique_ptr<PoolResource> Create( - LayerTreeResourceProvider* resource_provider) { - return base::WrapUnique(new PoolResource(resource_provider)); - } - void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd, - const LayerTreeResourceProvider* resource_provider, - bool is_free) const; + PoolResource(size_t unique_id, + const gfx::Size& size, + viz::ResourceFormat format, + const gfx::ColorSpace& color_space, + viz::ResourceId resource_id); + ~PoolResource(); + + size_t unique_id() const { return unique_id_; } + const gfx::Size& size() const { return size_; } + const viz::ResourceFormat& format() const { return format_; } + const gfx::ColorSpace& color_space() const { return color_space_; } + const viz::ResourceId& resource_id() const { return resource_id_; } uint64_t content_id() const { return content_id_; } void set_content_id(uint64_t content_id) { content_id_ = content_id; } @@ -128,28 +193,39 @@ base::TimeTicks last_usage() const { return last_usage_; } void set_last_usage(base::TimeTicks time) { last_usage_ = time; } - gfx::Rect invalidated_rect() const { return invalidated_rect_; } + const gfx::Rect& invalidated_rect() const { return invalidated_rect_; } void set_invalidated_rect(const gfx::Rect& invalidated_rect) { invalidated_rect_ = invalidated_rect; } + void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd, + const LayerTreeResourceProvider* resource_provider, + bool is_free) const; + private: - explicit PoolResource(LayerTreeResourceProvider* resource_provider) - : ScopedResource(resource_provider), content_id_(0) {} - uint64_t content_id_; + const size_t unique_id_; + const gfx::Size size_; + const viz::ResourceFormat format_; + const gfx::ColorSpace color_space_; + + uint64_t content_id_ = 0; base::TimeTicks last_usage_; gfx::Rect invalidated_rect_; + + viz::ResourceId resource_id_; + // TODO(crbug.com/730660): Own a backing for software resources here, + // instead of owning it through the |resource_id_|. }; // Tries to reuse a resource. Returns |nullptr| if none are available. - Resource* ReuseResource(const gfx::Size& size, - viz::ResourceFormat format, - const gfx::ColorSpace& color_space); + PoolResource* ReuseResource(const gfx::Size& size, + viz::ResourceFormat format, + const gfx::ColorSpace& color_space); // Creates a new resource without trying to reuse an old one. - Resource* CreateResource(const gfx::Size& size, - viz::ResourceFormat format, - const gfx::ColorSpace& color_space); + PoolResource* CreateResource(const gfx::Size& size, + viz::ResourceFormat format, + const gfx::ColorSpace& color_space); void DidFinishUsingResource(std::unique_ptr<PoolResource> resource); void DeleteResource(std::unique_ptr<PoolResource> resource); @@ -165,30 +241,29 @@ bool HasEvictableResources() const; base::TimeTicks GetUsageTimeForLRUResource() const; - LayerTreeResourceProvider* resource_provider_ = nullptr; - bool use_gpu_resources_ = false; - bool use_gpu_memory_buffers_ = false; - gfx::BufferUsage usage_ = gfx::BufferUsage::GPU_READ_CPU_READ_WRITE; - viz::ResourceTextureHint hint_ = viz::ResourceTextureHint::kDefault; + LayerTreeResourceProvider* const resource_provider_ = nullptr; + const bool use_gpu_resources_ = false; + const bool use_gpu_memory_buffers_ = false; + const gfx::BufferUsage usage_ = gfx::BufferUsage::GPU_READ_CPU_READ_WRITE; + const viz::ResourceTextureHint hint_ = viz::ResourceTextureHint::kDefault; + const scoped_refptr<base::SingleThreadTaskRunner> task_runner_; + const base::TimeDelta resource_expiration_delay_; + const bool disallow_non_exact_reuse_ = false; + + size_t next_resource_unique_id_ = 1; size_t max_memory_usage_bytes_ = 0; size_t max_resource_count_ = 0; size_t in_use_memory_usage_bytes_ = 0; size_t total_memory_usage_bytes_ = 0; size_t total_resource_count_ = 0; + bool evict_expired_resources_pending_ = false; // Holds most recently used resources at the front of the queue. - using ResourceDeque = base::circular_deque<std::unique_ptr<PoolResource>>; - ResourceDeque unused_resources_; - ResourceDeque busy_resources_; + base::circular_deque<std::unique_ptr<PoolResource>> unused_resources_; + base::circular_deque<std::unique_ptr<PoolResource>> busy_resources_; - using InUseResourceMap = - std::map<viz::ResourceId, std::unique_ptr<PoolResource>>; - InUseResourceMap in_use_resources_; - - scoped_refptr<base::SingleThreadTaskRunner> task_runner_; - bool evict_expired_resources_pending_ = false; - const base::TimeDelta resource_expiration_delay_; - bool disallow_non_exact_reuse_ = false; + // Map from the PoolResource |unique_id| to the PoolResource. + std::map<size_t, std::unique_ptr<PoolResource>> in_use_resources_; base::WeakPtrFactory<ResourcePool> weak_ptr_factory_;
diff --git a/cc/resources/resource_pool_unittest.cc b/cc/resources/resource_pool_unittest.cc index 8577927..c94c54e 100644 --- a/cc/resources/resource_pool_unittest.cc +++ b/cc/resources/resource_pool_unittest.cc
@@ -32,9 +32,9 @@ } protected: - void CheckAndReturnResource(Resource* resource) { - EXPECT_NE(nullptr, resource); - resource_pool_->ReleaseResource(resource); + void CheckAndReturnResource(ResourcePool::InUsePoolResource resource) { + EXPECT_TRUE(!!resource); + resource_pool_->ReleaseResource(std::move(resource)); resource_pool_->CheckBusyResources(); } @@ -48,13 +48,14 @@ gfx::Size size(100, 100); viz::ResourceFormat format = viz::RGBA_8888; gfx::ColorSpace color_space = gfx::ColorSpace::CreateSRGB(); - Resource* resource = + ResourcePool::InUsePoolResource resource = resource_pool_->AcquireResource(size, format, color_space); - EXPECT_EQ(size, resource->size()); - EXPECT_EQ(format, resource->format()); - EXPECT_TRUE(resource_provider_->CanLockForWrite(resource->id())); + EXPECT_EQ(size, resource.size()); + EXPECT_EQ(format, resource.format()); + EXPECT_TRUE( + resource_provider_->CanLockForWrite(resource.gpu_backing_resource_id())); - resource_pool_->ReleaseResource(resource); + resource_pool_->ReleaseResource(std::move(resource)); } TEST_F(ResourcePoolTest, AccountingSingleResource) { @@ -68,7 +69,7 @@ gfx::ColorSpace color_space = gfx::ColorSpace::CreateSRGB(); size_t resource_bytes = ResourceUtil::UncheckedSizeInBytes<size_t>(size, format); - Resource* resource = + ResourcePool::InUsePoolResource resource = resource_pool_->AcquireResource(size, format, color_space); EXPECT_EQ(resource_bytes, resource_pool_->GetTotalMemoryUsageForTesting()); @@ -77,7 +78,7 @@ EXPECT_EQ(1u, resource_pool_->resource_count()); EXPECT_EQ(0u, resource_pool_->GetBusyResourceCountForTesting()); - resource_pool_->ReleaseResource(resource); + resource_pool_->ReleaseResource(std::move(resource)); EXPECT_EQ(resource_bytes, resource_pool_->GetTotalMemoryUsageForTesting()); EXPECT_EQ(1u, resource_pool_->GetTotalResourceCountForTesting()); EXPECT_EQ(1u, resource_pool_->GetBusyResourceCountForTesting()); @@ -114,23 +115,23 @@ EXPECT_EQ(1u, resource_provider_->num_resources()); // Same size/format should re-use resource. - Resource* resource = + ResourcePool::InUsePoolResource resource = resource_pool_->AcquireResource(size, format, color_space1); EXPECT_EQ(1u, resource_provider_->num_resources()); - CheckAndReturnResource(resource); + CheckAndReturnResource(std::move(resource)); EXPECT_EQ(1u, resource_provider_->num_resources()); // Different size/format should allocate new resource. resource = resource_pool_->AcquireResource(gfx::Size(50, 50), viz::LUMINANCE_8, color_space1); EXPECT_EQ(2u, resource_provider_->num_resources()); - CheckAndReturnResource(resource); + CheckAndReturnResource(std::move(resource)); EXPECT_EQ(2u, resource_provider_->num_resources()); // Different color space should allocate new resource. resource = resource_pool_->AcquireResource(size, format, color_space2); EXPECT_EQ(3u, resource_provider_->num_resources()); - CheckAndReturnResource(resource); + CheckAndReturnResource(std::move(resource)); EXPECT_EQ(3u, resource_provider_->num_resources()); } @@ -144,12 +145,13 @@ viz::ResourceFormat format = viz::RGBA_8888; gfx::ColorSpace color_space = gfx::ColorSpace::CreateSRGB(); - Resource* resource = + ResourcePool::InUsePoolResource resource = resource_pool_->AcquireResource(size, format, color_space); EXPECT_EQ(1u, resource_provider_->num_resources()); - resource_provider_->LoseResourceForTesting(resource->id()); - resource_pool_->ReleaseResource(resource); + resource_provider_->LoseResourceForTesting( + resource.gpu_backing_resource_id()); + resource_pool_->ReleaseResource(std::move(resource)); resource_pool_->CheckBusyResources(); EXPECT_EQ(0u, resource_provider_->num_resources()); } @@ -171,13 +173,13 @@ viz::ResourceFormat format = viz::RGBA_8888; gfx::ColorSpace color_space; - Resource* resource = + ResourcePool::InUsePoolResource resource = resource_pool_->AcquireResource(size, format, color_space); EXPECT_EQ(1u, resource_provider_->num_resources()); EXPECT_EQ(40000u, resource_pool_->GetTotalMemoryUsageForTesting()); EXPECT_EQ(1u, resource_pool_->resource_count()); - resource_pool_->ReleaseResource(resource); + resource_pool_->ReleaseResource(std::move(resource)); EXPECT_EQ(1u, resource_provider_->num_resources()); EXPECT_EQ(40000u, resource_pool_->GetTotalMemoryUsageForTesting()); EXPECT_EQ(0u, resource_pool_->memory_usage_bytes()); @@ -212,14 +214,14 @@ viz::ResourceFormat format = viz::RGBA_8888; gfx::ColorSpace color_space; - Resource* resource = + ResourcePool::InUsePoolResource resource = resource_pool_->AcquireResource(size, format, color_space); EXPECT_EQ(1u, resource_provider_->num_resources()); EXPECT_EQ(40000u, resource_pool_->GetTotalMemoryUsageForTesting()); EXPECT_EQ(1u, resource_pool_->GetTotalResourceCountForTesting()); EXPECT_EQ(1u, resource_pool_->resource_count()); - resource_pool_->ReleaseResource(resource); + resource_pool_->ReleaseResource(std::move(resource)); EXPECT_EQ(1u, resource_provider_->num_resources()); EXPECT_EQ(40000u, resource_pool_->GetTotalMemoryUsageForTesting()); EXPECT_EQ(1u, resource_pool_->GetTotalResourceCountForTesting()); @@ -252,20 +254,21 @@ uint64_t new_content_id = 43; gfx::Rect new_invalidated_rect(20, 20, 10, 10); - Resource* resource = + ResourcePool::InUsePoolResource resource = resource_pool_->AcquireResource(size, format, color_space); - resource_pool_->OnContentReplaced(resource->id(), content_id); - resource_pool_->ReleaseResource(resource); + resource_pool_->OnContentReplaced(resource, content_id); + auto original_id = resource.gpu_backing_resource_id(); + resource_pool_->ReleaseResource(std::move(resource)); resource_pool_->CheckBusyResources(); // Ensure that we can retrieve the resource based on |content_id|. gfx::Rect invalidated_rect; - Resource* reacquired_resource = + ResourcePool::InUsePoolResource reacquired_resource = resource_pool_->TryAcquireResourceForPartialRaster( new_content_id, new_invalidated_rect, content_id, &invalidated_rect); - EXPECT_EQ(resource, reacquired_resource); + EXPECT_EQ(original_id, reacquired_resource.gpu_backing_resource_id()); EXPECT_EQ(new_invalidated_rect, invalidated_rect); - resource_pool_->ReleaseResource(reacquired_resource); + resource_pool_->ReleaseResource(std::move(reacquired_resource)); } TEST_F(ResourcePoolTest, UpdateContentIdAndInvalidatedRect) { @@ -278,28 +281,29 @@ gfx::Rect expected_total_invalidated_rect(20, 20, 15, 15); // Acquire a new resource with the first content id. - Resource* resource = + ResourcePool::InUsePoolResource resource = resource_pool_->AcquireResource(size, format, color_space); - resource_pool_->OnContentReplaced(resource->id(), content_ids[0]); + resource_pool_->OnContentReplaced(resource, content_ids[0]); + auto original_id = resource.gpu_backing_resource_id(); // Attempt to acquire this resource. It is in use, so its ID and invalidated // rect should be updated, but a new resource will be returned. gfx::Rect new_invalidated_rect; - Resource* reacquired_resource = + ResourcePool::InUsePoolResource reacquired_resource = resource_pool_->TryAcquireResourceForPartialRaster( content_ids[1], invalidated_rect, content_ids[0], &new_invalidated_rect); - EXPECT_EQ(nullptr, reacquired_resource); + EXPECT_FALSE(!!reacquired_resource); EXPECT_EQ(gfx::Rect(), new_invalidated_rect); // Release the original resource, returning it to the unused pool. - resource_pool_->ReleaseResource(resource); + resource_pool_->ReleaseResource(std::move(resource)); resource_pool_->CheckBusyResources(); // Ensure that we cannot retrieve a resource based on the original content id. reacquired_resource = resource_pool_->TryAcquireResourceForPartialRaster( content_ids[1], invalidated_rect, content_ids[0], &new_invalidated_rect); - EXPECT_EQ(nullptr, reacquired_resource); + EXPECT_FALSE(!!reacquired_resource); EXPECT_EQ(gfx::Rect(), new_invalidated_rect); // Ensure that we can retrieve the resource based on the second (updated) @@ -308,9 +312,9 @@ reacquired_resource = resource_pool_->TryAcquireResourceForPartialRaster( content_ids[2], second_invalidated_rect, content_ids[1], &total_invalidated_rect); - EXPECT_EQ(resource, reacquired_resource); + EXPECT_EQ(original_id, reacquired_resource.gpu_backing_resource_id()); EXPECT_EQ(expected_total_invalidated_rect, total_invalidated_rect); - resource_pool_->ReleaseResource(reacquired_resource); + resource_pool_->ReleaseResource(std::move(reacquired_resource)); } TEST_F(ResourcePoolTest, ReuseResource) { @@ -318,8 +322,10 @@ gfx::ColorSpace color_space = gfx::ColorSpace::CreateSRGB(); // Create unused resource with size 100x100. - CheckAndReturnResource( - resource_pool_->CreateResource(gfx::Size(100, 100), format, color_space)); + ResourcePool::InUsePoolResource original = + resource_pool_->AcquireResource(gfx::Size(100, 100), format, color_space); + auto original_id = original.gpu_backing_resource_id(); + CheckAndReturnResource(std::move(original)); // Try some cases that are too large, none should succeed. EXPECT_EQ(nullptr, resource_pool_->ReuseResource(gfx::Size(101, 100), format, @@ -346,12 +352,18 @@ // should succeed if non-exact requests are supported. Some platforms never // support these. if (resource_pool_->AllowsNonExactReUseForTesting()) { - CheckAndReturnResource( - resource_pool_->ReuseResource(gfx::Size(50, 100), format, color_space)); - CheckAndReturnResource( - resource_pool_->ReuseResource(gfx::Size(100, 50), format, color_space)); - CheckAndReturnResource( - resource_pool_->ReuseResource(gfx::Size(71, 71), format, color_space)); + ResourcePool::InUsePoolResource reused = resource_pool_->AcquireResource( + gfx::Size(50, 100), format, color_space); + EXPECT_EQ(original_id, reused.gpu_backing_resource_id()); + CheckAndReturnResource(std::move(reused)); + reused = resource_pool_->AcquireResource(gfx::Size(100, 50), format, + color_space); + EXPECT_EQ(original_id, reused.gpu_backing_resource_id()); + CheckAndReturnResource(std::move(reused)); + reused = + resource_pool_->AcquireResource(gfx::Size(71, 71), format, color_space); + EXPECT_EQ(original_id, reused.gpu_backing_resource_id()); + CheckAndReturnResource(std::move(reused)); } else { EXPECT_EQ(nullptr, resource_pool_->ReuseResource(gfx::Size(50, 100), format, color_space)); @@ -363,11 +375,11 @@ // 100x100 is an exact match and should succeed. A subsequent request for // the same size should fail (the resource is already in use). - Resource* resource = - resource_pool_->ReuseResource(gfx::Size(100, 100), format, color_space); + ResourcePool::InUsePoolResource resource = + resource_pool_->AcquireResource(gfx::Size(100, 100), format, color_space); EXPECT_EQ(nullptr, resource_pool_->ReuseResource(gfx::Size(100, 100), format, color_space)); - CheckAndReturnResource(resource); + CheckAndReturnResource(std::move(resource)); } TEST_F(ResourcePoolTest, MemoryStateSuspended) { @@ -379,7 +391,7 @@ gfx::Size size(100, 100); viz::ResourceFormat format = viz::RGBA_8888; gfx::ColorSpace color_space = gfx::ColorSpace::CreateSRGB(); - Resource* resource = + ResourcePool::InUsePoolResource resource = resource_pool_->AcquireResource(size, format, color_space); EXPECT_EQ(1u, resource_pool_->GetTotalResourceCountForTesting()); @@ -393,7 +405,7 @@ resource_pool_->OnMemoryStateChange(base::MemoryState::NORMAL); // Release the resource making it busy. - resource_pool_->ReleaseResource(resource); + resource_pool_->ReleaseResource(std::move(resource)); EXPECT_EQ(1u, resource_pool_->GetTotalResourceCountForTesting()); EXPECT_EQ(1u, resource_pool_->GetBusyResourceCountForTesting()); @@ -414,8 +426,8 @@ base::TimeDelta::FromMilliseconds(100), true); // Create unused resource with size 100x100. - CheckAndReturnResource( - resource_pool_->CreateResource(gfx::Size(100, 100), format, color_space)); + CheckAndReturnResource(resource_pool_->AcquireResource(gfx::Size(100, 100), + format, color_space)); // Try some cases that are smaller than 100x100, but within 2x area which // would typically allow reuse. Reuse should fail. @@ -428,11 +440,11 @@ // 100x100 is an exact match and should succeed. A subsequent request for // the same size should fail (the resource is already in use). - Resource* resource = - resource_pool_->ReuseResource(gfx::Size(100, 100), format, color_space); + ResourcePool::InUsePoolResource resource = + resource_pool_->AcquireResource(gfx::Size(100, 100), format, color_space); EXPECT_EQ(nullptr, resource_pool_->ReuseResource(gfx::Size(100, 100), format, color_space)); - CheckAndReturnResource(resource); + CheckAndReturnResource(std::move(resource)); } } // namespace cc
diff --git a/cc/test/fake_raster_buffer_provider.cc b/cc/test/fake_raster_buffer_provider.cc index 539f63c..ab6d3948 100644 --- a/cc/test/fake_raster_buffer_provider.cc +++ b/cc/test/fake_raster_buffer_provider.cc
@@ -12,7 +12,7 @@ std::unique_ptr<RasterBuffer> FakeRasterBufferProviderImpl::AcquireBufferForRaster( - const Resource* resource, + const ResourcePool::InUsePoolResource& resource, uint64_t resource_content_id, uint64_t previous_content_id) { return nullptr; @@ -38,12 +38,12 @@ } bool FakeRasterBufferProviderImpl::IsResourceReadyToDraw( - viz::ResourceId resource_id) const { + const ResourcePool::InUsePoolResource& resource) const { return true; } uint64_t FakeRasterBufferProviderImpl::SetReadyToDrawCallback( - const ResourceProvider::ResourceIdArray& resource_ids, + const std::vector<const ResourcePool::InUsePoolResource*>& resources, const base::Callback<void()>& callback, uint64_t pending_callback_id) const { return 0;
diff --git a/cc/test/fake_raster_buffer_provider.h b/cc/test/fake_raster_buffer_provider.h index e68c6a9a..e194873 100644 --- a/cc/test/fake_raster_buffer_provider.h +++ b/cc/test/fake_raster_buffer_provider.h
@@ -17,7 +17,7 @@ // RasterBufferProvider methods. std::unique_ptr<RasterBuffer> AcquireBufferForRaster( - const Resource* resource, + const ResourcePool::InUsePoolResource& resource, uint64_t resource_content_id, uint64_t previous_content_id) override; void OrderingBarrier() override; @@ -25,9 +25,10 @@ viz::ResourceFormat GetResourceFormat(bool must_support_alpha) const override; bool IsResourceSwizzleRequired(bool must_support_alpha) const override; bool CanPartialRasterIntoProvidedResource() const override; - bool IsResourceReadyToDraw(viz::ResourceId id) const override; + bool IsResourceReadyToDraw( + const ResourcePool::InUsePoolResource& resource) const override; uint64_t SetReadyToDrawCallback( - const ResourceProvider::ResourceIdArray& resource_ids, + const std::vector<const ResourcePool::InUsePoolResource*>& resources, const base::Callback<void()>& callback, uint64_t pending_callback_id) const override; void Shutdown() override;
diff --git a/cc/tiles/tile.cc b/cc/tiles/tile.cc index f0d076e..1dd6367 100644 --- a/cc/tiles/tile.cc +++ b/cc/tiles/tile.cc
@@ -82,7 +82,7 @@ // We can use UncheckedSizeInBytes, since the tile size is determined by the // compositor. return ResourceUtil::UncheckedSizeInBytes<size_t>( - draw_info_.resource_->size(), draw_info_.resource_->format()); + draw_info_.resource_size(), draw_info_.resource_format()); } return 0; }
diff --git a/cc/tiles/tile_draw_info.cc b/cc/tiles/tile_draw_info.cc index d27059f..0e51c2b2 100644 --- a/cc/tiles/tile_draw_info.cc +++ b/cc/tiles/tile_draw_info.cc
@@ -20,10 +20,32 @@ mode_ == SOLID_COLOR_MODE && !SkColorGetA(solid_color_)); } -Resource* TileDrawInfo::TakeResource() { - Resource* resource = resource_; - set_resource(nullptr, false); - return resource; +void TileDrawInfo::SetResource(ResourcePool::InUsePoolResource resource, + bool resource_is_checker_imaged, + bool contents_swizzled) { + DCHECK(!resource_); + DCHECK(resource); + + mode_ = RESOURCE_MODE; + is_resource_ready_to_draw_ = false; + resource_is_checker_imaged_ = resource_is_checker_imaged; + contents_swizzled_ = contents_swizzled; + resource_ = std::move(resource); +} + +const ResourcePool::InUsePoolResource& TileDrawInfo::GetResource() { + DCHECK_EQ(mode_, RESOURCE_MODE); + DCHECK(resource_); + return resource_; +} + +ResourcePool::InUsePoolResource TileDrawInfo::TakeResource() { + DCHECK_EQ(mode_, RESOURCE_MODE); + DCHECK(resource_); + is_resource_ready_to_draw_ = false; + resource_is_checker_imaged_ = false; + contents_swizzled_ = false; + return std::move(resource_); } } // namespace cc
diff --git a/cc/tiles/tile_draw_info.h b/cc/tiles/tile_draw_info.h index a812c1c..5ae3cbe0 100644 --- a/cc/tiles/tile_draw_info.h +++ b/cc/tiles/tile_draw_info.h
@@ -8,10 +8,10 @@ #include <memory> #include "base/trace_event/trace_event_argument.h" -#include "cc/resources/resource_provider.h" -#include "cc/resources/scoped_resource.h" +#include "cc/resources/resource_pool.h" #include "components/viz/common/resources/platform_color.h" #include "components/viz/common/resources/resource_format_utils.h" +#include "third_party/skia/include/core/SkColor.h" namespace cc { @@ -49,16 +49,22 @@ return false; } - viz::ResourceId resource_id() const { + viz::ResourceId resource_id_for_export() const { DCHECK(mode_ == RESOURCE_MODE); DCHECK(resource_); - return resource_->id(); + return resource_.resource_id_for_export(); } const gfx::Size& resource_size() const { DCHECK(mode_ == RESOURCE_MODE); DCHECK(resource_); - return resource_->size(); + return resource_.size(); + } + + const viz::ResourceFormat& resource_format() const { + DCHECK(mode_ == RESOURCE_MODE); + DCHECK(resource_); + return resource_.format(); } SkColor solid_color() const { @@ -74,8 +80,10 @@ inline bool has_resource() const { return !!resource_; } + const ResourcePool::InUsePoolResource& GetResource(); + inline bool has_compressed_resource() const { - return resource_ ? IsResourceFormatCompressed(resource_->format()) : false; + return resource_ ? IsResourceFormatCompressed(resource_.format()) : false; } bool is_checker_imaged() const { @@ -91,25 +99,17 @@ friend class Tile; friend class TileManager; - const Resource* resource() const { return resource_; } - - void set_resource(Resource* resource, bool resource_is_checker_imaged) { - DCHECK(!resource_is_checker_imaged || resource) - << "Need to have a resource for it to be checker-imaged"; - - mode_ = RESOURCE_MODE; - is_resource_ready_to_draw_ = false; - resource_is_checker_imaged_ = resource_is_checker_imaged; - resource_ = resource; - } + void SetResource(ResourcePool::InUsePoolResource resource, + bool resource_is_checker_imaged, + bool contents_swizzled); + ResourcePool::InUsePoolResource TakeResource(); void set_resource_ready_for_draw() { is_resource_ready_to_draw_ = true; } - Resource* TakeResource(); - void set_solid_color(const SkColor& color) { + DCHECK(!resource_); mode_ = SOLID_COLOR_MODE; solid_color_ = color; } @@ -118,7 +118,7 @@ Mode mode_ = RESOURCE_MODE; SkColor solid_color_ = SK_ColorWHITE; - Resource* resource_ = nullptr; + ResourcePool::InUsePoolResource resource_; bool contents_swizzled_ = false; bool is_resource_ready_to_draw_ = false;
diff --git a/cc/tiles/tile_manager.cc b/cc/tiles/tile_manager.cc index 5a1e7f4..cf3835f 100644 --- a/cc/tiles/tile_manager.cc +++ b/cc/tiles/tile_manager.cc
@@ -85,7 +85,7 @@ public: RasterTaskImpl(TileManager* tile_manager, Tile* tile, - Resource* resource, + ResourcePool::InUsePoolResource resource, scoped_refptr<RasterSource> raster_source, const RasterSource::PlaybackSettings& playback_settings, TileResolution tile_resolution, @@ -98,7 +98,7 @@ : TileTask(!is_gpu_rasterization, dependencies), tile_manager_(tile_manager), tile_id_(tile->id()), - resource_(resource), + resource_(std::move(resource)), raster_source_(std::move(raster_source)), content_rect_(tile->content_rect()), invalid_content_rect_(invalidated_rect), @@ -145,7 +145,7 @@ // already concluded as FINISHED or CANCELLED and no longer will be worked // upon by task graph runner. raster_buffer_ = nullptr; - tile_manager_->OnRasterTaskCompleted(tile_id_, resource_, + tile_manager_->OnRasterTaskCompleted(tile_id_, std::move(resource_), state().IsCanceled()); } @@ -153,6 +153,7 @@ ~RasterTaskImpl() override { DCHECK(origin_thread_checker_.CalledOnValidThread()); DCHECK(!raster_buffer_); + DCHECK(!resource_); } private: @@ -163,7 +164,7 @@ // origin thread. Ensure their access by checking CalledOnValidThread(). TileManager* tile_manager_; Tile::Id tile_id_; - Resource* resource_; + ResourcePool::InUsePoolResource resource_; // The following members should be used for running the task. scoped_refptr<RasterSource> raster_source_; @@ -866,9 +867,8 @@ num_of_tiles_with_checker_images_--; DCHECK_GE(num_of_tiles_with_checker_images_, 0); - Resource* resource = draw_info.TakeResource(); - if (resource) { - resource_pool_->ReleaseResource(resource); + if (draw_info.has_resource()) { + resource_pool_->ReleaseResource(draw_info.TakeResource()); pending_gpu_work_tiles_.erase(tile); } } @@ -989,7 +989,7 @@ Tile* tile = prioritized_tile.tile(); DCHECK(tile->draw_info().requires_resource()); - DCHECK(!tile->draw_info().resource()); + DCHECK(!tile->draw_info().has_resource()); DCHECK(tile->HasRasterTask()); TileTask* task = tile->raster_task_.get(); @@ -1127,8 +1127,8 @@ "TileManager::CreateRasterTask", "Tile", tile->id()); // Get the resource. + ResourcePool::InUsePoolResource resource; uint64_t resource_content_id = 0; - Resource* resource = nullptr; gfx::Rect invalidated_rect = tile->invalidated_content_rect(); if (UsePartialRaster() && tile->invalidated_id()) { resource = resource_pool_->TryAcquireResourceForPartialRaster( @@ -1139,12 +1139,13 @@ bool partial_tile_decode = false; if (resource) { resource_content_id = tile->invalidated_id(); - DCHECK_EQ(DetermineResourceFormat(tile), resource->format()); + DCHECK_EQ(DetermineResourceFormat(tile), resource.format()); partial_tile_decode = true; } else { resource = resource_pool_->AcquireResource(tile->desired_texture_size(), DetermineResourceFormat(tile), color_space); + DCHECK(resource); } // For LOW_RESOLUTION tiles, we don't draw or predecode images. @@ -1191,7 +1192,8 @@ sync_decoded_images.begin(), sync_decoded_images.end()); // This will unref the images, but ScheduleTasks will schedule them // right away anyway. - OnRasterTaskCompleted(tile->id(), resource, true /* was_canceled */); + OnRasterTaskCompleted(tile->id(), std::move(resource), + true /* was_canceled */); return nullptr; } @@ -1228,19 +1230,20 @@ std::move(settings)); return base::MakeRefCounted<RasterTaskImpl>( - this, tile, resource, prioritized_tile.raster_source(), playback_settings, - prioritized_tile.priority().resolution, invalidated_rect, - prepare_tiles_count_, std::move(raster_buffer), &decode_tasks, - use_gpu_rasterization_, std::move(image_provider)); + this, tile, std::move(resource), prioritized_tile.raster_source(), + playback_settings, prioritized_tile.priority().resolution, + invalidated_rect, prepare_tiles_count_, std::move(raster_buffer), + &decode_tasks, use_gpu_rasterization_, std::move(image_provider)); } void TileManager::ResetSignalsForTesting() { signals_.reset(); } -void TileManager::OnRasterTaskCompleted(Tile::Id tile_id, - Resource* resource, - bool was_canceled) { +void TileManager::OnRasterTaskCompleted( + Tile::Id tile_id, + ResourcePool::InUsePoolResource resource, + bool was_canceled) { auto found = tiles_.find(tile_id); Tile* tile = nullptr; bool raster_task_was_scheduled_with_checker_images = false; @@ -1265,35 +1268,41 @@ if (was_canceled) { ++raster_task_completion_stats_.canceled_count; - resource_pool_->ReleaseResource(resource); + resource_pool_->ReleaseResource(std::move(resource)); return; } - resource_pool_->OnContentReplaced(resource->id(), tile_id); + resource_pool_->OnContentReplaced(resource, tile_id); ++raster_task_completion_stats_.completed_count; if (!tile) { - resource_pool_->ReleaseResource(resource); + resource_pool_->ReleaseResource(std::move(resource)); return; } - TileDrawInfo& draw_info = tile->draw_info(); - draw_info.set_resource(resource, - raster_task_was_scheduled_with_checker_images); - draw_info.contents_swizzled_ = DetermineResourceRequiresSwizzle(tile); - if (raster_task_was_scheduled_with_checker_images) - num_of_tiles_with_checker_images_++; - // In SMOOTHNESS_TAKES_PRIORITY mode, we wait for GPU work to complete for a // tile before setting it as ready to draw. - if (global_state_.tree_priority == SMOOTHNESS_TAKES_PRIORITY && - !raster_buffer_provider_->IsResourceReadyToDraw(resource->id())) { - pending_gpu_work_tiles_.insert(tile); - return; + bool is_ready_for_draw = true; + if (global_state_.tree_priority == SMOOTHNESS_TAKES_PRIORITY) { + is_ready_for_draw = + raster_buffer_provider_->IsResourceReadyToDraw(resource); } - draw_info.set_resource_ready_for_draw(); - client_->NotifyTileStateChanged(tile); + TileDrawInfo& draw_info = tile->draw_info(); + bool needs_swizzle = + raster_buffer_provider_->IsResourceSwizzleRequired(!tile->is_opaque()); + draw_info.SetResource(std::move(resource), + raster_task_was_scheduled_with_checker_images, + needs_swizzle); + if (raster_task_was_scheduled_with_checker_images) + num_of_tiles_with_checker_images_++; + + if (!is_ready_for_draw) { + pending_gpu_work_tiles_.insert(tile); + } else { + draw_info.set_resource_ready_for_draw(); + client_->NotifyTileStateChanged(tile); + } } void TileManager::SetDecodedImageTracker( @@ -1531,10 +1540,6 @@ return raster_buffer_provider_->GetResourceFormat(!tile->is_opaque()); } -bool TileManager::DetermineResourceRequiresSwizzle(const Tile* tile) const { - return raster_buffer_provider_->IsResourceSwizzleRequired(!tile->is_opaque()); -} - std::unique_ptr<base::trace_event::ConvertableToTraceFormat> TileManager::ScheduledTasksStateAsValue() const { std::unique_ptr<base::trace_event::TracedValue> state( @@ -1562,17 +1567,18 @@ if (flush) raster_buffer_provider_->Flush(); - ResourceProvider::ResourceIdArray required_for_activation_ids; - ResourceProvider::ResourceIdArray required_for_draw_ids; + std::vector<const ResourcePool::InUsePoolResource*> required_for_activation; + std::vector<const ResourcePool::InUsePoolResource*> required_for_draw; for (auto it = pending_gpu_work_tiles_.begin(); it != pending_gpu_work_tiles_.end();) { Tile* tile = *it; - const Resource* resource = tile->draw_info().resource(); - DCHECK(resource); + DCHECK(tile->draw_info().has_resource()); + const ResourcePool::InUsePoolResource& resource = + tile->draw_info().GetResource(); if (global_state_.tree_priority != SMOOTHNESS_TAKES_PRIORITY || - raster_buffer_provider_->IsResourceReadyToDraw(resource->id())) { + raster_buffer_provider_->IsResourceReadyToDraw(resource)) { tile->draw_info().set_resource_ready_for_draw(); client_->NotifyTileStateChanged(tile); it = pending_gpu_work_tiles_.erase(it); @@ -1585,30 +1591,31 @@ if (pending_tile_requirements_dirty_) tile->tiling()->UpdateRequiredStatesOnTile(tile); if (tile->required_for_activation()) - required_for_activation_ids.push_back(resource->id()); + required_for_activation.push_back(&resource); if (tile->required_for_draw()) - required_for_draw_ids.push_back(resource->id()); + required_for_draw.push_back(&resource); ++it; } - if (required_for_activation_ids.empty()) { + if (required_for_activation.empty()) { pending_required_for_activation_callback_id_ = 0; } else { pending_required_for_activation_callback_id_ = raster_buffer_provider_->SetReadyToDrawCallback( - required_for_activation_ids, + required_for_activation, base::Bind(&TileManager::CheckPendingGpuWorkTiles, ready_to_draw_callback_weak_ptr_factory_.GetWeakPtr(), true /* issue_signals */, false /* flush */), pending_required_for_activation_callback_id_); } - pending_required_for_draw_callback_id_ = 0; - if (!required_for_draw_ids.empty()) { + if (required_for_draw.empty()) { + pending_required_for_draw_callback_id_ = 0; + } else { pending_required_for_draw_callback_id_ = raster_buffer_provider_->SetReadyToDrawCallback( - required_for_draw_ids, + required_for_draw, base::Bind(&TileManager::CheckPendingGpuWorkTiles, ready_to_draw_callback_weak_ptr_factory_.GetWeakPtr(), true /* issue_signals */, false /* flush */), @@ -1732,9 +1739,9 @@ // static TileManager::MemoryUsage TileManager::MemoryUsage::FromTile(const Tile* tile) { const TileDrawInfo& draw_info = tile->draw_info(); - if (draw_info.resource()) { - return MemoryUsage::FromConfig(draw_info.resource()->size(), - draw_info.resource()->format()); + if (draw_info.has_resource()) { + return MemoryUsage::FromConfig(draw_info.resource_size(), + draw_info.resource_format()); } return MemoryUsage(); }
diff --git a/cc/tiles/tile_manager.h b/cc/tiles/tile_manager.h index ddad219..98060e5e 100644 --- a/cc/tiles/tile_manager.h +++ b/cc/tiles/tile_manager.h
@@ -191,12 +191,12 @@ void InitializeTilesWithResourcesForTesting(const std::vector<Tile*>& tiles) { for (size_t i = 0; i < tiles.size(); ++i) { TileDrawInfo& draw_info = tiles[i]->draw_info(); - draw_info.set_resource( + draw_info.SetResource( resource_pool_->AcquireResource( tiles[i]->desired_texture_size(), raster_buffer_provider_->GetResourceFormat(false), client_->GetRasterColorSpace()), - false); + false, false); draw_info.set_resource_ready_for_draw(); } } @@ -249,7 +249,7 @@ } void OnRasterTaskCompleted(Tile::Id tile_id, - Resource* resource, + ResourcePool::InUsePoolResource resource, bool was_canceled); void SetDecodedImageTracker(DecodedImageTracker* decoded_image_tracker); @@ -355,7 +355,6 @@ std::unique_ptr<RasterTilePriorityQueue> queue) const; viz::ResourceFormat DetermineResourceFormat(const Tile* tile) const; - bool DetermineResourceRequiresSwizzle(const Tile* tile) const; void DidFinishRunningTileTasksRequiredForActivation(); void DidFinishRunningTileTasksRequiredForDraw();
diff --git a/cc/tiles/tile_manager_unittest.cc b/cc/tiles/tile_manager_unittest.cc index 633ac18..158a279 100644 --- a/cc/tiles/tile_manager_unittest.cc +++ b/cc/tiles/tile_manager_unittest.cc
@@ -1378,13 +1378,14 @@ host_impl()->tile_manager()->PrepareTiles(host_impl()->global_tile_state()); EXPECT_TRUE(host_impl()->is_likely_to_require_a_draw()); - Resource* resource = host_impl()->resource_pool()->AcquireResource( - gfx::Size(256, 256), viz::RGBA_8888, gfx::ColorSpace()); + ResourcePool::InUsePoolResource resource = + host_impl()->resource_pool()->AcquireResource( + gfx::Size(256, 256), viz::RGBA_8888, gfx::ColorSpace()); host_impl()->tile_manager()->CheckIfMoreTilesNeedToBePreparedForTesting(); EXPECT_FALSE(host_impl()->is_likely_to_require_a_draw()); - host_impl()->resource_pool()->ReleaseResource(resource); + host_impl()->resource_pool()->ReleaseResource(std::move(resource)); } TEST_F(TileManagerTilePriorityQueueTest, DefaultMemoryPolicy) { @@ -1726,7 +1727,8 @@ EXPECT_TRUE(tile->draw_info().IsReadyToDraw()); LayerTreeResourceProvider::ScopedWriteLockSoftware lock( - host_impl()->resource_provider(), tile->draw_info().resource_id()); + host_impl()->resource_provider(), + tile->draw_info().GetResource().software_backing_resource_id()); const SkBitmap bitmap = lock.sk_bitmap(); for (int x = 0; x < size.width(); ++x) { for (int y = 0; y < size.height(); ++y) { @@ -1889,7 +1891,7 @@ // RasterBufferProvider methods. std::unique_ptr<RasterBuffer> AcquireBufferForRaster( - const Resource* resource, + const ResourcePool::InUsePoolResource& resource, uint64_t resource_content_id, uint64_t previous_content_id) override { EXPECT_EQ(expected_resource_id_, resource_content_id); @@ -1922,10 +1924,11 @@ &raster_buffer_provider); // Ensure there's a resource with our |kInvalidatedId| in the resource pool. - auto* resource = host_impl->resource_pool()->AcquireResource( - kTileSize, viz::RGBA_8888, gfx::ColorSpace()); - host_impl->resource_pool()->OnContentReplaced(resource->id(), kInvalidatedId); - host_impl->resource_pool()->ReleaseResource(resource); + ResourcePool::InUsePoolResource resource = + host_impl->resource_pool()->AcquireResource(kTileSize, viz::RGBA_8888, + gfx::ColorSpace()); + host_impl->resource_pool()->OnContentReplaced(resource, kInvalidatedId); + host_impl->resource_pool()->ReleaseResource(std::move(resource)); host_impl->resource_pool()->CheckBusyResources(); scoped_refptr<FakeRasterSource> pending_raster_source = @@ -1981,10 +1984,11 @@ &raster_buffer_provider); // Ensure there's a resource with our |kInvalidatedId| in the resource pool. - auto* resource = host_impl->resource_pool()->AcquireResource( - kTileSize, viz::RGBA_8888, gfx::ColorSpace()); - host_impl->resource_pool()->OnContentReplaced(resource->id(), kInvalidatedId); - host_impl->resource_pool()->ReleaseResource(resource); + ResourcePool::InUsePoolResource resource = + host_impl->resource_pool()->AcquireResource(kTileSize, viz::RGBA_8888, + gfx::ColorSpace()); + host_impl->resource_pool()->OnContentReplaced(resource, kInvalidatedId); + host_impl->resource_pool()->ReleaseResource(std::move(resource)); host_impl->resource_pool()->CheckBusyResources(); const gfx::Size layer_bounds(500, 500); @@ -2080,15 +2084,17 @@ class MockReadyToDrawRasterBufferProviderImpl : public FakeRasterBufferProviderImpl { public: - MOCK_CONST_METHOD1(IsResourceReadyToDraw, bool(viz::ResourceId resource_id)); + MOCK_CONST_METHOD1(IsResourceReadyToDraw, + bool(const ResourcePool::InUsePoolResource& resource)); MOCK_CONST_METHOD3( SetReadyToDrawCallback, - uint64_t(const ResourceProvider::ResourceIdArray& resource_ids, - const base::Closure& callback, - uint64_t pending_callback_id)); + uint64_t( + const std::vector<const ResourcePool::InUsePoolResource*>& resources, + const base::RepeatingClosure& callback, + uint64_t pending_callback_id)); std::unique_ptr<RasterBuffer> AcquireBufferForRaster( - const Resource* resource, + const ResourcePool::InUsePoolResource& resource, uint64_t resource_content_id, uint64_t previous_content_id) override { return std::make_unique<FakeRasterBuffer>(); @@ -2186,7 +2192,7 @@ host_impl()->SetTreePriority(SMOOTHNESS_TAKES_PRIORITY); SetupTreesWithPendingTreeTiles(); - base::Closure callback; + base::RepeatingClosure callback; { base::RunLoop run_loop; @@ -2197,13 +2203,16 @@ .WillRepeatedly(Return(false)); EXPECT_CALL(*mock_raster_buffer_provider(), SetReadyToDrawCallback(_, _, 0)) - .WillOnce(testing::Invoke([&run_loop, &callback]( - const ResourceProvider::ResourceIdArray& resource_ids, - const base::Closure& callback_in, uint64_t pending_callback_id) { - callback = callback_in; - run_loop.Quit(); - return 1; - })); + .WillOnce(testing::Invoke( + [&run_loop, &callback]( + const std::vector<const ResourcePool::InUsePoolResource*>& + resources, + const base::RepeatingClosure& callback_in, + uint64_t pending_callback_id) { + callback = callback_in; + run_loop.Quit(); + return 1; + })); host_impl()->tile_manager()->DidModifyTilePriorities(); host_impl()->tile_manager()->PrepareTiles(host_impl()->global_tile_state()); run_loop.Run(); @@ -2248,7 +2257,7 @@ host_impl()->SetTreePriority(SMOOTHNESS_TAKES_PRIORITY); SetupTreesWithActiveTreeTiles(); - base::Closure callback; + base::RepeatingClosure callback; { base::RunLoop run_loop; @@ -2259,13 +2268,16 @@ .WillRepeatedly(Return(false)); EXPECT_CALL(*mock_raster_buffer_provider(), SetReadyToDrawCallback(_, _, 0)) - .WillOnce(Invoke([&run_loop, &callback]( - const ResourceProvider::ResourceIdArray& resource_ids, - const base::Closure& callback_in, uint64_t pending_callback_id) { - callback = callback_in; - run_loop.Quit(); - return 1; - })); + .WillOnce(Invoke( + [&run_loop, &callback]( + const std::vector<const ResourcePool::InUsePoolResource*>& + resources, + const base::RepeatingClosure& callback_in, + uint64_t pending_callback_id) { + callback = callback_in; + run_loop.Quit(); + return 1; + })); host_impl()->tile_manager()->DidModifyTilePriorities(); host_impl()->tile_manager()->PrepareTiles(host_impl()->global_tile_state()); run_loop.Run(); @@ -2364,18 +2376,21 @@ EXPECT_CALL(*mock_raster_buffer_provider(), IsResourceReadyToDraw(testing::_)) .WillRepeatedly(Return(false)); - base::Closure callback; + base::RepeatingClosure callback; { base::RunLoop run_loop; EXPECT_CALL(*mock_raster_buffer_provider(), SetReadyToDrawCallback(_, _, 0)) - .WillOnce(testing::Invoke([&run_loop, &callback]( - const ResourceProvider::ResourceIdArray& resource_ids, - const base::Closure& callback_in, uint64_t pending_callback_id) { - callback = callback_in; - run_loop.Quit(); - return 1; - })); + .WillOnce(testing::Invoke( + [&run_loop, &callback]( + const std::vector<const ResourcePool::InUsePoolResource*>& + resources, + const base::RepeatingClosure& callback_in, + uint64_t pending_callback_id) { + callback = callback_in; + run_loop.Quit(); + return 1; + })); host_impl()->tile_manager()->DidModifyTilePriorities(); host_impl()->tile_manager()->PrepareTiles(host_impl()->global_tile_state()); run_loop.Run(); @@ -2982,7 +2997,7 @@ } std::unique_ptr<RasterBuffer> AcquireBufferForRaster( - const Resource* resource, + const ResourcePool::InUsePoolResource& resource, uint64_t resource_content_id, uint64_t previous_content_id) override { buffer_count_++;
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index d1dc46a..5482b96 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc
@@ -1930,6 +1930,14 @@ layer_tree_frame_sink_->SetLocalSurfaceId( active_tree()->local_surface_id()); } + if (const char* client_name = GetClientNameForMetrics()) { + size_t total_quad_count = 0; + for (const auto& pass : compositor_frame.render_pass_list) + total_quad_count += pass->quad_list.size(); + UMA_HISTOGRAM_COUNTS_1000( + base::StringPrintf("Compositing.%s.CompositorFrame.Quads", client_name), + total_quad_count); + } layer_tree_frame_sink_->SubmitCompositorFrame(std::move(compositor_frame)); // Clears the list of swap promises after calling DidSwap on each of them to
diff --git a/cc/trees/layer_tree_host_pixeltest_masks.cc b/cc/trees/layer_tree_host_pixeltest_masks.cc index df6bd386..2303463 100644 --- a/cc/trees/layer_tree_host_pixeltest_masks.cc +++ b/cc/trees/layer_tree_host_pixeltest_masks.cc
@@ -25,7 +25,7 @@ namespace cc { namespace { -typedef ParameterizedPixelResourceTest LayerTreeHostMasksPixelTest; +using LayerTreeHostMasksPixelTest = ParameterizedPixelResourceTest; INSTANTIATE_PIXEL_RESOURCE_TEST_CASE_P(LayerTreeHostMasksPixelTest);
diff --git a/chrome/android/java/res/layout/accept_languages_item.xml b/chrome/android/java/res/layout/accept_languages_item.xml index 2cbdac2..4379f99 100644 --- a/chrome/android/java/res/layout/accept_languages_item.xml +++ b/chrome/android/java/res/layout/accept_languages_item.xml
@@ -6,6 +6,7 @@ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:chrome="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" android:id="@+id/language_item" android:layout_marginStart="0dp" android:paddingStart="@dimen/pref_languages_padding" @@ -43,9 +44,9 @@ android:layout_height="match_parent" android:paddingStart="@dimen/selectable_list_layout_row_padding" android:paddingEnd="@dimen/selectable_list_layout_row_padding" - android:contentDescription="@string/accessibility_list_menu_button" android:background="@null" android:src="@drawable/ic_more_vert_black_24dp" chrome:menuWidth="@dimen/pref_languages_item_popup_width" - chrome:chrometint="@color/dark_mode_tint" /> + chrome:chrometint="@color/dark_mode_tint" + tools:ignore="ContentDescription" /> </LinearLayout>
diff --git a/chrome/android/java/res/layout/distilled_page_prefs_view.xml b/chrome/android/java/res/layout/distilled_page_prefs_view.xml index d39922c8..ef59467 100644 --- a/chrome/android/java/res/layout/distilled_page_prefs_view.xml +++ b/chrome/android/java/res/layout/distilled_page_prefs_view.xml
@@ -41,7 +41,9 @@ android:layout_height="wrap_content" android:layout_weight="1" android:orientation="horizontal" - android:padding="10dp"/> + android:padding="10dp" + android:layout_marginTop="24dp" + android:layout_marginBottom="12dp"/> <LinearLayout android:layout_width="match_parent" @@ -52,16 +54,16 @@ <TextView android:id="@+id/font_size_percentage" android:layout_width="wrap_content" - android:layout_height="wrap_content" + android:layout_height="match_parent" android:layout_marginEnd="3dp" android:layout_marginStart="3dp" android:minWidth="50dp" - android:gravity="center" + android:gravity="center_vertical" android:textSize="17sp" /> <TextView android:layout_width="wrap_content" - android:layout_height="wrap_content" + android:layout_height="match_parent" android:gravity="center_vertical" android:layout_marginStart="5dp" android:textSize="13sp" @@ -70,7 +72,7 @@ <SeekBar android:id="@+id/font_size" android:layout_width="0dp" - android:layout_height="wrap_content" + android:layout_height="48dp" android:layout_gravity="center" android:layout_weight="1" android:orientation="horizontal" @@ -78,7 +80,7 @@ <TextView android:layout_width="wrap_content" - android:layout_height="wrap_content" + android:layout_height="match_parent" android:gravity="center_vertical" android:layout_marginEnd="3dp" android:textSize="20sp"
diff --git a/chrome/android/java/res/layout/list_menu_button.xml b/chrome/android/java/res/layout/list_menu_button.xml index b50526fa..944c84f 100644 --- a/chrome/android/java/res/layout/list_menu_button.xml +++ b/chrome/android/java/res/layout/list_menu_button.xml
@@ -8,12 +8,13 @@ <org.chromium.chrome.browser.widget.ListMenuButton xmlns:android="http://schemas.android.com/apk/res/android" xmlns:chrome="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" android:id="@+id/more" android:layout_width="wrap_content" android:layout_height="match_parent" android:paddingStart="@dimen/selectable_list_layout_row_padding" android:paddingEnd="@dimen/selectable_list_layout_row_padding" - android:contentDescription="@string/accessibility_list_menu_button" android:background="@null" android:src="@drawable/ic_more_vert_black_24dp" - chrome:chrometint="@color/dark_mode_tint" /> + chrome:chrometint="@color/dark_mode_tint" + tools:ignore="ContentDescription" />
diff --git a/chrome/android/java/res/values/arrays.xml b/chrome/android/java/res/values/arrays.xml deleted file mode 100644 index 1dabf77..0000000 --- a/chrome/android/java/res/values/arrays.xml +++ /dev/null
@@ -1,14 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright 2014 The Chromium Authors. All rights reserved. - Use of this source code is governed by a BSD-style license that can be - found in the LICENSE file. --> - -<resources> - <!-- These must be kept in sync (and in-order) with components/dom_distiller/core/font_family_list.h --> - <string-array name="distiller_mode_font_family_values"> - <item>@string/sans_serif</item> - <item>@string/serif</item> - <item>@string/monospace</item> - </string-array> - -</resources>
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkRow.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkRow.java index 98330ee..0c6aed4 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkRow.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkRow.java
@@ -44,6 +44,7 @@ BookmarkItem bookmarkItem = mDelegate.getModel().getBookmarkById(bookmarkId); mMoreIcon.dismiss(); + mMoreIcon.setContentDescriptionContext(bookmarkItem.getTitle()); mMoreIcon.setVisibility(bookmarkItem.isEditable() ? VISIBLE : GONE); setChecked(mDelegate.getSelectionDelegate().isItemSelected(bookmarkId));
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/TabularContextMenuViewPager.java b/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/TabularContextMenuViewPager.java index 6521749..282f344 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/TabularContextMenuViewPager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/TabularContextMenuViewPager.java
@@ -66,50 +66,45 @@ // It does not take into account the tab layout like getChildCount(), so we add 1. int currentChildIndex = getCurrentItem() + 1; - // Handles the case where this is called while the pager is scrolling between views. - // The height should remain the same as the height of the last view seen before scrolling. - if (getScrollX() != 0 && getScrollX() != mCanvasWidth) { - heightMeasureSpec = MeasureSpec.makeMeasureSpec(mOldHeight, MeasureSpec.EXACTLY); - } else { - // The height of the context menu is calculated as the sum of: - // 1. The tab bar's height, which is only visible when the context menu requires it - // (i.e. an ImageLink is clicked) - // 2. The height of the View being displayed for the current tab. - for (int i = 0; i < getChildCount(); i++) { - View child = getChildAt(i); - child.measure( - widthMeasureSpec, MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED)); - int measuredHeight = child.getMeasuredHeight(); + // The height of the context menu is calculated as the sum of: + // 1. The tab bar's height, which is only visible when the context menu requires it + // (i.e. an ImageLink is clicked) + // 2. The height of the View being displayed for the current tab. + for (int i = 0; i < getChildCount(); i++) { + View child = getChildAt(i); + child.measure( + widthMeasureSpec, MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED)); + int measuredHeight = child.getMeasuredHeight(); - // The ViewPager also considers the tab layout one of its children, and needs to be - // treated separately from getting the largest height. - if (child.getId() == R.id.tab_layout && child.getVisibility() != GONE) { - tabHeight = measuredHeight; - } else if (i == currentChildIndex) { - menuHeight = child.getMeasuredHeight(); - break; - } - } - int fullHeight = menuHeight + tabHeight; - int appWindowHeightPx = getResources().getDisplayMetrics().heightPixels; - fullHeight = Math.min(fullHeight, appWindowHeightPx - 2 * mContextMenuMinimumPaddingPx); - mDifferenceInHeight = fullHeight - mOldHeight; - - if (currentChildIndex == mPreviousChildIndex) { - // Handles the snapping of the view when its height changes - // (i.e. an image finished loading or the link became fully visible). - // The pager will immediately snap to the new height. - mClipHeight = fullHeight; - if (menuHeight != 0) mOldHeight = fullHeight; - heightMeasureSpec = MeasureSpec.makeMeasureSpec(fullHeight, MeasureSpec.EXACTLY); - } else { - // Handles the case where the view pager has completely scrolled to a different - // child. It will measure to the larger height so the clipping is visible. - initAnimator(); - heightMeasureSpec = MeasureSpec.makeMeasureSpec( - Math.max(mOldHeight, fullHeight), MeasureSpec.EXACTLY); + // The ViewPager also considers the tab layout one of its children, and needs to be + // treated separately from getting the largest height. + if (child.getId() == R.id.tab_layout && child.getVisibility() != GONE) { + tabHeight = measuredHeight; + } else if (i == currentChildIndex) { + menuHeight = child.getMeasuredHeight(); + break; } } + int fullHeight = menuHeight + tabHeight; + int appWindowHeightPx = getResources().getDisplayMetrics().heightPixels; + fullHeight = Math.min(fullHeight, appWindowHeightPx - 2 * mContextMenuMinimumPaddingPx); + mDifferenceInHeight = fullHeight - mOldHeight; + + if (currentChildIndex == mPreviousChildIndex) { + // Handles the snapping of the view when its height changes + // (i.e. an image finished loading or the link became fully visible). + // The pager will immediately snap to the new height. + mClipHeight = fullHeight; + if (menuHeight != 0) mOldHeight = fullHeight; + heightMeasureSpec = MeasureSpec.makeMeasureSpec(fullHeight, MeasureSpec.EXACTLY); + } else { + // Handles the case where the view pager has completely scrolled to a different + // child. It will measure to the larger height so the clipping is visible. + initAnimator(); + heightMeasureSpec = MeasureSpec.makeMeasureSpec( + Math.max(mOldHeight, fullHeight), MeasureSpec.EXACTLY); + } + super.onMeasure(widthMeasureSpec, heightMeasureSpec); mPreviousChildIndex = currentChildIndex; // The animation only runs when switching to a tab with a different height.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/dom_distiller/DistilledPagePrefsView.java b/chrome/android/java/src/org/chromium/chrome/browser/dom_distiller/DistilledPagePrefsView.java index d59328f..e96ff83 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/dom_distiller/DistilledPagePrefsView.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/dom_distiller/DistilledPagePrefsView.java
@@ -109,9 +109,15 @@ } private void initFontFamilySpinner() { - ArrayAdapter<CharSequence> adapter = new ArrayAdapter<CharSequence>(getContext(), - android.R.layout.simple_spinner_item, getResources().getStringArray( - R.array.distiller_mode_font_family_values)) { + // These must be kept in sync (and in-order) with + // components/dom_distiller/core/font_family_list.h + // TODO(wychen): fix getStringArray issue (https://crbug/803117#c2) + String[] fonts = { + getResources().getString(R.string.sans_serif), + getResources().getString(R.string.serif), + getResources().getString(R.string.monospace)}; + ArrayAdapter<CharSequence> adapter = new ArrayAdapter<CharSequence>( + getContext(), android.R.layout.simple_spinner_item, fonts) { @Override public View getView(int position, View convertView, ViewGroup parent) { View view = super.getView(position, convertView, parent);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadItemView.java b/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadItemView.java index 6d6e85d..ac40433 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadItemView.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadItemView.java
@@ -289,6 +289,7 @@ } } + mMoreButton.setContentDescriptionContext(item.getDisplayFileName()); boolean canShowMore = item.isComplete() && isMoreButtonEnabled(); mMoreButton.setVisibility(canShowMore ? View.VISIBLE : View.GONE);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/languages/LanguageListBaseAdapter.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/languages/LanguageListBaseAdapter.java index dd1d758e..a10fdce 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/languages/LanguageListBaseAdapter.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/languages/LanguageListBaseAdapter.java
@@ -81,6 +81,8 @@ mDescription.setText(item.getNativeDisplayName()); } + mMoreButton.setContentDescriptionContext(item.getDisplayName()); + // The default visibility for the views below is GONE. mStartIcon.setVisibility(View.GONE); mMoreButton.setVisibility(View.GONE);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java index 840948c..f4a72f4 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java
@@ -20,7 +20,6 @@ import android.text.TextUtils; import android.view.ContextThemeWrapper; import android.view.Gravity; -import android.view.KeyEvent; import android.view.View; import android.view.View.OnAttachStateChangeListener; import android.view.ViewGroup; @@ -111,6 +110,7 @@ import org.chromium.content_public.browser.ChildProcessImportance; import org.chromium.content_public.browser.GestureListenerManager; import org.chromium.content_public.browser.GestureStateListener; +import org.chromium.content_public.browser.ImeAdapter; import org.chromium.content_public.browser.ImeEventObserver; import org.chromium.content_public.browser.LoadUrlParams; import org.chromium.content_public.browser.SelectionPopupController; @@ -1870,24 +1870,22 @@ // web views. mContentViewCore.setShouldSetAccessibilityFocusOnPageLoad(true); - mContentViewCore.addImeEventObserver(new ImeEventObserver() { - @Override - public void onImeEvent() { - // Some text was set in the page. Don't reuse it if a tab is - // open from the same external application, we might lose some - // user data. - mAppAssociatedWith = null; - } + ImeAdapter.fromWebContents(mContentViewCore.getWebContents()) + .addEventObserver(new ImeEventObserver() { + @Override + public void onImeEvent() { + // Some text was set in the page. Don't reuse it if a tab is + // open from the same external application, we might lose some + // user data. + mAppAssociatedWith = null; + } - @Override - public void onNodeAttributeUpdated(boolean editable, boolean password) { - if (getFullscreenManager() == null) return; - updateFullscreenEnabledState(); - } - - @Override - public void onBeforeSendKeyEvent(KeyEvent event) {} - }); + @Override + public void onNodeAttributeUpdated(boolean editable, boolean password) { + if (getFullscreenManager() == null) return; + updateFullscreenEnabledState(); + } + }); setInterceptNavigationDelegate(mDelegateFactory.createInterceptNavigationDelegate( this));
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/widget/ListMenuButton.java b/chrome/android/java/src/org/chromium/chrome/browser/widget/ListMenuButton.java index aa19dc9..a49ace4 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/widget/ListMenuButton.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/widget/ListMenuButton.java
@@ -109,6 +109,17 @@ } /** + * Text that represents the item this menu button is related to. This will affect the content + * description of the view {@see #setContentDescription(CharSequence)}. + * @param context The string representation of the list item this button represents. + */ + public void setContentDescriptionContext(String context) { + if (context == null) context = ""; + setContentDescription(getContext().getResources().getString( + R.string.accessibility_list_menu_button, context)); + } + + /** * Sets the delegate this menu will rely on for populating the popup menu and handling selection * responses. The menu will not show or work without it. * @@ -129,6 +140,7 @@ @Override protected void onFinishInflate() { super.onFinishInflate(); + setContentDescriptionContext(""); setOnClickListener((view) -> showMenu()); }
diff --git a/chrome/android/java/strings/android_chrome_strings.grd b/chrome/android/java/strings/android_chrome_strings.grd index 82d7287..16e69e26 100644 --- a/chrome/android/java/strings/android_chrome_strings.grd +++ b/chrome/android/java/strings/android_chrome_strings.grd
@@ -2774,7 +2774,7 @@ Close navigation drawer </message> <message name="IDS_ACCESSIBILITY_LIST_MENU_BUTTON" desc="Content description for the button that shows option menu for a list item."> - Options + <ph name="NAME_OF_LIST_ITEM">%1$s<ex>Movie Title</ex></ph> Options </message> <message name="IDS_ACCESSIBILITY_TOOLBAR_SCREEN_POSITION" desc="Accessibility announcement to inform users about a toolbar's location."> Options available near top of the screen
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/autofill/AutofillPopupTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/autofill/AutofillPopupTest.java index 47e8ca3..a8f8703 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/autofill/AutofillPopupTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/autofill/AutofillPopupTest.java
@@ -32,6 +32,7 @@ import org.chromium.content.browser.test.util.DOMUtils; import org.chromium.content.browser.test.util.TestInputMethodManagerWrapper; import org.chromium.content.browser.test.util.TouchCommon; +import org.chromium.content_public.browser.ImeAdapter; import org.chromium.content_public.browser.WebContents; import org.chromium.ui.R; @@ -155,9 +156,9 @@ mActivityTestRule.getActivity().getCurrentContentViewCore(); final WebContents webContents = viewCore.getWebContents(); final ViewGroup view = viewCore.getContainerView(); - final TestInputMethodManagerWrapper immw = - new TestInputMethodManagerWrapper(viewCore); - viewCore.getImeAdapterForTest().setInputMethodManagerWrapperForTest(immw); + final ImeAdapter imeAdapter = ImeAdapter.fromWebContents(webContents); + TestInputMethodManagerWrapper immw = TestInputMethodManagerWrapper.create(imeAdapter); + imeAdapter.setInputMethodManagerWrapperForTest(immw); // Add an Autofill profile. AutofillProfile profile = new AutofillProfile( @@ -176,7 +177,7 @@ waitForKeyboardShowRequest(immw, 1); final ChromiumBaseInputConnection inputConnection = - viewCore.getImeAdapterForTest().getInputConnectionForTest(); + (ChromiumBaseInputConnection) imeAdapter.getInputConnectionForTest(); inputConnection.getHandler().post(() -> inputConnection.setComposingText(inputText, 1)); waitForAnchorViewAdd(view);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java index 9e63317f..8abdfd05 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java
@@ -758,7 +758,7 @@ // @RetryOnFailure @Test @DisabledTest // Disabled due to flakiness on browser_side_navigation apk - see crbug.com/707766 - public void testTabReparentingSelectPopup() throws InterruptedException { + public void testTabReparentingSelectPopup() throws InterruptedException, TimeoutException { LocationSettingsTestUtil.setSystemLocationSettingEnabled(true); mCustomTabActivityTestRule.startCustomTabActivityWithIntent( CustomTabsTestUtils.createMinimalCustomTabIntent( @@ -772,13 +772,9 @@ && currentTab.getContentViewCore() != null; } }); - try { - DOMUtils.clickNode( - mCustomTabActivityTestRule.getActivity().getActivityTab().getContentViewCore(), - "select"); - } catch (TimeoutException e) { - Assert.fail(); - } + DOMUtils.clickNode( + mCustomTabActivityTestRule.getActivity().getActivityTab().getContentViewCore(), + "select"); CriteriaHelper.pollUiThread(new Criteria() { @Override public boolean isSatisfied() { @@ -948,7 +944,7 @@ @Test @SmallTest @RetryOnFailure - public void testLoadNewUrlWithSession() throws InterruptedException { + public void testLoadNewUrlWithSession() throws InterruptedException, TimeoutException { final Context context = InstrumentationRegistry.getTargetContext(); final Intent intent = CustomTabsTestUtils.createMinimalCustomTabIntent(context, mTestPage); CustomTabsSessionToken session = CustomTabsSessionToken.getSessionTokenFromIntent(intent); @@ -985,11 +981,7 @@ pageLoadFinishedHelper.notifyCalled(); } }); - try { - pageLoadFinishedHelper.waitForCallback(0); - } catch (TimeoutException e) { - Assert.fail(); - } + pageLoadFinishedHelper.waitForCallback(0); CriteriaHelper.pollInstrumentationThread( Criteria.equals(mTestPage2, new Callable<String>() { @Override @@ -1035,7 +1027,7 @@ @Test @SmallTest @RetryOnFailure - public void testReferrerAddedAutomatically() throws InterruptedException { + public void testReferrerAddedAutomatically() throws InterruptedException, TimeoutException { final Context context = InstrumentationRegistry.getInstrumentation() .getTargetContext() .getApplicationContext(); @@ -1068,17 +1060,13 @@ return BrowserSessionContentUtils.handleInActiveContentIfNeeded(intent); } })); - try { - pageLoadFinishedHelper.waitForCallback(0); - } catch (TimeoutException e) { - Assert.fail(); - } + pageLoadFinishedHelper.waitForCallback(0); } @Test @SmallTest @RetryOnFailure - public void testVerifiedReferrer() throws InterruptedException { + public void testVerifiedReferrer() throws InterruptedException, TimeoutException { final Context context = InstrumentationRegistry.getInstrumentation() .getTargetContext() .getApplicationContext(); @@ -1120,11 +1108,7 @@ return BrowserSessionContentUtils.handleInActiveContentIfNeeded(intent); } })); - try { - pageLoadFinishedHelper.waitForCallback(0); - } catch (TimeoutException e) { - Assert.fail(); - } + pageLoadFinishedHelper.waitForCallback(0); } /** @@ -1132,7 +1116,7 @@ */ @Test @SmallTest - public void testCallbacksAreSent() { + public void testCallbacksAreSent() throws InterruptedException { final Semaphore navigationStartSemaphore = new Semaphore(0); final Semaphore navigationFinishedSemaphore = new Semaphore(0); CustomTabsSession session = bindWithCallback(new CustomTabsCallback() { @@ -1153,15 +1137,11 @@ InstrumentationRegistry.getTargetContext(), ChromeLauncherActivity.class)); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - try { - mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); - Assert.assertTrue(navigationStartSemaphore.tryAcquire( - TIMEOUT_PAGE_LOAD_SECONDS, TimeUnit.SECONDS)); - Assert.assertTrue(navigationFinishedSemaphore.tryAcquire( - TIMEOUT_PAGE_LOAD_SECONDS, TimeUnit.SECONDS)); - } catch (InterruptedException e) { - Assert.fail(); - } + mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); + Assert.assertTrue( + navigationStartSemaphore.tryAcquire(TIMEOUT_PAGE_LOAD_SECONDS, TimeUnit.SECONDS)); + Assert.assertTrue(navigationFinishedSemaphore.tryAcquire( + TIMEOUT_PAGE_LOAD_SECONDS, TimeUnit.SECONDS)); } /** @@ -1170,7 +1150,7 @@ @Test @SmallTest @RetryOnFailure - public void testPageLoadMetricIsSent() { + public void testPageLoadMetricIsSent() throws InterruptedException { final AtomicReference<Long> firstContentfulPaintMs = new AtomicReference<>(-1L); final AtomicReference<Long> activityStartTimeMs = new AtomicReference<>(-1L); final AtomicReference<Long> loadEventStartMs = new AtomicReference<>(-1L); @@ -1216,30 +1196,26 @@ InstrumentationRegistry.getTargetContext(), ChromeLauncherActivity.class)); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - try { - activityStartTimeMs.set(SystemClock.uptimeMillis()); - mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); - CriteriaHelper.pollInstrumentationThread(new Criteria() { - @Override - public boolean isSatisfied() { - return firstContentfulPaintMs.get() > 0; - } - }); - CriteriaHelper.pollInstrumentationThread(new Criteria() { - @Override - public boolean isSatisfied() { - return loadEventStartMs.get() > 0; - } - }); - CriteriaHelper.pollInstrumentationThread(new Criteria() { - @Override - public boolean isSatisfied() { - return sawNetworkQualityEstimates.get(); - } - }); - } catch (InterruptedException e) { - Assert.fail(); - } + activityStartTimeMs.set(SystemClock.uptimeMillis()); + mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); + CriteriaHelper.pollInstrumentationThread(new Criteria() { + @Override + public boolean isSatisfied() { + return firstContentfulPaintMs.get() > 0; + } + }); + CriteriaHelper.pollInstrumentationThread(new Criteria() { + @Override + public boolean isSatisfied() { + return loadEventStartMs.get() > 0; + } + }); + CriteriaHelper.pollInstrumentationThread(new Criteria() { + @Override + public boolean isSatisfied() { + return sawNetworkQualityEstimates.get(); + } + }); } private static void assertSuffixedHistogramTotalCount(long expected, String histogramPrefix) { @@ -1255,7 +1231,7 @@ */ @Test @SmallTest - public void testNavigationHistogramsRecorded() { + public void testNavigationHistogramsRecorded() throws InterruptedException { String startHistogramPrefix = "CustomTabs.IntentToFirstNavigationStartTime"; String commitHistogramPrefix = "CustomTabs.IntentToFirstCommitNavigationTime3"; assertSuffixedHistogramTotalCount(0, startHistogramPrefix); @@ -1273,12 +1249,8 @@ intent.setComponent(new ComponentName( InstrumentationRegistry.getTargetContext(), ChromeLauncherActivity.class)); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - try { mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); Assert.assertTrue(semaphore.tryAcquire(TIMEOUT_PAGE_LOAD_SECONDS, TimeUnit.SECONDS)); - } catch (InterruptedException e) { - Assert.fail(); - } assertSuffixedHistogramTotalCount(1, startHistogramPrefix); assertSuffixedHistogramTotalCount(1, commitHistogramPrefix); @@ -1289,7 +1261,7 @@ */ @Test @SmallTest - public void testToolbarTitleOnlyStateWithProperTitle() throws InterruptedException { + public void testToolbarTitleOnlyStateWithProperTitle() throws Exception, InterruptedException { final String url = mWebServer.setResponse("/test.html", ONLOAD_TITLE_CHANGE, null); hideDomainAndEnsureTitleIsSet( url, CustomTabsConnection.SpeculationParams.NO_SPECULATION, "nytimes.com"); @@ -1301,7 +1273,8 @@ */ @Test @SmallTest - public void testToolbarTitleOnlyStateWithProperTitlePrerendered() throws InterruptedException { + public void testToolbarTitleOnlyStateWithProperTitlePrerendered() + throws Exception, InterruptedException { final String url = mWebServer.setResponse("/test.html", ONLOAD_TITLE_CHANGE, null); hideDomainAndEnsureTitleIsSet( url, CustomTabsConnection.SpeculationParams.PRERENDER, "nytimes.com"); @@ -1313,14 +1286,14 @@ */ @Test @SmallTest - public void testToolbarTitleOnlyStateWithDelayedTitle() throws InterruptedException { + public void testToolbarTitleOnlyStateWithDelayedTitle() throws Exception, InterruptedException { final String url = mWebServer.setResponse("/test.html", DELAYED_TITLE_CHANGE, null); hideDomainAndEnsureTitleIsSet( url, CustomTabsConnection.SpeculationParams.NO_SPECULATION, "nytimes.com"); } - private void hideDomainAndEnsureTitleIsSet( - final String url, int speculation, final String expectedTitle) { + private void hideDomainAndEnsureTitleIsSet(final String url, int speculation, + final String expectedTitle) throws Exception, InterruptedException { final CustomTabsConnection connection = CustomTabsTestUtils.warmUpAndWait(); Context context = InstrumentationRegistry.getTargetContext(); Intent intent = CustomTabsTestUtils.createMinimalCustomTabIntent(context, url); @@ -1334,18 +1307,10 @@ if (speculation != CustomTabsConnection.SpeculationParams.NO_SPECULATION) { connection.setSpeculationModeForSession(token, speculation); Assert.assertTrue(connection.mayLaunchUrl(token, Uri.parse(url), null, null)); - try { ensureCompletedSpeculationForUrl(connection, url, speculation); - } catch (Exception e1) { - Assert.fail(); - } } - try { - mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); - } catch (InterruptedException e) { - Assert.fail(); - } + mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); CriteriaHelper.pollUiThread(new Criteria() { @Override public boolean isSatisfied() { @@ -1381,11 +1346,7 @@ CustomTabsSessionToken.getSessionTokenFromIntent(intent); Assert.assertTrue(connection.newSession(token)); Assert.assertTrue(connection.requestPostMessageChannel(token, null)); - try { mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); - } catch (InterruptedException e) { - Assert.fail(); - } CriteriaHelper.pollInstrumentationThread(new Criteria() { @Override public boolean isSatisfied() { @@ -1420,7 +1381,8 @@ @Test @SmallTest @RetryOnFailure - public void testPostMessageWebContentsDestroyed() throws InterruptedException { + public void testPostMessageWebContentsDestroyed() + throws InterruptedException, TimeoutException { final CustomTabsConnection connection = CustomTabsTestUtils.warmUpAndWait(); Context context = InstrumentationRegistry.getTargetContext(); Intent intent = CustomTabsTestUtils.createMinimalCustomTabIntent(context, mTestPage); @@ -1428,11 +1390,7 @@ CustomTabsSessionToken.getSessionTokenFromIntent(intent); Assert.assertTrue(connection.newSession(token)); Assert.assertTrue(connection.requestPostMessageChannel(token, null)); - try { mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); - } catch (InterruptedException e) { - Assert.fail(); - } CriteriaHelper.pollInstrumentationThread(new Criteria() { @Override public boolean isSatisfied() { @@ -1460,11 +1418,7 @@ .simulateRendererKilledForTesting(false); } }); - try { - renderProcessCallback.waitForCallback(0); - } catch (TimeoutException e) { - Assert.fail(); - } + renderProcessCallback.waitForCallback(0); Assert.assertTrue(connection.postMessage(token, "Message", null) == CustomTabsService.RESULT_FAILURE_MESSAGING_ERROR); } @@ -1483,11 +1437,7 @@ final CustomTabsSessionToken token = CustomTabsSessionToken.getSessionTokenFromIntent(intent); Assert.assertTrue(connection.newSession(token)); - try { - mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); - } catch (InterruptedException e) { - Assert.fail(); - } + mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); CriteriaHelper.pollInstrumentationThread(new Criteria() { @Override public boolean isSatisfied() { @@ -1515,11 +1465,7 @@ CustomTabsSessionToken.getSessionTokenFromIntent(intent); Assert.assertTrue(connection.newSession(token)); Assert.assertTrue(connection.requestPostMessageChannel(token, null)); - try { - mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); - } catch (InterruptedException e) { - Assert.fail(); - } + mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); CriteriaHelper.pollInstrumentationThread(new Criteria() { @Override public boolean isSatisfied() { @@ -1544,7 +1490,7 @@ @Test @SmallTest @RetryOnFailure - public void testPostMessageReceivedFromPage() throws InterruptedException { + public void testPostMessageReceivedFromPage() throws InterruptedException, TimeoutException { final CallbackHelper messageChannelHelper = new CallbackHelper(); final CallbackHelper onPostMessageHelper = new CallbackHelper(); final String url = mWebServer.setResponse("/test.html", MESSAGE_FROM_PAGE_TO_CHANNEL, null); @@ -1570,23 +1516,9 @@ Assert.assertTrue(session.postMessage("Message", null) == CustomTabsService.RESULT_FAILURE_MESSAGING_ERROR); - try { - mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); - } catch (InterruptedException e) { - Assert.fail(); - } - - try { - messageChannelHelper.waitForCallback(0); - } catch (TimeoutException e) { - Assert.fail(); - } - - try { - onPostMessageHelper.waitForCallback(0); - } catch (TimeoutException e) { - Assert.fail(); - } + mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); + messageChannelHelper.waitForCallback(0); + onPostMessageHelper.waitForCallback(0); } /** @@ -1596,7 +1528,8 @@ @Test @SmallTest @RetryOnFailure - public void testPostMessageReceivedFromPageWithLateRequest() throws InterruptedException { + public void testPostMessageReceivedFromPageWithLateRequest() + throws InterruptedException, TimeoutException { final CallbackHelper messageChannelHelper = new CallbackHelper(); final CallbackHelper onPostMessageHelper = new CallbackHelper(); final String url = mWebServer.setResponse("/test.html", MESSAGE_FROM_PAGE_TO_CHANNEL, null); @@ -1619,11 +1552,7 @@ InstrumentationRegistry.getTargetContext(), ChromeLauncherActivity.class)); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - try { - mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); - } catch (InterruptedException e) { - Assert.fail(); - } + mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); CriteriaHelper.pollInstrumentationThread(new Criteria() { @Override public boolean isSatisfied() { @@ -1633,18 +1562,8 @@ }); session.requestPostMessageChannel(null); - - try { - messageChannelHelper.waitForCallback(0); - } catch (TimeoutException e) { - Assert.fail(); - } - - try { - onPostMessageHelper.waitForCallback(0); - } catch (TimeoutException e) { - Assert.fail(); - } + messageChannelHelper.waitForCallback(0); + onPostMessageHelper.waitForCallback(0); Assert.assertTrue(session.postMessage("Message", null) == CustomTabsService.RESULT_SUCCESS); } @@ -1662,7 +1581,7 @@ @RetryOnFailure @Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE) public void testPostMessageThroughPrerenderWithRequestBeforeMayLaunchUrl() - throws InterruptedException { + throws Exception, InterruptedException { sendPostMessageDuringPrerenderTransition(BEFORE_MAY_LAUNCH_URL); } @@ -1675,7 +1594,7 @@ @RetryOnFailure @Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE) public void testPostMessageThroughPrerenderWithRequestBeforeIntent() - throws InterruptedException { + throws Exception, InterruptedException { sendPostMessageDuringPrerenderTransition(BEFORE_INTENT); } @@ -1688,12 +1607,12 @@ @RetryOnFailure @Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE) public void testPostMessageThroughPrerenderWithRequestAfterIntent() - throws InterruptedException { + throws Exception, InterruptedException { sendPostMessageDuringPrerenderTransition(AFTER_INTENT); } private void sendPostMessageDuringPrerenderTransition(int requestTime) - throws InterruptedException { + throws Exception, InterruptedException { sendPostMessageDuringSpeculationTransition( requestTime, CustomTabsConnection.SpeculationParams.PRERENDER); } @@ -1708,7 +1627,7 @@ @Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE) @CommandLineFlags.Add("enable-features=" + ChromeFeatureList.CCT_BACKGROUND_TAB) public void testPostMessageThroughHiddenTabWithRequestBeforeMayLaunchUrl() - throws InterruptedException { + throws Exception, InterruptedException, TimeoutException { sendPostMessageDuringHiddenTabTransition(BEFORE_MAY_LAUNCH_URL); } @@ -1722,7 +1641,7 @@ @Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE) @CommandLineFlags.Add("enable-features=" + ChromeFeatureList.CCT_BACKGROUND_TAB) public void testPostMessageThroughHiddenTabWithRequestBeforeIntent() - throws InterruptedException { + throws Exception, InterruptedException, TimeoutException { sendPostMessageDuringHiddenTabTransition(BEFORE_INTENT); } @@ -1736,19 +1655,19 @@ @Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE) @CommandLineFlags.Add("enable-features=" + ChromeFeatureList.CCT_BACKGROUND_TAB) public void testPostMessageThroughHiddenTabWithRequestAfterIntent() - throws InterruptedException { + throws Exception, InterruptedException, TimeoutException { sendPostMessageDuringHiddenTabTransition(AFTER_INTENT); } @CommandLineFlags.Add("enable-features=" + ChromeFeatureList.CCT_BACKGROUND_TAB) private void sendPostMessageDuringHiddenTabTransition(int requestTime) - throws InterruptedException { + throws Exception, InterruptedException, TimeoutException { sendPostMessageDuringSpeculationTransition( requestTime, CustomTabsConnection.SpeculationParams.HIDDEN_TAB); } private void sendPostMessageDuringSpeculationTransition(int requestTime, int speculationMode) - throws InterruptedException { + throws Exception, InterruptedException, TimeoutException { final CallbackHelper messageChannelHelper = new CallbackHelper(); final String url = mWebServer.setResponse("/test.html", TITLE_FROM_POSTMESSAGE_TO_CHANNEL, null); @@ -1779,11 +1698,7 @@ connection.setSpeculationModeForSession(token, speculationMode); session.mayLaunchUrl(Uri.parse(url), null, null); - try { ensureCompletedSpeculationForUrl(connection, url, speculationMode); - } catch (Exception e) { - Assert.fail(); - } if (requestTime == BEFORE_INTENT) { channelRequested = session.requestPostMessageChannel(null); @@ -1791,11 +1706,7 @@ } if (channelRequested) { - try { messageChannelHelper.waitForCallback(0); - } catch (TimeoutException e) { - Assert.fail(); - } currentMessage = "Prerendering "; // Initial title update during prerender. Assert.assertTrue( @@ -1803,11 +1714,7 @@ titleString = currentMessage; } - try { - mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); - } catch (InterruptedException e) { - Assert.fail(); - } + mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); CriteriaHelper.pollInstrumentationThread(new Criteria() { @Override @@ -1820,11 +1727,7 @@ if (requestTime == AFTER_INTENT) { channelRequested = session.requestPostMessageChannel(null); Assert.assertTrue(channelRequested); - try { messageChannelHelper.waitForCallback(0); - } catch (TimeoutException e) { - Assert.fail(); - } } currentMessage = "and loading "; @@ -1835,11 +1738,7 @@ // Request a new channel, verify it was created. session.requestPostMessageChannel(null); - try { - messageChannelHelper.waitForCallback(1); - } catch (TimeoutException e) { - Assert.fail(); - } + messageChannelHelper.waitForCallback(1); currentMessage = "and refreshing"; // Update title again and verify both updates went through with the channel still intact. @@ -1875,11 +1774,7 @@ extras.putInt( CustomTabsConnection.DEBUG_OVERRIDE_KEY, CustomTabsConnection.NO_PRERENDERING); Assert.assertTrue(connection.mayLaunchUrl(token, Uri.parse(mTestPage), extras, null)); - try { mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); - } catch (InterruptedException e) { - Assert.fail(); - } CriteriaHelper.pollInstrumentationThread(new Criteria() { @Override public boolean isSatisfied() { @@ -1901,7 +1796,7 @@ @Test @SmallTest @RetryOnFailure - public void testMayLaunchUrlWithoutWarmupNoSpeculation() { + public void testMayLaunchUrlWithoutWarmupNoSpeculation() throws InterruptedException { mayLaunchUrlWithoutWarmup(CustomTabsConnection.SpeculationParams.NO_SPECULATION); } @@ -1909,7 +1804,7 @@ @Test @SmallTest @RetryOnFailure - public void testMayLaunchUrlWithoutWarmupPrerender() { + public void testMayLaunchUrlWithoutWarmupPrerender() throws InterruptedException { mayLaunchUrlWithoutWarmup(CustomTabsConnection.SpeculationParams.PRERENDER); } @@ -1917,7 +1812,7 @@ @Test @SmallTest @RetryOnFailure - public void testMayLaunchUrlWithoutWarmupHiddenTab() { + public void testMayLaunchUrlWithoutWarmupHiddenTab() throws InterruptedException { mayLaunchUrlWithoutWarmup(CustomTabsConnection.SpeculationParams.HIDDEN_TAB); } @@ -2113,11 +2008,7 @@ if (wait) ensureCompletedSpeculationForUrl(connection, initialUrl, speculationMode); - try { mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); - } catch (InterruptedException e) { - Assert.fail(); - } final Tab tab = getActivity().getActivityTab(); if (wait) { @@ -2240,12 +2131,8 @@ Assert.assertTrue(connection.mayLaunchUrl(token, Uri.parse(mTestPage), null, null)); ensureCompletedSpeculationForUrl(connection, mTestPage, usedSpeculationMode); - try { - mCustomTabActivityTestRule.startCustomTabActivityWithIntent( - CustomTabsTestUtils.createMinimalCustomTabIntent(context, mTestPage)); - } catch (InterruptedException e) { - Assert.fail(); - } + mCustomTabActivityTestRule.startCustomTabActivityWithIntent( + CustomTabsTestUtils.createMinimalCustomTabIntent(context, mTestPage)); Assert.assertEquals(Uri.parse(mTestPage).getHost() + ":" + Uri.parse(mTestPage).getPort(), ((EditText) getActivity().findViewById(R.id.url_bar)).getText().toString()); } @@ -2295,12 +2182,8 @@ final CustomTabsConnection connection = CustomTabsTestUtils.warmUpAndWait(); CustomTabsSessionToken token = CustomTabsSessionToken.createMockSessionTokenForTesting(); connection.newSession(token); - try { - mCustomTabActivityTestRule.startCustomTabActivityWithIntent( - CustomTabsTestUtils.createMinimalCustomTabIntent(context, mTestPage)); - } catch (InterruptedException e) { - Assert.fail(); - } + mCustomTabActivityTestRule.startCustomTabActivityWithIntent( + CustomTabsTestUtils.createMinimalCustomTabIntent(context, mTestPage)); ThreadUtils.runOnUiThreadBlocking(new Runnable() { @Override public void run() { @@ -2325,12 +2208,8 @@ CustomTabsSessionToken token = CustomTabsSessionToken.createMockSessionTokenForTesting(); connection.newSession(token); - try { - mCustomTabActivityTestRule.startCustomTabActivityWithIntent( - CustomTabsTestUtils.createMinimalCustomTabIntent(context, mTestPage2)); - } catch (InterruptedException e) { - Assert.fail(); - } + mCustomTabActivityTestRule.startCustomTabActivityWithIntent( + CustomTabsTestUtils.createMinimalCustomTabIntent(context, mTestPage2)); ThreadUtils.runOnUiThreadBlocking(new Runnable() { @Override public void run() { @@ -2362,12 +2241,8 @@ connection.newSession(token); connection.setSpeculationModeForSession(token, speculationMode); Assert.assertTrue(connection.mayLaunchUrl(token, Uri.parse(mTestPage), null, null)); - try { - mCustomTabActivityTestRule.startCustomTabActivityWithIntent( - CustomTabsTestUtils.createMinimalCustomTabIntent(context, mTestPage)); - } catch (InterruptedException e) { - Assert.fail(); - } + mCustomTabActivityTestRule.startCustomTabActivityWithIntent( + CustomTabsTestUtils.createMinimalCustomTabIntent(context, mTestPage)); ThreadUtils.runOnUiThreadBlocking(new Runnable() { @Override public void run() { @@ -2386,12 +2261,8 @@ .getApplicationContext(); CustomTabsTestUtils.warmUpAndWait(); - try { - mCustomTabActivityTestRule.startCustomTabActivityWithIntent( - CustomTabsTestUtils.createMinimalCustomTabIntent(context, mTestPage)); - } catch (InterruptedException e) { - Assert.fail(); - } + mCustomTabActivityTestRule.startCustomTabActivityWithIntent( + CustomTabsTestUtils.createMinimalCustomTabIntent(context, mTestPage)); ThreadUtils.runOnUiThreadBlocking(new Runnable() { @Override @@ -2690,11 +2561,7 @@ if (launchReferrer != null) { intent.putExtra(Intent.EXTRA_REFERRER, Uri.parse(launchReferrer)); } - try { - mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); - } catch (InterruptedException e) { - Assert.fail(); - } + mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); } /** @@ -2764,7 +2631,7 @@ } private void verifyHistoryAfterSpeculation(int speculationMode, boolean speculationWasAHit) - throws Exception { + throws Exception, InterruptedException { String speculationUrl = mTestPage; String navigationUrl = speculationWasAHit ? mTestPage : mTestPage2; final CustomTabsConnection connection = CustomTabsTestUtils.warmUpAndWait(); @@ -2789,7 +2656,7 @@ Assert.assertEquals(navigationUrl, history.get(0).getUrl()); } - private void mayLaunchUrlWithoutWarmup(int speculationMode) { + private void mayLaunchUrlWithoutWarmup(int speculationMode) throws InterruptedException { Context context = InstrumentationRegistry.getInstrumentation() .getTargetContext() .getApplicationContext(); @@ -2804,12 +2671,8 @@ } connection.setSpeculationModeForSession(token, speculationMode); Assert.assertTrue(connection.mayLaunchUrl(token, Uri.parse(mTestPage), extras, null)); - try { - mCustomTabActivityTestRule.startCustomTabActivityWithIntent( - CustomTabsTestUtils.createMinimalCustomTabIntent(context, mTestPage)); - } catch (InterruptedException e) { - Assert.fail(); - } + mCustomTabActivityTestRule.startCustomTabActivityWithIntent( + CustomTabsTestUtils.createMinimalCustomTabIntent(context, mTestPage)); Tab tab = mCustomTabActivityTestRule.getActivity().getActivityTab(); Assert.assertEquals(mTestPage, tab.getUrl()); }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/profiling_host/ProfilingProcessHostAndroidTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/profiling_host/ProfilingProcessHostAndroidTest.java index 53f9a4d..103a845da 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/profiling_host/ProfilingProcessHostAndroidTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/profiling_host/ProfilingProcessHostAndroidTest.java
@@ -55,19 +55,4 @@ TestAndroidShim profilingProcessHost = new TestAndroidShim(); Assert.assertTrue(profilingProcessHost.runTestForMode("browser", true, true)); } - - @Test - @MediumTest - @CommandLineFlags.Add({"memlog=all-renderers", "memlog-stack-mode=pseudo"}) - public void testModeRendererPseudo() throws Exception { - TestAndroidShim profilingProcessHost = new TestAndroidShim(); - Assert.assertTrue(profilingProcessHost.runTestForMode("all-renderers", false, true)); - } - - @Test - @MediumTest - public void testModeGpuDynamicPseudo() throws Exception { - TestAndroidShim profilingProcessHost = new TestAndroidShim(); - Assert.assertTrue(profilingProcessHost.runTestForMode("gpu", true, true)); - } }
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchBackgroundTaskUnitTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchBackgroundTaskUnitTest.java index a07067e5..6228a83d 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchBackgroundTaskUnitTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchBackgroundTaskUnitTest.java
@@ -18,6 +18,7 @@ import android.os.Bundle; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; @@ -152,7 +153,9 @@ /** * Tests that the background task is scheduled when limitless prefetching is enabled: * the waiting delay is shorter but the provided backoff time should be respected. + * TODO(https://crbug.com/803584): fix limitless mode or fully remove it. */ + @Ignore @Test public void scheduleTaskLimitless() { final int additionalDelaySeconds = 20; @@ -210,7 +213,9 @@ /** * Tests that the background task is correctly started when conditions are sufficient for * limitless prefetching. + * TODO(https://crbug.com/803584): fix limitless mode or fully remove it. */ + @Ignore @Test public void createNativeTaskLimitless() { final ArrayList<Boolean> reschedules = new ArrayList<>(); @@ -304,7 +309,9 @@ /** * Tests that the background task is not started (rescheduled) when there's no connection and * limitless prefetching is enabled. + * TODO(https://crbug.com/803584): fix limitless mode or fully remove it. */ + @Ignore @Test public void testNoNetworkLimitless() throws Exception { // Setup no network conditions.
diff --git a/chrome/app/chromeos_strings.grdp b/chrome/app/chromeos_strings.grdp index 70707071..e8841c9 100644 --- a/chrome/app/chromeos_strings.grdp +++ b/chrome/app/chromeos_strings.grdp
@@ -1519,7 +1519,7 @@ Please wait... </message> <message name="IDS_ENTERPRISE_ENROLLMENT_WORKING_MESSAGE" desc="Message to show while enrollment is in progress"> - Please wait... + Enrolling device... </message> <message name="IDS_NETWORK_SELECTION_TITLE" desc="Welcome title shown on network selection screen"> Let's get started
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 43cc80c8..094021d 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd
@@ -5325,31 +5325,31 @@ </message> <if expr="is_android"> <message name="IDS_CLIPBOARD_INFOBAR_TEXT" desc="Text requesting permission for a site to read data from the system clipboard"> - <ph name="URL">$1<ex>maps.google.com</ex></ph> wants to see text and images copied to the clipboard. + <ph name="URL">$1<ex>maps.google.com</ex></ph> wants to see text and images copied to the clipboard </message> </if> - <message name="IDS_ALLOWED_CLIPBOARD_TITLE" desc="Bubble info title for when a page has been granted clipboard read access."> + <message name="IDS_ALLOWED_CLIPBOARD_TITLE" desc="Title of the info bubble shown when a page has been allowed access to read the contents of the system clipboard."> Clipboard read access allowed </message> - <message name="IDS_ALLOWED_CLIPBOARD_MESSAGE" desc="Bubble info message and location bar icon tooltip text when a page has been granted clipboard read access."> + <message name="IDS_ALLOWED_CLIPBOARD_MESSAGE" desc="Info bubble message and location bar icon tooltip text shown when a page has been allowed access to read the contents of the system clipboard."> This page can see text and images copied to the clipboard. </message> <message name="IDS_ALLOWED_CLIPBOARD_BLOCK" desc="Radio button to block read access to the clipboard"> Always block <ph name="HOST">$1<ex>example.com</ex></ph> from seeing the clipboard </message> - <message name="IDS_ALLOWED_CLIPBOARD_NO_ACTION" desc="Radio button to keep allowing access to the clipboard"> + <message name="IDS_ALLOWED_CLIPBOARD_NO_ACTION" desc="Radio button to keep allowing read access to the system clipboard"> Continue allowing this site to see the clipboard </message> - <message name="IDS_BLOCKED_CLIPBOARD_TITLE" desc="Bubble info title for when a page has been denied clipboard read access."> + <message name="IDS_BLOCKED_CLIPBOARD_TITLE" desc="Title of the info bubble shown when a page has been denied access to read the contents of the system clipboard."> Clipboard read access denied </message> - <message name="IDS_BLOCKED_CLIPBOARD_MESSAGE" desc="Bubble info message and location bar icon tooltip text when a page had been denied clipboard read access."> + <message name="IDS_BLOCKED_CLIPBOARD_MESSAGE" desc="Info bubble message and location bar icon tooltip text shown when a page has been denied access to read the system clipboard."> This page has been blocked from seeing text and images copied to the clipboard </message> - <message name="IDS_BLOCKED_CLIPBOARD_UNBLOCK" desc="Radio button choice to unblock a site from accessing the clipboard."> + <message name="IDS_BLOCKED_CLIPBOARD_UNBLOCK" desc="Radio button choice to unblock a site from reading the system clipboard."> Always allow <ph name="HOST">$1<ex>mail.google.com</ex></ph> to see the clipboard </message> - <message name="IDS_BLOCKED_CLIPBOARD_NO_ACTION" desc="Radio button choice to continue blocking a site from accessing the clipboard API."> + <message name="IDS_BLOCKED_CLIPBOARD_NO_ACTION" desc="Radio button choice to continue blocking a site from reading the system clipboard."> Continue blocking this site from seeing the clipboard </message>
diff --git a/chrome/app/theme/default_100_percent/common/allowed_ads.png b/chrome/app/theme/default_100_percent/common/allowed_ads.png deleted file mode 100644 index 7729daa..0000000 --- a/chrome/app/theme/default_100_percent/common/allowed_ads.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_100_percent/common/allowed_background_sync.png b/chrome/app/theme/default_100_percent/common/allowed_background_sync.png deleted file mode 100644 index 7a88c2e..0000000 --- a/chrome/app/theme/default_100_percent/common/allowed_background_sync.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_100_percent/common/allowed_camera.png b/chrome/app/theme/default_100_percent/common/allowed_camera.png deleted file mode 100644 index 66e010a..0000000 --- a/chrome/app/theme/default_100_percent/common/allowed_camera.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_100_percent/common/allowed_clipboard.png b/chrome/app/theme/default_100_percent/common/allowed_clipboard.png deleted file mode 100644 index 6cc8be97..0000000 --- a/chrome/app/theme/default_100_percent/common/allowed_clipboard.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_100_percent/common/allowed_downloads.png b/chrome/app/theme/default_100_percent/common/allowed_downloads.png deleted file mode 100644 index c2cef96b..0000000 --- a/chrome/app/theme/default_100_percent/common/allowed_downloads.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_100_percent/common/allowed_images.png b/chrome/app/theme/default_100_percent/common/allowed_images.png deleted file mode 100644 index 45a7044..0000000 --- a/chrome/app/theme/default_100_percent/common/allowed_images.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_100_percent/common/allowed_location.png b/chrome/app/theme/default_100_percent/common/allowed_location.png deleted file mode 100644 index 74a07a5..0000000 --- a/chrome/app/theme/default_100_percent/common/allowed_location.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_100_percent/common/allowed_mic.png b/chrome/app/theme/default_100_percent/common/allowed_mic.png deleted file mode 100644 index 109c8f4d..0000000 --- a/chrome/app/theme/default_100_percent/common/allowed_mic.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_100_percent/common/allowed_notifications.png b/chrome/app/theme/default_100_percent/common/allowed_notifications.png deleted file mode 100644 index 4275aa38..0000000 --- a/chrome/app/theme/default_100_percent/common/allowed_notifications.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_100_percent/common/allowed_plugins.png b/chrome/app/theme/default_100_percent/common/allowed_plugins.png deleted file mode 100644 index 7914544..0000000 --- a/chrome/app/theme/default_100_percent/common/allowed_plugins.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_100_percent/common/allowed_popups.png b/chrome/app/theme/default_100_percent/common/allowed_popups.png deleted file mode 100644 index 9bcb217..0000000 --- a/chrome/app/theme/default_100_percent/common/allowed_popups.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_100_percent/common/allowed_script.png b/chrome/app/theme/default_100_percent/common/allowed_script.png deleted file mode 100644 index 642e99d..0000000 --- a/chrome/app/theme/default_100_percent/common/allowed_script.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_100_percent/common/allowed_sound.png b/chrome/app/theme/default_100_percent/common/allowed_sound.png deleted file mode 100644 index 5b1e51c..0000000 --- a/chrome/app/theme/default_100_percent/common/allowed_sound.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_100_percent/common/allowed_usb.png b/chrome/app/theme/default_100_percent/common/allowed_usb.png deleted file mode 100644 index cac73d7..0000000 --- a/chrome/app/theme/default_100_percent/common/allowed_usb.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_100_percent/common/blocked_ads.png b/chrome/app/theme/default_100_percent/common/blocked_ads.png deleted file mode 100644 index 51006557..0000000 --- a/chrome/app/theme/default_100_percent/common/blocked_ads.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_100_percent/common/blocked_background_sync.png b/chrome/app/theme/default_100_percent/common/blocked_background_sync.png deleted file mode 100644 index c14f40a..0000000 --- a/chrome/app/theme/default_100_percent/common/blocked_background_sync.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_100_percent/common/blocked_clipboard.png b/chrome/app/theme/default_100_percent/common/blocked_clipboard.png deleted file mode 100644 index b809b93f..0000000 --- a/chrome/app/theme/default_100_percent/common/blocked_clipboard.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_100_percent/common/blocked_cookies.png b/chrome/app/theme/default_100_percent/common/blocked_cookies.png deleted file mode 100644 index c7f1f3b..0000000 --- a/chrome/app/theme/default_100_percent/common/blocked_cookies.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_100_percent/common/blocked_downloads.png b/chrome/app/theme/default_100_percent/common/blocked_downloads.png deleted file mode 100644 index e494cd1d..0000000 --- a/chrome/app/theme/default_100_percent/common/blocked_downloads.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_100_percent/common/blocked_images.png b/chrome/app/theme/default_100_percent/common/blocked_images.png deleted file mode 100644 index 9913acf..0000000 --- a/chrome/app/theme/default_100_percent/common/blocked_images.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_100_percent/common/blocked_location.png b/chrome/app/theme/default_100_percent/common/blocked_location.png deleted file mode 100644 index b3b4b42b..0000000 --- a/chrome/app/theme/default_100_percent/common/blocked_location.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_100_percent/common/blocked_mic.png b/chrome/app/theme/default_100_percent/common/blocked_mic.png deleted file mode 100644 index 89ca867..0000000 --- a/chrome/app/theme/default_100_percent/common/blocked_mic.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_100_percent/common/blocked_midi.png b/chrome/app/theme/default_100_percent/common/blocked_midi.png deleted file mode 100644 index 69b3f96..0000000 --- a/chrome/app/theme/default_100_percent/common/blocked_midi.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_100_percent/common/blocked_notifications.png b/chrome/app/theme/default_100_percent/common/blocked_notifications.png deleted file mode 100644 index 22f01ef..0000000 --- a/chrome/app/theme/default_100_percent/common/blocked_notifications.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_100_percent/common/blocked_plugins.png b/chrome/app/theme/default_100_percent/common/blocked_plugins.png deleted file mode 100644 index 2c6844c..0000000 --- a/chrome/app/theme/default_100_percent/common/blocked_plugins.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_100_percent/common/blocked_script.png b/chrome/app/theme/default_100_percent/common/blocked_script.png deleted file mode 100644 index eadbd7b..0000000 --- a/chrome/app/theme/default_100_percent/common/blocked_script.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_100_percent/common/blocked_sound.png b/chrome/app/theme/default_100_percent/common/blocked_sound.png deleted file mode 100644 index 511fbe2..0000000 --- a/chrome/app/theme/default_100_percent/common/blocked_sound.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_100_percent/common/blocked_usb.png b/chrome/app/theme/default_100_percent/common/blocked_usb.png deleted file mode 100644 index 2bdb34e..0000000 --- a/chrome/app/theme/default_100_percent/common/blocked_usb.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_100_percent/common/accessed_cookies.png b/chrome/app/theme/default_100_percent/common/cookies.png similarity index 100% rename from chrome/app/theme/default_100_percent/common/accessed_cookies.png rename to chrome/app/theme/default_100_percent/common/cookies.png Binary files differ
diff --git a/chrome/app/theme/default_200_percent/common/allowed_ads.png b/chrome/app/theme/default_200_percent/common/allowed_ads.png deleted file mode 100644 index 47cd3f0..0000000 --- a/chrome/app/theme/default_200_percent/common/allowed_ads.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_200_percent/common/allowed_background_sync.png b/chrome/app/theme/default_200_percent/common/allowed_background_sync.png deleted file mode 100644 index b485e63..0000000 --- a/chrome/app/theme/default_200_percent/common/allowed_background_sync.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_200_percent/common/allowed_camera.png b/chrome/app/theme/default_200_percent/common/allowed_camera.png deleted file mode 100644 index 2bd6621..0000000 --- a/chrome/app/theme/default_200_percent/common/allowed_camera.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_200_percent/common/allowed_clipboard.png b/chrome/app/theme/default_200_percent/common/allowed_clipboard.png deleted file mode 100644 index fb65749c..0000000 --- a/chrome/app/theme/default_200_percent/common/allowed_clipboard.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_200_percent/common/allowed_downloads.png b/chrome/app/theme/default_200_percent/common/allowed_downloads.png deleted file mode 100644 index 260a2af3..0000000 --- a/chrome/app/theme/default_200_percent/common/allowed_downloads.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_200_percent/common/allowed_images.png b/chrome/app/theme/default_200_percent/common/allowed_images.png deleted file mode 100644 index 1b44b2b..0000000 --- a/chrome/app/theme/default_200_percent/common/allowed_images.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_200_percent/common/allowed_location.png b/chrome/app/theme/default_200_percent/common/allowed_location.png deleted file mode 100644 index 53fd5a5..0000000 --- a/chrome/app/theme/default_200_percent/common/allowed_location.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_200_percent/common/allowed_mic.png b/chrome/app/theme/default_200_percent/common/allowed_mic.png deleted file mode 100644 index 1b5de96..0000000 --- a/chrome/app/theme/default_200_percent/common/allowed_mic.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_200_percent/common/allowed_notifications.png b/chrome/app/theme/default_200_percent/common/allowed_notifications.png deleted file mode 100644 index db64c57..0000000 --- a/chrome/app/theme/default_200_percent/common/allowed_notifications.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_200_percent/common/allowed_plugins.png b/chrome/app/theme/default_200_percent/common/allowed_plugins.png deleted file mode 100644 index 2243538b..0000000 --- a/chrome/app/theme/default_200_percent/common/allowed_plugins.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_200_percent/common/allowed_popups.png b/chrome/app/theme/default_200_percent/common/allowed_popups.png deleted file mode 100644 index dbb10e59..0000000 --- a/chrome/app/theme/default_200_percent/common/allowed_popups.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_200_percent/common/allowed_script.png b/chrome/app/theme/default_200_percent/common/allowed_script.png deleted file mode 100644 index 9517afeb..0000000 --- a/chrome/app/theme/default_200_percent/common/allowed_script.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_200_percent/common/allowed_sound.png b/chrome/app/theme/default_200_percent/common/allowed_sound.png deleted file mode 100644 index cbffcc7..0000000 --- a/chrome/app/theme/default_200_percent/common/allowed_sound.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_200_percent/common/allowed_usb.png b/chrome/app/theme/default_200_percent/common/allowed_usb.png deleted file mode 100644 index ef6e8bf60..0000000 --- a/chrome/app/theme/default_200_percent/common/allowed_usb.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_200_percent/common/blocked_ads.png b/chrome/app/theme/default_200_percent/common/blocked_ads.png deleted file mode 100644 index 563d29c..0000000 --- a/chrome/app/theme/default_200_percent/common/blocked_ads.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_200_percent/common/blocked_background_sync.png b/chrome/app/theme/default_200_percent/common/blocked_background_sync.png deleted file mode 100644 index f4cd5e5..0000000 --- a/chrome/app/theme/default_200_percent/common/blocked_background_sync.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_200_percent/common/blocked_clipboard.png b/chrome/app/theme/default_200_percent/common/blocked_clipboard.png deleted file mode 100644 index d7cd9d7..0000000 --- a/chrome/app/theme/default_200_percent/common/blocked_clipboard.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_200_percent/common/blocked_cookies.png b/chrome/app/theme/default_200_percent/common/blocked_cookies.png deleted file mode 100644 index 44f341b12f..0000000 --- a/chrome/app/theme/default_200_percent/common/blocked_cookies.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_200_percent/common/blocked_downloads.png b/chrome/app/theme/default_200_percent/common/blocked_downloads.png deleted file mode 100644 index 8029fd26..0000000 --- a/chrome/app/theme/default_200_percent/common/blocked_downloads.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_200_percent/common/blocked_images.png b/chrome/app/theme/default_200_percent/common/blocked_images.png deleted file mode 100644 index f7a8411..0000000 --- a/chrome/app/theme/default_200_percent/common/blocked_images.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_200_percent/common/blocked_location.png b/chrome/app/theme/default_200_percent/common/blocked_location.png deleted file mode 100644 index c3b7d53..0000000 --- a/chrome/app/theme/default_200_percent/common/blocked_location.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_200_percent/common/blocked_mic.png b/chrome/app/theme/default_200_percent/common/blocked_mic.png deleted file mode 100644 index 9cdffc1..0000000 --- a/chrome/app/theme/default_200_percent/common/blocked_mic.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_200_percent/common/blocked_midi.png b/chrome/app/theme/default_200_percent/common/blocked_midi.png deleted file mode 100644 index 375007f6..0000000 --- a/chrome/app/theme/default_200_percent/common/blocked_midi.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_200_percent/common/blocked_notifications.png b/chrome/app/theme/default_200_percent/common/blocked_notifications.png deleted file mode 100644 index b4f9e27b..0000000 --- a/chrome/app/theme/default_200_percent/common/blocked_notifications.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_200_percent/common/blocked_plugins.png b/chrome/app/theme/default_200_percent/common/blocked_plugins.png deleted file mode 100644 index 603b25e..0000000 --- a/chrome/app/theme/default_200_percent/common/blocked_plugins.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_200_percent/common/blocked_script.png b/chrome/app/theme/default_200_percent/common/blocked_script.png deleted file mode 100644 index b08e5a9..0000000 --- a/chrome/app/theme/default_200_percent/common/blocked_script.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_200_percent/common/blocked_sound.png b/chrome/app/theme/default_200_percent/common/blocked_sound.png deleted file mode 100644 index 648ee98..0000000 --- a/chrome/app/theme/default_200_percent/common/blocked_sound.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_200_percent/common/blocked_usb.png b/chrome/app/theme/default_200_percent/common/blocked_usb.png deleted file mode 100644 index 8207ea9..0000000 --- a/chrome/app/theme/default_200_percent/common/blocked_usb.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_200_percent/common/accessed_cookies.png b/chrome/app/theme/default_200_percent/common/cookies.png similarity index 100% rename from chrome/app/theme/default_200_percent/common/accessed_cookies.png rename to chrome/app/theme/default_200_percent/common/cookies.png Binary files differ
diff --git a/chrome/app/theme/theme_resources.grd b/chrome/app/theme/theme_resources.grd index 86b1af59c..15a3cbd 100644 --- a/chrome/app/theme/theme_resources.grd +++ b/chrome/app/theme/theme_resources.grd
@@ -25,24 +25,6 @@ <!-- KEEP THESE IN ALPHABETICAL ORDER! DO NOT ADD TO RANDOM PLACES JUST BECAUSE YOUR RESOURCES ARE FUNCTIONALLY RELATED OR FALL UNDER THE SAME CONDITIONALS. --> - <structure type="chrome_scaled_image" name="IDR_ACCESSED_COOKIES" file="common/accessed_cookies.png" /> - <structure type="chrome_scaled_image" name="IDR_ALLOWED_ADS" file="common/allowed_ads.png" /> - <structure type="chrome_scaled_image" name="IDR_ALLOWED_BACKGROUND_SYNC" file="common/allowed_background_sync.png" /> - <structure type="chrome_scaled_image" name="IDR_ALLOWED_CAMERA" file="common/allowed_camera.png" /> - <structure type="chrome_scaled_image" name="IDR_ALLOWED_CLIPBOARD" file="common/allowed_clipboard.png" /> - <structure type="chrome_scaled_image" name="IDR_ALLOWED_DOWNLOADS" file="common/allowed_downloads.png" /> - <structure type="chrome_scaled_image" name="IDR_ALLOWED_IMAGES" file="common/allowed_images.png" /> - <structure type="chrome_scaled_image" name="IDR_ALLOWED_JAVASCRIPT" file="common/allowed_script.png" /> - <structure type="chrome_scaled_image" name="IDR_ALLOWED_LOCATION" file="common/allowed_location.png" /> - <structure type="chrome_scaled_image" name="IDR_ALLOWED_MIC" file="common/allowed_mic.png" /> - <structure type="chrome_scaled_image" name="IDR_ALLOWED_MIDI_SYSEX" file="common/allowed_midi.png" /> - <structure type="chrome_scaled_image" name="IDR_ALLOWED_NOTIFICATION" file="common/allowed_notifications.png" /> - <if expr="enable_plugins"> - <structure type="chrome_scaled_image" name="IDR_ALLOWED_PLUGINS" file="common/allowed_plugins.png" /> - </if> - <structure type="chrome_scaled_image" name="IDR_ALLOWED_POPUPS" file="common/allowed_popups.png" /> - <structure type="chrome_scaled_image" name="IDR_ALLOWED_SOUND" file="common/allowed_sound.png" /> - <structure type="chrome_scaled_image" name="IDR_ALLOWED_USB" file="common/allowed_usb.png" /> <if expr="enable_app_list and _google_chrome"> <structure type="chrome_scaled_image" name="IDR_APP_LIST_GOOGLE_LOGO_VOICE_SEARCH" file="google_chrome/google_logo_voice_search.png" /> </if> @@ -74,25 +56,8 @@ <structure type="chrome_scaled_image" name="IDR_BACK_H" file="common/browser_back_hover.png" /> <structure type="chrome_scaled_image" name="IDR_BACK_P" file="common/browser_back_pressed.png" /> </if> - <structure type="chrome_scaled_image" name="IDR_BLOCKED_ADS" file="common/blocked_ads.png" /> - <structure type="chrome_scaled_image" name="IDR_BLOCKED_BACKGROUND_SYNC" file="common/blocked_background_sync.png" /> - <structure type="chrome_scaled_image" name="IDR_BLOCKED_CAMERA" file="common/blocked_camera.png" /> - <structure type="chrome_scaled_image" name="IDR_BLOCKED_CLIPBOARD" file="common/blocked_clipboard.png" /> - <structure type="chrome_scaled_image" name="IDR_BLOCKED_COOKIES" file="common/blocked_cookies.png" /> - <structure type="chrome_scaled_image" name="IDR_BLOCKED_DOWNLOADS" file="common/blocked_downloads.png" /> <structure type="chrome_scaled_image" name="IDR_BLOCKED_EXTENSION_SCRIPT" file="common/blocked_extension_script.png" /> - <structure type="chrome_scaled_image" name="IDR_BLOCKED_IMAGES" file="common/blocked_images.png" /> - <structure type="chrome_scaled_image" name="IDR_BLOCKED_JAVASCRIPT" file="common/blocked_script.png" /> - <structure type="chrome_scaled_image" name="IDR_BLOCKED_LOCATION" file="common/blocked_location.png" /> - <structure type="chrome_scaled_image" name="IDR_BLOCKED_MIC" file="common/blocked_mic.png" /> - <structure type="chrome_scaled_image" name="IDR_BLOCKED_MIDI_SYSEX" file="common/blocked_midi.png" /> - <structure type="chrome_scaled_image" name="IDR_BLOCKED_NOTIFICATION" file="common/blocked_notifications.png" /> - <if expr="enable_plugins"> - <structure type="chrome_scaled_image" name="IDR_BLOCKED_PLUGINS" file="common/blocked_plugins.png" /> - </if> <structure type="chrome_scaled_image" name="IDR_BLOCKED_POPUPS" file="common/blocked_popups.png" /> - <structure type="chrome_scaled_image" name="IDR_BLOCKED_SOUND" file="common/blocked_sound.png" /> - <structure type="chrome_scaled_image" name="IDR_BLOCKED_USB" file="common/blocked_usb.png" /> <if expr="chromeos"> <structure type="chrome_scaled_image" name="IDR_BLUETOOTH_KEYBOARD" file="cros/bluetooth_pairing_keyboard.png" /> <structure type="chrome_scaled_image" name="IDR_BLUETOOTH_MOUSE" file="cros/bluetooth_pairing_mouse.png" /> @@ -123,6 +88,7 @@ <if expr="is_win"> <structure type="chrome_scaled_image" name="IDR_CONFLICT_FAVICON" file="common/favicon_conflicts.png" /> </if> + <structure type="chrome_scaled_image" name="IDR_COOKIES" file="common/cookies.png" /> <structure type="chrome_scaled_image" name="IDR_COOKIE_STORAGE_ICON" file="common/cookie_storage.png" /> <structure type="chrome_scaled_image" name="IDR_DEVELOPER_MODE_HIGHLIGHT_BOTTOM_LEFT" file="common/developer_mode_highlight_bottom_left.png" /> <structure type="chrome_scaled_image" name="IDR_DEVELOPER_MODE_HIGHLIGHT_BOTTOM" file="common/developer_mode_highlight_bottom.png" />
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 6ca9e0ef..d9c457cd 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -3671,6 +3671,13 @@ kMarkHttpAsFeatureVariations, "MarkHttpAs")}, +#if !defined(OS_ANDROID) + {"enable-web-authentication-api", + flag_descriptions::kEnableWebAuthenticationAPIName, + flag_descriptions::kEnableWebAuthenticationAPIDescription, kOsDesktop, + FEATURE_VALUE_TYPE(features::kWebAuth)}, +#endif // !defined(OS_ANDROID) + // NOTE: Adding a new flag requires adding a corresponding entry to enum // "LoginCustomFlags" in tools/metrics/histograms/enums.xml. See "Flag // Histograms" in tools/metrics/histograms/README.md (run the
diff --git a/chrome/browser/android/vr_shell/BUILD.gn b/chrome/browser/android/vr_shell/BUILD.gn index 00c6612..0150f1616 100644 --- a/chrome/browser/android/vr_shell/BUILD.gn +++ b/chrome/browser/android/vr_shell/BUILD.gn
@@ -61,6 +61,7 @@ "//device/gamepad", "//device/vr", "//services/device/public/interfaces", + "//services/metrics/public/cpp:ukm_builders", "//services/ui/public/cpp/gpu", "//ui/android", "//ui/base",
diff --git a/chrome/browser/android/vr_shell/DEPS b/chrome/browser/android/vr_shell/DEPS index 59f29a44..4bb15ad 100644 --- a/chrome/browser/android/vr_shell/DEPS +++ b/chrome/browser/android/vr_shell/DEPS
@@ -2,6 +2,7 @@ "+cc/base", "+cc/layers", "+device/vr", + "+services/metrics/public/cpp/ukm_builders.h", "+third_party/gvr-android-keyboard/src", "+third_party/gvr-android-sdk/src", ]
diff --git a/chrome/browser/android/vr_shell/vr_usage_monitor.cc b/chrome/browser/android/vr_shell/vr_usage_monitor.cc index 1c674a7..361c3ea 100644 --- a/chrome/browser/android/vr_shell/vr_usage_monitor.cc +++ b/chrome/browser/android/vr_shell/vr_usage_monitor.cc
@@ -7,9 +7,11 @@ #include "base/logging.h" #include "base/metrics/histogram_macros.h" #include "components/rappor/public/rappor_utils.h" +#include "components/ukm/content/source_url_recorder.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/navigation_handle.h" #include "content/public/browser/web_contents.h" +#include "services/metrics/public/cpp/ukm_builders.h" namespace vr_shell { @@ -125,6 +127,20 @@ break; } } + +int GetRoundedDurationInSeconds(base::Time start, base::Time end) { + base::TimeDelta duration = end - start; + if (duration.InHours() > 2) { + return duration.InHours() * 3600; + } else if (duration.InMinutes() > 10) { + return (duration.InMinutes() / 10) * 10 * 60; + } else if (duration.InSeconds() > 60) { + return duration.InMinutes() * 60; + } else { + return duration.InSeconds(); + } +} + } // namespace template <SessionEventName SessionType> @@ -220,9 +236,9 @@ num_voice_search_started_++; } -void VrMetricsHelper::SetVrMode(vr::Mode mode) { +void VrMetricsHelper::SetVrMode(vr::Mode new_mode) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); - DCHECK_NE(mode, mode_); + DCHECK_NE(new_mode, mode_); base::Time switch_time = base::Time::Now(); @@ -235,8 +251,8 @@ } // start the new modes - if (mode != vr::Mode::kNoVr) { - switch (mode) { + if (new_mode != vr::Mode::kNoVr) { + switch (new_mode) { case vr::Mode::kWebVr: if (started_with_autopresentation_) { mode_timer_ = std::make_unique<SessionTimerImpl<MODE_WEBVR_DLA>>( @@ -280,14 +296,14 @@ mode_timer_->StartSession(switch_time); if (num_videos_playing_ > 0) { mode_video_timer_->StartSession(switch_time); - SendRapporEnteredVideoMode(origin_, mode); + SendRapporEnteredVideoMode(origin_, new_mode); } - SendRapporEnteredMode(origin_, mode); + SendRapporEnteredMode(origin_, new_mode); } // stop the old session - if (mode_ != vr::Mode::kNoVr && mode == vr::Mode::kNoVr) { + if (mode_ != vr::Mode::kNoVr && new_mode == vr::Mode::kNoVr) { if (num_videos_playing_ > 0) session_video_timer_->StopSession(false, switch_time); @@ -299,10 +315,25 @@ num_session_navigation_); UMA_HISTOGRAM_COUNTS_100("VR.Session.VoiceSearch.StartedCount", num_voice_search_started_); + + ukm::UkmRecorder* ukm_recorder = ukm::UkmRecorder::Get(); + DCHECK(ukm_recorder); + DCHECK(!time_on_page_start_.is_null()); + DCHECK(time_on_page_start_ <= base::Time::Now()); + + // It's possible if the user started a navigation that is incomplete at this + // point that this will double log the value. However, in that case the + // value should be the same, so whichever lands in the UKM will be fine. + // TODO(offenwanger): Add a check to ensure that the value is only submitted + // once. + ukm::builders::XR_PageSession(last_source_id_) + .SetTimeOnPage( + GetRoundedDurationInSeconds(time_on_page_start_, base::Time::Now())) + .Record(ukm_recorder); } // start the new session - if (mode_ == vr::Mode::kNoVr && mode != vr::Mode::kNoVr) { + if (mode_ == vr::Mode::kNoVr && new_mode != vr::Mode::kNoVr) { // we are entering a vr mode from non-vr mode - start the vr session session_timer_->StartSession(switch_time); num_session_video_playback_ = 0; @@ -313,9 +344,25 @@ session_video_timer_->StartSession(switch_time); num_session_video_playback_ = num_videos_playing_; } + + ukm::UkmRecorder* ukm_recorder = ukm::UkmRecorder::Get(); + DCHECK(ukm_recorder); + + last_source_id_ = ukm::GetSourceIdForWebContentsDocument(web_contents()); + time_on_page_start_ = base::Time::Now(); } - mode_ = mode; + if (new_mode == vr::Mode::kVrBrowsingFullscreen && mode_ != vr::Mode::kNoVr) { + ukm::UkmRecorder* ukm_recorder = ukm::UkmRecorder::Get(); + DCHECK(ukm_recorder); + + ukm::builders::XR_PageSession( + ukm::GetSourceIdForWebContentsDocument(web_contents())) + .SetEnteredFullscreen(1) + .Record(ukm_recorder); + } + + mode_ = new_mode; } VrMetricsHelper::VrMetricsHelper(content::WebContents* contents, @@ -329,6 +376,8 @@ num_videos_playing_ = contents->GetCurrentlyPlayingVideoCount(); is_fullscreen_ = contents->IsFullscreen(); origin_ = contents->GetLastCommittedURL(); + last_source_id_ = ukm::GetSourceIdForWebContentsDocument(contents); + time_on_page_start_ = base::Time::Now(); Observe(contents); if (started_with_autopresentation) { @@ -391,18 +440,37 @@ } } +void VrMetricsHelper::DidStartNavigation(content::NavigationHandle* handle) { + if (handle && handle->IsInMainFrame() && !handle->IsSameDocument()) { + ukm::UkmRecorder* ukm_recorder = ukm::UkmRecorder::Get(); + DCHECK(ukm_recorder); + ukm::builders::XR_PageSession(last_source_id_) + .SetTimeOnPage( + GetRoundedDurationInSeconds(time_on_page_start_, base::Time::Now())) + .Record(ukm_recorder); + } +} + void VrMetricsHelper::DidFinishNavigation(content::NavigationHandle* handle) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); + // Counting the number of pages viewed is difficult - some websites load + // new content dynamically without a navigation. Others redirect several + // times for a single navigation. + // We look at the number of committed navigations in the main frame, which + // will slightly overestimate pages viewed instead of trying to filter or + // look at page loads, since those will underestimate on some pages, and + // overestimate on others. if (handle && handle->HasCommitted() && handle->IsInMainFrame()) { origin_ = handle->GetURL(); - // Counting the number of pages viewed is difficult - some websites load - // new content dynamically without a navigation. Others redirect several - // times for a single navigation. - // We look at the number of committed navigations in the main frame, which - // will slightly overestimate pages viewed instead of trying to filter or - // look at page loads, since those will underestimate on some pages, and - // overestimate on others. + + // Get the ukm::SourceId from the handle so that we don't wind up with a + // wrong ukm::SourceId from this WebContentObserver perhaps executing after + // another which changes the SourceId. + last_source_id_ = ukm::ConvertToSourceId(handle->GetNavigationId(), + ukm::SourceIdType::NAVIGATION_ID); + time_on_page_start_ = base::Time::Now(); + num_session_navigation_++; } }
diff --git a/chrome/browser/android/vr_shell/vr_usage_monitor.h b/chrome/browser/android/vr_shell/vr_usage_monitor.h index ee0de276..1821cb90 100644 --- a/chrome/browser/android/vr_shell/vr_usage_monitor.h +++ b/chrome/browser/android/vr_shell/vr_usage_monitor.h
@@ -10,6 +10,7 @@ #include "base/time/time.h" #include "chrome/browser/vr/mode.h" #include "content/public/browser/web_contents_observer.h" +#include "services/metrics/public/cpp/ukm_source_id.h" namespace vr_shell { @@ -65,6 +66,7 @@ const MediaPlayerInfo& media_info, const MediaPlayerId&, WebContentsObserver::MediaStoppedReason reason) override; + void DidStartNavigation(content::NavigationHandle* handle) override; void DidFinishNavigation(content::NavigationHandle* handle) override; void DidToggleFullscreenModeForTab(bool entered_fullscreen, bool will_cause_resize) override; @@ -79,6 +81,10 @@ vr::Mode mode_ = vr::Mode::kNoVr; + // The last collected source id + ukm::SourceId last_source_id_; + base::Time time_on_page_start_; + // state that gets translated into vr_mode: bool is_fullscreen_ = false; bool is_webvr_ = false;
diff --git a/chrome/browser/autofill/autofill_browsertest.cc b/chrome/browser/autofill/autofill_browsertest.cc index fc8c67f..bfbe1a6 100644 --- a/chrome/browser/autofill/autofill_browsertest.cc +++ b/chrome/browser/autofill/autofill_browsertest.cc
@@ -261,10 +261,9 @@ ASSERT_EQ(1u, personal_data_manager()->GetProfiles().size()); } -// Form submitted via JavaScript, with an event handler on the submit event -// which prevents submission of the form. Will not update the user's personal -// data. -IN_PROC_BROWSER_TEST_F(AutofillTest, ProfilesNotAggregatedWithSubmitHandler) { +// Form submitted via JavaScript, the user's personal data is updated even +// if the event handler on the submit event prevents submission of the form. +IN_PROC_BROWSER_TEST_F(AutofillTest, ProfilesAggregatedWithSubmitHandler) { FormMap data; data["NAME_FIRST"] = "Bob"; data["NAME_LAST"] = "Smith"; @@ -280,28 +279,12 @@ FillFormAndSubmitWithHandler("duplicate_profiles_test.html", data, submit, false, false); - // The AutofillManager will NOT update the user's profile. - EXPECT_EQ(0u, personal_data_manager()->GetProfiles().size()); + // The AutofillManager will update the user's profile. + EXPECT_EQ(1u, personal_data_manager()->GetProfiles().size()); - // We remove the submit handler and resubmit the form. This time the profile - // will be updated. This is to guard against the underlying mechanics changing - // and to try to avoid flakiness if this happens. We submit slightly different - // data to make sure the expected data is saved. - data["NAME_FIRST"] = "John"; - data["NAME_LAST"] = "Doe"; - std::string change_and_resubmit = - GetJSToFillForm(data) + - "document.forms[0].removeEventListener('submit', preventFunction);" - "document.querySelector('input[type=submit]').click();"; - WindowedPersonalDataManagerObserver observer(browser()); - ASSERT_TRUE(content::ExecuteScript(render_view_host(), change_and_resubmit)); - observer.Wait(); - - // The AutofillManager will update the user's profile this time. - ASSERT_EQ(1u, personal_data_manager()->GetProfiles().size()); - EXPECT_EQ(ASCIIToUTF16("John"), + EXPECT_EQ(ASCIIToUTF16("Bob"), personal_data_manager()->GetProfiles()[0]->GetRawInfo(NAME_FIRST)); - EXPECT_EQ(ASCIIToUTF16("Doe"), + EXPECT_EQ(ASCIIToUTF16("Smith"), personal_data_manager()->GetProfiles()[0]->GetRawInfo(NAME_LAST)); }
diff --git a/chrome/browser/autofill/autofill_provider_browsertest.cc b/chrome/browser/autofill/autofill_provider_browsertest.cc index d905b2ae..c86b1306 100644 --- a/chrome/browser/autofill/autofill_provider_browsertest.cc +++ b/chrome/browser/autofill/autofill_provider_browsertest.cc
@@ -11,6 +11,7 @@ #include "components/autofill/content/browser/content_autofill_driver_factory.h" #include "components/autofill/core/browser/test_autofill_client.h" #include "components/autofill/core/browser/test_autofill_provider.h" +#include "components/autofill/core/common/submission_source.h" #include "content/public/browser/web_contents.h" #include "content/public/common/url_constants.h" #include "content/public/test/browser_test_utils.h" @@ -20,35 +21,25 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +using ::testing::_; + namespace autofill { namespace { const base::FilePath::CharType kDocRoot[] = FILE_PATH_LITERAL("chrome/test/data"); -// The workaround class for MSVC warning C4373 -// see -// https://github.com/google/googlemock/blob/master/googlemock/docs/v1_5/FrequentlyAskedQuestions.md -class MockableAutofillProvider : public TestAutofillProvider { - public: - ~MockableAutofillProvider() override {} - bool OnWillSubmitForm(AutofillHandlerProxy* handler, - const FormData& form, - const base::TimeTicks timestamp) override { - return MockableOnWillSubmitForm(handler, form); - } - - virtual bool MockableOnWillSubmitForm(AutofillHandlerProxy* handler, - const FormData& form) = 0; -}; - -class MockAutofillProvider : public MockableAutofillProvider { +class MockAutofillProvider : public TestAutofillProvider { public: MockAutofillProvider() {} ~MockAutofillProvider() override {} - MOCK_METHOD2(MockableOnWillSubmitForm, - bool(AutofillHandlerProxy* handler, const FormData& form)); + MOCK_METHOD5(OnFormSubmitted, + bool(AutofillHandlerProxy* handler, + const FormData& form, + bool, + SubmissionSource, + base::TimeTicks)); }; } // namespace @@ -119,7 +110,7 @@ IN_PROC_BROWSER_TEST_F(AutofillProviderBrowserTest, FrameDetachedOnFormlessSubmission) { EXPECT_CALL(autofill_provider_, - MockableOnWillSubmitForm(testing::_, testing::_)) + OnFormSubmitted(_, _, _, SubmissionSource::FRAME_DETACHED, _)) .Times(1); ui_test_utils::NavigateToURL( browser(), embedded_test_server()->GetURL( @@ -153,7 +144,7 @@ IN_PROC_BROWSER_TEST_F(AutofillProviderBrowserTest, FrameDetachedOnFormSubmission) { EXPECT_CALL(autofill_provider_, - MockableOnWillSubmitForm(testing::_, testing::_)) + OnFormSubmitted(_, _, _, SubmissionSource::FORM_SUBMISSION, _)) .Times(1); ui_test_utils::NavigateToURL( browser(), embedded_test_server()->GetURL(
diff --git a/chrome/browser/browser_process_impl.h b/chrome/browser/browser_process_impl.h index 7d6dda1..a9d5d64 100644 --- a/chrome/browser/browser_process_impl.h +++ b/chrome/browser/browser_process_impl.h
@@ -26,11 +26,11 @@ #include "components/keep_alive_registry/keep_alive_state_observer.h" #include "components/nacl/common/features.h" #include "components/prefs/pref_change_registrar.h" -#include "content/public/common/network_service.mojom.h" #include "extensions/features/features.h" #include "media/media_features.h" #include "ppapi/features/features.h" #include "printing/features/features.h" +#include "services/network/public/interfaces/network_service.mojom.h" class ChromeChildProcessWatcher; class ChromeDeviceClient;
diff --git a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc index 595c6db4..62e5035 100644 --- a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc +++ b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc
@@ -406,7 +406,9 @@ const BrowsingDataFilterBuilder& filter_builder, int origin_type_mask, base::OnceClosure callback) { - DCHECK(((remove_mask & ~FILTERABLE_DATA_TYPES) == 0) || + DCHECK(((remove_mask & + ~content::BrowsingDataRemover::DATA_TYPE_AVOID_CLOSING_CONNECTIONS & + ~FILTERABLE_DATA_TYPES) == 0) || filter_builder.IsEmptyBlacklist()); // Embedder-defined DOM-accessible storage currently contains only
diff --git a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h index a9aedf5..57f7227 100644 --- a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h +++ b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h
@@ -94,9 +94,10 @@ // Datatypes that can be deleted partially per URL / origin / domain, // whichever makes sense. - FILTERABLE_DATA_TYPES = DATA_TYPE_SITE_DATA | - content::BrowsingDataRemover::DATA_TYPE_CACHE | - content::BrowsingDataRemover::DATA_TYPE_DOWNLOADS, + FILTERABLE_DATA_TYPES = + DATA_TYPE_SITE_DATA | + content::BrowsingDataRemover::DATA_TYPE_CACHE | + content::BrowsingDataRemover::DATA_TYPE_DOWNLOADS, // Includes all the available remove options. Meant to be used by clients // that wish to wipe as much data as possible from a Profile, to make it
diff --git a/chrome/browser/browsing_data/cookies_tree_model.cc b/chrome/browser/browsing_data/cookies_tree_model.cc index a6a5d9af..28041e4 100644 --- a/chrome/browser/browsing_data/cookies_tree_model.cc +++ b/chrome/browser/browsing_data/cookies_tree_model.cc
@@ -1121,7 +1121,7 @@ .GetNativeImageNamed(IDR_DEFAULT_FAVICON) .ToImageSkia()); icons->push_back(*ui::ResourceBundle::GetSharedInstance() - .GetNativeImageNamed(IDR_ACCESSED_COOKIES) + .GetNativeImageNamed(IDR_COOKIES) .ToImageSkia()); icons->push_back(*ui::ResourceBundle::GetSharedInstance() .GetNativeImageNamed(IDR_COOKIE_STORAGE_ICON)
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc index b6b20f6..3400d91 100644 --- a/chrome/browser/chrome_browser_main.cc +++ b/chrome/browser/chrome_browser_main.cc
@@ -80,6 +80,7 @@ #include "chrome/browser/nacl_host/nacl_browser_delegate_impl.h" #include "chrome/browser/performance_monitor/performance_monitor.h" #include "chrome/browser/plugins/plugin_prefs.h" +#include "chrome/browser/policy/chrome_browser_policy_connector.h" #include "chrome/browser/prefs/chrome_command_line_pref_store.h" #include "chrome/browser/prefs/chrome_pref_service_factory.h" #include "chrome/browser/prefs/incognito_mode_prefs.h" @@ -1064,6 +1065,8 @@ } #endif // defined(OS_MACOSX) + browser_process_->browser_policy_connector()->OnResourceBundleCreated(); + // Android does first run in Java instead of native. // Chrome OS has its own out-of-box-experience code. #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index 8d04261..d6cf360 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc
@@ -2861,7 +2861,7 @@ return g_browser_process->rappor_service(); } -content::mojom::NetworkContextPtr +network::mojom::NetworkContextPtr ChromeContentBrowserClient::CreateNetworkContext( content::BrowserContext* context, bool in_memory,
diff --git a/chrome/browser/chrome_content_browser_client.h b/chrome/browser/chrome_content_browser_client.h index 615751b..beea9dd9 100644 --- a/chrome/browser/chrome_content_browser_client.h +++ b/chrome/browser/chrome_content_browser_client.h
@@ -20,11 +20,11 @@ #include "build/build_config.h" #include "chrome/browser/chrome_service.h" #include "content/public/browser/content_browser_client.h" -#include "content/public/common/network_service.mojom.h" #include "content/public/common/resource_type.h" #include "extensions/features/features.h" #include "media/media_features.h" #include "ppapi/features/features.h" +#include "services/network/public/interfaces/network_service.mojom.h" #include "services/service_manager/public/cpp/binder_registry.h" class ChromeContentBrowserClientParts; @@ -358,7 +358,7 @@ std::unique_ptr<content::MemoryCoordinatorDelegate> GetMemoryCoordinatorDelegate() override; ::rappor::RapporService* GetRapporService() override; - content::mojom::NetworkContextPtr CreateNetworkContext( + network::mojom::NetworkContextPtr CreateNetworkContext( content::BrowserContext* context, bool in_memory, const base::FilePath& relative_partition_path) override;
diff --git a/chrome/browser/chrome_network_service_restart_browsertest.cc b/chrome/browser/chrome_network_service_restart_browsertest.cc index e89d21bb..a3d17074 100644 --- a/chrome/browser/chrome_network_service_restart_browsertest.cc +++ b/chrome/browser/chrome_network_service_restart_browsertest.cc
@@ -50,7 +50,8 @@ StoragePartition* partition = BrowserContext::GetDefaultStoragePartition(browser()->profile()); - mojom::NetworkContext* old_network_context = partition->GetNetworkContext(); + network::mojom::NetworkContext* old_network_context = + partition->GetNetworkContext(); EXPECT_EQ(net::OK, LoadBasicRequest(old_network_context, GetTestURL())); // Crash the NetworkService process. Existing interfaces should receive error @@ -77,7 +78,7 @@ SystemNetworkContextManager* system_network_context_manager = g_browser_process->system_network_context_manager(); - mojom::NetworkContext* old_network_context = + network::mojom::NetworkContext* old_network_context = system_network_context_manager->GetContext(); EXPECT_EQ(net::OK, LoadBasicRequest(old_network_context, GetTestURL()));
diff --git a/chrome/browser/chromeos/arc/arc_session_manager_unittest.cc b/chrome/browser/chromeos/arc/arc_session_manager_unittest.cc index 402adf68..9ae4b31 100644 --- a/chrome/browser/chromeos/arc/arc_session_manager_unittest.cc +++ b/chrome/browser/chromeos/arc/arc_session_manager_unittest.cc
@@ -127,7 +127,7 @@ const chromeos::LoginScreenContext& context) override {} void OnPreferencesChanged() override {} void OnStartAppLaunch() override {} - void StartArcKiosk(const AccountId& account_id) override {} + void OnStartArcKiosk() override {} void StartVoiceInteractionOobe() override { is_voice_interaction_oobe_ = true; }
diff --git a/chrome/browser/chromeos/login/ui/login_display_host.cc b/chrome/browser/chromeos/login/ui/login_display_host.cc index de1fd2b..74d725c 100644 --- a/chrome/browser/chromeos/login/ui/login_display_host.cc +++ b/chrome/browser/chromeos/login/ui/login_display_host.cc
@@ -6,6 +6,7 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/chromeos/login/app_launch_controller.h" +#include "chrome/browser/chromeos/login/arc_kiosk_controller.h" #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h" #include "chrome/browser/chromeos/login/startup_utils.h" #include "chrome/browser/chromeos/mobile_config.h" @@ -116,6 +117,16 @@ demo_app_launcher_->StartDemoAppLaunch(); } +void LoginDisplayHost::StartArcKiosk(const AccountId& account_id) { + VLOG(1) << "Login >> start ARC kiosk."; + SetStatusAreaVisible(false); + arc_kiosk_controller_ = + std::make_unique<ArcKioskController>(this, GetOobeUI()); + arc_kiosk_controller_->StartArcKiosk(account_id); + + OnStartArcKiosk(); +} + void LoginDisplayHost::OnAuthPrewarmDone() { auth_prewarmer_.reset(); }
diff --git a/chrome/browser/chromeos/login/ui/login_display_host.h b/chrome/browser/chromeos/login/ui/login_display_host.h index a4e59fa..c8181dd3 100644 --- a/chrome/browser/chromeos/login/ui/login_display_host.h +++ b/chrome/browser/chromeos/login/ui/login_display_host.h
@@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_HOST_H_ #define CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_HOST_H_ +#include <memory> #include <string> #include "base/callback_forward.h" @@ -19,6 +20,7 @@ namespace chromeos { +class ArcKioskController; class AppLaunchController; class DemoAppLauncher; class LoginScreenContext; @@ -102,7 +104,7 @@ void StartDemoAppLaunch(); // Starts ARC kiosk splash screen. - virtual void StartArcKiosk(const AccountId& account_id) = 0; + void StartArcKiosk(const AccountId& account_id); // Start voice interaction OOBE. virtual void StartVoiceInteractionOobe() = 0; @@ -116,6 +118,7 @@ virtual void OnStartSignInScreen(const LoginScreenContext& context) = 0; virtual void OnStartAppLaunch() = 0; + virtual void OnStartArcKiosk() = 0; // Deletes |auth_prewarmer_|. void OnAuthPrewarmDone(); @@ -129,6 +132,9 @@ // Demo app launcher. std::unique_ptr<DemoAppLauncher> demo_app_launcher_; + // ARC kiosk controller. + std::unique_ptr<ArcKioskController> arc_kiosk_controller_; + private: base::WeakPtrFactory<LoginDisplayHost> weak_factory_;
diff --git a/chrome/browser/chromeos/login/ui/login_display_host_views.cc b/chrome/browser/chromeos/login/ui/login_display_host_views.cc index 380f913..d5e1da0d 100644 --- a/chrome/browser/chromeos/login/ui/login_display_host_views.cc +++ b/chrome/browser/chromeos/login/ui/login_display_host_views.cc
@@ -4,6 +4,9 @@ #include "chrome/browser/chromeos/login/ui/login_display_host_views.h" +#include <string> +#include <utility> + #include "base/threading/thread_task_runner_handle.h" #include "chrome/browser/chromeos/login/existing_user_controller.h" #include "chrome/browser/chromeos/login/ui/login_display.h" @@ -102,7 +105,7 @@ NOTIMPLEMENTED(); } -void LoginDisplayHostViews::StartArcKiosk(const AccountId& account_id) { +void LoginDisplayHostViews::OnStartArcKiosk() { NOTIMPLEMENTED(); }
diff --git a/chrome/browser/chromeos/login/ui/login_display_host_views.h b/chrome/browser/chromeos/login/ui/login_display_host_views.h index f517aae..c5d4ffa 100644 --- a/chrome/browser/chromeos/login/ui/login_display_host_views.h +++ b/chrome/browser/chromeos/login/ui/login_display_host_views.h
@@ -6,6 +6,7 @@ #define CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_HOST_VIEWS_H_ #include <memory> +#include <string> #include "base/macros.h" #include "base/memory/weak_ptr.h" @@ -41,7 +42,7 @@ void OnStartSignInScreen(const LoginScreenContext& context) override; void OnPreferencesChanged() override; void OnStartAppLaunch() override; - void StartArcKiosk(const AccountId& account_id) override; + void OnStartArcKiosk() override; void StartVoiceInteractionOobe() override; bool IsVoiceInteractionOobe() override;
diff --git a/chrome/browser/chromeos/login/ui/login_display_host_webui.cc b/chrome/browser/chromeos/login/ui/login_display_host_webui.cc index 2cfc617..eefe88d 100644 --- a/chrome/browser/chromeos/login/ui/login_display_host_webui.cc +++ b/chrome/browser/chromeos/login/ui/login_display_host_webui.cc
@@ -35,7 +35,6 @@ #include "chrome/browser/chromeos/first_run/drive_first_run_controller.h" #include "chrome/browser/chromeos/first_run/first_run.h" #include "chrome/browser/chromeos/language_preferences.h" -#include "chrome/browser/chromeos/login/arc_kiosk_controller.h" #include "chrome/browser/chromeos/login/existing_user_controller.h" #include "chrome/browser/chromeos/login/helper.h" #include "chrome/browser/chromeos/login/login_wizard.h" @@ -774,10 +773,7 @@ login_view_->set_should_emit_login_prompt_visible(false); } -void LoginDisplayHostWebUI::StartArcKiosk(const AccountId& account_id) { - VLOG(1) << "Login WebUI >> start ARC kiosk."; - SetStatusAreaVisible(false); - +void LoginDisplayHostWebUI::OnStartArcKiosk() { // Animation is not supported in Mash. if (!ash_util::IsRunningInMash()) finalize_animation_type_ = ANIMATION_FADE_OUT; @@ -787,11 +783,6 @@ } login_view_->set_should_emit_login_prompt_visible(false); - - arc_kiosk_controller_ = - std::make_unique<ArcKioskController>(this, GetOobeUI()); - - arc_kiosk_controller_->StartArcKiosk(account_id); } bool LoginDisplayHostWebUI::IsVoiceInteractionOobe() {
diff --git a/chrome/browser/chromeos/login/ui/login_display_host_webui.h b/chrome/browser/chromeos/login/ui/login_display_host_webui.h index 9cef7681..4fa54d95 100644 --- a/chrome/browser/chromeos/login/ui/login_display_host_webui.h +++ b/chrome/browser/chromeos/login/ui/login_display_host_webui.h
@@ -31,7 +31,6 @@ #include "ui/views/widget/widget_removals_observer.h" #include "ui/wm/public/scoped_drag_drop_disabler.h" -class AccountId; class ScopedKeepAlive; namespace ash { @@ -40,7 +39,6 @@ namespace chromeos { -class ArcKioskController; class LoginDisplayWebUI; class WebUILoginView; @@ -74,7 +72,7 @@ void OnStartSignInScreen(const LoginScreenContext& context) override; void OnPreferencesChanged() override; void OnStartAppLaunch() override; - void StartArcKiosk(const AccountId& account_id) override; + void OnStartArcKiosk() override; bool IsVoiceInteractionOobe() override; void StartVoiceInteractionOobe() override; @@ -196,9 +194,6 @@ std::unique_ptr<SignInScreenController> signin_screen_controller_; - // ARC kiosk controller. - std::unique_ptr<ArcKioskController> arc_kiosk_controller_; - // Make sure chrome won't exit while we are at login/oobe screen. std::unique_ptr<ScopedKeepAlive> keep_alive_;
diff --git a/chrome/browser/chromeos/login/ui/mock_login_display_host.h b/chrome/browser/chromeos/login/ui/mock_login_display_host.h index eaaa8883..e161644 100644 --- a/chrome/browser/chromeos/login/ui/mock_login_display_host.h +++ b/chrome/browser/chromeos/login/ui/mock_login_display_host.h
@@ -47,7 +47,7 @@ MOCK_METHOD0(PrewarmAuthentication, void(void)); MOCK_METHOD0(OnStartAppLaunch, void()); MOCK_METHOD0(StartDemoAppLaunch, void(void)); - MOCK_METHOD1(StartArcKiosk, void(const AccountId&)); + MOCK_METHOD0(OnStartArcKiosk, void()); MOCK_METHOD0(StartVoiceInteractionOobe, void(void)); MOCK_METHOD0(IsVoiceInteractionOobe, bool(void));
diff --git a/chrome/browser/component_updater/vr_assets_component_installer.cc b/chrome/browser/component_updater/vr_assets_component_installer.cc index a0f458f..1d2ad29 100644 --- a/chrome/browser/component_updater/vr_assets_component_installer.cc +++ b/chrome/browser/component_updater/vr_assets_component_installer.cc
@@ -45,7 +45,7 @@ namespace component_updater { // static -void VrAssetsComponentInstallerTraits::UpdateComponent( +void VrAssetsComponentInstallerPolicy::UpdateComponent( ComponentUpdateService* cus) { #if BUILDFLAG(USE_VR_ASSETS_COMPONENT) const std::string crx_id = crx_file::id_util::GenerateIdFromHash( @@ -58,26 +58,26 @@ #endif // BUILDFLAG(USE_VR_ASSETS_COMPONENT) } -bool VrAssetsComponentInstallerTraits:: +bool VrAssetsComponentInstallerPolicy:: SupportsGroupPolicyEnabledComponentUpdates() const { return false; } -bool VrAssetsComponentInstallerTraits::RequiresNetworkEncryption() const { +bool VrAssetsComponentInstallerPolicy::RequiresNetworkEncryption() const { return false; } update_client::CrxInstaller::Result -VrAssetsComponentInstallerTraits::OnCustomInstall( +VrAssetsComponentInstallerPolicy::OnCustomInstall( const base::DictionaryValue& manifest, const base::FilePath& install_dir) { return update_client::CrxInstaller::Result(0); } -void VrAssetsComponentInstallerTraits::OnCustomUninstall() {} +void VrAssetsComponentInstallerPolicy::OnCustomUninstall() {} // Called during startup and installation before ComponentReady(). -bool VrAssetsComponentInstallerTraits::VerifyInstallation( +bool VrAssetsComponentInstallerPolicy::VerifyInstallation( const base::DictionaryValue& manifest, const base::FilePath& install_dir) const { auto* version_value = manifest.FindKey("version"); @@ -107,7 +107,7 @@ return true; } -void VrAssetsComponentInstallerTraits::ComponentReady( +void VrAssetsComponentInstallerPolicy::ComponentReady( const base::Version& version, const base::FilePath& install_dir, std::unique_ptr<base::DictionaryValue> manifest) { @@ -122,27 +122,27 @@ std::move(manifest)); } -base::FilePath VrAssetsComponentInstallerTraits::GetRelativeInstallDir() const { +base::FilePath VrAssetsComponentInstallerPolicy::GetRelativeInstallDir() const { return base::FilePath(kRelativeInstallDir); } -void VrAssetsComponentInstallerTraits::GetHash( +void VrAssetsComponentInstallerPolicy::GetHash( std::vector<uint8_t>* hash) const { hash->assign(kVrAssetsPublicKeySHA256, kVrAssetsPublicKeySHA256 + arraysize(kVrAssetsPublicKeySHA256)); } -std::string VrAssetsComponentInstallerTraits::GetName() const { +std::string VrAssetsComponentInstallerPolicy::GetName() const { return kVrAssetsComponentName; } update_client::InstallerAttributes -VrAssetsComponentInstallerTraits::GetInstallerAttributes() const { +VrAssetsComponentInstallerPolicy::GetInstallerAttributes() const { return {{"compatible_major_version", std::to_string(vr::kCompatibleMajorVrAssetsComponentVersion)}}; } -std::vector<std::string> VrAssetsComponentInstallerTraits::GetMimeTypes() +std::vector<std::string> VrAssetsComponentInstallerPolicy::GetMimeTypes() const { return std::vector<std::string>(); } @@ -150,7 +150,7 @@ void RegisterVrAssetsComponent(ComponentUpdateService* cus) { #if BUILDFLAG(USE_VR_ASSETS_COMPONENT) std::unique_ptr<ComponentInstallerPolicy> policy( - new VrAssetsComponentInstallerTraits()); + new VrAssetsComponentInstallerPolicy()); auto installer = base::MakeRefCounted<ComponentInstaller>(std::move(policy)); installer->Register(cus, base::Closure()); vr::AssetsLoader::GetInstance()->GetMetricsHelper()->OnRegisteredComponent(); @@ -159,7 +159,7 @@ } void UpdateVrAssetsComponent(ComponentUpdateService* cus) { - VrAssetsComponentInstallerTraits::UpdateComponent(cus); + VrAssetsComponentInstallerPolicy::UpdateComponent(cus); } } // namespace component_updater
diff --git a/chrome/browser/component_updater/vr_assets_component_installer.h b/chrome/browser/component_updater/vr_assets_component_installer.h index e2c9406..e7b1b80 100644 --- a/chrome/browser/component_updater/vr_assets_component_installer.h +++ b/chrome/browser/component_updater/vr_assets_component_installer.h
@@ -24,10 +24,10 @@ class ComponentUpdateService; -class VrAssetsComponentInstallerTraits : public ComponentInstallerPolicy { +class VrAssetsComponentInstallerPolicy : public ComponentInstallerPolicy { public: - VrAssetsComponentInstallerTraits() {} - ~VrAssetsComponentInstallerTraits() override {} + VrAssetsComponentInstallerPolicy() {} + ~VrAssetsComponentInstallerPolicy() override {} private: static void UpdateComponent(ComponentUpdateService* cus); @@ -52,7 +52,7 @@ friend void UpdateVrAssetsComponent(ComponentUpdateService* cus); - DISALLOW_COPY_AND_ASSIGN(VrAssetsComponentInstallerTraits); + DISALLOW_COPY_AND_ASSIGN(VrAssetsComponentInstallerPolicy); }; // Call once to make the component update service aware of the VR Assets
diff --git a/chrome/browser/cryptauth/chrome_cryptauth_service.cc b/chrome/browser/cryptauth/chrome_cryptauth_service.cc index e7f57e5..fdec67d 100644 --- a/chrome/browser/cryptauth/chrome_cryptauth_service.cc +++ b/chrome/browser/cryptauth/chrome_cryptauth_service.cc
@@ -44,12 +44,10 @@ namespace { -PrefService* GetLocalState() { - return g_browser_process ? g_browser_process->local_state() : nullptr; -} - std::string GetDeviceId() { - PrefService* local_state = GetLocalState(); + PrefService* local_state = + g_browser_process ? g_browser_process->local_state() : nullptr; + if (!local_state) return std::string();
diff --git a/chrome/browser/data_use_measurement/chrome_data_use_ascriber.cc b/chrome/browser/data_use_measurement/chrome_data_use_ascriber.cc index 2011c91c..4415005 100644 --- a/chrome/browser/data_use_measurement/chrome_data_use_ascriber.cc +++ b/chrome/browser/data_use_measurement/chrome_data_use_ascriber.cc
@@ -189,41 +189,49 @@ return entry; } -void ChromeDataUseAscriber::OnUrlRequestCompleted( - const net::URLRequest& request, - bool started) { +void ChromeDataUseAscriber::OnUrlRequestCompleted(net::URLRequest* request, + bool started) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); - - ChromeDataUseRecorder* recorder = GetDataUseRecorder(request); - - if (!recorder) - return; - - for (auto& observer : observers_) - observer.OnPageResourceLoad(request, &recorder->data_use()); - - const content::ResourceRequestInfo* request_info = - content::ResourceRequestInfo::ForRequest(&request); - if (!request_info || - request_info->GetResourceType() != content::RESOURCE_TYPE_MAIN_FRAME) { - return; - } - - // If mainframe request was not successful, then NavigationHandle in - // DidFinishMainFrameNavigation will not have GlobalRequestID. So we erase the - // DataUseRecorderEntry here. - if (!request.status().is_success()) - pending_navigation_data_use_map_.erase(recorder->main_frame_request_id()); -} - -void ChromeDataUseAscriber::OnUrlRequestDestroyed(net::URLRequest* request) { - DCHECK_CURRENTLY_ON(content::BrowserThread::IO); + DCHECK(request); const DataUseRecorderEntry entry = GetDataUseRecorderEntry(request); if (entry == data_use_recorders_.end()) return; + for (auto& observer : observers_) + observer.OnPageResourceLoad(*request, &entry->data_use()); + + OnUrlRequestCompletedOrDestroyed(request); +} + +void ChromeDataUseAscriber::OnUrlRequestDestroyed(net::URLRequest* request) { + OnUrlRequestCompletedOrDestroyed(request); +} + +void ChromeDataUseAscriber::OnUrlRequestCompletedOrDestroyed( + net::URLRequest* request) { + DCHECK_CURRENTLY_ON(content::BrowserThread::IO); + DCHECK(request); + + const DataUseRecorderEntry entry = GetDataUseRecorderEntry(request); + + if (entry == data_use_recorders_.end()) + return; + + { + const content::ResourceRequestInfo* request_info = + content::ResourceRequestInfo::ForRequest(request); + if (request_info && + request_info->GetResourceType() == content::RESOURCE_TYPE_MAIN_FRAME && + !request->status().is_success()) { + // If mainframe request was not successful, then NavigationHandle in + // DidFinishMainFrameNavigation will not have GlobalRequestID. So we erase + // the DataUseRecorderEntry here. + pending_navigation_data_use_map_.erase(entry->main_frame_request_id()); + } + } + const auto main_frame_it = main_render_frame_entry_map_.find(entry->main_frame_id()); @@ -432,9 +440,6 @@ // subresource requests started and get asribed to |old_frame_entry|. Move // these requests that started after |time| but ascribed to the previous // page load to page load |entry|. - // TODO(rajendrant): This does not move completed requests. It is possible - // that requests could complete (more likely for cached requests) before - // this code is executed. crbug.com/738522 std::vector<net::URLRequest*> pending_url_requests; old_frame_entry->GetPendingURLRequests(&pending_url_requests); for (net::URLRequest* request : pending_url_requests) {
diff --git a/chrome/browser/data_use_measurement/chrome_data_use_ascriber.h b/chrome/browser/data_use_measurement/chrome_data_use_ascriber.h index ce54ee1..371a08c 100644 --- a/chrome/browser/data_use_measurement/chrome_data_use_ascriber.h +++ b/chrome/browser/data_use_measurement/chrome_data_use_ascriber.h
@@ -59,8 +59,7 @@ net::URLRequest* request) override; ChromeDataUseRecorder* GetDataUseRecorder( const net::URLRequest& request) override; - void OnUrlRequestCompleted(const net::URLRequest& request, - bool started) override; + void OnUrlRequestCompleted(net::URLRequest* request, bool started) override; void OnUrlRequestDestroyed(net::URLRequest* request) override; std::unique_ptr<URLRequestClassifier> CreateURLRequestClassifier() const override; @@ -113,6 +112,8 @@ private: friend class ChromeDataUseAscriberTest; + void OnUrlRequestCompletedOrDestroyed(net::URLRequest* request); + // Entry in the |data_use_recorders_| list which owns all instances of // DataUseRecorder. std::list is used so that iterators remain valid until the // lifetime of the container, and will not be invalidated when container is
diff --git a/chrome/browser/data_use_measurement/chrome_data_use_ascriber_unittest.cc b/chrome/browser/data_use_measurement/chrome_data_use_ascriber_unittest.cc index 70573c2..fed46c2 100644 --- a/chrome/browser/data_use_measurement/chrome_data_use_ascriber_unittest.cc +++ b/chrome/browser/data_use_measurement/chrome_data_use_ascriber_unittest.cc
@@ -449,7 +449,7 @@ // Failed request will remove the pending entry. request->Cancel(); - ascriber()->OnUrlRequestCompleted(*request, false); + ascriber()->OnUrlRequestCompleted(request.get(), false); ascriber()->RenderFrameDeleted(kRenderProcessId, kRenderFrameId, -1, -1); ascriber()->OnUrlRequestDestroyed(request.get()); @@ -491,7 +491,7 @@ ascriber()->OnNetworkBytesReceived(request.get(), 2); EXPECT_CALL(mock_observer, OnPageResourceLoad(testing::_, data_use)).Times(1); - ascriber()->OnUrlRequestCompleted(*request, false); + ascriber()->OnUrlRequestCompleted(request.get(), false); EXPECT_CALL(mock_observer, OnPageLoadCommit(data_use)).Times(1); EXPECT_CALL(mock_observer, OnPageLoadConcluded(testing::_)).Times(1); @@ -548,7 +548,7 @@ ascriber()->OnNetworkBytesReceived(request.get(), 2); EXPECT_CALL(mock_observer, OnPageResourceLoad(testing::_, data_use)).Times(1); - ascriber()->OnUrlRequestCompleted(*request, false); + ascriber()->OnUrlRequestCompleted(request.get(), false); EXPECT_CALL(mock_observer, OnPageLoadCommit(data_use)).Times(1); EXPECT_CALL(mock_observer, OnPageLoadConcluded(testing::_)).Times(1);
diff --git a/chrome/browser/download/download_dir_policy_handler_unittest.cc b/chrome/browser/download/download_dir_policy_handler_unittest.cc index 194957cb..b0ed768b 100644 --- a/chrome/browser/download/download_dir_policy_handler_unittest.cc +++ b/chrome/browser/download/download_dir_policy_handler_unittest.cc
@@ -51,8 +51,7 @@ public: void SetUp() override { recommended_store_ = new policy::ConfigurationPolicyPrefStore( - policy_service_.get(), - &handler_list_, + nullptr, policy_service_.get(), &handler_list_, policy::POLICY_LEVEL_RECOMMENDED); handler_list_.AddHandler( base::WrapUnique<policy::ConfigurationPolicyHandler>(
diff --git a/chrome/browser/extensions/api/cookies/cookies_api.cc b/chrome/browser/extensions/api/cookies/cookies_api.cc index 6a5ef9f..f770803 100644 --- a/chrome/browser/extensions/api/cookies/cookies_api.cc +++ b/chrome/browser/extensions/api/cookies/cookies_api.cc
@@ -27,13 +27,13 @@ #include "content/public/browser/browser_thread.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/storage_partition.h" -#include "content/public/common/network_service.mojom.h" #include "extensions/browser/event_router.h" #include "extensions/common/error_utils.h" #include "extensions/common/extension.h" #include "extensions/common/permissions/permissions_data.h" #include "net/cookies/canonical_cookie.h" #include "net/cookies/cookie_constants.h" +#include "services/network/public/interfaces/network_service.mojom.h" using content::BrowserThread;
diff --git a/chrome/browser/extensions/display_info_provider_chromeos.cc b/chrome/browser/extensions/display_info_provider_chromeos.cc index 5528819..2c00749a 100644 --- a/chrome/browser/extensions/display_info_provider_chromeos.cc +++ b/chrome/browser/extensions/display_info_provider_chromeos.cc
@@ -385,6 +385,10 @@ } } + // Update the display zoom. + if (info.display_zoom_factor) + display_manager->UpdateZoomFactor(id, *info.display_zoom_factor); + // Set the display mode. if (info.display_mode) { display::ManagedDisplayMode current_mode; @@ -745,6 +749,9 @@ } } + unit->display_zoom_factor = + display_manager->GetZoomFactorForDisplay(display.id()); + const display::ManagedDisplayInfo& display_info = display_manager->GetDisplayInfo(display.id()); const float device_dpi = display_info.device_dpi();
diff --git a/chrome/browser/extensions/display_info_provider_chromeos_unittest.cc b/chrome/browser/extensions/display_info_provider_chromeos_unittest.cc index ce9a2df..943d4b69 100644 --- a/chrome/browser/extensions/display_info_provider_chromeos_unittest.cc +++ b/chrome/browser/extensions/display_info_provider_chromeos_unittest.cc
@@ -1626,6 +1626,74 @@ EXPECT_TRUE(success); } +TEST_F(DisplayInfoProviderChromeosTest, GetDisplayZoomFactor) { + UpdateDisplay("1200x600,600x1000*2"); + display::DisplayIdList display_id_list = + display_manager()->GetCurrentDisplayIdList(); + + float zoom_factor_1 = 1.23f; + float zoom_factor_2 = 2.34f; + display_manager()->UpdateZoomFactor(display_id_list[0], zoom_factor_1); + display_manager()->UpdateZoomFactor(display_id_list[1], zoom_factor_2); + + DisplayUnitInfoList displays = GetAllDisplaysInfo(); + + for (const auto& display : displays) { + if (display.id == base::Int64ToString(display_id_list[0])) + EXPECT_EQ(display.display_zoom_factor, zoom_factor_1); + if (display.id == base::Int64ToString(display_id_list[1])) + EXPECT_EQ(display.display_zoom_factor, zoom_factor_2); + } +} + +TEST_F(DisplayInfoProviderChromeosTest, SetDisplayZoomFactor) { + UpdateDisplay("1200x600,600x1000*2"); + display::DisplayIdList display_id_list = + display_manager()->GetCurrentDisplayIdList(); + + float zoom_factor_1 = 1.23f; + float zoom_factor_2 = 2.34f; + display_manager()->UpdateZoomFactor(display_id_list[0], zoom_factor_2); + display_manager()->UpdateZoomFactor(display_id_list[1], zoom_factor_1); + + EXPECT_EQ(display_manager()->GetZoomFactorForDisplay(display_id_list[0]), + zoom_factor_2); + EXPECT_EQ(display_manager()->GetZoomFactorForDisplay(display_id_list[1]), + zoom_factor_1); + + // After update, display 1 should have |final_zoom_factor_1| as its zoom + // factor and display 2 should have |final_zoom_factor_2| as its zoom factor. + float final_zoom_factor_1 = zoom_factor_1; + float final_zoom_factor_2 = zoom_factor_2; + + api::system_display::DisplayProperties info; + info.display_zoom_factor = std::make_unique<double>(zoom_factor_1); + + bool success = false; + std::string error; + CallSetDisplayUnitInfo(base::Int64ToString(display_id_list[0]), info, + &success, &error); + ASSERT_TRUE(success); + + EXPECT_EQ(display_manager()->GetZoomFactorForDisplay(display_id_list[0]), + final_zoom_factor_1); + // Display 2 has not been updated yet, so it will still have the old zoom + // factor. + EXPECT_EQ(display_manager()->GetZoomFactorForDisplay(display_id_list[1]), + zoom_factor_1); + + info.display_zoom_factor = std::make_unique<double>(zoom_factor_2); + CallSetDisplayUnitInfo(base::Int64ToString(display_id_list[1]), info, + &success, &error); + ASSERT_TRUE(success); + + // Both displays should now have the correct zoom factor set. + EXPECT_EQ(display_manager()->GetZoomFactorForDisplay(display_id_list[0]), + final_zoom_factor_1); + EXPECT_EQ(display_manager()->GetZoomFactorForDisplay(display_id_list[1]), + final_zoom_factor_2); +} + class DisplayInfoProviderChromeosTouchviewTest : public DisplayInfoProviderChromeosTest { public:
diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc index 57ec77e6..53ddccae 100644 --- a/chrome/browser/extensions/extension_service_unittest.cc +++ b/chrome/browser/extensions/extension_service_unittest.cc
@@ -100,7 +100,6 @@ #include "content/public/browser/render_process_host.h" #include "content/public/browser/storage_partition.h" #include "content/public/common/content_constants.h" -#include "content/public/common/network_service.mojom.h" #include "content/public/test/test_browser_thread_bundle.h" #include "content/public/test/test_utils.h" #include "extensions/browser/disable_reason.h" @@ -138,6 +137,7 @@ #include "net/url_request/url_request_context_getter.h" #include "ppapi/features/features.h" #include "services/network/public/interfaces/cookie_manager.mojom.h" +#include "services/network/public/interfaces/network_service.mojom.h" #include "storage/browser/database/database_tracker.h" #include "storage/browser/quota/quota_manager.h" #include "storage/common/database/database_identifier.h" @@ -5021,7 +5021,7 @@ EXPECT_TRUE(profile()->GetExtensionSpecialStoragePolicy()->IsStorageUnlimited( origin2)); - content::mojom::NetworkContext* network_context = + network::mojom::NetworkContext* network_context = content::BrowserContext::GetDefaultStoragePartition(profile()) ->GetNetworkContext(); network::mojom::CookieManagerPtr cookie_manager_ptr;
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index b7f8dad..f82ba49 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc
@@ -496,7 +496,7 @@ "CORS handling logic is moved out of blink."; const char kEnableOutOfProcessHeapProfilingName[] = - "Out of process heap profiling."; + "Out of process heap profiling start mode."; const char kEnableOutOfProcessHeapProfilingDescription[] = "Creates a profiling service that records stacktraces for all live, " "malloced objects. Heap dumps can be obtained at chrome://tracing " @@ -2252,6 +2252,10 @@ "Show a microphone for voice search on the local New Tab page " "if Google is the default search engine."; +const char kEnableWebAuthenticationAPIName[] = "Web Authentication API."; +const char kEnableWebAuthenticationAPIDescription[] = + "Enable Web Authentication API support."; + #if defined(GOOGLE_CHROME_BUILD) const char kGoogleBrandedContextMenuName[] =
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index bb2facb..3a16208 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -1372,6 +1372,9 @@ extern const char kVoiceSearchOnLocalNtpName[]; extern const char kVoiceSearchOnLocalNtpDescription[]; +extern const char kEnableWebAuthenticationAPIName[]; +extern const char kEnableWebAuthenticationAPIDescription[]; + #if defined(GOOGLE_CHROME_BUILD) extern const char kGoogleBrandedContextMenuName[];
diff --git a/chrome/browser/io_thread.h b/chrome/browser/io_thread.h index 0865c4f4..b2efc3a 100644 --- a/chrome/browser/io_thread.h +++ b/chrome/browser/io_thread.h
@@ -29,11 +29,11 @@ #include "components/ssl_config/ssl_config_service_manager.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread_delegate.h" -#include "content/public/common/network_service.mojom.h" #include "content/public/network/url_request_context_owner.h" #include "extensions/features/features.h" #include "net/base/network_change_notifier.h" #include "net/nqe/network_quality_estimator.h" +#include "services/network/public/interfaces/network_service.mojom.h" class PrefRegistrySimple; class PrefService; @@ -132,7 +132,7 @@ std::unique_ptr<net::HttpAuthPreferences> http_auth_preferences; // When the network service is enabled, this holds on to a // content::NetworkContext class that owns |system_request_context|. - std::unique_ptr<content::mojom::NetworkContext> system_network_context; + std::unique_ptr<network::mojom::NetworkContext> system_network_context; // When the network service is disabled, this owns |system_request_context|. content::URLRequestContextOwner system_request_context_owner; net::URLRequestContext* system_request_context; @@ -219,7 +219,7 @@ // NetworkService created through ServiceManager; when out-of-process // NetworkService is not enabld, this is a Mojo interface to the IOThread's // in-process NetworkService that lives on the IO thread. - content::mojom::NetworkService* GetNetworkServiceOnUIThread(); + network::mojom::NetworkService* GetNetworkServiceOnUIThread(); certificate_transparency::TreeStateTracker* ct_tree_tracker() const; @@ -315,8 +315,8 @@ // These are set on the UI thread, and then consumed during initialization on // the IO thread. - content::mojom::NetworkContextRequest network_context_request_; - content::mojom::NetworkContextParamsPtr network_context_params_; + network::mojom::NetworkContextRequest network_context_request_; + network::mojom::NetworkContextParamsPtr network_context_params_; // This is an instance of the default SSLConfigServiceManager for the current // platform and it gets SSL preferences from local_state object.
diff --git a/chrome/browser/media/unified_autoplay_browsertest.cc b/chrome/browser/media/unified_autoplay_browsertest.cc new file mode 100644 index 0000000..83aedaa --- /dev/null +++ b/chrome/browser/media/unified_autoplay_browsertest.cc
@@ -0,0 +1,148 @@ +// Copyright 2018 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 "base/test/scoped_feature_list.h" +#include "chrome/browser/ui/browser.h" +#include "chrome/test/base/in_process_browser_test.h" +#include "chrome/test/base/ui_test_utils.h" +#include "content/public/browser/render_frame_host.h" +#include "content/public/browser/render_process_host.h" +#include "content/public/browser/web_contents_observer.h" +#include "content/public/test/browser_test_utils.h" +#include "content/public/test/test_navigation_observer.h" +#include "media/base/media_switches.h" +#include "net/dns/mock_host_resolver.h" + +namespace { + +static constexpr char const kTestPagePath[] = "/media/unified_autoplay.html"; + +} // anonymous namespace + +// Integration tests for the unified autoplay policy that require the //chrome +// layer. +// These tests are called "UnifiedAutoplayBrowserTest" in order to avoid name +// conflict with "AutoplayBrowserTest" in extensions code. +class UnifiedAutoplayBrowserTest : public InProcessBrowserTest { + public: + ~UnifiedAutoplayBrowserTest() override = default; + + void SetUpOnMainThread() override { + scoped_feature_list_.InitAndEnableFeature(media::kUnifiedAutoplay); + + host_resolver()->AddRule("*", "127.0.0.1"); + ASSERT_TRUE(embedded_test_server()->Start()); + + InProcessBrowserTest::SetUpOnMainThread(); + } + + content::WebContents* OpenNewTab(const GURL& url, bool from_context_menu) { + return OpenInternal(url, from_context_menu, + WindowOpenDisposition::NEW_FOREGROUND_TAB); + } + + content::WebContents* OpenNewWindow(const GURL& url, bool from_context_menu) { + return OpenInternal(url, from_context_menu, + WindowOpenDisposition::NEW_WINDOW); + } + + bool AttemptPlay(content::WebContents* web_contents) { + bool played = false; + EXPECT_TRUE(content::ExecuteScriptWithoutUserGestureAndExtractBool( + web_contents, "attemptPlay();", &played)); + return played; + } + + private: + content::WebContents* OpenInternal(const GURL& url, + bool from_context_menu, + WindowOpenDisposition disposition) { + content::WebContents* active_contents = + browser()->tab_strip_model()->GetActiveWebContents(); + + content::Referrer referrer( + active_contents->GetLastCommittedURL(), + blink::WebReferrerPolicy::kWebReferrerPolicyAlways); + + content::OpenURLParams open_url_params(url, referrer, disposition, + ui::PAGE_TRANSITION_LINK, false, + from_context_menu); + + open_url_params.source_render_process_id = + active_contents->GetMainFrame()->GetProcess()->GetID(); + open_url_params.source_render_frame_id = + active_contents->GetMainFrame()->GetRoutingID(); + + return active_contents->OpenURL(open_url_params); + } + + base::test::ScopedFeatureList scoped_feature_list_; +}; + +IN_PROC_BROWSER_TEST_F(UnifiedAutoplayBrowserTest, OpenSameOriginOutsideMenu) { + const GURL kTestPageUrl = embedded_test_server()->GetURL(kTestPagePath); + + ui_test_utils::NavigateToURL(browser(), kTestPageUrl); + + content::WebContents* new_contents = OpenNewTab(kTestPageUrl, false); + content::WaitForLoadStop(new_contents); + + EXPECT_FALSE(AttemptPlay(new_contents)); +} + +IN_PROC_BROWSER_TEST_F(UnifiedAutoplayBrowserTest, OpenSameOriginFromMenu) { + const GURL kTestPageUrl = embedded_test_server()->GetURL(kTestPagePath); + + ui_test_utils::NavigateToURL(browser(), kTestPageUrl); + + content::WebContents* new_contents = OpenNewTab(kTestPageUrl, true); + content::WaitForLoadStop(new_contents); + + EXPECT_TRUE(AttemptPlay(new_contents)); +} + +IN_PROC_BROWSER_TEST_F(UnifiedAutoplayBrowserTest, OpenCrossOriginFromMenu) { + ui_test_utils::NavigateToURL( + browser(), + embedded_test_server()->GetURL("foo.example.com", kTestPagePath)); + + content::WebContents* new_contents = OpenNewTab( + embedded_test_server()->GetURL("bar.example.com", kTestPagePath), true); + content::WaitForLoadStop(new_contents); + + EXPECT_TRUE(AttemptPlay(new_contents)); +} + +IN_PROC_BROWSER_TEST_F(UnifiedAutoplayBrowserTest, OpenCrossDomainFromMenu) { + ui_test_utils::NavigateToURL(browser(), + embedded_test_server()->GetURL(kTestPagePath)); + + content::WebContents* new_contents = OpenNewTab( + embedded_test_server()->GetURL("example.com", kTestPagePath), true); + content::WaitForLoadStop(new_contents); + + EXPECT_FALSE(AttemptPlay(new_contents)); +} + +IN_PROC_BROWSER_TEST_F(UnifiedAutoplayBrowserTest, OpenWindowFromContextMenu) { + const GURL kTestPageUrl = embedded_test_server()->GetURL(kTestPagePath); + + ui_test_utils::NavigateToURL(browser(), kTestPageUrl); + + content::WebContents* new_contents = OpenNewTab(kTestPageUrl, true); + content::WaitForLoadStop(new_contents); + + EXPECT_TRUE(AttemptPlay(new_contents)); +} + +IN_PROC_BROWSER_TEST_F(UnifiedAutoplayBrowserTest, OpenWindowNotContextMenu) { + const GURL kTestPageUrl = embedded_test_server()->GetURL(kTestPagePath); + + ui_test_utils::NavigateToURL(browser(), kTestPageUrl); + + content::WebContents* new_contents = OpenNewTab(kTestPageUrl, false); + content::WaitForLoadStop(new_contents); + + EXPECT_FALSE(AttemptPlay(new_contents)); +}
diff --git a/chrome/browser/net/default_network_context_params.cc b/chrome/browser/net/default_network_context_params.cc index fa76267f..bb546f2 100644 --- a/chrome/browser/net/default_network_context_params.cc +++ b/chrome/browser/net/default_network_context_params.cc
@@ -23,9 +23,9 @@ #include "content/public/common/user_agent.h" #include "services/proxy_resolver/public/interfaces/proxy_resolver.mojom.h" -content::mojom::NetworkContextParamsPtr CreateDefaultNetworkContextParams() { - content::mojom::NetworkContextParamsPtr network_context_params = - content::mojom::NetworkContextParams::New(); +network::mojom::NetworkContextParamsPtr CreateDefaultNetworkContextParams() { + network::mojom::NetworkContextParamsPtr network_context_params = + network::mojom::NetworkContextParams::New(); network_context_params->enable_brotli = base::FeatureList::IsEnabled(features::kBrotliEncoding);
diff --git a/chrome/browser/net/default_network_context_params.h b/chrome/browser/net/default_network_context_params.h index ede8dbfa..c7a739a0 100644 --- a/chrome/browser/net/default_network_context_params.h +++ b/chrome/browser/net/default_network_context_params.h
@@ -5,9 +5,9 @@ #ifndef CHROME_BROWSER_NET_DEFAULT_NETWORK_CONTEXT_PARAMS_H_ #define CHROME_BROWSER_NET_DEFAULT_NETWORK_CONTEXT_PARAMS_H_ -#include "content/public/common/network_service.mojom.h" +#include "services/network/public/interfaces/network_service.mojom.h" // Returns default set of parameters for configuring the network service. -content::mojom::NetworkContextParamsPtr CreateDefaultNetworkContextParams(); +network::mojom::NetworkContextParamsPtr CreateDefaultNetworkContextParams(); #endif // CHROME_BROWSER_NET_DEFAULT_NETWORK_CONTEXT_PARAMS_H_
diff --git a/chrome/browser/net/network_connection_tracker_browsertest.cc b/chrome/browser/net/network_connection_tracker_browsertest.cc index 3f0d9383..17c4740 100644 --- a/chrome/browser/net/network_connection_tracker_browsertest.cc +++ b/chrome/browser/net/network_connection_tracker_browsertest.cc
@@ -13,12 +13,12 @@ #include "chrome/test/base/in_process_browser_test.h" #include "content/public/common/content_features.h" #include "content/public/common/network_connection_tracker.h" -#include "content/public/common/network_service_test.mojom.h" #include "content/public/common/service_manager_connection.h" #include "content/public/common/service_names.mojom.h" #include "content/public/test/browser_test.h" #include "content/public/test/browser_test_utils.h" #include "net/base/network_change_notifier.h" +#include "services/network/public/interfaces/network_service_test.mojom.h" #include "services/service_manager/public/cpp/connector.h" namespace content { @@ -88,7 +88,7 @@ void SimulateNetworkChange(network::mojom::ConnectionType type) { if (network_service_enabled_ && !content::IsNetworkServiceRunningInProcess()) { - mojom::NetworkServiceTestPtr network_service_test; + network::mojom::NetworkServiceTestPtr network_service_test; ServiceManagerConnection::GetForProcess()->GetConnector()->BindInterface( mojom::kNetworkServiceName, &network_service_test); base::RunLoop run_loop;
diff --git a/chrome/browser/net/network_context_configuration_browsertest.cc b/chrome/browser/net/network_context_configuration_browsertest.cc index 62fece6..f8c01c3 100644 --- a/chrome/browser/net/network_context_configuration_browsertest.cc +++ b/chrome/browser/net/network_context_configuration_browsertest.cc
@@ -29,7 +29,6 @@ #include "content/public/browser/storage_partition.h" #include "content/public/common/content_features.h" #include "content/public/common/content_switches.h" -#include "content/public/common/network_service.mojom.h" #include "content/public/common/simple_url_loader.h" #include "content/public/common/url_constants.h" #include "content/public/test/browser_test_utils.h" @@ -47,6 +46,7 @@ #include "net/traffic_annotation/network_traffic_annotation_test_helper.h" #include "services/network/public/cpp/resource_response.h" #include "services/network/public/cpp/resource_response_info.h" +#include "services/network/public/interfaces/network_service.mojom.h" #include "services/network/public/interfaces/url_loader.mojom.h" #include "services/network/public/interfaces/url_loader_factory.mojom.h" #include "testing/gtest/include/gtest/gtest.h" @@ -133,7 +133,7 @@ return nullptr; } - content::mojom::NetworkContext* network_context() const { + network::mojom::NetworkContext* network_context() const { switch (GetParam().network_context_type) { case NetworkContextType::kSystem: return g_browser_process->system_network_context_manager()
diff --git a/chrome/browser/net/profile_network_context_service.cc b/chrome/browser/net/profile_network_context_service.cc index e8daf34..9a3e863 100644 --- a/chrome/browser/net/profile_network_context_service.cc +++ b/chrome/browser/net/profile_network_context_service.cc
@@ -42,7 +42,7 @@ ProfileNetworkContextService::~ProfileNetworkContextService() {} -content::mojom::NetworkContextPtr +network::mojom::NetworkContextPtr ProfileNetworkContextService::CreateMainNetworkContext() { if (!base::FeatureList::IsEnabled(features::kNetworkService)) { // |profile_io_data_main_network_context_| may be initialized if @@ -54,15 +54,15 @@ return std::move(profile_io_data_main_network_context_); } - content::mojom::NetworkContextPtr network_context; + network::mojom::NetworkContextPtr network_context; content::GetNetworkService()->CreateNetworkContext( MakeRequest(&network_context), CreateMainNetworkContextParams()); return network_context; } void ProfileNetworkContextService::SetUpProfileIODataMainContext( - content::mojom::NetworkContextRequest* network_context_request, - content::mojom::NetworkContextParamsPtr* network_context_params) { + network::mojom::NetworkContextRequest* network_context_request, + network::mojom::NetworkContextParamsPtr* network_context_params) { DCHECK(network_context_request); DCHECK(network_context_params); @@ -82,7 +82,7 @@ // Just use default if network service is enabled, to avoid the legacy // in-process URLRequestContext from fighting with the NetworkService over // ownership of on-disk files. - *network_context_params = content::mojom::NetworkContextParams::New(); + *network_context_params = network::mojom::NetworkContextParams::New(); } void ProfileNetworkContextService::RegisterProfilePrefs( @@ -105,10 +105,10 @@ proxy_config_monitor_.FlushForTesting(); } -content::mojom::NetworkContextParamsPtr +network::mojom::NetworkContextParamsPtr ProfileNetworkContextService::CreateMainNetworkContextParams() { // TODO(mmenke): Set up parameters here. - content::mojom::NetworkContextParamsPtr network_context_params = + network::mojom::NetworkContextParamsPtr network_context_params = CreateDefaultNetworkContextParams(); network_context_params->context_name = std::string("main");
diff --git a/chrome/browser/net/profile_network_context_service.h b/chrome/browser/net/profile_network_context_service.h index 8de0d08..c5c5f9b4 100644 --- a/chrome/browser/net/profile_network_context_service.h +++ b/chrome/browser/net/profile_network_context_service.h
@@ -9,7 +9,7 @@ #include "chrome/browser/net/proxy_config_monitor.h" #include "components/keyed_service/core/keyed_service.h" #include "components/prefs/pref_member.h" -#include "content/public/common/network_service.mojom.h" +#include "services/network/public/interfaces/network_service.mojom.h" class Profile; @@ -28,7 +28,7 @@ // service if enabled. Otherwise creates one that will use the IOThread's // NetworkService. This may be called either before or after // SetUpProfileIODataMainContext. - content::mojom::NetworkContextPtr CreateMainNetworkContext(); + network::mojom::NetworkContextPtr CreateMainNetworkContext(); // Initializes |*network_context_params| to set up the ProfileIOData's // main URLRequestContext and |*network_context_request| to be one end of a @@ -49,8 +49,8 @@ // storage (so as not to conflict with the network service vended context), // and will only be used for legacy requests that use it directly. void SetUpProfileIODataMainContext( - content::mojom::NetworkContextRequest* network_context_request, - content::mojom::NetworkContextParamsPtr* network_context_params); + network::mojom::NetworkContextRequest* network_context_request, + network::mojom::NetworkContextParamsPtr* network_context_params); static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); @@ -63,7 +63,7 @@ // Creates parameters for the NetworkContext. May only be called once, since // it initializes some class members. - content::mojom::NetworkContextParamsPtr CreateMainNetworkContextParams(); + network::mojom::NetworkContextParamsPtr CreateMainNetworkContextParams(); Profile* const profile_; @@ -73,11 +73,11 @@ // NetworkContext. If the network service is disabled, ownership is passed to // StoragePartition when CreateMainNetworkContext is called. Otherwise, // retains ownership, though nothing uses it after construction. - content::mojom::NetworkContextPtr profile_io_data_main_network_context_; + network::mojom::NetworkContextPtr profile_io_data_main_network_context_; // Request corresponding to |profile_io_data_main_network_context_|. Ownership // is passed to ProfileIOData when SetUpProfileIODataMainContext() is called. - content::mojom::NetworkContextRequest profile_io_data_context_request_; + network::mojom::NetworkContextRequest profile_io_data_context_request_; BooleanPrefMember quic_allowed_;
diff --git a/chrome/browser/net/proxy_config_monitor.cc b/chrome/browser/net/proxy_config_monitor.cc index 5187315..a1acd46 100644 --- a/chrome/browser/net/proxy_config_monitor.cc +++ b/chrome/browser/net/proxy_config_monitor.cc
@@ -62,7 +62,7 @@ } void ProxyConfigMonitor::AddToNetworkContextParams( - content::mojom::NetworkContextParams* network_context_params) { + network::mojom::NetworkContextParams* network_context_params) { network::mojom::ProxyConfigClientPtr proxy_config_client; network_context_params->proxy_config_client_request = mojo::MakeRequest(&proxy_config_client);
diff --git a/chrome/browser/net/proxy_config_monitor.h b/chrome/browser/net/proxy_config_monitor.h index e3a244e..a7a3a9e 100644 --- a/chrome/browser/net/proxy_config_monitor.h +++ b/chrome/browser/net/proxy_config_monitor.h
@@ -8,10 +8,10 @@ #include <memory> #include "base/macros.h" -#include "content/public/common/network_service.mojom.h" #include "mojo/public/cpp/bindings/binding_set.h" #include "mojo/public/cpp/bindings/interface_ptr_set.h" #include "net/proxy/proxy_config_service.h" +#include "services/network/public/interfaces/network_service.mojom.h" #include "services/network/public/interfaces/proxy_config.mojom.h" namespace net { @@ -44,7 +44,7 @@ // whenever the configuration changes. Can be called more than once to inform // multiple NetworkContexts of proxy changes. void AddToNetworkContextParams( - content::mojom::NetworkContextParams* network_context_params); + network::mojom::NetworkContextParams* network_context_params); // Flushes all pending data on the pipe, blocking the current thread until // they're received, to allow tests to wait until all pending proxy
diff --git a/chrome/browser/net/system_network_context_manager.cc b/chrome/browser/net/system_network_context_manager.cc index c4f1535..985ac6b 100644 --- a/chrome/browser/net/system_network_context_manager.cc +++ b/chrome/browser/net/system_network_context_manager.cc
@@ -51,7 +51,7 @@ base::LazyInstance<SystemNetworkContextManager>::Leaky g_system_network_context_manager = LAZY_INSTANCE_INITIALIZER; -content::mojom::NetworkContext* SystemNetworkContextManager::GetContext() { +network::mojom::NetworkContext* SystemNetworkContextManager::GetContext() { if (!base::FeatureList::IsEnabled(features::kNetworkService)) { // SetUp should already have been called. DCHECK(io_thread_network_context_); @@ -60,7 +60,7 @@ if (!network_service_network_context_ || network_service_network_context_.encountered_error()) { - content::mojom::NetworkService* network_service = + network::mojom::NetworkService* network_service = content::GetNetworkService(); if (!is_quic_allowed_) network_service->DisableQuic(); @@ -81,8 +81,8 @@ } void SystemNetworkContextManager::SetUp( - content::mojom::NetworkContextRequest* network_context_request, - content::mojom::NetworkContextParamsPtr* network_context_params, + network::mojom::NetworkContextRequest* network_context_request, + network::mojom::NetworkContextParamsPtr* network_context_params, bool* is_quic_allowed) { if (!base::FeatureList::IsEnabled(features::kNetworkService)) { *network_context_request = mojo::MakeRequest(&io_thread_network_context_); @@ -142,10 +142,10 @@ url_loader_factory_.FlushForTesting(); } -content::mojom::NetworkContextParamsPtr +network::mojom::NetworkContextParamsPtr SystemNetworkContextManager::CreateNetworkContextParams() { // TODO(mmenke): Set up parameters here (in memory cookie store, etc). - content::mojom::NetworkContextParamsPtr network_context_params = + network::mojom::NetworkContextParamsPtr network_context_params = CreateDefaultNetworkContextParams(); network_context_params->context_name = std::string("system");
diff --git a/chrome/browser/net/system_network_context_manager.h b/chrome/browser/net/system_network_context_manager.h index 98fb00e..f549fd74 100644 --- a/chrome/browser/net/system_network_context_manager.h +++ b/chrome/browser/net/system_network_context_manager.h
@@ -9,7 +9,7 @@ #include "base/macros.h" #include "chrome/browser/net/proxy_config_monitor.h" -#include "content/public/common/network_service.mojom.h" +#include "services/network/public/interfaces/network_service.mojom.h" class ProxyConfigMonitor; @@ -44,14 +44,14 @@ // Must be called before the system NetworkContext is first used. // // |is_quic_allowed| is set to true if policy allows QUIC to be enabled. - void SetUp(content::mojom::NetworkContextRequest* network_context_request, - content::mojom::NetworkContextParamsPtr* network_context_params, + void SetUp(network::mojom::NetworkContextRequest* network_context_request, + network::mojom::NetworkContextParamsPtr* network_context_params, bool* is_quic_allowed); // Returns the System NetworkContext. May only be called after SetUp(). Does // any initialization of the NetworkService that may be needed when first // called. - content::mojom::NetworkContext* GetContext(); + network::mojom::NetworkContext* GetContext(); // Returns a URLLoaderFactory owned by the SystemNetworkContextManager that is // backed by the SystemNetworkContext. Allows sharing of the URLLoaderFactory. @@ -72,18 +72,18 @@ private: // Creates parameters for the NetworkContext. May only be called once, since // it initializes some class members. - content::mojom::NetworkContextParamsPtr CreateNetworkContextParams(); + network::mojom::NetworkContextParamsPtr CreateNetworkContextParams(); ProxyConfigMonitor proxy_config_monitor_; // NetworkContext using the network service, if the network service is // enabled. nullptr, otherwise. - content::mojom::NetworkContextPtr network_service_network_context_; + network::mojom::NetworkContextPtr network_service_network_context_; // This is a NetworkContext that wraps the IOThread's SystemURLRequestContext. // Always initialized in SetUp, but it's only returned by Context() when the // network service is disabled. - content::mojom::NetworkContextPtr io_thread_network_context_; + network::mojom::NetworkContextPtr io_thread_network_context_; // URLLoaderFactory backed by the NetworkContext returned by GetContext(), so // consumers don't all need to create their own factory.
diff --git a/chrome/browser/net/variations_http_headers_browsertest.cc b/chrome/browser/net/variations_http_headers_browsertest.cc index 5ae09ee..2f72e83e 100644 --- a/chrome/browser/net/variations_http_headers_browsertest.cc +++ b/chrome/browser/net/variations_http_headers_browsertest.cc
@@ -204,7 +204,7 @@ TestStrippingHeadersFromNetworkService) { content::StoragePartition* partition = content::BrowserContext::GetDefaultStoragePartition(browser()->profile()); - content::mojom::NetworkContext* network_context = + network::mojom::NetworkContext* network_context = partition->GetNetworkContext(); EXPECT_EQ(net::OK, content::LoadBasicRequest(network_context, GetGoogleRedirectUrl1()));
diff --git a/chrome/browser/offline_pages/android/offline_page_model_factory.cc b/chrome/browser/offline_pages/android/offline_page_model_factory.cc index 034e673d..119d027 100644 --- a/chrome/browser/offline_pages/android/offline_page_model_factory.cc +++ b/chrome/browser/offline_pages/android/offline_page_model_factory.cc
@@ -37,7 +37,7 @@ // static OfflinePageModel* OfflinePageModelFactory::GetForBrowserContext( content::BrowserContext* context) { - return static_cast<OfflinePageModelTaskified*>( + return static_cast<OfflinePageModel*>( GetInstance()->GetServiceForBrowserContext(context, true)); }
diff --git a/chrome/browser/page_load_metrics/observers/data_reduction_proxy_metrics_observer.cc b/chrome/browser/page_load_metrics/observers/data_reduction_proxy_metrics_observer.cc index ed4c037..2d70818 100644 --- a/chrome/browser/page_load_metrics/observers/data_reduction_proxy_metrics_observer.cc +++ b/chrome/browser/page_load_metrics/observers/data_reduction_proxy_metrics_observer.cc
@@ -494,7 +494,13 @@ memory_dump->process_dumps().end())); auto process_dump_it = memory_dump->process_dumps().begin(); + if (process_dump_it == memory_dump->process_dumps().end()) + return; + + // We want to catch this in debug but not crash in release. DCHECK_EQ(process_id_, process_dump_it->pid()); + if (process_dump_it->pid() != process_id_) + return; renderer_memory_usage_kb_ = static_cast<int64_t>(process_dump_it->os_dump().private_footprint_kb); }
diff --git a/chrome/browser/policy/chrome_browser_policy_connector.cc b/chrome/browser/policy/chrome_browser_policy_connector.cc index 089eb4a..7bb72ac9 100644 --- a/chrome/browser/policy/chrome_browser_policy_connector.cc +++ b/chrome/browser/policy/chrome_browser_policy_connector.cc
@@ -67,6 +67,10 @@ ChromeBrowserPolicyConnector::~ChromeBrowserPolicyConnector() {} +void ChromeBrowserPolicyConnector::OnResourceBundleCreated() { + BrowserPolicyConnectorBase::OnResourceBundleCreated(); +} + void ChromeBrowserPolicyConnector::Init( PrefService* local_state, scoped_refptr<net::URLRequestContextGetter> request_context) {
diff --git a/chrome/browser/policy/chrome_browser_policy_connector.h b/chrome/browser/policy/chrome_browser_policy_connector.h index 19da2a9..a79bfb6f 100644 --- a/chrome/browser/policy/chrome_browser_policy_connector.h +++ b/chrome/browser/policy/chrome_browser_policy_connector.h
@@ -38,6 +38,10 @@ ~ChromeBrowserPolicyConnector() override; + // Called once the resource bundle has been created. Calls through to super + // class to notify observers. + void OnResourceBundleCreated(); + void Init( PrefService* local_state, scoped_refptr<net::URLRequestContextGetter> request_context) override;
diff --git a/chrome/browser/policy/policy_network_browsertest.cc b/chrome/browser/policy/policy_network_browsertest.cc index 23f861d..b65a3c94 100644 --- a/chrome/browser/policy/policy_network_browsertest.cc +++ b/chrome/browser/policy/policy_network_browsertest.cc
@@ -75,7 +75,7 @@ return is_quic_enabled; } -bool IsQuicEnabled(content::mojom::NetworkContext* network_context) { +bool IsQuicEnabled(network::mojom::NetworkContext* network_context) { GURL url = GURL(std::string("https://") + grpc_support::kTestServerHost + ":" + base::NumberToString(grpc_support::GetQuicTestServerPort()) +
diff --git a/chrome/browser/prefs/chrome_command_line_pref_store.cc b/chrome/browser/prefs/chrome_command_line_pref_store.cc index 6312f77e..64f24a5 100644 --- a/chrome/browser/prefs/chrome_command_line_pref_store.cc +++ b/chrome/browser/prefs/chrome_command_line_pref_store.cc
@@ -29,6 +29,7 @@ #include "components/ssl_config/ssl_config_switches.h" #include "components/sync/base/pref_names.h" #include "content/public/common/content_switches.h" +#include "services/network/public/cpp/network_switches.h" #include "ui/base/ui_base_switches.h" #include "ui/display/display_switches.h" @@ -69,7 +70,7 @@ true}, {switches::kAllowOutdatedPlugins, prefs::kPluginsAllowOutdated, true}, {switches::kNoPings, prefs::kEnableHyperlinkAuditing, false}, - {switches::kNoReferrers, prefs::kEnableReferrers, false}, + {network::switches::kNoReferrers, prefs::kEnableReferrers, false}, {switches::kAllowRunningInsecureContent, prefs::kWebKitAllowRunningInsecureContent, true}, {switches::kAllowCrossOriginAuthPrompt,
diff --git a/chrome/browser/printing/print_view_manager_base.cc b/chrome/browser/printing/print_view_manager_base.cc index e3b908c..59761b2 100644 --- a/chrome/browser/printing/print_view_manager_base.cc +++ b/chrome/browser/printing/print_view_manager_base.cc
@@ -83,13 +83,13 @@ #if BUILDFLAG(ENABLE_PRINT_PREVIEW) void CreateQueryWithSettings( std::unique_ptr<base::DictionaryValue> job_settings, - content::RenderFrameHost* rfh, + int render_process_id, + int render_frame_id, scoped_refptr<PrintQueriesQueue> queue, PrintSettingsCallback callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); scoped_refptr<printing::PrinterQuery> printer_query = - queue->CreatePrinterQuery(rfh->GetProcess()->GetID(), - rfh->GetRoutingID()); + queue->CreatePrinterQuery(render_process_id, render_frame_id); printer_query->SetSettings( std::move(job_settings), base::BindOnce(std::move(callback), printer_query)); @@ -153,8 +153,8 @@ std::move(callback)); content::BrowserThread::PostTask( content::BrowserThread::IO, FROM_HERE, - base::BindOnce(CreateQueryWithSettings, std::move(job_settings), rfh, - queue_, + base::BindOnce(CreateQueryWithSettings, std::move(job_settings), + rfh->GetProcess()->GetID(), rfh->GetRoutingID(), queue_, base::BindOnce(OnPrintSettingsDoneWrapper, std::move(settings_callback)))); }
diff --git a/chrome/browser/profile_resetter/profile_resetter_browsertest.cc b/chrome/browser/profile_resetter/profile_resetter_browsertest.cc index 06441b72..6c96137 100644 --- a/chrome/browser/profile_resetter/profile_resetter_browsertest.cc +++ b/chrome/browser/profile_resetter/profile_resetter_browsertest.cc
@@ -55,7 +55,7 @@ RemoveCookieTester::RemoveCookieTester(Profile* profile) : waiting_callback_(false), profile_(profile) { - content::mojom::NetworkContext* network_context = + network::mojom::NetworkContext* network_context = content::BrowserContext::GetDefaultStoragePartition(profile_) ->GetNetworkContext(); network_context->GetCookieManager(mojo::MakeRequest(&cookie_manager_));
diff --git a/chrome/browser/profiles/profile.cc b/chrome/browser/profiles/profile.cc index 10a18d7..0419811 100644 --- a/chrome/browser/profiles/profile.cc +++ b/chrome/browser/profiles/profile.cc
@@ -254,7 +254,7 @@ return false; } -content::mojom::NetworkContextPtr Profile::CreateMainNetworkContext() { +network::mojom::NetworkContextPtr Profile::CreateMainNetworkContext() { return ProfileNetworkContextServiceFactory::GetForContext(this) ->CreateMainNetworkContext(); }
diff --git a/chrome/browser/profiles/profile.h b/chrome/browser/profiles/profile.h index bf94ef3d..8ae1a4b 100644 --- a/chrome/browser/profiles/profile.h +++ b/chrome/browser/profiles/profile.h
@@ -16,7 +16,7 @@ #include "components/domain_reliability/clear_mode.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/content_browser_client.h" -#include "content/public/common/network_service.mojom.h" +#include "services/network/public/interfaces/network_service.mojom.h" #if !defined(OS_ANDROID) class ChromeZoomLevelPrefs; @@ -296,7 +296,7 @@ // Creates the main NetworkContext for the profile, or returns nullptr to // defer NetworkContext creation to the caller. - virtual content::mojom::NetworkContextPtr CreateMainNetworkContext(); + virtual network::mojom::NetworkContextPtr CreateMainNetworkContext(); // Stop sending accessibility events until ResumeAccessibilityEvents(). // Calls to Pause nest; no events will be sent until the number of
diff --git a/chrome/browser/profiles/profile_impl_io_data.cc b/chrome/browser/profiles/profile_impl_io_data.cc index 8bcdd49..558f516 100644 --- a/chrome/browser/profiles/profile_impl_io_data.cc +++ b/chrome/browser/profiles/profile_impl_io_data.cc
@@ -59,7 +59,6 @@ #include "content/public/browser/notification_service.h" #include "content/public/browser/resource_context.h" #include "content/public/browser/storage_partition.h" -#include "content/public/common/network_service.mojom.h" #include "extensions/browser/extension_protocols.h" #include "extensions/common/constants.h" #include "extensions/features/features.h" @@ -76,6 +75,7 @@ #include "net/url_request/url_request_context_builder.h" #include "net/url_request/url_request_intercepting_job_factory.h" #include "net/url_request/url_request_job_factory_impl.h" +#include "services/network/public/interfaces/network_service.mojom.h" #include "storage/browser/quota/special_storage_policy.h" #if BUILDFLAG(ENABLE_OFFLINE_PAGES)
diff --git a/chrome/browser/profiles/profile_io_data.h b/chrome/browser/profiles/profile_io_data.h index eb038302..cdd85d6 100644 --- a/chrome/browser/profiles/profile_io_data.h +++ b/chrome/browser/profiles/profile_io_data.h
@@ -28,7 +28,6 @@ #include "components/prefs/pref_member.h" #include "content/public/browser/content_browser_client.h" #include "content/public/browser/resource_context.h" -#include "content/public/common/network_service.mojom.h" #include "content/public/network/url_request_context_owner.h" #include "extensions/features/features.h" #include "net/cookies/cookie_store.h" @@ -37,6 +36,7 @@ #include "net/url_request/url_request_context.h" #include "net/url_request/url_request_interceptor.h" #include "net/url_request/url_request_job_factory.h" +#include "services/network/public/interfaces/network_service.mojom.h" class ChromeHttpUserAgentSettings; class ChromeNetworkDelegate; @@ -323,8 +323,8 @@ // Used to configure the main URLRequestContext through the IOThread's // in-process network service. - content::mojom::NetworkContextRequest main_network_context_request; - content::mojom::NetworkContextParamsPtr main_network_context_params; + network::mojom::NetworkContextRequest main_network_context_request; + network::mojom::NetworkContextParamsPtr main_network_context_params; scoped_refptr<content_settings::CookieSettings> cookie_settings; scoped_refptr<HostContentSettingsMap> host_content_settings_map; @@ -594,7 +594,7 @@ // When the network service is enabled, this holds on to a // content::NetworkContext class that owns |main_request_context_|. - mutable std::unique_ptr<content::mojom::NetworkContext> main_network_context_; + mutable std::unique_ptr<network::mojom::NetworkContext> main_network_context_; // When the network service is disabled, this owns |system_request_context|. mutable content::URLRequestContextOwner main_request_context_owner_; mutable net::URLRequestContext* main_request_context_;
diff --git a/chrome/browser/renderer_context_menu/render_view_context_menu.cc b/chrome/browser/renderer_context_menu/render_view_context_menu.cc index 78e203a..45bc532b 100644 --- a/chrome/browser/renderer_context_menu/render_view_context_menu.cc +++ b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
@@ -1807,7 +1807,10 @@ switch (id) { case IDC_CONTENT_CONTEXT_OPENLINKNEWTAB: - ExecOpenLinkNewTab(); + OpenURLWithExtraHeaders(params_.link_url, GetDocumentURL(params_), + WindowOpenDisposition::NEW_BACKGROUND_TAB, + ui::PAGE_TRANSITION_LINK, "" /* extra_headers */, + true /* started_from_context_menu */); break; case IDC_CONTENT_CONTEXT_OPENLINKNEWWINDOW: @@ -2263,13 +2266,6 @@ return incognito_avail != IncognitoModePrefs::DISABLED; } -void RenderViewContextMenu::ExecOpenLinkNewTab() { - OpenURLWithExtraHeaders(params_.link_url, GetDocumentURL(params_), - WindowOpenDisposition::NEW_BACKGROUND_TAB, - ui::PAGE_TRANSITION_LINK, "" /* extra_headers */, - true /* started_from_context_menu */); -} - void RenderViewContextMenu::ExecOpenBookmarkApp() { const extensions::Extension* bookmark_app = GetBookmarkAppForURL(browser_context_, params_.link_url);
diff --git a/chrome/browser/renderer_context_menu/render_view_context_menu.h b/chrome/browser/renderer_context_menu/render_view_context_menu.h index 2be9d6d..979186a 100644 --- a/chrome/browser/renderer_context_menu/render_view_context_menu.h +++ b/chrome/browser/renderer_context_menu/render_view_context_menu.h
@@ -171,7 +171,6 @@ bool IsOpenLinkOTREnabled() const; // Command execution functions. - void ExecOpenLinkNewTab(); void ExecOpenBookmarkApp(); void ExecProtocolHandler(int event_flags, int handler_index); void ExecOpenLinkInProfile(int profile_index);
diff --git a/chrome/browser/resources/md_extensions/error_page.html b/chrome/browser/resources/md_extensions/error_page.html index b4379cac..2cae6446 100644 --- a/chrome/browser/resources/md_extensions/error_page.html +++ b/chrome/browser/resources/md_extensions/error_page.html
@@ -72,7 +72,7 @@ margin: 0 10px; } - #errors-list { + #errorsList { min-height: 100px; } @@ -131,7 +131,7 @@ background: var(--google-blue-100); } - .dev-tool-button { + .devtool-button { margin-bottom: 20px; max-width: 300px; } @@ -139,6 +139,7 @@ extensions-code-section { background: white; height: 200px; + margin-bottom: 20px; } /* TODO(scottchen): extract to shared location from settings. */ @@ -184,10 +185,7 @@ </paper-button> </div> <div class="section"> - <extensions-code-section id="code-section" - could-not-display-code="$i18n{noErrorsToShow}"> - </extensions-code-section> - <div id="errors-list"> + <div id="errorsList"> <template is="dom-repeat" items="[[entries_]]"> <div class="item-container"> <div class$="error-item @@ -201,8 +199,7 @@ <div id$="[[item.id]]" class="error-message"> [[item.message]] </div> - <div class$="cr-icon [[iconName_(index, selectedEntry_)]]" - hidden="[[!computeIsRuntimeError_(item)]]"> + <div class$="cr-icon [[iconName_(index, selectedEntry_)]]"> </div> </div> <div class="separator"></div> @@ -213,9 +210,10 @@ on-keydown="onDeleteErrorAction_"> </button> </div> - <template is="dom-if" if="[[computeIsRuntimeError_(item)]]"> - <iron-collapse opened="[[isOpened_(index, selectedEntry_)]]"> - <div class="devtools-controls"> + <iron-collapse opened="[[isOpened_(index, selectedEntry_)]]"> + <div class="devtools-controls"> + <template is="dom-if" + if="[[computeIsRuntimeError_(item)]]"> <div class="details-heading"> $i18n{errorContext} </div> @@ -236,14 +234,21 @@ </li> </template> </ul> - <paper-button class="devtool-button action-button" - disabled="[[!item.canInspect]]" - on-tap="onDevToolButtonTap_"> - $i18n{openInDevtool} - </paper-button> - </div> - </iron-collapse> - </template> + </template> + <template is="dom-if" + if="[[isOpened_(index, selectedEntry_)]]"> + <extensions-code-section code="[[code_]]" + could-not-display-code="$i18n{noErrorsToShow}"> + </extensions-code-section> + </template> + <paper-button class="devtool-button action-button" + hidden$="[[!computeIsRuntimeError_(item)]]" + disabled="[[!item.canInspect]]" + on-tap="onDevToolButtonTap_"> + $i18n{openInDevtool} + </paper-button> + </div> + </iron-collapse> </div> </template> </div>
diff --git a/chrome/browser/resources/md_extensions/error_page.js b/chrome/browser/resources/md_extensions/error_page.js index 05f081e..0acaac0 100644 --- a/chrome/browser/resources/md_extensions/error_page.js +++ b/chrome/browser/resources/md_extensions/error_page.js
@@ -84,6 +84,9 @@ /** @private {!Array<!(ManifestError|RuntimeError)>} */ entries_: Array, + /** @private {?chrome.developerPrivate.RequestFileSourceResponse} */ + code_: Object, + /** * Index into |entries_|. * @private @@ -191,10 +194,10 @@ * @private */ onSelectedErrorChanged_: function() { - if (this.selectedEntry_ < 0) { - this.$['code-section'].code = null; + this.code_ = null; + + if (this.selectedEntry_ < 0) return; - } const error = this.getSelectedError(); const args = { @@ -218,9 +221,7 @@ null; break; } - this.delegate.requestFileSource(args).then(code => { - this.$['code-section'].code = code; - }); + this.delegate.requestFileSource(args).then(code => this.code_ = code); }, /** @@ -296,9 +297,7 @@ pathSuffix: getRelativeUrl(frame.url, selectedError), lineNumber: frame.lineNumber, }) - .then(code => { - this.$['code-section'].code = code; - }); + .then(code => this.code_ = code); }, /** @private */ @@ -345,7 +344,7 @@ }, /** - * @param {!{model: !{index: number}}} e + * @param {!{type: string, code: string, model: !{index: number}}} e * @private */ onErrorItemAction_: function(e) {
diff --git a/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_controller_impl_win.cc b/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_controller_impl_win.cc index 1be9af9a..d7e89945 100644 --- a/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_controller_impl_win.cc +++ b/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_controller_impl_win.cc
@@ -17,7 +17,6 @@ #include "base/files/file_util.h" #include "base/location.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/metrics/histogram_macros.h" #include "base/task_scheduler/post_task.h" #include "base/task_scheduler/task_traits.h" @@ -210,7 +209,7 @@ if (PostCleanupSettingsResetter::IsEnabled()) { PostCleanupSettingsResetter().ResetTaggedProfiles( std::move(profiles), std::move(continuation), - base::MakeUnique<PostCleanupSettingsResetter::Delegate>()); + std::make_unique<PostCleanupSettingsResetter::Delegate>()); } } @@ -472,7 +471,7 @@ DCHECK(!reporter_invocation_); reporter_invocation_ = - base::MakeUnique<SwReporterInvocation>(reporter_invocation); + std::make_unique<SwReporterInvocation>(reporter_invocation); const std::string& reporter_engine = reporter_invocation_->command_line().GetSwitchValueASCII( @@ -548,7 +547,7 @@ } ChromeCleanerControllerImpl::ChromeCleanerControllerImpl() - : real_delegate_(base::MakeUnique<ChromeCleanerControllerDelegate>()), + : real_delegate_(std::make_unique<ChromeCleanerControllerDelegate>()), delegate_(real_delegate_.get()), weak_factory_(this) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
diff --git a/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_dialog_controller_impl_browsertest_win.cc b/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_dialog_controller_impl_browsertest_win.cc index a590cc83..56b8bc7 100644 --- a/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_dialog_controller_impl_browsertest_win.cc +++ b/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_dialog_controller_impl_browsertest_win.cc
@@ -6,7 +6,6 @@ #include <memory> -#include "base/memory/ptr_util.h" #include "base/memory/ref_counted.h" #include "base/run_loop.h" #include "chrome/browser/profiles/profile_manager.h" @@ -119,7 +118,7 @@ IN_PROC_BROWSER_TEST_P(ChromeCleanerPromptUserTest, AllBrowsersClosed) { std::unique_ptr<ScopedKeepAlive> keep_alive = - base::MakeUnique<ScopedKeepAlive>(KeepAliveOrigin::BROWSER, + std::make_unique<ScopedKeepAlive>(KeepAliveOrigin::BROWSER, KeepAliveRestartOption::DISABLED); CloseAllBrowsers();
diff --git a/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_dialog_controller_impl_win.cc b/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_dialog_controller_impl_win.cc index 564c70d2..e975ed47 100644 --- a/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_dialog_controller_impl_win.cc +++ b/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_dialog_controller_impl_win.cc
@@ -58,7 +58,7 @@ ChromeCleanerController* cleaner_controller) : cleaner_controller_(cleaner_controller), prompt_delegate_impl_( - base::MakeUnique<ChromeCleanerPromptDelegateImpl>()) { + std::make_unique<ChromeCleanerPromptDelegateImpl>()) { DCHECK(cleaner_controller_); DCHECK_EQ(ChromeCleanerController::State::kScanning, cleaner_controller_->state());
diff --git a/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_reboot_dialog_controller_impl_browsertest_win.cc b/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_reboot_dialog_controller_impl_browsertest_win.cc index 45f5746..49c8ac79 100644 --- a/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_reboot_dialog_controller_impl_browsertest_win.cc +++ b/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_reboot_dialog_controller_impl_browsertest_win.cc
@@ -6,7 +6,6 @@ #include <memory> -#include "base/memory/ptr_util.h" #include "base/run_loop.h" #include "base/test/scoped_feature_list.h" #include "chrome/browser/profiles/profile_manager.h" @@ -80,7 +79,7 @@ EXPECT_CALL(mock_cleaner_controller_, state()) .WillRepeatedly( Return(ChromeCleanerController::State::kRebootRequired)); - mock_prompt_delegate_ = base::MakeUnique<StrictMock<MockPromptDelegate>>(); + mock_prompt_delegate_ = std::make_unique<StrictMock<MockPromptDelegate>>(); } void SetUpOnMainThread() override { @@ -89,7 +88,7 @@ ? chrome::GetSettingsUrl(chrome::kCleanupSubPage) : chrome::GetSettingsUrl(""); - run_loop_ = base::MakeUnique<base::RunLoop>(); + run_loop_ = std::make_unique<base::RunLoop>(); } void OpenPage(const GURL& gurl, Browser* browser) { @@ -178,7 +177,7 @@ IN_PROC_BROWSER_TEST_P(ChromeCleanerRebootFlowTest, OnRebootRequired_SettingsPageActiveWhenBrowserIsOpened) { - auto keep_alive = base::MakeUnique<ScopedKeepAlive>( + auto keep_alive = std::make_unique<ScopedKeepAlive>( KeepAliveOrigin::BROWSER, KeepAliveRestartOption::DISABLED); SetExpectationsWhenSettingsPageIsActive(); @@ -209,7 +208,7 @@ IN_PROC_BROWSER_TEST_P( ChromeCleanerRebootFlowTest, OnRebootRequired_SettingsPageNotActiveWhenBrowserIsOpened) { - auto keep_alive = base::MakeUnique<ScopedKeepAlive>( + auto keep_alive = std::make_unique<ScopedKeepAlive>( KeepAliveOrigin::BROWSER, KeepAliveRestartOption::DISABLED); SetExpectationsWhenSettingsPageIsNotActive(); @@ -253,7 +252,7 @@ ChromeCleanerRebootDialogControllerImpl* dialog_controller() { auto mock_prompt_delegate = - base::MakeUnique<StrictMock<MockPromptDelegate>>(); + std::make_unique<StrictMock<MockPromptDelegate>>(); EXPECT_CALL(*mock_prompt_delegate, ShowChromeCleanerRebootPrompt(_, _)) .Times(1); return ChromeCleanerRebootDialogControllerImpl::Create(
diff --git a/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_reboot_dialog_controller_impl_win.cc b/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_reboot_dialog_controller_impl_win.cc index b652164..0ea55b6 100644 --- a/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_reboot_dialog_controller_impl_win.cc +++ b/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_reboot_dialog_controller_impl_win.cc
@@ -4,8 +4,9 @@ #include "chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_reboot_dialog_controller_impl_win.h" +#include <memory> + #include "base/feature_list.h" -#include "base/memory/ptr_util.h" #include "base/metrics/histogram_macros.h" #include "chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_navigation_util_win.h" #include "chrome/browser/safe_browsing/chrome_cleaner/srt_field_trial_win.h" @@ -73,7 +74,7 @@ ChromeCleanerRebootDialogControllerImpl* ChromeCleanerRebootDialogControllerImpl::Create( ChromeCleanerController* cleaner_controller) { - return Create(cleaner_controller, base::MakeUnique<PromptDelegateImpl>()); + return Create(cleaner_controller, std::make_unique<PromptDelegateImpl>()); } // static
diff --git a/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_runner_win.cc b/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_runner_win.cc index 80bce04..927cc458 100644 --- a/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_runner_win.cc +++ b/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_runner_win.cc
@@ -11,7 +11,6 @@ #include "base/bind_helpers.h" #include "base/feature_list.h" #include "base/location.h" -#include "base/memory/ptr_util.h" #include "base/metrics/histogram_functions.h" #include "base/path_service.h" #include "base/strings/string_number_conversions.h" @@ -203,7 +202,7 @@ DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK(!chrome_prompt_impl_); - // Cannot use base::MakeUnique() since it does not support creating + // Cannot use std::make_unique() since it does not support creating // std::unique_ptrs with custom deleters. chrome_prompt_impl_.reset(new ChromePromptImpl( std::move(chrome_prompt_request),
diff --git a/chrome/browser/safe_browsing/chrome_cleaner/settings_resetter_browsertest_win.cc b/chrome/browser/safe_browsing/chrome_cleaner/settings_resetter_browsertest_win.cc index 32d45b0..89a3d06 100644 --- a/chrome/browser/safe_browsing/chrome_cleaner/settings_resetter_browsertest_win.cc +++ b/chrome/browser/safe_browsing/chrome_cleaner/settings_resetter_browsertest_win.cc
@@ -97,7 +97,7 @@ void FetchDefaultSettings( DefaultSettingsFetcher::SettingsCallback callback) override { - callback.Run(base::MakeUnique<BrandcodedDefaultSettings>()); + callback.Run(std::make_unique<BrandcodedDefaultSettings>()); } // Returns a MockProfileResetter that requires Reset() be called. @@ -105,7 +105,7 @@ Profile* profile) override { ++(*num_resets_); auto mock_profile_resetter = - base::MakeUnique<StrictMock<MockProfileResetter>>(profile); + std::make_unique<StrictMock<MockProfileResetter>>(profile); EXPECT_CALL(*mock_profile_resetter, MockReset(_, _, _)); return std::move(mock_profile_resetter); } @@ -184,7 +184,7 @@ profile3->GetPrefs()->SetBoolean(prefs::kChromeCleanerResetPending, true); int num_resets = 0; - auto delegate = base::MakeUnique<SettingsResetterTestDelegate>(&num_resets); + auto delegate = std::make_unique<SettingsResetterTestDelegate>(&num_resets); PostCleanupSettingsResetter resetter; base::RunLoop run_loop_for_reset;
diff --git a/chrome/browser/safe_browsing/chrome_cleaner/settings_resetter_win.cc b/chrome/browser/safe_browsing/chrome_cleaner/settings_resetter_win.cc index 1227b4b..969c11c1 100644 --- a/chrome/browser/safe_browsing/chrome_cleaner/settings_resetter_win.cc +++ b/chrome/browser/safe_browsing/chrome_cleaner/settings_resetter_win.cc
@@ -211,7 +211,7 @@ std::unique_ptr<ProfileResetter> PostCleanupSettingsResetter::Delegate::GetProfileResetter(Profile* profile) { - return base::MakeUnique<ProfileResetter>(profile); + return std::make_unique<ProfileResetter>(profile); } void PostCleanupSettingsResetter::TagForResetting(Profile* profile) {
diff --git a/chrome/browser/safe_browsing/chrome_password_protection_service.cc b/chrome/browser/safe_browsing/chrome_password_protection_service.cc index 4275342..cdb5a4eb 100644 --- a/chrome/browser/safe_browsing/chrome_password_protection_service.cc +++ b/chrome/browser/safe_browsing/chrome_password_protection_service.cc
@@ -4,6 +4,8 @@ #include "chrome/browser/safe_browsing/chrome_password_protection_service.h" +#include <memory> + #include "base/feature_list.h" #include "base/metrics/field_trial_params.h" #include "base/metrics/histogram_macros.h" @@ -463,7 +465,7 @@ if (navigation_id <= 0) return nullptr; - auto specifics = base::MakeUnique<UserEventSpecifics>(); + auto specifics = std::make_unique<UserEventSpecifics>(); specifics->set_event_time_usec( GetMicrosecondsSinceWindowsEpoch(base::Time::Now())); specifics->set_navigation_id(navigation_id);
diff --git a/chrome/browser/safe_browsing/chrome_password_protection_service_unittest.cc b/chrome/browser/safe_browsing/chrome_password_protection_service_unittest.cc index 926519a3..adf81bd 100644 --- a/chrome/browser/safe_browsing/chrome_password_protection_service_unittest.cc +++ b/chrome/browser/safe_browsing/chrome_password_protection_service_unittest.cc
@@ -3,6 +3,8 @@ // found in the LICENSE file. #include "chrome/browser/safe_browsing/chrome_password_protection_service.h" +#include <memory> + #include "base/memory/ref_counted.h" #include "base/run_loop.h" #include "base/test/scoped_feature_list.h" @@ -60,7 +62,7 @@ std::unique_ptr<KeyedService> BuildFakeUserEventService( content::BrowserContext* context) { - return base::MakeUnique<syncer::FakeUserEventService>(); + return std::make_unique<syncer::FakeUserEventService>(); } constexpr struct { @@ -138,7 +140,7 @@ content_setting_map_ = new HostContentSettingsMap( &test_pref_service_, false /* incognito */, false /* guest_profile */, false /* store_last_modified */); - service_ = base::MakeUnique<MockChromePasswordProtectionService>( + service_ = std::make_unique<MockChromePasswordProtectionService>( profile(), content_setting_map_, new SafeBrowsingUIManager( SafeBrowsingService::CreateSafeBrowsingService())); @@ -192,14 +194,14 @@ } void InitializeVerdict(LoginReputationClientResponse::VerdictType type) { - verdict_ = base::MakeUnique<LoginReputationClientResponse>(); + verdict_ = std::make_unique<LoginReputationClientResponse>(); verdict_->set_verdict_type(type); } void SimulateRequestFinished( LoginReputationClientResponse::VerdictType verdict_type) { std::unique_ptr<LoginReputationClientResponse> verdict = - base::MakeUnique<LoginReputationClientResponse>(); + std::make_unique<LoginReputationClientResponse>(); verdict->set_verdict_type(verdict_type); service_->RequestFinished(request_.get(), false, std::move(verdict)); } @@ -429,7 +431,7 @@ } { - auto response = base::MakeUnique<LoginReputationClientResponse>(); + auto response = std::make_unique<LoginReputationClientResponse>(); response->set_verdict_token("token1"); response->set_verdict_type(LoginReputationClientResponse::LOW_REPUTATION); service_->MaybeLogPasswordReuseLookupEvent( @@ -449,7 +451,7 @@ } { - auto response = base::MakeUnique<LoginReputationClientResponse>(); + auto response = std::make_unique<LoginReputationClientResponse>(); response->set_verdict_token("token2"); response->set_verdict_type(LoginReputationClientResponse::SAFE); service_->MaybeLogPasswordReuseLookupEvent(
diff --git a/chrome/browser/safe_browsing/client_side_detection_host_browsertest.cc b/chrome/browser/safe_browsing/client_side_detection_host_browsertest.cc index 21d2464..5ee5f16 100644 --- a/chrome/browser/safe_browsing/client_side_detection_host_browsertest.cc +++ b/chrome/browser/safe_browsing/client_side_detection_host_browsertest.cc
@@ -55,7 +55,7 @@ false); ASSERT_TRUE(embedded_test_server()->Start()); std::unique_ptr<TestClientSideDetectionHost> csd_host = - base::MakeUnique<TestClientSideDetectionHost>( + std::make_unique<TestClientSideDetectionHost>( browser()->tab_strip_model()->GetActiveWebContents()); GURL page_url(embedded_test_server()->GetURL("/safe_browsing/malware.html")); ui_test_utils::NavigateToURL(browser(), page_url);
diff --git a/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc b/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc index affbc4e..0766367 100644 --- a/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc +++ b/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc
@@ -15,7 +15,6 @@ #include "base/containers/queue.h" #include "base/logging.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/message_loop/message_loop.h" #include "base/metrics/field_trial.h" #include "base/run_loop.h" @@ -151,8 +150,8 @@ void SetCache(const GURL& gurl, bool is_phishing, base::Time time) { csd_service_->cache_[gurl] = - base::MakeUnique<ClientSideDetectionService::CacheState>( - is_phishing, time); + std::make_unique<ClientSideDetectionService::CacheState>(is_phishing, + time); } void TestCache() { @@ -163,28 +162,28 @@ ClientSideDetectionService::kNegativeCacheIntervalDays) + base::TimeDelta::FromMinutes(5); cache[GURL("http://first.url.com/")] = - base::MakeUnique<ClientSideDetectionService::CacheState>(false, time); + std::make_unique<ClientSideDetectionService::CacheState>(false, time); time = now - base::TimeDelta::FromDays( ClientSideDetectionService::kNegativeCacheIntervalDays) - base::TimeDelta::FromHours(1); - cache[GURL("http://second.url.com/")] - = base::MakeUnique<ClientSideDetectionService::CacheState>(false, time); + cache[GURL("http://second.url.com/")] = + std::make_unique<ClientSideDetectionService::CacheState>(false, time); time = now - base::TimeDelta::FromMinutes( ClientSideDetectionService::kPositiveCacheIntervalMinutes) - base::TimeDelta::FromMinutes(5); - cache[GURL("http://third.url.com/")] - = base::MakeUnique<ClientSideDetectionService::CacheState>(true, time); + cache[GURL("http://third.url.com/")] = + std::make_unique<ClientSideDetectionService::CacheState>(true, time); time = now - base::TimeDelta::FromMinutes( ClientSideDetectionService::kPositiveCacheIntervalMinutes) + base::TimeDelta::FromMinutes(5); cache[GURL("http://fourth.url.com/")] = - base::MakeUnique<ClientSideDetectionService::CacheState>(true, time); + std::make_unique<ClientSideDetectionService::CacheState>(true, time); csd_service_->UpdateCache();
diff --git a/chrome/browser/safe_browsing/download_protection/check_client_download_request.cc b/chrome/browser/safe_browsing/download_protection/check_client_download_request.cc index 93acb81..1c5ba8d 100644 --- a/chrome/browser/safe_browsing/download_protection/check_client_download_request.cc +++ b/chrome/browser/safe_browsing/download_protection/check_client_download_request.cc
@@ -4,6 +4,8 @@ #include "chrome/browser/safe_browsing/download_protection/check_client_download_request.h" +#include <memory> + #include "base/metrics/histogram_functions.h" #include "base/metrics/histogram_macros.h" #include "base/rand_util.h" @@ -613,7 +615,7 @@ if (results.signature_blob.size() > 0) { disk_image_signature_ = - base::MakeUnique<std::vector<uint8_t>>(results.signature_blob); + std::make_unique<std::vector<uint8_t>>(results.signature_blob); } // Even if !results.success, some of the DMG may have been parsed.
diff --git a/chrome/browser/safe_browsing/download_protection/download_feedback_service.cc b/chrome/browser/safe_browsing/download_protection/download_feedback_service.cc index 3330c2a..d2f73911 100644 --- a/chrome/browser/safe_browsing/download_protection/download_feedback_service.cc +++ b/chrome/browser/safe_browsing/download_protection/download_feedback_service.cc
@@ -9,7 +9,6 @@ #include "base/bind.h" #include "base/files/file_path.h" #include "base/files/file_util.h" -#include "base/memory/ptr_util.h" #include "base/metrics/histogram_macros.h" #include "base/supports_user_data.h" #include "base/task_runner.h" @@ -56,7 +55,7 @@ content::DownloadItem* download, const std::string& ping_request, const std::string& ping_response) { - download->SetUserData(kPingKey, base::MakeUnique<DownloadFeedbackPings>( + download->SetUserData(kPingKey, std::make_unique<DownloadFeedbackPings>( ping_request, ping_response)); }
diff --git a/chrome/browser/safe_browsing/download_protection/download_protection_service.cc b/chrome/browser/safe_browsing/download_protection/download_protection_service.cc index 20bf07a..8e58b0a 100644 --- a/chrome/browser/safe_browsing/download_protection/download_protection_service.cc +++ b/chrome/browser/safe_browsing/download_protection/download_protection_service.cc
@@ -238,7 +238,7 @@ const std::string& token) { if (item) { item->SetUserData(kDownloadPingTokenKey, - base::MakeUnique<DownloadPingToken>(token)); + std::make_unique<DownloadPingToken>(token)); } } @@ -364,7 +364,7 @@ return nullptr; std::unique_ptr<ReferrerChain> referrer_chain = - base::MakeUnique<ReferrerChain>(); + std::make_unique<ReferrerChain>(); content::WebContents* web_contents = item.GetWebContents(); int download_tab_id = SessionTabHelper::IdForTab(web_contents); UMA_HISTOGRAM_BOOLEAN(
diff --git a/chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer.cc b/chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer.cc index 3b8ae5c00..20075863 100644 --- a/chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer.cc +++ b/chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer.cc
@@ -10,7 +10,6 @@ #include "base/bind.h" #include "base/callback.h" #include "base/files/file_util.h" -#include "base/memory/ptr_util.h" #include "base/metrics/histogram_macros.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" @@ -44,7 +43,7 @@ incident(new ClientIncidentReport_IncidentData_BinaryIntegrityIncident()); incident->set_file_basename(basename); incident_receiver->ClearIncidentForProcess( - base::MakeUnique<BinaryIntegrityIncident>(std::move(incident))); + std::make_unique<BinaryIntegrityIncident>(std::move(incident))); } void RegisterBinaryIntegrityAnalysis() {
diff --git a/chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer_mac.cc b/chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer_mac.cc index 7f4331e..66d7528 100644 --- a/chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer_mac.cc +++ b/chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer_mac.cc
@@ -6,11 +6,11 @@ #include <stddef.h> +#include <memory> #include <utility> #include "base/files/file_util.h" #include "base/mac/bundle_locations.h" -#include "base/memory/ptr_util.h" #include "chrome/browser/safe_browsing/incident_reporting/binary_integrity_incident.h" #include "chrome/browser/safe_browsing/incident_reporting/incident_receiver.h" #include "chrome/browser/safe_browsing/signature_evaluator_mac.h" @@ -33,7 +33,7 @@ incident(new ClientIncidentReport_IncidentData_BinaryIntegrityIncident()); if (!evaluator.PerformEvaluation(incident.get())) { incident_receiver->AddIncidentForProcess( - base::MakeUnique<BinaryIntegrityIncident>(std::move(incident))); + std::make_unique<BinaryIntegrityIncident>(std::move(incident))); } else { // Clear past incidents involving this bundle if the signature is // now valid.
diff --git a/chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer_win.cc b/chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer_win.cc index e05eb2b..5551091 100644 --- a/chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer_win.cc +++ b/chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer_win.cc
@@ -6,13 +6,13 @@ #include <stddef.h> +#include <memory> #include <utility> #include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/logging.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/path_service.h" #include "chrome/browser/safe_browsing/incident_reporting/binary_integrity_incident.h" #include "chrome/browser/safe_browsing/incident_reporting/incident_receiver.h" @@ -83,7 +83,7 @@ // Send the report. incident_receiver->AddIncidentForProcess( - base::MakeUnique<BinaryIntegrityIncident>(std::move(incident))); + std::make_unique<BinaryIntegrityIncident>(std::move(incident))); } else { // The binary is integral, remove previous report so that next incidents // for the binary will be reported.
diff --git a/chrome/browser/safe_browsing/incident_reporting/binary_integrity_incident_unittest.cc b/chrome/browser/safe_browsing/incident_reporting/binary_integrity_incident_unittest.cc index 061d7e7..95c3cac 100644 --- a/chrome/browser/safe_browsing/incident_reporting/binary_integrity_incident_unittest.cc +++ b/chrome/browser/safe_browsing/incident_reporting/binary_integrity_incident_unittest.cc
@@ -10,7 +10,6 @@ #include <utility> #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "components/safe_browsing/proto/csd.pb.h" #include "testing/gtest/include/gtest/gtest.h" @@ -40,7 +39,7 @@ element->set_certificate(certificates[i], arraysize(certificates[i])); } - return base::MakeUnique<BinaryIntegrityIncident>(std::move(incident)); + return std::make_unique<BinaryIntegrityIncident>(std::move(incident)); } } // namespace
diff --git a/chrome/browser/safe_browsing/incident_reporting/delayed_callback_runner_unittest.cc b/chrome/browser/safe_browsing/incident_reporting/delayed_callback_runner_unittest.cc index 3220694..78bdb9b8 100644 --- a/chrome/browser/safe_browsing/incident_reporting/delayed_callback_runner_unittest.cc +++ b/chrome/browser/safe_browsing/incident_reporting/delayed_callback_runner_unittest.cc
@@ -10,7 +10,6 @@ #include "base/callback.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/run_loop.h" #include "base/threading/thread_task_runner_handle.h" #include "content/public/browser/browser_thread.h" @@ -70,7 +69,7 @@ // on behalf of the given callback name. std::unique_ptr<CallbackArgument> MakeCallbackArgument( const std::string& name) { - return base::MakeUnique<CallbackArgument>(base::Bind( + return std::make_unique<CallbackArgument>(base::Bind( &DelayedCallbackRunnerTest::OnDelete, base::Unretained(this), name)); }
diff --git a/chrome/browser/safe_browsing/incident_reporting/download_metadata_manager.cc b/chrome/browser/safe_browsing/incident_reporting/download_metadata_manager.cc index 6c5cd38e..026e90ae 100644 --- a/chrome/browser/safe_browsing/incident_reporting/download_metadata_manager.cc +++ b/chrome/browser/safe_browsing/incident_reporting/download_metadata_manager.cc
@@ -369,7 +369,7 @@ GetDownloadManagerForBrowserContext(item->GetBrowserContext()); DCHECK_EQ(contexts_.count(download_manager), 1U); contexts_[download_manager]->SetRequest( - item, base::MakeUnique<ClientDownloadRequest>(*request)); + item, std::make_unique<ClientDownloadRequest>(*request)); } void DownloadMetadataManager::GetDownloadDetails( @@ -481,7 +481,7 @@ get_details_callbacks_.push_back(callback); } else { callback.Run(download_metadata_ - ? base::MakeUnique<ClientIncidentReport_DownloadDetails>( + ? std::make_unique<ClientIncidentReport_DownloadDetails>( download_metadata_->download()) : nullptr); } @@ -590,7 +590,7 @@ while (!get_details_callbacks_.empty()) { const auto& callback = get_details_callbacks_.front(); callback.Run(download_metadata_ - ? base::MakeUnique<ClientIncidentReport_DownloadDetails>( + ? std::make_unique<ClientIncidentReport_DownloadDetails>( download_metadata_->download()) : nullptr); get_details_callbacks_.pop_front();
diff --git a/chrome/browser/safe_browsing/incident_reporting/extension_data_collection_unittest.cc b/chrome/browser/safe_browsing/incident_reporting/extension_data_collection_unittest.cc index a9d1e75..994779c 100644 --- a/chrome/browser/safe_browsing/incident_reporting/extension_data_collection_unittest.cc +++ b/chrome/browser/safe_browsing/incident_reporting/extension_data_collection_unittest.cc
@@ -4,10 +4,10 @@ #include "chrome/browser/safe_browsing/incident_reporting/extension_data_collection.h" +#include <memory> #include <utility> #include "base/command_line.h" -#include "base/memory/ptr_util.h" #include "base/strings/string_number_conversions.h" #include "base/strings/utf_string_conversions.h" #include "build/build_config.h" @@ -100,10 +100,10 @@ extension_prefs_->UpdateExtensionPref( extension_id, "install_time", - base::MakeUnique<base::Value>( + std::make_unique<base::Value>( base::Int64ToString(install_time.ToInternalValue()))); extension_prefs_->UpdateExtensionPref( - extension_id, "state", base::MakeUnique<base::Value>(state_value)); + extension_id, "state", std::make_unique<base::Value>(state_value)); } void ExtensionTestingProfile::SetInstallSignature( @@ -175,7 +175,7 @@ std::string(), // supervised_user_id TestingProfile::TestingFactories()); - return base::MakeUnique<ExtensionTestingProfile>(profile); + return std::make_unique<ExtensionTestingProfile>(profile); } content::TestBrowserThreadBundle browser_thread_bundle_;
diff --git a/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc b/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc index 35d4a23..6b704cd 100644 --- a/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc +++ b/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc
@@ -367,7 +367,7 @@ std::unique_ptr<IncidentReceiver> IncidentReportingService::GetIncidentReceiver() { - return base::MakeUnique<Receiver>(receiver_weak_ptr_factory_.GetWeakPtr()); + return std::make_unique<Receiver>(receiver_weak_ptr_factory_.GetWeakPtr()); } std::unique_ptr<prefs::mojom::TrackedPreferenceValidationDelegate> @@ -376,7 +376,7 @@ if (profile->IsOffTheRecord()) return std::unique_ptr<prefs::mojom::TrackedPreferenceValidationDelegate>(); - return base::MakeUnique<PreferenceValidationDelegate>(profile, + return std::make_unique<PreferenceValidationDelegate>(profile, GetIncidentReceiver()); } @@ -522,7 +522,7 @@ IncidentReportingService::GetOrCreateProfileContext(Profile* profile) { std::unique_ptr<ProfileContext>& context = profiles_[profile]; if (!context) - context = base::MakeUnique<ProfileContext>(); + context = std::make_unique<ProfileContext>(); return context.get(); }
diff --git a/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service_unittest.cc b/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service_unittest.cc index f2faed69..93d12c87 100644 --- a/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service_unittest.cc +++ b/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service_unittest.cc
@@ -14,7 +14,6 @@ #include "base/callback.h" #include "base/lazy_instance.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/strings/string_number_conversions.h" #include "base/strings/utf_string_conversions.h" #include "base/test/mock_entropy_provider.h" @@ -297,7 +296,7 @@ incident->set_path(kTestTrackedPrefPath); if (value) incident->set_atomic_value(value); - return base::MakeUnique<safe_browsing::TrackedPreferenceIncident>( + return std::make_unique<safe_browsing::TrackedPreferenceIncident>( std::move(incident), false /* is_personal */); } @@ -560,7 +559,7 @@ on_start_upload_callback_.Run(); on_start_upload_callback_ = base::Closure(); } - return base::MakeUnique<FakeUploader>( + return std::make_unique<FakeUploader>( base::Bind(&IncidentReportingServiceTest::OnUploaderDestroyed, base::Unretained(this)), callback, upload_result_); @@ -1312,11 +1311,11 @@ // Set up a prune state dict with data to be cleared (and not). std::unique_ptr<base::DictionaryValue> incidents_sent( new base::DictionaryValue()); - auto type_dict = base::MakeUnique<base::DictionaryValue>(); + auto type_dict = std::make_unique<base::DictionaryValue>(); type_dict->SetKey("foo", base::Value("47")); incidents_sent->SetWithoutPathExpansion(blacklist_load_type, std::move(type_dict)); - type_dict = base::MakeUnique<base::DictionaryValue>(); + type_dict = std::make_unique<base::DictionaryValue>(); type_dict->SetKey("bar", base::Value("43")); incidents_sent->SetWithoutPathExpansion(preference_type, std::move(type_dict));
diff --git a/chrome/browser/safe_browsing/incident_reporting/last_download_finder_unittest.cc b/chrome/browser/safe_browsing/incident_reporting/last_download_finder_unittest.cc index 44626dea..5b60484 100644 --- a/chrome/browser/safe_browsing/incident_reporting/last_download_finder_unittest.cc +++ b/chrome/browser/safe_browsing/incident_reporting/last_download_finder_unittest.cc
@@ -17,7 +17,6 @@ #include "base/files/file_util.h" #include "base/guid.h" #include "base/location.h" -#include "base/memory/ptr_util.h" #include "base/run_loop.h" #include "base/single_thread_task_runner.h" #include "base/strings/string_number_conversions.h" @@ -70,7 +69,7 @@ std::unique_ptr<history::HistoryService> history_service( new history::HistoryService( - base::MakeUnique<ChromeHistoryClient>( + std::make_unique<ChromeHistoryClient>( BookmarkModelFactory::GetForBrowserContext(profile)), std::unique_ptr<history::VisitDelegate>())); if (history_service->Init(
diff --git a/chrome/browser/safe_browsing/incident_reporting/preference_validation_delegate.cc b/chrome/browser/safe_browsing/incident_reporting/preference_validation_delegate.cc index 6bd74eb8..b1b074b 100644 --- a/chrome/browser/safe_browsing/incident_reporting/preference_validation_delegate.cc +++ b/chrome/browser/safe_browsing/incident_reporting/preference_validation_delegate.cc
@@ -9,7 +9,6 @@ #include <vector> #include "base/json/json_writer.h" -#include "base/memory/ptr_util.h" #include "chrome/browser/safe_browsing/incident_reporting/incident_receiver.h" #include "chrome/browser/safe_browsing/incident_reporting/tracked_preference_incident.h" #include "components/safe_browsing/proto/csd.pb.h" @@ -79,7 +78,7 @@ } incident->set_value_state(proto_value_state); incident_receiver_->AddIncidentForProfile( - profile_, base::MakeUnique<TrackedPreferenceIncident>( + profile_, std::make_unique<TrackedPreferenceIncident>( std::move(incident), is_personal)); } } @@ -113,7 +112,7 @@ } incident->set_value_state(proto_value_state); incident_receiver_->AddIncidentForProfile( - profile_, base::MakeUnique<TrackedPreferenceIncident>( + profile_, std::make_unique<TrackedPreferenceIncident>( std::move(incident), is_personal)); } }
diff --git a/chrome/browser/safe_browsing/incident_reporting/preference_validation_delegate_unittest.cc b/chrome/browser/safe_browsing/incident_reporting/preference_validation_delegate_unittest.cc index 0ea185a6..afa279b 100644 --- a/chrome/browser/safe_browsing/incident_reporting/preference_validation_delegate_unittest.cc +++ b/chrome/browser/safe_browsing/incident_reporting/preference_validation_delegate_unittest.cc
@@ -13,7 +13,6 @@ #include "base/bind.h" #include "base/compiler_specific.h" -#include "base/memory/ptr_util.h" #include "base/values.h" #include "chrome/browser/safe_browsing/incident_reporting/incident.h" #include "chrome/browser/safe_browsing/incident_reporting/mock_incident_receiver.h" @@ -130,7 +129,7 @@ using base::Value; switch (value_type) { case Value::Type::NONE: - return base::MakeUnique<base::Value>(); + return std::make_unique<base::Value>(); case Value::Type::BOOLEAN: return std::unique_ptr<Value>(new base::Value(false)); case Value::Type::INTEGER: @@ -213,7 +212,7 @@ TEST_P(PreferenceValidationDelegateNoIncident, Atomic) { instance_->OnAtomicPreferenceValidation( - kPrefPath, base::MakeUnique<base::Value>(), value_state_, + kPrefPath, std::make_unique<base::Value>(), value_state_, external_validation_value_state_, false /* is_personal */); EXPECT_EQ(0U, incidents_.size()); } @@ -256,7 +255,7 @@ TEST_P(PreferenceValidationDelegateWithIncident, Atomic) { instance_->OnAtomicPreferenceValidation( - kPrefPath, base::MakeUnique<base::Value>(), value_state_, + kPrefPath, std::make_unique<base::Value>(), value_state_, external_validation_value_state_, is_personal_); ASSERT_EQ(1U, incidents_.size()); std::unique_ptr<safe_browsing::ClientIncidentReport_IncidentData> incident(
diff --git a/chrome/browser/safe_browsing/incident_reporting/resource_request_detector.cc b/chrome/browser/safe_browsing/incident_reporting/resource_request_detector.cc index 9885c5f..d5595b6 100644 --- a/chrome/browser/safe_browsing/incident_reporting/resource_request_detector.cc +++ b/chrome/browser/safe_browsing/incident_reporting/resource_request_detector.cc
@@ -6,7 +6,6 @@ #include <utility> -#include "base/memory/ptr_util.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/safe_browsing/incident_reporting/incident_receiver.h" #include "chrome/browser/safe_browsing/incident_reporting/resource_request_incident.h" @@ -182,7 +181,7 @@ incident_receiver_->AddIncidentForProfile( profile, - base::MakeUnique<ResourceRequestIncident>(std::move(incident_data))); + std::make_unique<ResourceRequestIncident>(std::move(incident_data))); } }
diff --git a/chrome/browser/safe_browsing/incident_reporting/resource_request_detector_unittest.cc b/chrome/browser/safe_browsing/incident_reporting/resource_request_detector_unittest.cc index 9baa28c..27f0fc7 100644 --- a/chrome/browser/safe_browsing/incident_reporting/resource_request_detector_unittest.cc +++ b/chrome/browser/safe_browsing/incident_reporting/resource_request_detector_unittest.cc
@@ -81,7 +81,7 @@ new StrictMock<safe_browsing::MockIncidentReceiver>()), mock_database_manager_(new StrictMock<MockSafeBrowsingDatabaseManager>), fake_resource_request_detector_( - base::MakeUnique<FakeResourceRequestDetector>( + std::make_unique<FakeResourceRequestDetector>( mock_database_manager_, base::WrapUnique(mock_incident_receiver_))) {}
diff --git a/chrome/browser/safe_browsing/incident_reporting/tracked_preference_incident_unittest.cc b/chrome/browser/safe_browsing/incident_reporting/tracked_preference_incident_unittest.cc index 1ad07e0b..f31aaf4 100644 --- a/chrome/browser/safe_browsing/incident_reporting/tracked_preference_incident_unittest.cc +++ b/chrome/browser/safe_browsing/incident_reporting/tracked_preference_incident_unittest.cc
@@ -7,7 +7,6 @@ #include <memory> #include <utility> -#include "base/memory/ptr_util.h" #include "components/safe_browsing/proto/csd.pb.h" #include "testing/gtest/include/gtest/gtest.h" @@ -25,7 +24,7 @@ changed ? ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState_CHANGED : ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState_CLEARED); - return base::MakeUnique<TrackedPreferenceIncident>(std::move(incident), + return std::make_unique<TrackedPreferenceIncident>(std::move(incident), is_personal); }
diff --git a/chrome/browser/safe_browsing/local_database_manager.cc b/chrome/browser/safe_browsing/local_database_manager.cc index 9f8c714..3230b6fc 100644 --- a/chrome/browser/safe_browsing/local_database_manager.cc +++ b/chrome/browser/safe_browsing/local_database_manager.cc
@@ -350,7 +350,7 @@ // We need to check the database for url prefix, and later may fetch the url // from the safebrowsing backends. These need to be asynchronous. std::unique_ptr<SafeBrowsingCheck> check = - base::MakeUnique<SafeBrowsingCheck>( + std::make_unique<SafeBrowsingCheck>( url_chain, std::vector<SBFullHash>(), client, BINURL, CreateSBThreatTypeSet({SB_THREAT_TYPE_URL_BINARY_MALWARE})); std::vector<SBPrefix> prefixes; @@ -378,7 +378,7 @@ prefixes.push_back(hash.prefix); std::unique_ptr<SafeBrowsingCheck> check = - base::MakeUnique<SafeBrowsingCheck>( + std::make_unique<SafeBrowsingCheck>( std::vector<GURL>(), extension_id_hashes, client, EXTENSIONBLACKLIST, CreateSBThreatTypeSet({SB_THREAT_TYPE_EXTENSION})); StartSafeBrowsingCheck(
diff --git a/chrome/browser/safe_browsing/notification_image_reporter.cc b/chrome/browser/safe_browsing/notification_image_reporter.cc index 82e9817..1a853c2 100644 --- a/chrome/browser/safe_browsing/notification_image_reporter.cc +++ b/chrome/browser/safe_browsing/notification_image_reporter.cc
@@ -10,7 +10,6 @@ #include "base/bind.h" #include "base/feature_list.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/memory/ref_counted_memory.h" #include "base/metrics/histogram_functions.h" #include "base/rand_util.h" @@ -93,7 +92,7 @@ NotificationImageReporter::NotificationImageReporter( net::URLRequestContext* request_context) : NotificationImageReporter( - base::MakeUnique<net::ReportSender>(request_context, + std::make_unique<net::ReportSender>(request_context, kTrafficAnnotation)) {} NotificationImageReporter::NotificationImageReporter(
diff --git a/chrome/browser/safe_browsing/notification_image_reporter_unittest.cc b/chrome/browser/safe_browsing/notification_image_reporter_unittest.cc index 547e5c1..23d5c62 100644 --- a/chrome/browser/safe_browsing/notification_image_reporter_unittest.cc +++ b/chrome/browser/safe_browsing/notification_image_reporter_unittest.cc
@@ -149,7 +149,7 @@ g_browser_process->safe_browsing_service()->Initialize(); base::RunLoop().RunUntilIdle(); // TODO(johnme): Might still be tasks on IO. - profile_ = base::MakeUnique<TestingProfile>(); + profile_ = std::make_unique<TestingProfile>(); base::RunLoop run_loop; BrowserThread::PostTaskAndReply( @@ -178,7 +178,7 @@ void NotificationImageReporterTest::SetExtendedReportingLevel( ExtendedReportingLevel level) { - feature_list_ = base::MakeUnique<base::test::ScopedFeatureList>(); + feature_list_ = std::make_unique<base::test::ScopedFeatureList>(); if (level != SBER_LEVEL_SCOUT) // Explicitly disable CanShowScoutOptIn, which is on by default. feature_list_->InitWithFeatures({}, {safe_browsing::kCanShowScoutOptIn});
diff --git a/chrome/browser/safe_browsing/permission_reporter.cc b/chrome/browser/safe_browsing/permission_reporter.cc index f77e885..3b85244 100644 --- a/chrome/browser/safe_browsing/permission_reporter.cc +++ b/chrome/browser/safe_browsing/permission_reporter.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/safe_browsing/permission_reporter.h" #include <functional> +#include <memory> #include "base/containers/queue.h" #include "base/hash.h" @@ -177,7 +178,7 @@ PermissionReporter::PermissionReporter(net::URLRequestContext* request_context) : PermissionReporter( - base::MakeUnique<net::ReportSender>(request_context, + std::make_unique<net::ReportSender>(request_context, kTrafficAnnotation), base::WrapUnique(new base::DefaultClock)) {}
diff --git a/chrome/browser/safe_browsing/permission_reporter_browsertest.cc b/chrome/browser/safe_browsing/permission_reporter_browsertest.cc index 01c62c4..afcc874e 100644 --- a/chrome/browser/safe_browsing/permission_reporter_browsertest.cc +++ b/chrome/browser/safe_browsing/permission_reporter_browsertest.cc
@@ -4,6 +4,8 @@ #include "chrome/browser/safe_browsing/permission_reporter.h" +#include <memory> + #include "base/command_line.h" #include "base/memory/ptr_util.h" #include "base/memory/ref_counted.h" @@ -93,7 +95,7 @@ // Set up mock permission manager and prompt factory. PermissionRequestManager* manager = GetPermissionRequestManager(browser); std::unique_ptr<MockPermissionPromptFactory> mock_permission_prompt_factory = - base::MakeUnique<MockPermissionPromptFactory>(manager); + std::make_unique<MockPermissionPromptFactory>(manager); ASSERT_TRUE(embedded_test_server()->Start()); ui_test_utils::NavigateToURLBlockUntilNavigationsComplete( @@ -136,7 +138,7 @@ // Set up mock permission manager and prompt factory. PermissionRequestManager* manager = GetPermissionRequestManager(browser); std::unique_ptr<MockPermissionPromptFactory> mock_permission_prompt_factory = - base::MakeUnique<MockPermissionPromptFactory>(manager); + std::make_unique<MockPermissionPromptFactory>(manager); ASSERT_TRUE(embedded_test_server()->Start()); ui_test_utils::NavigateToURLBlockUntilNavigationsComplete(
diff --git a/chrome/browser/safe_browsing/ping_manager.cc b/chrome/browser/safe_browsing/ping_manager.cc index b0d27cc..68bc6a2a 100644 --- a/chrome/browser/safe_browsing/ping_manager.cc +++ b/chrome/browser/safe_browsing/ping_manager.cc
@@ -4,6 +4,8 @@ #include "chrome/browser/safe_browsing/ping_manager.h" +#include <memory> + #include "base/memory/ptr_util.h" #include "chrome/browser/safe_browsing/notification_image_reporter.h" #include "chrome/browser/safe_browsing/permission_reporter.h" @@ -31,9 +33,9 @@ const SafeBrowsingProtocolConfig& config) : BasePingManager(request_context_getter, config) { if (request_context_getter) { - permission_reporter_ = base::MakeUnique<PermissionReporter>( + permission_reporter_ = std::make_unique<PermissionReporter>( request_context_getter->GetURLRequestContext()); - notification_image_reporter_ = base::MakeUnique<NotificationImageReporter>( + notification_image_reporter_ = std::make_unique<NotificationImageReporter>( request_context_getter->GetURLRequestContext()); } }
diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc index 6f47c6d..f72a6566 100644 --- a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc +++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
@@ -6,6 +6,8 @@ #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" +#include <memory> + #include "base/lazy_instance.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/history/history_service_factory.h" @@ -277,12 +279,12 @@ DCHECK(profile); std::unique_ptr<ChromeMetricsHelper> metrics_helper = - base::MakeUnique<ChromeMetricsHelper>( + std::make_unique<ChromeMetricsHelper>( web_contents, unsafe_resources[0].url, GetReportingInfo(unsafe_resources), GetSamplingEventName(GetInterstitialReason(unsafe_resources))); - return base::MakeUnique<SafeBrowsingControllerClient>( + return std::make_unique<SafeBrowsingControllerClient>( web_contents, std::move(metrics_helper), profile->GetPrefs(), ui_manager->app_locale(), ui_manager->default_safe_page()); }
diff --git a/chrome/browser/safe_browsing/safe_browsing_database.cc b/chrome/browser/safe_browsing/safe_browsing_database.cc index ea83624..53d0240 100644 --- a/chrome/browser/safe_browsing/safe_browsing_database.cc +++ b/chrome/browser/safe_browsing/safe_browsing_database.cc
@@ -268,7 +268,7 @@ bool enable_extension_blacklist, bool enable_ip_blacklist, bool enable_unwanted_software_list) override { - return base::MakeUnique<SafeBrowsingDatabaseNew>( + return std::make_unique<SafeBrowsingDatabaseNew>( db_task_runner, CreateStore(true, db_task_runner), // browse_store CreateStore(enable_download_protection, db_task_runner), CreateStore(enable_client_side_whitelist, db_task_runner),
diff --git a/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc b/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc index 43f264c9..1d6ca88d 100644 --- a/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc +++ b/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc
@@ -13,7 +13,6 @@ #include "base/files/file_util.h" #include "base/files/scoped_temp_dir.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "base/sha1.h" @@ -85,7 +84,7 @@ raw_data->add_add_numbers(add_chunk_numbers[i]); } - return base::MakeUnique<SBChunkData>(std::move(raw_data)); + return std::make_unique<SBChunkData>(std::move(raw_data)); } // Create add chunk with a single prefix.
diff --git a/chrome/browser/safe_browsing/safe_browsing_navigation_observer.cc b/chrome/browser/safe_browsing/safe_browsing_navigation_observer.cc index 29d50acc..009fa96 100644 --- a/chrome/browser/safe_browsing/safe_browsing_navigation_observer.cc +++ b/chrome/browser/safe_browsing/safe_browsing_navigation_observer.cc
@@ -4,7 +4,8 @@ #include "chrome/browser/safe_browsing/safe_browsing_navigation_observer.h" -#include "base/memory/ptr_util.h" +#include <memory> + #include "base/time/time.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/content_settings/host_content_settings_map_factory.h" @@ -81,7 +82,7 @@ Profile::FromBrowserContext(web_contents->GetBrowserContext()))) { web_contents->SetUserData( kWebContentsUserDataKey, - base::MakeUnique<SafeBrowsingNavigationObserver>( + std::make_unique<SafeBrowsingNavigationObserver>( web_contents, g_browser_process->safe_browsing_service() ->navigation_observer_manager())); } @@ -114,7 +115,7 @@ void SafeBrowsingNavigationObserver::DidStartNavigation( content::NavigationHandle* navigation_handle) { std::unique_ptr<NavigationEvent> nav_event = - base::MakeUnique<NavigationEvent>(); + std::make_unique<NavigationEvent>(); auto it = navigation_handle_map_.find(navigation_handle); // It is possible to see multiple DidStartNavigation(..) with the same // navigation_handle (e.g. cross-process transfer). If that's the case,
diff --git a/chrome/browser/safe_browsing/safe_browsing_navigation_observer_manager.cc b/chrome/browser/safe_browsing/safe_browsing_navigation_observer_manager.cc index 001a6557..aab0c41d 100644 --- a/chrome/browser/safe_browsing/safe_browsing_navigation_observer_manager.cc +++ b/chrome/browser/safe_browsing/safe_browsing_navigation_observer_manager.cc
@@ -4,7 +4,8 @@ #include "chrome/browser/safe_browsing/safe_browsing_navigation_observer_manager.h" -#include "base/memory/ptr_util.h" +#include <memory> + #include "base/metrics/field_trial_params.h" #include "base/metrics/histogram_macros.h" #include "base/strings/stringprintf.h" @@ -453,7 +454,7 @@ SafeBrowsingNavigationObserverManager::ClearURLRef(target_url); std::unique_ptr<NavigationEvent> nav_event = - base::MakeUnique<NavigationEvent>(); + std::make_unique<NavigationEvent>(); if (rfh) { nav_event->source_url = SafeBrowsingNavigationObserverManager::ClearURLRef( rfh->GetLastCommittedURL()); @@ -568,7 +569,7 @@ const GURL& destination_main_frame_url, ReferrerChainEntry::URLType type) { std::unique_ptr<ReferrerChainEntry> referrer_chain_entry = - base::MakeUnique<ReferrerChainEntry>(); + std::make_unique<ReferrerChainEntry>(); referrer_chain_entry->set_navigation_initiation( nav_event->navigation_initiation); const GURL destination_url = nav_event->GetDestinationUrl();
diff --git a/chrome/browser/safe_browsing/safe_browsing_navigation_observer_unittest.cc b/chrome/browser/safe_browsing/safe_browsing_navigation_observer_unittest.cc index 6beafcd..6baf731 100644 --- a/chrome/browser/safe_browsing/safe_browsing_navigation_observer_unittest.cc +++ b/chrome/browser/safe_browsing/safe_browsing_navigation_observer_unittest.cc
@@ -4,6 +4,8 @@ #include "chrome/browser/safe_browsing/safe_browsing_navigation_observer.h" +#include <memory> + #include "base/test/histogram_tester.h" #include "chrome/browser/safe_browsing/safe_browsing_navigation_observer_manager.h" #include "chrome/browser/sessions/session_tab_helper.h" @@ -86,7 +88,7 @@ std::unique_ptr<NavigationEvent> CreateNavigationEventUniquePtr( const GURL& destination_url, const base::Time& timestamp) { std::unique_ptr<NavigationEvent> nav_event_ptr = - base::MakeUnique<NavigationEvent>(); + std::make_unique<NavigationEvent>(); nav_event_ptr->original_request_url = destination_url; nav_event_ptr->source_url = GURL("http://dummy.com"); nav_event_ptr->last_updated = timestamp;
diff --git a/chrome/browser/safe_browsing/safe_browsing_service.cc b/chrome/browser/safe_browsing/safe_browsing_service.cc index cc60615..4f990d6 100644 --- a/chrome/browser/safe_browsing/safe_browsing_service.cc +++ b/chrome/browser/safe_browsing/safe_browsing_service.cc
@@ -14,7 +14,6 @@ #include "base/command_line.h" #include "base/lazy_instance.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/metrics/histogram_macros.h" #include "base/path_service.h" #include "base/strings/string_util.h" @@ -488,7 +487,7 @@ void SafeBrowsingService::AddPrefService(PrefService* pref_service) { DCHECK(prefs_map_.find(pref_service) == prefs_map_.end()); std::unique_ptr<PrefChangeRegistrar> registrar = - base::MakeUnique<PrefChangeRegistrar>(); + std::make_unique<PrefChangeRegistrar>(); registrar->Init(pref_service); registrar->Add( prefs::kSafeBrowsingEnabled, @@ -588,6 +587,6 @@ void SafeBrowsingService::CreateTriggerManager() { DCHECK_CURRENTLY_ON(BrowserThread::UI); - trigger_manager_ = base::MakeUnique<TriggerManager>(ui_manager_.get()); + trigger_manager_ = std::make_unique<TriggerManager>(ui_manager_.get()); } } // namespace safe_browsing
diff --git a/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc b/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc index 7ce1ba2..d53a950 100644 --- a/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc +++ b/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc
@@ -152,7 +152,7 @@ if (!base::StartsWith(request.relative_url, kNeverCompletesPath, base::CompareCase::SENSITIVE)) return nullptr; - return base::MakeUnique<NeverCompletingHttpResponse>(); + return std::make_unique<NeverCompletingHttpResponse>(); } // This is not a proper WebSocket server. It does the minimum necessary to make @@ -194,7 +194,7 @@ if (request.relative_url != kMalwareWebSocketPath) return nullptr; - return base::MakeUnique<QuasiWebSocketHttpResponse>(request); + return std::make_unique<QuasiWebSocketHttpResponse>(request); } enum class ContextType { kWindow, kWorker, kSharedWorker, kServiceWorker }; @@ -938,7 +938,7 @@ } IN_PROC_BROWSER_TEST_P(SafeBrowsingServiceMetadataTest, MalwareMainFrameInApp) { - auto feature_list = base::MakeUnique<base::test::ScopedFeatureList>(); + auto feature_list = std::make_unique<base::test::ScopedFeatureList>(); feature_list->InitAndEnableFeature(features::kDesktopPWAWindowing); GURL url = embedded_test_server()->GetURL(kEmptyPage); @@ -1982,7 +1982,7 @@ base::Bind(&SafeBrowsingDatabaseManagerCookieTest::HandleRequest)); ASSERT_TRUE(embedded_test_server()->Start()); - sb_factory_ = base::MakeUnique<TestSafeBrowsingServiceFactory>(); + sb_factory_ = std::make_unique<TestSafeBrowsingServiceFactory>(); SetProtocolConfigURLPrefix( embedded_test_server()->GetURL("/testpath").spec(), sb_factory_.get()); SafeBrowsingService::RegisterFactory(sb_factory_.get()); @@ -2130,7 +2130,7 @@ V4SafeBrowsingServiceTest() : SafeBrowsingServiceTest() {} void SetUp() override { - sb_factory_ = base::MakeUnique<TestSafeBrowsingServiceFactory>( + sb_factory_ = std::make_unique<TestSafeBrowsingServiceFactory>( V4FeatureList::V4UsageStatus::V4_ONLY); sb_factory_->SetTestUIManager(new FakeSafeBrowsingUIManager()); SafeBrowsingService::RegisterFactory(sb_factory_.get());
diff --git a/chrome/browser/safe_browsing/services_delegate_impl.cc b/chrome/browser/safe_browsing/services_delegate_impl.cc index d3814b9..3f75ac5 100644 --- a/chrome/browser/safe_browsing/services_delegate_impl.cc +++ b/chrome/browser/safe_browsing/services_delegate_impl.cc
@@ -188,7 +188,7 @@ auto it = password_protection_service_map_.find(profile); DCHECK(it == password_protection_service_map_.end()); std::unique_ptr<ChromePasswordProtectionService> service = - base::MakeUnique<ChromePasswordProtectionService>(safe_browsing_service_, + std::make_unique<ChromePasswordProtectionService>(safe_browsing_service_, profile); password_protection_service_map_[profile] = std::move(service); }
diff --git a/chrome/browser/safe_browsing/settings_reset_prompt/default_settings_fetcher.cc b/chrome/browser/safe_browsing/settings_reset_prompt/default_settings_fetcher.cc index ea8490e..3bbc5ee5 100644 --- a/chrome/browser/safe_browsing/settings_reset_prompt/default_settings_fetcher.cc +++ b/chrome/browser/safe_browsing/settings_reset_prompt/default_settings_fetcher.cc
@@ -9,7 +9,6 @@ #include "base/bind_helpers.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "chrome/browser/google/google_brand.h" #include "chrome/browser/profile_resetter/brandcode_config_fetcher.h" #include "chrome/browser/profile_resetter/brandcoded_default_settings.h" @@ -70,7 +69,7 @@ // For non Google Chrome builds and cases with an empty |brandcode|, we create // a default-constructed |BrandcodedDefaultSettings| object and post the // callback immediately. - PostCallbackAndDeleteSelf(base::MakeUnique<BrandcodedDefaultSettings>()); + PostCallbackAndDeleteSelf(std::make_unique<BrandcodedDefaultSettings>()); } void DefaultSettingsFetcher::OnSettingsFetched() {
diff --git a/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_model.cc b/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_model.cc index df01d350..b6c23c6b6 100644 --- a/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_model.cc +++ b/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_model.cc
@@ -70,7 +70,7 @@ : profile_(profile), prefs_manager_(profile, prompt_config->prompt_wave()), prompt_config_(std::move(prompt_config)), - settings_snapshot_(base::MakeUnique<ResettableSettingsSnapshot>(profile)), + settings_snapshot_(std::make_unique<ResettableSettingsSnapshot>(profile)), profile_resetter_(std::move(profile_resetter)), time_since_last_prompt_(base::Time::Now() - prefs_manager_.LastTriggeredPrompt()) {
diff --git a/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_model_browsertest_win.cc b/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_model_browsertest_win.cc index ac2fb4b..a5ed9dd 100644 --- a/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_model_browsertest_win.cc +++ b/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_model_browsertest_win.cc
@@ -10,7 +10,6 @@ #include <utility> #include "base/callback.h" -#include "base/memory/ptr_util.h" #include "base/run_loop.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" @@ -129,7 +128,7 @@ data.SetURL(kDefaultSearchUrl); TemplateURL* template_url = - template_url_service->Add(base::MakeUnique<TemplateURL>(data)); + template_url_service->Add(std::make_unique<TemplateURL>(data)); template_url_service->SetUserSelectedDefaultSearchProvider(template_url); // Set up a couple of startup URLs.
diff --git a/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_model_unittest.cc b/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_model_unittest.cc index b33986d..13d612b 100644 --- a/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_model_unittest.cc +++ b/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_model_unittest.cc
@@ -10,7 +10,6 @@ #include <utility> #include "base/callback.h" -#include "base/memory/ptr_util.h" #include "base/strings/utf_string_conversions.h" #include "base/values.h" #include "chrome/browser/extensions/extension_service_test_base.h" @@ -124,7 +123,7 @@ data.SetKeyword(base::ASCIIToUTF16("TestEngine")); data.SetURL(default_search); TemplateURL* template_url = - template_url_service->Add(base::MakeUnique<TemplateURL>(data)); + template_url_service->Add(std::make_unique<TemplateURL>(data)); template_url_service->SetUserSelectedDefaultSearchProvider(template_url); } @@ -405,12 +404,12 @@ expected_reset_flags = ProfileResetter::HOMEPAGE; auto profile_resetter = - base::MakeUnique<NiceMock<MockProfileResetter>>(profile()); + std::make_unique<NiceMock<MockProfileResetter>>(profile()); EXPECT_CALL(*profile_resetter, MockReset(expected_reset_flags, _, _)) .Times(1); ModelPointer model = CreateModel(reset_urls, std::move(profile_resetter)); - model->PerformReset(base::MakeUnique<BrandcodedDefaultSettings>(), + model->PerformReset(std::make_unique<BrandcodedDefaultSettings>(), base::Bind(&SettingsResetPromptModelTest::OnResetDone, base::Unretained(this))); EXPECT_EQ(reset_callbacks_, 1);
diff --git a/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_test_utils.cc b/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_test_utils.cc index bb50eb2..cc09e7cc 100644 --- a/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_test_utils.cc +++ b/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_test_utils.cc
@@ -7,7 +7,6 @@ #include <utility> #include "base/callback.h" -#include "base/memory/ptr_util.h" #include "chrome/browser/profile_resetter/brandcoded_default_settings.h" #include "chrome/browser/profile_resetter/resettable_settings_snapshot.h" #include "chrome/browser/profiles/profile.h" @@ -43,7 +42,7 @@ Profile* profile, const std::unordered_set<std::string>& reset_urls, std::unique_ptr<ProfileResetter> profile_resetter) { - auto config = base::MakeUnique<NiceMock<MockSettingsResetPromptConfig>>(); + auto config = std::make_unique<NiceMock<MockSettingsResetPromptConfig>>(); int id = 1; for (const std::string& reset_url : reset_urls) { @@ -52,11 +51,11 @@ ++id; } - return base::MakeUnique<SettingsResetPromptModel>( + return std::make_unique<SettingsResetPromptModel>( profile, std::move(config), profile_resetter ? std::move(profile_resetter) - : base::MakeUnique<NiceMock<MockProfileResetter>>(profile)); + : std::make_unique<NiceMock<MockProfileResetter>>(profile)); } } // namespace safe_browsing
diff --git a/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_util_win.cc b/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_util_win.cc index d2633f6..19a2640 100644 --- a/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_util_win.cc +++ b/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_util_win.cc
@@ -11,7 +11,6 @@ #include "base/bind_helpers.h" #include "base/location.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/time/time.h" #include "chrome/browser/profile_resetter/brandcoded_default_settings.h" #include "chrome/browser/profiles/profile.h" @@ -70,8 +69,8 @@ // displaying the dialog. Profile* profile = browser->profile()->GetOriginalProfile(); - auto model = base::MakeUnique<SettingsResetPromptModel>( - profile, std::move(config), base::MakeUnique<ProfileResetter>(profile)); + auto model = std::make_unique<SettingsResetPromptModel>( + profile, std::move(config), std::make_unique<ProfileResetter>(profile)); model->ReportUmaMetrics();
diff --git a/chrome/browser/search_engines/template_url_fetcher_unittest.cc b/chrome/browser/search_engines/template_url_fetcher_unittest.cc index 0941b0ba..a6f00d5 100644 --- a/chrome/browser/search_engines/template_url_fetcher_unittest.cc +++ b/chrome/browser/search_engines/template_url_fetcher_unittest.cc
@@ -13,7 +13,6 @@ #include "base/callback_helpers.h" #include "base/files/file_util.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/path_service.h" #include "base/run_loop.h" #include "base/strings/utf_string_conversions.h" @@ -248,7 +247,7 @@ data.SetShortName(keyword); data.SetKeyword(keyword); data.SetURL("http://example.com/"); - test_util()->model()->Add(base::MakeUnique<TemplateURL>(data)); + test_util()->model()->Add(std::make_unique<TemplateURL>(data)); test_util()->ChangeModelToLoadState(); EXPECT_TRUE(test_util()->model()->GetTemplateURLForKeyword(keyword));
diff --git a/chrome/browser/search_engines/template_url_service_android.cc b/chrome/browser/search_engines/template_url_service_android.cc index c2f85c4..2e5abc0 100644 --- a/chrome/browser/search_engines/template_url_service_android.cc +++ b/chrome/browser/search_engines/template_url_service_android.cc
@@ -11,7 +11,6 @@ #include "base/command_line.h" #include "base/feature_list.h" #include "base/format_macros.h" -#include "base/memory/ptr_util.h" #include "base/metrics/field_trial_params.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/profiles/profile_manager.h" @@ -391,7 +390,7 @@ data.last_visited = base::Time::Now() - base::TimeDelta::FromDays((int) age_in_days); TemplateURL* t_url = - template_url_service_->Add(base::MakeUnique<TemplateURL>(data)); + template_url_service_->Add(std::make_unique<TemplateURL>(data)); CHECK(t_url) << "Failed adding template url for: " << keyword; return base::android::ConvertUTF16ToJavaString(env, t_url->data().keyword()); }
diff --git a/chrome/browser/search_engines/template_url_service_factory.cc b/chrome/browser/search_engines/template_url_service_factory.cc index e2d9366..afda6c0 100644 --- a/chrome/browser/search_engines/template_url_service_factory.cc +++ b/chrome/browser/search_engines/template_url_service_factory.cc
@@ -7,7 +7,6 @@ #include <string> #include "base/bind.h" -#include "base/memory/ptr_util.h" #include "build/build_config.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/google/google_url_tracker_factory.h" @@ -50,7 +49,7 @@ rlz::RLZTracker::ChromeOmnibox(), rlz_lib::SET_TO_GOOGLE); #endif Profile* profile = static_cast<Profile*>(context); - return base::MakeUnique<TemplateURLService>( + return std::make_unique<TemplateURLService>( profile->GetPrefs(), std::unique_ptr<SearchTermsData>(new UIThreadSearchTermsData(profile)), WebDataServiceFactory::GetKeywordWebDataForProfile(
diff --git a/chrome/browser/search_engines/template_url_service_sync_unittest.cc b/chrome/browser/search_engines/template_url_service_sync_unittest.cc index 9824564..b6fef83 100644 --- a/chrome/browser/search_engines/template_url_service_sync_unittest.cc +++ b/chrome/browser/search_engines/template_url_service_sync_unittest.cc
@@ -310,7 +310,7 @@ data.prepopulate_id = prepopulate_id; if (!guid.empty()) data.sync_guid = guid; - return base::MakeUnique<TemplateURL>(data); + return std::make_unique<TemplateURL>(data); } void TemplateURLServiceSyncTest::AssertEquals(const TemplateURL& expected, @@ -388,7 +388,7 @@ data.date_created = Time::FromTimeT(100); data.last_modified = Time::FromTimeT(100); data.sync_guid = guid; - return base::MakeUnique<TemplateURL>(data); + return std::make_unique<TemplateURL>(data); } syncer::SyncMergeResult TemplateURLServiceSyncTest::MergeAndExpectNotify( @@ -490,7 +490,7 @@ // Change default search provider to an extension one. std::unique_ptr<TemplateURLData> extension = GenerateDummyTemplateURLData("extension"); - auto ext_dse = base::MakeUnique<TemplateURL>( + auto ext_dse = std::make_unique<TemplateURL>( *extension, TemplateURL::NORMAL_CONTROLLED_BY_EXTENSION, "ext", Time(), true); test_util_a_->AddExtensionControlledTURL(std::move(ext_dse)); @@ -1752,7 +1752,7 @@ // Change the default search provider to an extension one. std::unique_ptr<TemplateURLData> extension = GenerateDummyTemplateURLData("extensiondefault"); - auto ext_dse = base::MakeUnique<TemplateURL>( + auto ext_dse = std::make_unique<TemplateURL>( *extension, TemplateURL::NORMAL_CONTROLLED_BY_EXTENSION, "ext", Time(), true); test_util_a_->AddExtensionControlledTURL(std::move(ext_dse)); @@ -1803,7 +1803,7 @@ // Change the default search provider to an extension one. std::unique_ptr<TemplateURLData> extension = GenerateDummyTemplateURLData("common_keyword"); - auto ext_dse = base::MakeUnique<TemplateURL>( + auto ext_dse = std::make_unique<TemplateURL>( *extension, TemplateURL::NORMAL_CONTROLLED_BY_EXTENSION, "ext", Time(), true); const TemplateURL* extension_turl = @@ -2000,7 +2000,7 @@ data_copy.SetKeyword(ASCIIToUTF16(kNewKeyword)); // Set safe_for_autoreplace to false so our keyword survives. data_copy.safe_for_autoreplace = false; - model()->Add(base::MakeUnique<TemplateURL>(data_copy)); + model()->Add(std::make_unique<TemplateURL>(data_copy)); // Merge the prepopulate search engines. base::Time pre_merge_time = base::Time::Now(); @@ -2294,7 +2294,7 @@ TemplateURLData data = *default_turl; data.SetURL("http://old.wrong.url.com?q={searchTerms}"); data.sync_guid = "default"; - model()->Add(base::MakeUnique<TemplateURL>(data)); + model()->Add(std::make_unique<TemplateURL>(data)); model()->MergeDataAndStartSyncing(syncer::SEARCH_ENGINES, syncer::SyncDataList(), PassProcessor(), @@ -2330,7 +2330,7 @@ data.date_created = Time::FromTimeT(50); data.last_modified = Time::FromTimeT(50); data.sync_guid = "default"; - model()->Add(base::MakeUnique<TemplateURL>(data)); + model()->Add(std::make_unique<TemplateURL>(data)); data.date_created = Time::FromTimeT(100); data.last_modified = Time::FromTimeT(100); @@ -2359,7 +2359,7 @@ data.last_modified = Time::FromTimeT(50); data.prepopulate_id = 1; data.sync_guid = "default"; - model()->Add(base::MakeUnique<TemplateURL>(data)); + model()->Add(std::make_unique<TemplateURL>(data)); TemplateURLData new_data(*default_turl); new_data.SetKeyword(ASCIIToUTF16("new_kw")); @@ -2374,7 +2374,7 @@ // Test that a remote TemplateURL can override a local TemplateURL not yet // known to sync. std::unique_ptr<TemplateURL> sync_turl = - base::MakeUnique<TemplateURL>(new_data); + std::make_unique<TemplateURL>(new_data); syncer::SyncDataList list; list.push_back(TemplateURLService::CreateSyncDataFromTemplateURL(*sync_turl)); MergeAndExpectNotify(list, 1); @@ -2419,7 +2419,7 @@ data.date_created = Time::FromTimeT(50); data.last_modified = Time::FromTimeT(50); data.sync_guid = "default"; - model()->Add(base::MakeUnique<TemplateURL>(data)); + model()->Add(std::make_unique<TemplateURL>(data)); data.date_created = Time::FromTimeT(100); data.last_modified = Time::FromTimeT(100);
diff --git a/chrome/browser/search_engines/template_url_service_unittest.cc b/chrome/browser/search_engines/template_url_service_unittest.cc index 26f0d87..5e1b7bc 100644 --- a/chrome/browser/search_engines/template_url_service_unittest.cc +++ b/chrome/browser/search_engines/template_url_service_unittest.cc
@@ -13,7 +13,6 @@ #include "base/bind_helpers.h" #include "base/callback.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/memory/ref_counted.h" #include "base/run_loop.h" #include "base/strings/string_split.h" @@ -99,7 +98,7 @@ data.date_created = date_created; data.last_modified = last_modified; data.last_visited = last_visited; - return base::MakeUnique<TemplateURL>(data, type); + return std::make_unique<TemplateURL>(data, type); } TemplateURL* AddKeywordWithDate(TemplateURLService* model, @@ -131,7 +130,7 @@ } std::unique_ptr<TemplateURLData> CreateTestSearchEngine() { - auto result = base::MakeUnique<TemplateURLData>(); + auto result = std::make_unique<TemplateURLData>(); result->SetShortName(ASCIIToUTF16("test1")); result->SetKeyword(ASCIIToUTF16("test.com")); result->SetURL("http://test.com/search?t={searchTerms}"); @@ -259,7 +258,7 @@ GenerateDummyTemplateURLData(keyword); turl_data->safe_for_autoreplace = false; - auto ext_dse = base::MakeUnique<TemplateURL>( + auto ext_dse = std::make_unique<TemplateURL>( *turl_data, TemplateURL::NORMAL_CONTROLLED_BY_EXTENSION, extension_name, install_time, wants_to_be_default_engine); return test_util()->AddExtensionControlledTURL(std::move(ext_dse)); @@ -305,12 +304,12 @@ data.last_modified = Time::FromTimeT(100); data.last_visited = Time::FromTimeT(100); data.prepopulate_id = prepopulate_id; - return base::MakeUnique<TemplateURL>(data); + return std::make_unique<TemplateURL>(data); } void TemplateURLServiceTest::SetOverriddenEngines() { // Set custom search engine as default fallback through overrides. - auto entry = base::MakeUnique<base::DictionaryValue>(); + auto entry = std::make_unique<base::DictionaryValue>(); entry->SetString("name", "override_name"); entry->SetString("keyword", "override_keyword"); entry->SetString("search_url", "http://override.com/s?q={searchTerms}"); @@ -320,12 +319,12 @@ entry->SetString("suggest_url", "http://override.com/suggest?q={searchTerms}"); - auto overrides_list = base::MakeUnique<base::ListValue>(); + auto overrides_list = std::make_unique<base::ListValue>(); overrides_list->Append(std::move(entry)); auto* prefs = test_util()->profile()->GetTestingPrefService(); prefs->SetUserPref(prefs::kSearchProviderOverridesVersion, - base::MakeUnique<base::Value>(1)); + std::make_unique<base::Value>(1)); prefs->SetUserPref(prefs::kSearchProviderOverrides, std::move(overrides_list)); } @@ -362,7 +361,7 @@ data.last_modified = Time::FromTimeT(100); data.last_visited = Time::FromTimeT(100); data.sync_guid = "00000000-0000-0000-0000-000000000001"; - TemplateURL* t_url = model()->Add(base::MakeUnique<TemplateURL>(data)); + TemplateURL* t_url = model()->Add(std::make_unique<TemplateURL>(data)); ASSERT_TRUE(model()->CanAddAutogeneratedKeyword(ASCIIToUTF16("keyword"), GURL(), NULL)); VerifyObserverCount(1); @@ -373,7 +372,7 @@ // will delete it. We have to do this after calling Add() since that gives // |t_url| its ID. std::unique_ptr<TemplateURL> cloned_url = - base::MakeUnique<TemplateURL>(t_url->data()); + std::make_unique<TemplateURL>(t_url->data()); // Reload the model to verify it was actually saved to the database. test_util()->ResetModel(true); @@ -436,7 +435,7 @@ data.SetKeyword(ASCIIToUTF16("keyword")); data.SetURL("http://test2"); data.safe_for_autoreplace = false; - TemplateURL* t_url = model()->Add(base::MakeUnique<TemplateURL>(data)); + TemplateURL* t_url = model()->Add(std::make_unique<TemplateURL>(data)); // Because the old TemplateURL was replaceable and the new one wasn't, the new // one should have replaced the old. @@ -451,7 +450,7 @@ data.SetShortName(ASCIIToUTF16("third")); data.SetURL("http://test3"); data.safe_for_autoreplace = true; - model()->Add(base::MakeUnique<TemplateURL>(data)); + model()->Add(std::make_unique<TemplateURL>(data)); VerifyObserverCount(0); EXPECT_EQ(t_url, model()->GetTemplateURLForKeyword(ASCIIToUTF16("keyword"))); EXPECT_EQ(ASCIIToUTF16("second"), t_url->short_name()); @@ -463,7 +462,7 @@ data.SetShortName(ASCIIToUTF16("fourth")); data.SetURL("http://test4"); data.safe_for_autoreplace = false; - TemplateURL* t_url2 = model()->Add(base::MakeUnique<TemplateURL>(data)); + TemplateURL* t_url2 = model()->Add(std::make_unique<TemplateURL>(data)); VerifyObserverCount(1); EXPECT_EQ(t_url2, model()->GetTemplateURLForKeyword(ASCIIToUTF16("keyword"))); EXPECT_EQ(ASCIIToUTF16("fourth"), t_url2->short_name()); @@ -535,7 +534,7 @@ data.SetKeyword(ASCIIToUTF16("keyword")); data.SetURL("http://test3"); data.safe_for_autoreplace = true; - TemplateURL* t_url = model()->Add(base::MakeUnique<TemplateURL>(data)); + TemplateURL* t_url = model()->Add(std::make_unique<TemplateURL>(data)); EXPECT_EQ(extension, model()->GetTemplateURLForKeyword(ASCIIToUTF16("keyword"))); EXPECT_EQ(t_url, model()->GetTemplateURLForHost("test3")); @@ -549,7 +548,7 @@ data.SetURL("http://test4"); data.safe_for_autoreplace = false; TemplateURL* nonreplaceable = - model()->Add(base::MakeUnique<TemplateURL>(data)); + model()->Add(std::make_unique<TemplateURL>(data)); EXPECT_EQ(extension, model()->GetTemplateURLForKeyword(ASCIIToUTF16("keyword"))); EXPECT_EQ(nonreplaceable, model()->GetTemplateURLForHost("test4")); @@ -706,7 +705,7 @@ data.date_created = Time::FromTimeT(100); data.last_modified = Time::FromTimeT(100); data.last_visited = Time::FromTimeT(100); - TemplateURL* t_url = model()->Add(base::MakeUnique<TemplateURL>(data)); + TemplateURL* t_url = model()->Add(std::make_unique<TemplateURL>(data)); VerifyObserverCount(1); base::RunLoop().RunUntilIdle(); @@ -731,7 +730,7 @@ model()->GetTemplateURLForKeyword(ASCIIToUTF16("keyword")) == NULL); std::unique_ptr<TemplateURL> cloned_url( - base::MakeUnique<TemplateURL>(t_url->data())); + std::make_unique<TemplateURL>(t_url->data())); // Reload the model from the database and make sure the change took. test_util()->ResetModel(true); @@ -761,7 +760,7 @@ base::RunLoop().RunUntilIdle(); std::unique_ptr<TemplateURL> cloned_url( - base::MakeUnique<TemplateURL>(t_url->data())); + std::make_unique<TemplateURL>(t_url->data())); // Make sure when we reload we get a default search provider. test_util()->ResetModel(true); @@ -833,13 +832,13 @@ data.date_created = Time::FromTimeT(100); data.last_modified = Time::FromTimeT(100); data.last_visited = Time::FromTimeT(100); - TemplateURL* t_url = model()->Add(base::MakeUnique<TemplateURL>(data)); + TemplateURL* t_url = model()->Add(std::make_unique<TemplateURL>(data)); const TemplateURLID id = t_url->id(); model()->SetUserSelectedDefaultSearchProvider(t_url); base::RunLoop().RunUntilIdle(); std::unique_ptr<TemplateURL> cloned_url( - base::MakeUnique<TemplateURL>(t_url->data())); + std::make_unique<TemplateURL>(t_url->data())); // Reset the model and don't load it. The template url we set as the default // should be pulled from prefs now. @@ -919,7 +918,7 @@ test_util()->VerifyLoad(); // Verify that the default manager we are getting is the managed one. - auto expected_managed_default = base::MakeUnique<TemplateURL>(*managed); + auto expected_managed_default = std::make_unique<TemplateURL>(*managed); EXPECT_TRUE(model()->is_default_search_managed()); const TemplateURL* actual_managed_default = model()->GetDefaultSearchProvider(); @@ -1045,7 +1044,7 @@ // Add user provided default search engine. TemplateURL* user_dse = model()->Add( - base::MakeUnique<TemplateURL>(*GenerateDummyTemplateURLData("user_dse"))); + std::make_unique<TemplateURL>(*GenerateDummyTemplateURLData("user_dse"))); model()->SetUserSelectedDefaultSearchProvider(user_dse); EXPECT_EQ(user_dse, model()->GetDefaultSearchProvider()); @@ -1292,7 +1291,7 @@ // Do the copy after t_url is added so that the id is set. std::unique_ptr<TemplateURL> cloned_url = - base::MakeUnique<TemplateURL>(t_url->data()); + std::make_unique<TemplateURL>(t_url->data()); ASSERT_EQ(t_url, model()->GetTemplateURLForKeyword(ASCIIToUTF16("unittest"))); // Wait for any saves to finish. @@ -1350,7 +1349,7 @@ // Do the copy after t_url is added and set as default so that its // internal state is correct. std::unique_ptr<TemplateURL> cloned_url = - base::MakeUnique<TemplateURL>(t_url->data()); + std::make_unique<TemplateURL>(t_url->data()); ASSERT_EQ(t_url, model()->GetTemplateURLForKeyword(ASCIIToUTF16("unittest"))); ASSERT_EQ(t_url, model()->GetDefaultSearchProvider()); @@ -1455,7 +1454,7 @@ EXPECT_EQ(initial_count + 2, model()->GetTemplateURLs().size()); // Verify that the default manager we are getting is the managed one. - auto expected_managed_default1 = base::MakeUnique<TemplateURL>(*managed); + auto expected_managed_default1 = std::make_unique<TemplateURL>(*managed); const TemplateURL* actual_managed_default = model()->GetDefaultSearchProvider(); ExpectSimilar(expected_managed_default1.get(), actual_managed_default); @@ -1473,7 +1472,7 @@ EXPECT_EQ(initial_count + 2, model()->GetTemplateURLs().size()); // Verify that the default manager we are now getting is the correct one. - auto expected_managed_default2 = base::MakeUnique<TemplateURL>(managed2); + auto expected_managed_default2 = std::make_unique<TemplateURL>(managed2); actual_managed_default = model()->GetDefaultSearchProvider(); ExpectSimilar(expected_managed_default2.get(), actual_managed_default); EXPECT_EQ(model()->ShowInDefaultList(actual_managed_default), true); @@ -1541,7 +1540,7 @@ data.SetKeyword(ASCIIToUTF16("keyword")); data.SetURL("http://www.google.com/foo/bar"); data.sync_guid.clear(); - model()->Add(base::MakeUnique<TemplateURL>(data)); + model()->Add(std::make_unique<TemplateURL>(data)); VerifyObserverCount(1); base::RunLoop().RunUntilIdle(); @@ -1577,7 +1576,7 @@ data.input_encodings.push_back("UTF-16"); data.input_encodings.push_back("Big5"); data.input_encodings.push_back("Windows-1252"); - model()->Add(base::MakeUnique<TemplateURL>(data)); + model()->Add(std::make_unique<TemplateURL>(data)); VerifyObserverCount(1); base::RunLoop().RunUntilIdle(); @@ -1630,7 +1629,7 @@ TemplateURL* ext_dse_ptr = AddExtensionSearchEngine("extension2_keyword", "extension2_id", true); EXPECT_EQ(ext_dse_ptr, model()->GetDefaultSearchProvider()); - auto cloned_ext_dse = base::MakeUnique<TemplateURL>(ext_dse_ptr->data()); + auto cloned_ext_dse = std::make_unique<TemplateURL>(ext_dse_ptr->data()); // A default search engine set by an extension must be persisted across // browser restarts, until the extension is unloaded/disabled. @@ -1650,7 +1649,7 @@ // the service has loaded. const TemplateURL* ext_dse = AddExtensionSearchEngine("extension1_keyword", "extension1_id", true); - auto cloned_ext_dse = base::MakeUnique<TemplateURL>(ext_dse->data()); + auto cloned_ext_dse = std::make_unique<TemplateURL>(ext_dse->data()); // Default search engine from extension must be persisted between browser // restarts, and should be available before the TemplateURLService is loaded. @@ -1675,7 +1674,7 @@ // Add non replaceable user engine. const TemplateURL* user1 = - model()->Add(base::MakeUnique<TemplateURL>(*turl_data)); + model()->Add(std::make_unique<TemplateURL>(*turl_data)); // Add default extension engine with same keyword as user engine. const TemplateURL* extension = AddExtensionSearchEngine( @@ -1683,7 +1682,7 @@ // Add another non replaceable user engine with same keyword as extension. const TemplateURL* user2 = - model()->Add(base::MakeUnique<TemplateURL>(*turl_data)); + model()->Add(std::make_unique<TemplateURL>(*turl_data)); // Check extension DSE is set as default and its keyword is not changed. const TemplateURL* current_dse = model()->GetDefaultSearchProvider(); @@ -1907,7 +1906,7 @@ SetManagedDefaultSearchPreferences(*managed, true, test_util()->profile()); test_util()->VerifyLoad(); // Verify that the default manager we are getting is the managed one. - auto expected_managed_default = base::MakeUnique<TemplateURL>(*managed); + auto expected_managed_default = std::make_unique<TemplateURL>(*managed); EXPECT_TRUE(model()->is_default_search_managed()); const TemplateURL* actual_managed_default = model()->GetDefaultSearchProvider(); @@ -1945,7 +1944,7 @@ data.SetKeyword(ASCIIToUTF16("engine_keyword")); data.SetURL("http://test_engine"); data.safe_for_autoreplace = true; - TemplateURL* original_url = model()->Add(base::MakeUnique<TemplateURL>(data)); + TemplateURL* original_url = model()->Add(std::make_unique<TemplateURL>(data)); const Time original_last_modified = original_url->last_modified(); model()->ResetTemplateURL(original_url, ASCIIToUTF16("test_engine2"), ASCIIToUTF16("engine_keyword"), @@ -1965,10 +1964,10 @@ // emitted when TemplateURLService is not yet loaded. TEST_F(TemplateURLServiceTest, ChangeDefaultEngineBeforeLoad) { TemplateURL* search_engine1 = model()->Add( - base::MakeUnique<TemplateURL>(*GenerateDummyTemplateURLData("keyword1"))); + std::make_unique<TemplateURL>(*GenerateDummyTemplateURLData("keyword1"))); DCHECK(search_engine1); TemplateURL* search_engine2 = model()->Add( - base::MakeUnique<TemplateURL>(*GenerateDummyTemplateURLData("keyword2"))); + std::make_unique<TemplateURL>(*GenerateDummyTemplateURLData("keyword2"))); DCHECK(search_engine2); base::HistogramTester histogram_tester;
diff --git a/chrome/browser/ssl/cert_verifier_browser_test.h b/chrome/browser/ssl/cert_verifier_browser_test.h index 2edb7ea2..7ac9040e 100644 --- a/chrome/browser/ssl/cert_verifier_browser_test.h +++ b/chrome/browser/ssl/cert_verifier_browser_test.h
@@ -8,8 +8,8 @@ #include <memory> #include "chrome/test/base/in_process_browser_test.h" -#include "content/public/common/network_service_test.mojom.h" #include "net/cert/mock_cert_verifier.h" +#include "services/network/public/interfaces/network_service_test.mojom.h" namespace net { class MockCertVerifier; @@ -53,7 +53,7 @@ void EnsureNetworkServiceTestInitialized(); net::MockCertVerifier* verifier_; - content::mojom::NetworkServiceTestPtr network_service_test_; + network::mojom::NetworkServiceTestPtr network_service_test_; }; // Returns a pointer to the MockCertVerifier used by all profiles in
diff --git a/chrome/browser/ui/app_list/app_context_menu_unittest.cc b/chrome/browser/ui/app_list/app_context_menu_unittest.cc index ba2a5bd1..93035717 100644 --- a/chrome/browser/ui/app_list/app_context_menu_unittest.cc +++ b/chrome/browser/ui/app_list/app_context_menu_unittest.cc
@@ -338,7 +338,7 @@ arc_test.app_instance()->RefreshAppList(); arc_test.app_instance()->SendRefreshAppList(arc_test.fake_apps()); - ArcAppItem item(profile(), nullptr, app_id, std::string()); + ArcAppItem item(profile(), nullptr, nullptr, app_id, std::string()); ui::MenuModel* menu = item.GetContextMenuModel(); ASSERT_NE(nullptr, menu); @@ -413,7 +413,7 @@ arc_test.app_instance()->SendInstallShortcuts(arc_test.fake_shortcuts()); - ArcAppItem item(profile(), nullptr, app_id, std::string()); + ArcAppItem item(profile(), nullptr, nullptr, app_id, std::string()); ui::MenuModel* menu = item.GetContextMenuModel(); ASSERT_NE(nullptr, menu); @@ -457,7 +457,7 @@ const std::string store_id = ArcAppTest::GetAppId(store_info); controller()->SetAppPinnable(store_id, AppListControllerDelegate::PIN_EDITABLE); - ArcAppItem item(profile(), nullptr, store_id, std::string()); + ArcAppItem item(profile(), nullptr, nullptr, store_id, std::string()); ui::MenuModel* menu = item.GetContextMenuModel(); ASSERT_NE(nullptr, menu);
diff --git a/chrome/browser/ui/app_list/arc/arc_app_item.cc b/chrome/browser/ui/app_list/arc/arc_app_item.cc index 4a234d9..8c4e0bc 100644 --- a/chrome/browser/ui/app_list/arc/arc_app_item.cc +++ b/chrome/browser/ui/app_list/arc/arc_app_item.cc
@@ -19,6 +19,7 @@ ArcAppItem::ArcAppItem( Profile* profile, + AppListModelUpdater* model_updater, const app_list::AppListSyncableService::SyncItem* sync_item, const std::string& id, const std::string& name) @@ -36,6 +37,9 @@ UpdateFromSync(sync_item); else SetDefaultPositionIfApplicable(); + + // Set model updater last to avoid being called during construction. + set_model_updater(model_updater); } ArcAppItem::~ArcAppItem() {
diff --git a/chrome/browser/ui/app_list/arc/arc_app_item.h b/chrome/browser/ui/app_list/arc/arc_app_item.h index 4c8b2de..0b384ddc7 100644 --- a/chrome/browser/ui/app_list/arc/arc_app_item.h +++ b/chrome/browser/ui/app_list/arc/arc_app_item.h
@@ -24,6 +24,7 @@ static const char kItemType[]; ArcAppItem(Profile* profile, + AppListModelUpdater* model_updater, const app_list::AppListSyncableService::SyncItem* sync_item, const std::string& id, const std::string& name);
diff --git a/chrome/browser/ui/app_list/arc/arc_app_model_builder.cc b/chrome/browser/ui/app_list/arc/arc_app_model_builder.cc index b9c49b2..74031ad 100644 --- a/chrome/browser/ui/app_list/arc/arc_app_model_builder.cc +++ b/chrome/browser/ui/app_list/arc/arc_app_model_builder.cc
@@ -42,8 +42,8 @@ std::unique_ptr<ArcAppItem> ArcAppModelBuilder::CreateApp( const std::string& app_id, const ArcAppListPrefs::AppInfo& app_info) { - return std::make_unique<ArcAppItem>(profile(), GetSyncItem(app_id), app_id, - app_info.name); + return std::make_unique<ArcAppItem>( + profile(), model_updater(), GetSyncItem(app_id), app_id, app_info.name); } void ArcAppModelBuilder::OnAppRegistered(
diff --git a/chrome/browser/ui/app_list/chrome_app_list_item.cc b/chrome/browser/ui/app_list/chrome_app_list_item.cc index 602c3a9..7e5fe92 100644 --- a/chrome/browser/ui/app_list/chrome_app_list_item.cc +++ b/chrome/browser/ui/app_list/chrome_app_list_item.cc
@@ -32,9 +32,7 @@ ChromeAppListItem::ChromeAppListItem(Profile* profile, const std::string& app_id) - : app_list::AppListItem(app_id), - profile_(profile) { -} + : app_list::AppListItem(app_id), profile_(profile) {} ChromeAppListItem::~ChromeAppListItem() { }
diff --git a/chrome/browser/ui/app_list/chrome_app_list_item.h b/chrome/browser/ui/app_list/chrome_app_list_item.h index 3bd79e0..a0b41d4 100644 --- a/chrome/browser/ui/app_list/chrome_app_list_item.h +++ b/chrome/browser/ui/app_list/chrome_app_list_item.h
@@ -11,6 +11,7 @@ #include "ash/app_list/model/app_list_item.h" #include "base/macros.h" +#include "chrome/browser/ui/app_list/app_list_model_updater.h" #include "chrome/browser/ui/app_list/app_list_syncable_service.h" class AppListControllerDelegate; @@ -84,6 +85,11 @@ AppListControllerDelegate* GetController(); + AppListModelUpdater* model_updater() { return model_updater_; } + void set_model_updater(AppListModelUpdater* model_updater) { + model_updater_ = model_updater; + } + // Updates item position and name from |sync_item|. |sync_item| must be valid. void UpdateFromSync( const app_list::AppListSyncableService::SyncItem* sync_item); @@ -93,6 +99,7 @@ private: Profile* profile_; + AppListModelUpdater* model_updater_ = nullptr; DISALLOW_COPY_AND_ASSIGN(ChromeAppListItem); };
diff --git a/chrome/browser/ui/app_list/extension_app_item.cc b/chrome/browser/ui/app_list/extension_app_item.cc index 35e35e84..f64c2bd 100644 --- a/chrome/browser/ui/app_list/extension_app_item.cc +++ b/chrome/browser/ui/app_list/extension_app_item.cc
@@ -40,6 +40,7 @@ ExtensionAppItem::ExtensionAppItem( Profile* profile, + AppListModelUpdater* model_updater, const app_list::AppListSyncableService::SyncItem* sync_item, const std::string& extension_id, const std::string& extension_name, @@ -55,6 +56,9 @@ UpdateFromSync(sync_item); else SetDefaultPositionIfApplicable(); + + // Set model updater last to avoid being called during construction. + set_model_updater(model_updater); } ExtensionAppItem::~ExtensionAppItem() {
diff --git a/chrome/browser/ui/app_list/extension_app_item.h b/chrome/browser/ui/app_list/extension_app_item.h index a29ca2b..9ac957d 100644 --- a/chrome/browser/ui/app_list/extension_app_item.h +++ b/chrome/browser/ui/app_list/extension_app_item.h
@@ -38,6 +38,7 @@ static const char kItemType[]; ExtensionAppItem(Profile* profile, + AppListModelUpdater* model_updater, const app_list::AppListSyncableService::SyncItem* sync_item, const std::string& extension_id, const std::string& extension_name,
diff --git a/chrome/browser/ui/app_list/extension_app_model_builder.cc b/chrome/browser/ui/app_list/extension_app_model_builder.cc index b965230..8840f6f 100644 --- a/chrome/browser/ui/app_list/extension_app_model_builder.cc +++ b/chrome/browser/ui/app_list/extension_app_model_builder.cc
@@ -176,8 +176,8 @@ const gfx::ImageSkia& installing_icon, bool is_platform_app) { return std::make_unique<ExtensionAppItem>( - profile(), GetSyncItem(extension_id), extension_id, extension_name, - installing_icon, is_platform_app); + profile(), model_updater(), GetSyncItem(extension_id), extension_id, + extension_name, installing_icon, is_platform_app); } void ExtensionAppModelBuilder::BuildModel() {
diff --git a/chrome/browser/ui/cocoa/browser_window_controller.mm b/chrome/browser/ui/cocoa/browser_window_controller.mm index 031a335..c65db3c 100644 --- a/chrome/browser/ui/cocoa/browser_window_controller.mm +++ b/chrome/browser/ui/cocoa/browser_window_controller.mm
@@ -748,9 +748,10 @@ WebContents* contents = browser_->tab_strip_model()->GetActiveWebContents(); if (contents) { - CGFloat intrinsicWidth = - static_cast<CGFloat>(contents->GetPreferredSize().width()); // If the intrinsic width is bigger, then make it the zoomed width. + const int kScrollbarWidth = 16; // TODO(viettrungluu): ugh. + CGFloat intrinsicWidth = static_cast<CGFloat>( + contents->GetPreferredSize().width() + kScrollbarWidth); zoomedWidth = std::max(zoomedWidth, std::min(intrinsicWidth, NSWidth(frame))); }
diff --git a/chrome/browser/ui/views/frame/browser_desktop_window_tree_host_x11.cc b/chrome/browser/ui/views/frame/browser_desktop_window_tree_host_x11.cc index 1c7b345..befdc056 100644 --- a/chrome/browser/ui/views/frame/browser_desktop_window_tree_host_x11.cc +++ b/chrome/browser/ui/views/frame/browser_desktop_window_tree_host_x11.cc
@@ -71,6 +71,10 @@ browser_view_->frame()->GetFrameView()->OnMaximizedStateChanged(); } +void BrowserDesktopWindowTreeHostX11::OnFullscreenStateChanged() { + browser_view_->frame()->GetFrameView()->OnFullscreenStateChanged(); +} + //////////////////////////////////////////////////////////////////////////////// // BrowserDesktopWindowTreeHost, public:
diff --git a/chrome/browser/ui/views/frame/browser_desktop_window_tree_host_x11.h b/chrome/browser/ui/views/frame/browser_desktop_window_tree_host_x11.h index a26f2e9b..2f60b1cc 100644 --- a/chrome/browser/ui/views/frame/browser_desktop_window_tree_host_x11.h +++ b/chrome/browser/ui/views/frame/browser_desktop_window_tree_host_x11.h
@@ -39,6 +39,7 @@ const views::Widget::InitParams& params) override; void CloseNow() override; void OnMaximizedStateChanged() override; + void OnFullscreenStateChanged() override; BrowserView* browser_view_;
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view.cc b/chrome/browser/ui/views/frame/browser_non_client_frame_view.cc index e10ced4..59d28f3 100644 --- a/chrome/browser/ui/views/frame/browser_non_client_frame_view.cc +++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view.cc
@@ -58,6 +58,8 @@ void BrowserNonClientFrameView::OnMaximizedStateChanged() {} +void BrowserNonClientFrameView::OnFullscreenStateChanged() {} + gfx::ImageSkia BrowserNonClientFrameView::GetIncognitoAvatarIcon() const { const SkColor icon_color = color_utils::PickContrastingColor( SK_ColorWHITE, gfx::kChromeIconGrey, GetFrameColor());
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view.h b/chrome/browser/ui/views/frame/browser_non_client_frame_view.h index a85e461..613069f 100644 --- a/chrome/browser/ui/views/frame/browser_non_client_frame_view.h +++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view.h
@@ -32,6 +32,10 @@ // Called on Linux X11 after the browser window is maximized or restored. virtual void OnMaximizedStateChanged(); + // Called on Linux X11 after the browser window is fullscreened or + // unfullscreened. + virtual void OnFullscreenStateChanged(); + // Retrieves the bounds, in non-client view coordinates within which the // TabStrip should be laid out. virtual gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const = 0;
diff --git a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc index c35baec..d5d0c13 100644 --- a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc +++ b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
@@ -142,6 +142,11 @@ MaybeRedrawFrameButtons(); } +void OpaqueBrowserFrameView::OnFullscreenStateChanged() { + // The top area height is 0 when the window is fullscreened. + MaybeRedrawFrameButtons(); +} + gfx::Rect OpaqueBrowserFrameView::GetBoundsForTabStrip( views::View* tabstrip) const { if (!tabstrip)
diff --git a/chrome/browser/ui/views/frame/opaque_browser_frame_view.h b/chrome/browser/ui/views/frame/opaque_browser_frame_view.h index 24eec1f2..8bdaf0f7 100644 --- a/chrome/browser/ui/views/frame/opaque_browser_frame_view.h +++ b/chrome/browser/ui/views/frame/opaque_browser_frame_view.h
@@ -49,6 +49,7 @@ // BrowserNonClientFrameView: void OnBrowserViewInitViewsComplete() override; void OnMaximizedStateChanged() override; + void OnFullscreenStateChanged() override; gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const override; int GetTopInset(bool restored) const override; int GetThemeBackgroundXInset() const override;
diff --git a/chrome/browser/ui/views/profiles/profile_chooser_view.cc b/chrome/browser/ui/views/profiles/profile_chooser_view.cc index 25facbb..b295a550a 100644 --- a/chrome/browser/ui/views/profiles/profile_chooser_view.cc +++ b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
@@ -212,7 +212,7 @@ for (const std::string& account_id : account_ids) { AccountInfo account_info = account_tracker_service->GetAccountInfo(account_id); - if (account_id == cookie_accounts[0].id) + if (account_id == gaia_default_account_id) accounts.insert(accounts.begin(), account_info); else accounts.push_back(account_info);
diff --git a/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc b/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc index 01dc4b1..d4a395d 100644 --- a/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc +++ b/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc
@@ -80,6 +80,16 @@ int id; }; +#if defined(OS_CHROMEOS) +// Generates a Google Help URL which includes a "board type" parameter. Some +// help pages need to be adjusted depending on the type of CrOS device that is +// accessing the page. +base::string16 GetHelpUrlWithBoard(const std::string& original_url) { + return base::ASCIIToUTF16(original_url + + "&b=" + base::SysInfo::GetLsbReleaseBoard()); +} +#endif + void AddLocalizedStringsBulk(content::WebUIDataSource* html_source, LocalizedString localized_strings[], size_t num_strings) { @@ -221,8 +231,9 @@ arraysize(localized_strings)); #if defined(OS_CHROMEOS) - html_source->AddString("a11yLearnMoreUrl", - chrome::kChromeAccessibilityHelpURL); + html_source->AddString( + "a11yLearnMoreUrl", + GetHelpUrlWithBoard(chrome::kChromeAccessibilityHelpURL)); html_source->AddBoolean( "showExperimentalA11yFeatures", @@ -346,7 +357,7 @@ "androidAppsSubtext", l10n_util::GetStringFUTF16( IDS_SETTINGS_ANDROID_APPS_SUBTEXT, - base::ASCIIToUTF16(chrome::kAndroidAppsLearnMoreURL))); + GetHelpUrlWithBoard(chrome::kAndroidAppsLearnMoreURL))); } #endif @@ -728,7 +739,7 @@ AddLocalizedStringsBulk(html_source, power_strings, arraysize(power_strings)); html_source->AddString("naturalScrollLearnMoreLink", - base::ASCIIToUTF16(chrome::kNaturalScrollHelpURL)); + GetHelpUrlWithBoard(chrome::kNaturalScrollHelpURL)); } #endif @@ -990,7 +1001,7 @@ IDS_SETTINGS_EASY_UNLOCK_PROXIMITY_THRESHOLD_LABEL, device_name)); html_source->AddString("easyUnlockLearnMoreURL", - chrome::kEasyUnlockLearnMoreUrl); + GetHelpUrlWithBoard(chrome::kEasyUnlockLearnMoreUrl)); } void AddInternetStrings(content::WebUIDataSource* html_source) { @@ -1111,13 +1122,11 @@ chromeos::switches::IsNetworkSettingsConfigEnabled()); html_source->AddString("networkGoogleNameserversLearnMoreUrl", chrome::kGoogleNameserversLearnMoreURL); - - std::string tether_learn_more_url(chrome::kInstantTetheringLearnMoreURL); - tether_learn_more_url += "&b=" + base::SysInfo::GetLsbReleaseBoard(); html_source->AddString( "internetNoNetworksMobileData", - l10n_util::GetStringFUTF16(IDS_SETTINGS_INTERNET_NO_NETWORKS_MOBILE_DATA, - base::ASCIIToUTF16(tether_learn_more_url))); + l10n_util::GetStringFUTF16( + IDS_SETTINGS_INTERNET_NO_NETWORKS_MOBILE_DATA, + GetHelpUrlWithBoard(chrome::kInstantTetheringLearnMoreURL))); } #endif @@ -1484,7 +1493,12 @@ } html_source->AddString("syncLearnMoreUrl", chrome::kSyncLearnMoreURL); - html_source->AddString("autofillHelpURL", autofill::kHelpURL); + html_source->AddString("autofillHelpURL", +#if defined(OS_CHROMEOS) + GetHelpUrlWithBoard(autofill::kHelpURL)); +#else + autofill::kHelpURL); +#endif html_source->AddString("supervisedUsersUrl", chrome::kLegacySupervisedUserManagementURL); @@ -1492,7 +1506,11 @@ "encryptWithSyncPassphraseLabel", l10n_util::GetStringFUTF8( IDS_SETTINGS_ENCRYPT_WITH_SYNC_PASSPHRASE_LABEL, +#if defined(OS_CHROMEOS) + GetHelpUrlWithBoard(chrome::kSyncEncryptionHelpURL))); +#else base::ASCIIToUTF16(chrome::kSyncEncryptionHelpURL))); +#endif std::string sync_dashboard_url = google_util::AppendGoogleLocaleParam( @@ -1632,7 +1650,7 @@ #if defined(OS_CHROMEOS) html_source->AddString("printingCUPSPrintLearnMoreUrl", - chrome::kCupsPrintLearnMoreURL); + GetHelpUrlWithBoard(chrome::kCupsPrintLearnMoreURL)); #endif } @@ -1685,15 +1703,24 @@ *profile->GetPrefs(), IDS_SETTINGS_SAFEBROWSING_ENABLE_EXTENDED_REPORTING, IDS_SETTINGS_SAFEBROWSING_ENABLE_SCOUT_REPORTING)); - html_source->AddString("improveBrowsingExperience", - l10n_util::GetStringFUTF16( - IDS_SETTINGS_IMPROVE_BROWSING_EXPERIENCE, - base::ASCIIToUTF16(chrome::kPrivacyLearnMoreURL))); + html_source->AddString( + "improveBrowsingExperience", + l10n_util::GetStringFUTF16( + IDS_SETTINGS_IMPROVE_BROWSING_EXPERIENCE, +#if defined(OS_CHROMEOS) + GetHelpUrlWithBoard(chrome::kPrivacyLearnMoreURL))); +#else + base::ASCIIToUTF16(chrome::kPrivacyLearnMoreURL))); +#endif html_source->AddString( "doNotTrackDialogMessage", l10n_util::GetStringFUTF16( IDS_SETTINGS_ENABLE_DO_NOT_TRACK_DIALOG_TEXT, +#if defined(OS_CHROMEOS) + GetHelpUrlWithBoard(chrome::kDoNotTrackLearnMoreURL))); +#else base::ASCIIToUTF16(chrome::kDoNotTrackLearnMoreURL))); +#endif html_source->AddString( "exceptionsLearnMoreURL", base::ASCIIToUTF16(chrome::kContentSettingsExceptionsLearnMoreURL));
diff --git a/chrome/browser/usb/usb_chooser_controller.cc b/chrome/browser/usb/usb_chooser_controller.cc index fc72e8f7..4b103044 100644 --- a/chrome/browser/usb/usb_chooser_controller.cc +++ b/chrome/browser/usb/usb_chooser_controller.cc
@@ -10,9 +10,7 @@ #include "base/bind.h" #include "chrome/browser/net/referrer.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/ui/browser.h" -#include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" #include "chrome/browser/usb/usb_blocklist.h" #include "chrome/browser/usb/usb_chooser_context.h" #include "chrome/browser/usb/usb_chooser_context_factory.h" @@ -35,17 +33,6 @@ using content::WebContents; using device::UsbDevice; -namespace { - -Browser* GetBrowser() { - chrome::ScopedTabbedBrowserDisplayer browser_displayer( - ProfileManager::GetLastUsedProfileAllowedByPolicy()); - DCHECK(browser_displayer.browser()); - return browser_displayer.browser(); -} - -} // namespace - UsbChooserController::UsbChooserController( RenderFrameHost* render_frame_host, std::vector<device::mojom::UsbDeviceFilterPtr> device_filters,
diff --git a/chrome/browser/usb/usb_util.cc b/chrome/browser/usb/usb_util.cc index d5fd9a3..9a803b9 100644 --- a/chrome/browser/usb/usb_util.cc +++ b/chrome/browser/usb/usb_util.cc
@@ -7,6 +7,8 @@ #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "build/build_config.h" +#include "chrome/browser/profiles/profile_manager.h" +#include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" #include "chrome/grit/generated_resources.h" #include "device/usb/usb_device.h" #include "ui/base/l10n/l10n_util.h" @@ -39,3 +41,14 @@ return device_name; } + +Browser* GetBrowser() { +#if defined(OS_ANDROID) + return nullptr; +#else + chrome::ScopedTabbedBrowserDisplayer browser_displayer( + ProfileManager::GetLastUsedProfileAllowedByPolicy()); + DCHECK(browser_displayer.browser()); + return browser_displayer.browser(); +#endif // !defined(OS_ANDROID) +}
diff --git a/chrome/browser/usb/usb_util.h b/chrome/browser/usb/usb_util.h index e9911f7..3402327 100644 --- a/chrome/browser/usb/usb_util.h +++ b/chrome/browser/usb/usb_util.h
@@ -8,10 +8,14 @@ #include "base/memory/ref_counted.h" #include "base/strings/string16.h" +class Browser; + namespace device { class UsbDevice; } base::string16 FormatUsbDeviceName(scoped_refptr<device::UsbDevice> device); +Browser* GetBrowser(); + #endif // CHROME_BROWSER_USB_USB_UTIL_H_
diff --git a/chrome/browser/usb/web_usb_detector.cc b/chrome/browser/usb/web_usb_detector.cc index d6438220..16cc012 100644 --- a/chrome/browser/usb/web_usb_detector.cc +++ b/chrome/browser/usb/web_usb_detector.cc
@@ -16,9 +16,9 @@ #include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/browser_tab_strip_tracker.h" #include "chrome/browser/ui/browser_window.h" -#include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" #include "chrome/browser/ui/tab_contents/tab_contents_iterator.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" +#include "chrome/browser/usb/usb_util.h" #include "chrome/grit/generated_resources.h" #include "components/url_formatter/elide_url.h" #include "components/vector_icons/vector_icons.h" @@ -67,13 +67,6 @@ WEBUSB_NOTIFICATION_CLOSED_MAX); } -Browser* GetBrowser() { - chrome::ScopedTabbedBrowserDisplayer browser_displayer( - ProfileManager::GetLastUsedProfileAllowedByPolicy()); - DCHECK(browser_displayer.browser()); - return browser_displayer.browser(); -} - GURL GetActiveTabURL() { Browser* browser = chrome::FindLastActiveWithProfile( ProfileManager::GetLastUsedProfileAllowedByPolicy());
diff --git a/chrome/common/extensions/docs/examples/extensions/mappy/manifest.json b/chrome/common/extensions/docs/examples/extensions/mappy/manifest.json index 45deeddd3..c0e8462 100644 --- a/chrome/common/extensions/docs/examples/extensions/mappy/manifest.json +++ b/chrome/common/extensions/docs/examples/extensions/mappy/manifest.json
@@ -18,5 +18,5 @@ "default_popup": "popup.html" }, "manifest_version": 2, - "content_security_policy": "default-src 'none'; style-src 'self'; script-src 'self'; connect-src https://maps.googleapis.com; img-src https://maps.google.com" + "content_security_policy": "default-src 'none'; style-src 'self'; script-src 'self'; connect-src https://maps.googleapis.com; img-src https://maps.googleapis.com" }
diff --git a/chrome/common/extensions/docs/examples/extensions/mappy/mappy_content_script.js b/chrome/common/extensions/docs/examples/extensions/mappy/mappy_content_script.js index 2393a0f..990a27f 100644 --- a/chrome/common/extensions/docs/examples/extensions/mappy/mappy_content_script.js +++ b/chrome/common/extensions/docs/examples/extensions/mappy/mappy_content_script.js
@@ -49,4 +49,3 @@ } return null; } -
diff --git a/chrome/common/extensions/docs/examples/extensions/mappy/popup.js b/chrome/common/extensions/docs/examples/extensions/mappy/popup.js index 45663c3..10b4e74 100644 --- a/chrome/common/extensions/docs/examples/extensions/mappy/popup.js +++ b/chrome/common/extensions/docs/examples/extensions/mappy/popup.js
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -var maps_key = "ABQIAAAATfHumDbW3OmRByfquHd3SRTRERdeAiwZ9EeJWta3L_JZVS0bOBRQeZgr4K0xyVKzUdnnuFl8X9PX0w"; +var maps_key = "AIzaSyBa5aieunaIp3Obco-dNVYMdbnTZGAVkKQ"; function gclient_geocode(address) { var url = 'https://maps.googleapis.com/maps/api/geocode/json?address=' + @@ -18,12 +18,10 @@ var json = JSON.parse(request.responseText); var latlng = json.results[0].geometry.location; latlng = latlng.lat + ',' + latlng.lng; - - var src = "https://maps.google.com/staticmap?center=" + latlng + - "&markers=" + latlng + "&zoom=14" + - "&size=512x512&sensor=false&key=" + maps_key; - var map = document.getElementById("map"); - + var src = 'https://maps.googleapis.com/maps/api/staticmap?center=' + + latlng + '&markers=' + latlng + '&zoom=14' + + '&size=512x512&sensor=false&key=' + maps_key; + var map = document.getElementById('map'); map.src = src; map.addEventListener('click', function () { window.close();
diff --git a/chrome/common/extensions/docs/templates/articles/about_apps.html b/chrome/common/extensions/docs/templates/articles/about_apps.html index 066e617..fbf9a49 100644 --- a/chrome/common/extensions/docs/templates/articles/about_apps.html +++ b/chrome/common/extensions/docs/templates/articles/about_apps.html
@@ -1,6 +1,5 @@ <meta name="doc-family" content="apps"> <h1 id="what">What Are Chrome Apps?</h1> - <p>Chrome Apps let you use HTML5, CSS, and JavaScript to deliver an experience comparable to a native application.</p>
diff --git a/chrome/common/extensions/docs/templates/articles/extensions_index.html b/chrome/common/extensions/docs/templates/articles/extensions_index.html index 6aab824..57d546a 100644 --- a/chrome/common/extensions/docs/templates/articles/extensions_index.html +++ b/chrome/common/extensions/docs/templates/articles/extensions_index.html
@@ -53,7 +53,7 @@ <h2 id="hello-extensions">Hello Extensions</h2> <p> Take a small step into extensions with this quick Hello Extensions example. -You can create a new directory to store files or download them +Create a new directory to store files or download them <a href="examples/tutorials/" download="hello_extensions.zip"> here. </a> @@ -75,8 +75,8 @@ Every extension requires a manifest, though most extensions will not do much with just the manifest. For this quick start, -the extension has a popup file and icon declared under the browser action: -<a href="browserAction"><code>browser_action</code></a>. +the extension has a popup file and icon declared under the +<a href="browserAction"><code>browser_action</code></a> field: </p> <pre data-filename="manifest.json"> { @@ -107,7 +107,7 @@ <p> The extension now displays <code>hello.html</code> when the icon is clicked. The next step is to include a command - in the manifest.json that enables a keyboard shortcut. + in the <code>manifest.json</code> that enables a keyboard shortcut. This step is fun, but not necessary: </p> <pre data-filename="manifest.json">
diff --git a/chrome/common/extensions/docs/templates/intros/pageAction.html b/chrome/common/extensions/docs/templates/intros/pageAction.html index 46c14d8..0751f0bb 100644 --- a/chrome/common/extensions/docs/templates/intros/pageAction.html +++ b/chrome/common/extensions/docs/templates/intros/pageAction.html
@@ -56,17 +56,13 @@ }</pre> <p> -You can provide any size icon to be used in Chrome, and Chrome will select the -closest one and scale it to the appropriate size to fill the 16-dip space. -However, if the exact size isn't provided, this scaling can cause the icon to -lose detail or look fuzzy. -</p> - -<p> -Since devices with less-common scale factors like 1.5x or 1.2x are becoming more -common, you are encouraged to provide multiple sizes for your icons. This also -ensures that if the icon display size is ever changed, you don't need to do any -more work to provide different icons! +Since devices with less-common scale factors like 1.5x or 1.2x are becoming more common, +you are encouraged to provide multiple sizes for your icons. +Chrome will select the closest one and scale it to fill the 16-dip space. +This also ensures that if the icon display size is ever changed, +you don't need to do any more work to provide different icons! +However, if the size difference is too extreme, +this scaling can cause the icon to lose detail or look fuzzy. </p> <p>
diff --git a/chrome/renderer/autofill/autofill_renderer_browsertest.cc b/chrome/renderer/autofill/autofill_renderer_browsertest.cc index 98926f17..568a15c 100644 --- a/chrome/renderer/autofill/autofill_renderer_browsertest.cc +++ b/chrome/renderer/autofill/autofill_renderer_browsertest.cc
@@ -76,10 +76,10 @@ forms_.reset(new std::vector<FormData>(forms)); } - void WillSubmitForm(const FormData& form, - base::TimeTicks timestamp) override {} - - void FormSubmitted(const FormData& form) override {} + void FormSubmitted(const FormData& form, + bool known_success, + SubmissionSource source, + base::TimeTicks timestamp) override {} void TextFieldDidChange(const FormData& form, const FormFieldData& field,
diff --git a/chrome/renderer/autofill/form_autocomplete_browsertest.cc b/chrome/renderer/autofill/form_autocomplete_browsertest.cc index 6ce4f32..c37a21cc 100644 --- a/chrome/renderer/autofill/form_autocomplete_browsertest.cc +++ b/chrome/renderer/autofill/form_autocomplete_browsertest.cc
@@ -43,22 +43,24 @@ bool did_unfocus_form() const { return did_unfocus_form_; } - const FormData* form_will_submit() const { return form_will_submit_.get(); } - const FormData* form_submitted() const { return form_submitted_.get(); } + bool known_success() const { return known_success_; } + + SubmissionSource submission_source() const { return submission_source_; } + private: // mojom::AutofillDriver: void FormsSeen(const std::vector<FormData>& forms, base::TimeTicks timestamp) override {} - void WillSubmitForm(const FormData& form, - base::TimeTicks timestamp) override { - form_will_submit_.reset(new FormData(form)); - } - - void FormSubmitted(const FormData& form) override { + void FormSubmitted(const FormData& form, + bool known_success, + SubmissionSource source, + base::TimeTicks timestamp) override { form_submitted_.reset(new FormData(form)); + known_success_ = known_success; + submission_source_ = source; } void TextFieldDidChange(const FormData& form, @@ -95,11 +97,14 @@ // Records whether FocusNoLongerOnForm() get called. bool did_unfocus_form_; - // Records the form data received via WillSubmitForm() call. - std::unique_ptr<FormData> form_will_submit_; + // Records the form data received via FormSubmitted() call. std::unique_ptr<FormData> form_submitted_; + bool known_success_; + + SubmissionSource submission_source_; + mojo::BindingSet<mojom::AutofillDriver> bindings_; }; @@ -110,28 +115,36 @@ const FakeContentAutofillDriver& fake_driver, const std::string& fname, const std::string& lname, - bool expect_submitted_message) { - ASSERT_TRUE(fake_driver.form_will_submit()); - ASSERT_EQ(expect_submitted_message, fake_driver.form_submitted() != nullptr); + bool expect_known_success, + SubmissionSource expect_submission_source) { + ASSERT_TRUE(fake_driver.form_submitted()); // The tuple also includes a timestamp, which is ignored. - const FormData& will_submit_form = *(fake_driver.form_will_submit()); - ASSERT_LE(2U, will_submit_form.fields.size()); + const FormData& submitted_form = *(fake_driver.form_submitted()); + ASSERT_LE(2U, submitted_form.fields.size()); + EXPECT_EQ(base::ASCIIToUTF16("fname"), submitted_form.fields[0].name); + EXPECT_EQ(base::UTF8ToUTF16(fname), submitted_form.fields[0].value); + EXPECT_EQ(base::ASCIIToUTF16("lname"), submitted_form.fields[1].name); + EXPECT_EQ(expect_known_success, fake_driver.known_success()); + EXPECT_EQ(expect_submission_source, + mojo::ConvertTo<SubmissionSource>(fake_driver.submission_source())); +} - EXPECT_EQ(base::ASCIIToUTF16("fname"), will_submit_form.fields[0].name); - EXPECT_EQ(base::UTF8ToUTF16(fname), will_submit_form.fields[0].value); - EXPECT_EQ(base::ASCIIToUTF16("lname"), will_submit_form.fields[1].name); - EXPECT_EQ(base::UTF8ToUTF16(lname), will_submit_form.fields[1].value); +void VerifyReceivedAddressRendererMessages( + const FakeContentAutofillDriver& fake_driver, + const std::string& address, + bool expect_known_success, + SubmissionSource expect_submission_source) { + ASSERT_TRUE(fake_driver.form_submitted()); - if (expect_submitted_message) { - const FormData& submitted_form = *(fake_driver.form_submitted()); - ASSERT_LE(2U, submitted_form.fields.size()); - - EXPECT_EQ(base::ASCIIToUTF16("fname"), submitted_form.fields[0].name); - EXPECT_EQ(base::UTF8ToUTF16(fname), submitted_form.fields[0].value); - EXPECT_EQ(base::ASCIIToUTF16("lname"), submitted_form.fields[1].name); - EXPECT_EQ(base::UTF8ToUTF16(lname), submitted_form.fields[1].value); - } + // The tuple also includes a timestamp, which is ignored. + const FormData& submitted_form = *(fake_driver.form_submitted()); + ASSERT_LE(1U, submitted_form.fields.size()); + EXPECT_EQ(base::ASCIIToUTF16("address"), submitted_form.fields[0].name); + EXPECT_EQ(base::UTF8ToUTF16(address), submitted_form.fields[0].value); + EXPECT_EQ(expect_known_success, fake_driver.known_success()); + EXPECT_EQ(expect_submission_source, + mojo::ConvertTo<SubmissionSource>(fake_driver.submission_source())); } // Helper function to verify that NO form-related messages are received from the @@ -139,7 +152,6 @@ void VerifyNoSubmitMessagesReceived( const FakeContentAutofillDriver& fake_driver) { // No submission messages sent. - EXPECT_EQ(nullptr, fake_driver.form_will_submit()); EXPECT_EQ(nullptr, fake_driver.form_submitted()); } @@ -215,8 +227,8 @@ DISALLOW_COPY_AND_ASSIGN(FormAutocompleteTest); }; -// Tests that submitting a form generates WillSubmitForm and FormSubmitted -// messages with the form fields. +// Tests that submitting a form generates FormSubmitted message with the form +// fields. TEST_F(FormAutocompleteTest, NormalFormSubmit) { // Load a form. LoadHTML( @@ -229,13 +241,13 @@ base::RunLoop().RunUntilIdle(); VerifyReceivedRendererMessages(fake_driver_, "Rick", "Deckard", - true /* expect_submitted_message */); + false /* expect_known_success */, + SubmissionSource::FORM_SUBMISSION); } -// TODO(crbug.com/785504): Rewrite this test. -// Tests that submitting a form that prevents the submit event from propagating -// will only send the WillSubmitForm message. -TEST_F(FormAutocompleteTest, DISABLED_SubmitEventPrevented) { +// Tests that FormSubmitted message is generated even the submit event isn't +// propagated by Javascript. +TEST_F(FormAutocompleteTest, SubmitEventPrevented) { // Load a form. LoadHTML( "<html><form id='myForm'><input name='fname' value='Rick'/>" @@ -250,7 +262,8 @@ base::RunLoop().RunUntilIdle(); VerifyReceivedRendererMessages(fake_driver_, "Rick", "Deckard", - false /* expect_submitted_message */); + false /* expect_known_success */, + SubmissionSource::FORM_SUBMISSION); } // Tests that completing an Ajax request and having the form disappear will @@ -279,7 +292,8 @@ base::RunLoop().RunUntilIdle(); VerifyReceivedRendererMessages(fake_driver_, "Rick", "Deckard", - true /* expect_submitted_message */); + true /* expect_known_success */, + SubmissionSource::XHR_SUCCEEDED); } // Tests that completing an Ajax request and having the form with a specific @@ -313,7 +327,8 @@ base::RunLoop().RunUntilIdle(); VerifyReceivedRendererMessages(fake_driver_, "Rick", "Deckard", - true /* expect_submitted_message */); + true /* expect_known_success */, + SubmissionSource::XHR_SUCCEEDED); } // Tests that completing an Ajax request and having the form with no action @@ -354,7 +369,8 @@ base::RunLoop().RunUntilIdle(); VerifyReceivedRendererMessages(fake_driver_, "Rick", "Deckard", - true /* expect_submitted_message */); + true /* expect_known_success */, + SubmissionSource::XHR_SUCCEEDED); } // Tests that completing an Ajax request and having the form with no action @@ -382,7 +398,8 @@ base::RunLoop().RunUntilIdle(); VerifyReceivedRendererMessages(fake_driver_, "Rick", "Deckard", - true /* expect_submitted_message */); + true /* expect_known_success */, + SubmissionSource::XHR_SUCCEEDED); } // Tests that completing an Ajax request but leaving a form visible will not @@ -458,7 +475,8 @@ base::RunLoop().RunUntilIdle(); VerifyReceivedRendererMessages(fake_driver_, "Rick", "Smith", - true /* expect_submitted_message */); + true /* expect_known_success */, + SubmissionSource::XHR_SUCCEEDED); } // Tests that completing an Ajax request after having autofilled a form, @@ -512,7 +530,8 @@ base::RunLoop().RunUntilIdle(); VerifyReceivedRendererMessages(fake_driver_, "Kirby", "Puckett", - /* expect_submitted_message = */ true); + true /* expect_known_success */, + SubmissionSource::XHR_SUCCEEDED); } // Unit test for CollectFormlessElements. @@ -675,7 +694,8 @@ base::RunLoop().RunUntilIdle(); VerifyReceivedRendererMessages(fake_driver_, "Rick", "Deckard", - true /* expect_submitted_message */); + false /* expect_known_success */, + SubmissionSource::FORM_SUBMISSION); } // Tests that fields with autocomplete off are submitted. @@ -692,7 +712,8 @@ base::RunLoop().RunUntilIdle(); VerifyReceivedRendererMessages(fake_driver_, "Rick", "Deckard", - true /* expect_submitted_message */); + false /* expect_known_success */, + SubmissionSource::FORM_SUBMISSION); } // Tests that submitting a form that has been dynamically set as autocomplete @@ -722,7 +743,83 @@ base::RunLoop().RunUntilIdle(); VerifyReceivedRendererMessages(fake_driver_, "Rick", "Deckard", - true /* expect_submitted_message */); + false /* expect_known_success */, + SubmissionSource::FORM_SUBMISSION); +} + +TEST_F(FormAutocompleteTest, FormSubmittedByDOMMutationAfterXHR) { + LoadHTML( + "<html>" + "<input type='text' id='address_field' name='address' autocomplete='on'>" + "</html>"); + + SimulateUserInput(WebString::FromUTF8("address_field"), std::string("City")); + + // Simulate an Ajax request completing. + static_cast<blink::WebAutofillClient*>(autofill_agent_)->AjaxSucceeded(); + + // Hide elements to simulate successful form submission. + std::string hide_elements = + "var address = document.getElementById('address_field');" + "address.style = 'display:none';"; + + ExecuteJavaScriptForTests(hide_elements.c_str()); + base::RunLoop().RunUntilIdle(); + + VerifyReceivedAddressRendererMessages( + fake_driver_, "City", true /* expect_known_success */, + SubmissionSource::DOM_MUTATION_AFTER_XHR); +} + +TEST_F(FormAutocompleteTest, FormSubmittedBySameDocumentNavigation) { + LoadHTML( + "<html>" + "<input type='text' id='address_field' name='address' autocomplete='on'>" + "</html>"); + + SimulateUserInput(WebString::FromUTF8("address_field"), std::string("City")); + + // Hide elements to simulate successful form submission. + std::string hide_elements = + "var address = document.getElementById('address_field');" + "address.style = 'display:none';"; + + ExecuteJavaScriptForTests(hide_elements.c_str()); + + // Simulate same document navigation. + autofill_agent_->form_tracker_for_testing()->DidCommitProvisionalLoad( + false, true /*is_same_document_navigation*/); + base::RunLoop().RunUntilIdle(); + + VerifyReceivedAddressRendererMessages( + fake_driver_, "City", true /* expect_known_success */, + SubmissionSource::SAME_DOCUMENT_NAVIGATION); +} + +TEST_F(FormAutocompleteTest, FormSubmittedByProbablyFormSubmitted) { + LoadHTML( + "<html>" + "<input type='text' id='address_field' name='address' autocomplete='on'>" + "</html>"); + + SimulateUserInput(WebString::FromUTF8("address_field"), std::string("City")); + + // Hide elements to simulate successful form submission. + std::string hide_elements = + "var address = document.getElementById('address_field');" + "address.style = 'display:none';"; + + ExecuteJavaScriptForTests(hide_elements.c_str()); + + // Simulate navigation. + autofill_agent_->form_tracker_for_testing() + ->FireProbablyFormSubmittedForTesting(); + + base::RunLoop().RunUntilIdle(); + + VerifyReceivedAddressRendererMessages( + fake_driver_, "City", false /* expect_known_success */, + SubmissionSource::PROBABLY_FORM_SUBMITTED); } } // namespace autofill
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index c694ea9c..2bbb110 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -543,6 +543,7 @@ "../browser/media/test_license_server.cc", "../browser/media/test_license_server.h", "../browser/media/test_license_server_config.h", + "../browser/media/unified_autoplay_browsertest.cc", "../browser/media/webrtc/media_stream_devices_controller_browsertest.cc", "../browser/media/webrtc/media_stream_infobar_browsertest.cc", "../browser/media/webrtc/test_stats_dictionary.cc", @@ -904,6 +905,7 @@ "//chrome/renderer", "//chrome/services/removable_storage_writer:lib", "//components/autofill/content/browser:risk_proto", + "//components/autofill/content/common:mojo_interfaces", "//components/autofill/content/renderer:test_support", "//components/captive_portal:test_support", "//components/dom_distiller/content/browser",
diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc index 4a82b593..19a9b0e 100644 --- a/chrome/test/base/testing_profile.cc +++ b/chrome/test/base/testing_profile.cc
@@ -985,7 +985,7 @@ return last_session_exited_cleanly_ ? EXIT_NORMAL : EXIT_CRASHED; } -content::mojom::NetworkContextPtr TestingProfile::CreateMainNetworkContext() { +network::mojom::NetworkContextPtr TestingProfile::CreateMainNetworkContext() { return nullptr; }
diff --git a/chrome/test/base/testing_profile.h b/chrome/test/base/testing_profile.h index f86e5d9..a5ae077 100644 --- a/chrome/test/base/testing_profile.h +++ b/chrome/test/base/testing_profile.h
@@ -17,8 +17,8 @@ #include "chrome/browser/profiles/profile.h" #include "components/domain_reliability/clear_mode.h" #include "components/keyed_service/content/browser_context_keyed_service_factory.h" -#include "content/public/common/network_service.mojom.h" #include "extensions/features/features.h" +#include "services/network/public/interfaces/network_service.mojom.h" #if defined(OS_CHROMEOS) #include "chrome/browser/chromeos/settings/scoped_cros_settings_test_helper.h" @@ -321,7 +321,7 @@ bool IsGuestSession() const override; void SetExitType(ExitType exit_type) override {} ExitType GetLastSessionExitType() override; - content::mojom::NetworkContextPtr CreateMainNetworkContext() override; + network::mojom::NetworkContextPtr CreateMainNetworkContext() override; #if defined(OS_CHROMEOS) void ChangeAppLocale(const std::string&, AppLocaleChangedVia) override {} void OnLogin() override {}
diff --git a/chrome/test/chromedriver/test/run_py_tests.py b/chrome/test/chromedriver/test/run_py_tests.py index d45d9c8..8a8b648 100755 --- a/chrome/test/chromedriver/test/run_py_tests.py +++ b/chrome/test/chromedriver/test/run_py_tests.py
@@ -126,12 +126,16 @@ 'ChromeDriverTest.testWindowMaximize', # https://bugs.chromium.org/p/chromedriver/issues/detail?id=2132 'MobileEmulationCapabilityTest.testDeviceMetricsWithDeviceWidth', + # https://bugs.chromium.org/p/chromium/issues/detail?id=803678 + 'ChromeDriverTest.testGoBackAndGoForward' ] _OS_SPECIFIC_FILTER['mac'] = [ # https://bugs.chromium.org/p/chromedriver/issues/detail?id=1927 'MobileEmulationCapabilityTest.testTapElement', # https://bugs.chromium.org/p/chromedriver/issues/detail?id=1945 'ChromeDriverTest.testWindowFullScreen', + # https://bugs.chromium.org/p/chromium/issues/detail?id=803678 + 'ChromeDriverTest.testGoBackAndGoForward' ] _DESKTOP_NEGATIVE_FILTER = [
diff --git a/chrome/test/data/media/unified_autoplay.html b/chrome/test/data/media/unified_autoplay.html new file mode 100644 index 0000000..cfefabc4 --- /dev/null +++ b/chrome/test/data/media/unified_autoplay.html
@@ -0,0 +1,15 @@ +<!DOCTYPE html> +<html> +<meta charset='utf-8'> +<title>Simple autopaly test page</title> +<video src='bigbuck.webm'></video> +<script> +function attemptPlay() { + document.querySelector('video').play().then(function() { + window.domAutomationController.send(true); + }, function() { + window.domAutomationController.send(false); + }); +} +</script> +</html>
diff --git a/chrome/test/data/webui/extensions/a11y/extensions_a11y_test.js b/chrome/test/data/webui/extensions/a11y/extensions_a11y_test.js index d0eb05160..a2763a6 100644 --- a/chrome/test/data/webui/extensions/a11y/extensions_a11y_test.js +++ b/chrome/test/data/webui/extensions/a11y/extensions_a11y_test.js
@@ -226,7 +226,7 @@ /** @override */ tests: { 'Accessible Error Console': function() { - assertTrue(!!document.querySelector('* /deep/ #errors-list')); + assertTrue(!!document.querySelector('* /deep/ #errorsList')); }, }, });
diff --git a/chrome/test/data/webui/extensions/extension_error_page_test.js b/chrome/test/data/webui/extensions/extension_error_page_test.js index 30ecbb5..aaafc58 100644 --- a/chrome/test/data/webui/extensions/extension_error_page_test.js +++ b/chrome/test/data/webui/extensions/extension_error_page_test.js
@@ -94,7 +94,7 @@ var testIsVisible = extension_test_util.isVisible.bind(null, errorPage); expectTrue(testIsVisible('#close-button')); expectTrue(testIsVisible('#heading')); - expectTrue(testIsVisible('#errors-list')); + expectTrue(testIsVisible('#errorsList')); var errorElements = errorPage.querySelectorAll('* /deep/ .error-item'); expectEquals(1, errorElements.length);
diff --git a/chrome/test/data/webui/md_bookmarks/md_bookmarks_browsertest.js b/chrome/test/data/webui/md_bookmarks/md_bookmarks_browsertest.js index c2d2c59..533783e 100644 --- a/chrome/test/data/webui/md_bookmarks/md_bookmarks_browsertest.js +++ b/chrome/test/data/webui/md_bookmarks/md_bookmarks_browsertest.js
@@ -87,7 +87,14 @@ ]), }; -TEST_F('MaterialBookmarksDNDManagerTest', 'All', function() { +// http://crbug.com/803570 : Flaky on Win 7 (dbg) +GEN('#if defined(OS_WIN) && !defined(NDEBUG)'); +GEN('#define MAYBE_All DISABLED_All'); +GEN('#else'); +GEN('#define MAYBE_All All'); +GEN('#endif'); + +TEST_F('MaterialBookmarksDNDManagerTest', 'MAYBE_All', function() { mocha.run(); });
diff --git a/chromecast/base/alarm_manager.cc b/chromecast/base/alarm_manager.cc index 83eb24a..35e25b0fd 100644 --- a/chromecast/base/alarm_manager.cc +++ b/chromecast/base/alarm_manager.cc
@@ -8,7 +8,6 @@ #include "base/bind.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/single_thread_task_runner.h" #include "base/threading/thread_task_runner_handle.h" #include "base/time/clock.h" @@ -67,7 +66,7 @@ } AlarmManager::AlarmManager() - : AlarmManager(base::MakeUnique<base::DefaultClock>(), + : AlarmManager(std::make_unique<base::DefaultClock>(), base::ThreadTaskRunnerHandle::Get()) {} AlarmManager::~AlarmManager() {} @@ -75,7 +74,7 @@ std::unique_ptr<AlarmHandle> AlarmManager::PostAlarmTask(base::OnceClosure task, base::Time time) { DCHECK(task); - std::unique_ptr<AlarmHandle> handle = base::MakeUnique<AlarmHandle>(); + std::unique_ptr<AlarmHandle> handle = std::make_unique<AlarmHandle>(); AddAlarm(base::BindOnce(&VerifyHandleCallback, std::move(task), handle->AsWeakPtr()), time, base::ThreadTaskRunnerHandle::Get()); @@ -87,7 +86,7 @@ base::Time time, scoped_refptr<base::SingleThreadTaskRunner> task_runner) { MAKE_SURE_OWN_THREAD(AddAlarm, std::move(task), time, std::move(task_runner)); - next_alarm_.push(base::MakeUnique<AlarmInfo>(std::move(task), time, + next_alarm_.push(std::make_unique<AlarmInfo>(std::move(task), time, std::move(task_runner))); }
diff --git a/chromecast/base/alarm_manager_unittest.cc b/chromecast/base/alarm_manager_unittest.cc index fb14c24..0ccd9f4f 100644 --- a/chromecast/base/alarm_manager_unittest.cc +++ b/chromecast/base/alarm_manager_unittest.cc
@@ -8,7 +8,6 @@ #include <utility> #include "base/bind.h" -#include "base/memory/ptr_util.h" #include "base/message_loop/message_loop.h" #include "base/test/simple_test_clock.h" #include "base/test/test_mock_time_task_runner.h" @@ -51,11 +50,11 @@ // Create the AlarmManager. base::Time now = base::Time::Now(); std::unique_ptr<base::SimpleTestClock> test_clock = - base::MakeUnique<base::SimpleTestClock>(); + std::make_unique<base::SimpleTestClock>(); test_clock->SetNow(now); base::SimpleTestClock* clock = test_clock.get(); std::unique_ptr<AlarmManager> manager = - base::MakeUnique<AlarmManager>(std::move(test_clock), task_runner_); + std::make_unique<AlarmManager>(std::move(test_clock), task_runner_); base::Time alarm_time = now + base::TimeDelta::FromMinutes(10); std::unique_ptr<AlarmHandle> handle(manager->PostAlarmTask( @@ -74,11 +73,11 @@ // Create the AlarmManager. base::Time now = base::Time::Now(); std::unique_ptr<base::SimpleTestClock> test_clock = - base::MakeUnique<base::SimpleTestClock>(); + std::make_unique<base::SimpleTestClock>(); test_clock->SetNow(now); base::SimpleTestClock* clock = test_clock.get(); std::unique_ptr<AlarmManager> manager = - base::MakeUnique<AlarmManager>(std::move(test_clock), task_runner_); + std::make_unique<AlarmManager>(std::move(test_clock), task_runner_); // Add an alarm. base::Time alarm_time = now + base::TimeDelta::FromMinutes(10); @@ -105,10 +104,10 @@ // Create the AlarmManager. base::Time now = base::Time::Now(); std::unique_ptr<base::SimpleTestClock> test_clock = - base::MakeUnique<base::SimpleTestClock>(); + std::make_unique<base::SimpleTestClock>(); test_clock->SetNow(now); std::unique_ptr<AlarmManager> manager = - base::MakeUnique<AlarmManager>(std::move(test_clock), task_runner_); + std::make_unique<AlarmManager>(std::move(test_clock), task_runner_); // Add an alarm in the past. Should fire right away. base::Time alarm_time = base::Time::Now() - base::TimeDelta::FromMinutes(10); @@ -127,11 +126,11 @@ // Create the AlarmManager. base::Time now = base::Time::Now(); std::unique_ptr<base::SimpleTestClock> test_clock = - base::MakeUnique<base::SimpleTestClock>(); + std::make_unique<base::SimpleTestClock>(); test_clock->SetNow(now); base::SimpleTestClock* clock = test_clock.get(); std::unique_ptr<AlarmManager> manager = - base::MakeUnique<AlarmManager>(std::move(test_clock), task_runner_); + std::make_unique<AlarmManager>(std::move(test_clock), task_runner_); // Add an alarm. The time jumps to the future. base::Time alarm_time = now + base::TimeDelta::FromMinutes(10); @@ -151,11 +150,11 @@ // Create the AlarmManager. base::Time now = base::Time::Now(); std::unique_ptr<base::SimpleTestClock> test_clock = - base::MakeUnique<base::SimpleTestClock>(); + std::make_unique<base::SimpleTestClock>(); test_clock->SetNow(now); base::SimpleTestClock* clock = test_clock.get(); std::unique_ptr<AlarmManager> manager = - base::MakeUnique<AlarmManager>(std::move(test_clock), task_runner_); + std::make_unique<AlarmManager>(std::move(test_clock), task_runner_); // Add an alarm. The time jumps far into the future. base::Time alarm_time = now + base::TimeDelta::FromMinutes(10); @@ -177,11 +176,11 @@ // Create the AlarmManager. base::Time now = base::Time::Now(); std::unique_ptr<base::SimpleTestClock> test_clock = - base::MakeUnique<base::SimpleTestClock>(); + std::make_unique<base::SimpleTestClock>(); test_clock->SetNow(now); base::SimpleTestClock* clock = test_clock.get(); std::unique_ptr<AlarmManager> manager = - base::MakeUnique<AlarmManager>(std::move(test_clock), task_runner_); + std::make_unique<AlarmManager>(std::move(test_clock), task_runner_); // Add first task. base::Time alarm_time = now + base::TimeDelta::FromMinutes(10); @@ -223,11 +222,11 @@ // Create the AlarmManager. base::Time now = base::Time::Now(); std::unique_ptr<base::SimpleTestClock> test_clock = - base::MakeUnique<base::SimpleTestClock>(); + std::make_unique<base::SimpleTestClock>(); test_clock->SetNow(now); base::SimpleTestClock* clock = test_clock.get(); std::unique_ptr<AlarmManager> manager = - base::MakeUnique<AlarmManager>(std::move(test_clock), task_runner_); + std::make_unique<AlarmManager>(std::move(test_clock), task_runner_); // Add first task. base::Time alarm_time = now + base::TimeDelta::FromMinutes(12); @@ -271,11 +270,11 @@ // Create the AlarmManager. base::Time now = base::Time::Now(); std::unique_ptr<base::SimpleTestClock> test_clock = - base::MakeUnique<base::SimpleTestClock>(); + std::make_unique<base::SimpleTestClock>(); test_clock->SetNow(now); base::SimpleTestClock* clock = test_clock.get(); std::unique_ptr<AlarmManager> manager = - base::MakeUnique<AlarmManager>(std::move(test_clock), task_runner_); + std::make_unique<AlarmManager>(std::move(test_clock), task_runner_); // Add first task. base::Time alarm_time = now + base::TimeDelta::FromMinutes(12); @@ -315,11 +314,11 @@ // Create the AlarmManager. base::Time now = base::Time::Now(); std::unique_ptr<base::SimpleTestClock> test_clock = - base::MakeUnique<base::SimpleTestClock>(); + std::make_unique<base::SimpleTestClock>(); test_clock->SetNow(now); base::SimpleTestClock* clock = test_clock.get(); std::unique_ptr<AlarmManager> manager = - base::MakeUnique<AlarmManager>(std::move(test_clock), task_runner_); + std::make_unique<AlarmManager>(std::move(test_clock), task_runner_); // Add first task. base::Time alarm_time = now + base::TimeDelta::FromMinutes(15); @@ -364,11 +363,11 @@ // Create the AlarmManager. base::Time now = base::Time::Now(); std::unique_ptr<base::SimpleTestClock> test_clock = - base::MakeUnique<base::SimpleTestClock>(); + std::make_unique<base::SimpleTestClock>(); test_clock->SetNow(now); base::SimpleTestClock* clock = test_clock.get(); std::unique_ptr<AlarmManager> manager = - base::MakeUnique<AlarmManager>(std::move(test_clock), task_runner_); + std::make_unique<AlarmManager>(std::move(test_clock), task_runner_); // Add first task. base::Time alarm_time = now + base::TimeDelta::FromMinutes(15); @@ -408,11 +407,11 @@ TEST_F(AlarmManagerTest, AlarmCancel) { std::unique_ptr<WallClockDependantTask> task1 = - base::MakeUnique<WallClockDependantTask>(); + std::make_unique<WallClockDependantTask>(); std::unique_ptr<WallClockDependantTask> task2 = - base::MakeUnique<WallClockDependantTask>(); + std::make_unique<WallClockDependantTask>(); std::unique_ptr<WallClockDependantTask> task3 = - base::MakeUnique<WallClockDependantTask>(); + std::make_unique<WallClockDependantTask>(); ASSERT_FALSE(task1->fired_); ASSERT_FALSE(task2->fired_); ASSERT_FALSE(task3->fired_); @@ -420,11 +419,11 @@ // Create the AlarmManager. base::Time now = base::Time::Now(); std::unique_ptr<base::SimpleTestClock> test_clock = - base::MakeUnique<base::SimpleTestClock>(); + std::make_unique<base::SimpleTestClock>(); test_clock->SetNow(now); base::SimpleTestClock* clock = test_clock.get(); std::unique_ptr<AlarmManager> manager = - base::MakeUnique<AlarmManager>(std::move(test_clock), task_runner_); + std::make_unique<AlarmManager>(std::move(test_clock), task_runner_); // Add first task. base::Time alarm_time = now + base::TimeDelta::FromMinutes(12); @@ -457,11 +456,11 @@ TEST_F(AlarmManagerTest, AlarmDeleteHandle) { std::unique_ptr<WallClockDependantTask> task1 = - base::MakeUnique<WallClockDependantTask>(); + std::make_unique<WallClockDependantTask>(); std::unique_ptr<WallClockDependantTask> task2 = - base::MakeUnique<WallClockDependantTask>(); + std::make_unique<WallClockDependantTask>(); std::unique_ptr<WallClockDependantTask> task3 = - base::MakeUnique<WallClockDependantTask>(); + std::make_unique<WallClockDependantTask>(); ASSERT_FALSE(task1->fired_); ASSERT_FALSE(task2->fired_); ASSERT_FALSE(task3->fired_); @@ -469,11 +468,11 @@ // Create the AlarmManager. base::Time now = base::Time::Now(); std::unique_ptr<base::SimpleTestClock> test_clock = - base::MakeUnique<base::SimpleTestClock>(); + std::make_unique<base::SimpleTestClock>(); test_clock->SetNow(now); base::SimpleTestClock* clock = test_clock.get(); std::unique_ptr<AlarmManager> manager = - base::MakeUnique<AlarmManager>(std::move(test_clock), task_runner_); + std::make_unique<AlarmManager>(std::move(test_clock), task_runner_); // Add first task. base::Time alarm_time = now + base::TimeDelta::FromMinutes(12);
diff --git a/chromecast/base/bind_to_task_runner_unittest.cc b/chromecast/base/bind_to_task_runner_unittest.cc index a21134f..8e0e692 100644 --- a/chromecast/base/bind_to_task_runner_unittest.cc +++ b/chromecast/base/bind_to_task_runner_unittest.cc
@@ -10,7 +10,6 @@ #include "base/bind.h" #include "base/bind_helpers.h" #include "base/callback.h" -#include "base/memory/ptr_util.h" #include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "testing/gmock/include/gmock/gmock.h" @@ -94,7 +93,7 @@ TEST_F(BindToTaskRunnerTest, OnceCallbackWithBoundMoveOnly) { base::OnceCallback<void()> callback = BindToCurrentThread(base::BindOnce( &Callbacks::MoveOnlyCallback, base::Unretained(&callbacks_), - base::MakeUnique<Type>(kValue))); + std::make_unique<Type>(kValue))); std::move(callback).Run(); EXPECT_CALL(callbacks_, DoMoveOnlyCallback(Pointee(kValue))); } @@ -103,7 +102,7 @@ base::OnceCallback<void(std::unique_ptr<Type>)> callback = BindToCurrentThread(base::BindOnce(&Callbacks::MoveOnlyCallback, base::Unretained(&callbacks_))); - std::move(callback).Run(base::MakeUnique<Type>(kValue)); + std::move(callback).Run(std::make_unique<Type>(kValue)); EXPECT_CALL(callbacks_, DoMoveOnlyCallback(Pointee(kValue))); } @@ -150,7 +149,7 @@ base::RepeatingCallback<void()> callback = BindToCurrentThread(base::BindRepeating( &Callbacks::MoveOnlyCallback, base::Unretained(&callbacks_), - base::Passed(base::MakeUnique<Type>(kValue)))); + base::Passed(std::make_unique<Type>(kValue)))); callback.Run(); EXPECT_CALL(callbacks_, DoMoveOnlyCallback(Pointee(kValue))); } @@ -159,7 +158,7 @@ base::RepeatingCallback<void(std::unique_ptr<Type>)> callback = BindToCurrentThread(base::BindRepeating(&Callbacks::MoveOnlyCallback, base::Unretained(&callbacks_))); - callback.Run(base::MakeUnique<Type>(kValue)); + callback.Run(std::make_unique<Type>(kValue)); EXPECT_CALL(callbacks_, DoMoveOnlyCallback(Pointee(kValue))); }
diff --git a/chromecast/base/cast_features.cc b/chromecast/base/cast_features.cc index 4c1577a..6c143c0 100644 --- a/chromecast/base/cast_features.cc +++ b/chromecast/base/cast_features.cc
@@ -78,8 +78,8 @@ // // std::unique_ptr<Foo> CreateFoo() { // if (base::FeatureList::IsEnabled(kSuperSecretSauce)) -// return base::MakeUnique<SuperSecretFoo>(); -// return base::MakeUnique<BoringOldFoo>(); +// return std::make_unique<SuperSecretFoo>(); +// return std::make_unique<BoringOldFoo>(); // } // // base::FeatureList can be called from any thread, in any process, at any @@ -140,7 +140,7 @@ SetExperimentIds(dcs_experiment_ids); // Initialize the FeatureList from the command line. - auto feature_list = base::MakeUnique<base::FeatureList>(); + auto feature_list = std::make_unique<base::FeatureList>(); feature_list->InitializeFromCommandLine(cmd_line_enable_features, cmd_line_disable_features); @@ -234,7 +234,7 @@ const base::DictionaryValue* params_dict; if (it.value().GetAsDictionary(¶ms_dict)) { - auto params = base::MakeUnique<base::DictionaryValue>(); + auto params = std::make_unique<base::DictionaryValue>(); bool bval; int ival;
diff --git a/chromecast/base/cast_features_unittest.cc b/chromecast/base/cast_features_unittest.cc index cccee8d..334c76c 100644 --- a/chromecast/base/cast_features_unittest.cc +++ b/chromecast/base/cast_features_unittest.cc
@@ -6,7 +6,6 @@ #include "base/feature_list.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/metrics/field_trial.h" #include "base/metrics/field_trial_params.h" #include "base/values.h" @@ -53,8 +52,8 @@ base::FEATURE_ENABLED_BY_DEFAULT}; // Override those features with DCS configs. - auto experiments = base::MakeUnique<base::ListValue>(); - auto features = base::MakeUnique<base::DictionaryValue>(); + auto experiments = std::make_unique<base::ListValue>(); + auto features = std::make_unique<base::DictionaryValue>(); features->SetBoolean(kTestBooleanFeatureName, false); features->SetBoolean(kTestBooleanFeatureName2, false); features->SetBoolean(kTestBooleanFeatureName3, true); @@ -76,9 +75,9 @@ base::FEATURE_DISABLED_BY_DEFAULT}; // Pass params via DCS. - auto experiments = base::MakeUnique<base::ListValue>(); - auto features = base::MakeUnique<base::DictionaryValue>(); - auto params = base::MakeUnique<base::DictionaryValue>(); + auto experiments = std::make_unique<base::ListValue>(); + auto features = std::make_unique<base::DictionaryValue>(); + auto params = std::make_unique<base::DictionaryValue>(); params->SetString("foo_key", "foo"); params->SetString("bar_key", "bar"); params->SetString("doub_key", "3.14159"); @@ -117,8 +116,8 @@ base::FEATURE_ENABLED_BY_DEFAULT}; // Override those features with DCS configs. - auto experiments = base::MakeUnique<base::ListValue>(); - auto features = base::MakeUnique<base::DictionaryValue>(); + auto experiments = std::make_unique<base::ListValue>(); + auto features = std::make_unique<base::DictionaryValue>(); features->SetBoolean(kTestBooleanFeatureName, false); features->SetBoolean(kTestBooleanFeatureName2, false); features->SetBoolean(kTestBooleanFeatureName3, true); @@ -127,7 +126,7 @@ // Also override a param feature with DCS config. base::Feature params_feature{kTestParamsFeatureName, base::FEATURE_ENABLED_BY_DEFAULT}; - auto params = base::MakeUnique<base::DictionaryValue>(); + auto params = std::make_unique<base::DictionaryValue>(); params->SetString("foo_key", "foo"); features->Set(kTestParamsFeatureName, std::move(params)); @@ -159,8 +158,8 @@ TEST_F(CastFeaturesTest, SetEmptyExperiments) { // Override those features with DCS configs. - auto experiments = base::MakeUnique<base::ListValue>(); - auto features = base::MakeUnique<base::DictionaryValue>(); + auto experiments = std::make_unique<base::ListValue>(); + auto features = std::make_unique<base::DictionaryValue>(); InitializeFeatureList(*features, *experiments, "", ""); ASSERT_EQ(0u, GetDCSExperimentIds().size()); @@ -168,8 +167,8 @@ TEST_F(CastFeaturesTest, SetGoodExperiments) { // Override those features with DCS configs. - auto experiments = base::MakeUnique<base::ListValue>(); - auto features = base::MakeUnique<base::DictionaryValue>(); + auto experiments = std::make_unique<base::ListValue>(); + auto features = std::make_unique<base::DictionaryValue>(); int32_t ids[] = {12345678, 123, 0, -1}; std::unordered_set<int32_t> expected; @@ -184,8 +183,8 @@ TEST_F(CastFeaturesTest, SetSomeGoodExperiments) { // Override those features with DCS configs. - auto experiments = base::MakeUnique<base::ListValue>(); - auto features = base::MakeUnique<base::DictionaryValue>(); + auto experiments = std::make_unique<base::ListValue>(); + auto features = std::make_unique<base::DictionaryValue>(); experiments->AppendInteger(1234); experiments->AppendString("foobar"); experiments->AppendBoolean(true); @@ -202,8 +201,8 @@ TEST_F(CastFeaturesTest, SetAllBadExperiments) { // Override those features with DCS configs. - auto experiments = base::MakeUnique<base::ListValue>(); - auto features = base::MakeUnique<base::DictionaryValue>(); + auto experiments = std::make_unique<base::ListValue>(); + auto features = std::make_unique<base::DictionaryValue>(); experiments->AppendString("foobar"); experiments->AppendBoolean(true); experiments->AppendDouble(1.23456); @@ -215,11 +214,11 @@ } TEST_F(CastFeaturesTest, GetOverriddenFeaturesForStorage) { - auto features = base::MakeUnique<base::DictionaryValue>(); + auto features = std::make_unique<base::DictionaryValue>(); features->SetBoolean("bool_key", false); features->SetBoolean("bool_key_2", true); - auto params = base::MakeUnique<base::DictionaryValue>(); + auto params = std::make_unique<base::DictionaryValue>(); params->SetString("foo_key", "foo"); params->SetString("bar_key", "bar"); params->SetDouble("doub_key", 3.14159); @@ -258,13 +257,13 @@ } TEST_F(CastFeaturesTest, GetOverriddenFeaturesForStorage_BadParams) { - auto features = base::MakeUnique<base::DictionaryValue>(); + auto features = std::make_unique<base::DictionaryValue>(); features->SetBoolean("bool_key", false); features->SetString("str_key", "foobar"); features->SetInteger("int_key", 12345); features->SetDouble("doub_key", 4.5678); - auto params = base::MakeUnique<base::DictionaryValue>(); + auto params = std::make_unique<base::DictionaryValue>(); params->SetString("foo_key", "foo"); features->Set("params_key", std::move(params)); @@ -282,4 +281,4 @@ ASSERT_EQ("foo", sval); } -} // namespace chromecast \ No newline at end of file +} // namespace chromecast
diff --git a/chromecast/base/cast_sys_info_android.cc b/chromecast/base/cast_sys_info_android.cc index 7394c229..1c078c75 100644 --- a/chromecast/base/cast_sys_info_android.cc +++ b/chromecast/base/cast_sys_info_android.cc
@@ -4,10 +4,11 @@ #include "chromecast/base/cast_sys_info_android.h" +#include <memory> + #include "base/android/build_info.h" #include "base/android/jni_android.h" #include "base/android/jni_string.h" -#include "base/memory/ptr_util.h" #include "base/strings/string_number_conversions.h" #include "base/sys_info.h" #include "chromecast/base/cast_sys_info_util.h" @@ -22,7 +23,7 @@ // static std::unique_ptr<CastSysInfo> CreateSysInfo() { - return base::MakeUnique<CastSysInfoAndroid>(); + return std::make_unique<CastSysInfoAndroid>(); } CastSysInfoAndroid::CastSysInfoAndroid()
diff --git a/chromecast/base/cast_sys_info_util_simple.cc b/chromecast/base/cast_sys_info_util_simple.cc index 6f384b46..472e586 100644 --- a/chromecast/base/cast_sys_info_util_simple.cc +++ b/chromecast/base/cast_sys_info_util_simple.cc
@@ -2,16 +2,17 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <memory> + #include "chromecast/base/cast_sys_info_util.h" -#include "base/memory/ptr_util.h" #include "chromecast/base/cast_sys_info_dummy.h" namespace chromecast { // static std::unique_ptr<CastSysInfo> CreateSysInfo() { - return base::MakeUnique<CastSysInfoDummy>(); + return std::make_unique<CastSysInfoDummy>(); } } // namespace chromecast
diff --git a/chromecast/base/chromecast_switches.cc b/chromecast/base/chromecast_switches.cc index 3bfb783..bf2ec347 100644 --- a/chromecast/base/chromecast_switches.cc +++ b/chromecast/base/chromecast_switches.cc
@@ -123,6 +123,9 @@ const char kCastInitialScreenHeight[] = "cast-initial-screen-height"; const char kGraphicsBufferCount[] = "graphics-buffer-count"; +// Overrides the vsync interval used by the GPU process to refresh the display. +const char kVSyncInterval[] = "vsync-interval"; + // When present, desktop cast_shell will create 1080p window (provided display // resolution is high enough). Otherwise, cast_shell defaults to 720p. const char kDesktopWindow1080p[] = "desktop-window-1080p";
diff --git a/chromecast/base/chromecast_switches.h b/chromecast/base/chromecast_switches.h index a9872db..126d26b 100644 --- a/chromecast/base/chromecast_switches.h +++ b/chromecast/base/chromecast_switches.h
@@ -65,6 +65,7 @@ extern const char kCastInitialScreenWidth[]; extern const char kCastInitialScreenHeight[]; extern const char kGraphicsBufferCount[]; +extern const char kVSyncInterval[]; // Graphics switches extern const char kDesktopWindow1080p[];
diff --git a/chromecast/base/device_capabilities_impl.cc b/chromecast/base/device_capabilities_impl.cc index 7b36854..398d221 100644 --- a/chromecast/base/device_capabilities_impl.cc +++ b/chromecast/base/device_capabilities_impl.cc
@@ -64,13 +64,13 @@ std::unique_ptr<DeviceCapabilities> DeviceCapabilities::CreateForTesting() { DeviceCapabilities* capabilities = new DeviceCapabilitiesImpl; capabilities->SetCapability(kKeyBluetoothSupported, - base::MakeUnique<base::Value>(false)); + std::make_unique<base::Value>(false)); capabilities->SetCapability(kKeyDisplaySupported, - base::MakeUnique<base::Value>(true)); + std::make_unique<base::Value>(true)); capabilities->SetCapability(kKeyHiResAudioSupported, - base::MakeUnique<base::Value>(false)); + std::make_unique<base::Value>(false)); capabilities->SetCapability(kKeyAssistantSupported, - base::MakeUnique<base::Value>(true)); + std::make_unique<base::Value>(true)); return base::WrapUnique(capabilities); } @@ -161,7 +161,7 @@ base::AutoLock auto_lock(validation_lock_); // Check that a validator has not already been registered for this key DCHECK_EQ(0u, validator_map_.count(key)); - validator_map_[key] = base::MakeUnique<ValidatorInfo>(validator); + validator_map_[key] = std::make_unique<ValidatorInfo>(validator); } void DeviceCapabilitiesImpl::Unregister(const std::string& key,
diff --git a/chromecast/base/device_capabilities_impl_unittest.cc b/chromecast/base/device_capabilities_impl_unittest.cc index 03442c4..d819975 100644 --- a/chromecast/base/device_capabilities_impl_unittest.cc +++ b/chromecast/base/device_capabilities_impl_unittest.cc
@@ -153,7 +153,7 @@ DCHECK(key); DCHECK(init_value); *key = DeviceCapabilities::kKeyBluetoothSupported; - *init_value = base::MakeUnique<base::Value>(true); + *init_value = std::make_unique<base::Value>(true); } // For test fixtures that test dynamic capabilities, gets a sample key @@ -163,21 +163,21 @@ DCHECK(key); DCHECK(init_value); *key = "dummy_dynamic_key"; - *init_value = base::MakeUnique<base::Value>(99); + *init_value = std::make_unique<base::Value>(99); } // Gets a value for sample default capability different from |init_value| // returned in GetSampleDefaultCapability(). Must be of same type as // |init_value| of course. std::unique_ptr<base::Value> GetSampleDefaultCapabilityNewValue() { - return base::MakeUnique<base::Value>(false); + return std::make_unique<base::Value>(false); } // Gets a value for sample dynamic capability different from |init_value| // returned in GetSampleDynamicCapability(). Must be of same type as // |init_value| of course. std::unique_ptr<base::Value> GetSampleDynamicCapabilityNewValue() { - return base::MakeUnique<base::Value>(100); + return std::make_unique<base::Value>(100); } // Tests that |json| string matches contents of a DictionaryValue with one entry
diff --git a/chromecast/base/observer.h b/chromecast/base/observer.h index 5a0f50a..6605f85 100644 --- a/chromecast/base/observer.h +++ b/chromecast/base/observer.h
@@ -110,7 +110,6 @@ #include "base/location.h" #include "base/logging.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/memory/ref_counted.h" #include "base/sequence_checker.h" #include "base/sequenced_task_runner.h" @@ -310,7 +309,7 @@ PerSequenceInfo(scoped_refptr<base::SequencedTaskRunner> task_runner, const T& value) : task_runner_(std::move(task_runner)), - owned_info_(base::MakeUnique<SequenceOwnedInfo>(value)) {} + owned_info_(std::make_unique<SequenceOwnedInfo>(value)) {} PerSequenceInfo(PerSequenceInfo&& other) = default;
diff --git a/chromecast/base/observer_unittest.cc b/chromecast/base/observer_unittest.cc index 87a6fafd..22a2522f 100644 --- a/chromecast/base/observer_unittest.cc +++ b/chromecast/base/observer_unittest.cc
@@ -9,7 +9,6 @@ #include "base/bind_helpers.h" #include "base/location.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "base/synchronization/waitable_event.h" @@ -21,7 +20,7 @@ class ObserverTest : public ::testing::Test { protected: - ObserverTest() : message_loop_(base::MakeUnique<base::MessageLoop>()) {} + ObserverTest() : message_loop_(std::make_unique<base::MessageLoop>()) {} const std::unique_ptr<base::MessageLoop> message_loop_; }; @@ -90,7 +89,7 @@ private: void ObserveOnThread(Observable<int>* observable) { DCHECK(thread_.task_runner()->BelongsToCurrentThread()); - observer_ = base::MakeUnique<Observer<int>>(observable->Observe()); + observer_ = std::make_unique<Observer<int>>(observable->Observe()); observing_.Signal(); } @@ -291,7 +290,7 @@ } TEST_F(ObserverTest, ObserverOutlivesObservable) { - auto original = base::MakeUnique<Observable<int>>(0); + auto original = std::make_unique<Observable<int>>(0); Observer<int> observer1 = original->Observe(); EXPECT_EQ(0, observer1.GetValue()); @@ -308,7 +307,7 @@ } TEST_F(ObserverTest, ObserverOnDifferentThread) { - auto original = base::MakeUnique<ThreadedObservable>(); + auto original = std::make_unique<ThreadedObservable>(); Observer<int> observer = original->Observe(); EXPECT_EQ(0, observer.GetValue()); @@ -331,10 +330,10 @@ } TEST_F(ObserverTest, ObserveOnManyThreads) { - auto original = base::MakeUnique<Observable<int>>(0); + auto original = std::make_unique<Observable<int>>(0); std::vector<std::unique_ptr<ThreadedObserver>> observers; for (int i = 0; i < 20; ++i) { - observers.push_back(base::MakeUnique<ThreadedObserver>()); + observers.push_back(std::make_unique<ThreadedObserver>()); observers.back()->Observe(original.get()); }
diff --git a/chromecast/base/thread_health_checker.cc b/chromecast/base/thread_health_checker.cc index b5f0259..c1356ec8 100644 --- a/chromecast/base/thread_health_checker.cc +++ b/chromecast/base/thread_health_checker.cc
@@ -7,7 +7,6 @@ #include <memory> #include <string> -#include "base/memory/ptr_util.h" #include "base/memory/ref_counted.h" #include "base/single_thread_task_runner.h" #include "base/task_runner.h" @@ -37,8 +36,8 @@ void ThreadHealthChecker::Internal::StartHealthCheck() { DCHECK(doctor_task_runner_->BelongsToCurrentThread()); DETACH_FROM_THREAD(thread_checker_); - ok_timer_ = base::MakeUnique<base::OneShotTimer>(); - failure_timer_ = base::MakeUnique<base::OneShotTimer>(); + ok_timer_ = std::make_unique<base::OneShotTimer>(); + failure_timer_ = std::make_unique<base::OneShotTimer>(); ScheduleHealthCheck(); }
diff --git a/chromecast/browser/cast_browser_context.cc b/chromecast/browser/cast_browser_context.cc index 9f091d0..f1ac8ea 100644 --- a/chromecast/browser/cast_browser_context.cc +++ b/chromecast/browser/cast_browser_context.cc
@@ -4,6 +4,8 @@ #include "chromecast/browser/cast_browser_context.h" +#include <memory> + #include "base/command_line.h" #include "base/files/file_util.h" #include "base/macros.h" @@ -112,7 +114,7 @@ CastBrowserContext::GetDownloadManagerDelegate() { if (!GetUserData(kDownloadManagerDelegateKey)) { SetUserData(kDownloadManagerDelegateKey, - base::MakeUnique<CastDownloadManagerDelegate>()); + std::make_unique<CastDownloadManagerDelegate>()); } return static_cast<CastDownloadManagerDelegate*>( GetUserData(kDownloadManagerDelegateKey));
diff --git a/chromecast/browser/cast_browser_main_parts.cc b/chromecast/browser/cast_browser_main_parts.cc index 76f442eb..01d95e2 100644 --- a/chromecast/browser/cast_browser_main_parts.cc +++ b/chromecast/browser/cast_browser_main_parts.cc
@@ -378,7 +378,7 @@ void CastBrowserMainParts::PostMainMessageLoopStart() { cast_browser_process_->SetMetricsHelper( - base::MakeUnique<metrics::CastMetricsHelper>( + std::make_unique<metrics::CastMetricsHelper>( base::ThreadTaskRunnerHandle::Get())); #if defined(OS_ANDROID) @@ -413,7 +413,7 @@ } breakpad::CrashDumpObserver::Create(); breakpad::CrashDumpObserver::GetInstance()->RegisterClient( - base::MakeUnique<breakpad::ChildProcessCrashObserver>( + std::make_unique<breakpad::ChildProcessCrashObserver>( crash_dumps_dir, kAndroidMinidumpDescriptor)); #else base::FilePath home_dir; @@ -454,7 +454,7 @@ cast_browser_process_->SetCastScreen(base::WrapUnique(new CastScreen())); DCHECK(!display::Screen::GetScreen()); display::Screen::SetScreenInstance(cast_browser_process_->cast_screen()); - display_configurator_ = base::MakeUnique<CastDisplayConfigurator>( + display_configurator_ = std::make_unique<CastDisplayConfigurator>( cast_browser_process_->cast_screen()); #endif // defined(USE_AURA) @@ -484,15 +484,15 @@ #endif // defined(OS_FUCHSIA) cast_browser_process_->SetBrowserContext( - base::MakeUnique<CastBrowserContext>(url_request_context_factory_)); + std::make_unique<CastBrowserContext>(url_request_context_factory_)); cast_browser_process_->SetMetricsServiceClient( - base::MakeUnique<metrics::CastMetricsServiceClient>( + std::make_unique<metrics::CastMetricsServiceClient>( cast_browser_process_->pref_service(), content::BrowserContext::GetDefaultStoragePartition( cast_browser_process_->browser_context()) ->GetURLRequestContext())); cast_browser_process_->SetRemoteDebuggingServer( - base::MakeUnique<RemoteDebuggingServer>( + std::make_unique<RemoteDebuggingServer>( cast_browser_process_->browser_client() ->EnableRemoteDebuggingImmediately()));
diff --git a/chromecast/browser/cast_content_browser_client.cc b/chromecast/browser/cast_content_browser_client.cc index 3a23447..0e3bd7e 100644 --- a/chromecast/browser/cast_content_browser_client.cc +++ b/chromecast/browser/cast_content_browser_client.cc
@@ -16,7 +16,6 @@ #include "base/i18n/rtl.h" #include "base/json/json_reader.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/path_service.h" #include "base/strings/string_number_conversions.h" #include "base/strings/utf_string_conversions.h" @@ -171,6 +170,15 @@ std::string process_type = command_line->GetSwitchValueNative(switches::kProcessType); if (process_type == switches::kGpuProcess) { + static const char* const kForwardSwitches[] = { + switches::kCastInitialScreenHeight, switches::kCastInitialScreenWidth, + switches::kVSyncInterval, + }; + base::CommandLine* browser_command_line = + base::CommandLine::ForCurrentProcess(); + command_line->CopySwitchesFrom(*browser_command_line, kForwardSwitches, + arraysize(kForwardSwitches)); + auto display = display::Screen::GetScreen()->GetPrimaryDisplay(); gfx::Size res = display.GetSizeInPixel(); if (display.rotation() == display::Display::ROTATE_90 || @@ -202,7 +210,7 @@ net::URLRequestContextGetter* request_context_getter, media::VideoPlaneController* video_plane_controller, CastWindowManager* window_manager) { - return base::MakeUnique<CastServiceSimple>(browser_context, pref_service, + return std::make_unique<CastServiceSimple>(browser_context, pref_service, window_manager); } @@ -252,15 +260,15 @@ // CastAudioManager. bool use_mixer = true; #if defined(USE_ALSA) - return base::MakeUnique<media::CastAudioManagerAlsa>( - base::MakeUnique<::media::AudioThreadImpl>(), audio_log_factory, - base::MakeUnique<media::MediaPipelineBackendFactoryImpl>( + return std::make_unique<media::CastAudioManagerAlsa>( + std::make_unique<::media::AudioThreadImpl>(), audio_log_factory, + std::make_unique<media::MediaPipelineBackendFactoryImpl>( media_pipeline_backend_manager()), GetMediaTaskRunner(), use_mixer); #else - return base::MakeUnique<media::CastAudioManager>( - base::MakeUnique<::media::AudioThreadImpl>(), audio_log_factory, - base::MakeUnique<media::MediaPipelineBackendFactoryImpl>( + return std::make_unique<media::CastAudioManager>( + std::make_unique<::media::AudioThreadImpl>(), audio_log_factory, + std::make_unique<media::MediaPipelineBackendFactoryImpl>( media_pipeline_backend_manager()), GetMediaTaskRunner(), use_mixer); #endif // defined(USE_ALSA) @@ -269,7 +277,7 @@ std::unique_ptr<::media::CdmFactory> CastContentBrowserClient::CreateCdmFactory() { #if BUILDFLAG(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS) - return base::MakeUnique<media::CastCdmFactory>(GetMediaTaskRunner(), + return std::make_unique<media::CastCdmFactory>(GetMediaTaskRunner(), media_resource_tracker()); #endif // BUILDFLAG(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS) return nullptr;
diff --git a/chromecast/browser/cast_media_blocker_browsertest.cc b/chromecast/browser/cast_media_blocker_browsertest.cc index 576b9cb..cf989e0 100644 --- a/chromecast/browser/cast_media_blocker_browsertest.cc +++ b/chromecast/browser/cast_media_blocker_browsertest.cc
@@ -2,8 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <memory> + #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/run_loop.h" #include "base/threading/platform_thread.h" #include "base/threading/thread_task_runner_handle.h" @@ -44,7 +45,7 @@ web_contents_ = NavigateToURL(gurl); WaitForLoadStop(web_contents_); - blocker_ = base::MakeUnique<CastMediaBlocker>( + blocker_ = std::make_unique<CastMediaBlocker>( content::MediaSession::Get(web_contents_)); }
diff --git a/chromecast/browser/cast_media_blocker_unittest.cc b/chromecast/browser/cast_media_blocker_unittest.cc index 709e9dd..63dd3f8 100644 --- a/chromecast/browser/cast_media_blocker_unittest.cc +++ b/chromecast/browser/cast_media_blocker_unittest.cc
@@ -6,7 +6,6 @@ #include <memory> -#include "base/memory/ptr_util.h" #include "base/time/time.h" #include "content/public/browser/media_session.h" #include "content/public/test/test_content_client_initializer.h" @@ -54,10 +53,10 @@ void SetUp() override { gl::GLSurfaceTestSupport::InitializeOneOff(); - initializer_ = base::MakeUnique<content::TestContentClientInitializer>(); + initializer_ = std::make_unique<content::TestContentClientInitializer>(); content::RenderViewHostTestHarness::SetUp(); - media_session_ = base::MakeUnique<MockMediaSession>(); - media_blocker_ = base::MakeUnique<CastMediaBlocker>(media_session_.get()); + media_session_ = std::make_unique<MockMediaSession>(); + media_blocker_ = std::make_unique<CastMediaBlocker>(media_session_.get()); } void TearDown() override { content::RenderViewHostTestHarness::TearDown(); }
diff --git a/chromecast/browser/cast_net_log.cc b/chromecast/browser/cast_net_log.cc index e281054..123f112 100644 --- a/chromecast/browser/cast_net_log.cc +++ b/chromecast/browser/cast_net_log.cc
@@ -12,7 +12,6 @@ #include "base/command_line.h" #include "base/files/file_path.h" #include "base/files/scoped_file.h" -#include "base/memory/ptr_util.h" #include "base/values.h" #include "content/public/common/content_switches.h" #include "net/log/file_net_log_observer.h" @@ -27,7 +26,7 @@ net::GetNetConstants(); // Add a dictionary with client information - auto dict = base::MakeUnique<base::DictionaryValue>(); + auto dict = std::make_unique<base::DictionaryValue>(); dict->SetString("name", "cast_shell"); dict->SetString(
diff --git a/chromecast/browser/cast_network_delegate_simple.cc b/chromecast/browser/cast_network_delegate_simple.cc index 4c162d3..77576956c 100644 --- a/chromecast/browser/cast_network_delegate_simple.cc +++ b/chromecast/browser/cast_network_delegate_simple.cc
@@ -2,10 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <memory> + #include "chromecast/browser/cast_network_delegate.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "url/gurl.h" namespace chromecast { @@ -34,7 +35,7 @@ // static std::unique_ptr<CastNetworkDelegate> CastNetworkDelegate::Create() { - return base::MakeUnique<CastNetworkDelegateSimple>(); + return std::make_unique<CastNetworkDelegateSimple>(); } } // namespace shell
diff --git a/chromecast/browser/cast_web_contents_manager.cc b/chromecast/browser/cast_web_contents_manager.cc index 422303e..d234b2ac 100644 --- a/chromecast/browser/cast_web_contents_manager.cc +++ b/chromecast/browser/cast_web_contents_manager.cc
@@ -9,7 +9,6 @@ #include "base/bind.h" #include "base/location.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/sequenced_task_runner.h" #include "base/stl_util.h" #include "base/threading/sequenced_task_runner_handle.h" @@ -38,7 +37,7 @@ bool is_headless, bool enable_touch_input) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - return base::MakeUnique<CastWebView>( + return std::make_unique<CastWebView>( delegate, this, browser_context_, site_instance, transparent, allow_media_access, is_headless, enable_touch_input); }
diff --git a/chromecast/browser/devtools/cast_devtools_manager_delegate_unittest.cc b/chromecast/browser/devtools/cast_devtools_manager_delegate_unittest.cc index b744de45..08e34e3 100644 --- a/chromecast/browser/devtools/cast_devtools_manager_delegate_unittest.cc +++ b/chromecast/browser/devtools/cast_devtools_manager_delegate_unittest.cc
@@ -8,7 +8,6 @@ #include <unordered_set> #include "base/bind.h" -#include "base/memory/ptr_util.h" #include "content/public/browser/devtools_agent_host.h" #include "content/public/browser/web_contents.h" #include "content/public/test/test_content_client_initializer.h" @@ -30,10 +29,10 @@ void SetUp() override { gl::GLSurfaceTestSupport::InitializeOneOff(); - initializer_ = base::MakeUnique<content::TestContentClientInitializer>(); + initializer_ = std::make_unique<content::TestContentClientInitializer>(); content::RenderViewHostTestHarness::SetUp(); devtools_manager_delegate_ = - base::MakeUnique<CastDevToolsManagerDelegate>(); + std::make_unique<CastDevToolsManagerDelegate>(); } void TestDiscoveredTargets(const WebContentsSet& enabled_web_contents,
diff --git a/chromecast/browser/metrics/cast_metrics_service_client.cc b/chromecast/browser/metrics/cast_metrics_service_client.cc index ae199fd..002a901 100644 --- a/chromecast/browser/metrics/cast_metrics_service_client.cc +++ b/chromecast/browser/metrics/cast_metrics_service_client.cc
@@ -8,7 +8,6 @@ #include "base/guid.h" #include "base/i18n/rtl.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/strings/string16.h" #include "base/strings/string_number_conversions.h" #include "base/threading/thread_task_runner_handle.h" @@ -358,7 +357,7 @@ new ::metrics::ScreenInfoMetricsProvider)); } metrics_service_->RegisterMetricsProvider( - base::MakeUnique<::metrics::NetworkMetricsProvider>()); + std::make_unique<::metrics::NetworkMetricsProvider>()); shell::CastBrowserProcess::GetInstance()->browser_client()-> RegisterMetricsProviders(metrics_service_.get());
diff --git a/chromecast/browser/service/cast_service_simple.cc b/chromecast/browser/service/cast_service_simple.cc index f02e731a..4448bd0 100644 --- a/chromecast/browser/service/cast_service_simple.cc +++ b/chromecast/browser/service/cast_service_simple.cc
@@ -8,7 +8,6 @@ #include "base/command_line.h" #include "base/files/file_util.h" -#include "base/memory/ptr_util.h" #include "base/time/time.h" #include "chromecast/browser/cast_web_contents_manager.h" #include "content/public/browser/web_contents.h" @@ -43,7 +42,7 @@ : CastService(browser_context, pref_service), window_manager_(window_manager), web_contents_manager_( - base::MakeUnique<CastWebContentsManager>(browser_context)) { + std::make_unique<CastWebContentsManager>(browser_context)) { DCHECK(window_manager_); }
diff --git a/chromecast/browser/test/cast_browser_test.cc b/chromecast/browser/test/cast_browser_test.cc index e9ac83c..97dc609 100644 --- a/chromecast/browser/test/cast_browser_test.cc +++ b/chromecast/browser/test/cast_browser_test.cc
@@ -6,7 +6,6 @@ #include "base/command_line.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/run_loop.h" #include "chromecast/base/chromecast_switches.h" #include "chromecast/base/metrics/cast_metrics_helper.h" @@ -45,7 +44,7 @@ base::RunLoop().RunUntilIdle(); metrics::CastMetricsHelper::GetInstance()->SetDummySessionIdForTesting(); - web_contents_manager_ = base::MakeUnique<CastWebContentsManager>( + web_contents_manager_ = std::make_unique<CastWebContentsManager>( CastBrowserProcess::GetInstance()->browser_context()); }
diff --git a/chromecast/browser/test/cast_features_browsertest.cc b/chromecast/browser/test/cast_features_browsertest.cc index c968f629..8e90492 100644 --- a/chromecast/browser/test/cast_features_browsertest.cc +++ b/chromecast/browser/test/cast_features_browsertest.cc
@@ -5,6 +5,7 @@ #include "chromecast/base/cast_features.h" #include <cstdint> +#include <memory> #include <unordered_set> #include "base/feature_list.h" @@ -195,7 +196,7 @@ // Set the features to be used on next boot. base::DictionaryValue features; - auto params = base::MakeUnique<base::DictionaryValue>(); + auto params = std::make_unique<base::DictionaryValue>(); params->SetBoolean("bool_param", true); params->SetBoolean("bool_param_2", false); params->SetString("str_param", "foo"); @@ -253,7 +254,7 @@ // ... and bad parameters. features.SetString("test_feat_22", "False"); - features.Set("test_feat_23", base::MakeUnique<base::ListValue>()); + features.Set("test_feat_23", std::make_unique<base::ListValue>()); SetFeatures(features); }
diff --git a/chromecast/browser/url_request_context_factory.cc b/chromecast/browser/url_request_context_factory.cc index 7e6c0f4..cf52d3aa 100644 --- a/chromecast/browser/url_request_context_factory.cc +++ b/chromecast/browser/url_request_context_factory.cc
@@ -277,7 +277,7 @@ switches::kEnableLocalFileAccesses)) { set_protocol = job_factory->SetProtocolHandler( url::kFileScheme, - base::MakeUnique<net::FileProtocolHandler>( + std::make_unique<net::FileProtocolHandler>( base::CreateTaskRunnerWithTraits( {base::MayBlock(), base::TaskPriority::BACKGROUND, base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN})));
diff --git a/chromecast/crash/cast_crashdump_uploader.cc b/chromecast/crash/cast_crashdump_uploader.cc index 1454f158..d9a5544 100644 --- a/chromecast/crash/cast_crashdump_uploader.cc +++ b/chromecast/crash/cast_crashdump_uploader.cc
@@ -7,7 +7,6 @@ #include <sys/stat.h> #include "base/logging.h" -#include "base/memory/ptr_util.h" // TODO(slan): Find a replacement for LibcurlWrapper in Chromium to remove the // breakpad dependency. #include "third_party/breakpad/breakpad/src/common/linux/libcurl_wrapper.h" @@ -38,7 +37,7 @@ CastCrashdumpUploader::CastCrashdumpUploader(const CastCrashdumpData& data) : CastCrashdumpUploader( data, - base::MakeUnique<google_breakpad::LibcurlWrapper>()) {} + std::make_unique<google_breakpad::LibcurlWrapper>()) {} CastCrashdumpUploader::CastCrashdumpUploader( const CastCrashdumpData& data,
diff --git a/chromecast/crash/cast_crashdump_uploader_unittest.cc b/chromecast/crash/cast_crashdump_uploader_unittest.cc index 97f9e402..a2593b7 100644 --- a/chromecast/crash/cast_crashdump_uploader_unittest.cc +++ b/chromecast/crash/cast_crashdump_uploader_unittest.cc
@@ -5,7 +5,6 @@ #include <string> #include "base/files/file_util.h" -#include "base/memory/ptr_util.h" #include "chromecast/base/scoped_temp_file.h" #include "chromecast/crash/cast_crashdump_uploader.h" #include "testing/gmock/include/gmock/gmock.h" @@ -36,7 +35,7 @@ using testing::Return; TEST(CastCrashdumpUploaderTest, UploadFailsWhenInitFails) { - auto m = base::MakeUnique<testing::StrictMock<MockLibcurlWrapper>>(); + auto m = std::make_unique<testing::StrictMock<MockLibcurlWrapper>>(); EXPECT_CALL(*m, Init()).Times(1).WillOnce(Return(false)); CastCrashdumpData data; @@ -53,7 +52,7 @@ } TEST(CastCrashdumpUploaderTest, UploadSucceedsWithValidParameters) { - auto m = base::MakeUnique<testing::StrictMock<MockLibcurlWrapper>>(); + auto m = std::make_unique<testing::StrictMock<MockLibcurlWrapper>>(); // Create a temporary file. ScopedTempFile minidump; @@ -77,7 +76,7 @@ } TEST(CastCrashdumpUploaderTest, UploadFailsWithInvalidPathname) { - auto m = base::MakeUnique<testing::StrictMock<MockLibcurlWrapper>>(); + auto m = std::make_unique<testing::StrictMock<MockLibcurlWrapper>>(); EXPECT_CALL(*m, Init()).Times(1).WillOnce(Return(true)); EXPECT_CALL(*m, SendRequest(_, _, _, _, _)).Times(0); @@ -111,7 +110,7 @@ // Test with empty product name. data.product = ""; - auto m = base::MakeUnique<testing::StrictMock<MockLibcurlWrapper>>(); + auto m = std::make_unique<testing::StrictMock<MockLibcurlWrapper>>(); EXPECT_CALL(*m, Init()).Times(1).WillOnce(Return(true)); CastCrashdumpUploader uploader_no_product(data, std::move(m)); ASSERT_FALSE(uploader_no_product.Upload(nullptr)); @@ -119,7 +118,7 @@ // Test with empty product version. data.version = ""; - m = base::MakeUnique<testing::StrictMock<MockLibcurlWrapper>>(); + m = std::make_unique<testing::StrictMock<MockLibcurlWrapper>>(); EXPECT_CALL(*m, Init()).Times(1).WillOnce(Return(true)); CastCrashdumpUploader uploader_no_version(data, std::move(m)); ASSERT_FALSE(uploader_no_version.Upload(nullptr)); @@ -127,14 +126,14 @@ // Test with empty client GUID. data.guid = ""; - m = base::MakeUnique<testing::StrictMock<MockLibcurlWrapper>>(); + m = std::make_unique<testing::StrictMock<MockLibcurlWrapper>>(); EXPECT_CALL(*m, Init()).Times(1).WillOnce(Return(true)); CastCrashdumpUploader uploader_no_guid(data, std::move(m)); ASSERT_FALSE(uploader_no_guid.Upload(nullptr)); } TEST(CastCrashdumpUploaderTest, UploadFailsWithInvalidAttachment) { - auto m = base::MakeUnique<testing::StrictMock<MockLibcurlWrapper>>(); + auto m = std::make_unique<testing::StrictMock<MockLibcurlWrapper>>(); // Create a temporary file. ScopedTempFile minidump; @@ -158,7 +157,7 @@ } TEST(CastCrashdumpUploaderTest, UploadSucceedsWithValidAttachment) { - auto m = base::MakeUnique<testing::StrictMock<MockLibcurlWrapper>>(); + auto m = std::make_unique<testing::StrictMock<MockLibcurlWrapper>>(); // Create a temporary file. ScopedTempFile minidump;
diff --git a/chromecast/crash/linux/crash_testing_utils.cc b/chromecast/crash/linux/crash_testing_utils.cc index fa177ec..aa7cea8 100644 --- a/chromecast/crash/linux/crash_testing_utils.cc +++ b/chromecast/crash/linux/crash_testing_utils.cc
@@ -7,7 +7,6 @@ #include <utility> #include "base/files/file_util.h" -#include "base/memory/ptr_util.h" #include "base/strings/string_split.h" #include "base/strings/stringprintf.h" #include "base/values.h" @@ -39,7 +38,7 @@ std::vector<std::string> lines = base::SplitString( lockfile_string, "\n", base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY); - std::unique_ptr<base::ListValue> dumps = base::MakeUnique<base::ListValue>(); + std::unique_ptr<base::ListValue> dumps = std::make_unique<base::ListValue>(); // Validate dumps for (const std::string& line : lines) { @@ -83,7 +82,7 @@ std::unique_ptr<DumpInfo> CreateDumpInfo(const std::string& json_string) { std::unique_ptr<base::Value> value(DeserializeFromJson(json_string)); - return base::MakeUnique<DumpInfo>(value.get()); + return std::make_unique<DumpInfo>(value.get()); } bool FetchDumps(const std::string& lockfile_path, @@ -105,21 +104,21 @@ bool ClearDumps(const std::string& lockfile_path) { std::unique_ptr<base::ListValue> dump_list = - base::MakeUnique<base::ListValue>(); + std::make_unique<base::ListValue>(); return WriteLockFile(lockfile_path, dump_list.get()) == 0; } bool CreateFiles(const std::string& lockfile_path, const std::string& metadata_path) { std::unique_ptr<base::DictionaryValue> metadata = - base::MakeUnique<base::DictionaryValue>(); + std::make_unique<base::DictionaryValue>(); - auto ratelimit_fields = base::MakeUnique<base::DictionaryValue>(); + auto ratelimit_fields = std::make_unique<base::DictionaryValue>(); ratelimit_fields->SetDouble(kRatelimitPeriodStartKey, 0.0); ratelimit_fields->SetInteger(kRatelimitPeriodDumpsKey, 0); metadata->Set(kRatelimitKey, std::move(ratelimit_fields)); - std::unique_ptr<base::ListValue> dumps = base::MakeUnique<base::ListValue>(); + std::unique_ptr<base::ListValue> dumps = std::make_unique<base::ListValue>(); return WriteLockFile(lockfile_path, dumps.get()) == 0 && WriteMetadataFile(metadata_path, metadata.get());
diff --git a/chromecast/crash/linux/dump_info.cc b/chromecast/crash/linux/dump_info.cc index c3e4992b..82f325c 100644 --- a/chromecast/crash/linux/dump_info.cc +++ b/chromecast/crash/linux/dump_info.cc
@@ -8,7 +8,6 @@ #include <stdlib.h> #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/strings/stringprintf.h" #include "base/values.h" @@ -54,7 +53,7 @@ std::unique_ptr<base::Value> DumpInfo::GetAsValue() const { std::unique_ptr<base::Value> result = - base::MakeUnique<base::DictionaryValue>(); + std::make_unique<base::DictionaryValue>(); base::DictionaryValue* entry; result->GetAsDictionary(&entry); entry->SetString(kNameKey, params_.process_name);
diff --git a/chromecast/crash/linux/synchronized_minidump_manager.cc b/chromecast/crash/linux/synchronized_minidump_manager.cc index 710ed35..62149fb2 100644 --- a/chromecast/crash/linux/synchronized_minidump_manager.cc +++ b/chromecast/crash/linux/synchronized_minidump_manager.cc
@@ -11,13 +11,13 @@ #include <sys/file.h> #include <unistd.h> +#include <memory> #include <string> #include <utility> #include "base/files/dir_reader_posix.h" #include "base/files/file_util.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/posix/eintr_wrapper.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_split.h" @@ -274,7 +274,7 @@ std::vector<std::string> lines = base::SplitString( lockfile, "\n", base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY); - std::unique_ptr<base::ListValue> dumps = base::MakeUnique<base::ListValue>(); + std::unique_ptr<base::ListValue> dumps = std::make_unique<base::ListValue>(); // Validate dumps for (const std::string& line : lines) { @@ -317,14 +317,14 @@ bool SynchronizedMinidumpManager::InitializeFiles() { std::unique_ptr<base::DictionaryValue> metadata = - base::MakeUnique<base::DictionaryValue>(); + std::make_unique<base::DictionaryValue>(); - auto ratelimit_fields = base::MakeUnique<base::DictionaryValue>(); + auto ratelimit_fields = std::make_unique<base::DictionaryValue>(); ratelimit_fields->SetDouble(kLockfileRatelimitPeriodStartKey, 0.0); ratelimit_fields->SetInteger(kLockfileRatelimitPeriodDumpsKey, 0); metadata->Set(kLockfileRatelimitKey, std::move(ratelimit_fields)); - std::unique_ptr<base::ListValue> dumps = base::MakeUnique<base::ListValue>(); + std::unique_ptr<base::ListValue> dumps = std::make_unique<base::ListValue>(); return WriteFiles(dumps.get(), metadata.get()); }
diff --git a/chromecast/crash/linux/synchronized_minidump_manager_unittest.cc b/chromecast/crash/linux/synchronized_minidump_manager_unittest.cc index 94a26487..18a072d 100644 --- a/chromecast/crash/linux/synchronized_minidump_manager_unittest.cc +++ b/chromecast/crash/linux/synchronized_minidump_manager_unittest.cc
@@ -250,7 +250,7 @@ // Test that the manager tried to log the entry and failed. SynchronizedMinidumpManagerSimple manager; - manager.SetDumpInfoToWrite(base::MakeUnique<DumpInfo>(&val)); + manager.SetDumpInfoToWrite(std::make_unique<DumpInfo>(&val)); ASSERT_TRUE(manager.DoWorkLocked()); ASSERT_FALSE(manager.add_entry_return_code()); @@ -270,7 +270,7 @@ // Write the first entry. SynchronizedMinidumpManagerSimple manager; manager.SetDumpInfoToWrite( - base::MakeUnique<DumpInfo>("dump1", "log1", now, params)); + std::make_unique<DumpInfo>("dump1", "log1", now, params)); ASSERT_TRUE(manager.DoWorkLocked()); ASSERT_TRUE(manager.add_entry_return_code()); @@ -281,7 +281,7 @@ // Write the second entry. manager.SetDumpInfoToWrite( - base::MakeUnique<DumpInfo>("dump2", "log2", now, params)); + std::make_unique<DumpInfo>("dump2", "log2", now, params)); ASSERT_TRUE(manager.DoWorkLocked()); ASSERT_TRUE(manager.add_entry_return_code()); @@ -302,7 +302,7 @@ const int sleep_time_ms = 100; SleepySynchronizedMinidumpManagerSimple sleepy_manager(sleep_time_ms); sleepy_manager.SetDumpInfoToWrite( - base::MakeUnique<DumpInfo>("dump", "log", now, params)); + std::make_unique<DumpInfo>("dump", "log", now, params)); base::Thread sleepy_thread("sleepy"); sleepy_thread.Start(); sleepy_thread.task_runner()->PostTask( @@ -320,7 +320,7 @@ // the dump. SynchronizedMinidumpManagerSimple manager; manager.SetDumpInfoToWrite( - base::MakeUnique<DumpInfo>("dump", "log", now, params)); + std::make_unique<DumpInfo>("dump", "log", now, params)); EXPECT_TRUE(manager.DoWorkLocked()); EXPECT_TRUE(manager.add_entry_return_code()); @@ -393,7 +393,7 @@ FakeSynchronizedMinidumpUploader uploader; SynchronizedMinidumpManagerSimple producer; producer.SetDumpInfoToWrite( - base::MakeUnique<DumpInfo>("dump1", "log1", now, params)); + std::make_unique<DumpInfo>("dump1", "log1", now, params)); const int max_dumps = SynchronizedMinidumpManager::kRatelimitPeriodMaxDumps; produce_dumps(&producer, max_dumps); @@ -409,7 +409,7 @@ FakeSynchronizedMinidumpUploader uploader; SynchronizedMinidumpManagerSimple producer; producer.SetDumpInfoToWrite( - base::MakeUnique<DumpInfo>("dump1", "log1", now, params)); + std::make_unique<DumpInfo>("dump1", "log1", now, params)); const int max_dumps = SynchronizedMinidumpManager::kRatelimitPeriodMaxDumps; produce_dumps(&producer, max_dumps + 1); @@ -429,7 +429,7 @@ FakeSynchronizedMinidumpUploader uploader; SynchronizedMinidumpManagerSimple producer; producer.SetDumpInfoToWrite( - base::MakeUnique<DumpInfo>("dump1", "log1", now, params)); + std::make_unique<DumpInfo>("dump1", "log1", now, params)); const int iters = 3; const int max_dumps = SynchronizedMinidumpManager::kRatelimitPeriodMaxDumps; @@ -475,7 +475,7 @@ FakeSynchronizedMinidumpUploader uploader; producer.SetDumpInfoToWrite( - base::MakeUnique<DumpInfo>("dump1", "log1", now, params)); + std::make_unique<DumpInfo>("dump1", "log1", now, params)); const int kNumDumps = 3; for (int i = 0; i < kNumDumps; ++i) {
diff --git a/chromecast/media/audio/cast_audio_manager.cc b/chromecast/media/audio/cast_audio_manager.cc index 97fc9c8..932e560 100644 --- a/chromecast/media/audio/cast_audio_manager.cc +++ b/chromecast/media/audio/cast_audio_manager.cc
@@ -5,10 +5,10 @@ #include "chromecast/media/audio/cast_audio_manager.h" #include <algorithm> +#include <memory> #include <string> #include "base/bind.h" -#include "base/memory/ptr_util.h" #include "chromecast/media/audio/cast_audio_mixer.h" #include "chromecast/media/audio/cast_audio_output_stream.h" #include "chromecast/media/cma/backend/media_pipeline_backend_factory.h" @@ -43,7 +43,7 @@ backend_factory_(std::move(backend_factory)), backend_task_runner_(std::move(backend_task_runner)) { if (use_mixer) - mixer_ = base::MakeUnique<CastAudioMixer>(this); + mixer_ = std::make_unique<CastAudioMixer>(this); } CastAudioManager::~CastAudioManager() = default;
diff --git a/chromecast/media/audio/cast_audio_manager_alsa_unittest.cc b/chromecast/media/audio/cast_audio_manager_alsa_unittest.cc index f2aca60..a878f0103 100644 --- a/chromecast/media/audio/cast_audio_manager_alsa_unittest.cc +++ b/chromecast/media/audio/cast_audio_manager_alsa_unittest.cc
@@ -4,6 +4,8 @@ #include "chromecast/media/audio/cast_audio_manager_alsa.h" +#include <memory> + #include "base/memory/ptr_util.h" #include "base/test/test_message_loop.h" #include "chromecast/media/cma/test/mock_media_pipeline_backend_factory.h" @@ -38,8 +40,8 @@ CHECK(media_thread_.Start()); backend_factory_ = new MockMediaPipelineBackendFactory(); - audio_manager_ = base::MakeUnique<CastAudioManagerAlsa>( - base::MakeUnique<::media::TestAudioThread>(), &audio_log_factory_, + audio_manager_ = std::make_unique<CastAudioManagerAlsa>( + std::make_unique<::media::TestAudioThread>(), &audio_log_factory_, base::WrapUnique(backend_factory_), media_thread_.task_runner(), false); }
diff --git a/chromecast/media/audio/cast_audio_manager_unittest.cc b/chromecast/media/audio/cast_audio_manager_unittest.cc index ef8ea959..71cc4f2 100644 --- a/chromecast/media/audio/cast_audio_manager_unittest.cc +++ b/chromecast/media/audio/cast_audio_manager_unittest.cc
@@ -4,6 +4,8 @@ #include "chromecast/media/audio/cast_audio_manager.h" +#include <memory> + #include "base/memory/ptr_util.h" #include "base/test/test_message_loop.h" #include "chromecast/media/cma/test/mock_media_pipeline_backend.h" @@ -35,8 +37,8 @@ CHECK(media_thread_.Start()); backend_factory_ = new MockMediaPipelineBackendFactory(); - audio_manager_ = base::MakeUnique<CastAudioManager>( - base::MakeUnique<::media::TestAudioThread>(), &audio_log_factory_, + audio_manager_ = std::make_unique<CastAudioManager>( + std::make_unique<::media::TestAudioThread>(), &audio_log_factory_, base::WrapUnique(backend_factory_), media_thread_.task_runner(), false); } @@ -57,7 +59,7 @@ EXPECT_CALL(audio_decoder, SetDelegate(_)).Times(1); EXPECT_CALL(audio_decoder, SetConfig(_)).WillOnce(Return(true)); - auto backend = base::MakeUnique<StrictMock<MockMediaPipelineBackend>>(); + auto backend = std::make_unique<StrictMock<MockMediaPipelineBackend>>(); EXPECT_CALL(*backend, CreateAudioDecoder()).WillOnce(Return(&audio_decoder)); EXPECT_CALL(*backend, Initialize()).WillOnce(Return(true));
diff --git a/chromecast/media/audio/cast_audio_mixer.cc b/chromecast/media/audio/cast_audio_mixer.cc index 80782aa..9033ea7 100644 --- a/chromecast/media/audio/cast_audio_mixer.cc +++ b/chromecast/media/audio/cast_audio_mixer.cc
@@ -6,7 +6,6 @@ #include "base/bind.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/stl_util.h" #include "chromecast/media/audio/cast_audio_manager.h" #include "chromecast/media/audio/cast_audio_output_stream.h" @@ -122,7 +121,7 @@ return; source_callback_ = source_callback; proxy_ = - base::MakeUnique<ResamplerProxy>(this, input_params_, output_params_); + std::make_unique<ResamplerProxy>(this, input_params_, output_params_); audio_mixer_->AddInput(proxy_.get()); }
diff --git a/chromecast/media/audio/cast_audio_mixer_unittest.cc b/chromecast/media/audio/cast_audio_mixer_unittest.cc index 131c087..c53ebc7 100644 --- a/chromecast/media/audio/cast_audio_mixer_unittest.cc +++ b/chromecast/media/audio/cast_audio_mixer_unittest.cc
@@ -11,7 +11,6 @@ #include <vector> #include "base/bind.h" -#include "base/memory/ptr_util.h" #include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "base/time/time.h" @@ -91,7 +90,7 @@ class MockCastAudioManager : public CastAudioManager { public: MockCastAudioManager() - : CastAudioManager(base::MakeUnique<::media::TestAudioThread>(), + : CastAudioManager(std::make_unique<::media::TestAudioThread>(), nullptr, nullptr, nullptr,
diff --git a/chromecast/media/audio/cast_audio_output_stream.cc b/chromecast/media/audio/cast_audio_output_stream.cc index d5eeb0e..adfb153 100644 --- a/chromecast/media/audio/cast_audio_output_stream.cc +++ b/chromecast/media/audio/cast_audio_output_stream.cc
@@ -279,7 +279,7 @@ bool success = false; DCHECK(!backend_); - backend_ = base::MakeUnique<Backend>(audio_params_); + backend_ = std::make_unique<Backend>(audio_params_); { base::WaitableEvent completion_event( base::WaitableEvent::ResetPolicy::AUTOMATIC,
diff --git a/chromecast/media/audio/cast_audio_output_stream_unittest.cc b/chromecast/media/audio/cast_audio_output_stream_unittest.cc index e62e493a..ff66739 100644 --- a/chromecast/media/audio/cast_audio_output_stream_unittest.cc +++ b/chromecast/media/audio/cast_audio_output_stream_unittest.cc
@@ -153,7 +153,7 @@ // MediaPipelineBackend implementation: AudioDecoder* CreateAudioDecoder() override { DCHECK(!audio_decoder_); - audio_decoder_ = base::MakeUnique<FakeAudioDecoder>(params_); + audio_decoder_ = std::make_unique<FakeAudioDecoder>(params_); return audio_decoder_.get(); } VideoDecoder* CreateVideoDecoder() override { @@ -211,14 +211,14 @@ CHECK(media_thread_.Start()); auto backend_factory = - base::MakeUnique<NiceMock<MockMediaPipelineBackendFactory>>(); + std::make_unique<NiceMock<MockMediaPipelineBackendFactory>>(); ON_CALL(*backend_factory, CreateBackend(_)) .WillByDefault(Invoke([this](const MediaPipelineDeviceParams& params) { media_pipeline_backend_ = new FakeMediaPipelineBackend(params); return base::WrapUnique(media_pipeline_backend_); })); - audio_manager_ = base::MakeUnique<CastAudioManager>( - base::MakeUnique<::media::TestAudioThread>(), nullptr, + audio_manager_ = std::make_unique<CastAudioManager>( + std::make_unique<::media::TestAudioThread>(), nullptr, std::move(backend_factory), media_thread_.task_runner(), false); }
diff --git a/chromecast/media/base/slew_volume_unittests.cc b/chromecast/media/base/slew_volume_unittests.cc index 8e4d580..21c2acb 100644 --- a/chromecast/media/base/slew_volume_unittests.cc +++ b/chromecast/media/base/slew_volume_unittests.cc
@@ -5,11 +5,11 @@ #include <cmath> #include <cstdint> #include <limits> +#include <memory> #include <vector> #include "base/logging.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "chromecast/media/base/slew_volume.h" #include "media/base/audio_bus.h" #include "media/base/vector_math.h" @@ -84,7 +84,7 @@ ~SlewVolumeBaseTest() override = default; void SetUp() override { - slew_volume_ = base::MakeUnique<SlewVolume>(); + slew_volume_ = std::make_unique<SlewVolume>(); slew_volume_->Interrupted(); MakeData(kNumFrames); } @@ -450,7 +450,7 @@ ~SlewVolumeInterleavedTest() override = default; void SetUp() override { - slew_volume_ = base::MakeUnique<SlewVolume>(); + slew_volume_ = std::make_unique<SlewVolume>(); slew_volume_->Interrupted(); channels_ = std::get<0>(GetParam());
diff --git a/chromecast/media/cdm/cast_cdm.cc b/chromecast/media/cdm/cast_cdm.cc index 627b0eea..a8d6d81 100644 --- a/chromecast/media/cdm/cast_cdm.cc +++ b/chromecast/media/cdm/cast_cdm.cc
@@ -4,11 +4,11 @@ #include "chromecast/media/cdm/cast_cdm.h" +#include <memory> #include <utility> #include "base/bind.h" #include "base/location.h" -#include "base/memory/ptr_util.h" #include "base/single_thread_task_runner.h" #include "base/threading/thread_task_runner_handle.h" #include "chromecast/media/base/decrypt_context_impl.h" @@ -197,7 +197,7 @@ ::media::CdmKeysInfo* keys_info) { DCHECK(keys_info); for (const std::pair<std::string, std::string>& key : keys) { - keys_info->push_back(base::MakeUnique<::media::CdmKeyInformation>( + keys_info->push_back(std::make_unique<::media::CdmKeyInformation>( key.first, ::media::CdmKeyInformation::USABLE, 0)); } }
diff --git a/chromecast/media/cma/backend/alsa/stream_mixer_unittest.cc b/chromecast/media/cma/backend/alsa/stream_mixer_unittest.cc index bae591b..8f1ef87 100644 --- a/chromecast/media/cma/backend/alsa/stream_mixer_unittest.cc +++ b/chromecast/media/cma/backend/alsa/stream_mixer_unittest.cc
@@ -7,6 +7,7 @@ #include <algorithm> #include <cmath> #include <limits> +#include <memory> #include <unordered_map> #include <utility> @@ -362,7 +363,7 @@ const std::string& name, const base::ListValue* filter_description_list, int channels) override { - return base::MakeUnique<testing::NiceMock<MockPostProcessor>>( + return std::make_unique<testing::NiceMock<MockPostProcessor>>( name, filter_description_list, channels); } };
diff --git a/chromecast/media/cma/backend/desktop/audio_decoder_desktop.cc b/chromecast/media/cma/backend/desktop/audio_decoder_desktop.cc index 8d381a4..0b83eb0 100644 --- a/chromecast/media/cma/backend/desktop/audio_decoder_desktop.cc +++ b/chromecast/media/cma/backend/desktop/audio_decoder_desktop.cc
@@ -4,7 +4,6 @@ #include "chromecast/media/cma/backend/desktop/audio_decoder_desktop.h" -#include "base/memory/ptr_util.h" #include "chromecast/media/cma/backend/desktop/media_sink_desktop.h" namespace chromecast { @@ -16,7 +15,7 @@ void AudioDecoderDesktop::Start(base::TimeDelta start_pts) { DCHECK(!sink_); - sink_ = base::MakeUnique<MediaSinkDesktop>(delegate_, start_pts); + sink_ = std::make_unique<MediaSinkDesktop>(delegate_, start_pts); } void AudioDecoderDesktop::Stop() {
diff --git a/chromecast/media/cma/backend/desktop/media_pipeline_backend_desktop.cc b/chromecast/media/cma/backend/desktop/media_pipeline_backend_desktop.cc index bf1c387..e05e5b6 100644 --- a/chromecast/media/cma/backend/desktop/media_pipeline_backend_desktop.cc +++ b/chromecast/media/cma/backend/desktop/media_pipeline_backend_desktop.cc
@@ -5,7 +5,6 @@ #include "chromecast/media/cma/backend/desktop/media_pipeline_backend_desktop.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "chromecast/media/cma/backend/desktop/audio_decoder_desktop.h" #include "chromecast/media/cma/backend/desktop/video_decoder_desktop.h" #include "media/base/timestamp_constants.h" @@ -22,7 +21,7 @@ MediaPipelineBackendDesktop::CreateAudioDecoder() { DCHECK_EQ(kStateUninitialized, state_); DCHECK(!audio_decoder_); - audio_decoder_ = base::MakeUnique<AudioDecoderDesktop>(); + audio_decoder_ = std::make_unique<AudioDecoderDesktop>(); return audio_decoder_.get(); } @@ -30,7 +29,7 @@ MediaPipelineBackendDesktop::CreateVideoDecoder() { DCHECK_EQ(kStateUninitialized, state_); DCHECK(!video_decoder_); - video_decoder_ = base::MakeUnique<VideoDecoderDesktop>(); + video_decoder_ = std::make_unique<VideoDecoderDesktop>(); return video_decoder_.get(); }
diff --git a/chromecast/media/cma/backend/desktop/video_decoder_desktop.cc b/chromecast/media/cma/backend/desktop/video_decoder_desktop.cc index da6349d9..32112a1 100644 --- a/chromecast/media/cma/backend/desktop/video_decoder_desktop.cc +++ b/chromecast/media/cma/backend/desktop/video_decoder_desktop.cc
@@ -4,7 +4,6 @@ #include "chromecast/media/cma/backend/desktop/video_decoder_desktop.h" -#include "base/memory/ptr_util.h" #include "chromecast/media/cma/backend/desktop/media_sink_desktop.h" namespace chromecast { @@ -16,7 +15,7 @@ void VideoDecoderDesktop::Start(base::TimeDelta start_pts) { DCHECK(!sink_); - sink_ = base::MakeUnique<MediaSinkDesktop>(delegate_, start_pts); + sink_ = std::make_unique<MediaSinkDesktop>(delegate_, start_pts); } void VideoDecoderDesktop::Stop() {
diff --git a/chromecast/media/cma/backend/media_pipeline_backend_manager.cc b/chromecast/media/cma/backend/media_pipeline_backend_manager.cc index 0fa39359..d143f23 100644 --- a/chromecast/media/cma/backend/media_pipeline_backend_manager.cc +++ b/chromecast/media/cma/backend/media_pipeline_backend_manager.cc
@@ -9,7 +9,6 @@ #include "base/bind.h" #include "base/location.h" -#include "base/memory/ptr_util.h" #include "base/time/time.h" #include "chromecast/base/metrics/cast_metrics_helper.h" #include "chromecast/chromecast_features.h" @@ -70,7 +69,7 @@ MediaPipelineBackendManager::CreateMediaPipelineBackend( const media::MediaPipelineDeviceParams& params) { DCHECK(media_task_runner_->BelongsToCurrentThread()); - return base::MakeUnique<MediaPipelineBackendWrapper>(params, this); + return std::make_unique<MediaPipelineBackendWrapper>(params, this); } bool MediaPipelineBackendManager::IncrementDecoderCount(DecoderType type) {
diff --git a/chromecast/media/cma/backend/media_pipeline_backend_wrapper.cc b/chromecast/media/cma/backend/media_pipeline_backend_wrapper.cc index 72b1949c..1e9a077 100644 --- a/chromecast/media/cma/backend/media_pipeline_backend_wrapper.cc +++ b/chromecast/media/cma/backend/media_pipeline_backend_wrapper.cc
@@ -74,7 +74,7 @@ delegate = backend_manager_->buffer_delegate(); } - audio_decoder_ = base::MakeUnique<AudioDecoderWrapper>( + audio_decoder_ = std::make_unique<AudioDecoderWrapper>( backend_manager_, real_decoder, content_type_, delegate); return audio_decoder_.get(); }
diff --git a/chromecast/media/cma/backend/multizone_backend_unittest.cc b/chromecast/media/cma/backend/multizone_backend_unittest.cc index 66ec578..e4e5301c 100644 --- a/chromecast/media/cma/backend/multizone_backend_unittest.cc +++ b/chromecast/media/cma/backend/multizone_backend_unittest.cc
@@ -14,7 +14,6 @@ #include "base/bind_helpers.h" #include "base/command_line.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/memory/ref_counted.h" #include "base/message_loop/message_loop.h" #include "base/run_loop.h" @@ -324,7 +323,7 @@ config.bytes_per_channel = 4; config.samples_per_second = sample_rate; - audio_feeder_ = base::MakeUnique<BufferFeeder>( + audio_feeder_ = std::make_unique<BufferFeeder>( config, false /* effects_only */, base::BindOnce(&MultizoneBackendTest::OnEndOfStream, base::Unretained(this)), @@ -341,7 +340,7 @@ effects_config.samples_per_second = 48000; for (int i = 0; i < kNumEffectsStreams; ++i) { - auto feeder = base::MakeUnique<BufferFeeder>( + auto feeder = std::make_unique<BufferFeeder>( effects_config, true /* effects_only */, base::BindOnce(&IgnoreEos), 0); feeder->Initialize(); effects_feeders_.push_back(std::move(feeder));
diff --git a/chromecast/media/cma/backend/post_processing_pipeline_impl.cc b/chromecast/media/cma/backend/post_processing_pipeline_impl.cc index b5f18e7..18b49f17 100644 --- a/chromecast/media/cma/backend/post_processing_pipeline_impl.cc +++ b/chromecast/media/cma/backend/post_processing_pipeline_impl.cc
@@ -8,7 +8,6 @@ #include <string> #include "base/files/file_path.h" -#include "base/memory/ptr_util.h" #include "base/scoped_native_library.h" #include "base/values.h" #include "chromecast/base/serializers.h" @@ -36,7 +35,7 @@ const std::string& name, const base::ListValue* filter_description_list, int num_channels) { - return base::MakeUnique<PostProcessingPipelineImpl>( + return std::make_unique<PostProcessingPipelineImpl>( name, filter_description_list, num_channels); }
diff --git a/chromecast/media/cma/backend/post_processors/governor_unittest.cc b/chromecast/media/cma/backend/post_processors/governor_unittest.cc index f1661cf7..42fc63a 100644 --- a/chromecast/media/cma/backend/post_processors/governor_unittest.cc +++ b/chromecast/media/cma/backend/post_processors/governor_unittest.cc
@@ -10,7 +10,6 @@ #include <vector> #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/strings/stringprintf.h" #include "chromecast/media/cma/backend/post_processors/governor.h" #include "chromecast/media/cma/backend/post_processors/post_processor_benchmark.h" @@ -51,7 +50,7 @@ clamp_ = kDefaultClamp; onset_volume_ = GetParam(); std::string config = MakeConfigString(onset_volume_, clamp_); - governor_ = base::MakeUnique<Governor>(config, kNumChannels); + governor_ = std::make_unique<Governor>(config, kNumChannels); governor_->SetSlewTimeMsForTest(0); governor_->SetSampleRate(kSampleRate);
diff --git a/chromecast/media/cma/base/multi_demuxer_stream_adapter_unittest.cc b/chromecast/media/cma/base/multi_demuxer_stream_adapter_unittest.cc index 21fe8d7..da685f7 100644 --- a/chromecast/media/cma/base/multi_demuxer_stream_adapter_unittest.cc +++ b/chromecast/media/cma/base/multi_demuxer_stream_adapter_unittest.cc
@@ -7,7 +7,6 @@ #include "base/bind.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/memory/ref_counted.h" #include "base/message_loop/message_loop.h" #include "base/run_loop.h" @@ -93,7 +92,7 @@ frame_received_count_ = 0; for (const auto& stream : demuxer_streams_) { - coded_frame_providers_.push_back(base::MakeUnique<DemuxerStreamAdapter>( + coded_frame_providers_.push_back(std::make_unique<DemuxerStreamAdapter>( base::ThreadTaskRunnerHandle::Get(), media_task_runner_factory_, stream.get())); } @@ -154,9 +153,9 @@ frame_count_short + kMaxPtsDiffMs / DemuxerStreamForTest::kDemuxerStreamForTestFrameDuration + 100; - demuxer_streams_.push_back(base::MakeUnique<DemuxerStreamForTest>( + demuxer_streams_.push_back(std::make_unique<DemuxerStreamForTest>( frame_count_short, 2, 0, config_idx_)); - demuxer_streams_.push_back(base::MakeUnique<DemuxerStreamForTest>( + demuxer_streams_.push_back(std::make_unique<DemuxerStreamForTest>( frame_count_long, 10, 0, config_idx_)); total_expected_frames_ = frame_count_short + frame_count_long;
diff --git a/chromecast/media/cma/pipeline/audio_video_pipeline_impl_unittest.cc b/chromecast/media/cma/pipeline/audio_video_pipeline_impl_unittest.cc index bf1ec851..bf019a5 100644 --- a/chromecast/media/cma/pipeline/audio_video_pipeline_impl_unittest.cc +++ b/chromecast/media/cma/pipeline/audio_video_pipeline_impl_unittest.cc
@@ -128,7 +128,7 @@ .WillByDefault(PushBuffer(&video_decoder_delegate_, &last_push_pts_[STREAM_VIDEO])); - media_pipeline_ = base::MakeUnique<MediaPipelineImpl>(); + media_pipeline_ = std::make_unique<MediaPipelineImpl>(); media_pipeline_->Initialize(kLoadTypeURL, base::WrapUnique(pipeline_backend_));
diff --git a/chromecast/media/service/cast_mojo_media_client.cc b/chromecast/media/service/cast_mojo_media_client.cc index 468a40e..c50f9bde 100644 --- a/chromecast/media/service/cast_mojo_media_client.cc +++ b/chromecast/media/service/cast_mojo_media_client.cc
@@ -4,7 +4,8 @@ #include "chromecast/media/service/cast_mojo_media_client.h" -#include "base/memory/ptr_util.h" +#include <memory> + #include "chromecast/media/cma/backend/media_pipeline_backend_factory.h" #include "chromecast/media/service/cast_renderer.h" #include "chromecast/public/media/media_pipeline_backend.h" @@ -82,7 +83,7 @@ const gfx::ColorSpace& target_color_space) final { DCHECK(audio_renderer_sink); DCHECK(!video_renderer_sink); - return base::MakeUnique<CastRenderer>( + return std::make_unique<CastRenderer>( backend_factory_, media_task_runner, audio_renderer_sink->GetOutputDeviceInfo().device_id(), video_mode_switcher_, video_resolution_policy_, @@ -129,7 +130,7 @@ std::unique_ptr<::media::RendererFactory> CastMojoMediaClient::CreateRendererFactory(::media::MediaLog* /* media_log */) { - return base::MakeUnique<CastRendererFactory>( + return std::make_unique<CastRendererFactory>( backend_factory_, video_mode_switcher_, video_resolution_policy_, media_resource_tracker_); }
diff --git a/chromecast/net/fake_stream_socket.cc b/chromecast/net/fake_stream_socket.cc index 4b6df1f..1e81cf1 100644 --- a/chromecast/net/fake_stream_socket.cc +++ b/chromecast/net/fake_stream_socket.cc
@@ -10,7 +10,6 @@ #include "base/callback_helpers.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "net/base/io_buffer.h" #include "net/base/net_errors.h" #include "net/socket/next_proto.h" @@ -76,7 +75,7 @@ FakeStreamSocket::FakeStreamSocket(const net::IPEndPoint& local_address) : local_address_(local_address), - buffer_(base::MakeUnique<SocketBuffer>()), + buffer_(std::make_unique<SocketBuffer>()), peer_(nullptr) {} FakeStreamSocket::~FakeStreamSocket() {
diff --git a/chromeos/CHROMEOS_LKGM b/chromeos/CHROMEOS_LKGM index c4c4e78..b3f9517 100644 --- a/chromeos/CHROMEOS_LKGM +++ b/chromeos/CHROMEOS_LKGM
@@ -1 +1 @@ -10309.0.0 \ No newline at end of file +10320.0.0 \ No newline at end of file
diff --git a/components/autofill/android/autofill_provider_android.cc b/components/autofill/android/autofill_provider_android.cc index 2fdb69565..5d3d325f 100644 --- a/components/autofill/android/autofill_provider_android.cc +++ b/components/autofill/android/autofill_provider_android.cc
@@ -31,7 +31,7 @@ AutofillProviderAndroid::AutofillProviderAndroid( const JavaRef<jobject>& jcaller, content::WebContents* web_contents) - : id_(kNoQueryId), web_contents_(web_contents) { + : id_(kNoQueryId), web_contents_(web_contents), check_submission_(false) { JNIEnv* env = AttachCurrentThread(); java_ref_ = JavaObjectWeakGlobalRef(env, jcaller); Java_AutofillProvider_setNativeAutofillProvider( @@ -147,20 +147,28 @@ transformed_bounding.width(), transformed_bounding.height()); } -bool AutofillProviderAndroid::OnWillSubmitForm( - AutofillHandlerProxy* handler, - const FormData& form, - const base::TimeTicks timestamp) { +void AutofillProviderAndroid::FireSuccessfulSubmission() { + JNIEnv* env = AttachCurrentThread(); + ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); + if (obj.is_null()) + return; + Java_AutofillProvider_onWillSubmitForm(env, obj); + Reset(); +} + +bool AutofillProviderAndroid::OnFormSubmitted(AutofillHandlerProxy* handler, + const FormData& form, + bool known_success, + SubmissionSource source, + base::TimeTicks timestamp) { DCHECK_CURRENTLY_ON(BrowserThread::UI); if (!IsCurrentlyLinkedHandler(handler) || !IsCurrentlyLinkedForm(form)) return false; - JNIEnv* env = AttachCurrentThread(); - ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); - if (obj.is_null()) - return false; - Java_AutofillProvider_onWillSubmitForm(env, obj); - Reset(); + if (known_success || source == SubmissionSource::FORM_SUBMISSION) + FireSuccessfulSubmission(); + + check_submission_ = true; return true; } @@ -222,6 +230,27 @@ Java_AutofillProvider_onDidFillAutofillFormData(env, obj); } +void AutofillProviderAndroid::OnFormsSeen(AutofillHandlerProxy* handler, + const std::vector<FormData>& forms, + const base::TimeTicks) { + if (!check_submission_) + return; + + if (handler != handler_.get()) + return; + + if (form_.get() == nullptr) + return; + + for (auto const& form : forms) { + if (form_->SimilarFormAs(form)) + return; + } + // The form_ disappeared after it was submitted, we consider the submission + // succeeded. + FireSuccessfulSubmission(); +} + void AutofillProviderAndroid::Reset(AutofillHandlerProxy* handler) { DCHECK_CURRENTLY_ON(BrowserThread::UI); if (handler == handler_.get()) { @@ -255,6 +284,7 @@ void AutofillProviderAndroid::Reset() { form_.reset(nullptr); id_ = kNoQueryId; + check_submission_ = false; } } // namespace autofill
diff --git a/components/autofill/android/autofill_provider_android.h b/components/autofill/android/autofill_provider_android.h index 463aa1b..0c2c1cc 100644 --- a/components/autofill/android/autofill_provider_android.h +++ b/components/autofill/android/autofill_provider_android.h
@@ -40,9 +40,11 @@ const FormData& form, const FormFieldData& field, const gfx::RectF& bounding_box) override; - bool OnWillSubmitForm(AutofillHandlerProxy* handler, - const FormData& form, - const base::TimeTicks timestamp) override; + bool OnFormSubmitted(AutofillHandlerProxy* handler, + const FormData& form, + bool known_success, + SubmissionSource source, + base::TimeTicks timestamp) override; void OnFocusNoLongerOnForm(AutofillHandlerProxy* handler) override; void OnFocusOnFormField(AutofillHandlerProxy* handler, const FormData& form, @@ -51,12 +53,17 @@ void OnDidFillAutofillFormData(AutofillHandlerProxy* handler, const FormData& form, base::TimeTicks timestamp) override; + void OnFormsSeen(AutofillHandlerProxy* handler, + const std::vector<FormData>& forms, + const base::TimeTicks timestamp) override; + void Reset(AutofillHandlerProxy* handler) override; // Methods called by Java. void OnAutofillAvailable(JNIEnv* env, jobject jcaller, jobject form_data); private: + void FireSuccessfulSubmission(); void OnFocusChanged(bool focus_on_form, size_t index, const gfx::RectF& bounding_box); @@ -74,6 +81,7 @@ base::WeakPtr<AutofillHandlerProxy> handler_; JavaObjectWeakGlobalRef java_ref_; content::WebContents* web_contents_; + bool check_submission_; DISALLOW_COPY_AND_ASSIGN(AutofillProviderAndroid); };
diff --git a/components/autofill/content/browser/content_autofill_driver.cc b/components/autofill/content/browser/content_autofill_driver.cc index 5a5f7f8..71f4284a 100644 --- a/components/autofill/content/browser/content_autofill_driver.cc +++ b/components/autofill/content/browser/content_autofill_driver.cc
@@ -192,13 +192,11 @@ autofill_handler_->OnFormsSeen(forms, timestamp); } -void ContentAutofillDriver::WillSubmitForm(const FormData& form, - base::TimeTicks timestamp) { - autofill_handler_->OnWillSubmitForm(form, timestamp); -} - -void ContentAutofillDriver::FormSubmitted(const FormData& form) { - autofill_handler_->OnFormSubmitted(form); +void ContentAutofillDriver::FormSubmitted(const FormData& form, + bool known_success, + SubmissionSource source, + base::TimeTicks timestamp) { + autofill_handler_->OnFormSubmitted(form, known_success, source, timestamp); } void ContentAutofillDriver::TextFieldDidChange(const FormData& form,
diff --git a/components/autofill/content/browser/content_autofill_driver.h b/components/autofill/content/browser/content_autofill_driver.h index 624f87bb1..17758e4 100644 --- a/components/autofill/content/browser/content_autofill_driver.h +++ b/components/autofill/content/browser/content_autofill_driver.h
@@ -74,8 +74,10 @@ // mojom::AutofillDriver: void FormsSeen(const std::vector<FormData>& forms, base::TimeTicks timestamp) override; - void WillSubmitForm(const FormData& form, base::TimeTicks timestamp) override; - void FormSubmitted(const FormData& form) override; + void FormSubmitted(const FormData& form, + bool known_success, + SubmissionSource source, + base::TimeTicks timestamp) override; void TextFieldDidChange(const FormData& form, const FormFieldData& field, const gfx::RectF& bounding_box,
diff --git a/components/autofill/content/common/autofill_driver.mojom b/components/autofill/content/common/autofill_driver.mojom index e3a18f08..1e6f108 100644 --- a/components/autofill/content/common/autofill_driver.mojom +++ b/components/autofill/content/common/autofill_driver.mojom
@@ -18,11 +18,13 @@ // filling/submitting by the AutofillManager. FormsSeen(array<FormData> forms, mojo.common.mojom.TimeTicks timestamp); - // Notification that a form is about to be submitted. The user hit the button. - WillSubmitForm(FormData form, mojo.common.mojom.TimeTicks timestamp); - - // Notification that a form has been submitted. - FormSubmitted(FormData form); + // Notification that a form has been submitted. The |known_success| indicates + // whether the submission succeeded or not. Currently, we assume submission + // succeeds if the form is removed. + FormSubmitted(FormData form, + bool known_success, + SubmissionSource source, + mojo.common.mojom.TimeTicks timestamp); // Notification that a form field's value has changed. TextFieldDidChange(FormData form,
diff --git a/components/autofill/content/common/autofill_types.mojom b/components/autofill/content/common/autofill_types.mojom index 3875697..3a6fa9e 100644 --- a/components/autofill/content/common/autofill_types.mojom +++ b/components/autofill/content/common/autofill_types.mojom
@@ -75,6 +75,16 @@ PREDICTION_NOT_PASSWORD }; +// autofill::SubmissionSource +enum SubmissionSource { + SAME_DOCUMENT_NAVIGATION, + XHR_SUCCEEDED, + FRAME_DETACHED, + DOM_MUTATION_AFTER_XHR, + PROBABLY_FORM_SUBMITTED, + FORM_SUBMISSION, +}; + // autofill::FormFieldData struct FormFieldData { string label;
diff --git a/components/autofill/content/common/autofill_types.typemap b/components/autofill/content/common/autofill_types.typemap index 4b2a90b9..775d6e5 100644 --- a/components/autofill/content/common/autofill_types.typemap +++ b/components/autofill/content/common/autofill_types.typemap
@@ -12,6 +12,7 @@ "//components/autofill/core/common/password_form_field_prediction_map.h", "//components/autofill/core/common/password_form_fill_data.h", "//components/autofill/core/common/password_form_generation_data.h", + "//components/autofill/core/common/submission_source.h", ] traits_headers = [ "//components/autofill/content/common/autofill_types_struct_traits.h" ] @@ -44,4 +45,5 @@ "autofill.mojom.RoleAttribute=autofill::FormFieldData::RoleAttribute", "autofill.mojom.PossibleUsernamePair=autofill::PossibleUsernamePair", "autofill.mojom.PasswordFormSubmissionIndicatorEvent=autofill::PasswordForm::SubmissionIndicatorEvent", + "autofill.mojom.SubmissionSource=autofill::SubmissionSource", ]
diff --git a/components/autofill/content/common/autofill_types_struct_traits.cc b/components/autofill/content/common/autofill_types_struct_traits.cc index ccfdf58..953a983 100644 --- a/components/autofill/content/common/autofill_types_struct_traits.cc +++ b/components/autofill/content/common/autofill_types_struct_traits.cc
@@ -417,6 +417,56 @@ } // static +autofill::mojom::SubmissionSource EnumTraits< + autofill::mojom::SubmissionSource, + autofill::SubmissionSource>::ToMojom(autofill::SubmissionSource input) { + switch (input) { + case autofill::SubmissionSource::SAME_DOCUMENT_NAVIGATION: + return autofill::mojom::SubmissionSource::SAME_DOCUMENT_NAVIGATION; + case autofill::SubmissionSource::XHR_SUCCEEDED: + return autofill::mojom::SubmissionSource::XHR_SUCCEEDED; + case autofill::SubmissionSource::FRAME_DETACHED: + return autofill::mojom::SubmissionSource::FRAME_DETACHED; + case autofill::SubmissionSource::DOM_MUTATION_AFTER_XHR: + return autofill::mojom::SubmissionSource::DOM_MUTATION_AFTER_XHR; + case autofill::SubmissionSource::PROBABLY_FORM_SUBMITTED: + return autofill::mojom::SubmissionSource::PROBABLY_FORM_SUBMITTED; + case autofill::SubmissionSource::FORM_SUBMISSION: + return autofill::mojom::SubmissionSource::FORM_SUBMISSION; + } + NOTREACHED(); + return autofill::mojom::SubmissionSource::FORM_SUBMISSION; +} + +// static +bool EnumTraits<autofill::mojom::SubmissionSource, autofill::SubmissionSource>:: + FromMojom(autofill::mojom::SubmissionSource input, + autofill::SubmissionSource* output) { + switch (input) { + case autofill::mojom::SubmissionSource::SAME_DOCUMENT_NAVIGATION: + *output = autofill::SubmissionSource::SAME_DOCUMENT_NAVIGATION; + return true; + case autofill::mojom::SubmissionSource::XHR_SUCCEEDED: + *output = autofill::SubmissionSource::XHR_SUCCEEDED; + return true; + case autofill::mojom::SubmissionSource::FRAME_DETACHED: + *output = autofill::SubmissionSource::FRAME_DETACHED; + return true; + case autofill::mojom::SubmissionSource::DOM_MUTATION_AFTER_XHR: + *output = autofill::SubmissionSource::DOM_MUTATION_AFTER_XHR; + return true; + case autofill::mojom::SubmissionSource::PROBABLY_FORM_SUBMITTED: + *output = autofill::SubmissionSource::PROBABLY_FORM_SUBMITTED; + return true; + case autofill::mojom::SubmissionSource::FORM_SUBMISSION: + *output = autofill::SubmissionSource::FORM_SUBMISSION; + return true; + } + NOTREACHED(); + return false; +} + +// static bool StructTraits< autofill::mojom::FormFieldDataDataView, autofill::FormFieldData>::Read(autofill::mojom::FormFieldDataDataView data,
diff --git a/components/autofill/content/common/autofill_types_struct_traits.h b/components/autofill/content/common/autofill_types_struct_traits.h index 4fa2266f..bcdd9bf 100644 --- a/components/autofill/content/common/autofill_types_struct_traits.h +++ b/components/autofill/content/common/autofill_types_struct_traits.h
@@ -18,6 +18,7 @@ #include "components/autofill/core/common/password_form_field_prediction_map.h" #include "components/autofill/core/common/password_form_fill_data.h" #include "components/autofill/core/common/password_form_generation_data.h" +#include "components/autofill/core/common/submission_source.h" #include "mojo/public/cpp/bindings/struct_traits.h" #include "url/origin.h" @@ -97,6 +98,15 @@ }; template <> +struct EnumTraits<autofill::mojom::SubmissionSource, + autofill::SubmissionSource> { + static autofill::mojom::SubmissionSource ToMojom( + autofill::SubmissionSource input); + static bool FromMojom(autofill::mojom::SubmissionSource input, + autofill::SubmissionSource* output); +}; + +template <> struct StructTraits<autofill::mojom::FormFieldDataDataView, autofill::FormFieldData> { static const base::string16& label(const autofill::FormFieldData& r) {
diff --git a/components/autofill/content/renderer/autofill_agent.cc b/components/autofill/content/renderer/autofill_agent.cc index b7ce07a..f9fd778 100644 --- a/components/autofill/content/renderer/autofill_agent.cc +++ b/components/autofill/content/renderer/autofill_agent.cc
@@ -204,6 +204,7 @@ form_cache_.Reset(); ResetLastInteractedElements(); + OnFormNoLongerSubmittable(); } void AutofillAgent::DidFinishDocumentLoad() { @@ -283,18 +284,24 @@ } void AutofillAgent::FireHostSubmitEvents(const WebFormElement& form, - bool known_success) { + bool known_success, + SubmissionSource source) { FormData form_data; if (!form_util::ExtractFormData(form, &form_data)) return; - FireHostSubmitEvents(form_data, known_success); + FireHostSubmitEvents(form_data, known_success, source); } void AutofillAgent::FireHostSubmitEvents(const FormData& form_data, - bool /*known_success*/) { - GetAutofillDriver()->WillSubmitForm(form_data, base::TimeTicks::Now()); - GetAutofillDriver()->FormSubmitted(form_data); + bool known_success, + SubmissionSource source) { + // We don't want to fire duplicate submission event. + if (!submitted_forms_.insert(form_data).second) + return; + + GetAutofillDriver()->FormSubmitted(form_data, known_success, source, + base::TimeTicks::Now()); } void AutofillAgent::Shutdown() { @@ -793,10 +800,18 @@ void AutofillAgent::OnProvisionallySaveForm(const WebFormElement& form, const WebInputElement& element, ElementChangeSource source) { - // Remember the last form the user interacted with. if (source == ElementChangeSource::WILL_SEND_SUBMIT_EVENT) { - UpdateLastInteractedForm(form); + // Fire the form submission event to avoid missing submission when web site + // handles the onsubmit event, this also gets the form before Javascript + // could change it. + // We don't clear submitted_forms_ because OnFormSubmitted will normally be + // invoked afterwards and we don't want to fire the same event twice. + FireHostSubmitEvents(form, /*known_success=*/false, + SubmissionSource::FORM_SUBMISSION); + ResetLastInteractedElements(); + return; } else if (source == ElementChangeSource::TEXTFIELD_CHANGED) { + // Remember the last form the user interacted with. if (!element.Form().IsNull()) { UpdateLastInteractedForm(element.Form()); } else { @@ -822,18 +837,22 @@ } void AutofillAgent::OnProbablyFormSubmitted() { - // Uncomment below code once we check whether form submission - // is successful in browser side. - // FormData form_data; - // if (GetSubmittedForm(&form_data)) { - // FireHostSubmitEvents(form_data, /*known_success=*/false); - // } + FormData form_data; + if (GetSubmittedForm(&form_data)) { + FireHostSubmitEvents(form_data, /*known_success=*/false, + SubmissionSource::PROBABLY_FORM_SUBMITTED); + } ResetLastInteractedElements(); + OnFormNoLongerSubmittable(); } void AutofillAgent::OnFormSubmitted(const WebFormElement& form) { - FireHostSubmitEvents(form, /*known_success=*/false); + // Fire the submission event here because WILL_SEND_SUBMIT_EVENT is skipped + // if javascript calls submit() directly. + FireHostSubmitEvents(form, /*known_success=*/false, + SubmissionSource::FORM_SUBMISSION); ResetLastInteractedElements(); + OnFormNoLongerSubmittable(); } void AutofillAgent::OnInferredFormSubmission(SubmissionSource source) { @@ -843,6 +862,8 @@ !render_frame()->GetWebFrame()->Parent()) || (source == SubmissionSource::SAME_DOCUMENT_NAVIGATION && render_frame()->GetWebFrame()->Parent())) { + ResetLastInteractedElements(); + OnFormNoLongerSubmittable(); return; } @@ -850,13 +871,15 @@ // Should not access the frame because it is now detached. Instead, use // |provisionally_saved_form_|. if (provisionally_saved_form_) - FireHostSubmitEvents(*provisionally_saved_form_, /*known_success=*/true); + FireHostSubmitEvents(*provisionally_saved_form_, /*known_success=*/true, + source); } else { FormData form_data; if (GetSubmittedForm(&form_data)) - FireHostSubmitEvents(form_data, /*known_success=*/true); + FireHostSubmitEvents(form_data, /*known_success=*/true, source); } ResetLastInteractedElements(); + OnFormNoLongerSubmittable(); } void AutofillAgent::AddFormObserver(Observer* observer) { @@ -907,6 +930,10 @@ } } +void AutofillAgent::OnFormNoLongerSubmittable() { + submitted_forms_.clear(); +} + const mojom::AutofillDriverPtr& AutofillAgent::GetAutofillDriver() { if (!autofill_driver_) { render_frame()->GetRemoteInterfaces()->GetInterface(
diff --git a/components/autofill/content/renderer/autofill_agent.h b/components/autofill/content/renderer/autofill_agent.h index eeff3d2..0ec39ed 100644 --- a/components/autofill/content/renderer/autofill_agent.h +++ b/components/autofill/content/renderer/autofill_agent.h
@@ -158,13 +158,13 @@ void FocusedNodeChanged(const blink::WebNode& node) override; void OnDestruct() override; - // Fires Mojo messages for a given form submission. Will always fire - // AutofillHostMsg_WillSubmitForm and AutofillHostMsg_FormSubmitted - // in sequence. - // TODO(crbug.com/785519): Combine those two events to one. + // Fires Mojo messages for a given form submission. void FireHostSubmitEvents(const blink::WebFormElement& form, - bool known_success); - void FireHostSubmitEvents(const FormData& form_data, bool known_success); + bool known_success, + SubmissionSource source); + void FireHostSubmitEvents(const FormData& form_data, + bool known_success, + SubmissionSource source); // Shuts the AutofillAgent down on RenderFrame deletion. Safe to call multiple // times. @@ -251,6 +251,10 @@ void ResetLastInteractedElements(); void UpdateLastInteractedForm(blink::WebFormElement form); + // Called when current form is no longer submittable, submitted_forms_ is + // cleared in this method. + void OnFormNoLongerSubmittable(); + // Formerly cached forms for all frames, now only caches forms for the current // frame. FormCache form_cache_; @@ -279,6 +283,14 @@ // form can't be converted to FormData at the time of form submission. std::unique_ptr<FormData> provisionally_saved_form_; + // Keeps track of the forms for which form submitted event has been sent to + // AutofillDriver. We use it to avoid fire duplicated submission event when + // WILL_SEND_SUBMIT_EVENT and form submitted are both fired for same form. + // The submitted_forms_ is cleared when we know no more submission could + // happen for that form. + // We use a simplified comparison function. + std::set<FormData, FormDataCompare> submitted_forms_; + // Was the query node autofilled prior to previewing the form? bool was_query_node_autofilled_;
diff --git a/components/autofill/content/renderer/form_tracker.cc b/components/autofill/content/renderer/form_tracker.cc index 7070c3e..97d2e2a 100644 --- a/components/autofill/content/renderer/form_tracker.cc +++ b/components/autofill/content/renderer/form_tracker.cc
@@ -31,7 +31,7 @@ void ElementWasHiddenOrRemoved() override { tracker_->FireInferredFormSubmission( - Observer::SubmissionSource::DOM_MUTATION_AFTER_XHR); + SubmissionSource::DOM_MUTATION_AFTER_XHR); } private: @@ -64,7 +64,7 @@ void FormTracker::AjaxSucceeded() { DCHECK_CALLED_ON_VALID_SEQUENCE(form_tracker_sequence_checker_); - FireSubmissionIfFormDisappear(Observer::SubmissionSource::XHR_SUCCEEDED); + FireSubmissionIfFormDisappear(SubmissionSource::XHR_SUCCEEDED); } void FormTracker::TextFieldDidChange(const WebFormControlElement& element) { @@ -91,6 +91,10 @@ weak_ptr_factory_.GetWeakPtr(), element)); } +void FormTracker::FireProbablyFormSubmittedForTesting() { + FireProbablyFormSubmitted(); +} + void FormTracker::TextFieldDidChangeImpl(const WebFormControlElement& element) { DCHECK_CALLED_ON_VALID_SEQUENCE(form_tracker_sequence_checker_); // If the element isn't focused then the changes don't matter. This check is @@ -121,8 +125,7 @@ if (!is_same_document_navigation) return; - FireSubmissionIfFormDisappear( - Observer::SubmissionSource::SAME_DOCUMENT_NAVIGATION); + FireSubmissionIfFormDisappear(SubmissionSource::SAME_DOCUMENT_NAVIGATION); } void FormTracker::DidStartProvisionalLoad(WebDocumentLoader* document_loader) { @@ -159,7 +162,7 @@ void FormTracker::FrameDetached() { DCHECK_CALLED_ON_VALID_SEQUENCE(form_tracker_sequence_checker_); - FireInferredFormSubmission(Observer::SubmissionSource::FRAME_DETACHED); + FireInferredFormSubmission(SubmissionSource::FRAME_DETACHED); } void FormTracker::WillSendSubmitEvent(const WebFormElement& form) { @@ -194,16 +197,14 @@ ResetLastInteractedElements(); } -void FormTracker::FireInferredFormSubmission( - Observer::SubmissionSource source) { +void FormTracker::FireInferredFormSubmission(SubmissionSource source) { DCHECK_CALLED_ON_VALID_SEQUENCE(form_tracker_sequence_checker_); for (auto& observer : observers_) observer.OnInferredFormSubmission(source); ResetLastInteractedElements(); } -void FormTracker::FireSubmissionIfFormDisappear( - Observer::SubmissionSource source) { +void FormTracker::FireSubmissionIfFormDisappear(SubmissionSource source) { if (CanInferFormSubmitted()) { FireInferredFormSubmission(source); return;
diff --git a/components/autofill/content/renderer/form_tracker.h b/components/autofill/content/renderer/form_tracker.h index ba67c52d..24bc6f3 100644 --- a/components/autofill/content/renderer/form_tracker.h +++ b/components/autofill/content/renderer/form_tracker.h
@@ -8,6 +8,7 @@ #include "base/memory/weak_ptr.h" #include "base/observer_list.h" #include "base/sequence_checker.h" +#include "components/autofill/core/common/submission_source.h" #include "content/public/renderer/render_frame_observer.h" #include "third_party/WebKit/public/web/WebInputElement.h" @@ -26,14 +27,6 @@ // and submission. class Observer { public: - // Probably should merge with PasswordForm::SubmissionIndicatorEvent. - enum class SubmissionSource { - SAME_DOCUMENT_NAVIGATION, - XHR_SUCCEEDED, - FRAME_DETACHED, - DOM_MUTATION_AFTER_XHR, - }; - enum class ElementChangeSource { TEXTFIELD_CHANGED, WILL_SEND_SUBMIT_EVENT, @@ -83,7 +76,12 @@ user_gesture_required_ = required; } + void FireProbablyFormSubmittedForTesting(); + private: + FRIEND_TEST_ALL_PREFIXES(FormAutocompleteTest, + FormSubmittedBySameDocumentNavigation); + class FormElementObserverCallback; // content::RenderFrameObserver: @@ -101,8 +99,8 @@ void TextFieldDidChangeImpl(const blink::WebFormControlElement& element); void FireProbablyFormSubmitted(); void FireFormSubmitted(const blink::WebFormElement& form); - void FireInferredFormSubmission(Observer::SubmissionSource source); - void FireSubmissionIfFormDisappear(Observer::SubmissionSource source); + void FireInferredFormSubmission(SubmissionSource source); + void FireSubmissionIfFormDisappear(SubmissionSource source); bool CanInferFormSubmitted(); void TrackElement();
diff --git a/components/autofill/content/renderer/password_autofill_agent.cc b/components/autofill/content/renderer/password_autofill_agent.cc index cc1db34..b8f64d41 100644 --- a/components/autofill/content/renderer/password_autofill_agent.cc +++ b/components/autofill/content/renderer/password_autofill_agent.cc
@@ -570,15 +570,15 @@ } PasswordForm::SubmissionIndicatorEvent ToSubmissionIndicatorEvent( - FormTracker::Observer::SubmissionSource source) { + SubmissionSource source) { switch (source) { - case FormTracker::Observer::SubmissionSource::FRAME_DETACHED: + case SubmissionSource::FRAME_DETACHED: return PasswordForm::SubmissionIndicatorEvent::FRAME_DETACHED; - case FormTracker::Observer::SubmissionSource::SAME_DOCUMENT_NAVIGATION: + case SubmissionSource::SAME_DOCUMENT_NAVIGATION: return PasswordForm::SubmissionIndicatorEvent::SAME_DOCUMENT_NAVIGATION; - case FormTracker::Observer::SubmissionSource::XHR_SUCCEEDED: + case SubmissionSource::XHR_SUCCEEDED: return PasswordForm::SubmissionIndicatorEvent::XHR_SUCCEEDED; - case FormTracker::Observer::SubmissionSource::DOM_MUTATION_AFTER_XHR: + case SubmissionSource::DOM_MUTATION_AFTER_XHR: return PasswordForm::SubmissionIndicatorEvent::DOM_MUTATION_AFTER_XHR; default: return PasswordForm::SubmissionIndicatorEvent::NONE;
diff --git a/components/autofill/core/browser/autofill_handler.cc b/components/autofill/core/browser/autofill_handler.cc index a099eb8d..3388ea6 100644 --- a/components/autofill/core/browser/autofill_handler.cc +++ b/components/autofill/core/browser/autofill_handler.cc
@@ -15,12 +15,13 @@ AutofillHandler::~AutofillHandler() {} -bool AutofillHandler::OnWillSubmitForm(const FormData& form, - const TimeTicks timestamp) { +bool AutofillHandler::OnFormSubmitted(const FormData& form, + bool known_success, + SubmissionSource source, + base::TimeTicks timestamp) { if (!IsValidFormData(form)) return false; - - return OnWillSubmitFormImpl(form, timestamp); + return OnFormSubmittedImpl(form, known_success, source, timestamp); } void AutofillHandler::OnTextFieldDidChange(const FormData& form,
diff --git a/components/autofill/core/browser/autofill_handler.h b/components/autofill/core/browser/autofill_handler.h index e8bdf42..c8f260c9 100644 --- a/components/autofill/core/browser/autofill_handler.h +++ b/components/autofill/core/browser/autofill_handler.h
@@ -13,6 +13,7 @@ #include "build/build_config.h" #include "components/autofill/core/browser/autofill_driver.h" #include "components/autofill/core/common/form_data.h" +#include "components/autofill/core/common/submission_source.h" namespace gfx { class RectF; @@ -52,23 +53,19 @@ const FormFieldData& field, const gfx::RectF& bounding_box); - // Invoked when the specified form will be submitted, returns false if this - // form is not relevant for Autofill. - // - // IMPORTANT: On iOS, this method is called when the form is submitted, - // immediately before OnFormSubmitted() is called. Do not assume that - // OnWillSubmitForm() will run before the form submits. - // TODO(mathp): Revisit this and use a single method to track form submission. - // - // Processes the about-to-be-submitted |form|, uploading the possible field - // types for the submitted fields to the crowdsourcing server. - bool OnWillSubmitForm(const FormData& form, const base::TimeTicks timestamp); - // Invoked when |form|'s |field| has focus. void OnFocusOnFormField(const FormData& form, const FormFieldData& field, const gfx::RectF& bounding_box); + // Invoked when |form| has been submitted. + // Processes the submitted |form|, saving any new Autofill data to the user's + // personal profile. Returns false if this form is not relevant for Autofill. + bool OnFormSubmitted(const FormData& form, + bool known_success, + SubmissionSource source, + base::TimeTicks timestamp); + // Invoked when focus is no longer on form. virtual void OnFocusNoLongerOnForm() = 0; @@ -84,11 +81,6 @@ virtual void OnFormsSeen(const std::vector<FormData>& forms, const base::TimeTicks timestamp) = 0; - // Invoked when |form| has been submitted. - // Processes the submitted |form|, saving any new Autofill data to the user's - // personal profile. Returns false if this form is not relevant for Autofill. - virtual bool OnFormSubmitted(const FormData& form) = 0; - // Invoked when textfeild editing ended virtual void OnDidEndTextFieldEditing() = 0; @@ -110,8 +102,10 @@ protected: AutofillHandler(AutofillDriver* driver); - virtual bool OnWillSubmitFormImpl(const FormData& form, - const base::TimeTicks timestamp) = 0; + virtual bool OnFormSubmittedImpl(const FormData& form, + bool known_success, + SubmissionSource source, + base::TimeTicks timestamp) = 0; virtual void OnTextFieldDidChangeImpl(const FormData& form, const FormFieldData& field,
diff --git a/components/autofill/core/browser/autofill_handler_proxy.cc b/components/autofill/core/browser/autofill_handler_proxy.cc index fd223daa..b64a5360 100644 --- a/components/autofill/core/browser/autofill_handler_proxy.cc +++ b/components/autofill/core/browser/autofill_handler_proxy.cc
@@ -16,9 +16,12 @@ AutofillHandlerProxy::~AutofillHandlerProxy() {} -bool AutofillHandlerProxy::OnWillSubmitFormImpl(const FormData& form, - const TimeTicks timestamp) { - return provider_->OnWillSubmitForm(this, form, timestamp); +bool AutofillHandlerProxy::OnFormSubmittedImpl(const FormData& form, + bool known_success, + SubmissionSource source, + base::TimeTicks timestamp) { + return provider_->OnFormSubmitted(this, form, known_success, source, + timestamp); } void AutofillHandlerProxy::OnTextFieldDidChangeImpl( @@ -65,10 +68,8 @@ void AutofillHandlerProxy::OnDidPreviewAutofillFormData() {} void AutofillHandlerProxy::OnFormsSeen(const std::vector<FormData>& forms, - const base::TimeTicks timestamp) {} - -bool AutofillHandlerProxy::OnFormSubmitted(const FormData& form) { - return false; + const base::TimeTicks timestamp) { + provider_->OnFormsSeen(this, forms, timestamp); } void AutofillHandlerProxy::OnDidEndTextFieldEditing() {}
diff --git a/components/autofill/core/browser/autofill_handler_proxy.h b/components/autofill/core/browser/autofill_handler_proxy.h index 0a3a039..9af41d05 100644 --- a/components/autofill/core/browser/autofill_handler_proxy.h +++ b/components/autofill/core/browser/autofill_handler_proxy.h
@@ -28,8 +28,6 @@ void OnFormsSeen(const std::vector<FormData>& forms, const base::TimeTicks timestamp) override; - bool OnFormSubmitted(const FormData& form) override; - void OnDidEndTextFieldEditing() override; void OnHidePopup() override; void OnSetDataList(const std::vector<base::string16>& values, @@ -42,8 +40,10 @@ } protected: - bool OnWillSubmitFormImpl(const FormData& form, - const base::TimeTicks timestamp) override; + bool OnFormSubmittedImpl(const FormData& form, + bool known_success, + SubmissionSource source, + base::TimeTicks timestamp) override; void OnTextFieldDidChangeImpl(const FormData& form, const FormFieldData& field,
diff --git a/components/autofill/core/browser/autofill_manager.cc b/components/autofill/core/browser/autofill_manager.cc index 43f3088..50180a1c 100644 --- a/components/autofill/core/browser/autofill_manager.cc +++ b/components/autofill/core/browser/autofill_manager.cc
@@ -336,8 +336,14 @@ ParseForms(forms); } -bool AutofillManager::OnWillSubmitFormImpl(const FormData& form, - const TimeTicks timestamp) { +bool AutofillManager::OnFormSubmittedImpl(const FormData& form, + bool known_success, + SubmissionSource source, + base::TimeTicks timestamp) { + // TODO(crbug.com/801698): handle PROBABLY_FORM_SUBMITTED. + if (source == SubmissionSource::PROBABLY_FORM_SUBMITTED) + return false; + // We will always give Autocomplete a chance to save the data. std::unique_ptr<FormStructure> submitted_form = ValidateSubmittedForm(form); if (!submitted_form) { @@ -360,21 +366,15 @@ if (IsCreditCardAutofillEnabled()) credit_card_form_event_logger_->OnWillSubmitForm(); - StartUploadProcess(std::move(submitted_form), timestamp, true); + bool ret = StartUploadProcess(std::move(submitted_form), timestamp, true); - return true; -} - -bool AutofillManager::OnFormSubmitted(const FormData& form) { - if (!IsValidFormData(form)) + // TODO(crbug.com/803334): Add FormStructure::Clone() method. + // Create another FormStructure instance. + submitted_form = ValidateSubmittedForm(form); + DCHECK(submitted_form); + if (!submitted_form) return false; - // We will always give Autocomplete a chance to save the data. - std::unique_ptr<FormStructure> submitted_form = ValidateSubmittedForm(form); - if (!submitted_form) { - return false; - } - CreditCard credit_card = form_data_importer_->ExtractCreditCardFromForm(*submitted_form); AutofillMetrics::CardNumberStatus card_number_status = @@ -393,17 +393,17 @@ IsCreditCardAutofillEnabled()); } - return true; + return ret; } -void AutofillManager::StartUploadProcess( +bool AutofillManager::StartUploadProcess( std::unique_ptr<FormStructure> form_structure, const TimeTicks& timestamp, bool observed_submission) { // It is possible for |personal_data_| to be null, such as when used in the // Android webview. if (!personal_data_) - return; + return false; // Only upload server statistics and UMA metrics if at least some local data // is available to use as a baseline. @@ -414,35 +414,35 @@ } const std::vector<CreditCard*>& credit_cards = personal_data_->GetCreditCards(); - if (!profiles.empty() || !credit_cards.empty()) { - // Copy the profile and credit card data, so that it can be accessed on a - // separate thread. - std::vector<AutofillProfile> copied_profiles; - copied_profiles.reserve(profiles.size()); - for (const AutofillProfile* profile : profiles) - copied_profiles.push_back(*profile); + if (profiles.empty() && credit_cards.empty()) + return false; + // Copy the profile and credit card data, so that it can be accessed on a + // separate thread. + std::vector<AutofillProfile> copied_profiles; + copied_profiles.reserve(profiles.size()); + for (const AutofillProfile* profile : profiles) + copied_profiles.push_back(*profile); - std::vector<CreditCard> copied_credit_cards; - copied_credit_cards.reserve(credit_cards.size()); - for (const CreditCard* card : credit_cards) - copied_credit_cards.push_back(*card); + std::vector<CreditCard> copied_credit_cards; + copied_credit_cards.reserve(credit_cards.size()); + for (const CreditCard* card : credit_cards) + copied_credit_cards.push_back(*card); - // Note that ownership of |form_structure| is passed to the second task, - // using |base::Owned|. - FormStructure* raw_form = form_structure.get(); - TimeTicks loaded_timestamp = - forms_loaded_timestamps_[raw_form->ToFormData()]; - base::PostTaskWithTraitsAndReply( - FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND}, - base::BindOnce(&AutofillManager::DeterminePossibleFieldTypesForUpload, - copied_profiles, copied_credit_cards, app_locale_, - raw_form), - base::BindOnce(&AutofillManager::UploadFormDataAsyncCallback, - weak_ptr_factory_.GetWeakPtr(), - base::Owned(form_structure.release()), loaded_timestamp, - initial_interaction_timestamp_, timestamp, - observed_submission)); - } + // Note that ownership of |form_structure| is passed to the second task, + // using |base::Owned|. + FormStructure* raw_form = form_structure.get(); + TimeTicks loaded_timestamp = forms_loaded_timestamps_[raw_form->ToFormData()]; + base::PostTaskWithTraitsAndReply( + FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND}, + base::BindOnce(&AutofillManager::DeterminePossibleFieldTypesForUpload, + copied_profiles, copied_credit_cards, app_locale_, + raw_form), + base::BindOnce(&AutofillManager::UploadFormDataAsyncCallback, + weak_ptr_factory_.GetWeakPtr(), + base::Owned(form_structure.release()), loaded_timestamp, + initial_interaction_timestamp_, timestamp, + observed_submission)); + return true; } void AutofillManager::UpdatePendingForm(const FormData& form) {
diff --git a/components/autofill/core/browser/autofill_manager.h b/components/autofill/core/browser/autofill_manager.h index 2241f29e..25cf6b7 100644 --- a/components/autofill/core/browser/autofill_manager.h +++ b/components/autofill/core/browser/autofill_manager.h
@@ -161,7 +161,8 @@ // Will send an upload based on the |form_structure| data and the local // Autofill profile data. |observed_submission| is specified if the upload // follows an observed submission event. - virtual void StartUploadProcess(std::unique_ptr<FormStructure> form_structure, + // return false if the upload couldn't start. + virtual bool StartUploadProcess(std::unique_ptr<FormStructure> form_structure, const base::TimeTicks& timestamp, bool observed_submission); @@ -179,7 +180,6 @@ void OnDidPreviewAutofillFormData() override; void OnFormsSeen(const std::vector<FormData>& forms, const base::TimeTicks timestamp) override; - bool OnFormSubmitted(const FormData& form) override; void OnDidEndTextFieldEditing() override; void OnHidePopup() override; void OnSetDataList(const std::vector<base::string16>& values, @@ -238,8 +238,10 @@ std::string* profile_backend_id) const; // AutofillHandler: - bool OnWillSubmitFormImpl(const FormData& form, - const base::TimeTicks timestamp) override; + bool OnFormSubmittedImpl(const FormData& form, + bool known_success, + SubmissionSource source, + base::TimeTicks timestamp) override; void OnTextFieldDidChangeImpl(const FormData& form, const FormFieldData& field, const gfx::RectF& bounding_box,
diff --git a/components/autofill/core/browser/autofill_manager_unittest.cc b/components/autofill/core/browser/autofill_manager_unittest.cc index 2324f63..c59970f 100644 --- a/components/autofill/core/browser/autofill_manager_unittest.cc +++ b/components/autofill/core/browser/autofill_manager_unittest.cc
@@ -406,11 +406,11 @@ void FormSubmitted(const FormData& form) { autofill_manager_->ResetRunLoop(); - if (autofill_manager_->OnWillSubmitForm(form, base::TimeTicks::Now()) && - (!personal_data_.GetProfiles().empty() || - !personal_data_.GetCreditCards().empty())) + if (autofill_manager_->OnFormSubmitted(form, false, + SubmissionSource::FORM_SUBMISSION, + base::TimeTicks::Now())) { autofill_manager_->WaitForAsyncUploadProcess(); - autofill_manager_->OnFormSubmitted(form); + } } void FillAutofillFormData(int query_id, @@ -3791,9 +3791,8 @@ EXPECT_EQ(1, personal_data_.num_times_save_imported_profile_called()); } -// Test that we are not saving form data when only the WillSubmitForm event is -// sent. -TEST_F(AutofillManagerTest, FormWillSubmitDoesNotSaveData) { +// Test that we are saving form data when the FormSubmitted event is sent. +TEST_F(AutofillManagerTest, FormSubmittedSaveData) { // Set up our form data. FormData form; test::CreateTestAddressFormData(&form); @@ -3810,13 +3809,12 @@ ExpectFilledAddressFormElvis(response_page_id, response_data, kDefaultPageID, false); - // Simulate OnWillSubmitForm(). We should *not* be calling into the PDM at - // this point (since the form was not submitted). Does not call - // OnFormSubmitted. autofill_manager_->ResetRunLoop(); - autofill_manager_->OnWillSubmitForm(response_data, base::TimeTicks::Now()); + autofill_manager_->OnFormSubmitted(response_data, false, + SubmissionSource::FORM_SUBMISSION, + base::TimeTicks::Now()); autofill_manager_->WaitForAsyncUploadProcess(); - EXPECT_EQ(0, personal_data_.num_times_save_imported_profile_called()); + EXPECT_EQ(1, personal_data_.num_times_save_imported_profile_called()); } // Test that when Autocomplete is enabled and Autofill is disabled, form @@ -5019,7 +5017,8 @@ full_card_unmask_delegate()->OnUnmaskResponse(response); autofill_manager_->OnDidGetRealPan(AutofillClient::SUCCESS, "4012888888881881"); - autofill_manager_->OnFormSubmitted(form); + autofill_manager_->OnFormSubmitted( + form, false, SubmissionSource::FORM_SUBMISSION, base::TimeTicks::Now()); } TEST_F(AutofillManagerTest, FillInUpdatedExpirationDate) {
diff --git a/components/autofill/core/browser/autofill_metrics_unittest.cc b/components/autofill/core/browser/autofill_metrics_unittest.cc index 33defae..87676d05 100644 --- a/components/autofill/core/browser/autofill_metrics_unittest.cc +++ b/components/autofill/core/browser/autofill_metrics_unittest.cc
@@ -433,7 +433,7 @@ // Simulate form submission. base::HistogramTester histogram_tester; - autofill_manager_->SubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); // Heuristic predictions. { @@ -1121,7 +1121,7 @@ // Run the form submission code while tracking the histograms. base::HistogramTester histogram_tester; - autofill_manager_->SubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); ExpectedUkmMetrics expected_ukm_metrics; AppendFieldTypeUkm(form, heuristic_types, server_types, actual_types, @@ -1627,7 +1627,7 @@ // Simulate form submission. base::HistogramTester histogram_tester; - autofill_manager_->SubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); histogram_tester.ExpectBucketCount( "Autofill.UserHappiness", AutofillMetrics::USER_DID_ENTER_UPI_VPA, 1); @@ -1678,7 +1678,7 @@ // match what is in the test profile. form.fields[1].value = base::ASCIIToUTF16("79401"); form.fields[2].value = base::ASCIIToUTF16("2345678901"); - autofill_manager_->SubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); for (const std::string source : {"Heuristic", "Server", "Overall"}) { std::string histogram_name = @@ -1778,7 +1778,7 @@ // Simulate form submission. base::HistogramTester histogram_tester; - autofill_manager_->SubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); for (const std::string source : {"Heuristic", "Server", "Overall"}) { std::string aggregate_histogram = @@ -1846,7 +1846,7 @@ // Simulate form submission. base::HistogramTester histogram_tester; autofill_manager_->OnFormsSeen(forms, TimeTicks()); - autofill_manager_->SubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); // An autofillable form was submitted, and the number of stored profiles is // logged. @@ -1879,7 +1879,7 @@ // Simulate form submission. base::HistogramTester histogram_tester; autofill_manager_->OnFormsSeen(forms, TimeTicks()); - autofill_manager_->SubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); // A non-autofillable form was submitted, and number of stored profiles is NOT // logged. @@ -1932,7 +1932,7 @@ TimeTicks()); // Simulate form submission. - autofill_manager_->SubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); // An autofillable form was submitted, and the number of edited autofilled // fields is logged. @@ -2628,7 +2628,7 @@ { base::UserActionTester user_action_tester; autofill_manager_->OnQueryFormFieldAutofill(0, form, field, gfx::RectF()); - autofill_manager_->SubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); EXPECT_EQ(1, user_action_tester.GetActionCount("Autofill_OnWillSubmitForm")); EXPECT_EQ(1, user_action_tester.GetActionCount( @@ -2741,7 +2741,7 @@ { base::UserActionTester user_action_tester; autofill_manager_->OnQueryFormFieldAutofill(0, form, field, gfx::RectF()); - autofill_manager_->SubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); EXPECT_EQ(1, user_action_tester.GetActionCount("Autofill_OnWillSubmitForm")); EXPECT_EQ(1, user_action_tester.GetActionCount( @@ -3269,7 +3269,7 @@ autofill_manager_->MakeFrontendID(guid, std::string())); autofill_manager_->OnDidGetRealPan(AutofillClient::SUCCESS, "6011000990139424"); - autofill_manager_->SubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); histogram_tester.ExpectBucketCount( "Autofill.FormEvents.CreditCard", AutofillMetrics::FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_FILLED, 1); @@ -3487,7 +3487,7 @@ base::HistogramTester histogram_tester; autofill_manager_->DidShowSuggestions(true /* is_new_popup */, form, field); autofill_manager_->OnQueryFormFieldAutofill(0, form, field, gfx::RectF()); - autofill_manager_->SubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); histogram_tester.ExpectBucketCount( "Autofill.FormEvents.CreditCard", AutofillMetrics::FORM_EVENT_SUBMIT_WITHOUT_SELECTING_SUGGESTIONS_NO_CARD, @@ -3528,7 +3528,7 @@ base::HistogramTester histogram_tester; autofill_manager_->DidShowSuggestions(true /* is_new_popup */, form, field); autofill_manager_->OnQueryFormFieldAutofill(0, form, field, gfx::RectF()); - autofill_manager_->SubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); histogram_tester.ExpectBucketCount( "Autofill.FormEvents.CreditCard", AutofillMetrics:: @@ -3571,7 +3571,7 @@ base::HistogramTester histogram_tester; autofill_manager_->DidShowSuggestions(true /* is_new_popup */, form, field); autofill_manager_->OnQueryFormFieldAutofill(0, form, field, gfx::RectF()); - autofill_manager_->SubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); histogram_tester.ExpectBucketCount( "Autofill.FormEvents.CreditCard", AutofillMetrics:: @@ -3616,7 +3616,7 @@ base::HistogramTester histogram_tester; autofill_manager_->DidShowSuggestions(true /* is_new_popup */, form, field); autofill_manager_->OnQueryFormFieldAutofill(0, form, field, gfx::RectF()); - autofill_manager_->SubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); histogram_tester.ExpectBucketCount( "Autofill.FormEvents.CreditCard", AutofillMetrics:: @@ -3661,7 +3661,7 @@ base::HistogramTester histogram_tester; autofill_manager_->DidShowSuggestions(true /* is_new_popup */, form, field); autofill_manager_->OnQueryFormFieldAutofill(0, form, field, gfx::RectF()); - autofill_manager_->SubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); histogram_tester.ExpectBucketCount( "Autofill.FormEvents.CreditCard", AutofillMetrics:: @@ -3711,7 +3711,7 @@ AutofillDriver::FORM_DATA_ACTION_FILL, 0, form, form.fields.back(), autofill_manager_->MakeFrontendID(guid, std::string())); - autofill_manager_->SubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); histogram_tester.ExpectBucketCount( "Autofill.FormEvents.CreditCard", AutofillMetrics:: @@ -3760,7 +3760,7 @@ base::HistogramTester histogram_tester; autofill_manager_->DidShowSuggestions(true /* is_new_popup */, form, field); autofill_manager_->OnQueryFormFieldAutofill(0, form, field, gfx::RectF()); - autofill_manager_->SubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); histogram_tester.ExpectBucketCount( "Autofill.FormEvents.Address", AutofillMetrics::FORM_EVENT_SUBMIT_WITHOUT_SELECTING_SUGGESTIONS_NO_CARD, @@ -3802,7 +3802,7 @@ // Simulating submission with no filled data. base::HistogramTester histogram_tester; autofill_manager_->OnQueryFormFieldAutofill(0, form, field, gfx::RectF()); - autofill_manager_->SubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); histogram_tester.ExpectBucketCount( "Autofill.FormEvents.CreditCard", AutofillMetrics::FORM_EVENT_NO_SUGGESTION_WILL_SUBMIT_ONCE, 1); @@ -3825,7 +3825,7 @@ base::HistogramTester histogram_tester; autofill_manager_->DidShowSuggestions(true /* is_new_popup */, form, field); autofill_manager_->OnQueryFormFieldAutofill(0, form, field, gfx::RectF()); - autofill_manager_->SubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); histogram_tester.ExpectBucketCount( "Autofill.FormEvents.CreditCard", AutofillMetrics::FORM_EVENT_SUGGESTION_SHOWN_SUBMITTED_ONCE, 1); @@ -3858,8 +3858,8 @@ autofill_manager_->DidShowSuggestions(true /* is_new_popup */, form, field); autofill_manager_->OnQueryFormFieldAutofill(0, form, field, gfx::RectF()); autofill_manager_->ResetRunLoop(); - autofill_manager_->OnWillSubmitForm(form, TimeTicks::Now()); - autofill_manager_->OnFormSubmitted(form); + autofill_manager_->OnFormSubmitted( + form, false, SubmissionSource::FORM_SUBMISSION, TimeTicks::Now()); autofill_manager_->Reset(); // Trigger UploadFormDataAsyncCallback. autofill_manager_->RunRunLoop(); @@ -3895,7 +3895,7 @@ autofill_manager_->FillOrPreviewForm( AutofillDriver::FORM_DATA_ACTION_FILL, 0, form, form.fields.front(), autofill_manager_->MakeFrontendID(guid, std::string())); - autofill_manager_->SubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); histogram_tester.ExpectBucketCount( "Autofill.FormEvents.CreditCard", AutofillMetrics::FORM_EVENT_LOCAL_SUGGESTION_WILL_SUBMIT_ONCE, 1); @@ -3926,7 +3926,7 @@ autofill_manager_->FillOrPreviewForm( AutofillDriver::FORM_DATA_ACTION_FILL, 0, form, form.fields.front(), autofill_manager_->MakeFrontendID(guid, std::string())); - autofill_manager_->SubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); histogram_tester.ExpectBucketCount( "Autofill.FormEvents.CreditCard", AutofillMetrics::FORM_EVENT_SERVER_SUGGESTION_WILL_SUBMIT_ONCE, 1); @@ -3959,7 +3959,7 @@ autofill_manager_->MakeFrontendID(guid, std::string())); autofill_manager_->OnDidGetRealPan(AutofillClient::SUCCESS, "6011000990139424"); - autofill_manager_->SubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); histogram_tester.ExpectBucketCount( "Autofill.FormEvents.CreditCard", AutofillMetrics::FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_FILLED, 1); @@ -3998,7 +3998,7 @@ // Simulating multiple submissions. base::HistogramTester histogram_tester; autofill_manager_->OnQueryFormFieldAutofill(0, form, field, gfx::RectF()); - autofill_manager_->SubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); VerifyFormInteractionUkm( test_ukm_recorder_, form, UkmFormSubmittedType::kEntryName, @@ -4006,7 +4006,7 @@ AutofillMetrics::NON_FILLABLE_FORM_OR_NEW_DATA}, {UkmSuggestionFilledType::kMillisecondsSinceFormParsedName, 0}}}); - autofill_manager_->SubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); VerifyFormInteractionUkm( test_ukm_recorder_, form, UkmFormSubmittedType::kEntryName, @@ -4064,7 +4064,7 @@ // interaction. base::HistogramTester histogram_tester; autofill_manager_->DidShowSuggestions(true /* is_new_popup */, form, field); - autofill_manager_->SubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); histogram_tester.ExpectBucketCount( "Autofill.FormEvents.CreditCard", AutofillMetrics::FORM_EVENT_SUGGESTION_SHOWN_SUBMITTED_ONCE, 0); @@ -4112,9 +4112,8 @@ } } -// Test that we log "will submit" (but not submitted) form events for credit -// cards. Mirrors CreditCardSubmittedFormEvents test but does not expect any -// "submitted" metrics. +// Test that we log "will submit" and "submitted" form events for credit +// cards. TEST_F(AutofillMetricsTest, CreditCardWillSubmitFormEvents) { EnableWalletSync(); // Creating all kinds of cards. @@ -4149,13 +4148,13 @@ // Simulating submission with no filled data. base::HistogramTester histogram_tester; autofill_manager_->OnQueryFormFieldAutofill(0, form, field, gfx::RectF()); - autofill_manager_->WillSubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); histogram_tester.ExpectBucketCount( "Autofill.FormEvents.CreditCard", AutofillMetrics::FORM_EVENT_NO_SUGGESTION_WILL_SUBMIT_ONCE, 1); histogram_tester.ExpectBucketCount( "Autofill.FormEvents.CreditCard", - AutofillMetrics::FORM_EVENT_NO_SUGGESTION_SUBMITTED_ONCE, 0); + AutofillMetrics::FORM_EVENT_NO_SUGGESTION_SUBMITTED_ONCE, 1); } // Reset the autofill manager state. @@ -4167,13 +4166,13 @@ base::HistogramTester histogram_tester; autofill_manager_->DidShowSuggestions(true /* is_new_popup */, form, field); autofill_manager_->OnQueryFormFieldAutofill(0, form, field, gfx::RectF()); - autofill_manager_->WillSubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); histogram_tester.ExpectBucketCount( "Autofill.FormEvents.CreditCard", AutofillMetrics::FORM_EVENT_SUGGESTION_SHOWN_WILL_SUBMIT_ONCE, 1); histogram_tester.ExpectBucketCount( "Autofill.FormEvents.CreditCard", - AutofillMetrics::FORM_EVENT_SUGGESTION_SHOWN_SUBMITTED_ONCE, 0); + AutofillMetrics::FORM_EVENT_SUGGESTION_SHOWN_SUBMITTED_ONCE, 1); } // Reset the autofill manager state. @@ -4188,13 +4187,13 @@ autofill_manager_->FillOrPreviewForm( AutofillDriver::FORM_DATA_ACTION_FILL, 0, form, form.fields.front(), autofill_manager_->MakeFrontendID(guid, std::string())); - autofill_manager_->WillSubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); histogram_tester.ExpectBucketCount( "Autofill.FormEvents.CreditCard", AutofillMetrics::FORM_EVENT_LOCAL_SUGGESTION_WILL_SUBMIT_ONCE, 1); histogram_tester.ExpectBucketCount( "Autofill.FormEvents.CreditCard", - AutofillMetrics::FORM_EVENT_LOCAL_SUGGESTION_SUBMITTED_ONCE, 0); + AutofillMetrics::FORM_EVENT_LOCAL_SUGGESTION_SUBMITTED_ONCE, 1); } // Reset the autofill manager state. @@ -4210,13 +4209,13 @@ autofill_manager_->FillOrPreviewForm( AutofillDriver::FORM_DATA_ACTION_FILL, 0, form, form.fields.front(), autofill_manager_->MakeFrontendID(guid, std::string())); - autofill_manager_->WillSubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); histogram_tester.ExpectBucketCount( "Autofill.FormEvents.CreditCard", AutofillMetrics::FORM_EVENT_SERVER_SUGGESTION_WILL_SUBMIT_ONCE, 1); histogram_tester.ExpectBucketCount( "Autofill.FormEvents.CreditCard", - AutofillMetrics::FORM_EVENT_SERVER_SUGGESTION_SUBMITTED_ONCE, 0); + AutofillMetrics::FORM_EVENT_SERVER_SUGGESTION_SUBMITTED_ONCE, 1); } // Reset the autofill manager state. @@ -4256,8 +4255,8 @@ // Simulating multiple submissions. base::HistogramTester histogram_tester; autofill_manager_->OnQueryFormFieldAutofill(0, form, field, gfx::RectF()); - autofill_manager_->WillSubmitForm(form, TimeTicks::Now()); - autofill_manager_->WillSubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); + autofill_manager_->SubmitForm(form); histogram_tester.ExpectBucketCount( "Autofill.FormEvents.CreditCard", AutofillMetrics::FORM_EVENT_NO_SUGGESTION_WILL_SUBMIT_ONCE, 1); @@ -4277,7 +4276,7 @@ 0); histogram_tester.ExpectBucketCount( "Autofill.FormEvents.CreditCard", - AutofillMetrics::FORM_EVENT_NO_SUGGESTION_SUBMITTED_ONCE, 0); + AutofillMetrics::FORM_EVENT_NO_SUGGESTION_SUBMITTED_ONCE, 1); histogram_tester.ExpectBucketCount( "Autofill.FormEvents.CreditCard", AutofillMetrics::FORM_EVENT_SUGGESTION_SHOWN_SUBMITTED_ONCE, 0); @@ -4303,7 +4302,7 @@ // interaction. base::HistogramTester histogram_tester; autofill_manager_->DidShowSuggestions(true /* is_new_popup */, form, field); - autofill_manager_->WillSubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); histogram_tester.ExpectBucketCount( "Autofill.FormEvents.CreditCard", AutofillMetrics::FORM_EVENT_SUGGESTION_SHOWN_SUBMITTED_ONCE, 0); @@ -4582,7 +4581,7 @@ // Simulating submission with no filled data. base::HistogramTester histogram_tester; autofill_manager_->OnQueryFormFieldAutofill(0, form, field, gfx::RectF()); - autofill_manager_->SubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); histogram_tester.ExpectBucketCount( "Autofill.FormEvents.Address", AutofillMetrics::FORM_EVENT_NO_SUGGESTION_WILL_SUBMIT_ONCE, 1); @@ -4607,8 +4606,8 @@ base::HistogramTester histogram_tester; autofill_manager_->OnQueryFormFieldAutofill(0, form, field, gfx::RectF()); autofill_manager_->ResetRunLoop(); - autofill_manager_->OnWillSubmitForm(form, TimeTicks::Now()); - autofill_manager_->OnFormSubmitted(form); + autofill_manager_->OnFormSubmitted( + form, false, SubmissionSource::FORM_SUBMISSION, TimeTicks::Now()); autofill_manager_->Reset(); // Trigger UploadFormDataAsyncCallback. autofill_manager_->RunRunLoop(); @@ -4634,7 +4633,7 @@ base::HistogramTester histogram_tester; autofill_manager_->DidShowSuggestions(true /* is_new_popup */, form, field); autofill_manager_->OnQueryFormFieldAutofill(0, form, field, gfx::RectF()); - autofill_manager_->SubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); histogram_tester.ExpectBucketCount( "Autofill.FormEvents.Address", AutofillMetrics::FORM_EVENT_SUGGESTION_SHOWN_WILL_SUBMIT_ONCE, 1); @@ -4655,7 +4654,7 @@ autofill_manager_->FillOrPreviewForm( AutofillDriver::FORM_DATA_ACTION_FILL, 0, form, form.fields.front(), autofill_manager_->MakeFrontendID(std::string(), guid)); - autofill_manager_->SubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); histogram_tester.ExpectBucketCount( "Autofill.FormEvents.Address", AutofillMetrics::FORM_EVENT_LOCAL_SUGGESTION_WILL_SUBMIT_ONCE, 1); @@ -4672,8 +4671,8 @@ // Simulating multiple submissions. base::HistogramTester histogram_tester; autofill_manager_->OnQueryFormFieldAutofill(0, form, field, gfx::RectF()); - autofill_manager_->SubmitForm(form, TimeTicks::Now()); - autofill_manager_->SubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); + autofill_manager_->SubmitForm(form); histogram_tester.ExpectBucketCount( "Autofill.FormEvents.Address", @@ -4710,7 +4709,7 @@ // interaction. base::HistogramTester histogram_tester; autofill_manager_->DidShowSuggestions(true /* is_new_popup */, form, field); - autofill_manager_->SubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); histogram_tester.ExpectBucketCount( "Autofill.FormEvents.Address", @@ -4749,9 +4748,7 @@ } } -// Test that we log "will submit" (but not submitted) form events for address. -// Mirrors AddressSubmittedFormEvents test but does not expect any "submitted" -// metrics. +// Test that we log "will submit" and "submitted" form events for address. TEST_F(AutofillMetricsTest, AddressWillSubmitFormEvents) { EnableWalletSync(); // Create a profile. @@ -4784,13 +4781,13 @@ // Simulating submission with no filled data. base::HistogramTester histogram_tester; autofill_manager_->OnQueryFormFieldAutofill(0, form, field, gfx::RectF()); - autofill_manager_->WillSubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); histogram_tester.ExpectBucketCount( "Autofill.FormEvents.Address", AutofillMetrics::FORM_EVENT_NO_SUGGESTION_WILL_SUBMIT_ONCE, 1); histogram_tester.ExpectBucketCount( "Autofill.FormEvents.Address", - AutofillMetrics::FORM_EVENT_NO_SUGGESTION_SUBMITTED_ONCE, 0); + AutofillMetrics::FORM_EVENT_NO_SUGGESTION_SUBMITTED_ONCE, 1); } // Reset the autofill manager state. @@ -4802,13 +4799,13 @@ base::HistogramTester histogram_tester; autofill_manager_->DidShowSuggestions(true /* is_new_popup */, form, field); autofill_manager_->OnQueryFormFieldAutofill(0, form, field, gfx::RectF()); - autofill_manager_->WillSubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); histogram_tester.ExpectBucketCount( "Autofill.FormEvents.Address", AutofillMetrics::FORM_EVENT_SUGGESTION_SHOWN_WILL_SUBMIT_ONCE, 1); histogram_tester.ExpectBucketCount( "Autofill.FormEvents.Address", - AutofillMetrics::FORM_EVENT_SUGGESTION_SHOWN_SUBMITTED_ONCE, 0); + AutofillMetrics::FORM_EVENT_SUGGESTION_SHOWN_SUBMITTED_ONCE, 1); } // Reset the autofill manager state. @@ -4823,13 +4820,13 @@ autofill_manager_->FillOrPreviewForm( AutofillDriver::FORM_DATA_ACTION_FILL, 0, form, form.fields.front(), autofill_manager_->MakeFrontendID(std::string(), guid)); - autofill_manager_->WillSubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); histogram_tester.ExpectBucketCount( "Autofill.FormEvents.Address", AutofillMetrics::FORM_EVENT_LOCAL_SUGGESTION_WILL_SUBMIT_ONCE, 1); histogram_tester.ExpectBucketCount( "Autofill.FormEvents.Address", - AutofillMetrics::FORM_EVENT_LOCAL_SUGGESTION_SUBMITTED_ONCE, 0); + AutofillMetrics::FORM_EVENT_LOCAL_SUGGESTION_SUBMITTED_ONCE, 1); } // Reset the autofill manager state. @@ -4840,8 +4837,8 @@ // Simulating multiple submissions. base::HistogramTester histogram_tester; autofill_manager_->OnQueryFormFieldAutofill(0, form, field, gfx::RectF()); - autofill_manager_->WillSubmitForm(form, TimeTicks::Now()); - autofill_manager_->WillSubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); + autofill_manager_->SubmitForm(form); histogram_tester.ExpectBucketCount( "Autofill.FormEvents.Address", AutofillMetrics::FORM_EVENT_SUGGESTION_SHOWN_WILL_SUBMIT_ONCE, 0); @@ -4864,7 +4861,7 @@ AutofillMetrics::FORM_EVENT_SUGGESTION_SHOWN_SUBMITTED_ONCE, 0); histogram_tester.ExpectBucketCount( "Autofill.FormEvents.Address", - AutofillMetrics::FORM_EVENT_NO_SUGGESTION_SUBMITTED_ONCE, 0); + AutofillMetrics::FORM_EVENT_NO_SUGGESTION_SUBMITTED_ONCE, 1); histogram_tester.ExpectBucketCount( "Autofill.FormEvents.Address", AutofillMetrics::FORM_EVENT_LOCAL_SUGGESTION_SUBMITTED_ONCE, 0); @@ -4887,7 +4884,7 @@ // interaction. base::HistogramTester histogram_tester; autofill_manager_->DidShowSuggestions(true /* is_new_popup */, form, field); - autofill_manager_->WillSubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); histogram_tester.ExpectBucketCount( "Autofill.FormEvents.Address", AutofillMetrics::FORM_EVENT_SUGGESTION_SHOWN_WILL_SUBMIT_ONCE, 0); @@ -5158,7 +5155,7 @@ { base::HistogramTester histogram_tester; base::UserActionTester user_action_tester; - autofill_manager_->SubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); histogram_tester.ExpectUniqueSample( "Autofill.FormSubmittedState", AutofillMetrics::NON_FILLABLE_FORM_OR_NEW_DATA, 1); @@ -5187,7 +5184,7 @@ { base::HistogramTester histogram_tester; base::UserActionTester user_action_tester; - autofill_manager_->SubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); histogram_tester.ExpectUniqueSample( "Autofill.FormSubmittedState", AutofillMetrics::NON_FILLABLE_FORM_OR_NEW_DATA, 1); @@ -5218,7 +5215,7 @@ { base::HistogramTester histogram_tester; base::UserActionTester user_action_tester; - autofill_manager_->SubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); histogram_tester.ExpectUniqueSample( "Autofill.FormSubmittedState", AutofillMetrics::FILLABLE_FORM_AUTOFILLED_NONE_DID_NOT_SHOW_SUGGESTIONS, @@ -5247,7 +5244,7 @@ { base::HistogramTester histogram_tester; base::UserActionTester user_action_tester; - autofill_manager_->SubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); histogram_tester.ExpectUniqueSample( "Autofill.FormSubmittedState", AutofillMetrics::FILLABLE_FORM_AUTOFILLED_NONE_DID_SHOW_SUGGESTIONS, 1); @@ -5285,7 +5282,7 @@ { base::HistogramTester histogram_tester; base::UserActionTester user_action_tester; - autofill_manager_->SubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); histogram_tester.ExpectUniqueSample( "Autofill.FormSubmittedState", AutofillMetrics::FILLABLE_FORM_AUTOFILLED_SOME, 1); @@ -5315,7 +5312,7 @@ { base::HistogramTester histogram_tester; base::UserActionTester user_action_tester; - autofill_manager_->SubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); histogram_tester.ExpectUniqueSample( "Autofill.FormSubmittedState", AutofillMetrics::FILLABLE_FORM_AUTOFILLED_ALL, 1); @@ -5348,7 +5345,7 @@ kAutofillEnforceMinRequiredFieldsForHeuristics); base::HistogramTester histogram_tester; base::UserActionTester user_action_tester; - autofill_manager_->SubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); histogram_tester.ExpectUniqueSample( "Autofill.FormSubmittedState", AutofillMetrics::NON_FILLABLE_FORM_OR_NEW_DATA, 1); @@ -5413,7 +5410,7 @@ form.fields[2].value = ASCIIToUTF16("12345678901"); form.fields[2].is_autofilled = true; - autofill_manager_->SubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); histogram_tester.ExpectUniqueSample( "Autofill.FormSubmittedState", AutofillMetrics::FILLABLE_FORM_AUTOFILLED_ALL, 1); @@ -6590,7 +6587,7 @@ // Simulate submitting the credit card form. { base::HistogramTester histograms; - autofill_manager_->SubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); histograms.ExpectBucketCount( "Autofill.FormEvents.CreditCard.OnNonsecurePage", AutofillMetrics::FORM_EVENT_NO_SUGGESTION_SUBMITTED_ONCE, 1); @@ -6646,7 +6643,7 @@ // Simulate submitting the credit card form. { base::HistogramTester histograms; - autofill_manager_->SubmitForm(form, TimeTicks::Now()); + autofill_manager_->SubmitForm(form); histograms.ExpectBucketCount( "Autofill.FormEvents.CreditCard", AutofillMetrics::FORM_EVENT_NO_SUGGESTION_WILL_SUBMIT_ONCE, 1);
diff --git a/components/autofill/core/browser/autofill_provider.h b/components/autofill/core/browser/autofill_provider.h index edc25f92..c835437 100644 --- a/components/autofill/core/browser/autofill_provider.h +++ b/components/autofill/core/browser/autofill_provider.h
@@ -7,6 +7,7 @@ #include "base/time/time.h" #include "components/autofill/core/common/form_data.h" +#include "components/autofill/core/common/submission_source.h" namespace gfx { class RectF; @@ -40,9 +41,11 @@ const FormFieldData& field, const gfx::RectF& bounding_box) = 0; - virtual bool OnWillSubmitForm(AutofillHandlerProxy* handler, - const FormData& form, - const base::TimeTicks timestamp) = 0; + virtual bool OnFormSubmitted(AutofillHandlerProxy* handler, + const FormData& form, + bool known_success, + SubmissionSource source, + base::TimeTicks timestamp) = 0; virtual void OnFocusNoLongerOnForm(AutofillHandlerProxy* handler) = 0; @@ -55,6 +58,10 @@ const FormData& form, base::TimeTicks timestamp) = 0; + virtual void OnFormsSeen(AutofillHandlerProxy* handler, + const std::vector<FormData>& forms, + const base::TimeTicks timestamp) = 0; + virtual void Reset(AutofillHandlerProxy* handler) = 0; void SendFormDataToRenderer(AutofillHandlerProxy* handler,
diff --git a/components/autofill/core/browser/credit_card_save_manager_unittest.cc b/components/autofill/core/browser/credit_card_save_manager_unittest.cc index e79083f..dfa40607 100644 --- a/components/autofill/core/browser/credit_card_save_manager_unittest.cc +++ b/components/autofill/core/browser/credit_card_save_manager_unittest.cc
@@ -160,11 +160,11 @@ void FormSubmitted(const FormData& form) { autofill_manager_->ResetRunLoop(); - if (autofill_manager_->OnWillSubmitForm(form, base::TimeTicks::Now()) && - (!personal_data_.GetProfiles().empty() || - !personal_data_.GetCreditCards().empty())) + if (autofill_manager_->OnFormSubmitted(form, false, + SubmissionSource::FORM_SUBMISSION, + base::TimeTicks::Now())) { autofill_manager_->WaitForAsyncUploadProcess(); - autofill_manager_->OnFormSubmitted(form); + } } // Populates |form| with data corresponding to a simple credit card form.
diff --git a/components/autofill/core/browser/test_autofill_manager.cc b/components/autofill/core/browser/test_autofill_manager.cc index 15646b4..2fab42d 100644 --- a/components/autofill/core/browser/test_autofill_manager.cc +++ b/components/autofill/core/browser/test_autofill_manager.cc
@@ -144,20 +144,18 @@ form_structures()->push_back(std::move(form_structure)); } -void TestAutofillManager::WillSubmitForm(const FormData& form, - const TimeTicks& timestamp) { +void TestAutofillManager::SubmitForm(const FormData& form, + const TimeTicks& timestamp) { ResetRunLoop(); - if (!OnWillSubmitForm(form, timestamp)) + if (!OnFormSubmitted(form, false, SubmissionSource::FORM_SUBMISSION, + timestamp)) return; - // Wait for the asynchronous OnWillSubmitForm() call to complete. RunRunLoop(); } -void TestAutofillManager::SubmitForm(const FormData& form, - const TimeTicks& timestamp) { - WillSubmitForm(form, timestamp); - OnFormSubmitted(form); +void TestAutofillManager::SubmitForm(const FormData& form) { + SubmitForm(form, TimeTicks::Now()); } void TestAutofillManager::ClearFormStructures() {
diff --git a/components/autofill/core/browser/test_autofill_manager.h b/components/autofill/core/browser/test_autofill_manager.h index e13db80f..dc5acd3 100644 --- a/components/autofill/core/browser/test_autofill_manager.h +++ b/components/autofill/core/browser/test_autofill_manager.h
@@ -76,12 +76,9 @@ void AddSeenFormStructure(std::unique_ptr<FormStructure> form_structure); - // Calls AutofillManager::OnWillSubmitForm and waits for it to complete. - void WillSubmitForm(const FormData& form, const TimeTicks& timestamp); - - // Calls both AutofillManager::OnWillSubmitForm and - // AutofillManager::OnFormSubmitted. + // Calls AutofillManager::OnFormSubmitted and waits for it to complete. void SubmitForm(const FormData& form, const TimeTicks& timestamp); + void SubmitForm(const FormData& form); void ClearFormStructures();
diff --git a/components/autofill/core/browser/test_autofill_provider.cc b/components/autofill/core/browser/test_autofill_provider.cc index 6ed1370..eb20139a 100644 --- a/components/autofill/core/browser/test_autofill_provider.cc +++ b/components/autofill/core/browser/test_autofill_provider.cc
@@ -26,9 +26,11 @@ const FormFieldData& field, const gfx::RectF& bounding_box) {} -bool TestAutofillProvider::OnWillSubmitForm(AutofillHandlerProxy* handler, - const FormData& form, - const base::TimeTicks timestamp) { +bool TestAutofillProvider::OnFormSubmitted(AutofillHandlerProxy* handler, + const FormData& form, + bool known_success, + SubmissionSource source, + base::TimeTicks timestamp) { return false; } @@ -45,6 +47,10 @@ const FormData& form, base::TimeTicks timestamp) {} +void TestAutofillProvider::OnFormsSeen(AutofillHandlerProxy* handler, + const std::vector<FormData>& forms, + const base::TimeTicks timestamp) {} + void TestAutofillProvider::Reset(AutofillHandlerProxy* handler) {} } // namespace autofill
diff --git a/components/autofill/core/browser/test_autofill_provider.h b/components/autofill/core/browser/test_autofill_provider.h index 7e140a80..4148d77 100644 --- a/components/autofill/core/browser/test_autofill_provider.h +++ b/components/autofill/core/browser/test_autofill_provider.h
@@ -28,9 +28,11 @@ const FormData& form, const FormFieldData& field, const gfx::RectF& bounding_box) override; - bool OnWillSubmitForm(AutofillHandlerProxy* handler, - const FormData& form, - const base::TimeTicks timestamp) override; + bool OnFormSubmitted(AutofillHandlerProxy* handler, + const FormData& form, + bool known_success, + SubmissionSource source, + base::TimeTicks timestamp) override; void OnFocusNoLongerOnForm(AutofillHandlerProxy* handler) override; void OnFocusOnFormField(AutofillHandlerProxy* handler, const FormData& form, @@ -39,6 +41,9 @@ void OnDidFillAutofillFormData(AutofillHandlerProxy* handler, const FormData& form, base::TimeTicks timestamp) override; + void OnFormsSeen(AutofillHandlerProxy* handler, + const std::vector<FormData>& forms, + const base::TimeTicks timestamp) override; void Reset(AutofillHandlerProxy* handler) override; };
diff --git a/components/autofill/core/common/BUILD.gn b/components/autofill/core/common/BUILD.gn index a31edfb..8e15cd7 100644 --- a/components/autofill/core/common/BUILD.gn +++ b/components/autofill/core/common/BUILD.gn
@@ -45,6 +45,7 @@ "save_password_progress_logger.h", "signatures_util.cc", "signatures_util.h", + "submission_source.h", ] deps = [
diff --git a/components/autofill/core/common/submission_source.h b/components/autofill/core/common/submission_source.h new file mode 100644 index 0000000..f7118804 --- /dev/null +++ b/components/autofill/core/common/submission_source.h
@@ -0,0 +1,23 @@ +// 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_AUTOFILL_CORE_COMMON_SUBMISSION_SOURCE_H_ +#define COMPONENTS_AUTOFILL_CORE_COMMON_SUBMISSION_SOURCE_H_ + +namespace autofill { + +enum class SubmissionSource { + SAME_DOCUMENT_NAVIGATION, // The form was removed in same document + // navigation. + XHR_SUCCEEDED, // The form was removed whem XHR succeeded. + FRAME_DETACHED, // The subframe which has form was detached. + DOM_MUTATION_AFTER_XHR, // The form was removed after XHR. + PROBABLY_FORM_SUBMITTED, // The form was probably submitted since new page + // is loaded. + FORM_SUBMISSION, // Normal form submission. +}; + +} // namespace autofill + +#endif // COMPONENTS_AUTOFILL_CORE_COMMON_FORM_SUBMISSION_SOURCE_H_
diff --git a/components/autofill/ios/browser/autofill_agent.mm b/components/autofill/ios/browser/autofill_agent.mm index bfdf303..a4ca3608 100644 --- a/components/autofill/ios/browser/autofill_agent.mm +++ b/components/autofill/ios/browser/autofill_agent.mm
@@ -341,11 +341,9 @@ // Exactly one form should be extracted. DCHECK_EQ(1U, forms.size()); autofill::FormData form = forms[0]; - - // iOS doesn't get a separate "will submit form" notification so call - // OnWillSubmitForm() here. - autofillManager->OnWillSubmitForm(form, base::TimeTicks::Now()); - autofillManager->OnFormSubmitted(form); + autofillManager->OnFormSubmitted(form, false, + autofill::SubmissionSource::FORM_SUBMISSION, + base::TimeTicks::Now()); autofill::KeyboardAccessoryMetricsLogger::OnFormSubmitted(); }
diff --git a/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerImpl.java b/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerImpl.java index f3c4403..082a047 100644 --- a/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerImpl.java +++ b/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerImpl.java
@@ -9,6 +9,7 @@ import org.chromium.base.Log; import org.chromium.base.ThreadUtils; +import org.chromium.base.TraceEvent; import java.util.Set; @@ -30,25 +31,31 @@ @Override public boolean schedule(Context context, TaskInfo taskInfo) { + TraceEvent.begin( + "BackgroundTaskScheduler.schedule", Integer.toString(taskInfo.getTaskId())); ThreadUtils.assertOnUiThread(); boolean success = mSchedulerDelegate.schedule(context, taskInfo); BackgroundTaskSchedulerUma.getInstance().reportTaskScheduled(taskInfo.getTaskId(), success); if (success) { BackgroundTaskSchedulerPrefs.addScheduledTask(taskInfo); } + TraceEvent.end("BackgroundTaskScheduler.schedule"); return success; } @Override public void cancel(Context context, int taskId) { + TraceEvent.begin("BackgroundTaskScheduler.cancel", Integer.toString(taskId)); ThreadUtils.assertOnUiThread(); BackgroundTaskSchedulerUma.getInstance().reportTaskCanceled(taskId); BackgroundTaskSchedulerPrefs.removeScheduledTask(taskId); mSchedulerDelegate.cancel(context, taskId); + TraceEvent.end("BackgroundTaskScheduler.cancel"); } @Override public void checkForOSUpgrade(Context context) { + TraceEvent.begin("BackgroundTaskScheduler.checkForOSUpgrade"); int oldSdkInt = BackgroundTaskSchedulerPrefs.getLastSdkVersion(); int newSdkInt = Build.VERSION.SDK_INT; @@ -75,10 +82,12 @@ } reschedule(context); + TraceEvent.end("BackgroundTaskScheduler.checkForOSUpgrade"); } @Override public void reschedule(Context context) { + TraceEvent.begin("BackgroundTaskScheduler.reschedule"); Set<String> scheduledTasksClassNames = BackgroundTaskSchedulerPrefs.getScheduledTasks(); BackgroundTaskSchedulerPrefs.removeAllTasks(); for (String className : scheduledTasksClassNames) { @@ -91,6 +100,7 @@ task.reschedule(context); } + TraceEvent.end("BackgroundTaskScheduler.reschedule"); } private boolean osUpgradeChangesDelegateType(int oldSdkInt, int newSdkInt) {
diff --git a/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerPrefs.java b/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerPrefs.java index 62e0cc8c..adae668 100644 --- a/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerPrefs.java +++ b/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerPrefs.java
@@ -8,6 +8,7 @@ import android.os.Build; import org.chromium.base.ContextUtils; +import org.chromium.base.TraceEvent; import java.util.HashSet; import java.util.Set; @@ -84,6 +85,8 @@ /** Adds a task to scheduler's preferences, so that it can be rescheduled with OS upgrade. */ public static void addScheduledTask(TaskInfo taskInfo) { + TraceEvent.begin("BackgroundTaskSchedulerPrefs.addScheduledTask", + Integer.toString(taskInfo.getTaskId())); SharedPreferences prefs = ContextUtils.getAppSharedPreferences(); Set<String> scheduledTasks = prefs.getStringSet(KEY_SCHEDULED_TASKS, new HashSet<String>(1)); @@ -94,10 +97,13 @@ scheduledTasks = new HashSet<>(scheduledTasks); scheduledTasks.add(prefsEntry); updateScheduledTasks(prefs, scheduledTasks); + TraceEvent.end("BackgroundTaskSchedulerPrefs.addScheduledTask"); } /** Removes a task from scheduler's preferences. */ public static void removeScheduledTask(int taskId) { + TraceEvent.begin( + "BackgroundTaskSchedulerPrefs.removeScheduledTask", Integer.toString(taskId)); SharedPreferences prefs = ContextUtils.getAppSharedPreferences(); Set<String> scheduledTasks = getScheduledTaskEntries(prefs); @@ -117,10 +123,12 @@ scheduledTasks = new HashSet<>(scheduledTasks); scheduledTasks.remove(entryToRemove); updateScheduledTasks(prefs, scheduledTasks); + TraceEvent.end("BackgroundTaskSchedulerPrefs.removeScheduledTask"); } /** Gets a set of scheduled task class names. */ public static Set<String> getScheduledTasks() { + TraceEvent.begin("BackgroundTaskSchedulerPrefs.getScheduledTasks"); SharedPreferences prefs = ContextUtils.getAppSharedPreferences(); Set<String> scheduledTask = getScheduledTaskEntries(prefs); Set<String> scheduledTasksClassNames = new HashSet<>(scheduledTask.size()); @@ -131,11 +139,13 @@ } } + TraceEvent.end("BackgroundTaskSchedulerPrefs.getScheduledTasks"); return scheduledTasksClassNames; } /** Gets a set of scheduled task IDs. */ public static Set<Integer> getScheduledTaskIds() { + TraceEvent.begin("BackgroundTaskSchedulerPrefs.getScheduledTaskIds"); SharedPreferences prefs = ContextUtils.getAppSharedPreferences(); Set<String> scheduledTasks = getScheduledTaskEntries(prefs); Set<Integer> scheduledTaskIds = new HashSet<>(scheduledTasks.size()); @@ -145,26 +155,36 @@ scheduledTaskIds.add(parsed.getTaskId()); } } + + TraceEvent.end("BackgroundTaskSchedulerPrefs.getScheduledTaskIds"); return scheduledTaskIds; } /** Removes all scheduled tasks from shared preferences store. */ public static void removeAllTasks() { + TraceEvent.begin("BackgroundTaskSchedulerPrefs.removeAllTasks"); ContextUtils.getAppSharedPreferences().edit().remove(KEY_SCHEDULED_TASKS).apply(); + TraceEvent.end("BackgroundTaskSchedulerPrefs.removeAllTasks"); } /** Gets the last SDK version on which this instance ran. Defaults to current SDK version. */ public static int getLastSdkVersion() { - return ContextUtils.getAppSharedPreferences().getInt( + TraceEvent.begin("BackgroundTaskSchedulerPrefs.getLastSdkVersion"); + int sdkInt = ContextUtils.getAppSharedPreferences().getInt( KEY_LAST_SDK_VERSION, Build.VERSION.SDK_INT); + TraceEvent.end("BackgroundTaskSchedulerPrefs.getLastSdkVersion"); + return sdkInt; } /** Gets the last SDK version on which this instance ran. */ public static void setLastSdkVersion(int sdkVersion) { + TraceEvent.begin( + "BackgroundTaskSchedulerPrefs.setLastSdkVersion", Integer.toString(sdkVersion)); ContextUtils.getAppSharedPreferences() .edit() .putInt(KEY_LAST_SDK_VERSION, sdkVersion) .apply(); + TraceEvent.end("BackgroundTaskSchedulerPrefs.setLastSdkVersion"); } private static void updateScheduledTasks(SharedPreferences prefs, Set<String> tasks) {
diff --git a/components/component_updater/component_updater_service.h b/components/component_updater/component_updater_service.h index fa94e890..6ddae4a 100644 --- a/components/component_updater/component_updater_service.h +++ b/components/component_updater/component_updater_service.h
@@ -163,7 +163,7 @@ #if defined(OS_CHROMEOS) friend class CrOSComponentManager; #endif // defined(OS_CHROMEOS) - friend class VrAssetsComponentInstallerTraits; + friend class VrAssetsComponentInstallerPolicy; // Triggers an update check for a component. |id| is a value // returned by GetCrxComponentID(). If an update for this component is already
diff --git a/components/data_use_measurement/core/data_use_ascriber.cc b/components/data_use_measurement/core/data_use_ascriber.cc index 5fd4dfe..4c549c0 100644 --- a/components/data_use_measurement/core/data_use_ascriber.cc +++ b/components/data_use_measurement/core/data_use_ascriber.cc
@@ -55,7 +55,7 @@ observer.OnNetworkBytesUpdate(*request, &recorder->data_use()); } -void DataUseAscriber::OnUrlRequestCompleted(const net::URLRequest& request, +void DataUseAscriber::OnUrlRequestCompleted(net::URLRequest* request, bool started) {} void DataUseAscriber::OnUrlRequestDestroyed(net::URLRequest* request) {
diff --git a/components/data_use_measurement/core/data_use_ascriber.h b/components/data_use_measurement/core/data_use_ascriber.h index 02094697..d271883 100644 --- a/components/data_use_measurement/core/data_use_ascriber.h +++ b/components/data_use_measurement/core/data_use_ascriber.h
@@ -106,8 +106,7 @@ virtual void OnNetworkBytesSent(net::URLRequest* request, int64_t bytes_sent); virtual void OnNetworkBytesReceived(net::URLRequest* request, int64_t bytes_received); - virtual void OnUrlRequestCompleted(const net::URLRequest& request, - bool started); + virtual void OnUrlRequestCompleted(net::URLRequest* request, bool started); virtual void OnUrlRequestDestroyed(net::URLRequest* request); protected:
diff --git a/components/data_use_measurement/core/data_use_network_delegate.cc b/components/data_use_measurement/core/data_use_network_delegate.cc index c296a80..3a5f1d9 100644 --- a/components/data_use_measurement/core/data_use_network_delegate.cc +++ b/components/data_use_measurement/core/data_use_network_delegate.cc
@@ -66,7 +66,7 @@ void DataUseNetworkDelegate::OnCompletedInternal(net::URLRequest* request, bool started) { - ascriber_->OnUrlRequestCompleted(*request, started); + ascriber_->OnUrlRequestCompleted(request, started); data_use_measurement_.OnCompleted(*request, started); }
diff --git a/components/discardable_memory/client/client_discardable_shared_memory_manager.cc b/components/discardable_memory/client/client_discardable_shared_memory_manager.cc index 245bfe4..e97180e 100644 --- a/components/discardable_memory/client/client_discardable_shared_memory_manager.cc +++ b/components/discardable_memory/client/client_discardable_shared_memory_manager.cc
@@ -391,12 +391,10 @@ base::SharedMemoryHandle* handle, base::ScopedClosureRunner closure_runner, mojo::ScopedSharedBufferHandle mojo_handle) { - size_t memory_size = 0; - bool read_only = false; if (!mojo_handle.is_valid()) return; auto result = mojo::UnwrapSharedMemoryHandle(std::move(mojo_handle), handle, - &memory_size, &read_only); + nullptr, nullptr); DCHECK_EQ(result, MOJO_RESULT_OK); }
diff --git a/components/discardable_memory/service/discardable_shared_memory_manager.cc b/components/discardable_memory/service/discardable_shared_memory_manager.cc index d36d0fa..620c60e 100644 --- a/components/discardable_memory/service/discardable_shared_memory_manager.cc +++ b/components/discardable_memory/service/discardable_shared_memory_manager.cc
@@ -74,8 +74,9 @@ if (manager_) { manager_->AllocateLockedDiscardableSharedMemoryForClient(client_id_, size, id, &handle); - memory = - mojo::WrapSharedMemoryHandle(handle, size, false /* read_only */); + memory = mojo::WrapSharedMemoryHandle( + handle, size, + mojo::UnwrappedSharedMemoryHandleProtection::kReadWrite); } std::move(callback).Run(std::move(memory)); }
diff --git a/components/exo/client_controlled_shell_surface_unittest.cc b/components/exo/client_controlled_shell_surface_unittest.cc index 40a45be..78da5c0 100644 --- a/components/exo/client_controlled_shell_surface_unittest.cc +++ b/components/exo/client_controlled_shell_surface_unittest.cc
@@ -25,6 +25,10 @@ #include "components/exo/wm_helper.h" #include "ui/aura/client/aura_constants.h" #include "ui/aura/window.h" +#include "ui/aura/window_event_dispatcher.h" +#include "ui/aura/window_tree_host.h" +#include "ui/events/base_event_utils.h" +#include "ui/events/event_targeter.h" #include "ui/events/test/event_generator.h" #include "ui/views/widget/widget.h" #include "ui/wm/core/shadow.h" @@ -701,4 +705,53 @@ shell_surface->host_window()->layer()->GetTargetTransform().ToString()); } +TEST_F(ClientControlledShellSurfaceTest, MouseAndTouchTarget) { + gfx::Size buffer_size(256, 256); + std::unique_ptr<Buffer> buffer( + new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size))); + std::unique_ptr<Surface> surface(new Surface); + auto shell_surface( + exo_test_helper()->CreateClientControlledShellSurface(surface.get())); + + const gfx::Rect original_bounds(0, 0, 256, 256); + shell_surface->SetGeometry(original_bounds); + shell_surface->set_client_controlled_move_resize(false); + surface->Attach(buffer.get()); + surface->Commit(); + + EXPECT_TRUE(shell_surface->CanResize()); + + aura::Window* window = shell_surface->GetWidget()->GetNativeWindow(); + aura::Window* root = window->GetRootWindow(); + ui::EventTargeter* targeter = + root->GetHost()->dispatcher()->GetDefaultEventTargeter(); + + gfx::Point mouse_location(256 + 5, 150); + + ui::MouseEvent mouse(ui::ET_MOUSE_MOVED, mouse_location, mouse_location, + ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE); + EXPECT_EQ(window, targeter->FindTargetForEvent(root, &mouse)); + + // Move 20px further away. Touch event can hit the window but + // mouse event will not. + gfx::Point touch_location(256 + 25, 150); + ui::MouseEvent touch(ui::ET_TOUCH_PRESSED, touch_location, touch_location, + ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE); + EXPECT_EQ(window, targeter->FindTargetForEvent(root, &touch)); + + ui::MouseEvent mouse_with_touch_loc(ui::ET_MOUSE_MOVED, touch_location, + touch_location, ui::EventTimeForNow(), + ui::EF_NONE, ui::EF_NONE); + EXPECT_FALSE(window->Contains(static_cast<aura::Window*>( + targeter->FindTargetForEvent(root, &mouse_with_touch_loc)))); + + // Touching futher away shouldn't hit the window. + gfx::Point no_touch_location(256 + 35, 150); + ui::MouseEvent no_touch(ui::ET_TOUCH_PRESSED, no_touch_location, + no_touch_location, ui::EventTimeForNow(), ui::EF_NONE, + ui::EF_NONE); + EXPECT_FALSE(window->Contains(static_cast<aura::Window*>( + targeter->FindTargetForEvent(root, &no_touch)))); +} + } // namespace exo
diff --git a/components/exo/keyboard.cc b/components/exo/keyboard.cc index f5a9f9e..b42fb115 100644 --- a/components/exo/keyboard.cc +++ b/components/exo/keyboard.cc
@@ -134,6 +134,11 @@ return false; } +// Returns false if an accelerator is not reserved or it's not enabled. +bool ProcessAcceleratorIfReserved(Surface* surface, ui::KeyEvent* event) { + return IsReservedAccelerator(event) && ProcessAccelerator(surface, event); +} + } // namespace //////////////////////////////////////////////////////////////////////////////// @@ -218,6 +223,17 @@ delegate_->OnKeyboardModifiers(modifier_flags_); } + // Process reserved accelerators before sending it to client. + if (focus_ && ProcessAcceleratorIfReserved(focus_, event)) { + // Discard a key press event if it's a reserved accelerator and it's + // enabled. + event->SetHandled(); + // Send leave/enter event instead of key event, so the client can know the + // actual state of the keyboard. + SetFocus(focus_); + return; + } + // When IME ate a key event, we use the event only for tracking key states and // ignore for further processing. Otherwise it is handled in two places (IME // and client) and causes undesired behavior. @@ -225,7 +241,7 @@ switch (event->type()) { case ui::ET_KEY_PRESSED: - if (focus_ && !consumed_by_ime && !IsReservedAccelerator(event)) { + if (focus_ && !consumed_by_ime && !event->handled()) { uint32_t serial = delegate_->OnKeyboardKey(event->time_stamp(), event->code(), true); if (are_keyboard_key_acks_needed_) { @@ -238,7 +254,7 @@ } break; case ui::ET_KEY_RELEASED: - if (focus_ && !consumed_by_ime && !IsReservedAccelerator(event)) { + if (focus_ && !consumed_by_ime && !event->handled()) { uint32_t serial = delegate_->OnKeyboardKey(event->time_stamp(), event->code(), false); if (are_keyboard_key_acks_needed_) {
diff --git a/components/exo/shell_surface_base.cc b/components/exo/shell_surface_base.cc index b3ba732..6463c48 100644 --- a/components/exo/shell_surface_base.cc +++ b/components/exo/shell_surface_base.cc
@@ -159,16 +159,15 @@ class CustomWindowTargeter : public aura::WindowTargeter { public: - CustomWindowTargeter(views::Widget* widget) : widget_(widget) {} + CustomWindowTargeter(views::Widget* widget, + bool client_controlled_move_resize) + : widget_(widget), + client_controlled_move_resize_(client_controlled_move_resize) {} ~CustomWindowTargeter() override {} // Overridden from aura::WindowTargeter: bool EventLocationInsideBounds(aura::Window* window, const ui::LocatedEvent& event) const override { - Surface* surface = ShellSurfaceBase::GetMainSurface(window); - if (!surface) - return false; - gfx::Point local_point = event.location(); if (window->parent()) { @@ -176,6 +175,13 @@ &local_point); } + if (IsInResizeHandle(window, event, local_point)) + return true; + + Surface* surface = ShellSurfaceBase::GetMainSurface(window); + if (!surface) + return false; + int component = widget_->non_client_view()->NonClientHitTest(local_point); if (component != HTNOWHERE && component != HTCLIENT) return true; @@ -185,7 +191,52 @@ } private: + bool IsInResizeHandle(aura::Window* window, + const ui::LocatedEvent& event, + const gfx::Point& local_point) const { + if (window != widget_->GetNativeWindow() || + !widget_->widget_delegate()->CanResize()) { + return false; + } + + // Use ash's resize handle detection logic if + // a) ClientControlledShellSurface uses server side resize or + // b) xdg shell is using the server side decoration. + if (ash::wm::GetWindowState(widget_->GetNativeWindow()) + ->allow_set_bounds_direct() + ? client_controlled_move_resize_ + : !widget_->non_client_view()->frame_view()->enabled()) { + return false; + } + + ui::EventTarget* parent = + static_cast<ui::EventTarget*>(window)->GetParentTarget(); + if (parent) { + aura::WindowTargeter* parent_targeter = + static_cast<aura::WindowTargeter*>(parent->GetEventTargeter()); + + if (parent_targeter) { + gfx::Rect mouse_rect; + gfx::Rect touch_rect; + + if (parent_targeter->GetHitTestRects(window, &mouse_rect, + &touch_rect)) { + const gfx::Vector2d offset = -window->bounds().OffsetFromOrigin(); + mouse_rect.Offset(offset); + touch_rect.Offset(offset); + if (event.IsTouchEvent() || event.IsGestureEvent() + ? touch_rect.Contains(local_point) + : mouse_rect.Contains(local_point)) { + return true; + } + } + } + } + return false; + } + views::Widget* const widget_; + const bool client_controlled_move_resize_; DISALLOW_COPY_AND_ASSIGN(CustomWindowTargeter); }; @@ -1031,7 +1082,8 @@ // events. window->SetEventTargetingPolicy( ui::mojom::EventTargetingPolicy::DESCENDANTS_ONLY); - window->SetEventTargeter(base::WrapUnique(new CustomWindowTargeter(widget_))); + window->SetEventTargeter(base::WrapUnique( + new CustomWindowTargeter(widget_, client_controlled_move_resize_))); SetApplicationId(window, application_id_); SetMainSurface(window, root_surface());
diff --git a/components/flags_ui/flags_state.cc b/components/flags_ui/flags_state.cc index 5ee6372..fba9512d 100644 --- a/components/flags_ui/flags_state.cc +++ b/components/flags_ui/flags_state.cc
@@ -4,10 +4,12 @@ #include "components/flags_ui/flags_state.h" +#include <algorithm> #include <memory> #include <utility> #include "base/callback.h" +#include "base/containers/span.h" #include "base/feature_list.h" #include "base/logging.h" #include "base/macros.h" @@ -41,6 +43,25 @@ return cmd_line.argv()[1]; } +// Return the span between the first occurrence of |begin_sentinel_switch| and +// the last occurrence of |end_sentinel_switch|. +base::span<const base::CommandLine::StringType> GetSwitchesBetweenSentinels( + const base::CommandLine::StringVector& switches, + const base::CommandLine::StringType& begin_sentinel_switch, + const base::CommandLine::StringType& end_sentinel_switch) { + const auto first = + std::find(switches.begin(), switches.end(), begin_sentinel_switch); + if (first == switches.end()) + return {}; + // Go backwards in order to find the last occurrence (as opposed to + // std::find() which would return the first one). + for (auto last = --switches.end(); last != first; --last) { + if (*last == end_sentinel_switch) + return base::make_span(&first[1], last - first - 1); + } + return {}; +} + // Scoops flags from a command line. // Only switches between --flag-switches-begin and --flag-switches-end are // compared. The embedder may use |extra_flag_sentinel_begin_flag_name| and @@ -53,24 +74,18 @@ !!extra_flag_sentinel_end_flag_name); std::set<base::CommandLine::StringType> flags; // First do the ones between --flag-switches-begin and --flag-switches-end. - base::CommandLine::StringVector::const_iterator first = - std::find(cmdline.argv().begin(), cmdline.argv().end(), - GetSwitchString(switches::kFlagSwitchesBegin)); - base::CommandLine::StringVector::const_iterator last = - std::find(cmdline.argv().begin(), cmdline.argv().end(), - GetSwitchString(switches::kFlagSwitchesEnd)); - if (first != cmdline.argv().end() && last != cmdline.argv().end()) - flags.insert(first + 1, last); + const auto flags_span = GetSwitchesBetweenSentinels( + cmdline.argv(), GetSwitchString(switches::kFlagSwitchesBegin), + GetSwitchString(switches::kFlagSwitchesEnd)); + flags.insert(flags_span.begin(), flags_span.end()); // Then add those between the extra sentinels. if (extra_flag_sentinel_begin_flag_name && extra_flag_sentinel_end_flag_name) { - first = std::find(cmdline.argv().begin(), cmdline.argv().end(), - GetSwitchString(extra_flag_sentinel_begin_flag_name)); - last = std::find(cmdline.argv().begin(), cmdline.argv().end(), - GetSwitchString(extra_flag_sentinel_end_flag_name)); - if (first != cmdline.argv().end() && last != cmdline.argv().end()) - flags.insert(first + 1, last); + const auto extra_flags_span = GetSwitchesBetweenSentinels( + cmdline.argv(), GetSwitchString(extra_flag_sentinel_begin_flag_name), + GetSwitchString(extra_flag_sentinel_end_flag_name)); + flags.insert(extra_flags_span.begin(), extra_flags_span.end()); } return flags; }
diff --git a/components/flags_ui/flags_state_unittest.cc b/components/flags_ui/flags_state_unittest.cc index 11bf0ffc..9524d90 100644 --- a/components/flags_ui/flags_state_unittest.cc +++ b/components/flags_ui/flags_state_unittest.cc
@@ -63,6 +63,9 @@ const char kEnableFeatures[] = "dummy-enable-features"; const char kDisableFeatures[] = "dummy-disable-features"; +const char kDummySentinelBeginSwitch[] = "dummy-begin"; +const char kDummySentinelEndSwitch[] = "dummy-end"; + const char kTestTrial[] = "TestTrial"; const char kTestParam1[] = "param1"; const char kTestParam2[] = "param2"; @@ -382,6 +385,9 @@ } TEST_F(FlagsStateTest, CompareSwitchesToCurrentCommandLine) { + // Start with the active command line containing no flags, and the new command + // line having the |kFlags1| flag. + flags_state_->SetFeatureEntryEnabled(&flags_storage_, kFlags1, true); const std::string kDoubleDash("--"); @@ -404,6 +410,8 @@ EXPECT_EQ(1U, difference.count(CreateSwitch(kDoubleDash + kSwitch1))); } + // Now both command lines have the |kFlags1| flag. + flags_state_->ConvertFlagsToSwitches(&flags_storage_, &command_line, kAddSentinels, kEnableFeatures, kDisableFeatures); @@ -417,7 +425,9 @@ EXPECT_TRUE(difference.empty()); } - // Now both have flags but different. + // Now the active command line has the |kFlags2| flag, and the new command + // line has the |kFlags1| flag. + flags_state_->SetFeatureEntryEnabled(&flags_storage_, kFlags1, false); flags_state_->SetFeatureEntryEnabled(&flags_storage_, kFlags2, true); @@ -437,6 +447,59 @@ EXPECT_EQ(1U, difference.count(CreateSwitch(kDoubleDash + kSwitch2 + "=" + kValueForSwitch2))); } + + // Now both command lines have both flags |kFlags1| and |kFlags2|, but each + // flag is surrounded by dummy sentinels in one of the command lines. + + new_command_line.AppendSwitch(kDummySentinelBeginSwitch); + flags_state_->ConvertFlagsToSwitches(&flags_storage_, &new_command_line, + kNoSentinels, kEnableFeatures, + kDisableFeatures); + new_command_line.AppendSwitch(kDummySentinelEndSwitch); + + flags_state_->SetFeatureEntryEnabled(&flags_storage_, kFlags1, true); + flags_state_->SetFeatureEntryEnabled(&flags_storage_, kFlags2, false); + + another_command_line.AppendSwitch(kDummySentinelBeginSwitch); + flags_state_->ConvertFlagsToSwitches(&flags_storage_, &another_command_line, + kNoSentinels, kEnableFeatures, + kDisableFeatures); + another_command_line.AppendSwitch(kDummySentinelEndSwitch); + + EXPECT_FALSE(FlagsState::AreSwitchesIdenticalToCurrentCommandLine( + new_command_line, another_command_line, nullptr, nullptr, nullptr)); + EXPECT_TRUE(FlagsState::AreSwitchesIdenticalToCurrentCommandLine( + new_command_line, another_command_line, nullptr, + kDummySentinelBeginSwitch, kDummySentinelEndSwitch)); + + // Now the new command line additionally contains |kFlags3|, which is + // followed by another dummy end sentinel. + + flags_state_->SetFeatureEntryEnabled(&flags_storage_, kFlags1, false); + flags_state_->SetFeatureEntryEnabled(&flags_storage_, kFlags3, true); + + flags_state_->ConvertFlagsToSwitches(&flags_storage_, &new_command_line, + kNoSentinels, kEnableFeatures, + kDisableFeatures); + new_command_line.AppendSwitch(kDummySentinelEndSwitch); + + EXPECT_FALSE(FlagsState::AreSwitchesIdenticalToCurrentCommandLine( + new_command_line, another_command_line, nullptr, + kDummySentinelBeginSwitch, kDummySentinelEndSwitch)); + + // Now both command lines contain the |kFlags3| flag followed by the second + // dummy end sentinel. + + flags_state_->ConvertFlagsToSwitches(&flags_storage_, &another_command_line, + kNoSentinels, kEnableFeatures, + kDisableFeatures); + another_command_line.AppendSwitch(kDummySentinelEndSwitch); + + EXPECT_FALSE(FlagsState::AreSwitchesIdenticalToCurrentCommandLine( + new_command_line, another_command_line, nullptr, nullptr, nullptr)); + EXPECT_TRUE(FlagsState::AreSwitchesIdenticalToCurrentCommandLine( + new_command_line, another_command_line, nullptr, + kDummySentinelBeginSwitch, kDummySentinelEndSwitch)); } TEST_F(FlagsStateTest, RemoveFlagSwitches) {
diff --git a/components/metrics/net/network_metrics_provider_unittest.cc b/components/metrics/net/network_metrics_provider_unittest.cc index e4e9012..a15a368 100644 --- a/components/metrics/net/network_metrics_provider_unittest.cc +++ b/components/metrics/net/network_metrics_provider_unittest.cc
@@ -87,8 +87,7 @@ // Set RTT so that the effective connection type is computed as 2G. estimator.set_recent_http_rtt(base::TimeDelta::FromMilliseconds(1500)); - estimator.set_start_time_null_http_rtt( - base::TimeDelta::FromMilliseconds(1500)); + estimator.SetStartTimeNullHttpRtt(base::TimeDelta::FromMilliseconds(1500)); EXPECT_EQ(net::EFFECTIVE_CONNECTION_TYPE_UNKNOWN, network_metrics_provider.effective_connection_type_); EXPECT_EQ(net::EFFECTIVE_CONNECTION_TYPE_UNKNOWN, @@ -112,8 +111,7 @@ // Set RTT so that the effective connection type is computed as SLOW_2G. estimator.set_recent_http_rtt(base::TimeDelta::FromMilliseconds(3000)); - estimator.set_start_time_null_http_rtt( - base::TimeDelta::FromMilliseconds(3000)); + estimator.SetStartTimeNullHttpRtt(base::TimeDelta::FromMilliseconds(3000)); // Running a request would cause the effective connection type to be computed // as SLOW_2G, and observers to be notified. estimator.RunOneRequest(); @@ -160,8 +158,7 @@ // Set RTT so that the effective connection type is computed as 2G. estimator.set_recent_http_rtt(base::TimeDelta::FromMilliseconds(1500)); - estimator.set_start_time_null_http_rtt( - base::TimeDelta::FromMilliseconds(1500)); + estimator.SetStartTimeNullHttpRtt(base::TimeDelta::FromMilliseconds(1500)); // Running a request would cause the effective connection type to be computed // as 2G, and observers to be notified. estimator.RunOneRequest();
diff --git a/components/offline_pages/core/model/offline_page_model_taskified.h b/components/offline_pages/core/model/offline_page_model_taskified.h index 330abb3f..0045ee29 100644 --- a/components/offline_pages/core/model/offline_page_model_taskified.h +++ b/components/offline_pages/core/model/offline_page_model_taskified.h
@@ -46,7 +46,6 @@ // executing various tasks, including database operation or other process that // needs to run on a background thread. class OfflinePageModelTaskified : public OfflinePageModel, - public KeyedService, public TaskQueue::Delegate { public: // Initial delay after which a list of items for upgrade will be generated.
diff --git a/components/offline_pages/core/offline_page_feature.cc b/components/offline_pages/core/offline_page_feature.cc index cf2b99f..59aaf91 100644 --- a/components/offline_pages/core/offline_page_feature.cc +++ b/components/offline_pages/core/offline_page_feature.cc
@@ -100,8 +100,8 @@ } bool IsLimitlessPrefetchingEnabled() { - return IsPrefetchingOfflinePagesEnabled() && - base::FeatureList::IsEnabled(kOfflinePagesLimitlessPrefetchingFeature); + // TODO(https://crbug.com/803584): fix limitless mode or fully remove it. + return false; } bool IsOfflinePagesLoadSignalCollectingEnabled() {
diff --git a/components/offline_pages/core/offline_page_feature_unittest.cc b/components/offline_pages/core/offline_page_feature_unittest.cc index c51d5ba..f3673276 100644 --- a/components/offline_pages/core/offline_page_feature_unittest.cc +++ b/components/offline_pages/core/offline_page_feature_unittest.cc
@@ -102,13 +102,14 @@ // Check if helper method works correctly when all required features are // enabled. + // TODO(https://crbug.com/803584): fix limitless mode or fully remove it. { base::test::ScopedFeatureList scoped_feature_list; scoped_feature_list.InitWithFeatures( {kPrefetchingOfflinePagesFeature, kOfflinePagesLimitlessPrefetchingFeature}, {}); - EXPECT_TRUE(offline_pages::IsLimitlessPrefetchingEnabled()); + EXPECT_FALSE(offline_pages::IsLimitlessPrefetchingEnabled()); } }
diff --git a/components/offline_pages/core/offline_page_model.h b/components/offline_pages/core/offline_page_model.h index b63927d..d50ee959 100644 --- a/components/offline_pages/core/offline_page_model.h +++ b/components/offline_pages/core/offline_page_model.h
@@ -13,6 +13,7 @@ #include <vector> #include "base/supports_user_data.h" +#include "components/keyed_service/core/keyed_service.h" #include "components/offline_pages/core/offline_event_logger.h" #include "components/offline_pages/core/offline_page_archiver.h" #include "components/offline_pages/core/offline_page_model_query.h" @@ -42,7 +43,7 @@ // // TODO(fgorski): Things to describe: // * how to cancel requests and what to expect -class OfflinePageModel : public base::SupportsUserData { +class OfflinePageModel : public base::SupportsUserData, public KeyedService { public: // Describes the parameters to control how to save a page. struct SavePageParams {
diff --git a/components/offline_pages/core/offline_page_model_impl.h b/components/offline_pages/core/offline_page_model_impl.h index e2b117b9..d4fb7779 100644 --- a/components/offline_pages/core/offline_page_model_impl.h +++ b/components/offline_pages/core/offline_page_model_impl.h
@@ -52,7 +52,7 @@ // Implementation of service for saving pages offline, storing the offline // copy and metadata, and retrieving them upon request. -class OfflinePageModelImpl : public OfflinePageModel, public KeyedService { +class OfflinePageModelImpl : public OfflinePageModel { public: // All blocking calls/disk access will happen on the provided |task_runner|. OfflinePageModelImpl(
diff --git a/components/offline_pages/core/prefetch/download_archives_task_unittest.cc b/components/offline_pages/core/prefetch/download_archives_task_unittest.cc index e5b0149..d4e559f 100644 --- a/components/offline_pages/core/prefetch/download_archives_task_unittest.cc +++ b/components/offline_pages/core/prefetch/download_archives_task_unittest.cc
@@ -318,8 +318,9 @@ kSmallArchiveSize / 1024, DownloadArchivesTask::kMaxConcurrentDownloads); } +// TODO(https://crbug.com/803584): fix limitless mode or fully remove it. TEST_F(DownloadArchivesTaskTest, - ManyLargeArchivesToDownloadWithLimitlessEnabled) { + DISABLED_ManyLargeArchivesToDownloadWithLimitlessEnabled) { // Enable limitless prefetching. base::test::ScopedFeatureList scoped_feature_list; scoped_feature_list.InitWithFeatures(
diff --git a/components/password_manager/core/browser/password_form_manager_unittest.cc b/components/password_manager/core/browser/password_form_manager_unittest.cc index b062d64..9f66ed3 100644 --- a/components/password_manager/core/browser/password_form_manager_unittest.cc +++ b/components/password_manager/core/browser/password_form_manager_unittest.cc
@@ -297,11 +297,12 @@ } // Workaround for std::unique_ptr<> lacking a copy constructor. - void StartUploadProcess(std::unique_ptr<FormStructure> form_structure, + bool StartUploadProcess(std::unique_ptr<FormStructure> form_structure, const base::TimeTicks& timestamp, bool observed_submission) { StartUploadProcessPtr(form_structure.release(), timestamp, observed_submission); + return true; } MOCK_METHOD3(StartUploadProcessPtr,
diff --git a/components/policy/core/browser/browser_policy_connector_base.cc b/components/policy/core/browser/browser_policy_connector_base.cc index 4cab3f4..35ce760 100644 --- a/components/policy/core/browser/browser_policy_connector_base.cc +++ b/components/policy/core/browser/browser_policy_connector_base.cc
@@ -13,6 +13,7 @@ #include "components/policy/core/common/policy_namespace.h" #include "components/policy/core/common/policy_service_impl.h" #include "components/policy/policy_constants.h" +#include "ui/base/resource/resource_bundle.h" namespace policy { @@ -95,6 +96,12 @@ g_testing_provider = provider; } +void BrowserPolicyConnectorBase::NotifyWhenResourceBundleReady( + base::OnceClosure closure) { + DCHECK(!ui::ResourceBundle::HasSharedInstance()); + resource_bundle_callbacks_.push_back(std::move(closure)); +} + // static ConfigurationPolicyProvider* BrowserPolicyConnectorBase::GetPolicyProviderForTesting() { @@ -140,4 +147,11 @@ return providers; } +void BrowserPolicyConnectorBase::OnResourceBundleCreated() { + std::vector<base::OnceClosure> resource_bundle_callbacks; + std::swap(resource_bundle_callbacks, resource_bundle_callbacks_); + for (auto& closure : resource_bundle_callbacks) + std::move(closure).Run(); +} + } // namespace policy
diff --git a/components/policy/core/browser/browser_policy_connector_base.h b/components/policy/core/browser/browser_policy_connector_base.h index dbe1af9..a7674b5 100644 --- a/components/policy/core/browser/browser_policy_connector_base.h +++ b/components/policy/core/browser/browser_policy_connector_base.h
@@ -8,6 +8,7 @@ #include <memory> #include <vector> +#include "base/callback_forward.h" #include "base/macros.h" #include "base/optional.h" #include "components/policy/core/browser/configuration_policy_handler_list.h" @@ -63,6 +64,9 @@ ConfigurationPolicyProvider* provider); ConfigurationPolicyProvider* GetPolicyProviderForTesting(); + // Adds a callback that is notified the the ResourceBundle is loaded. + void NotifyWhenResourceBundleReady(base::OnceClosure closure); + protected: // Builds an uninitialized BrowserPolicyConnectorBase. SetPolicyProviders() // should be called to create and start the policy components. @@ -74,6 +78,10 @@ void SetPolicyProviders( std::vector<std::unique_ptr<ConfigurationPolicyProvider>> providers); + // Must be called when ui::ResourceBundle has been loaded, results in running + // any callbacks scheduled in NotifyWhenResourceBundleReady(). + void OnResourceBundleCreated(); + private: // Returns the providers to pass to the PolicyService. Generally this is the // same as |policy_providers_|, unless SetPolicyProviderForTesting() has been @@ -103,6 +111,9 @@ // Must be deleted before all the policy providers. std::unique_ptr<PolicyServiceImpl> policy_service_; + // Callbacks scheduled via NotifyWhenResourceBundleReady(). + std::vector<base::OnceClosure> resource_bundle_callbacks_; + DISALLOW_COPY_AND_ASSIGN(BrowserPolicyConnectorBase); };
diff --git a/components/policy/core/browser/configuration_policy_pref_store.cc b/components/policy/core/browser/configuration_policy_pref_store.cc index 56e7ef0..94a2c13 100644 --- a/components/policy/core/browser/configuration_policy_pref_store.cc +++ b/components/policy/core/browser/configuration_policy_pref_store.cc
@@ -10,10 +10,9 @@ #include "base/bind.h" #include "base/location.h" #include "base/logging.h" -#include "base/single_thread_task_runner.h" #include "base/strings/string16.h" #include "base/strings/utf_string_conversions.h" -#include "base/threading/thread_task_runner_handle.h" +#include "components/policy/core/browser/browser_policy_connector_base.h" #include "components/policy/core/browser/configuration_policy_handler_list.h" #include "components/policy/core/browser/policy_error_map.h" #include "components/prefs/pref_value_map.h" @@ -22,14 +21,11 @@ namespace { -// Policies are loaded early on startup, before PolicyErrorMaps are ready to -// be retrieved. This function is posted to UI to log any errors found on -// Refresh below. -void LogErrors(PolicyErrorMap* errors) { - PolicyErrorMap::const_iterator iter; - for (iter = errors->begin(); iter != errors->end(); ++iter) { - base::string16 policy = base::ASCIIToUTF16(iter->first); - DLOG(WARNING) << "Policy " << policy << ": " << iter->second; +void LogErrors(std::unique_ptr<PolicyErrorMap> errors) { + DCHECK(errors->IsReady()); + for (auto& pair : *errors) { + base::string16 policy = base::ASCIIToUTF16(pair.first); + DLOG(WARNING) << "Policy " << policy << ": " << pair.second; } } @@ -40,10 +36,12 @@ } // namespace ConfigurationPolicyPrefStore::ConfigurationPolicyPrefStore( + BrowserPolicyConnectorBase* policy_connector, PolicyService* service, const ConfigurationPolicyHandlerList* handler_list, PolicyLevel level) - : policy_service_(service), + : policy_connector_(policy_connector), + policy_service_(service), handler_list_(handler_list), level_(level) { // Read initial policy. @@ -129,16 +127,20 @@ PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()))); filtered_policies.EraseNonmatching(base::Bind(&IsLevel, level_)); - std::unique_ptr<PolicyErrorMap> errors(new PolicyErrorMap); + std::unique_ptr<PolicyErrorMap> errors = std::make_unique<PolicyErrorMap>(); handler_list_->ApplyPolicySettings(filtered_policies, prefs.get(), errors.get()); - // Retrieve and log the errors once the UI loop is ready. This is only an - // issue during startup. - base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(&LogErrors, base::Owned(errors.release()))); + if (!errors->empty()) { + if (errors->IsReady()) { + LogErrors(std::move(errors)); + } else if (policy_connector_) { // May be null in tests. + policy_connector_->NotifyWhenResourceBundleReady( + base::BindOnce(&LogErrors, std::move(errors))); + } + } return prefs.release(); }
diff --git a/components/policy/core/browser/configuration_policy_pref_store.h b/components/policy/core/browser/configuration_policy_pref_store.h index 87e1992..c742a5f6 100644 --- a/components/policy/core/browser/configuration_policy_pref_store.h +++ b/components/policy/core/browser/configuration_policy_pref_store.h
@@ -21,6 +21,7 @@ namespace policy { +class BrowserPolicyConnectorBase; class ConfigurationPolicyHandlerList; // An implementation of PrefStore that bridges policy settings as read from the @@ -33,6 +34,7 @@ // Does not take ownership of |service| nor |handler_list|, which must outlive // the store. Only policies of the given |level| will be mapped. ConfigurationPolicyPrefStore( + BrowserPolicyConnectorBase* policy_connector, PolicyService* service, const ConfigurationPolicyHandlerList* handler_list, PolicyLevel level); @@ -63,6 +65,9 @@ // to the policies currently provided by the policy service. PrefValueMap* CreatePreferencesFromPolicies(); + // May be null in tests. + BrowserPolicyConnectorBase* policy_connector_; + // The PolicyService from which policy settings are read. PolicyService* policy_service_;
diff --git a/components/policy/core/browser/configuration_policy_pref_store_test.cc b/components/policy/core/browser/configuration_policy_pref_store_test.cc index 6a9bfac2..fbdc51e9 100644 --- a/components/policy/core/browser/configuration_policy_pref_store_test.cc +++ b/components/policy/core/browser/configuration_policy_pref_store_test.cc
@@ -33,7 +33,7 @@ policy_service_ = std::make_unique<PolicyServiceImpl>(); policy_service_->SetProviders(providers_); store_ = new ConfigurationPolicyPrefStore( - policy_service_.get(), &handler_list_, POLICY_LEVEL_MANDATORY); + nullptr, policy_service_.get(), &handler_list_, POLICY_LEVEL_MANDATORY); } ConfigurationPolicyPrefStoreTest::~ConfigurationPolicyPrefStoreTest() {}
diff --git a/components/policy/core/browser/policy_error_map.cc b/components/policy/core/browser/policy_error_map.cc index 0dadd94..8312ab9 100644 --- a/components/policy/core/browser/policy_error_map.cc +++ b/components/policy/core/browser/policy_error_map.cc
@@ -197,9 +197,10 @@ return base::JoinString(list, base::ASCIIToUTF16("\n")); } -bool PolicyErrorMap::empty() { - CheckReadyAndConvert(); - return map_.empty(); +bool PolicyErrorMap::empty() const { + // This doesn't call CheckReadyAndConvert() to allow code to destroy empty + // PolicyErrorMaps rather than having to wait for ResourceBundle to be ready. + return pending_.empty() && map_.empty(); } size_t PolicyErrorMap::size() {
diff --git a/components/policy/core/browser/policy_error_map.h b/components/policy/core/browser/policy_error_map.h index 6b1543d1b..4922ef6 100644 --- a/components/policy/core/browser/policy_error_map.h +++ b/components/policy/core/browser/policy_error_map.h
@@ -83,7 +83,7 @@ // space. Returns an empty string if there are no errors for |policy|. base::string16 GetErrors(const std::string& policy); - bool empty(); + bool empty() const; size_t size(); const_iterator begin();
diff --git a/components/policy/core/browser/proxy_policy_handler_unittest.cc b/components/policy/core/browser/proxy_policy_handler_unittest.cc index 4095533..8ee3593 100644 --- a/components/policy/core/browser/proxy_policy_handler_unittest.cc +++ b/components/policy/core/browser/proxy_policy_handler_unittest.cc
@@ -35,7 +35,7 @@ policy_service_ = std::make_unique<PolicyServiceImpl>(); policy_service_->SetProviders(providers_); store_ = new ConfigurationPolicyPrefStore( - policy_service_.get(), &handler_list_, POLICY_LEVEL_MANDATORY); + nullptr, policy_service_.get(), &handler_list_, POLICY_LEVEL_MANDATORY); } protected:
diff --git a/components/prefs/pref_registry_simple.cc b/components/prefs/pref_registry_simple.cc index c19825e..f7d1ef3 100644 --- a/components/prefs/pref_registry_simple.cc +++ b/components/prefs/pref_registry_simple.cc
@@ -83,6 +83,12 @@ NO_REGISTRATION_FLAGS); } +void PrefRegistrySimple::RegisterTimePref(const std::string& path, + base::Time default_value) { + RegisterInt64Pref(path, + default_value.ToDeltaSinceWindowsEpoch().InMicroseconds()); +} + void PrefRegistrySimple::RegisterBooleanPref(const std::string& path, bool default_value, uint32_t flags) { @@ -154,3 +160,10 @@ path, std::make_unique<base::Value>(base::NumberToString(default_value)), flags); } + +void PrefRegistrySimple::RegisterTimePref(const std::string& path, + base::Time default_value, + uint32_t flags) { + RegisterInt64Pref( + path, default_value.ToDeltaSinceWindowsEpoch().InMicroseconds(), flags); +}
diff --git a/components/prefs/pref_registry_simple.h b/components/prefs/pref_registry_simple.h index bd2370d..e68301c 100644 --- a/components/prefs/pref_registry_simple.h +++ b/components/prefs/pref_registry_simple.h
@@ -11,6 +11,7 @@ #include <string> #include "base/macros.h" +#include "base/time/time.h" #include "components/prefs/pref_registry.h" #include "components/prefs/prefs_export.h" @@ -41,6 +42,7 @@ std::unique_ptr<base::DictionaryValue> default_value); void RegisterInt64Pref(const std::string& path, int64_t default_value); void RegisterUint64Pref(const std::string&, uint64_t default_value); + void RegisterTimePref(const std::string& path, base::Time default_value); // Versions of registration functions that accept PrefRegistrationFlags. // |flags| is a bitmask of PrefRegistrationFlags. @@ -74,6 +76,9 @@ void RegisterUint64Pref(const std::string&, uint64_t default_value, uint32_t flags); + void RegisterTimePref(const std::string&, + base::Time default_value, + uint32_t flags); protected: ~PrefRegistrySimple() override;
diff --git a/components/prefs/pref_service.cc b/components/prefs/pref_service.cc index c96a044a..592d429 100644 --- a/components/prefs/pref_service.cc +++ b/components/prefs/pref_service.cc
@@ -469,6 +469,15 @@ return val; } +void PrefService::SetTime(const std::string& path, base::Time value) { + SetInt64(path, value.ToDeltaSinceWindowsEpoch().InMicroseconds()); +} + +base::Time PrefService::GetTime(const std::string& path) const { + return base::Time::FromDeltaSinceWindowsEpoch( + base::TimeDelta::FromMicroseconds(GetInt64(path))); +} + base::Value* PrefService::GetMutableUserPref(const std::string& path, base::Value::Type type) { CHECK(type == base::Value::Type::DICTIONARY ||
diff --git a/components/prefs/pref_service.h b/components/prefs/pref_service.h index 2a013aa..68b5439 100644 --- a/components/prefs/pref_service.h +++ b/components/prefs/pref_service.h
@@ -24,6 +24,7 @@ #include "base/memory/ref_counted.h" #include "base/observer_list.h" #include "base/sequence_checker.h" +#include "base/time/time.h" #include "base/values.h" #include "components/prefs/persistent_pref_store.h" #include "components/prefs/prefs_export.h" @@ -243,6 +244,13 @@ void SetUint64(const std::string& path, uint64_t value); uint64_t GetUint64(const std::string& path) const; + // Time helper methods that actually store the given value as a string, which + // represents the number of microseconds elapsed since the Windows epoch. Note + // that if obtaining the named value via GetDictionary or GetList, the Value + // type will be Type::STRING. + void SetTime(const std::string& path, base::Time value); + base::Time GetTime(const std::string& path) const; + // Returns the value of the given preference, from the user pref store. If // the preference is not set in the user pref store, returns NULL. const base::Value* GetUserPrefValue(const std::string& path) const;
diff --git a/components/prefs/pref_service_unittest.cc b/components/prefs/pref_service_unittest.cc index 5df7851..c1ee360d 100644 --- a/components/prefs/pref_service_unittest.cc +++ b/components/prefs/pref_service_unittest.cc
@@ -8,6 +8,7 @@ #include <string> #include "base/macros.h" +#include "base/time/time.h" #include "base/values.h" #include "components/prefs/json_pref_store.h" #include "components/prefs/mock_pref_change_callback.h" @@ -231,6 +232,33 @@ EXPECT_EQ(kRecommendedValue, actual_int_value); } +TEST(PrefServiceTest, SetTimeValue_RegularTime) { + TestingPrefServiceSimple prefs; + + // Register a null time as the default. + prefs.registry()->RegisterTimePref(kPrefName, base::Time()); + EXPECT_TRUE(prefs.GetTime(kPrefName).is_null()); + + // Set a time and make sure that we can read it without any loss of precision. + const base::Time time = base::Time::Now(); + prefs.SetTime(kPrefName, time); + EXPECT_EQ(time, prefs.GetTime(kPrefName)); +} + +TEST(PrefServiceTest, SetTimeValue_NullTime) { + TestingPrefServiceSimple prefs; + + // Register a non-null time as the default. + const base::Time default_time = base::Time::FromDeltaSinceWindowsEpoch( + base::TimeDelta::FromMicroseconds(12345)); + prefs.registry()->RegisterTimePref(kPrefName, default_time); + EXPECT_FALSE(prefs.GetTime(kPrefName).is_null()); + + // Set a null time and make sure that it remains null upon deserialization. + prefs.SetTime(kPrefName, base::Time()); + EXPECT_TRUE(prefs.GetTime(kPrefName).is_null()); +} + // A PrefStore which just stores the last write flags that were used to write // values to it. class WriteFlagChecker : public TestingPrefStore {
diff --git a/components/printing/browser/print_composite_client.h b/components/printing/browser/print_composite_client.h index e157eb3..99dfa5a 100644 --- a/components/printing/browser/print_composite_client.h +++ b/components/printing/browser/print_composite_client.h
@@ -18,6 +18,8 @@ explicit PrintCompositeClient(content::WebContents* web_contents); ~PrintCompositeClient() override; + // NOTE: |handle| must be a READ-ONLY base::SharedMemoryHandle, i.e. one + // acquired by base::SharedMemory::GetReadOnlyHandle(). void DoComposite(base::SharedMemoryHandle handle, uint32_t data_size, mojom::PdfCompositor::CompositePdfCallback callback);
diff --git a/components/printing/renderer/DEPS b/components/printing/renderer/DEPS index d6b6f93d..e33c1df 100644 --- a/components/printing/renderer/DEPS +++ b/components/printing/renderer/DEPS
@@ -1,6 +1,7 @@ include_rules = [ "+components/grit/components_resources.h", "+content/public/renderer", + "+mojo/public", "+net/base", "+services/service_manager/public/cpp", "+third_party/skia",
diff --git a/components/printing/renderer/print_render_frame_helper.cc b/components/printing/renderer/print_render_frame_helper.cc index 03b643b..86c3b7a 100644 --- a/components/printing/renderer/print_render_frame_helper.cc +++ b/components/printing/renderer/print_render_frame_helper.cc
@@ -31,6 +31,8 @@ #include "content/public/renderer/render_frame.h" #include "content/public/renderer/render_thread.h" #include "content/public/renderer/render_view.h" +#include "mojo/public/cpp/system/buffer.h" +#include "mojo/public/cpp/system/platform_handle.h" #include "net/base/escape.h" #include "printing/features/features.h" #include "printing/metafile_skia_wrapper.h" @@ -1363,9 +1365,9 @@ PdfMetafileSkia* metafile = print_preview_context_.metafile(); PrintHostMsg_DidPreviewDocument_Params preview_params; - if (!CopyMetafileDataToSharedMem(*metafile, - &preview_params.metafile_data_handle)) { - LOG(ERROR) << "CopyMetafileDataToSharedMem failed"; + if (!CopyMetafileDataToReadOnlySharedMem( + *metafile, &preview_params.metafile_data_handle)) { + LOG(ERROR) << "CopyMetafileDataToReadOnlySharedMem failed"; print_preview_context_.set_error(PREVIEW_ERROR_METAFILE_COPY_FAILED); return false; } @@ -1628,8 +1630,8 @@ metafile.FinishDocument(); - if (!CopyMetafileDataToSharedMem(metafile, - &page_params.metafile_data_handle)) { + if (!CopyMetafileDataToReadOnlySharedMem(metafile, + &page_params.metafile_data_handle)) { return false; } @@ -1949,26 +1951,29 @@ } #endif // !defined(OS_MACOSX) -bool PrintRenderFrameHelper::CopyMetafileDataToSharedMem( +bool PrintRenderFrameHelper::CopyMetafileDataToReadOnlySharedMem( const PdfMetafileSkia& metafile, base::SharedMemoryHandle* shared_mem_handle) { uint32_t buf_size = metafile.GetDataSize(); if (buf_size == 0) return false; - std::unique_ptr<base::SharedMemory> shared_buf( - content::RenderThread::Get()->HostAllocateSharedMemoryBuffer(buf_size)); - if (!shared_buf) + mojo::ScopedSharedBufferHandle buffer = + mojo::SharedBufferHandle::Create(buf_size); + if (!buffer.is_valid()) return false; - if (!shared_buf->Map(buf_size)) + mojo::ScopedSharedBufferMapping mapping = buffer->Map(buf_size); + if (!mapping) return false; - if (!metafile.GetData(shared_buf->memory(), buf_size)) + if (!metafile.GetData(mapping.get(), buf_size)) return false; - *shared_mem_handle = - base::SharedMemory::DuplicateHandle(shared_buf->handle()); + MojoResult result = mojo::UnwrapSharedMemoryHandle( + buffer->Clone(mojo::SharedBufferHandle::AccessMode::READ_ONLY), + shared_mem_handle, nullptr, nullptr); + DCHECK_EQ(MOJO_RESULT_OK, result); return true; } @@ -2092,9 +2097,9 @@ } PrintHostMsg_DidPreviewPage_Params preview_page_params; - if (!CopyMetafileDataToSharedMem(*metafile, - &preview_page_params.metafile_data_handle)) { - LOG(ERROR) << "CopyMetafileDataToSharedMem failed"; + if (!CopyMetafileDataToReadOnlySharedMem( + *metafile, &preview_page_params.metafile_data_handle)) { + LOG(ERROR) << "CopyMetafileDataToReadOnlySharedMem failed"; print_preview_context_.set_error(PREVIEW_ERROR_METAFILE_COPY_FAILED); return false; }
diff --git a/components/printing/renderer/print_render_frame_helper.h b/components/printing/renderer/print_render_frame_helper.h index b96f5b17..b087b9ef 100644 --- a/components/printing/renderer/print_render_frame_helper.h +++ b/components/printing/renderer/print_render_frame_helper.h
@@ -307,8 +307,9 @@ // Helper methods ----------------------------------------------------------- - bool CopyMetafileDataToSharedMem(const PdfMetafileSkia& metafile, - base::SharedMemoryHandle* shared_mem_handle); + bool CopyMetafileDataToReadOnlySharedMem( + const PdfMetafileSkia& metafile, + base::SharedMemoryHandle* read_only_shared_mem_handle); // Helper method to get page layout in points and fit to page if needed. static void ComputePageLayoutInPointsForCss(
diff --git a/components/printing/renderer/print_render_frame_helper_linux.cc b/components/printing/renderer/print_render_frame_helper_linux.cc index 2d47730..4d13548 100644 --- a/components/printing/renderer/print_render_frame_helper_linux.cc +++ b/components/printing/renderer/print_render_frame_helper_linux.cc
@@ -82,8 +82,8 @@ return true; #else PrintHostMsg_DidPrintDocument_Params page_params; - if (!CopyMetafileDataToSharedMem(metafile, - &page_params.metafile_data_handle)) { + if (!CopyMetafileDataToReadOnlySharedMem(metafile, + &page_params.metafile_data_handle)) { return false; }
diff --git a/components/printing/service/pdf_compositor_service_unittest.cc b/components/printing/service/pdf_compositor_service_unittest.cc index eec937e..7b2193c 100644 --- a/components/printing/service/pdf_compositor_service_unittest.cc +++ b/components/printing/service/pdf_compositor_service_unittest.cc
@@ -144,7 +144,7 @@ base::SharedMemory shared_memory; if (shared_memory.Create(options) && shared_memory.Map(len)) { stream.copyTo(shared_memory.memory()); - return base::SharedMemory::DuplicateHandle(shared_memory.handle()); + return shared_memory.GetReadOnlyHandle(); } return base::SharedMemoryHandle(); } @@ -152,8 +152,9 @@ void CallCompositorWithSuccess(mojom::PdfCompositorPtr ptr) { auto handle = CreateMSKPInSharedMemory(); ASSERT_TRUE(handle.IsValid()); - mojo::ScopedSharedBufferHandle buffer_handle = - mojo::WrapSharedMemoryHandle(handle, handle.GetSize(), true); + mojo::ScopedSharedBufferHandle buffer_handle = mojo::WrapSharedMemoryHandle( + handle, handle.GetSize(), + mojo::UnwrappedSharedMemoryHandleProtection::kReadOnly); ASSERT_TRUE(buffer_handle->is_valid()); EXPECT_CALL(*this, CallbackOnSuccess(testing::_)).Times(1); ptr->CompositePdf(std::move(buffer_handle),
diff --git a/components/printing/service/public/cpp/pdf_compositor_client.cc b/components/printing/service/public/cpp/pdf_compositor_client.cc index e88eb4b7..921b068e2 100644 --- a/components/printing/service/public/cpp/pdf_compositor_client.cc +++ b/components/printing/service/public/cpp/pdf_compositor_client.cc
@@ -47,8 +47,9 @@ if (!compositor_) Connect(connector); - mojo::ScopedSharedBufferHandle buffer_handle = - mojo::WrapSharedMemoryHandle(handle, data_size, true); + mojo::ScopedSharedBufferHandle buffer_handle = mojo::WrapSharedMemoryHandle( + handle, data_size, + mojo::UnwrappedSharedMemoryHandleProtection::kReadOnly); compositor_->CompositePdf( std::move(buffer_handle),
diff --git a/components/printing/service/public/cpp/pdf_compositor_client.h b/components/printing/service/public/cpp/pdf_compositor_client.h index d3d8c29b..9816848 100644 --- a/components/printing/service/public/cpp/pdf_compositor_client.h +++ b/components/printing/service/public/cpp/pdf_compositor_client.h
@@ -18,6 +18,9 @@ ~PdfCompositorClient(); // Composite the final picture and convert into a PDF file. + // + // NOTE: |handle| must be a READ-ONLY base::SharedMemoryHandle, i.e. one + // acquired by base::SharedMemory::GetReadOnlyHandle(). void Composite(service_manager::Connector* connector, base::SharedMemoryHandle handle, size_t data_size,
diff --git a/components/printing/service/public/cpp/pdf_service_mojo_utils.cc b/components/printing/service/public/cpp/pdf_service_mojo_utils.cc index f5f6c89..8e129e1a 100644 --- a/components/printing/service/public/cpp/pdf_service_mojo_utils.cc +++ b/components/printing/service/public/cpp/pdf_service_mojo_utils.cc
@@ -14,16 +14,18 @@ mojo::ScopedSharedBufferHandle handle) { base::SharedMemoryHandle memory_handle; size_t memory_size = 0; - bool read_only_flag = false; + mojo::UnwrappedSharedMemoryHandleProtection protection; const MojoResult result = mojo::UnwrapSharedMemoryHandle( - std::move(handle), &memory_handle, &memory_size, &read_only_flag); + std::move(handle), &memory_handle, &memory_size, &protection); if (result != MOJO_RESULT_OK) return nullptr; DCHECK_GT(memory_size, 0u); + const bool read_only = + protection == mojo::UnwrappedSharedMemoryHandleProtection::kReadOnly; std::unique_ptr<base::SharedMemory> shm = - std::make_unique<base::SharedMemory>(memory_handle, read_only_flag); + std::make_unique<base::SharedMemory>(memory_handle, read_only); if (!shm->Map(memory_size)) { DLOG(ERROR) << "Map shared memory failed."; return nullptr;
diff --git a/components/sync_preferences/pref_service_syncable_factory.cc b/components/sync_preferences/pref_service_syncable_factory.cc index 3b12290d..10cb2a5 100644 --- a/components/sync_preferences/pref_service_syncable_factory.cc +++ b/components/sync_preferences/pref_service_syncable_factory.cc
@@ -32,7 +32,8 @@ policy::BrowserPolicyConnector* connector) { #if !defined(OS_IOS) set_managed_prefs(new policy::ConfigurationPolicyPrefStore( - service, connector->GetHandlerList(), policy::POLICY_LEVEL_MANDATORY)); + connector, service, connector->GetHandlerList(), + policy::POLICY_LEVEL_MANDATORY)); #else NOTREACHED(); #endif @@ -43,7 +44,8 @@ policy::BrowserPolicyConnector* connector) { #if !defined(OS_IOS) set_recommended_prefs(new policy::ConfigurationPolicyPrefStore( - service, connector->GetHandlerList(), policy::POLICY_LEVEL_RECOMMENDED)); + connector, service, connector->GetHandlerList(), + policy::POLICY_LEVEL_RECOMMENDED)); #else NOTREACHED(); #endif
diff --git a/components/variations/pref_names.cc b/components/variations/pref_names.cc index d8bd392..dd4fdea 100644 --- a/components/variations/pref_names.cc +++ b/components/variations/pref_names.cc
@@ -23,8 +23,8 @@ const char kVariationsFailedToFetchSeedStreak[] = "variations_failed_to_fetch_seed_streak"; -// 64-bit integer serialization of the base::Time from the last successful seed -// fetch (i.e. when the Variations server responds with 200 or 304). +// The serialized base::Time from the last successful seed fetch (i.e. when the +// Variations server responds with 200 or 304). const char kVariationsLastFetchTime[] = "variations_last_fetch_time"; // Pair of <Chrome version string, country code string> representing the country @@ -49,9 +49,9 @@ // https://docs.google.com/document/d/17UN2pLSa5JZqk8f3LeYZIftXewxqcITotgalTrJvGSY const char kVariationsSafeCompressedSeed[] = "variations_safe_compressed_seed"; -// The 64-bit integer serialization of the base::Time at which the last known -// "safe" seed was received. An empty/default-constructed base::Time time if -// there is no known "safe" seed. +// The serialized base::Time at which the last known "safe" seed was received. +// An empty/default-constructed base::Time time if there is no known "safe" +// seed. const char kVariationsSafeSeedDate[] = "variations_safe_seed_date"; // The active client locale that was successfully used in association with the @@ -74,7 +74,7 @@ // base64-encoded. Empty if there is no known "safe" seed. const char kVariationsSafeSeedSignature[] = "variations_safe_seed_signature"; -// 64-bit integer serialization of the base::Time from the last seed received. +// The serialized base::Time from the last seed received. const char kVariationsSeedDate[] = "variations_seed_date"; // Digital signature of the binary variations seed data, base64-encoded.
diff --git a/components/variations/service/variations_field_trial_creator.cc b/components/variations/service/variations_field_trial_creator.cc index 605cc89b..0962bf1 100644 --- a/components/variations/service/variations_field_trial_creator.cc +++ b/components/variations/service/variations_field_trial_creator.cc
@@ -88,8 +88,7 @@ // Returns the date that should be used by the VariationsSeedProcessor to do // expiry and start date checks. base::Time GetReferenceDateForExpiryChecks(PrefService* local_state) { - const int64_t date_value = local_state->GetInt64(prefs::kVariationsSeedDate); - const base::Time seed_date = base::Time::FromInternalValue(date_value); + const base::Time seed_date = local_state->GetTime(prefs::kVariationsSeedDate); const base::Time build_time = base::GetBuildTime(); // Use the build time for date checks if either the seed date is invalid or // the build time is newer than the seed date. @@ -169,10 +168,15 @@ TRACE_EVENT0("startup", "VariationsFieldTrialCreator::CreateTrialsFromSeed"); DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); CHECK(!create_trials_from_seed_called_); + create_trials_from_seed_called_ = true; base::TimeTicks start_time = base::TimeTicks::Now(); - create_trials_from_seed_called_ = true; + const base::Version current_version(version_info::GetVersionNumber()); + if (!current_version.IsValid()) + return false; + std::unique_ptr<ClientFilterableState> client_filterable_state = + GetClientFilterableStateForVersion(current_version); VariationsSeed seed; std::string seed_data; @@ -180,36 +184,10 @@ if (!LoadSeed(&seed, &seed_data, &base64_seed_signature)) return false; - const int64_t last_fetch_time_internal = - local_state()->GetInt64(prefs::kVariationsLastFetchTime); - const base::Time last_fetch_time = - base::Time::FromInternalValue(last_fetch_time_internal); - if (last_fetch_time.is_null()) { - // If the last fetch time is missing and we have a seed, then this must be - // the first run of Chrome. Store the current time as the last fetch time. - RecordLastFetchTime(); - RecordCreateTrialsSeedExpiry(VARIATIONS_SEED_EXPIRY_FETCH_TIME_MISSING); - } else { - // Reject the seed if it is more than 30 days old. - const base::TimeDelta seed_age = base::Time::Now() - last_fetch_time; - if (seed_age.InDays() > kMaxVariationsSeedAgeDays) { - RecordCreateTrialsSeedExpiry(VARIATIONS_SEED_EXPIRY_EXPIRED); - return false; - } - RecordCreateTrialsSeedExpiry(VARIATIONS_SEED_EXPIRY_NOT_EXPIRED); - } - - const base::Version current_version(version_info::GetVersionNumber()); - if (!current_version.IsValid()) - return false; - - std::unique_ptr<ClientFilterableState> client_filterable_state = - GetClientFilterableStateForVersion(current_version); - // Note that passing |&ui_string_overrider_| via base::Unretained below is - // safe because the callback is executed synchronously. It is not possible - // to pass UIStringOverrider itself to VariationSeedProcessor as variations - // components should not depends on //ui/base. + // safe because the callback is executed synchronously. It is not possible to + // pass UIStringOverrider directly to VariationSeedProcessor as the variations + // component should not depend on //ui/base. VariationsSeedProcessor().CreateTrialsFromSeed( seed, *client_filterable_state, base::Bind(&UIStringOverrider::OverrideUIString, @@ -221,18 +199,6 @@ safe_seed_manager->SetActiveSeedState(seed_data, base64_seed_signature, std::move(client_filterable_state)); - const base::Time now = base::Time::Now(); - - // Log the "freshness" of the seed that was just used. The freshness is the - // time between the last successful seed download and now. - if (!last_fetch_time.is_null()) { - const base::TimeDelta delta = now - last_fetch_time; - // Log the value in number of minutes. - UMA_HISTOGRAM_CUSTOM_COUNTS("Variations.SeedFreshness", delta.InMinutes(), - 1, base::TimeDelta::FromDays(30).InMinutes(), - 50); - } - UMA_HISTOGRAM_TIMES("Variations.SeedProcessingTime", base::TimeTicks::Now() - start_time); return true; @@ -353,14 +319,7 @@ void VariationsFieldTrialCreator::RecordLastFetchTime() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - local_state()->SetInt64(prefs::kVariationsLastFetchTime, - base::Time::Now().ToInternalValue()); -} - -bool VariationsFieldTrialCreator::LoadSeed(VariationsSeed* seed, - std::string* seed_data, - std::string* base64_signature) { - return seed_store_.LoadSeed(seed, seed_data, base64_signature); + local_state()->SetTime(prefs::kVariationsLastFetchTime, base::Time::Now()); } void VariationsFieldTrialCreator::OverrideVariationsPlatform( @@ -369,6 +328,43 @@ platform_override_ = platform_override; } +bool VariationsFieldTrialCreator::LoadSeed(VariationsSeed* seed, + std::string* seed_data, + std::string* base64_signature) { + if (!LoadSeedFromStore(seed, seed_data, base64_signature)) + return false; + + const base::Time last_fetch_time = + local_state()->GetTime(prefs::kVariationsLastFetchTime); + if (last_fetch_time.is_null()) { + // If the last fetch time is missing and we have a seed, then this must be + // the first run of Chrome. Store the current time as the last fetch time. + RecordLastFetchTime(); + RecordCreateTrialsSeedExpiry(VARIATIONS_SEED_EXPIRY_FETCH_TIME_MISSING); + return true; + } + + // Reject the seed if it is more than 30 days old. + const base::TimeDelta seed_age = base::Time::Now() - last_fetch_time; + if (seed_age.InDays() > kMaxVariationsSeedAgeDays) { + RecordCreateTrialsSeedExpiry(VARIATIONS_SEED_EXPIRY_EXPIRED); + return false; + } + + // Record that a suitably fresh seed was loaded. + RecordCreateTrialsSeedExpiry(VARIATIONS_SEED_EXPIRY_NOT_EXPIRED); + UMA_HISTOGRAM_CUSTOM_COUNTS("Variations.SeedFreshness", seed_age.InMinutes(), + 1, base::TimeDelta::FromDays(30).InMinutes(), 50); + return true; +} + +bool VariationsFieldTrialCreator::LoadSeedFromStore( + VariationsSeed* seed, + std::string* seed_data, + std::string* base64_signature) { + return seed_store_.LoadSeed(seed, seed_data, base64_signature); +} + bool VariationsFieldTrialCreator::SetupFieldTrials( const char* kEnableGpuBenchmarking, const char* kEnableFeatures,
diff --git a/components/variations/service/variations_field_trial_creator.h b/components/variations/service/variations_field_trial_creator.h index 3fddf60..5cf2b62 100644 --- a/components/variations/service/variations_field_trial_creator.h +++ b/components/variations/service/variations_field_trial_creator.h
@@ -35,7 +35,6 @@ std::string GetLatestCountry() const; VariationsSeedStore* seed_store() { return &seed_store_; } - const VariationsSeedStore& seed_store() const { return seed_store_; } // Sets up field trials based on stored variations seed data. Returns whether // setup completed successfully. @@ -84,24 +83,27 @@ // Records the time of the most recent successful fetch. void RecordLastFetchTime(); - // Loads the seed from the variations store into |seed|. Returns true on - // success, in which case |seed| will contain the loaded data, and |seed_data| - // and |base64_signature| will contain the raw pref values. Virtual for - // testing. - virtual bool LoadSeed(VariationsSeed* seed, - std::string* seed_data, - std::string* base64_signature); - // Allow the platform that is used to filter the set of active trials to be // overridden. void OverrideVariationsPlatform(Study::Platform platform_override); - protected: - // Exposed for testing. - PrefService* local_state() { return seed_store_.local_state(); } - const PrefService* local_state() const { return seed_store_.local_state(); } - private: + // Loads the seed from the variations store into |seed|, and records metrics + // about the loaded seed. Returns true on success, in which case |seed| will + // contain the loaded data, and |seed_data| and |base64_signature| will + // contain the raw pref values. + bool LoadSeed(VariationsSeed* seed, + std::string* seed_data, + std::string* base64_signature); + + // Loads the seed from the variations store into |seed|. Returns true on + // success, in which case |seed| will contain the loaded data, and |seed_data| + // and |base64_signature| will contain the raw pref values. Virtual for + // testing. + virtual bool LoadSeedFromStore(VariationsSeed* seed, + std::string* seed_data, + std::string* base64_signature); + // Creates field trials based on the variations seed loaded from local state. // If there is a problem loading the seed data, all trials specified by the // seed may not be created. Some field trials are configured to override or @@ -115,6 +117,9 @@ base::FeatureList* feature_list, SafeSeedManager* safe_seed_manager); + PrefService* local_state() { return seed_store_.local_state(); } + const PrefService* local_state() const { return seed_store_.local_state(); } + VariationsServiceClient* client_; UIStringOverrider ui_string_overrider_;
diff --git a/components/variations/service/variations_field_trial_creator_unittest.cc b/components/variations/service/variations_field_trial_creator_unittest.cc index a5d4e31..560642c 100644 --- a/components/variations/service/variations_field_trial_creator_unittest.cc +++ b/components/variations/service/variations_field_trial_creator_unittest.cc
@@ -145,9 +145,9 @@ } private: - bool LoadSeed(VariationsSeed* seed, - std::string* seed_data, - std::string* base64_signature) override { + bool LoadSeedFromStore(VariationsSeed* seed, + std::string* seed_data, + std::string* base64_signature) override { *seed = CreateTestSeed(); *seed_data = kTestSeedData; *base64_signature = kTestSeedSignature; @@ -202,8 +202,7 @@ &prefs_, &variations_service_client, &safe_seed_manager); // Simulate a seed having been stored recently. - prefs_.SetInt64(prefs::kVariationsLastFetchTime, - base::Time::Now().ToInternalValue()); + prefs_.SetTime(prefs::kVariationsLastFetchTime, base::Time::Now()); // Check that field trials are created from the seed. Since the test study has // only 1 experiment with 100% probability weight, we must be part of it. @@ -247,7 +246,7 @@ // Simulate an expired seed. const base::Time seed_date = base::Time::Now() - base::TimeDelta::FromDays(31); - prefs_.SetInt64(prefs::kVariationsLastFetchTime, seed_date.ToInternalValue()); + prefs_.SetTime(prefs::kVariationsLastFetchTime, seed_date); // Check that field trials are not created from the expired seed. EXPECT_FALSE(field_trial_creator.SetupFieldTrials());
diff --git a/components/variations/service/variations_service.cc b/components/variations/service/variations_service.cc index f78cb2cc..58dde00 100644 --- a/components/variations/service/variations_service.cc +++ b/components/variations/service/variations_service.cc
@@ -377,7 +377,7 @@ SafeSeedManager::RegisterPrefs(registry); VariationsSeedStore::RegisterPrefs(registry); - registry->RegisterInt64Pref(prefs::kVariationsLastFetchTime, 0); + registry->RegisterTimePref(prefs::kVariationsLastFetchTime, base::Time()); // This preference will only be written by the policy service, which will fill // it according to a value stored in the User Policy. registry->RegisterStringPref(prefs::kVariationsRestrictParameter,
diff --git a/components/variations/variations_request_scheduler_mobile.cc b/components/variations/variations_request_scheduler_mobile.cc index 18a3ad1..32528e1 100644 --- a/components/variations/variations_request_scheduler_mobile.cc +++ b/components/variations/variations_request_scheduler_mobile.cc
@@ -30,8 +30,8 @@ // period, run the task. Otherwise, do nothing. Note that no future requests // are scheduled since it is unlikely that the mobile process would live long // enough for the timer to fire. - const base::Time last_fetch_time = base::Time::FromInternalValue( - local_state_->GetInt64(prefs::kVariationsLastFetchTime)); + const base::Time last_fetch_time = + local_state_->GetTime(prefs::kVariationsLastFetchTime); if (base::Time::Now() > last_fetch_time + GetFetchPeriod()) { last_request_time_ = base::Time::Now(); task().Run();
diff --git a/components/variations/variations_request_scheduler_mobile_unittest.cc b/components/variations/variations_request_scheduler_mobile_unittest.cc index 3f1e8e949..91b2ee9 100644 --- a/components/variations/variations_request_scheduler_mobile_unittest.cc +++ b/components/variations/variations_request_scheduler_mobile_unittest.cc
@@ -25,8 +25,8 @@ TEST(VariationsRequestSchedulerMobileTest, StartNoRun) { TestingPrefServiceSimple prefs; // Initialize to as if it was just fetched. This means it should not run. - prefs.registry()->RegisterInt64Pref(prefs::kVariationsLastFetchTime, - base::Time::Now().ToInternalValue()); + prefs.registry()->RegisterTimePref(prefs::kVariationsLastFetchTime, + base::Time::Now()); int executed = 0; const base::Closure task = base::Bind(&Increment, &executed); VariationsRequestSchedulerMobile scheduler(task, &prefs); @@ -39,8 +39,7 @@ TestingPrefServiceSimple prefs; // Verify it doesn't take more than a day. base::Time old = base::Time::Now() - base::TimeDelta::FromHours(24); - prefs.registry()->RegisterInt64Pref(prefs::kVariationsLastFetchTime, - old.ToInternalValue()); + prefs.registry()->RegisterTimePref(prefs::kVariationsLastFetchTime, old); int executed = 0; const base::Closure task = base::Bind(&Increment, &executed); VariationsRequestSchedulerMobile scheduler(task, &prefs); @@ -55,8 +54,8 @@ TestingPrefServiceSimple prefs; // Initialize to as if it was just fetched. This means it should not run. - prefs.registry()->RegisterInt64Pref(prefs::kVariationsLastFetchTime, - base::Time::Now().ToInternalValue()); + prefs.registry()->RegisterTimePref(prefs::kVariationsLastFetchTime, + base::Time::Now()); int executed = 0; const base::Closure task = base::Bind(&Increment, &executed); VariationsRequestSchedulerMobile scheduler(task, &prefs); @@ -82,8 +81,7 @@ TestingPrefServiceSimple prefs; base::Time old = base::Time::Now() - base::TimeDelta::FromHours(24); - prefs.registry()->RegisterInt64Pref(prefs::kVariationsLastFetchTime, - old.ToInternalValue()); + prefs.registry()->RegisterTimePref(prefs::kVariationsLastFetchTime, old); int executed = 0; const base::Closure task = base::Bind(&Increment, &executed); VariationsRequestSchedulerMobile scheduler(task, &prefs); @@ -109,8 +107,7 @@ TestingPrefServiceSimple prefs; base::Time old = base::Time::Now() - base::TimeDelta::FromHours(24); - prefs.registry()->RegisterInt64Pref(prefs::kVariationsLastFetchTime, - old.ToInternalValue()); + prefs.registry()->RegisterTimePref(prefs::kVariationsLastFetchTime, old); int executed = 0; const base::Closure task = base::Bind(&Increment, &executed); VariationsRequestSchedulerMobile scheduler(task, &prefs); @@ -128,11 +125,11 @@ EXPECT_EQ(1, executed); // Simulate letting time pass. - const base::Time last_fetch_time = base::Time::FromInternalValue( - prefs.GetInt64(prefs::kVariationsLastFetchTime)); - prefs.SetInt64( - prefs::kVariationsLastFetchTime, - (last_fetch_time - base::TimeDelta::FromHours(24)).ToInternalValue()); + const base::Time last_fetch_time = + prefs.GetTime(prefs::kVariationsLastFetchTime); + const base::Time one_day_earlier = + last_fetch_time - base::TimeDelta::FromHours(24); + prefs.SetTime(prefs::kVariationsLastFetchTime, one_day_earlier); scheduler.last_request_time_ -= base::TimeDelta::FromHours(24); scheduler.OnAppEnterForeground();
diff --git a/components/variations/variations_seed_store.cc b/components/variations/variations_seed_store.cc index 355fb6c..d0b7e7c 100644 --- a/components/variations/variations_seed_store.cc +++ b/components/variations/variations_seed_store.cc
@@ -247,9 +247,8 @@ local_state_->SetString(prefs::kVariationsSafeSeedSignature, base64_seed_signature); - local_state_->SetInt64( - prefs::kVariationsSafeSeedDate, - client_state.reference_date.ToDeltaSinceWindowsEpoch().InMicroseconds()); + local_state_->SetTime(prefs::kVariationsSafeSeedDate, + client_state.reference_date); local_state_->SetString(prefs::kVariationsSafeSeedLocale, client_state.locale); local_state_->SetString(prefs::kVariationsSafeSeedPermanentConsistencyCountry, @@ -264,19 +263,15 @@ UpdateSeedDateResult result = UpdateSeedDateResult::NO_OLD_DATE; if (local_state_->HasPrefPath(prefs::kVariationsSeedDate)) { - const int64_t stored_date_value = - local_state_->GetInt64(prefs::kVariationsSeedDate); const base::Time stored_date = - base::Time::FromInternalValue(stored_date_value); - + local_state_->GetTime(prefs::kVariationsSeedDate); result = GetSeedDateChangeState(server_date_fetched, stored_date); } UMA_HISTOGRAM_ENUMERATION("Variations.SeedDateChange", result, UpdateSeedDateResult::ENUM_SIZE); - local_state_->SetInt64(prefs::kVariationsSeedDate, - server_date_fetched.ToInternalValue()); + local_state_->SetTime(prefs::kVariationsSeedDate, server_date_fetched); } const std::string& VariationsSeedStore::GetLatestSerialNumber() { @@ -301,16 +296,13 @@ void VariationsSeedStore::RegisterPrefs(PrefRegistrySimple* registry) { registry->RegisterStringPref(prefs::kVariationsCompressedSeed, std::string()); registry->RegisterStringPref(prefs::kVariationsCountry, std::string()); - registry->RegisterInt64Pref(prefs::kVariationsSeedDate, - base::Time().ToInternalValue()); + registry->RegisterTimePref(prefs::kVariationsSeedDate, base::Time()); registry->RegisterStringPref(prefs::kVariationsSeedSignature, std::string()); // Safe seed prefs: registry->RegisterStringPref(prefs::kVariationsSafeCompressedSeed, std::string()); - registry->RegisterInt64Pref( - prefs::kVariationsSafeSeedDate, - base::Time().ToDeltaSinceWindowsEpoch().InMicroseconds()); + registry->RegisterTimePref(prefs::kVariationsSafeSeedDate, base::Time()); registry->RegisterStringPref(prefs::kVariationsSafeSeedLocale, std::string()); registry->RegisterStringPref( prefs::kVariationsSafeSeedPermanentConsistencyCountry, std::string());
diff --git a/components/viz/client/client_shared_bitmap_manager.cc b/components/viz/client/client_shared_bitmap_manager.cc index 6c931d5..e03df4f 100644 --- a/components/viz/client/client_shared_bitmap_manager.cc +++ b/components/viz/client/client_shared_bitmap_manager.cc
@@ -170,7 +170,8 @@ } mojo::ScopedSharedBufferHandle buffer_handle = mojo::WrapSharedMemoryHandle( - handle_to_send, memory->mapped_size(), true /* read_only */); + handle_to_send, memory->mapped_size(), + mojo::UnwrappedSharedMemoryHandleProtection::kReadWrite); { base::AutoLock lock(lock_);
diff --git a/components/viz/service/display/display.cc b/components/viz/service/display/display.cc index d923dda..5063b7c 100644 --- a/components/viz/service/display/display.cc +++ b/components/viz/service/display/display.cc
@@ -293,9 +293,12 @@ stored_latency_info_.end()); stored_latency_info_.clear(); bool have_copy_requests = false; + size_t total_quad_count = 0; for (const auto& pass : frame.render_pass_list) { have_copy_requests |= !pass->copy_requests.empty(); + total_quad_count += pass->quad_list.size(); } + UMA_HISTOGRAM_COUNTS_1000("Compositing.Display.Draw.Quads", total_quad_count); gfx::Size surface_size; bool have_damage = false;
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn index ede41f9..12246fd 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn
@@ -1802,8 +1802,8 @@ ] } - # Desktop screen capture implementations, conditionally built depending on - # the available implementations for each platform. + # Desktop/Window/WebContents screen capture implementations, conditionally + # built depending on the available implementations for each platform. if (is_linux || is_mac || is_win) { defines += [ "ENABLE_SCREEN_CAPTURE=1" ] sources += [ @@ -1811,6 +1811,8 @@ "media/capture/cursor_renderer.h", "media/capture/fake_webcontent_capture_machine.cc", "media/capture/fake_webcontent_capture_machine.h", + "media/capture/frame_sink_video_capture_device.cc", + "media/capture/frame_sink_video_capture_device.h", "media/capture/web_contents_video_capture_device.cc", "media/capture/web_contents_video_capture_device.h", ]
diff --git a/content/browser/android/ime_adapter_android.cc b/content/browser/android/ime_adapter_android.cc index 267c9ae2..82f32a98a 100644 --- a/content/browser/android/ime_adapter_android.cc +++ b/content/browser/android/ime_adapter_android.cc
@@ -24,7 +24,7 @@ #include "content/public/browser/browser_thread.h" #include "content/public/browser/native_web_keyboard_event.h" #include "content/public/browser/web_contents.h" -#include "jni/ImeAdapter_jni.h" +#include "jni/ImeAdapterImpl_jni.h" #include "third_party/WebKit/public/platform/WebInputEvent.h" #include "third_party/WebKit/public/platform/WebTextInputType.h" #include "ui/base/ime/ime_text_span.h" @@ -62,9 +62,9 @@ } // anonymous namespace -jlong JNI_ImeAdapter_Init(JNIEnv* env, - const JavaParamRef<jobject>& obj, - const JavaParamRef<jobject>& jweb_contents) { +jlong JNI_ImeAdapterImpl_Init(JNIEnv* env, + const JavaParamRef<jobject>& obj, + const JavaParamRef<jobject>& jweb_contents) { WebContents* web_contents = WebContents::FromJavaWebContents(jweb_contents); DCHECK(web_contents); auto* ime_adapter = new ImeAdapterAndroid(env, obj, web_contents); @@ -74,12 +74,12 @@ // Callback from Java to convert BackgroundColorSpan data to a // ui::ImeTextSpan instance, and append it to |ime_text_spans_ptr|. -void JNI_ImeAdapter_AppendBackgroundColorSpan(JNIEnv*, - const JavaParamRef<jclass>&, - jlong ime_text_spans_ptr, - jint start, - jint end, - jint background_color) { +void JNI_ImeAdapterImpl_AppendBackgroundColorSpan(JNIEnv*, + const JavaParamRef<jclass>&, + jlong ime_text_spans_ptr, + jint start, + jint end, + jint background_color) { DCHECK_GE(start, 0); DCHECK_GE(end, 0); // Do not check |background_color|. @@ -94,7 +94,7 @@ // Callback from Java to convert SuggestionSpan data to a // ui::ImeTextSpan instance, and append it to |ime_text_spans_ptr|. -void JNI_ImeAdapter_AppendSuggestionSpan( +void JNI_ImeAdapterImpl_AppendSuggestionSpan( JNIEnv* env, const JavaParamRef<jclass>&, jlong ime_text_spans_ptr, @@ -123,11 +123,11 @@ // Callback from Java to convert UnderlineSpan data to a // ui::ImeTextSpan instance, and append it to |ime_text_spans_ptr|. -void JNI_ImeAdapter_AppendUnderlineSpan(JNIEnv*, - const JavaParamRef<jclass>&, - jlong ime_text_spans_ptr, - jint start, - jint end) { +void JNI_ImeAdapterImpl_AppendUnderlineSpan(JNIEnv*, + const JavaParamRef<jclass>&, + jlong ime_text_spans_ptr, + jint start, + jint end) { DCHECK_GE(start, 0); DCHECK_GE(end, 0); std::vector<ui::ImeTextSpan>* ime_text_spans = @@ -149,7 +149,7 @@ JNIEnv* env = AttachCurrentThread(); ScopedJavaLocalRef<jobject> obj = java_ime_adapter_.get(env); if (!obj.is_null()) - Java_ImeAdapter_destroy(env, obj); + Java_ImeAdapterImpl_destroy(env, obj); } void ImeAdapterAndroid::UpdateRenderProcessConnection( @@ -163,7 +163,7 @@ JNIEnv* env = AttachCurrentThread(); ScopedJavaLocalRef<jobject> obj = java_ime_adapter_.get(env); if (!obj.is_null()) - Java_ImeAdapter_onConnectedToRenderProcess(env, obj); + Java_ImeAdapterImpl_onConnectedToRenderProcess(env, obj); } } rwhva_ = new_rwhva; @@ -177,11 +177,11 @@ ScopedJavaLocalRef<jstring> jstring_text = ConvertUTF8ToJavaString(env, state.value); - Java_ImeAdapter_updateState(env, obj, static_cast<int>(state.type), - state.flags, state.mode, state.show_ime_if_needed, - jstring_text, state.selection_start, - state.selection_end, state.composition_start, - state.composition_end, state.reply_to_request); + Java_ImeAdapterImpl_updateState( + env, obj, static_cast<int>(state.type), state.flags, state.mode, + state.show_ime_if_needed, jstring_text, state.selection_start, + state.selection_end, state.composition_start, state.composition_end, + state.reply_to_request); } void ImeAdapterAndroid::UpdateAfterViewSizeChanged() { @@ -189,7 +189,7 @@ ScopedJavaLocalRef<jobject> obj = java_ime_adapter_.get(env); if (obj.is_null()) return; - Java_ImeAdapter_updateAfterViewSizeChanged(env, obj); + Java_ImeAdapterImpl_updateAfterViewSizeChanged(env, obj); } void ImeAdapterAndroid::UpdateFrameInfo( @@ -213,7 +213,7 @@ const jfloat insertion_marker_bottom = has_insertion_marker ? selection_start.edge_bottom().y() : 0.0f; - Java_ImeAdapter_updateFrameInfo( + Java_ImeAdapterImpl_updateFrameInfo( env, obj, dip_scale, content_offset_ypix, has_insertion_marker, is_insertion_marker_visible, insertion_marker_horizontal, insertion_marker_top, insertion_marker_bottom); @@ -310,14 +310,14 @@ JNIEnv* env = AttachCurrentThread(); ScopedJavaLocalRef<jobject> obj = java_ime_adapter_.get(env); if (!obj.is_null()) - Java_ImeAdapter_cancelComposition(env, obj); + Java_ImeAdapterImpl_cancelComposition(env, obj); } void ImeAdapterAndroid::FocusedNodeChanged(bool is_editable_node) { JNIEnv* env = AttachCurrentThread(); ScopedJavaLocalRef<jobject> obj = java_ime_adapter_.get(env); if (!obj.is_null()) { - Java_ImeAdapter_focusedNodeChanged(env, obj, is_editable_node); + Java_ImeAdapterImpl_focusedNodeChanged(env, obj, is_editable_node); } } @@ -363,7 +363,7 @@ coordinates_array[coordinates_array_index + 2] = rect.right(); coordinates_array[coordinates_array_index + 3] = rect.bottom(); } - Java_ImeAdapter_setCharacterBounds( + Java_ImeAdapterImpl_setCharacterBounds( env, obj, base::android::ToJavaFloatArray(env, coordinates_array.get(), coordinates_array_size)); @@ -464,7 +464,7 @@ // Iterate over spans in |text|, dispatch those that we care about (e.g., // BackgroundColorSpan) to a matching callback (e.g., // AppendBackgroundColorSpan()), and populate |ime_text_spans|. - Java_ImeAdapter_populateImeTextSpansFromJava( + Java_ImeAdapterImpl_populateImeTextSpansFromJava( env, obj, text, reinterpret_cast<jlong>(&ime_text_spans)); std::sort(ime_text_spans.begin(), ime_text_spans.end(),
diff --git a/content/browser/browser_child_process_host_impl.cc b/content/browser/browser_child_process_host_impl.cc index c23fb4f..e09725a 100644 --- a/content/browser/browser_child_process_host_impl.cc +++ b/content/browser/browser_child_process_host_impl.cc
@@ -532,7 +532,8 @@ GetHost(), mojo::WrapSharedMemoryHandle( metrics_allocator_->shared_memory()->handle().Duplicate(), - metrics_allocator_->shared_memory()->mapped_size(), false)); + metrics_allocator_->shared_memory()->mapped_size(), + mojo::UnwrappedSharedMemoryHandleProtection::kReadWrite)); } else { HistogramController::GetInstance()->SetHistogramMemory<ChildProcessHost>( GetHost(), mojo::ScopedSharedBufferHandle());
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc index 7060093..afd9dc77 100644 --- a/content/browser/browser_main_loop.cc +++ b/content/browser/browser_main_loop.cc
@@ -148,6 +148,7 @@ #if BUILDFLAG(USE_ZYGOTE_HANDLE) #include "content/public/common/zygote_handle.h" +#include "media/base/media_switches.h" #endif #if defined(OS_ANDROID) @@ -264,6 +265,24 @@ #if BUILDFLAG(USE_ZYGOTE_HANDLE) pid_t LaunchZygoteHelper(base::CommandLine* cmd_line, base::ScopedFD* control_fd) { + // Append any switches from the browser process that need to be forwarded on + // to the zygote/renderers. + static const char* const kForwardSwitches[] = { + switches::kAndroidFontsPath, switches::kClearKeyCdmPathForTesting, + switches::kEnableHeapProfiling, + switches::kEnableLogging, // Support, e.g., --enable-logging=stderr. + // Need to tell the zygote that it is headless so that we don't try to use + // the wrong type of main delegate. + switches::kHeadless, + // Zygote process needs to know what resources to have loaded when it + // becomes a renderer process. + switches::kForceDeviceScaleFactor, switches::kLoggingLevel, + switches::kPpapiInProcess, switches::kRegisterPepperPlugins, switches::kV, + switches::kVModule, + }; + cmd_line->CopySwitchesFrom(*base::CommandLine::ForCurrentProcess(), + kForwardSwitches, arraysize(kForwardSwitches)); + GetContentClient()->browser()->AppendExtraCommandLineSwitches(cmd_line, -1); return ZygoteHostImpl::GetInstance()->LaunchZygote(cmd_line, control_fd); }
diff --git a/content/browser/browsing_data/browsing_data_remover_impl.cc b/content/browser/browsing_data/browsing_data_remover_impl.cc index c9bbd1c5..b2bca5a 100644 --- a/content/browser/browsing_data/browsing_data_remover_impl.cc +++ b/content/browser/browsing_data/browsing_data_remover_impl.cc
@@ -335,6 +335,7 @@ // Channel IDs are not separated for protected and unprotected web // origins. We check the origin_type_mask_ to prevent unintended deletion. if (remove_mask & DATA_TYPE_CHANNEL_IDS && + !(remove_mask & DATA_TYPE_AVOID_CLOSING_CONNECTIONS) && origin_type_mask_ & ORIGIN_TYPE_UNPROTECTED_WEB) { base::RecordAction(UserMetricsAction("ClearBrowsingData_ChannelIDs")); // Since we are running on the UI thread don't call GetURLRequestContext(). @@ -465,7 +466,8 @@ ////////////////////////////////////////////////////////////////////////////// // Auth cache. - if (remove_mask & DATA_TYPE_COOKIES) { + if ((remove_mask & DATA_TYPE_COOKIES) && + !(remove_mask & DATA_TYPE_AVOID_CLOSING_CONNECTIONS)) { scoped_refptr<net::URLRequestContextGetter> request_context = BrowserContext::GetDefaultStoragePartition(browser_context_) ->GetURLRequestContext();
diff --git a/content/browser/browsing_data/browsing_data_remover_impl_browsertest.cc b/content/browser/browsing_data/browsing_data_remover_impl_browsertest.cc index 17499c5..8c0b946 100644 --- a/content/browser/browsing_data/browsing_data_remover_impl_browsertest.cc +++ b/content/browser/browsing_data/browsing_data_remover_impl_browsertest.cc
@@ -12,7 +12,6 @@ #include "content/public/browser/browsing_data_remover.h" #include "content/public/browser/storage_partition.h" #include "content/public/browser/web_contents.h" -#include "content/public/common/network_service.mojom.h" #include "content/public/common/simple_url_loader.h" #include "content/public/test/browsing_data_remover_test_util.h" #include "content/public/test/content_browser_test.h" @@ -24,6 +23,7 @@ #include "net/test/embedded_test_server/http_request.h" #include "net/test/embedded_test_server/http_response.h" #include "net/traffic_annotation/network_traffic_annotation_test_helper.h" +#include "services/network/public/interfaces/network_service.mojom.h" #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h"
diff --git a/content/browser/browsing_data/browsing_data_remover_impl_unittest.cc b/content/browser/browsing_data/browsing_data_remover_impl_unittest.cc index dc68316e..7ae0b33 100644 --- a/content/browser/browsing_data/browsing_data_remover_impl_unittest.cc +++ b/content/browser/browsing_data/browsing_data_remover_impl_unittest.cc
@@ -658,7 +658,7 @@ ->GetURLRequestContext() ->http_transaction_factory() ->GetSession(); - DCHECK(http_session); + ASSERT_TRUE(http_session); net::HttpAuthCache* http_auth_cache = http_session->http_auth_cache(); http_auth_cache->Add(kOrigin1, kTestRealm, net::HttpAuth::AUTH_SCHEME_BASIC, @@ -666,8 +666,8 @@ net::AuthCredentials(base::ASCIIToUTF16("foo"), base::ASCIIToUTF16("bar")), "/"); - CHECK(http_auth_cache->Lookup(kOrigin1, kTestRealm, - net::HttpAuth::AUTH_SCHEME_BASIC)); + ASSERT_TRUE(http_auth_cache->Lookup(kOrigin1, kTestRealm, + net::HttpAuth::AUTH_SCHEME_BASIC)); BlockUntilBrowsingDataRemoved(base::Time(), base::Time::Max(), BrowsingDataRemover::DATA_TYPE_COOKIES, false); @@ -676,6 +676,38 @@ net::HttpAuth::AUTH_SCHEME_BASIC)); } +// Test that removing cookies does not clear HTTP auth data if we're avoiding +// closing connections. +TEST_F(BrowsingDataRemoverImplTest, + ClearHttpAuthCache_AvoidClosingConnections) { + net::HttpNetworkSession* http_session = + BrowserContext::GetDefaultStoragePartition(GetBrowserContext()) + ->GetURLRequestContext() + ->GetURLRequestContext() + ->http_transaction_factory() + ->GetSession(); + ASSERT_TRUE(http_session); + + net::HttpAuthCache* http_auth_cache = http_session->http_auth_cache(); + net::HttpAuthCache::Entry* entry = http_auth_cache->Add( + kOrigin1, kTestRealm, net::HttpAuth::AUTH_SCHEME_BASIC, "test challenge", + net::AuthCredentials(base::ASCIIToUTF16("foo"), + base::ASCIIToUTF16("bar")), + "/"); + ASSERT_TRUE(http_auth_cache->Lookup(kOrigin1, kTestRealm, + net::HttpAuth::AUTH_SCHEME_BASIC)); + + BlockUntilBrowsingDataRemoved( + base::Time(), base::Time::Max(), + BrowsingDataRemover::DATA_TYPE_COOKIES | + BrowsingDataRemover::DATA_TYPE_AVOID_CLOSING_CONNECTIONS, + false); + + // The entry stays unchanged. + EXPECT_EQ(entry, http_auth_cache->Lookup(kOrigin1, kTestRealm, + net::HttpAuth::AUTH_SCHEME_BASIC)); +} + TEST_F(BrowsingDataRemoverImplTest, RemoveChannelIDForever) { RemoveChannelIDTester tester(GetBrowserContext()); @@ -740,6 +772,29 @@ EXPECT_EQ(kTestRegisterableDomain3, channel_ids.front().server_identifier()); } +TEST_F(BrowsingDataRemoverImplTest, RemoveChannelIDsAvoidClosingConnections) { + RemoveChannelIDTester tester(GetBrowserContext()); + + tester.AddChannelID(kTestOrigin1); + EXPECT_EQ(0, tester.ssl_config_changed_count()); + EXPECT_EQ(1, tester.ChannelIDCount()); + + int remove_mask = BrowsingDataRemover::DATA_TYPE_CHANNEL_IDS | + BrowsingDataRemover::DATA_TYPE_AVOID_CLOSING_CONNECTIONS; + + BlockUntilBrowsingDataRemoved(base::Time(), base::Time::Max(), remove_mask, + false); + + EXPECT_EQ(remove_mask, GetRemovalMask()); + EXPECT_EQ(BrowsingDataRemover::ORIGIN_TYPE_UNPROTECTED_WEB, + GetOriginTypeMask()); + + // No deletion took place because the AVOID_CLOSING_CONNECTIONS flag + // was specified. + EXPECT_EQ(0, tester.ssl_config_changed_count()); + EXPECT_EQ(1, tester.ChannelIDCount()); +} + TEST_F(BrowsingDataRemoverImplTest, RemoveUnprotectedLocalStorageForever) { MockSpecialStoragePolicy* policy = CreateMockPolicy(); // Protect kOrigin1.
diff --git a/content/browser/browsing_data/clear_site_data_throttle.cc b/content/browser/browsing_data/clear_site_data_throttle.cc index 853df07..2f644a6 100644 --- a/content/browser/browsing_data/clear_site_data_throttle.cc +++ b/content/browser/browsing_data/clear_site_data_throttle.cc
@@ -149,7 +149,8 @@ remover_->RemoveWithFilterAndReply( base::Time(), base::Time::Max(), BrowsingDataRemover::DATA_TYPE_COOKIES | - BrowsingDataRemover::DATA_TYPE_CHANNEL_IDS, + BrowsingDataRemover::DATA_TYPE_CHANNEL_IDS | + BrowsingDataRemover::DATA_TYPE_AVOID_CLOSING_CONNECTIONS, BrowsingDataRemover::ORIGIN_TYPE_UNPROTECTED_WEB | BrowsingDataRemover::ORIGIN_TYPE_PROTECTED_WEB, std::move(domain_filter_builder), this); @@ -500,10 +501,15 @@ } // Pretty-print which types are to be cleared. - delegate->AddMessage( - current_url, - base::StringPrintf(kConsoleMessageCleared, output_types.c_str()), - CONSOLE_MESSAGE_LEVEL_INFO); + // TODO(crbug.com/798760): Remove the disclaimer about cookies. + std::string console_output = + base::StringPrintf(kConsoleMessageCleared, output_types.c_str()); + if (*clear_cookies) { + console_output += + " Clearing channel IDs and HTTP authentication cache is currently not" + " supported, as it breaks active network connections."; + } + delegate->AddMessage(current_url, console_output, CONSOLE_MESSAGE_LEVEL_INFO); return true; }
diff --git a/content/browser/browsing_data/clear_site_data_throttle_browsertest.cc b/content/browser/browsing_data/clear_site_data_throttle_browsertest.cc index c466e67..96ac045 100644 --- a/content/browser/browsing_data/clear_site_data_throttle_browsertest.cc +++ b/content/browser/browsing_data/clear_site_data_throttle_browsertest.cc
@@ -84,8 +84,10 @@ BrowsingDataRemover::ORIGIN_TYPE_PROTECTED_WEB; if (cookies) { - int data_type_mask = BrowsingDataRemover::DATA_TYPE_COOKIES | - BrowsingDataRemover::DATA_TYPE_CHANNEL_IDS; + int data_type_mask = + BrowsingDataRemover::DATA_TYPE_COOKIES | + BrowsingDataRemover::DATA_TYPE_CHANNEL_IDS | + BrowsingDataRemover::DATA_TYPE_AVOID_CLOSING_CONNECTIONS; BrowsingDataFilterBuilderImpl filter_builder( BrowsingDataFilterBuilder::WHITELIST);
diff --git a/content/browser/browsing_data/clear_site_data_throttle_unittest.cc b/content/browser/browsing_data/clear_site_data_throttle_unittest.cc index 408dbd1..77b4e919 100644 --- a/content/browser/browsing_data/clear_site_data_throttle_unittest.cc +++ b/content/browser/browsing_data/clear_site_data_throttle_unittest.cc
@@ -337,8 +337,11 @@ throttle.WillProcessResponse(&defer); EXPECT_TRUE(defer); EXPECT_EQ(1u, console_delegate->messages().size()); - EXPECT_EQ("Cleared data types: \"cookies\".", - console_delegate->messages().front().text); + EXPECT_EQ( + "Cleared data types: \"cookies\". " + "Clearing channel IDs and HTTP authentication cache is currently " + "not supported, as it breaks active network connections.", + console_delegate->messages().front().text); EXPECT_EQ(console_delegate->messages().front().level, CONSOLE_MESSAGE_LEVEL_INFO); testing::Mock::VerifyAndClearExpectations(&throttle); @@ -546,10 +549,13 @@ const char* url; const char* output; } kTestCases[] = { - // Successful deletion outputs one line. + // Successful deletion outputs one line, and in case of cookies, also + // a disclaimer about omitted data (crbug.com/798760). {"\"cookies\"", "https://origin1.com/foo", "Clear-Site-Data header on 'https://origin1.com/foo': " - "Cleared data types: \"cookies\".\n"}, + "Cleared data types: \"cookies\". " + "Clearing channel IDs and HTTP authentication cache is currently " + "not supported, as it breaks active network connections.\n"}, // Another successful deletion. {"\"storage\"", "https://origin2.com/foo",
diff --git a/content/browser/child_process_launcher_helper_mac.cc b/content/browser/child_process_launcher_helper_mac.cc index fe69395..ee448dbe 100644 --- a/content/browser/child_process_launcher_helper_mac.cc +++ b/content/browser/child_process_launcher_helper_mac.cc
@@ -80,6 +80,7 @@ case service_manager::SANDBOX_TYPE_NACL_LOADER: case service_manager::SANDBOX_TYPE_PDF_COMPOSITOR: case service_manager::SANDBOX_TYPE_PROFILING: + case service_manager::SANDBOX_TYPE_GPU: v2_process = true; break; default:
diff --git a/content/browser/devtools/protocol/network_handler.cc b/content/browser/devtools/protocol/network_handler.cc index a3f82f4..46a4e3ca 100644 --- a/content/browser/devtools/protocol/network_handler.cc +++ b/content/browser/devtools/protocol/network_handler.cc
@@ -960,11 +960,11 @@ double download_throughput, double upload_throughput, Maybe<protocol::Network::ConnectionType>) { - mojom::NetworkConditionsPtr network_conditions; + network::mojom::NetworkConditionsPtr network_conditions; bool throttling_enabled = offline || latency > 0 || download_throughput > 0 || upload_throughput > 0; if (throttling_enabled) { - network_conditions = mojom::NetworkConditions::New(); + network_conditions = network::mojom::NetworkConditions::New(); network_conditions->offline = offline; network_conditions->latency = base::TimeDelta::FromMilliseconds(latency); network_conditions->download_throughput = download_throughput; @@ -1395,11 +1395,11 @@ } void NetworkHandler::SetNetworkConditions( - mojom::NetworkConditionsPtr conditions) { + network::mojom::NetworkConditionsPtr conditions) { if (!process_) return; StoragePartition* partition = process_->GetStoragePartition(); - mojom::NetworkContext* context = partition->GetNetworkContext(); + network::mojom::NetworkContext* context = partition->GetNetworkContext(); context->SetNetworkConditions(host_id_, std::move(conditions)); }
diff --git a/content/browser/devtools/protocol/network_handler.h b/content/browser/devtools/protocol/network_handler.h index 8c67c89..4a92de4 100644 --- a/content/browser/devtools/protocol/network_handler.h +++ b/content/browser/devtools/protocol/network_handler.h
@@ -13,9 +13,9 @@ #include "base/memory/weak_ptr.h" #include "content/browser/devtools/protocol/devtools_domain_handler.h" #include "content/browser/devtools/protocol/network.h" -#include "content/public/common/network_service.mojom.h" #include "net/base/net_errors.h" #include "net/cookies/canonical_cookie.h" +#include "services/network/public/interfaces/network_service.mojom.h" namespace net { class HttpRequestHeaders; @@ -147,7 +147,7 @@ private: void RequestIntercepted(std::unique_ptr<InterceptedRequestInfo> request_info); - void SetNetworkConditions(mojom::NetworkConditionsPtr conditions); + void SetNetworkConditions(network::mojom::NetworkConditionsPtr conditions); std::unique_ptr<Network::Frontend> frontend_; RenderProcessHost* process_;
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc index f576c78..fc3412c 100644 --- a/content/browser/frame_host/render_frame_host_impl.cc +++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -122,7 +122,6 @@ #include "content/public/common/file_chooser_file_info.h" #include "content/public/common/file_chooser_params.h" #include "content/public/common/isolated_world_ids.h" -#include "content/public/common/network_service.mojom.h" #include "content/public/common/service_manager_connection.h" #include "content/public/common/service_names.mojom.h" #include "content/public/common/url_constants.h" @@ -143,6 +142,7 @@ #include "services/device/public/interfaces/sensor_provider.mojom.h" #include "services/device/public/interfaces/wake_lock.mojom.h" #include "services/device/public/interfaces/wake_lock_context.mojom.h" +#include "services/network/public/interfaces/network_service.mojom.h" #include "services/resource_coordinator/public/cpp/frame_resource_coordinator.h" #include "services/resource_coordinator/public/cpp/resource_coordinator_features.h" #include "services/service_manager/public/cpp/connector.h" @@ -3071,7 +3071,7 @@ render_frame_host_impl->GetProcess()->GetBrowserContext(); StoragePartition* storage_partition = BrowserContext::GetDefaultStoragePartition(browser_context); - mojom::NetworkContext* network_context = + network::mojom::NetworkContext* network_context = storage_partition->GetNetworkContext(); uint32_t render_process_id = render_frame_host_impl->GetProcess()->GetID(); uint32_t render_frame_id = render_frame_host_impl->GetRoutingID();
diff --git a/content/browser/frame_host/render_frame_message_filter.h b/content/browser/frame_host/render_frame_message_filter.h index 0b884a7..8c33712 100644 --- a/content/browser/frame_host/render_frame_message_filter.h +++ b/content/browser/frame_host/render_frame_message_filter.h
@@ -13,10 +13,10 @@ #include "content/common/render_frame_message_filter.mojom.h" #include "content/public/browser/browser_associated_interface.h" #include "content/public/browser/browser_message_filter.h" -#include "content/public/common/network_service.mojom.h" #include "content/public/common/three_d_api_types.h" #include "net/cookies/canonical_cookie.h" #include "ppapi/features/features.h" +#include "services/network/public/interfaces/network_service.mojom.h" #include "third_party/WebKit/public/web/WebTreeScopeType.h" #if BUILDFLAG(ENABLE_PLUGINS)
diff --git a/content/browser/loader/mime_sniffing_resource_handler.cc b/content/browser/loader/mime_sniffing_resource_handler.cc index 64e79f16..f951a3f 100644 --- a/content/browser/loader/mime_sniffing_resource_handler.cc +++ b/content/browser/loader/mime_sniffing_resource_handler.cc
@@ -20,7 +20,6 @@ #include "content/browser/loader/resource_dispatcher_host_impl.h" #include "content/browser/loader/resource_request_info_impl.h" #include "content/browser/loader/stream_resource_handler.h" -#include "content/common/loader_util.h" #include "content/public/browser/content_browser_client.h" #include "content/public/browser/download_item.h" #include "content/public/browser/download_save_info.h" @@ -36,6 +35,7 @@ #include "net/http/http_response_headers.h" #include "net/url_request/url_request.h" #include "ppapi/features/features.h" +#include "services/network/public/cpp/loader_util.h" #include "services/network/public/cpp/resource_response.h" #include "third_party/WebKit/common/mime_util/mime_util.h" #include "url/origin.h" @@ -149,7 +149,7 @@ response_->head.headers->response_code() == 304)) { // MIME sniffing should be disabled for a request initiated by fetch(). if (request_context_type_ != REQUEST_CONTEXT_TYPE_FETCH && - ShouldSniffContent(request(), response_.get())) { + network::ShouldSniffContent(request(), response_.get())) { controller->Resume(); return; }
diff --git a/content/browser/loader/navigation_url_loader_network_service.cc b/content/browser/loader/navigation_url_loader_network_service.cc index 6393244..d9297fa 100644 --- a/content/browser/loader/navigation_url_loader_network_service.cc +++ b/content/browser/loader/navigation_url_loader_network_service.cc
@@ -31,7 +31,6 @@ #include "content/browser/web_contents/web_contents_impl.h" #include "content/browser/webui/url_data_manager_backend.h" #include "content/browser/webui/web_ui_url_loader_factory.h" -#include "content/common/loader_util.h" #include "content/common/navigation_subresource_loader_params.h" #include "content/common/throttling_url_loader.h" #include "content/common/weak_wrapper_shared_url_loader_factory.h" @@ -55,6 +54,7 @@ #include "net/url_request/redirect_util.h" #include "net/url_request/url_request.h" #include "net/url_request/url_request_context.h" +#include "services/network/public/cpp/loader_util.h" #include "services/network/public/interfaces/request_context_frame_type.mojom.h" #include "services/network/public/interfaces/url_loader_factory.mojom.h" #include "services/service_manager/public/cpp/connector.h" @@ -826,7 +826,8 @@ request_info->common_params.referrer.policy); new_request->headers.AddHeadersFromString( request_info->begin_params->headers); - new_request->headers.SetHeader(kAcceptHeader, kFrameAcceptHeader); + new_request->headers.SetHeader(network::kAcceptHeader, + network::kFrameAcceptHeader); new_request->resource_type = request_info->is_main_frame ? RESOURCE_TYPE_MAIN_FRAME
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc index fbe324f0..ce39b49 100644 --- a/content/browser/loader/resource_dispatcher_host_impl.cc +++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -69,7 +69,6 @@ #include "content/browser/streams/stream.h" #include "content/browser/streams/stream_context.h" #include "content/browser/streams/stream_registry.h" -#include "content/common/loader_util.h" #include "content/common/net/url_request_service_worker_data.h" #include "content/common/view_messages.h" #include "content/public/browser/browser_child_process_host.h" @@ -110,6 +109,7 @@ #include "net/url_request/url_request_context_getter.h" #include "net/url_request/url_request_job_factory.h" #include "ppapi/features/features.h" +#include "services/network/public/cpp/loader_util.h" #include "services/network/public/cpp/resource_request.h" #include "services/network/public/cpp/resource_request_body.h" #include "services/network/public/cpp/url_loader_completion_status.h" @@ -1034,7 +1034,7 @@ storage::BlobStorageContext* blob_context = nullptr; bool do_not_prompt_for_login = false; bool report_raw_headers = false; - int load_flags = BuildLoadFlagsForRequest(request_data); + int load_flags = request_data.load_flags; bool is_navigation_stream_request = IsBrowserSideNavigationEnabled() && IsResourceTypeFrame( @@ -1099,7 +1099,7 @@ // else it will fail for SSL redirects since net/ will think the blob:https // for the stream is not a secure scheme (specifically, in the call to // ComputeReferrerForRedirect). - new_request->SetReferrer(ComputeReferrer(request_data.referrer)); + new_request->SetReferrer(network::ComputeReferrer(request_data.referrer)); new_request->set_referrer_policy(request_data.referrer_policy); new_request->SetExtraRequestHeaders(headers); @@ -1841,9 +1841,6 @@ if (info.is_main_frame) load_flags |= net::LOAD_MAIN_FRAME_DEPRECATED; - // TODO(davidben): BuildLoadFlagsForRequest includes logic for - // CanSendCookiesForOrigin and CanReadRawCookies. Is this needed here? - // Sync loads should have maximum priority and should be the only // requests that have the ignore limits flag set. DCHECK(!(load_flags & net::LOAD_IGNORE_LIMITS)); @@ -1865,7 +1862,7 @@ net::HttpRequestHeaders headers; headers.AddHeadersFromString(info.begin_params->headers); - headers.SetHeader(kAcceptHeader, kFrameAcceptHeader); + headers.SetHeader(network::kAcceptHeader, network::kFrameAcceptHeader); new_request->SetExtraRequestHeaders(headers); new_request->SetLoadFlags(load_flags);
diff --git a/content/browser/loader/resource_loader.cc b/content/browser/loader/resource_loader.cc index 5b1a8778..46a15c20 100644 --- a/content/browser/loader/resource_loader.cc +++ b/content/browser/loader/resource_loader.cc
@@ -25,7 +25,6 @@ #include "content/browser/service_worker/service_worker_response_info.h" #include "content/browser/ssl/ssl_client_auth_handler.h" #include "content/browser/ssl/ssl_manager.h" -#include "content/common/loader_util.h" #include "content/public/browser/resource_dispatcher_host_login_delegate.h" #include "content/public/common/appcache_info.h" #include "content/public/common/browser_side_navigation_policy.h" @@ -43,6 +42,7 @@ #include "net/url_request/redirect_info.h" #include "net/url_request/url_request_context.h" #include "net/url_request/url_request_status.h" +#include "services/network/public/cpp/loader_util.h" #include "services/network/public/cpp/resource_response.h" using base::TimeDelta; @@ -77,8 +77,9 @@ static_cast<int>(request_info->GetPreviewsState()); } if (info->ShouldReportRawHeaders()) { - response->head.raw_request_response_info = BuildRawRequestResponseInfo( - *request, raw_request_headers, raw_response_headers); + response->head.raw_request_response_info = + network::BuildRawRequestResponseInfo(*request, raw_request_headers, + raw_response_headers); } response->head.effective_connection_type =
diff --git a/content/browser/media/capture/cursor_renderer.cc b/content/browser/media/capture/cursor_renderer.cc index b83df98..cff5e6d 100644 --- a/content/browser/media/capture/cursor_renderer.cc +++ b/content/browser/media/capture/cursor_renderer.cc
@@ -285,6 +285,12 @@ CursorRendererUndoer::~CursorRendererUndoer() = default; +CursorRendererUndoer::CursorRendererUndoer(CursorRendererUndoer&& other) = + default; + +CursorRendererUndoer& CursorRendererUndoer::operator=( + CursorRendererUndoer&& other) = default; + namespace { // Returns the rect of pixels in a Chroma plane affected by the given |rect| in
diff --git a/content/browser/media/capture/cursor_renderer.h b/content/browser/media/capture/cursor_renderer.h index ac45a0f..b9d1acc 100644 --- a/content/browser/media/capture/cursor_renderer.h +++ b/content/browser/media/capture/cursor_renderer.h
@@ -185,6 +185,9 @@ CursorRendererUndoer(); ~CursorRendererUndoer(); + CursorRendererUndoer(CursorRendererUndoer&& other); + CursorRendererUndoer& operator=(CursorRendererUndoer&& other); + void TakeSnapshot(const media::VideoFrame& frame, const gfx::Rect& rect); // Restores the frame content to the point where TakeSnapshot() was last
diff --git a/content/browser/media/capture/frame_sink_video_capture_device.cc b/content/browser/media/capture/frame_sink_video_capture_device.cc new file mode 100644 index 0000000..5422fdf --- /dev/null +++ b/content/browser/media/capture/frame_sink_video_capture_device.cc
@@ -0,0 +1,441 @@ +// Copyright 2018 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 "content/browser/media/capture/frame_sink_video_capture_device.h" + +#include "base/bind.h" +#include "base/bind_helpers.h" +#include "base/callback.h" +#include "base/callback_helpers.h" +#include "base/location.h" +#include "base/logging.h" +#include "base/macros.h" +#include "base/memory/ref_counted.h" +#include "base/memory/weak_ptr.h" +#include "base/numerics/safe_conversions.h" +#include "base/time/time.h" +#include "components/viz/host/host_frame_sink_manager.h" +#include "content/browser/compositor/surface_utils.h" +#include "media/base/bind_to_current_loop.h" +#include "media/capture/mojo/video_capture_types.mojom.h" +#include "mojo/public/cpp/system/buffer.h" + +namespace content { + +namespace { + +// Transfers ownership of an object to a std::unique_ptr with a custom deleter +// that ensures the object is destroyed on the UI BrowserThread. +template <typename T> +std::unique_ptr<T, BrowserThread::DeleteOnUIThread> RescopeToUIThread( + std::unique_ptr<T>&& ptr) { + return std::unique_ptr<T, BrowserThread::DeleteOnUIThread>(ptr.release()); +} + +// Sets up a mojo message pipe and requests the HostFrameSinkManager create a +// new capturer instance bound to it. Returns the client-side interface. +viz::mojom::FrameSinkVideoCapturerPtrInfo CreateCapturer() { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + + viz::HostFrameSinkManager* const manager = GetHostFrameSinkManager(); + DCHECK(manager); + viz::mojom::FrameSinkVideoCapturerPtr capturer; + manager->CreateVideoCapturer(mojo::MakeRequest(&capturer)); + return capturer.PassInterface(); +} + +// Adapter for a VideoFrameReceiver to get access to the mojo SharedBufferHandle +// for a frame. +class HandleMover + : public media::VideoCaptureDevice::Client::Buffer::HandleProvider { + public: + explicit HandleMover(mojo::ScopedSharedBufferHandle handle) + : handle_(std::move(handle)) {} + ~HandleMover() final {} + + mojo::ScopedSharedBufferHandle GetHandleForInterProcessTransit( + bool read_only) final { + return std::move(handle_); + } + + base::SharedMemoryHandle GetNonOwnedSharedMemoryHandleForLegacyIPC() final { + NOTREACHED(); + return base::SharedMemoryHandle(); + } + + std::unique_ptr<media::VideoCaptureBufferHandle> GetHandleForInProcessAccess() + final { + NOTREACHED(); + return nullptr; + } + + private: + mojo::ScopedSharedBufferHandle handle_; +}; + +// Adapter for a VideoFrameReceiver to notify once frame consumption is +// complete. VideoFrameReceiver requires owning an object that it will destroy +// once consumption is complete. This class adapts between that scheme and +// running a "done callback" to notify that consumption is complete. +class ScopedFrameDoneHelper + : public base::ScopedClosureRunner, + public media::VideoCaptureDevice::Client::Buffer::ScopedAccessPermission { + public: + ScopedFrameDoneHelper(base::OnceClosure done_callback) + : base::ScopedClosureRunner(std::move(done_callback)) {} + ~ScopedFrameDoneHelper() final = default; +}; + +} // namespace + +FrameSinkVideoCaptureDevice::FrameSinkVideoCaptureDevice() + : capturer_creator_(base::BindRepeating(&CreateCapturer)), + binding_(this), + cursor_renderer_(RescopeToUIThread(CursorRenderer::Create( + CursorRenderer::CURSOR_DISPLAYED_ON_MOUSE_MOVEMENT))), + weak_factory_(this) { + DCHECK(cursor_renderer_); +} + +FrameSinkVideoCaptureDevice::~FrameSinkVideoCaptureDevice() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK(!receiver_) << "StopAndDeAllocate() was never called after start."; +} + +void FrameSinkVideoCaptureDevice::AllocateAndStartWithReceiver( + const media::VideoCaptureParams& params, + std::unique_ptr<media::VideoFrameReceiver> receiver) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK(params.IsValid()); + DCHECK(receiver); + + // If the device has already ended on a fatal error, abort immediately. + if (fatal_error_message_) { + receiver->OnLog(*fatal_error_message_); + receiver->OnError(); + return; + } + + capture_params_ = params; + DCHECK(!receiver_); + receiver_ = std::move(receiver); + + // Set a callback that will be run whenever the mouse moves, to trampoline + // back to the device thread and request a refresh frame so that the new mouse + // cursor location can be drawn in a new video frame. + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, + base::BindOnce(&CursorRenderer::SetNeedsRedrawCallback, + base::Unretained(cursor_renderer_.get()), + media::BindToCurrentLoop(base::BindRepeating( + &FrameSinkVideoCaptureDevice::RequestRefreshFrame, + weak_factory_.GetWeakPtr())))); + + // Hop to the UI thread to request a Mojo connection to a new capturer + // instance, and then hop back to the device thread to start using it. + BrowserThread::PostTaskAndReplyWithResult( + BrowserThread::UI, FROM_HERE, base::BindOnce(capturer_creator_), + base::BindOnce(&FrameSinkVideoCaptureDevice::OnCapturerCreated, + weak_factory_.GetWeakPtr())); +} + +void FrameSinkVideoCaptureDevice::AllocateAndStart( + const media::VideoCaptureParams& params, + std::unique_ptr<media::VideoCaptureDevice::Client> client) { + // FrameSinkVideoCaptureDevice does not use a + // VideoCaptureDevice::Client. Instead, it provides frames to a + // VideoFrameReceiver directly. + NOTREACHED(); +} + +void FrameSinkVideoCaptureDevice::RequestRefreshFrame() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + if (capturer_ && binding_.is_bound() && !suspend_requested_) { + capturer_->RequestRefreshFrame(); + } +} + +void FrameSinkVideoCaptureDevice::MaybeSuspend() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + suspend_requested_ = true; + MaybeStopConsuming(); +} + +void FrameSinkVideoCaptureDevice::Resume() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + suspend_requested_ = false; + MaybeStartConsuming(); +} + +void FrameSinkVideoCaptureDevice::StopAndDeAllocate() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + // Discontinue requesting extra video frames to render mouse cursor changes. + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, + base::BindOnce(&CursorRenderer::SetNeedsRedrawCallback, + base::Unretained(cursor_renderer_.get()), + base::RepeatingClosure())); + + MaybeStopConsuming(); + capturer_.reset(); + if (receiver_) { + receiver_.reset(); + } +} + +void FrameSinkVideoCaptureDevice::OnUtilizationReport(int frame_feedback_id, + double utilization) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + // Assumption: The "slot" should be valid at this point because this method + // will always be called before the VideoFrameReceiver signals it is done + // consuming the frame. + const auto slot_index = static_cast<size_t>(frame_feedback_id); + DCHECK_LT(slot_index, slots_.size()); + slots_[slot_index].callbacks->ProvideFeedback(utilization); +} + +void FrameSinkVideoCaptureDevice::OnFrameCaptured( + mojo::ScopedSharedBufferHandle buffer, + uint32_t buffer_size, + media::mojom::VideoFrameInfoPtr info, + const gfx::Rect& update_rect, + const gfx::Rect& content_rect, + viz::mojom::FrameSinkVideoConsumerFrameCallbacksPtr callbacks) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK(callbacks); + + if (!receiver_ || !buffer.is_valid()) { + callbacks->Done(); + return; + } + + // Search for the next available ConsumptionState slot and bind |callbacks| + // there. + size_t slot_index = 0; + for (;; ++slot_index) { + if (slot_index == slots_.size()) { + // The growth of |slots_| should be bounded because the + // viz::mojom::FrameSinkVideoCapturer should enforce an upper-bound on the + // number of frames in-flight. + constexpr size_t kMaxInFlightFrames = 32; // Arbitrarily-chosen limit. + DCHECK_LT(slots_.size(), kMaxInFlightFrames); + slots_.emplace_back(); + break; + } + if (!slots_[slot_index].callbacks.is_bound()) { + break; + } + } + ConsumptionState& slot = slots_[slot_index]; + slot.callbacks = std::move(callbacks); + + // Render the mouse cursor on the video frame, but first map the shared memory + // into the current process in order to render the cursor. + mojo::ScopedSharedBufferMapping mapping = buffer->Map(buffer_size); + scoped_refptr<media::VideoFrame> frame; + if (mapping) { + frame = media::VideoFrame::WrapExternalData( + info->pixel_format, info->coded_size, info->visible_rect, + info->visible_rect.size(), static_cast<uint8_t*>(mapping.get()), + buffer_size, info->timestamp); + if (frame) { + frame->AddDestructionObserver(base::BindOnce( + [](mojo::ScopedSharedBufferMapping mapping) {}, std::move(mapping))); + if (!cursor_renderer_->RenderOnVideoFrame(frame.get(), content_rect, + &slot.undoer)) { + // Release |frame| now, since no "undo cursor rendering" will be needed. + frame = nullptr; + } + } + } + + // Set the INTERACTIVE_CONTENT frame metadata. + media::VideoFrameMetadata modified_metadata; + if (info->metadata) { + modified_metadata.MergeInternalValuesFrom(*info->metadata); + } + modified_metadata.SetBoolean(media::VideoFrameMetadata::INTERACTIVE_CONTENT, + cursor_renderer_->IsUserInteractingWithView()); + info->metadata = modified_metadata.CopyInternalValues(); + + // Pass the video frame to the VideoFrameReceiver. This is done by first + // passing the shared memory buffer handle and then notifying it that a new + // frame is ready to be read from the buffer. + receiver_->OnNewBufferHandle( + static_cast<BufferId>(slot_index), + std::make_unique<HandleMover>(std::move(buffer))); + receiver_->OnFrameReadyInBuffer( + static_cast<BufferId>(slot_index), slot_index, + std::make_unique<ScopedFrameDoneHelper>( + media::BindToCurrentLoop(base::BindOnce( + &FrameSinkVideoCaptureDevice::OnFramePropagationComplete, + weak_factory_.GetWeakPtr(), slot_index, std::move(frame)))), + std::move(info)); +} + +void FrameSinkVideoCaptureDevice::OnTargetLost( + const viz::FrameSinkId& frame_sink_id) { + // This is ignored because FrameSinkVideoCaptureDevice subclasses always call + // OnTargetChanged() and OnTargetPermanentlyLost() to resolve lost targets. +} + +void FrameSinkVideoCaptureDevice::OnStopped() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + // This method would never be called if FrameSinkVideoCaptureDevice explicitly + // called capturer_->Stop(), because the binding is closed at that time. + // Therefore, a call to this method means that the capturer cannot continue; + // and that's a permanent failure. + OnFatalError("Capturer service cannot continue."); +} + +void FrameSinkVideoCaptureDevice::OnTargetChanged( + const viz::FrameSinkId& frame_sink_id, + gfx::NativeView native_view) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + target_ = frame_sink_id; + if (capturer_) { + capturer_->ChangeTarget(frame_sink_id); + } + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, + base::BindOnce(&CursorRenderer::SetTargetView, + base::Unretained(cursor_renderer_.get()), native_view)); +} + +void FrameSinkVideoCaptureDevice::OnTargetPermanentlyLost() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + target_ = viz::FrameSinkId(); + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, + base::BindOnce(&CursorRenderer::SetTargetView, + base::Unretained(cursor_renderer_.get()), + gfx::NativeView())); + + OnFatalError("Capture target has been permanently lost."); +} + +void FrameSinkVideoCaptureDevice::SetCapturerCreatorForTesting( + CapturerCreatorCallback creator) { + capturer_creator_ = std::move(creator); +} + +void FrameSinkVideoCaptureDevice::OnCapturerCreated( + viz::mojom::FrameSinkVideoCapturerPtrInfo info) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + if (!receiver_) { + return; // StopAndDeAllocate() occurred in the meantime. + } + + // Shutdown the prior capturer, if any. + MaybeStopConsuming(); + capturer_.reset(); + + // Bind and configure the new capturer. + capturer_.Bind(std::move(info)); + // TODO(miu): Remove this once HostFrameSinkManager will notify this + // consumer when to take recovery steps after VIZ process crashes. + capturer_.set_connection_error_handler(base::BindOnce( + &FrameSinkVideoCaptureDevice::OnFatalError, base::Unretained(this), + "Capturer service connection lost.")); + capturer_->SetFormat(capture_params_.requested_format.pixel_format, + media::COLOR_SPACE_UNSPECIFIED); + capturer_->SetMinCapturePeriod( + base::TimeDelta::FromMicroseconds(base::saturated_cast<int64_t>( + base::Time::kMicrosecondsPerSecond / + capture_params_.requested_format.frame_rate))); + const auto& constraints = capture_params_.SuggestConstraints(); + capturer_->SetResolutionConstraints(constraints.min_frame_size, + constraints.max_frame_size, + constraints.fixed_aspect_ratio); + + if (target_.is_valid()) { + capturer_->ChangeTarget(target_); + } + + receiver_->OnStarted(); + + if (!suspend_requested_) { + MaybeStartConsuming(); + } +} + +void FrameSinkVideoCaptureDevice::MaybeStartConsuming() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + if (!receiver_ || !capturer_ || binding_.is_bound()) { + return; + } + + viz::mojom::FrameSinkVideoConsumerPtr consumer; + binding_.Bind(mojo::MakeRequest(&consumer)); + // TODO(miu): Remove this once HostFrameSinkManager will notify this consumer + // when to take recovery steps after VIZ process crashes. + binding_.set_connection_error_handler(base::BindOnce( + &FrameSinkVideoCaptureDevice::OnFatalError, base::Unretained(this), + "Consumer connection to Capturer service lost.")); + capturer_->Start(std::move(consumer)); +} + +void FrameSinkVideoCaptureDevice::MaybeStopConsuming() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + if (capturer_) { + capturer_->Stop(); + } + binding_.Close(); +} + +void FrameSinkVideoCaptureDevice::OnFramePropagationComplete( + size_t slot_index, + scoped_refptr<media::VideoFrame> frame) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK_LT(slot_index, slots_.size()); + + // Notify the VideoFrameReceiver that the buffer is no longer valid. + if (receiver_) { + receiver_->OnBufferRetired(static_cast<BufferId>(slot_index)); + } + + // Undo the mouse cursor rendering, if any. + ConsumptionState& slot = slots_[slot_index]; + if (frame) { + slot.undoer.Undo(frame.get()); + frame = nullptr; + } + + // Notify the capturer that consumption of the frame is complete. + slot.callbacks->Done(); + slot.callbacks.reset(); +} + +void FrameSinkVideoCaptureDevice::OnFatalError(std::string message) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + fatal_error_message_ = std::move(message); + if (receiver_) { + receiver_->OnLog(*fatal_error_message_); + receiver_->OnError(); + } + + StopAndDeAllocate(); +} + +FrameSinkVideoCaptureDevice::ConsumptionState::ConsumptionState() = default; +FrameSinkVideoCaptureDevice::ConsumptionState::~ConsumptionState() = default; +FrameSinkVideoCaptureDevice::ConsumptionState::ConsumptionState( + FrameSinkVideoCaptureDevice::ConsumptionState&& other) = default; +FrameSinkVideoCaptureDevice::ConsumptionState& +FrameSinkVideoCaptureDevice::ConsumptionState::operator=( + FrameSinkVideoCaptureDevice::ConsumptionState&& other) = default; + +} // namespace content
diff --git a/content/browser/media/capture/frame_sink_video_capture_device.h b/content/browser/media/capture/frame_sink_video_capture_device.h new file mode 100644 index 0000000..d7f2f9d --- /dev/null +++ b/content/browser/media/capture/frame_sink_video_capture_device.h
@@ -0,0 +1,172 @@ +// Copyright 2018 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 CONTENT_BROWSER_MEDIA_CAPTURE_FRAME_SINK_VIDEO_CAPTURE_DEVICE_H_ +#define CONTENT_BROWSER_MEDIA_CAPTURE_FRAME_SINK_VIDEO_CAPTURE_DEVICE_H_ + +#include <memory> +#include <vector> + +#include "base/macros.h" +#include "base/memory/weak_ptr.h" +#include "base/optional.h" +#include "base/sequence_checker.h" +#include "components/viz/common/surfaces/frame_sink_id.h" +#include "content/browser/media/capture/cursor_renderer.h" +#include "content/common/content_export.h" +#include "content/public/browser/browser_thread.h" +#include "media/base/video_frame.h" +#include "media/capture/video/video_capture_device.h" +#include "media/capture/video/video_frame_receiver.h" +#include "media/capture/video_capture_types.h" +#include "mojo/public/cpp/bindings/binding.h" +#include "services/viz/privileged/interfaces/compositing/frame_sink_video_capture.mojom.h" +#include "ui/gfx/native_widget_types.h" + +namespace content { + +// A virtualized VideoCaptureDevice that captures the displayed contents of a +// frame sink (see viz::CompositorFrameSink), such as the composited main view +// of a WebContents instance, producing a stream of video frames. +// +// From the point-of-view of the VIZ service, this is a consumer of video frames +// (viz::mojom::FrameSinkVideoConsumer). However, from the point-of-view of the +// video capture stack, this is a device (media::VideoCaptureDevice) that +// produces video frames. Therefore, a FrameSinkVideoCaptureDevice is really a +// proxy between the two subsystems. +// +// Usually, a subclass implementation is instantiated and used, such as +// WebContentsVideoCaptureDevice or AuraWindowCaptureDevice. These subclasses +// provide additional implementation, to update which frame sink is targeted for +// capture, and to notify other components that capture is taking place. +class CONTENT_EXPORT FrameSinkVideoCaptureDevice + : public media::VideoCaptureDevice, + public viz::mojom::FrameSinkVideoConsumer { + public: + using CapturerCreatorCallback = + base::RepeatingCallback<viz::mojom::FrameSinkVideoCapturerPtrInfo()>; + + FrameSinkVideoCaptureDevice(); + ~FrameSinkVideoCaptureDevice() override; + + // Deviation from the VideoCaptureDevice interface: Since the memory pooling + // provided by a VideoCaptureDevice::Client is not needed, this + // FrameSinkVideoCaptureDevice will provide frames to a VideoFrameReceiver + // directly. + void AllocateAndStartWithReceiver( + const media::VideoCaptureParams& params, + std::unique_ptr<media::VideoFrameReceiver> receiver); + + // VideoCaptureDevice implementation. + void AllocateAndStart(const media::VideoCaptureParams& params, + std::unique_ptr<Client> client) final; + void RequestRefreshFrame() final; + void MaybeSuspend() final; + void Resume() final; + void StopAndDeAllocate() final; + void OnUtilizationReport(int frame_feedback_id, double utilization) final; + + // FrameSinkVideoConsumer implementation. + void OnFrameCaptured( + mojo::ScopedSharedBufferHandle buffer, + uint32_t buffer_size, + media::mojom::VideoFrameInfoPtr info, + const gfx::Rect& update_rect, + const gfx::Rect& content_rect, + viz::mojom::FrameSinkVideoConsumerFrameCallbacksPtr callbacks) final; + void OnTargetLost(const viz::FrameSinkId& frame_sink_id) final; + void OnStopped() final; + + // These are called to notify when the capture target has changed or was + // permanently lost. |frame_sink_id| specifies a target compositor frame sink, + // while |native_view| is the local view to monitor for the puproses of mouse + // cursor rendering. + void OnTargetChanged(const viz::FrameSinkId& frame_sink_id, + gfx::NativeView native_view); + void OnTargetPermanentlyLost(); + + // Overrides the callback that is run to create the capturer. + void SetCapturerCreatorForTesting(CapturerCreatorCallback creator); + + private: + using BufferId = decltype(media::VideoCaptureDevice::Client::Buffer::id); + + // Bind a newly-created capturer, configure it, and resuming consuming. + void OnCapturerCreated(viz::mojom::FrameSinkVideoCapturerPtrInfo info); + + // If not consuming and all preconditions are met, set up and start consuming. + void MaybeStartConsuming(); + + // If consuming, shut it down. + void MaybeStopConsuming(); + + // Undoes mouse cursor rendering and notifies the capturer that consumption of + // the frame is complete. + void OnFramePropagationComplete(size_t slot_index, + scoped_refptr<media::VideoFrame> frame); + + // Helper that logs the given error |message| to the |receiver_| and then + // stops capture and this VideoCaptureDevice. + void OnFatalError(std::string message); + + // Current capture target. This is cached to resolve a race where + // OnTargetChanged() can be called before the |capturer_| is created in + // OnCapturerCreated(). + viz::FrameSinkId target_; + + // The requested format, rate, and other capture constraints. + media::VideoCaptureParams capture_params_; + + // Set to true when MaybeSuspend() is called, and false when Resume() is + // called. This reflects the needs of the downstream client. + bool suspend_requested_ = false; + + // Receives video frames from this capture device, for propagation into the + // video capture stack. This is set by AllocateAndStartWithReceiver(), and + // cleared by StopAndDeAllocate(). + std::unique_ptr<media::VideoFrameReceiver> receiver_; + + // Callback that is run to request a capturer be created and returns the + // client-side interface. This callback will be run on the UI BrowserThread. + // The constructor provides a default, but unit tests can override this. + CapturerCreatorCallback capturer_creator_; + + // Mojo pointer to the capturer instance in VIZ. + viz::mojom::FrameSinkVideoCapturerPtr capturer_; + + // Mojo binding to this instance as a consumer of frames from the capturer. + mojo::Binding<viz::mojom::FrameSinkVideoConsumer> binding_; + + // A pool of structs that hold state relevant to frames currently being + // processed by VideoFrameReceiver. Each "slot" is re-used by later frames. + struct ConsumptionState { + viz::mojom::FrameSinkVideoConsumerFrameCallbacksPtr callbacks; + CursorRendererUndoer undoer; + + ConsumptionState(); + ~ConsumptionState(); + ConsumptionState(ConsumptionState&& other); + ConsumptionState& operator=(ConsumptionState&& other); + }; + std::vector<ConsumptionState> slots_; + + // Set when OnFatalError() is called. This prevents any future + // AllocateAndStartWithReceiver() calls from succeeding. + base::Optional<std::string> fatal_error_message_; + + SEQUENCE_CHECKER(sequence_checker_); + + // Renders the mouse cursor on each video frame. + const std::unique_ptr<CursorRenderer, BrowserThread::DeleteOnUIThread> + cursor_renderer_; + + // Creates WeakPtrs for use on the device thread. + base::WeakPtrFactory<FrameSinkVideoCaptureDevice> weak_factory_; + + DISALLOW_COPY_AND_ASSIGN(FrameSinkVideoCaptureDevice); +}; + +} // namespace content + +#endif // CONTENT_BROWSER_MEDIA_CAPTURE_FRAME_SINK_VIDEO_CAPTURE_DEVICE_H_
diff --git a/content/browser/media/capture/frame_sink_video_capture_device_unittest.cc b/content/browser/media/capture/frame_sink_video_capture_device_unittest.cc new file mode 100644 index 0000000..1ab56cb --- /dev/null +++ b/content/browser/media/capture/frame_sink_video_capture_device_unittest.cc
@@ -0,0 +1,604 @@ +// Copyright 2018 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 "content/browser/media/capture/frame_sink_video_capture_device.h" + +#include <memory> + +#include "base/bind.h" +#include "base/bind_helpers.h" +#include "base/containers/flat_map.h" +#include "content/public/test/test_browser_thread_bundle.h" +#include "content/public/test/test_utils.h" +#include "media/base/video_frame.h" +#include "media/capture/video/video_frame_receiver.h" +#include "media/capture/video_capture_types.h" +#include "mojo/public/cpp/bindings/binding.h" +#include "services/viz/privileged/interfaces/compositing/frame_sink_video_capture.mojom.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "ui/gfx/geometry/size.h" +#include "ui/gfx/native_widget_types.h" + +using testing::_; +using testing::ByRef; +using testing::Eq; +using testing::Expectation; +using testing::Ge; +using testing::NiceMock; +using testing::NotNull; +using testing::SaveArg; +using testing::Sequence; +using testing::StrNe; + +namespace content { +namespace { + +// Threading notes: Throughout these tests, the UI thread (the main test +// thread) represents the executor of all external-to-device operations. This +// means that it represents everything that runs on the UI thread in the browser +// process, plus anything that would run in the VIZ process. The IO thread is +// used as the "device thread" for content::FrameSinkVideoCaptureDevice. +#define DCHECK_ON_DEVICE_THREAD() DCHECK_CURRENTLY_ON(BrowserThread::IO) +#define DCHECK_NOT_ON_DEVICE_THREAD() DCHECK_CURRENTLY_ON(BrowserThread::UI) + +// Convenience macro to block the test procedure and run all pending UI tasks. +#define RUN_UI_TASKS() RunAllPendingInMessageLoop(BrowserThread::UI) + +// Convenience macro to post a task to run on the device thread. +#define POST_DEVICE_TASK(closure) \ + BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, closure) + +// Convenience macro to block the test procedure until all pending tasks have +// run on the device thread. +#define WAIT_FOR_DEVICE_TASKS() RunAllPendingInMessageLoop(BrowserThread::IO) + +// Capture parameters. +constexpr gfx::Size kResolution = gfx::Size(320, 180); +constexpr int kMaxFrameRate = 25; // It evenly divides 1 million usec. +constexpr base::TimeDelta kMinCapturePeriod = base::TimeDelta::FromMicroseconds( + base::Time::kMicrosecondsPerSecond / kMaxFrameRate); +constexpr media::VideoPixelFormat kFormat = media::PIXEL_FORMAT_I420; +constexpr media::VideoPixelStorage kStorage = media::VideoPixelStorage::CPU; + +// Helper to return the capture parameters packaged in a VideoCaptureParams. +media::VideoCaptureParams GetCaptureParams() { + media::VideoCaptureParams params; + params.requested_format = + media::VideoCaptureFormat(kResolution, kMaxFrameRate, kFormat, kStorage); + return params; +} + +// Mock for the FrameSinkVideoCapturer running in the VIZ process. +class MockFrameSinkVideoCapturer : public viz::mojom::FrameSinkVideoCapturer { + public: + MockFrameSinkVideoCapturer() : binding_(this) {} + + bool is_bound() const { return binding_.is_bound(); } + + void Bind(viz::mojom::FrameSinkVideoCapturerRequest request) { + DCHECK_NOT_ON_DEVICE_THREAD(); + binding_.Bind(std::move(request)); + } + + MOCK_METHOD2(SetFormat, + void(media::VideoPixelFormat format, + media::ColorSpace color_space)); + MOCK_METHOD1(SetMinCapturePeriod, void(base::TimeDelta min_period)); + MOCK_METHOD3(SetResolutionConstraints, + void(const gfx::Size& min_size, + const gfx::Size& max_size, + bool use_fixed_aspect_ratio)); + MOCK_METHOD1(ChangeTarget, void(const viz::FrameSinkId& frame_sink_id)); + void Start(viz::mojom::FrameSinkVideoConsumerPtr consumer) final { + DCHECK_NOT_ON_DEVICE_THREAD(); + consumer_ = std::move(consumer); + MockStart(consumer_.get()); + } + MOCK_METHOD1(MockStart, void(viz::mojom::FrameSinkVideoConsumer* consumer)); + void Stop() final { + DCHECK_NOT_ON_DEVICE_THREAD(); + consumer_.reset(); + MockStop(); + } + MOCK_METHOD0(MockStop, void()); + MOCK_METHOD0(RequestRefreshFrame, void()); + + private: + mojo::Binding<viz::mojom::FrameSinkVideoCapturer> binding_; + viz::mojom::FrameSinkVideoConsumerPtr consumer_; +}; + +// Represents the FrameSinkVideoConsumerFrameCallbacks instance in the VIZ +// process. +class MockFrameSinkVideoConsumerFrameCallbacks + : public viz::mojom::FrameSinkVideoConsumerFrameCallbacks { + public: + MockFrameSinkVideoConsumerFrameCallbacks() : binding_(this) {} + + void Bind(viz::mojom::FrameSinkVideoConsumerFrameCallbacksRequest request) { + DCHECK_NOT_ON_DEVICE_THREAD(); + binding_.Bind(std::move(request)); + } + + MOCK_METHOD0(Done, void()); + MOCK_METHOD1(ProvideFeedback, void(double utilization)); + + private: + mojo::Binding<viz::mojom::FrameSinkVideoConsumerFrameCallbacks> binding_; +}; + +// Mock for the VideoFrameReceiver, the point-of-injection of video frames into +// the video capture stack. It's mocked methods are called on the device thread. +// Some methods stash objects of interest, which test code must grab via the +// TakeXYZ() utility methods (called on the main thread). +class MockVideoFrameReceiver : public media::VideoFrameReceiver { + public: + using Buffer = media::VideoCaptureDevice::Client::Buffer; + + ~MockVideoFrameReceiver() override { + DCHECK_ON_DEVICE_THREAD(); + EXPECT_TRUE(handle_providers_.empty()); + EXPECT_TRUE(feedback_ids_.empty()); + EXPECT_TRUE(access_permissions_.empty()); + EXPECT_TRUE(frame_infos_.empty()); + } + + void OnNewBufferHandle( + int buffer_id, + std::unique_ptr<Buffer::HandleProvider> handle_provider) final { + DCHECK_ON_DEVICE_THREAD(); + auto* const raw_pointer = handle_provider.get(); + handle_providers_[buffer_id] = std::move(handle_provider); + MockOnNewBufferHandle(buffer_id, raw_pointer); + } + MOCK_METHOD2(MockOnNewBufferHandle, + void(int buffer_id, Buffer::HandleProvider* handle_provider)); + void OnFrameReadyInBuffer( + int buffer_id, + int frame_feedback_id, + std::unique_ptr<Buffer::ScopedAccessPermission> buffer_read_permission, + media::mojom::VideoFrameInfoPtr frame_info) final { + DCHECK_ON_DEVICE_THREAD(); + feedback_ids_[buffer_id] = frame_feedback_id; + auto* const raw_pointer_to_permission = buffer_read_permission.get(); + access_permissions_[buffer_id] = std::move(buffer_read_permission); + auto* const raw_pointer_to_info = frame_info.get(); + frame_infos_[buffer_id] = std::move(frame_info); + MockOnFrameReadyInBuffer(buffer_id, frame_feedback_id, + raw_pointer_to_permission, raw_pointer_to_info); + } + MOCK_METHOD4(MockOnFrameReadyInBuffer, + void(int buffer_id, + int frame_feedback_id, + Buffer::ScopedAccessPermission* buffer_read_permission, + const media::mojom::VideoFrameInfo* frame_info)); + MOCK_METHOD1(OnBufferRetired, void(int buffer_id)); + MOCK_METHOD0(OnError, void()); + MOCK_METHOD1(OnLog, void(const std::string& message)); + MOCK_METHOD0(OnStarted, void()); + void OnStartedUsingGpuDecode() final { NOTREACHED(); } + + mojo::ScopedSharedBufferHandle TakeBufferHandle(int buffer_id) { + DCHECK_NOT_ON_DEVICE_THREAD(); + const auto it = handle_providers_.find(buffer_id); + if (it == handle_providers_.end()) { + ADD_FAILURE() << "Missing entry for buffer_id=" << buffer_id; + return mojo::ScopedSharedBufferHandle(); + } + auto buffer = it->second->GetHandleForInterProcessTransit(true); + handle_providers_.erase(it); + return buffer; + } + + int TakeFeedbackId(int buffer_id) { + DCHECK_NOT_ON_DEVICE_THREAD(); + const auto it = feedback_ids_.find(buffer_id); + if (it == feedback_ids_.end()) { + ADD_FAILURE() << "Missing entry for buffer_id=" << buffer_id; + return -1; + } + const int feedback_id = it->second; + feedback_ids_.erase(it); + return feedback_id; + } + + void ReleaseAccessPermission(int buffer_id) { + DCHECK_NOT_ON_DEVICE_THREAD(); + const auto it = access_permissions_.find(buffer_id); + if (it == access_permissions_.end()) { + ADD_FAILURE() << "Missing entry for buffer_id=" << buffer_id; + return; + } + access_permissions_.erase(it); + } + + media::mojom::VideoFrameInfoPtr TakeVideoFrameInfo(int buffer_id) { + DCHECK_NOT_ON_DEVICE_THREAD(); + const auto it = frame_infos_.find(buffer_id); + if (it == frame_infos_.end()) { + ADD_FAILURE() << "Missing entry for buffer_id=" << buffer_id; + return media::mojom::VideoFrameInfoPtr(); + } + media::mojom::VideoFrameInfoPtr info = std::move(it->second); + frame_infos_.erase(it); + return info; + } + + private: + base::flat_map<int, std::unique_ptr<Buffer::HandleProvider>> + handle_providers_; + base::flat_map<int, int> feedback_ids_; + base::flat_map<int, std::unique_ptr<Buffer::ScopedAccessPermission>> + access_permissions_; + base::flat_map<int, media::mojom::VideoFrameInfoPtr> frame_infos_; +}; + +// Convenience macros to make a non-blocking FrameSinkVideoCaptureDevice method +// call on the device thread. +#define POST_DEVICE_METHOD_CALL0(method) \ + POST_DEVICE_TASK(base::BindOnce(&FrameSinkVideoCaptureDevice::method, \ + base::Unretained(device_.get()))) +#define POST_DEVICE_METHOD_CALL(method, ...) \ + POST_DEVICE_TASK(base::BindOnce(&FrameSinkVideoCaptureDevice::method, \ + base::Unretained(device_.get()), \ + __VA_ARGS__)) + +class FrameSinkVideoCaptureDeviceTest : public testing::Test { + public: + FrameSinkVideoCaptureDeviceTest() + : browser_threads_(TestBrowserThreadBundle::REAL_IO_THREAD) {} + + ~FrameSinkVideoCaptureDeviceTest() override { EXPECT_FALSE(device_); } + + void SetUp() override { + // Create the FrameSinkVideoCaptureDevice on the device thread, and block + // until complete. + POST_DEVICE_TASK(base::BindOnce( + [](FrameSinkVideoCaptureDeviceTest* test) { + test->device_ = std::make_unique<FrameSinkVideoCaptureDevice>(); + }, + this)); + WAIT_FOR_DEVICE_TASKS(); + + // Set an override to "create" the mock capturer instance instead of the + // real thing. + device_->SetCapturerCreatorForTesting(base::BindRepeating( + [](MockFrameSinkVideoCapturer* capturer) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + viz::mojom::FrameSinkVideoCapturerPtr capturer_ptr; + capturer->Bind(mojo::MakeRequest(&capturer_ptr)); + return capturer_ptr.PassInterface(); + }, + &capturer_)); + } + + void TearDown() override { + // Destroy the FrameSinkVideoCaptureDevice on the device thread, and block + // until complete. + POST_DEVICE_TASK(base::BindOnce( + [](FrameSinkVideoCaptureDeviceTest* test) { test->device_.reset(); }, + this)); + WAIT_FOR_DEVICE_TASKS(); + // Some objects owned by the FrameSinkVideoCaptureDevice may need to be + // deleted on the UI thread, so run those tasks now. + RUN_UI_TASKS(); + } + + // Starts-up the FrameSinkVideoCaptureDevice: Sets a frame sink target, + // creates a capturer, sets the capture parameters; and checks that the mock + // capturer receives the correct mojo method calls. + void AllocateAndStartSynchronouslyWithExpectations( + std::unique_ptr<media::VideoFrameReceiver> receiver) { + EXPECT_CALL(capturer_, SetFormat(kFormat, _)); + EXPECT_CALL(capturer_, SetMinCapturePeriod(kMinCapturePeriod)); + EXPECT_CALL(capturer_, + SetResolutionConstraints(kResolution, kResolution, _)); + constexpr viz::FrameSinkId frame_sink_id(1, 1); + EXPECT_CALL(capturer_, ChangeTarget(frame_sink_id)); + EXPECT_CALL(capturer_, MockStart(NotNull())); + + EXPECT_FALSE(capturer_.is_bound()); + POST_DEVICE_METHOD_CALL(OnTargetChanged, frame_sink_id, gfx::NativeView()); + POST_DEVICE_METHOD_CALL(AllocateAndStartWithReceiver, GetCaptureParams(), + std::move(receiver)); + WAIT_FOR_DEVICE_TASKS(); + RUN_UI_TASKS(); // Run the task to create the capturer. + EXPECT_TRUE(capturer_.is_bound()); + WAIT_FOR_DEVICE_TASKS(); // Run the task where the interface is bound, etc. + } + + // Stops the FrameSinkVideoCaptureDevice and optionally checks that the mock + // capturer received the Stop() call. + void StopAndDeAllocateSynchronouslyWithExpectations( + bool capturer_stopped_also) { + EXPECT_CALL(capturer_, MockStop()).Times(capturer_stopped_also ? 1 : 0); + POST_DEVICE_METHOD_CALL0(StopAndDeAllocate); + WAIT_FOR_DEVICE_TASKS(); + } + + // Simulates what the VIZ capturer would do: Allocates a shared memory buffer, + // populates it with video content, and calls OnFrameCaptured(). + void SimulateFrameCapture( + int frame_number, + MockFrameSinkVideoConsumerFrameCallbacks* callbacks) { + // Allocate a buffer and fill it with values based on |frame_number|. + const size_t buffer_size = + media::VideoFrame::AllocationSize(kFormat, kResolution); + mojo::ScopedSharedBufferHandle buffer = + mojo::SharedBufferHandle::Create(buffer_size); + memset(buffer->Map(buffer_size).get(), GetFrameFillValue(frame_number), + buffer_size); + + viz::mojom::FrameSinkVideoConsumerFrameCallbacksPtr callbacks_ptr; + callbacks->Bind(mojo::MakeRequest(&callbacks_ptr)); + // |callbacks_ptr| is bound on the main thread, so it needs to be re-bound + // to the device thread before calling OnFrameCaptured(). + POST_DEVICE_TASK(base::BindOnce( + [](FrameSinkVideoCaptureDevice* device, + mojo::ScopedSharedBufferHandle buffer, size_t buffer_size, + int frame_number, + mojo::InterfacePtrInfo< + viz::mojom::FrameSinkVideoConsumerFrameCallbacks> + callbacks_info) { + device->OnFrameCaptured( + std::move(buffer), buffer_size, + media::mojom::VideoFrameInfo::New( + kMinCapturePeriod * frame_number, nullptr, kFormat, kStorage, + kResolution, gfx::Rect(kResolution)), + gfx::Rect(kResolution), gfx::Rect(kResolution), + viz::mojom::FrameSinkVideoConsumerFrameCallbacksPtr( + std::move(callbacks_info))); + }, + base::Unretained(device_.get()), std::move(buffer), buffer_size, + frame_number, callbacks_ptr.PassInterface())); + } + + // Returns a byte value based on the given |frame_number|. + static constexpr uint8_t GetFrameFillValue(int frame_number) { + return (frame_number % 0x3f) << 2; + } + + // Returns true if the |buffer| is filled with the correct byte value for the + // given |frame_number|. + static bool IsExpectedBufferContentForFrame( + int frame_number, + mojo::ScopedSharedBufferHandle buffer) { + const size_t buffer_size = + media::VideoFrame::AllocationSize(kFormat, kResolution); + const auto mapping = buffer->Map(buffer_size); + const uint8_t* src = static_cast<uint8_t*>(mapping.get()); + const uint8_t expected_value = GetFrameFillValue(frame_number); + for (size_t i = 0; i < buffer_size; ++i) { + if (src[i] != expected_value) { + return false; + } + } + return true; + } + + private: + // See the threading notes at top of this file. + TestBrowserThreadBundle browser_threads_; + + protected: + NiceMock<MockFrameSinkVideoCapturer> capturer_; + std::unique_ptr<FrameSinkVideoCaptureDevice> device_; +}; + +// Tests a racy start condition: Ensure that nothing bad happens if +// StopAndDeAllocate() is called before the capturer creation completes. +TEST_F(FrameSinkVideoCaptureDeviceTest, + AllocatesAndDeallocatesBeforeCapturerCreated) { + auto receiver = std::make_unique<MockVideoFrameReceiver>(); + EXPECT_CALL(*receiver, OnStarted()).Times(0); + EXPECT_CALL(*receiver, OnError()).Times(0); + + EXPECT_CALL(capturer_, SetFormat(_, _)).Times(0); + EXPECT_CALL(capturer_, SetMinCapturePeriod(_)).Times(0); + EXPECT_CALL(capturer_, SetResolutionConstraints(_, _, _)).Times(0); + EXPECT_CALL(capturer_, ChangeTarget(_)).Times(0); + EXPECT_CALL(capturer_, MockStart(_)).Times(0); + + EXPECT_FALSE(capturer_.is_bound()); + POST_DEVICE_METHOD_CALL(AllocateAndStartWithReceiver, GetCaptureParams(), + std::move(receiver)); + // A task is pending on the UI thread to create the capturer. Call + // StopAndDeAllocate() before that task runs. + POST_DEVICE_METHOD_CALL0(StopAndDeAllocate); + WAIT_FOR_DEVICE_TASKS(); + + // Now, run the task on the UI thread, which will post the reply back to the + // device thread. + RUN_UI_TASKS(); + EXPECT_TRUE(capturer_.is_bound()); + + // Now, when the reply task on the device thread is run, the + // FrameSinkVideoCaptureDevice should realize that StopAndDeAllocate() was + // called in the meantime and abort. + WAIT_FOR_DEVICE_TASKS(); +} + +// Tests a normal session, progressing through the start, frame capture, and +// stop phases. +TEST_F(FrameSinkVideoCaptureDeviceTest, CapturesAndDeliversFrames) { + auto receiver_ptr = std::make_unique<MockVideoFrameReceiver>(); + auto* const receiver = receiver_ptr.get(); + EXPECT_CALL(*receiver, OnStarted()); + EXPECT_CALL(*receiver, OnError()).Times(0); + + AllocateAndStartSynchronouslyWithExpectations(std::move(receiver_ptr)); + // From this point, there is no reason the capturer should be re-started. + EXPECT_CALL(capturer_, MockStart(_)).Times(0); + + // Run 24 frames through the pipeline, one at a time. Then, run 24 more, two + // at a time. Then, run 24 more, three at a time. + constexpr int kNumFramesToDeliver = 24; + constexpr int kMaxSimultaneousFrames = 3; + int next_frame_number = 0; + for (int in_flight_count = 1; in_flight_count <= kMaxSimultaneousFrames; + ++in_flight_count) { + for (int iteration = 0; iteration < kNumFramesToDeliver; ++iteration) { + int buffer_ids[kMaxSimultaneousFrames] = {-1}; + MockFrameSinkVideoConsumerFrameCallbacks + callbackses[kMaxSimultaneousFrames]; + + // Simulate |in_flight_count| frame captures and expect the frames to be + // delivered to the VideoFrameReceiver. + const int first_frame_number = next_frame_number; + for (int i = 0; i < in_flight_count; ++i) { + Expectation new_buffer_called = + EXPECT_CALL(*receiver, MockOnNewBufferHandle(Ge(0), NotNull())) + .WillOnce(SaveArg<0>(&buffer_ids[i])); + EXPECT_CALL(*receiver, + MockOnFrameReadyInBuffer(Eq(ByRef(buffer_ids[i])), Ge(0), + NotNull(), NotNull())) + .After(new_buffer_called); + SimulateFrameCapture(next_frame_number, &callbackses[i]); + ++next_frame_number; + WAIT_FOR_DEVICE_TASKS(); + } + + // Confirm the VideoFrameReceiver was provided the correct buffer and + // VideoFrameInfo struct for each frame in this batch. + for (int frame_number = first_frame_number; + frame_number < next_frame_number; ++frame_number) { + const int buffer_id = buffer_ids[frame_number - first_frame_number]; + + auto buffer = receiver->TakeBufferHandle(buffer_id); + ASSERT_TRUE(buffer.is_valid()); + EXPECT_TRUE( + IsExpectedBufferContentForFrame(frame_number, std::move(buffer))); + + const auto info = receiver->TakeVideoFrameInfo(buffer_id); + ASSERT_TRUE(info); + EXPECT_EQ(kMinCapturePeriod * frame_number, info->timestamp); + EXPECT_EQ(kFormat, info->pixel_format); + EXPECT_EQ(kStorage, info->storage_type); + EXPECT_EQ(kResolution, info->coded_size); + EXPECT_EQ(gfx::Rect(kResolution), info->visible_rect); + } + + // Simulate the receiver providing the feedback and done notifications for + // each frame and expect the FrameSinkVideoCaptureDevice to process these + // notifications. + for (int frame_number = first_frame_number; + frame_number < next_frame_number; ++frame_number) { + const int buffer_id = buffer_ids[frame_number - first_frame_number]; + MockFrameSinkVideoConsumerFrameCallbacks& callbacks = + callbackses[frame_number - first_frame_number]; + + const double fake_utilization = + static_cast<double>(frame_number) / kNumFramesToDeliver; + EXPECT_CALL(callbacks, ProvideFeedback(fake_utilization)); + EXPECT_CALL(callbacks, Done()); + EXPECT_CALL(*receiver, OnBufferRetired(buffer_id)); + + const int feedback_id = receiver->TakeFeedbackId(buffer_id); + POST_DEVICE_METHOD_CALL(OnUtilizationReport, feedback_id, + fake_utilization); + receiver->ReleaseAccessPermission(buffer_id); + WAIT_FOR_DEVICE_TASKS(); + } + } + } + + StopAndDeAllocateSynchronouslyWithExpectations(true /* capturer will stop */); +} + +// Tests that a client request to Suspend() should stop consumption and ignore +// all refresh requests. Likewise, a client request to Resume() will +// re-establish consumption and allow refresh requests to propagate to the +// capturer again. +TEST_F(FrameSinkVideoCaptureDeviceTest, SuspendsAndResumes) { + AllocateAndStartSynchronouslyWithExpectations( + std::make_unique<NiceMock<MockVideoFrameReceiver>>()); + + // A started device should have started the capturer, and any refresh frame + // requests from the client should be propagated to it. + { + EXPECT_CALL(capturer_, RequestRefreshFrame()); + POST_DEVICE_METHOD_CALL0(RequestRefreshFrame); + WAIT_FOR_DEVICE_TASKS(); + } + + // Simulate a client request that capture be suspended. The capturer should + // receive a Stop() message. + { + EXPECT_CALL(capturer_, MockStart(_)).Times(0); + EXPECT_CALL(capturer_, MockStop()); + POST_DEVICE_METHOD_CALL0(MaybeSuspend); + WAIT_FOR_DEVICE_TASKS(); + } + + // A suspended device should not propagate any refresh frame requests. + { + EXPECT_CALL(capturer_, RequestRefreshFrame()).Times(0); + POST_DEVICE_METHOD_CALL0(RequestRefreshFrame); + WAIT_FOR_DEVICE_TASKS(); + } + + // Simulate a client request that capture be resumed. The capturer should + // receive a Start() message. + { + EXPECT_CALL(capturer_, MockStart(NotNull())); + EXPECT_CALL(capturer_, MockStop()).Times(0); + POST_DEVICE_METHOD_CALL0(Resume); + WAIT_FOR_DEVICE_TASKS(); + } + + // Now refresh frame requests should propagate again. + { + EXPECT_CALL(capturer_, RequestRefreshFrame()); + POST_DEVICE_METHOD_CALL0(RequestRefreshFrame); + WAIT_FOR_DEVICE_TASKS(); + } + + StopAndDeAllocateSynchronouslyWithExpectations(true /* capturer will stop */); +} + +// Tests that the FrameSinkVideoCaptureDevice will shutdown on a fatal error and +// refuse to be started again. +TEST_F(FrameSinkVideoCaptureDeviceTest, ShutsDownOnFatalError) { + auto receiver_ptr = std::make_unique<MockVideoFrameReceiver>(); + auto* receiver = receiver_ptr.get(); + Sequence sequence; + EXPECT_CALL(*receiver, OnStarted()).InSequence(sequence); + EXPECT_CALL(*receiver, OnLog(StrNe(""))).InSequence(sequence); + EXPECT_CALL(*receiver, OnError()).InSequence(sequence); + + AllocateAndStartSynchronouslyWithExpectations(std::move(receiver_ptr)); + + // Notify the device that the target frame sink was lost. This should stop + // consumption, unbind the capturer, log an error with the VideoFrameReceiver, + // and destroy the VideoFrameReceiver. + { + EXPECT_CALL(capturer_, MockStop()); + POST_DEVICE_METHOD_CALL0(OnTargetPermanentlyLost); + WAIT_FOR_DEVICE_TASKS(); + } + + // Shutdown the device. However, the fatal error already stopped consumption, + // so don't expect the capturer to be stopped again. + StopAndDeAllocateSynchronouslyWithExpectations(false); + + // Now, any further attempts to start the FrameSinkVideoCaptureDevice again + // should fail. The VideoFrameReceiver will be provided the same error + // message. + receiver_ptr = std::make_unique<MockVideoFrameReceiver>(); + receiver = receiver_ptr.get(); + { + EXPECT_CALL(*receiver, OnStarted()).Times(0); + EXPECT_CALL(*receiver, OnLog(StrNe(""))); + EXPECT_CALL(*receiver, OnError()); + EXPECT_CALL(capturer_, MockStart(_)).Times(0); + + POST_DEVICE_METHOD_CALL(AllocateAndStartWithReceiver, GetCaptureParams(), + std::move(receiver_ptr)); + WAIT_FOR_DEVICE_TASKS(); + } +} + +} // namespace +} // namespace content
diff --git a/content/browser/net/network_quality_observer_impl_unittest.cc b/content/browser/net/network_quality_observer_impl_unittest.cc index 76602426..1112635 100644 --- a/content/browser/net/network_quality_observer_impl_unittest.cc +++ b/content/browser/net/network_quality_observer_impl_unittest.cc
@@ -19,39 +19,24 @@ base::MessageLoopForIO message_loop; net::TestNetworkQualityEstimator estimator; - estimator.set_start_time_null_http_rtt(base::TimeDelta::FromMilliseconds(1)); + estimator.SetStartTimeNullHttpRtt(base::TimeDelta::FromMilliseconds(1)); NetworkQualityObserverImpl observer(&estimator); // Give a chance for |observer| to register with the |estimator|. base::RunLoop().RunUntilIdle(); - // Run one main frame request to force recomputation of effective connection - // type. - estimator.RunOneRequest(); - base::RunLoop().RunUntilIdle(); base::HistogramTester histogram_tester; - estimator.set_start_time_null_http_rtt( - base::TimeDelta::FromMilliseconds(500)); - // Run one main frame request to force recomputation of effective connection - // type. - estimator.RunOneRequest(); - base::RunLoop().RunUntilIdle(); + estimator.SetStartTimeNullHttpRtt(base::TimeDelta::FromMilliseconds(500)); // RTT changed from 1 msec to 500 msec. histogram_tester.ExpectBucketCount( "NQE.ContentObserver.NetworkQualityMeaningfullyChanged", 1, 1); - estimator.set_start_time_null_http_rtt( - base::TimeDelta::FromMilliseconds(625)); - estimator.RunOneRequest(); - base::RunLoop().RunUntilIdle(); + estimator.SetStartTimeNullHttpRtt(base::TimeDelta::FromMilliseconds(625)); // RTT changed from 500 msec to 625 msec. histogram_tester.ExpectBucketCount( "NQE.ContentObserver.NetworkQualityMeaningfullyChanged", 1, 2); - estimator.set_start_time_null_http_rtt( - base::TimeDelta::FromMilliseconds(626)); - estimator.RunOneRequest(); - base::RunLoop().RunUntilIdle(); + estimator.SetStartTimeNullHttpRtt(base::TimeDelta::FromMilliseconds(626)); // RTT changed from 625 msec to 626 msec which is not a meaningful change. histogram_tester.ExpectBucketCount( "NQE.ContentObserver.NetworkQualityMeaningfullyChanged", 1, 2);
diff --git a/content/browser/network_service_client.cc b/content/browser/network_service_client.cc index 6a924d98e..e90f332 100644 --- a/content/browser/network_service_client.cc +++ b/content/browser/network_service_client.cc
@@ -14,7 +14,8 @@ class SSLDelegate : public SSLErrorHandler::Delegate { public: explicit SSLDelegate( - mojom::NetworkServiceClient::OnSSLCertificateErrorCallback response) + network::mojom::NetworkServiceClient::OnSSLCertificateErrorCallback + response) : response_(std::move(response)), weak_factory_(this) {} ~SSLDelegate() override {} void CancelSSLRequest(int error, const net::SSLInfo* ssl_info) override { @@ -28,14 +29,14 @@ base::WeakPtr<SSLDelegate> GetWeakPtr() { return weak_factory_.GetWeakPtr(); } private: - mojom::NetworkServiceClient::OnSSLCertificateErrorCallback response_; + network::mojom::NetworkServiceClient::OnSSLCertificateErrorCallback response_; base::WeakPtrFactory<SSLDelegate> weak_factory_; }; } // namespace NetworkServiceClient::NetworkServiceClient( - mojom::NetworkServiceClientRequest network_service_client_request) + network::mojom::NetworkServiceClientRequest network_service_client_request) : binding_(this, std::move(network_service_client_request)) {} NetworkServiceClient::~NetworkServiceClient() = default;
diff --git a/content/browser/network_service_client.h b/content/browser/network_service_client.h index 83f5d16..91205490 100644 --- a/content/browser/network_service_client.h +++ b/content/browser/network_service_client.h
@@ -6,18 +6,18 @@ #define CONTENT_BROWSER_NETWORK_SERVICE_IMPL_H_ #include "base/macros.h" -#include "content/public/common/network_service.mojom.h" #include "mojo/public/cpp/bindings/binding.h" +#include "services/network/public/interfaces/network_service.mojom.h" namespace content { -class NetworkServiceClient : public mojom::NetworkServiceClient { +class NetworkServiceClient : public network::mojom::NetworkServiceClient { public: - explicit NetworkServiceClient( - mojom::NetworkServiceClientRequest network_service_client_request); + explicit NetworkServiceClient(network::mojom::NetworkServiceClientRequest + network_service_client_request); ~NetworkServiceClient() override; - // mojom::NetworkServiceClient implementation: + // network::mojom::NetworkServiceClient implementation: void OnSSLCertificateError(int32_t resource_type, const GURL& url, uint32_t process_id, @@ -27,7 +27,7 @@ OnSSLCertificateErrorCallback response) override; private: - mojo::Binding<mojom::NetworkServiceClient> binding_; + mojo::Binding<network::mojom::NetworkServiceClient> binding_; DISALLOW_COPY_AND_ASSIGN(NetworkServiceClient); };
diff --git a/content/browser/network_service_instance.cc b/content/browser/network_service_instance.cc index e22e31d..da85911 100644 --- a/content/browser/network_service_instance.cc +++ b/content/browser/network_service_instance.cc
@@ -18,10 +18,10 @@ namespace { -mojom::NetworkServicePtr* g_network_service_ptr = nullptr; +network::mojom::NetworkServicePtr* g_network_service_ptr = nullptr; NetworkServiceImpl* g_network_service; -void CreateNetworkServiceOnIO(mojom::NetworkServiceRequest request) { +void CreateNetworkServiceOnIO(network::mojom::NetworkServiceRequest request) { if (g_network_service) { // GetNetworkServiceImpl() was already called and created the object, so // just bind it. @@ -35,11 +35,11 @@ } // namespace -mojom::NetworkService* GetNetworkService() { +network::mojom::NetworkService* GetNetworkService() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (!g_network_service_ptr) - g_network_service_ptr = new mojom::NetworkServicePtr; + g_network_service_ptr = new network::mojom::NetworkServicePtr; static NetworkServiceClient* g_client; if (!g_network_service_ptr->is_bound() || g_network_service_ptr->encountered_error()) { @@ -54,7 +54,7 @@ mojo::MakeRequest(g_network_service_ptr))); } - mojom::NetworkServiceClientPtr client_ptr; + network::mojom::NetworkServiceClientPtr client_ptr; delete g_client; // In case we're recreating the network service. g_client = new NetworkServiceClient(mojo::MakeRequest(&client_ptr)); (*g_network_service_ptr)->SetClient(std::move(client_ptr));
diff --git a/content/browser/network_service_restart_browsertest.cc b/content/browser/network_service_restart_browsertest.cc index 3931405d..a3b91fb 100644 --- a/content/browser/network_service_restart_browsertest.cc +++ b/content/browser/network_service_restart_browsertest.cc
@@ -10,7 +10,6 @@ #include "content/public/browser/network_service_instance.h" #include "content/public/browser/web_contents.h" #include "content/public/common/content_features.h" -#include "content/public/common/network_service.mojom.h" #include "content/public/common/simple_url_loader.h" #include "content/public/test/browser_test_utils.h" #include "content/public/test/content_browser_test.h" @@ -18,15 +17,16 @@ #include "content/public/test/simple_url_loader_test_helper.h" #include "content/shell/browser/shell.h" #include "net/traffic_annotation/network_traffic_annotation_test_helper.h" +#include "services/network/public/interfaces/network_service.mojom.h" namespace content { namespace { -mojom::NetworkContextPtr CreateNetworkContext() { - mojom::NetworkContextPtr network_context; - mojom::NetworkContextParamsPtr context_params = - mojom::NetworkContextParams::New(); +network::mojom::NetworkContextPtr CreateNetworkContext() { + network::mojom::NetworkContextPtr network_context; + network::mojom::NetworkContextParamsPtr context_params = + network::mojom::NetworkContextParams::New(); GetNetworkService()->CreateNetworkContext(mojo::MakeRequest(&network_context), std::move(context_params)); return network_context; @@ -96,7 +96,7 @@ IN_PROC_BROWSER_TEST_F(NetworkServiceRestartBrowserTest, NetworkServiceProcessRecovery) { - mojom::NetworkContextPtr network_context = CreateNetworkContext(); + network::mojom::NetworkContextPtr network_context = CreateNetworkContext(); EXPECT_EQ(net::OK, LoadBasicRequest(network_context.get(), GetTestURL())); EXPECT_TRUE(network_context.is_bound()); EXPECT_FALSE(network_context.encountered_error()); @@ -115,7 +115,7 @@ LoadBasicRequest(network_context.get(), GetTestURL())); // NetworkService should restart automatically and return valid interface. - mojom::NetworkContextPtr network_context2 = CreateNetworkContext(); + network::mojom::NetworkContextPtr network_context2 = CreateNetworkContext(); EXPECT_EQ(net::OK, LoadBasicRequest(network_context2.get(), GetTestURL())); EXPECT_TRUE(network_context2.is_bound()); EXPECT_FALSE(network_context2.encountered_error()); @@ -128,7 +128,8 @@ StoragePartitionImpl* partition = static_cast<StoragePartitionImpl*>( BrowserContext::GetDefaultStoragePartition(browser_context())); - mojom::NetworkContext* old_network_context = partition->GetNetworkContext(); + network::mojom::NetworkContext* old_network_context = + partition->GetNetworkContext(); EXPECT_EQ(net::OK, LoadBasicRequest(old_network_context, GetTestURL())); // Crash the NetworkService process. Existing interfaces should receive error
diff --git a/content/browser/renderer_host/input/mouse_latency_browsertest.cc b/content/browser/renderer_host/input/mouse_latency_browsertest.cc index c993494..5980ee9 100644 --- a/content/browser/renderer_host/input/mouse_latency_browsertest.cc +++ b/content/browser/renderer_host/input/mouse_latency_browsertest.cc
@@ -310,7 +310,8 @@ // events in the case where events are coalesced. (crbug.com/771165). // Disabled on Android because we don't support synthetic mouse input on Android // (crbug.com/723618). -#if defined(OS_ANDROID) +// http://crbug.com/801629 : Flaky on Linux and Windows +#if defined(OS_ANDROID) || defined(OS_WIN) || defined(OS_LINUX) #define MAYBE_CoalescedMouseMovesCorrectlyTerminated \ DISABLED_CoalescedMouseMovesCorrectlyTerminated #else
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc index 028eb14..22c72f3 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -166,7 +166,6 @@ #include "content/public/common/content_features.h" #include "content/public/common/content_switches.h" #include "content/public/common/mojo_channel_switches.h" -#include "content/public/common/network_service.mojom.h" #include "content/public/common/process_type.h" #include "content/public/common/resource_type.h" #include "content/public/common/result_codes.h" @@ -197,6 +196,8 @@ #include "ppapi/features/features.h" #include "services/device/public/interfaces/battery_monitor.mojom.h" #include "services/device/public/interfaces/constants.mojom.h" +#include "services/network/public/cpp/network_switches.h" +#include "services/network/public/interfaces/network_service.mojom.h" #include "services/resource_coordinator/public/cpp/process_resource_coordinator.h" #include "services/resource_coordinator/public/cpp/resource_coordinator_features.h" #include "services/service_manager/embedder/switches.h" @@ -207,6 +208,7 @@ #include "services/service_manager/runner/common/switches.h" #include "services/service_manager/sandbox/switches.h" #include "storage/browser/fileapi/sandbox_file_system_backend.h" +#include "third_party/WebKit/common/page/launching_process_state.h" #include "third_party/WebKit/public/public_features.h" #include "third_party/skia/include/core/SkBitmap.h" #include "ui/base/ui_base_switches.h" @@ -279,15 +281,6 @@ const RenderProcessHostFactory* g_render_process_host_factory_ = nullptr; const char kSiteProcessMapKeyName[] = "content_site_process_map"; -#if defined(OS_ANDROID) -// This matches Android's ChildProcessConnection state before OnProcessLaunched. -constexpr bool kLaunchingProcessIsBackgrounded = true; -constexpr bool kLaunchingProcessIsBoostedForPendingView = true; -#else -constexpr bool kLaunchingProcessIsBackgrounded = false; -constexpr bool kLaunchingProcessIsBoostedForPendingView = false; -#endif - #if BUILDFLAG(ENABLE_WEBRTC) const base::FilePath::CharType kAecDumpFileNameAddition[] = FILE_PATH_LITERAL("aec_dump"); @@ -1309,8 +1302,8 @@ route_provider_binding_(this), visible_widgets_(0), priority_({ - kLaunchingProcessIsBackgrounded, - kLaunchingProcessIsBoostedForPendingView, + blink::kLaunchingProcessIsBackgrounded, + blink::kLaunchingProcessIsBoostedForPendingView, #if defined(OS_ANDROID) ChildProcessImportance::NORMAL, #endif @@ -2518,6 +2511,7 @@ // Propagate the following switches to the renderer command line (along // with any associated values) if present in the browser command line. static const char* const kSwitchNames[] = { + network::switches::kNoReferrers, service_manager::switches::kDisableInProcessStackTraces, service_manager::switches::kDisableSeccompFilterSandbox, switches::kAgcStartupMinVolume, @@ -2611,7 +2605,6 @@ switches::kDisableMojoLocalStorage, switches::kMSEAudioBufferSizeLimit, switches::kMSEVideoBufferSizeLimit, - switches::kNoReferrers, switches::kNoSandbox, switches::kNoZygote, switches::kOverridePluginPowerSaverForTesting, @@ -3626,7 +3619,8 @@ HistogramController::GetInstance()->SetHistogramMemory<RenderProcessHost>( this, mojo::WrapSharedMemoryHandle( metrics_allocator_->shared_memory()->handle().Duplicate(), - metrics_allocator_->shared_memory()->mapped_size(), false)); + metrics_allocator_->shared_memory()->mapped_size(), + mojo::UnwrappedSharedMemoryHandleProtection::kReadWrite)); } void RenderProcessHostImpl::ProcessDied(bool already_dead, @@ -3784,9 +3778,9 @@ void RenderProcessHostImpl::UpdateProcessPriority() { if (!run_renderer_in_process() && (!child_process_launcher_.get() || child_process_launcher_->IsStarting())) { - priority_.background = kLaunchingProcessIsBackgrounded; + priority_.background = blink::kLaunchingProcessIsBackgrounded; priority_.boost_for_pending_views = - kLaunchingProcessIsBoostedForPendingView; + blink::kLaunchingProcessIsBoostedForPendingView; return; } @@ -3854,7 +3848,7 @@ if (child_process_launcher_) { DCHECK(child_process_launcher_->GetProcess().IsValid()); - DCHECK_EQ(kLaunchingProcessIsBackgrounded, priority_.background); + DCHECK_EQ(blink::kLaunchingProcessIsBackgrounded, priority_.background); // Unpause the channel now that the process is launched. We don't flush it // yet to ensure that any initialization messages sent here (e.g., things @@ -3877,7 +3871,7 @@ #elif defined(OS_ANDROID) // Android child process priority works differently and cannot be queried // directly from base::Process. - DCHECK_EQ(kLaunchingProcessIsBackgrounded, priority_.background); + DCHECK_EQ(blink::kLaunchingProcessIsBackgrounded, priority_.background); #else priority_.background = child_process_launcher_->GetProcess().IsProcessBackgrounded();
diff --git a/content/browser/renderer_interface_binders.cc b/content/browser/renderer_interface_binders.cc index 79948d6..01ba963 100644 --- a/content/browser/renderer_interface_binders.cc +++ b/content/browser/renderer_interface_binders.cc
@@ -98,7 +98,7 @@ StoragePartition* storage_partition = render_process_host->GetStoragePartition(); - mojom::NetworkContext* network_context = + network::mojom::NetworkContext* network_context = storage_partition->GetNetworkContext(); uint32_t render_process_id = render_process_host->GetID(); network_context->GetRestrictedCookieManager(
diff --git a/content/browser/service_manager/service_manager_context.cc b/content/browser/service_manager/service_manager_context.cc index 3682fe0e..e4358d1 100644 --- a/content/browser/service_manager/service_manager_context.cc +++ b/content/browser/service_manager/service_manager_context.cc
@@ -40,7 +40,6 @@ #include "content/public/common/content_client.h" #include "content/public/common/content_features.h" #include "content/public/common/content_switches.h" -#include "content/public/common/network_service_test.mojom.h" #include "content/public/common/service_manager_connection.h" #include "content/public/common/service_names.mojom.h" #include "device/geolocation/geolocation_provider.h" @@ -56,6 +55,7 @@ #include "services/device/public/interfaces/constants.mojom.h" #include "services/metrics/metrics_mojo_service.h" #include "services/metrics/public/interfaces/constants.mojom.h" +#include "services/network/public/interfaces/network_service_test.mojom.h" #include "services/resource_coordinator/public/cpp/resource_coordinator_features.h" #include "services/resource_coordinator/public/interfaces/service_constants.mojom.h" #include "services/resource_coordinator/resource_coordinator_service.h" @@ -318,7 +318,7 @@ // The test interface doesn't need to be implemented in the in-process case. auto registry = std::make_unique<service_manager::BinderRegistry>(); registry->AddInterface(base::BindRepeating( - [](content::mojom::NetworkServiceTestRequest request) {})); + [](network::mojom::NetworkServiceTestRequest request) {})); return std::make_unique<NetworkServiceImpl>(std::move(registry)); }
diff --git a/content/browser/site_per_process_browsertest.cc b/content/browser/site_per_process_browsertest.cc index 7d9831af..6fb4f1c 100644 --- a/content/browser/site_per_process_browsertest.cc +++ b/content/browser/site_per_process_browsertest.cc
@@ -2964,7 +2964,13 @@ DepictFrameTree(root)); } -IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, NavigateRemoteFrame) { +// The test has been found flaky on Windows: crbug.com/803627 +#if defined(OS_WIN) +#define MAYBE_NavigateRemoteFrame DISABLED_NavigateRemoteFrame +#else +#define MAYBE_NavigateRemoteFrame NavigateRemoteFrame +#endif +IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, MAYBE_NavigateRemoteFrame) { GURL main_url(embedded_test_server()->GetURL( "a.com", "/cross_site_iframe_factory.html?a(a,a(a,a(a)))")); EXPECT_TRUE(NavigateToURL(shell(), main_url)); @@ -4265,7 +4271,8 @@ // TODO(bokan): Pretty soon most/all platforms will use overlay scrollbars. This // test should find a better way to check for scrollability. crbug.com/662196. // Flaky on Linux. crbug.com/790929. -#if defined(OS_ANDROID) || defined(OS_LINUX) +// Flaky on Windows. crbug.com/803628. +#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_WIN) #define MAYBE_FrameOwnerPropertiesPropagationScrolling \ DISABLED_FrameOwnerPropertiesPropagationScrolling #else @@ -5632,7 +5639,13 @@ EXPECT_EQ(1, GetReceivedMessages(child2)); } -IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, RFPHDestruction) { +// The test has been found flaky on Windows: crbug.com/803641 +#if defined(OS_WIN) +#define MAYBE_RFPHDestruction DISABLED_RFPHDestruction +#else +#define MAYBE_RFPHDestruction RFPHDestruction +#endif +IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, MAYBE_RFPHDestruction) { GURL main_url(embedded_test_server()->GetURL("/site_per_process_main.html")); EXPECT_TRUE(NavigateToURL(shell(), main_url));
diff --git a/content/browser/storage_partition_impl.cc b/content/browser/storage_partition_impl.cc index 7e555eb5..375eccf8 100644 --- a/content/browser/storage_partition_impl.cc +++ b/content/browser/storage_partition_impl.cc
@@ -261,7 +261,7 @@ ~NetworkContextOwner() { DCHECK_CURRENTLY_ON(BrowserThread::IO); } - void Initialize(mojom::NetworkContextRequest network_context_request, + void Initialize(network::mojom::NetworkContextRequest network_context_request, scoped_refptr<net::URLRequestContextGetter> context_getter) { DCHECK_CURRENTLY_ON(BrowserThread::IO); context_getter_ = std::move(context_getter); @@ -277,7 +277,7 @@ // needed to keep the URLRequestContext alive until the NetworkContext is // destroyed. scoped_refptr<net::URLRequestContextGetter> context_getter_; - std::unique_ptr<mojom::NetworkContext> network_context_; + std::unique_ptr<network::mojom::NetworkContext> network_context_; DISALLOW_COPY_AND_ASSIGN(NetworkContextOwner); }; @@ -621,7 +621,7 @@ return media_url_request_context_.get(); } -mojom::NetworkContext* StoragePartitionImpl::GetNetworkContext() { +network::mojom::NetworkContext* StoragePartitionImpl::GetNetworkContext() { // Create the NetworkContext as needed, when the network service is disabled. if (!base::FeatureList::IsEnabled(features::kNetworkService)) { if (network_context_)
diff --git a/content/browser/storage_partition_impl.h b/content/browser/storage_partition_impl.h index 1a3128f..4fb38a2 100644 --- a/content/browser/storage_partition_impl.h +++ b/content/browser/storage_partition_impl.h
@@ -34,10 +34,10 @@ #include "content/common/content_export.h" #include "content/common/storage_partition_service.mojom.h" #include "content/public/browser/storage_partition.h" -#include "content/public/common/network_service.mojom.h" #include "mojo/public/cpp/bindings/binding_set.h" #include "net/cookies/cookie_store.h" #include "services/network/public/interfaces/cookie_manager.mojom.h" +#include "services/network/public/interfaces/network_service.mojom.h" #include "storage/browser/quota/special_storage_policy.h" #if !defined(OS_ANDROID) @@ -78,7 +78,7 @@ base::FilePath GetPath() override; net::URLRequestContextGetter* GetURLRequestContext() override; net::URLRequestContextGetter* GetMediaURLRequestContext() override; - mojom::NetworkContext* GetNetworkContext() override; + network::mojom::NetworkContext* GetNetworkContext() override; network::mojom::URLLoaderFactory* GetURLLoaderFactoryForBrowserProcess() override; network::mojom::CookieManager* GetCookieManagerForBrowserProcess() override; @@ -302,7 +302,7 @@ // service. When it's disabled, the underlying NetworkContext may either be // provided by the embedder, or is created by the StoragePartition and owned // by |network_context_owner_|. - mojom::NetworkContextPtr network_context_; + network::mojom::NetworkContextPtr network_context_; // URLLoaderFactory/CookieManager for use in the browser process only. // See the method comment for
diff --git a/content/browser/storage_partition_impl_browsertest.cc b/content/browser/storage_partition_impl_browsertest.cc index c55aca72..fd06912 100644 --- a/content/browser/storage_partition_impl_browsertest.cc +++ b/content/browser/storage_partition_impl_browsertest.cc
@@ -11,7 +11,6 @@ #include "content/public/browser/browser_context.h" #include "content/public/browser/web_contents.h" #include "content/public/common/content_features.h" -#include "content/public/common/network_service.mojom.h" #include "content/public/test/content_browser_test.h" #include "content/public/test/test_url_loader_client.h" #include "content/shell/browser/shell.h" @@ -20,6 +19,7 @@ #include "net/test/embedded_test_server/embedded_test_server.h" #include "net/traffic_annotation/network_traffic_annotation_test_helper.h" #include "services/network/public/cpp/resource_response_info.h" +#include "services/network/public/interfaces/network_service.mojom.h" #include "services/network/public/interfaces/url_loader.mojom.h" #include "services/network/public/interfaces/url_loader_factory.mojom.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/content/browser/url_loader_factory_getter.cc b/content/browser/url_loader_factory_getter.cc index 40a1d74..87a593b 100644 --- a/content/browser/url_loader_factory_getter.cc +++ b/content/browser/url_loader_factory_getter.cc
@@ -7,7 +7,7 @@ #include "base/bind.h" #include "base/lazy_instance.h" #include "content/browser/storage_partition_impl.h" -#include "content/public/common/network_service.mojom.h" +#include "services/network/public/interfaces/network_service.mojom.h" namespace content {
diff --git a/content/browser/utility_process_host_impl.cc b/content/browser/utility_process_host_impl.cc index e63e2b0..1271bd60 100644 --- a/content/browser/utility_process_host_impl.cc +++ b/content/browser/utility_process_host_impl.cc
@@ -32,6 +32,7 @@ #include "content/public/common/service_names.mojom.h" #include "content/public/common/zygote_features.h" #include "media/base/media_switches.h" +#include "services/network/public/cpp/network_switches.h" #include "services/service_manager/public/cpp/interface_provider.h" #include "services/service_manager/sandbox/sandbox_type.h" #include "ui/base/ui_base_switches.h" @@ -296,6 +297,7 @@ // Browser command-line switches to propagate to the utility process. static const char* const kSwitchNames[] = { + network::switches::kNoReferrers, switches::kHostResolverRules, switches::kIgnoreCertificateErrors, switches::kIgnoreCertificateErrorsSPKIList,
diff --git a/content/browser/webauth/authenticator_impl.cc b/content/browser/webauth/authenticator_impl.cc index a9301f6..0ec4536f 100644 --- a/content/browser/webauth/authenticator_impl.cc +++ b/content/browser/webauth/authenticator_impl.cc
@@ -19,6 +19,7 @@ #include "device/u2f/u2f_register.h" #include "device/u2f/u2f_request.h" #include "device/u2f/u2f_return_code.h" +#include "device/u2f/u2f_sign.h" #include "net/base/registry_controlled_domains/registry_controlled_domain.h" #include "services/service_manager/public/cpp/connector.h" #include "url/url_util.h" @@ -79,6 +80,37 @@ return false; } +std::vector<std::vector<uint8_t>> FilterCredentialList( + const std::vector<webauth::mojom::PublicKeyCredentialDescriptorPtr>& + descriptors) { + std::vector<std::vector<uint8_t>> handles; + for (const auto& credential_descriptor : descriptors) { + if (credential_descriptor->type == + webauth::mojom::PublicKeyCredentialType::PUBLIC_KEY) { + handles.push_back(credential_descriptor->id); + } + } + return handles; +} + +std::vector<uint8_t> ConstructClientDataHash(const std::string& client_data) { + // SHA-256 hash of the JSON data structure. + std::vector<uint8_t> client_data_hash(crypto::kSHA256Length); + crypto::SHA256HashString(client_data, client_data_hash.data(), + client_data_hash.size()); + return client_data_hash; +} + +// The application parameter is the SHA-256 hash of the UTF-8 encoding of +// the application identity (i.e. relying_party_id) of the application +// requesting the registration. +std::vector<uint8_t> CreateAppId(const std::string& relying_party_id) { + std::vector<uint8_t> application_parameter(crypto::kSHA256Length); + crypto::SHA256HashString(relying_party_id, application_parameter.data(), + application_parameter.size()); + return application_parameter; +} + webauth::mojom::MakeCredentialAuthenticatorResponsePtr CreateMakeCredentialResponse(CollectedClientData client_data, device::RegisterResponseData response_data) { @@ -94,6 +126,24 @@ response_data.GetCBOREncodedAttestationObject(); return response; } + +webauth::mojom::GetAssertionAuthenticatorResponsePtr CreateGetAssertionResponse( + CollectedClientData client_data, + device::SignResponseData response_data) { + auto response = webauth::mojom::GetAssertionAuthenticatorResponse::New(); + auto common_info = webauth::mojom::CommonCredentialInfo::New(); + std::string client_data_json = client_data.SerializeToJson(); + common_info->client_data_json.assign(client_data_json.begin(), + client_data_json.end()); + common_info->raw_id = response_data.raw_id(); + common_info->id = response_data.GetId(); + response->info = std::move(common_info); + response->authenticator_data = response_data.GetAuthenticatorDataBytes(); + response->signature = response_data.signature(); + response->user_handle.emplace(); + return response; +} + } // namespace AuthenticatorImpl::AuthenticatorImpl(RenderFrameHost* render_frame_host) @@ -101,6 +151,7 @@ render_frame_host_(render_frame_host), weak_factory_(this) { DCHECK(render_frame_host_); + DCHECK(timer_); } AuthenticatorImpl::AuthenticatorImpl(RenderFrameHost* render_frame_host, @@ -111,6 +162,7 @@ connector_(connector), weak_factory_(this) { DCHECK(render_frame_host_); + DCHECK(timer_); } AuthenticatorImpl::~AuthenticatorImpl() {} @@ -123,12 +175,12 @@ void AuthenticatorImpl::MakeCredential( webauth::mojom::MakePublicKeyCredentialOptionsPtr options, MakeCredentialCallback callback) { - // Ensure no other operations are in flight. if (u2f_request_) { std::move(callback).Run( webauth::mojom::AuthenticatorStatus::PENDING_REQUEST, nullptr); return; } + url::Origin caller_origin = render_frame_host_->GetLastCommittedOrigin(); if (!HasValidEffectiveDomain(caller_origin)) { @@ -157,64 +209,105 @@ DCHECK(make_credential_response_callback_.is_null()); make_credential_response_callback_ = std::move(callback); + client_data_ = CollectedClientData::Create(client_data::kCreateType, caller_origin.Serialize(), std::move(options->challenge)); - // SHA-256 hash of the JSON data structure + // SHA-256 hash of the JSON data structure. std::vector<uint8_t> client_data_hash(crypto::kSHA256Length); crypto::SHA256HashString(client_data_.SerializeToJson(), client_data_hash.data(), client_data_hash.size()); - // The application parameter is the SHA-256 hash of the UTF-8 encoding of - // the application identity (i.e. relying_party_id) of the application - // requesting the registration. - std::vector<uint8_t> application_parameter(crypto::kSHA256Length); - crypto::SHA256HashString(options->relying_party->id, - application_parameter.data(), - application_parameter.size()); - - // Start the timer (step 16 - https://w3c.github.io/webauthn/#makeCredential). - DCHECK(timer_); timer_->Start( FROM_HERE, options->adjusted_timeout, base::Bind(&AuthenticatorImpl::OnTimeout, base::Unretained(this))); - - if (!connector_) { + if (!connector_) connector_ = ServiceManagerConnection::GetForProcess()->GetConnector(); - } DCHECK(!u2f_discovery_); u2f_discovery_ = std::make_unique<device::U2fHidDiscovery>(connector_); - // Per fido-u2f-raw-message-formats: - // The challenge parameter is the SHA-256 hash of the Client Data, - // Among other things, the Client Data contains the challenge from the - // relying party (hence the name of the parameter). - device::U2fRegister::RegisterResponseCallback response_callback = base::Bind( - &AuthenticatorImpl::OnRegisterResponse, weak_factory_.GetWeakPtr()); - // Extract list of credentials to exclude. std::vector<std::vector<uint8_t>> registered_keys; for (const auto& credential : options->exclude_credentials) { registered_keys.push_back(credential->id); } + // Save client data to return with the authenticator response. + client_data_ = CollectedClientData::Create(client_data::kCreateType, + caller_origin.Serialize(), + std::move(options->challenge)); // TODO(kpaulhamus): Mock U2fRegister for unit tests. // http://crbug.com/785955. + // Per fido-u2f-raw-message-formats: + // The challenge parameter is the SHA-256 hash of the Client Data, + // Among other things, the Client Data contains the challenge from the + // relying party (hence the name of the parameter). u2f_request_ = device::U2fRegister::TryRegistration( - registered_keys, client_data_hash, application_parameter, - options->relying_party->id, {u2f_discovery_.get()}, - std::move(response_callback)); + options->relying_party->id, {u2f_discovery_.get()}, registered_keys, + ConstructClientDataHash(client_data_.SerializeToJson()), + CreateAppId(options->relying_party->id), + base::BindOnce(&AuthenticatorImpl::OnRegisterResponse, + weak_factory_.GetWeakPtr())); } // mojom:Authenticator void AuthenticatorImpl::GetAssertion( webauth::mojom::PublicKeyCredentialRequestOptionsPtr options, GetAssertionCallback callback) { - std::move(callback).Run(webauth::mojom::AuthenticatorStatus::NOT_IMPLEMENTED, - nullptr); - return; + if (u2f_request_) { + std::move(callback).Run( + webauth::mojom::AuthenticatorStatus::PENDING_REQUEST, nullptr); + return; + } + + url::Origin caller_origin = render_frame_host_->GetLastCommittedOrigin(); + + if (!HasValidEffectiveDomain(caller_origin)) { + bad_message::ReceivedBadMessage(render_frame_host_->GetProcess(), + bad_message::AUTH_INVALID_EFFECTIVE_DOMAIN); + std::move(callback).Run(webauth::mojom::AuthenticatorStatus::INVALID_DOMAIN, + nullptr); + return; + } + + if (!IsRelyingPartyIdValid(options->relying_party_id, caller_origin)) { + bad_message::ReceivedBadMessage(render_frame_host_->GetProcess(), + bad_message::AUTH_INVALID_RELYING_PARTY); + std::move(callback).Run(webauth::mojom::AuthenticatorStatus::INVALID_DOMAIN, + nullptr); + return; + } + + DCHECK(get_assertion_response_callback_.is_null()); + get_assertion_response_callback_ = std::move(callback); + + // Pass along valid keys from allow_list, if any. + std::vector<std::vector<uint8_t>> handles = + FilterCredentialList(std::move(options->allow_credentials)); + + timer_->Start( + FROM_HERE, options->adjusted_timeout, + base::Bind(&AuthenticatorImpl::OnTimeout, base::Unretained(this))); + + if (!connector_) + connector_ = ServiceManagerConnection::GetForProcess()->GetConnector(); + + DCHECK(!u2f_discovery_); + u2f_discovery_ = std::make_unique<device::U2fHidDiscovery>(connector_); + + // Save client data to return with the authenticator response. + client_data_ = CollectedClientData::Create(client_data::kGetType, + caller_origin.Serialize(), + std::move(options->challenge)); + + u2f_request_ = device::U2fSign::TrySign( + options->relying_party_id, {u2f_discovery_.get()}, handles, + ConstructClientDataHash(client_data_.SerializeToJson()), + CreateAppId(options->relying_party_id), + base::BindOnce(&AuthenticatorImpl::OnSignResponse, + weak_factory_.GetWeakPtr())); } // Callback to handle the async registration response from a U2fDevice. @@ -245,6 +338,32 @@ Cleanup(); } +void AuthenticatorImpl::OnSignResponse( + device::U2fReturnCode status_code, + base::Optional<device::SignResponseData> response_data) { + timer_->Stop(); + switch (status_code) { + case device::U2fReturnCode::CONDITIONS_NOT_SATISFIED: + // No authenticators contained the credential. + std::move(get_assertion_response_callback_) + .Run(webauth::mojom::AuthenticatorStatus::NOT_ALLOWED_ERROR, nullptr); + break; + case device::U2fReturnCode::FAILURE: + case device::U2fReturnCode::INVALID_PARAMS: + std::move(get_assertion_response_callback_) + .Run(webauth::mojom::AuthenticatorStatus::UNKNOWN_ERROR, nullptr); + break; + case device::U2fReturnCode::SUCCESS: + DCHECK(response_data.has_value()); + std::move(get_assertion_response_callback_) + .Run(webauth::mojom::AuthenticatorStatus::SUCCESS, + CreateGetAssertionResponse(std::move(client_data_), + std::move(*response_data))); + break; + } + Cleanup(); +} + void AuthenticatorImpl::OnTimeout() { DCHECK(make_credential_response_callback_ || get_assertion_response_callback_);
diff --git a/content/browser/webauth/authenticator_impl.h b/content/browser/webauth/authenticator_impl.h index 90639ec..f297e4be 100644 --- a/content/browser/webauth/authenticator_impl.h +++ b/content/browser/webauth/authenticator_impl.h
@@ -13,6 +13,7 @@ #include "content/browser/webauth/collected_client_data.h" #include "content/common/content_export.h" #include "device/u2f/register_response_data.h" +#include "device/u2f/sign_response_data.h" #include "mojo/public/cpp/bindings/binding_set.h" #include "third_party/WebKit/public/platform/modules/webauth/authenticator.mojom.h" #include "url/origin.h" @@ -52,6 +53,9 @@ void Bind(webauth::mojom::AuthenticatorRequest request); private: + webauth::mojom::AuthenticatorStatus InitializeAndValidateRequest( + const std::string& relying_party_id); + // mojom:Authenticator void MakeCredential(webauth::mojom::MakePublicKeyCredentialOptionsPtr options, MakeCredentialCallback callback) override; @@ -65,6 +69,10 @@ device::U2fReturnCode status_code, base::Optional<device::RegisterResponseData> response_data); + // Callback to handle the async response from a U2fDevice. + void OnSignResponse(device::U2fReturnCode status_code, + base::Optional<device::SignResponseData> response_data); + // Runs when timer expires and cancels all issued requests to a U2fDevice. void OnTimeout(); void Cleanup();
diff --git a/content/browser/webauth/authenticator_impl_unittest.cc b/content/browser/webauth/authenticator_impl_unittest.cc index 5b3d86c..de4514b 100644 --- a/content/browser/webauth/authenticator_impl_unittest.cc +++ b/content/browser/webauth/authenticator_impl_unittest.cc
@@ -9,6 +9,7 @@ #include <utility> #include <vector> +#include "base/logging.h" #include "base/run_loop.h" #include "base/test/gtest_util.h" #include "base/test/test_mock_time_task_runner.h" @@ -61,11 +62,16 @@ 0x50, 0x5F, 0x8E, 0xD2, 0xB1, 0x6A, 0xE2, 0x2F, 0x16, 0xBB, 0x05, 0xB8, 0x8C, 0x25, 0xDB, 0x9E, 0x60, 0x26, 0x45, 0xF1, 0x41}; -constexpr char kTestClientDataJsonString[] = +constexpr char kTestRegisterClientDataJsonString[] = R"({"challenge":"aHE0loIi7BcgLkJQX47SsWriLxa7BbiMJdueYCZF8UE",)" R"("hashAlgorithm":"SHA-256","origin":"google.com","tokenBinding":)" R"("unused","type":"webauthn.create"})"; +constexpr char kTestSignClientDataJsonString[] = + R"({"challenge":"aHE0loIi7BcgLkJQX47SsWriLxa7BbiMJdueYCZF8UE",)" + R"("hashAlgorithm":"SHA-256","origin":"google.com","tokenBinding":)" + R"("unused","type":"webauthn.get"})"; + constexpr OriginRelyingPartyIdPair kValidRelyingPartyTestCases[] = { {"http://localhost", "localhost"}, {"https://myawesomedomain", "myawesomedomain"}, @@ -199,7 +205,7 @@ PublicKeyCredentialRequestOptionsPtr GetTestPublicKeyCredentialRequestOptions() { auto options = PublicKeyCredentialRequestOptions::New(); - options->relying_party_id = std::string("localhost"); + options->relying_party_id = std::string(kTestRelyingPartyId); options->challenge.assign(32, 0x0A); options->adjusted_timeout = base::TimeDelta::FromMinutes(1); return options; @@ -258,17 +264,17 @@ } // TODO(crbug.com/799044) - simplify the runloop usage. - std::pair<AuthenticatorStatus, MakeCredentialAuthenticatorResponsePtr>& - WaitForCallback() { + void WaitForCallback() { closure_ = run_loop_.QuitClosure(); run_loop_.Run(); - return response_; } AuthenticatorImpl::MakeCredentialCallback callback() { return std::move(callback_); } + AuthenticatorStatus GetResponseStatus() { return response_.first; } + private: std::pair<AuthenticatorStatus, MakeCredentialAuthenticatorResponsePtr> response_; @@ -291,13 +297,13 @@ } // TODO(crbug.com/799044) - simplify the runloop usage. - std::pair<AuthenticatorStatus, GetAssertionAuthenticatorResponsePtr>& - WaitForCallback() { + void WaitForCallback() { closure_ = run_loop_.QuitClosure(); run_loop_.Run(); - return response_; } + AuthenticatorStatus GetResponseStatus() { return response_.first; } + AuthenticatorImpl::GetAssertionCallback callback() { return std::move(callback_); } @@ -321,15 +327,17 @@ AuthenticatorPtr authenticator = ConnectToAuthenticator(); MakePublicKeyCredentialOptionsPtr options = GetTestMakePublicKeyCredentialOptions(); + DLOG(INFO) << "got options"; options->relying_party->id = test_case.relying_party_id; - + DLOG(INFO) << options->relying_party->id; TestMakeCredentialCallback cb; + DLOG(INFO) << "got callback"; authenticator->MakeCredential(std::move(options), cb.callback()); - std::pair<webauth::mojom::AuthenticatorStatus, - webauth::mojom::MakeCredentialAuthenticatorResponsePtr>& - response = cb.WaitForCallback(); + DLOG(INFO) << "called make cred"; + cb.WaitForCallback(); + DLOG(INFO) << "finished waiting"; EXPECT_EQ(webauth::mojom::AuthenticatorStatus::INVALID_DOMAIN, - response.first); + cb.GetResponseStatus()); } // These instances pass the origin and relying party checks and return at @@ -344,11 +352,9 @@ TestMakeCredentialCallback cb; authenticator->MakeCredential(std::move(options), cb.callback()); - std::pair<webauth::mojom::AuthenticatorStatus, - webauth::mojom::MakeCredentialAuthenticatorResponsePtr>& - response = cb.WaitForCallback(); + cb.WaitForCallback(); EXPECT_EQ(webauth::mojom::AuthenticatorStatus::NOT_SUPPORTED_ERROR, - response.first); + cb.GetResponseStatus()); } } @@ -364,19 +370,22 @@ TestMakeCredentialCallback cb; authenticator->MakeCredential(std::move(options), cb.callback()); - std::pair<webauth::mojom::AuthenticatorStatus, - webauth::mojom::MakeCredentialAuthenticatorResponsePtr>& response = - cb.WaitForCallback(); + cb.WaitForCallback(); EXPECT_EQ(webauth::mojom::AuthenticatorStatus::NOT_SUPPORTED_ERROR, - response.first); + cb.GetResponseStatus()); } // Test that client data serializes to JSON properly. TEST_F(AuthenticatorImplTest, TestSerializedRegisterClientData) { - EXPECT_EQ(kTestClientDataJsonString, + EXPECT_EQ(kTestRegisterClientDataJsonString, GetTestClientData(client_data::kCreateType).SerializeToJson()); } +TEST_F(AuthenticatorImplTest, TestSerializedSignClientData) { + EXPECT_EQ(kTestSignClientDataJsonString, + GetTestClientData(client_data::kGetType).SerializeToJson()); +} + TEST_F(AuthenticatorImplTest, TestMakeCredentialTimeout) { SimulateNavigation(GURL(kTestOrigin1)); MakePublicKeyCredentialOptionsPtr options = @@ -407,25 +416,63 @@ // Trigger timer. base::RunLoop().RunUntilIdle(); task_runner->FastForwardBy(base::TimeDelta::FromMinutes(1)); - std::pair<webauth::mojom::AuthenticatorStatus, - webauth::mojom::MakeCredentialAuthenticatorResponsePtr>& response = - cb.WaitForCallback(); - EXPECT_EQ(webauth::mojom::AuthenticatorStatus::TIMED_OUT, response.first); + cb.WaitForCallback(); + EXPECT_EQ(webauth::mojom::AuthenticatorStatus::TIMED_OUT, + cb.GetResponseStatus()); } -// Test that service returns NOT_IMPLEMENTED on a call to GetAssertion. -TEST_F(AuthenticatorImplTest, GetAssertionNotImplemented) { +// Verify behavior for various combinations of origins and rp id's. +TEST_F(AuthenticatorImplTest, GetAssertionOriginAndRpIds) { + // These instances should return security errors (for circumstances + // that would normally crash the renderer). + for (const OriginRelyingPartyIdPair& test_case : + kInvalidRelyingPartyTestCases) { + NavigateAndCommit(GURL(test_case.origin)); + AuthenticatorPtr authenticator = ConnectToAuthenticator(); + PublicKeyCredentialRequestOptionsPtr options = + GetTestPublicKeyCredentialRequestOptions(); + options->relying_party_id = test_case.relying_party_id; + + TestGetAssertionCallback cb; + authenticator->GetAssertion(std::move(options), cb.callback()); + cb.WaitForCallback(); + EXPECT_EQ(webauth::mojom::AuthenticatorStatus::INVALID_DOMAIN, + cb.GetResponseStatus()); + } +} + +TEST_F(AuthenticatorImplTest, TestGetAssertionTimeout) { SimulateNavigation(GURL(kTestOrigin1)); - AuthenticatorPtr authenticator = ConnectToAuthenticator(); PublicKeyCredentialRequestOptionsPtr options = GetTestPublicKeyCredentialRequestOptions(); - TestGetAssertionCallback cb; + + // Set up service_manager::Connector for tests. + auto fake_hid_manager = std::make_unique<device::FakeHidManager>(); + service_manager::mojom::ConnectorRequest request; + auto connector = service_manager::Connector::Create(&request); + service_manager::Connector::TestApi test_api(connector.get()); + test_api.OverrideBinderForTesting( + device::mojom::kServiceName, device::mojom::HidManager::Name_, + base::Bind(&device::FakeHidManager::AddBinding, + base::Unretained(fake_hid_manager.get()))); + + // Set up a timer for testing. + auto task_runner = base::MakeRefCounted<base::TestMockTimeTaskRunner>( + base::Time::Now(), base::TimeTicks::Now()); + auto tick_clock = task_runner->GetMockTickClock(); + auto timer = std::make_unique<base::OneShotTimer>(tick_clock.get()); + timer->SetTaskRunner(task_runner); + AuthenticatorPtr authenticator = + ConnectToAuthenticator(connector.get(), std::move(timer)); + authenticator->GetAssertion(std::move(options), cb.callback()); - std::pair<webauth::mojom::AuthenticatorStatus, - webauth::mojom::GetAssertionAuthenticatorResponsePtr>& response = - cb.WaitForCallback(); - EXPECT_EQ(webauth::mojom::AuthenticatorStatus::NOT_IMPLEMENTED, - response.first); + + // Trigger timer. + base::RunLoop().RunUntilIdle(); + task_runner->FastForwardBy(base::TimeDelta::FromMinutes(1)); + cb.WaitForCallback(); + EXPECT_EQ(webauth::mojom::AuthenticatorStatus::TIMED_OUT, + cb.GetResponseStatus()); } } // namespace content
diff --git a/content/browser/webauth/collected_client_data.cc b/content/browser/webauth/collected_client_data.cc index 1d493a0..472e45a 100644 --- a/content/browser/webauth/collected_client_data.cc +++ b/content/browser/webauth/collected_client_data.cc
@@ -15,6 +15,7 @@ namespace client_data { const char kCreateType[] = "webauthn.create"; +const char kGetType[] = "webauthn.get"; } // namespace client_data namespace {
diff --git a/content/browser/webauth/collected_client_data.h b/content/browser/webauth/collected_client_data.h index 70a933fa..0ae7b14 100644 --- a/content/browser/webauth/collected_client_data.h +++ b/content/browser/webauth/collected_client_data.h
@@ -16,6 +16,7 @@ namespace client_data { CONTENT_EXPORT extern const char kCreateType[]; +CONTENT_EXPORT extern const char kGetType[]; } // namespace client_data // Represents the contextual bindings of both the Relying Party and the
diff --git a/content/browser/webui/web_ui_url_loader_factory.cc b/content/browser/webui/web_ui_url_loader_factory.cc index d86beb2..53845bd 100644 --- a/content/browser/webui/web_ui_url_loader_factory.cc +++ b/content/browser/webui/web_ui_url_loader_factory.cc
@@ -29,9 +29,9 @@ #include "content/public/browser/render_process_host.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_observer.h" -#include "content/public/common/network_service.mojom.h" #include "content/public/common/url_constants.h" #include "mojo/public/cpp/bindings/binding_set.h" +#include "services/network/public/interfaces/network_service.mojom.h" #include "third_party/zlib/google/compression_utils.h" #include "ui/base/template_expressions.h"
diff --git a/content/browser/zygote_host/zygote_communication_linux.cc b/content/browser/zygote_host/zygote_communication_linux.cc index 4f2f9f1..f389abaf2 100644 --- a/content/browser/zygote_host/zygote_communication_linux.cc +++ b/content/browser/zygote_host/zygote_communication_linux.cc
@@ -19,12 +19,9 @@ #include "content/common/zygote_commands_linux.h" #include "content/public/common/content_switches.h" #include "content/public/common/result_codes.h" -#include "media/base/media_switches.h" #include "services/service_manager/embedder/switches.h" #include "services/service_manager/sandbox/switches.h" #include "third_party/icu/source/i18n/unicode/timezone.h" -#include "ui/display/display_switches.h" -#include "ui/gfx/switches.h" namespace content { @@ -241,24 +238,13 @@ cmd_line.PrependWrapper( browser_command_line.GetSwitchValueNative(switches::kZygoteCmdPrefix)); } - // Append any switches from the browser process that need to be forwarded on + // Append any switches from the service manager that need to be forwarded on // to the zygote/renderers. - // Should this list be obtained from browser_render_process_host.cc? static const char* const kForwardSwitches[] = { service_manager::switches::kAllowSandboxDebugging, service_manager::switches::kDisableInProcessStackTraces, service_manager::switches::kDisableSeccompFilterSandbox, - switches::kAndroidFontsPath, switches::kClearKeyCdmPathForTesting, - switches::kEnableHeapProfiling, - switches::kEnableLogging, // Support, e.g., --enable-logging=stderr. - // Need to tell the zygote that it is headless so that we don't try to use - // the wrong type of main delegate. - switches::kHeadless, - // Zygote process needs to know what resources to have loaded when it - // becomes a renderer process. - switches::kForceDeviceScaleFactor, switches::kLoggingLevel, - switches::kNoSandbox, switches::kPpapiInProcess, - switches::kRegisterPepperPlugins, switches::kV, switches::kVModule, + service_manager::switches::kNoSandbox, }; cmd_line.CopySwitchesFrom(browser_command_line, kForwardSwitches, arraysize(kForwardSwitches));
diff --git a/content/common/BUILD.gn b/content/common/BUILD.gn index 9282c510..eab8f4d 100644 --- a/content/common/BUILD.gn +++ b/content/common/BUILD.gn
@@ -195,8 +195,6 @@ "inter_process_time_ticks_converter.h", "layer_tree_settings_factory.cc", "layer_tree_settings_factory.h", - "loader_util.cc", - "loader_util.h", "mac/attributed_string_coder.h", "mac/attributed_string_coder.mm", "mac/font_loader.h",
diff --git a/content/common/frame_messages.h b/content/common/frame_messages.h index 91c390b..7bce348 100644 --- a/content/common/frame_messages.h +++ b/content/common/frame_messages.h
@@ -453,6 +453,7 @@ IPC_STRUCT_TRAITS_MEMBER(source_location) IPC_STRUCT_TRAITS_MEMBER(should_check_main_world_csp) IPC_STRUCT_TRAITS_MEMBER(has_user_gesture) + IPC_STRUCT_TRAITS_MEMBER(started_from_context_menu) IPC_STRUCT_TRAITS_END() IPC_STRUCT_TRAITS_BEGIN(content::NavigationTiming)
diff --git a/content/common/service_worker/service_worker_loader_helpers.cc b/content/common/service_worker/service_worker_loader_helpers.cc index 218d6668..b305bc73 100644 --- a/content/common/service_worker/service_worker_loader_helpers.cc +++ b/content/common/service_worker/service_worker_loader_helpers.cc
@@ -8,11 +8,11 @@ #include <utility> #include "base/strings/stringprintf.h" -#include "content/common/loader_util.h" #include "content/common/service_worker/service_worker_utils.h" #include "content/public/common/content_features.h" #include "mojo/public/cpp/bindings/strong_binding.h" #include "net/http/http_util.h" +#include "services/network/public/cpp/loader_util.h" #include "services/network/public/cpp/resource_request.h" #include "services/network/public/cpp/resource_response.h" #include "ui/base/page_transition_types.h" @@ -136,8 +136,8 @@ original_request.method, original_request.url, original_request.site_for_cookies, first_party_url_policy, original_request.referrer_policy, - ComputeReferrer(original_request.referrer), response_head.headers.get(), - response_head.headers->response_code(), + network::ComputeReferrer(original_request.referrer), + response_head.headers.get(), response_head.headers->response_code(), original_request.url.Resolve(new_location), token_binding_negotiated); }
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc index f701f23..018c4ce1 100644 --- a/content/gpu/gpu_main.cc +++ b/content/gpu/gpu_main.cc
@@ -87,6 +87,7 @@ #if defined(OS_MACOSX) #include "base/message_loop/message_pump_mac.h" +#include "sandbox/mac/seatbelt.h" #include "services/service_manager/sandbox/mac/sandbox_mac.h" #endif @@ -98,6 +99,14 @@ #include "media/gpu/vaapi/vaapi_wrapper.h" #endif +#if defined(OS_MACOSX) +extern "C" { +void _LSSetApplicationLaunchServicesServerConnectionStatus( + uint64_t flags, + bool (^connection_allowed)(CFDictionaryRef)); +}; +#endif // defined(OS_MACOSX) + namespace content { namespace { @@ -168,7 +177,7 @@ #elif defined(OS_WIN) return StartSandboxWindows(sandbox_info_); #elif defined(OS_MACOSX) - return service_manager::SandboxMac::IsCurrentlyActive(); + return sandbox::Seatbelt::IsSandboxed(); #else return false; #endif @@ -265,6 +274,9 @@ // https://crbug.com/312462#c51 and https://crbug.com/783298 std::unique_ptr<base::MessagePump> pump(new base::MessagePumpNSRunLoop()); main_message_loop.reset(new base::MessageLoop(std::move(pump))); + + // Tell LaunchServices to continue without a connection to the daemon. + _LSSetApplicationLaunchServicesServerConnectionStatus(0, nullptr); #else main_message_loop.reset( new base::MessageLoop(base::MessageLoop::TYPE_DEFAULT));
diff --git a/content/network/manifest.json b/content/network/manifest.json index c9323b1..d14542c1 100644 --- a/content/network/manifest.json +++ b/content/network/manifest.json
@@ -6,10 +6,10 @@ "service_manager:connector": { "provides": { "network_service": [ - "content::mojom::NetworkService" + "network::mojom::NetworkService" ], "test": [ - "content::mojom::NetworkServiceTest" + "network::mojom::NetworkServiceTest" ], "url_loader": [ "network::mojom::URLLoaderFactory"
diff --git a/content/network/network_context.cc b/content/network/network_context.cc index c81f18a..a1e1c22 100644 --- a/content/network/network_context.cc +++ b/content/network/network_context.cc
@@ -83,8 +83,8 @@ } // namespace NetworkContext::NetworkContext(NetworkServiceImpl* network_service, - mojom::NetworkContextRequest request, - mojom::NetworkContextParamsPtr params) + network::mojom::NetworkContextRequest request, + network::mojom::NetworkContextParamsPtr params) : network_service_(network_service), params_(std::move(params)), binding_(this, std::move(request)) { @@ -102,8 +102,8 @@ // corresponding options to be overwritten. NetworkContext::NetworkContext( NetworkServiceImpl* network_service, - mojom::NetworkContextRequest request, - mojom::NetworkContextParamsPtr params, + network::mojom::NetworkContextRequest request, + network::mojom::NetworkContextParamsPtr params, std::unique_ptr<URLRequestContextBuilderMojo> builder) : network_service_(network_service), params_(std::move(params)), @@ -118,7 +118,7 @@ } NetworkContext::NetworkContext(NetworkServiceImpl* network_service, - mojom::NetworkContextRequest request, + network::mojom::NetworkContextRequest request, net::URLRequestContext* url_request_context) : network_service_(network_service), url_request_context_(url_request_context), @@ -145,7 +145,7 @@ std::unique_ptr<NetworkContext> NetworkContext::CreateForTesting() { return base::WrapUnique( - new NetworkContext(mojom::NetworkContextParams::New())); + new NetworkContext(network::mojom::NetworkContextParams::New())); } void NetworkContext::SetCertVerifierForTesting( @@ -205,7 +205,7 @@ delete this; } -NetworkContext::NetworkContext(mojom::NetworkContextParamsPtr params) +NetworkContext::NetworkContext(network::mojom::NetworkContextParamsPtr params) : network_service_(nullptr), params_(std::move(params)), binding_(this) { url_request_context_owner_ = MakeURLRequestContext(params_.get()); url_request_context_ = url_request_context_owner_.url_request_context.get(); @@ -219,7 +219,7 @@ } URLRequestContextOwner NetworkContext::MakeURLRequestContext( - mojom::NetworkContextParams* network_context_params) { + network::mojom::NetworkContextParams* network_context_params) { URLRequestContextBuilderMojo builder; const base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); @@ -301,7 +301,7 @@ URLRequestContextOwner NetworkContext::ApplyContextParamsToBuilder( URLRequestContextBuilderMojo* builder, - mojom::NetworkContextParams* network_context_params, + network::mojom::NetworkContextParams* network_context_params, bool quic_disabled, net::NetLog* net_log) { URLRequestContextOwner url_request_owner; @@ -419,7 +419,7 @@ void NetworkContext::SetNetworkConditions( const std::string& profile_id, - mojom::NetworkConditionsPtr conditions) { + network::mojom::NetworkConditionsPtr conditions) { std::unique_ptr<NetworkConditions> network_conditions; if (conditions) { network_conditions.reset(new NetworkConditions(
diff --git a/content/network/network_context.h b/content/network/network_context.h index 42064836..b3cc152 100644 --- a/content/network/network_context.h +++ b/content/network/network_context.h
@@ -14,11 +14,11 @@ #include "base/macros.h" #include "base/time/time.h" #include "content/common/content_export.h" -#include "content/public/common/network_service.mojom.h" #include "content/public/network/url_request_context_owner.h" #include "mojo/public/cpp/bindings/binding.h" #include "mojo/public/cpp/bindings/strong_binding_set.h" #include "services/network/cookie_manager.h" +#include "services/network/public/interfaces/network_service.mojom.h" #include "services/network/public/interfaces/url_loader_factory.mojom.h" namespace net { @@ -45,24 +45,24 @@ // URLRequestContext. When that happens, the consumer takes ownership of the // NetworkContext directly, has direct access to its URLRequestContext, and is // responsible for destroying it before the NetworkService. -class CONTENT_EXPORT NetworkContext : public mojom::NetworkContext { +class CONTENT_EXPORT NetworkContext : public network::mojom::NetworkContext { public: NetworkContext(NetworkServiceImpl* network_service, - mojom::NetworkContextRequest request, - mojom::NetworkContextParamsPtr params); + network::mojom::NetworkContextRequest request, + network::mojom::NetworkContextParamsPtr params); // Temporary constructor that allows creating an in-process NetworkContext // with a pre-populated URLRequestContextBuilderMojo. NetworkContext(NetworkServiceImpl* network_service, - mojom::NetworkContextRequest request, - mojom::NetworkContextParamsPtr params, + network::mojom::NetworkContextRequest request, + network::mojom::NetworkContextParamsPtr params, std::unique_ptr<URLRequestContextBuilderMojo> builder); // Creates a NetworkContext that wraps a consumer-provided URLRequestContext // that the NetworkContext does not own. // TODO(mmenke): Remove this constructor when the network service ships. NetworkContext(NetworkServiceImpl* network_service, - mojom::NetworkContextRequest request, + network::mojom::NetworkContextRequest request, net::URLRequestContext* url_request_context); ~NetworkContext() override; @@ -81,7 +81,7 @@ void RegisterURLLoader(URLLoader* url_loader); void DeregisterURLLoader(URLLoader* url_loader); - // mojom::NetworkContext implementation: + // network::mojom::NetworkContext implementation: void CreateURLLoaderFactory(network::mojom::URLLoaderFactoryRequest request, uint32_t process_id) override; void HandleViewCacheRequest( @@ -95,8 +95,9 @@ void ClearNetworkingHistorySince( base::Time time, base::OnceClosure completion_callback) override; - void SetNetworkConditions(const std::string& profile_id, - mojom::NetworkConditionsPtr conditions) override; + void SetNetworkConditions( + const std::string& profile_id, + network::mojom::NetworkConditionsPtr conditions) override; void AddHSTSForTesting(const std::string& host, base::Time expiry, bool include_subdomains, @@ -114,19 +115,19 @@ // the URLRequestContext. static URLRequestContextOwner ApplyContextParamsToBuilder( URLRequestContextBuilderMojo* builder, - mojom::NetworkContextParams* network_context_params, + network::mojom::NetworkContextParams* network_context_params, bool quic_disabled, net::NetLog* net_log); private: // Constructor only used in tests. - explicit NetworkContext(mojom::NetworkContextParamsPtr params); + explicit NetworkContext(network::mojom::NetworkContextParamsPtr params); // On connection errors the NetworkContext destroys itself. void OnConnectionError(); URLRequestContextOwner MakeURLRequestContext( - mojom::NetworkContextParams* network_context_params); + network::mojom::NetworkContextParams* network_context_params); NetworkServiceImpl* const network_service_; @@ -148,9 +149,9 @@ // net::URLRequestContext (held by NetworkContext) is destroyed. std::set<URLLoader*> url_loaders_; - mojom::NetworkContextParamsPtr params_; + network::mojom::NetworkContextParamsPtr params_; - mojo::Binding<mojom::NetworkContext> binding_; + mojo::Binding<network::mojom::NetworkContext> binding_; std::unique_ptr<network::CookieManager> cookie_manager_;
diff --git a/content/network/network_context_unittest.cc b/content/network/network_context_unittest.cc index 4ff575de..23b203cb 100644 --- a/content/network/network_context_unittest.cc +++ b/content/network/network_context_unittest.cc
@@ -24,7 +24,6 @@ #include "components/network_session_configurator/common/network_switches.h" #include "content/network/network_context.h" #include "content/network/network_service_impl.h" -#include "content/public/common/network_service.mojom.h" #include "mojo/public/cpp/bindings/interface_request.h" #include "net/base/cache_type.h" #include "net/base/net_errors.h" @@ -44,6 +43,7 @@ #include "net/url_request/url_request_context.h" #include "net/url_request/url_request_context_builder.h" #include "net/url_request/url_request_job_factory.h" +#include "services/network/public/interfaces/network_service.mojom.h" #include "services/network/public/interfaces/proxy_config.mojom.h" #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h" @@ -54,8 +54,9 @@ namespace { -mojom::NetworkContextParamsPtr CreateContextParams() { - mojom::NetworkContextParamsPtr params = mojom::NetworkContextParams::New(); +network::mojom::NetworkContextParamsPtr CreateContextParams() { + network::mojom::NetworkContextParamsPtr params = + network::mojom::NetworkContextParams::New(); // Use a fixed proxy config, to avoid dependencies on local network // configuration. params->initial_proxy_config = net::ProxyConfig::CreateDirect(); @@ -71,7 +72,7 @@ ~NetworkContextTest() override {} std::unique_ptr<NetworkContext> CreateContextWithParams( - mojom::NetworkContextParamsPtr context_params) { + network::mojom::NetworkContextParamsPtr context_params) { return std::make_unique<NetworkContext>( network_service_.get(), mojo::MakeRequest(&network_context_ptr_), std::move(context_params)); @@ -98,7 +99,7 @@ return net::URLRequestContextBuilder::HttpCacheParams::IN_MEMORY; } - mojom::NetworkService* network_service() const { + network::mojom::NetworkService* network_service() const { return network_service_.get(); } @@ -109,7 +110,7 @@ // since destroying this before the NetworkContext itself triggers deletion of // the NetworkContext. These tests are probably fine anyways, since the // message loop must be spun for that to happen. - mojom::NetworkContextPtr network_context_ptr_; + network::mojom::NetworkContextPtr network_context_ptr_; }; TEST_F(NetworkContextTest, DisableQuic) { @@ -155,8 +156,8 @@ TEST_F(NetworkContextTest, EnableBrotli) { for (bool enable_brotli : {true, false}) { - mojom::NetworkContextParamsPtr context_params = - mojom::NetworkContextParams::New(); + network::mojom::NetworkContextParamsPtr context_params = + network::mojom::NetworkContextParams::New(); context_params->enable_brotli = enable_brotli; std::unique_ptr<NetworkContext> network_context = CreateContextWithParams(std::move(context_params)); @@ -167,8 +168,8 @@ TEST_F(NetworkContextTest, ContextName) { const char kContextName[] = "Jim"; - mojom::NetworkContextParamsPtr context_params = - mojom::NetworkContextParams::New(); + network::mojom::NetworkContextParamsPtr context_params = + network::mojom::NetworkContextParams::New(); context_params->context_name = std::string(kContextName); std::unique_ptr<NetworkContext> network_context = CreateContextWithParams(std::move(context_params)); @@ -177,7 +178,8 @@ TEST_F(NetworkContextTest, QuicUserAgentId) { const char kQuicUserAgentId[] = "007"; - mojom::NetworkContextParamsPtr context_params = CreateContextParams(); + network::mojom::NetworkContextParamsPtr context_params = + CreateContextParams(); context_params->quic_user_agent_id = kQuicUserAgentId; std::unique_ptr<NetworkContext> network_context = CreateContextWithParams(std::move(context_params)); @@ -189,7 +191,8 @@ } TEST_F(NetworkContextTest, DisableDataUrlSupport) { - mojom::NetworkContextParamsPtr context_params = CreateContextParams(); + network::mojom::NetworkContextParamsPtr context_params = + CreateContextParams(); context_params->enable_data_url_support = false; std::unique_ptr<NetworkContext> network_context = CreateContextWithParams(std::move(context_params)); @@ -199,7 +202,8 @@ } TEST_F(NetworkContextTest, EnableDataUrlSupport) { - mojom::NetworkContextParamsPtr context_params = CreateContextParams(); + network::mojom::NetworkContextParamsPtr context_params = + CreateContextParams(); context_params->enable_data_url_support = true; std::unique_ptr<NetworkContext> network_context = CreateContextWithParams(std::move(context_params)); @@ -209,7 +213,8 @@ } TEST_F(NetworkContextTest, DisableFileUrlSupport) { - mojom::NetworkContextParamsPtr context_params = CreateContextParams(); + network::mojom::NetworkContextParamsPtr context_params = + CreateContextParams(); context_params->enable_file_url_support = false; std::unique_ptr<NetworkContext> network_context = CreateContextWithParams(std::move(context_params)); @@ -220,7 +225,8 @@ #if !BUILDFLAG(DISABLE_FILE_SUPPORT) TEST_F(NetworkContextTest, EnableFileUrlSupport) { - mojom::NetworkContextParamsPtr context_params = CreateContextParams(); + network::mojom::NetworkContextParamsPtr context_params = + CreateContextParams(); context_params->enable_file_url_support = true; std::unique_ptr<NetworkContext> network_context = CreateContextWithParams(std::move(context_params)); @@ -231,7 +237,8 @@ #endif // !BUILDFLAG(DISABLE_FILE_SUPPORT) TEST_F(NetworkContextTest, DisableFtpUrlSupport) { - mojom::NetworkContextParamsPtr context_params = CreateContextParams(); + network::mojom::NetworkContextParamsPtr context_params = + CreateContextParams(); context_params->enable_ftp_url_support = false; std::unique_ptr<NetworkContext> network_context = CreateContextWithParams(std::move(context_params)); @@ -242,7 +249,8 @@ #if !BUILDFLAG(DISABLE_FTP_SUPPORT) TEST_F(NetworkContextTest, EnableFtpUrlSupport) { - mojom::NetworkContextParamsPtr context_params = CreateContextParams(); + network::mojom::NetworkContextParamsPtr context_params = + CreateContextParams(); context_params->enable_ftp_url_support = true; std::unique_ptr<NetworkContext> network_context = CreateContextWithParams(std::move(context_params)); @@ -253,7 +261,8 @@ #endif // !BUILDFLAG(DISABLE_FTP_SUPPORT) TEST_F(NetworkContextTest, Http09Disabled) { - mojom::NetworkContextParamsPtr context_params = CreateContextParams(); + network::mojom::NetworkContextParamsPtr context_params = + CreateContextParams(); context_params->http_09_on_non_default_ports_enabled = false; std::unique_ptr<NetworkContext> network_context = CreateContextWithParams(std::move(context_params)); @@ -265,7 +274,8 @@ } TEST_F(NetworkContextTest, Http09Enabled) { - mojom::NetworkContextParamsPtr context_params = CreateContextParams(); + network::mojom::NetworkContextParamsPtr context_params = + CreateContextParams(); context_params->http_09_on_non_default_ports_enabled = true; std::unique_ptr<NetworkContext> network_context = CreateContextWithParams(std::move(context_params)); @@ -317,7 +327,8 @@ } TEST_F(NetworkContextTest, NoCache) { - mojom::NetworkContextParamsPtr context_params = CreateContextParams(); + network::mojom::NetworkContextParamsPtr context_params = + CreateContextParams(); context_params->http_cache_enabled = false; std::unique_ptr<NetworkContext> network_context = CreateContextWithParams(std::move(context_params)); @@ -327,7 +338,8 @@ } TEST_F(NetworkContextTest, MemoryCache) { - mojom::NetworkContextParamsPtr context_params = CreateContextParams(); + network::mojom::NetworkContextParamsPtr context_params = + CreateContextParams(); context_params->http_cache_enabled = true; std::unique_ptr<NetworkContext> network_context = CreateContextWithParams(std::move(context_params)); @@ -346,7 +358,8 @@ } TEST_F(NetworkContextTest, DiskCache) { - mojom::NetworkContextParamsPtr context_params = CreateContextParams(); + network::mojom::NetworkContextParamsPtr context_params = + CreateContextParams(); context_params->http_cache_enabled = true; base::ScopedTempDir temp_dir; @@ -377,7 +390,8 @@ TEST_F(NetworkContextTest, SimpleCache) { base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( switches::kUseSimpleCacheBackend, "on"); - mojom::NetworkContextParamsPtr context_params = CreateContextParams(); + network::mojom::NetworkContextParamsPtr context_params = + CreateContextParams(); context_params->http_cache_enabled = true; base::ScopedTempDir temp_dir; @@ -412,8 +426,8 @@ const url::SchemeHostPort kSchemeHostPort("https", "foo", 443); // Create a context with on-disk storage of HTTP server properties. - mojom::NetworkContextParamsPtr context_params = - mojom::NetworkContextParams::New(); + network::mojom::NetworkContextParamsPtr context_params = + network::mojom::NetworkContextParams::New(); context_params->http_server_properties_path = file_path; std::unique_ptr<NetworkContext> network_context = CreateContextWithParams(std::move(context_params)); @@ -434,7 +448,7 @@ scoped_task_environment_.RunUntilIdle(); // Create a new NetworkContext using the same path for HTTP server properties. - context_params = mojom::NetworkContextParams::New(); + context_params = network::mojom::NetworkContextParams::New(); context_params->http_server_properties_path = file_path; network_context = CreateContextWithParams(std::move(context_params)); @@ -468,7 +482,7 @@ const url::SchemeHostPort kSchemeHostPort("https", "foo", 443); std::unique_ptr<NetworkContext> network_context = - CreateContextWithParams(mojom::NetworkContextParams::New()); + CreateContextWithParams(network::mojom::NetworkContextParams::New()); EXPECT_FALSE(network_context->url_request_context() ->http_server_properties() @@ -504,7 +518,7 @@ TEST_F(NetworkContextTest, CookieManager) { std::unique_ptr<NetworkContext> network_context = - CreateContextWithParams(mojom::NetworkContextParams::New()); + CreateContextWithParams(network::mojom::NetworkContextParams::New()); network::mojom::CookieManagerPtr cookie_manager_ptr; network::mojom::CookieManagerRequest cookie_manager_request( @@ -555,7 +569,8 @@ // Try each proxy config as the initial config, to make sure setting the // initial config works. for (const auto& initial_proxy_config : proxy_configs) { - mojom::NetworkContextParamsPtr context_params = CreateContextParams(); + network::mojom::NetworkContextParamsPtr context_params = + CreateContextParams(); context_params->initial_proxy_config = initial_proxy_config; network::mojom::ProxyConfigClientPtr config_client; context_params->proxy_config_client_request = @@ -588,7 +603,8 @@ net::ProxyConfig proxy_config; proxy_config.proxy_rules().ParseFromString("http=foopy:80;ftp=foopy2"); - mojom::NetworkContextParamsPtr context_params = CreateContextParams(); + network::mojom::NetworkContextParamsPtr context_params = + CreateContextParams(); context_params->initial_proxy_config = proxy_config; std::unique_ptr<NetworkContext> network_context = CreateContextWithParams(std::move(context_params)); @@ -603,7 +619,8 @@ } TEST_F(NetworkContextTest, NoInitialProxyConfig) { - mojom::NetworkContextParamsPtr context_params = CreateContextParams(); + network::mojom::NetworkContextParamsPtr context_params = + CreateContextParams(); context_params->initial_proxy_config.reset(); network::mojom::ProxyConfigClientPtr config_client; context_params->proxy_config_client_request =
diff --git a/content/network/network_service_impl.cc b/content/network/network_service_impl.cc index b631ee46..b7cb1277 100644 --- a/content/network/network_service_impl.cc +++ b/content/network/network_service_impl.cc
@@ -51,7 +51,7 @@ } // namespace std::unique_ptr<NetworkService> NetworkService::Create( - mojom::NetworkServiceRequest request, + network::mojom::NetworkServiceRequest request, net::NetLog* net_log) { return std::make_unique<NetworkServiceImpl>(nullptr, std::move(request), net_log); @@ -91,7 +91,7 @@ NetworkServiceImpl::NetworkServiceImpl( std::unique_ptr<service_manager::BinderRegistry> registry, - mojom::NetworkServiceRequest request, + network::mojom::NetworkServiceRequest request, net::NetLog* net_log) : registry_(std::move(registry)), binding_(this) { // |registry_| is nullptr when an in-process NetworkService is @@ -100,7 +100,7 @@ // network service. if (registry_) { DCHECK(!request.is_pending()); - registry_->AddInterface<mojom::NetworkService>( + registry_->AddInterface<network::mojom::NetworkService>( base::BindRepeating(&NetworkServiceImpl::Bind, base::Unretained(this))); } else if (request.is_pending()) { Bind(std::move(request)); @@ -135,10 +135,10 @@ (*network_contexts_.begin())->Cleanup(); } -std::unique_ptr<mojom::NetworkContext> +std::unique_ptr<network::mojom::NetworkContext> NetworkServiceImpl::CreateNetworkContextWithBuilder( - mojom::NetworkContextRequest request, - mojom::NetworkContextParamsPtr params, + network::mojom::NetworkContextRequest request, + network::mojom::NetworkContextParamsPtr params, std::unique_ptr<URLRequestContextBuilderMojo> builder, net::URLRequestContext** url_request_context) { std::unique_ptr<NetworkContext> network_context = @@ -167,13 +167,14 @@ network_contexts_.erase(network_context); } -void NetworkServiceImpl::SetClient(mojom::NetworkServiceClientPtr client) { +void NetworkServiceImpl::SetClient( + network::mojom::NetworkServiceClientPtr client) { client_ = std::move(client); } void NetworkServiceImpl::CreateNetworkContext( - mojom::NetworkContextRequest request, - mojom::NetworkContextParamsPtr params) { + network::mojom::NetworkContextRequest request, + network::mojom::NetworkContextParamsPtr params) { // The NetworkContext will destroy itself on connection error, or when the // service is destroyed. new NetworkContext(this, std::move(request), std::move(params)); @@ -219,7 +220,7 @@ registry_->BindInterface(interface_name, std::move(interface_pipe)); } -void NetworkServiceImpl::Bind(mojom::NetworkServiceRequest request) { +void NetworkServiceImpl::Bind(network::mojom::NetworkServiceRequest request) { DCHECK(!binding_.is_bound()); binding_.Bind(std::move(request)); }
diff --git a/content/network/network_service_impl.h b/content/network/network_service_impl.h index 3d30f47..c9c98b4 100644 --- a/content/network/network_service_impl.h +++ b/content/network/network_service_impl.h
@@ -12,10 +12,10 @@ #include "base/macros.h" #include "content/common/content_export.h" #include "content/network/network_change_manager.h" -#include "content/public/common/network_service.mojom.h" #include "content/public/network/network_service.h" #include "mojo/public/cpp/bindings/binding.h" #include "services/network/public/interfaces/network_change_manager.mojom.h" +#include "services/network/public/interfaces/network_service.mojom.h" #include "services/service_manager/public/cpp/binder_registry.h" #include "services/service_manager/public/cpp/service.h" @@ -37,20 +37,21 @@ // TODO(https://crbug.com/767450): Once the NetworkService can always create // its own NetLog in production, remove the |net_log| argument. NetworkServiceImpl(std::unique_ptr<service_manager::BinderRegistry> registry, - mojom::NetworkServiceRequest request = nullptr, + network::mojom::NetworkServiceRequest request = nullptr, net::NetLog* net_log = nullptr); ~NetworkServiceImpl() override; - std::unique_ptr<mojom::NetworkContext> CreateNetworkContextWithBuilder( - mojom::NetworkContextRequest request, - mojom::NetworkContextParamsPtr params, + std::unique_ptr<network::mojom::NetworkContext> + CreateNetworkContextWithBuilder( + network::mojom::NetworkContextRequest request, + network::mojom::NetworkContextParamsPtr params, std::unique_ptr<URLRequestContextBuilderMojo> builder, net::URLRequestContext** url_request_context) override; // Allows late binding if the mojo request wasn't specified in the // constructor. - void Bind(mojom::NetworkServiceRequest request); + void Bind(network::mojom::NetworkServiceRequest request); static std::unique_ptr<NetworkServiceImpl> CreateForTesting(); @@ -59,10 +60,11 @@ void RegisterNetworkContext(NetworkContext* network_context); void DeregisterNetworkContext(NetworkContext* network_context); - // mojom::NetworkService implementation: - void SetClient(mojom::NetworkServiceClientPtr client) override; - void CreateNetworkContext(mojom::NetworkContextRequest request, - mojom::NetworkContextParamsPtr params) override; + // network::mojom::NetworkService implementation: + void SetClient(network::mojom::NetworkServiceClientPtr client) override; + void CreateNetworkContext( + network::mojom::NetworkContextRequest request, + network::mojom::NetworkContextParamsPtr params) override; void DisableQuic() override; void SetRawHeadersAccess(uint32_t process_id, bool allow) override; void GetNetworkChangeManager( @@ -71,7 +73,7 @@ bool quic_disabled() const { return quic_disabled_; } bool HasRawHeadersAccess(uint32_t process_id) const; - mojom::NetworkServiceClient* client() { return client_.get(); } + network::mojom::NetworkServiceClient* client() { return client_.get(); } net::NetLog* net_log() const; private: @@ -89,7 +91,7 @@ // its own NetLog. net::NetLog* net_log_; - mojom::NetworkServiceClientPtr client_; + network::mojom::NetworkServiceClientPtr client_; // Observer that logs network changes to the NetLog. Must be below the NetLog // and the NetworkChangeNotifier (Once this class creates it), so it's @@ -100,7 +102,7 @@ std::unique_ptr<service_manager::BinderRegistry> registry_; - mojo::Binding<mojom::NetworkService> binding_; + mojo::Binding<network::mojom::NetworkService> binding_; // NetworkContexts register themselves with the NetworkService so that they // can be cleaned up when the NetworkService goes away. This is needed as
diff --git a/content/network/network_service_unittest.cc b/content/network/network_service_unittest.cc index 2a5c2bec..0780a3f51 100644 --- a/content/network/network_service_unittest.cc +++ b/content/network/network_service_unittest.cc
@@ -11,7 +11,6 @@ #include "build/build_config.h" #include "content/network/network_context.h" #include "content/network/network_service_impl.h" -#include "content/public/common/network_service.mojom.h" #include "content/public/common/service_names.mojom.h" #include "content/public/test/test_url_loader_client.h" #include "net/base/mock_network_change_notifier.h" @@ -19,6 +18,7 @@ #include "net/test/embedded_test_server/embedded_test_server.h" #include "net/traffic_annotation/network_traffic_annotation_test_helper.h" #include "services/network/public/interfaces/network_change_manager.mojom.h" +#include "services/network/public/interfaces/network_service.mojom.h" #include "services/service_manager/public/cpp/service_context.h" #include "services/service_manager/public/cpp/service_test.h" #include "services/service_manager/public/interfaces/service_factory.mojom.h" @@ -28,8 +28,9 @@ namespace { -mojom::NetworkContextParamsPtr CreateContextParams() { - mojom::NetworkContextParamsPtr params = mojom::NetworkContextParams::New(); +network::mojom::NetworkContextParamsPtr CreateContextParams() { + network::mojom::NetworkContextParamsPtr params = + network::mojom::NetworkContextParams::New(); // Use a fixed proxy config, to avoid dependencies on local network // configuration. params->initial_proxy_config = net::ProxyConfig::CreateDirect(); @@ -56,7 +57,7 @@ // Test shutdown in the case a NetworkContext is destroyed before the // NetworkService. TEST_F(NetworkServiceTest, CreateAndDestroyContext) { - mojom::NetworkContextPtr network_context; + network::mojom::NetworkContextPtr network_context; service()->CreateNetworkContext(mojo::MakeRequest(&network_context), CreateContextParams()); network_context.reset(); @@ -68,7 +69,7 @@ // NetworkService is destroyed. The service should destroy the NetworkContext // itself. TEST_F(NetworkServiceTest, DestroyingServiceDestroysContext) { - mojom::NetworkContextPtr network_context; + network::mojom::NetworkContextPtr network_context; service()->CreateNetworkContext(mojo::MakeRequest(&network_context), CreateContextParams()); base::RunLoop run_loop; @@ -157,8 +158,8 @@ net::EmbeddedTestServer* test_server() { return &test_server_; } TestURLLoaderClient* client() { return client_.get(); } network::mojom::URLLoader* loader() { return loader_.get(); } - mojom::NetworkService* service() { return network_service_.get(); } - mojom::NetworkContext* context() { return network_context_.get(); } + network::mojom::NetworkService* service() { return network_service_.get(); } + network::mojom::NetworkContext* context() { return network_context_.get(); } private: std::unique_ptr<service_manager::Service> CreateService() override { @@ -171,16 +172,16 @@ ASSERT_TRUE(test_server_.Start()); service_manager::test::ServiceTest::SetUp(); connector()->BindInterface(mojom::kNetworkServiceName, &network_service_); - mojom::NetworkContextParamsPtr context_params = - mojom::NetworkContextParams::New(); + network::mojom::NetworkContextParamsPtr context_params = + network::mojom::NetworkContextParams::New(); network_service_->CreateNetworkContext(mojo::MakeRequest(&network_context_), std::move(context_params)); } net::EmbeddedTestServer test_server_; std::unique_ptr<TestURLLoaderClient> client_; - mojom::NetworkServicePtr network_service_; - mojom::NetworkContextPtr network_context_; + network::mojom::NetworkServicePtr network_service_; + network::mojom::NetworkContextPtr network_context_; network::mojom::URLLoaderPtr loader_; DISALLOW_COPY_AND_ASSIGN(NetworkServiceTestWithService); @@ -279,8 +280,8 @@ } TEST_F(NetworkServiceTestWithService, SetNetworkConditions) { - mojom::NetworkConditionsPtr network_conditions = - mojom::NetworkConditions::New(); + network::mojom::NetworkConditionsPtr network_conditions = + network::mojom::NetworkConditions::New(); network_conditions->offline = true; context()->SetNetworkConditions("42", std::move(network_conditions)); @@ -299,14 +300,14 @@ EXPECT_EQ(net::ERR_INTERNET_DISCONNECTED, client()->completion_status().error_code); - network_conditions = mojom::NetworkConditions::New(); + network_conditions = network::mojom::NetworkConditions::New(); network_conditions->offline = false; context()->SetNetworkConditions("42", std::move(network_conditions)); StartLoadingURL(request, 0); client()->RunUntilComplete(); EXPECT_EQ(net::OK, client()->completion_status().error_code); - network_conditions = mojom::NetworkConditions::New(); + network_conditions = network::mojom::NetworkConditions::New(); network_conditions->offline = true; context()->SetNetworkConditions("42", std::move(network_conditions)); @@ -326,7 +327,7 @@ : public network::mojom::NetworkChangeManagerClient { public: explicit TestNetworkChangeManagerClient( - mojom::NetworkService* network_service) + network::mojom::NetworkService* network_service) : connection_type_(network::mojom::ConnectionType::CONNECTION_UNKNOWN), binding_(this) { network::mojom::NetworkChangeManagerPtr manager_ptr; @@ -414,7 +415,7 @@ base::test::ScopedTaskEnvironment::MainThreadType::IO) {} ~NetworkServiceNetworkChangeTest() override {} - mojom::NetworkService* service() { return network_service_.get(); } + network::mojom::NetworkService* service() { return network_service_.get(); } private: // A ServiceTestClient that broadcasts a network change notification in the @@ -450,7 +451,7 @@ connector()->BindInterface(mojom::kNetworkServiceName, &network_service_); } - mojom::NetworkServicePtr network_service_; + network::mojom::NetworkServicePtr network_service_; #if defined(OS_ANDROID) // On Android, NetworkChangeNotifier setup is more involved and needs // to be split between UI thread and network thread. Use a mock
diff --git a/content/network/url_loader.cc b/content/network/url_loader.cc index 752304c..cbffe0d 100644 --- a/content/network/url_loader.cc +++ b/content/network/url_loader.cc
@@ -12,7 +12,6 @@ #include "base/task_scheduler/post_task.h" #include "base/threading/thread_task_runner_handle.h" #include "base/time/time.h" -#include "content/common/loader_util.h" #include "content/network/data_pipe_element_reader.h" #include "content/network/network_context.h" #include "content/network/network_service_impl.h" @@ -23,6 +22,7 @@ #include "net/base/upload_file_element_reader.h" #include "net/cert/symantec_certs.h" #include "net/url_request/url_request_context.h" +#include "services/network/public/cpp/loader_util.h" #include "services/network/public/cpp/net_adapters.h" #include "services/network/public/cpp/resource_request.h" #include "services/network/public/cpp/resource_response.h" @@ -220,7 +220,7 @@ GURL(request.url), request.priority, this, traffic_annotation); url_request_->set_method(request.method); url_request_->set_site_for_cookies(request.site_for_cookies); - url_request_->SetReferrer(ComputeReferrer(request.referrer)); + url_request_->SetReferrer(network::ComputeReferrer(request.referrer)); url_request_->set_referrer_policy(request.referrer_policy); url_request_->SetExtraRequestHeaders(request.headers); @@ -248,7 +248,7 @@ net::URLRequest::UPDATE_FIRST_PARTY_URL_ON_REDIRECT); } - url_request_->SetLoadFlags(BuildLoadFlagsForRequest(request)); + url_request_->SetLoadFlags(request.load_flags); if (report_raw_headers_) { url_request_->SetRequestHeadersCallback( base::Bind(&net::HttpRawRequestHeaders::Assign, @@ -351,8 +351,9 @@ PopulateResourceResponse(url_request_.get(), is_load_timing_enabled_, response.get()); if (report_raw_headers_) { - response->head.raw_request_response_info = BuildRawRequestResponseInfo( - *url_request_, raw_request_headers_, raw_response_headers_.get()); + response->head.raw_request_response_info = + network::BuildRawRequestResponseInfo( + *url_request_, raw_request_headers_, raw_response_headers_.get()); raw_request_headers_ = net::HttpRawRequestHeaders(); raw_response_headers_ = nullptr; } @@ -404,8 +405,9 @@ PopulateResourceResponse(url_request_.get(), is_load_timing_enabled_, response_.get()); if (report_raw_headers_) { - response_->head.raw_request_response_info = BuildRawRequestResponseInfo( - *url_request_, raw_request_headers_, raw_response_headers_.get()); + response_->head.raw_request_response_info = + network::BuildRawRequestResponseInfo( + *url_request_, raw_request_headers_, raw_response_headers_.get()); raw_request_headers_ = net::HttpRawRequestHeaders(); raw_response_headers_ = nullptr; } @@ -427,7 +429,7 @@ base::Unretained(this))); if (!(options_ & network::mojom::kURLLoadOptionSniffMimeType) || - !ShouldSniffContent(url_request_.get(), response_.get())) + !network::ShouldSniffContent(url_request_.get(), response_.get())) SendResponseToClient(); // Start reading...
diff --git a/content/network/url_request_context_builder_mojo.cc b/content/network/url_request_context_builder_mojo.cc index 86482e9..c388e69 100644 --- a/content/network/url_request_context_builder_mojo.cc +++ b/content/network/url_request_context_builder_mojo.cc
@@ -30,7 +30,7 @@ } URLRequestContextOwner URLRequestContextBuilderMojo::Create( - mojom::NetworkContextParams* params, + network::mojom::NetworkContextParams* params, bool quic_disabled, net::NetLog* net_log) { return NetworkContext::ApplyContextParamsToBuilder(this, params,
diff --git a/content/public/android/BUILD.gn b/content/public/android/BUILD.gn index 448163b..6cd8114a 100644 --- a/content/public/android/BUILD.gn +++ b/content/public/android/BUILD.gn
@@ -175,7 +175,7 @@ "java/src/org/chromium/content/browser/input/ChromiumBaseInputConnection.java", "java/src/org/chromium/content/browser/input/CursorAnchorInfoController.java", "java/src/org/chromium/content/browser/input/DateTimeChooserAndroid.java", - "java/src/org/chromium/content/browser/input/ImeAdapter.java", + "java/src/org/chromium/content/browser/input/ImeAdapterImpl.java", "java/src/org/chromium/content/browser/input/ImeUtils.java", "java/src/org/chromium/content/browser/input/InputMethodManagerWrapper.java", "java/src/org/chromium/content/browser/input/InputMethodUma.java", @@ -233,6 +233,7 @@ "java/src/org/chromium/content_public/browser/GestureListenerManager.java", "java/src/org/chromium/content_public/browser/GestureStateListener.java", "java/src/org/chromium/content_public/browser/ImageDownloadCallback.java", + "java/src/org/chromium/content_public/browser/ImeAdapter.java", "java/src/org/chromium/content_public/browser/ImeEventObserver.java", "java/src/org/chromium/content_public/browser/InterfaceRegistrar.java", "java/src/org/chromium/content_public/browser/JavaScriptCallback.java", @@ -377,7 +378,7 @@ "java/src/org/chromium/content/browser/framehost/NavigationControllerImpl.java", "java/src/org/chromium/content/browser/framehost/RenderFrameHostImpl.java", "java/src/org/chromium/content/browser/input/DateTimeChooserAndroid.java", - "java/src/org/chromium/content/browser/input/ImeAdapter.java", + "java/src/org/chromium/content/browser/input/ImeAdapterImpl.java", "java/src/org/chromium/content/browser/input/SuggestionInfo.java", "java/src/org/chromium/content/browser/input/TextSuggestionHost.java", "java/src/org/chromium/content/browser/selection/HandleViewResources.java",
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentView.java b/content/public/android/java/src/org/chromium/content/browser/ContentView.java index 22ab04b..ca96de2 100644 --- a/content/public/android/java/src/org/chromium/content/browser/ContentView.java +++ b/content/public/android/java/src/org/chromium/content/browser/ContentView.java
@@ -23,6 +23,7 @@ import android.widget.FrameLayout; import org.chromium.base.TraceEvent; +import org.chromium.content_public.browser.ImeAdapter; import org.chromium.ui.base.EventForwarder; /** @@ -130,12 +131,13 @@ @Override public InputConnection onCreateInputConnection(EditorInfo outAttrs) { - return mContentViewCore.onCreateInputConnection(outAttrs); + return ImeAdapter.fromWebContents(mContentViewCore.getWebContents()) + .onCreateInputConnection(outAttrs); } @Override public boolean onCheckIsTextEditor() { - return mContentViewCore.onCheckIsTextEditor(); + return ImeAdapter.fromWebContents(mContentViewCore.getWebContents()).onCheckIsTextEditor(); } @Override
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java index 378486f..5823285 100644 --- a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java +++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
@@ -15,15 +15,11 @@ import android.view.ViewGroup; import android.view.ViewStructure; import android.view.accessibility.AccessibilityNodeProvider; -import android.view.inputmethod.EditorInfo; -import android.view.inputmethod.InputConnection; import org.chromium.base.VisibleForTesting; import org.chromium.content.browser.accessibility.WebContentsAccessibility; -import org.chromium.content.browser.input.ImeAdapter; import org.chromium.content.browser.input.SelectPopup; import org.chromium.content.browser.input.TextSuggestionHost; -import org.chromium.content_public.browser.ImeEventObserver; import org.chromium.content_public.browser.WebContents; import org.chromium.ui.base.ViewAndroidDelegate; import org.chromium.ui.base.WindowAndroid; @@ -119,12 +115,6 @@ void removeWindowAndroidChangedObserver(WindowAndroidChangedObserver observer); /** - * Add {@link ImeEventObserver} object to {@link ImeAdapter}. - * @param observer imeEventObserver instance to add. - */ - void addImeEventObserver(ImeEventObserver imeEventObserver); - - /** * Initialize {@link ContentViewCore} object. * @param viewDelegate Delegate to add/remove anchor views. * @param internalDispatcher Handles dispatching all hidden or super methods to the @@ -249,16 +239,6 @@ void onDetachedFromWindow(); /** - * @see View#onCreateInputConnection(EditorInfo) - */ - InputConnection onCreateInputConnection(EditorInfo outAttrs); - - /** - * @see View#onCheckIsTextEditor() - */ - boolean onCheckIsTextEditor(); - - /** * @see View#onConfigurationChanged(Configuration) */ void onConfigurationChanged(Configuration newConfig); @@ -493,12 +473,6 @@ void setTextSuggestionHostForTesting(TextSuggestionHost textSuggestionHost); @VisibleForTesting - void setImeAdapterForTest(ImeAdapter imeAdapter); - - @VisibleForTesting - ImeAdapter getImeAdapterForTest(); - - @VisibleForTesting void setPopupZoomerForTest(PopupZoomer popupZoomer); /**
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewCoreImpl.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewCoreImpl.java index b62dbe89..2b6f0618 100644 --- a/content/public/android/java/src/org/chromium/content/browser/ContentViewCoreImpl.java +++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewCoreImpl.java
@@ -26,8 +26,6 @@ import android.view.accessibility.AccessibilityManager; import android.view.accessibility.AccessibilityManager.AccessibilityStateChangeListener; import android.view.accessibility.AccessibilityNodeProvider; -import android.view.inputmethod.EditorInfo; -import android.view.inputmethod.InputConnection; import org.chromium.base.ObserverList; import org.chromium.base.TraceEvent; @@ -39,7 +37,7 @@ import org.chromium.content.browser.accessibility.captioning.CaptioningBridgeFactory; import org.chromium.content.browser.accessibility.captioning.SystemCaptioningBridge; import org.chromium.content.browser.accessibility.captioning.TextTrackSettings; -import org.chromium.content.browser.input.ImeAdapter; +import org.chromium.content.browser.input.ImeAdapterImpl; import org.chromium.content.browser.input.InputMethodManagerWrapper; import org.chromium.content.browser.input.SelectPopup; import org.chromium.content.browser.input.SelectPopupDialog; @@ -106,7 +104,7 @@ resetPopupsAndInput(); ContentViewCoreImpl contentViewCore = mWeakContentViewCore.get(); if (contentViewCore == null) return; - contentViewCore.mImeAdapter.resetAndHideKeyboard(); + contentViewCore.getImeAdapter().resetAndHideKeyboard(); } private void resetPopupsAndInput() { @@ -171,9 +169,6 @@ private SelectPopup mSelectPopup; private long mNativeSelectPopupSourceFrame; - // Only valid when focused on a text / password field. - private ImeAdapter mImeAdapter; - private TextSuggestionHost mTextSuggestionHost; // Cached copy of all positions and scales as reported by the renderer. @@ -320,23 +315,6 @@ mWindowAndroidChangedObservers.removeObserver(observer); } - @Override - public void addImeEventObserver(ImeEventObserver imeEventObserver) { - mImeAdapter.addEventObserver(imeEventObserver); - } - - @VisibleForTesting - @Override - public void setImeAdapterForTest(ImeAdapter imeAdapter) { - mImeAdapter = imeAdapter; - } - - @VisibleForTesting - @Override - public ImeAdapter getImeAdapterForTest() { - return mImeAdapter; - } - // Perform important post-construction set up of the ContentViewCore. // We do not require the containing view in the constructor to allow embedders to create a // ContentViewCore without having fully created its containing view. The containing view @@ -368,9 +346,9 @@ setContainerViewInternals(internalDispatcher); mPopupZoomer = new PopupZoomer(mContext, mWebContents, mContainerView); - mImeAdapter = new ImeAdapter( + ImeAdapterImpl imeAdapter = ImeAdapterImpl.create( mWebContents, mContainerView, new InputMethodManagerWrapper(mContext)); - mImeAdapter.addEventObserver(this); + imeAdapter.addEventObserver(this); mTextSuggestionHost = new TextSuggestionHost(this); mWebContentsObserver = new ContentViewWebContentsObserver(this); @@ -427,7 +405,7 @@ if (mContainerView != null) { hideSelectPopupWithCancelMessage(); mPopupZoomer.hide(false); - mImeAdapter.setContainerView(containerView); + getImeAdapter().setContainerView(containerView); } mContainerView = containerView; @@ -446,6 +424,10 @@ return GestureListenerManagerImpl.fromWebContents(mWebContents); } + private ImeAdapterImpl getImeAdapter() { + return ImeAdapterImpl.fromWebContents(mWebContents); + } + @CalledByNative private void onNativeContentViewCoreDestroyed(long nativeContentViewCore) { assert nativeContentViewCore == mNativeContentViewCore; @@ -471,7 +453,7 @@ } mWebContentsObserver.destroy(); mWebContentsObserver = null; - mImeAdapter.resetAndHideKeyboard(); + getImeAdapter().resetAndHideKeyboard(); hidePopupsAndPreserveSelection(); mWebContents = null; mNativeContentViewCore = 0; @@ -593,9 +575,7 @@ getSelectionPopupController().destroyActionModeAndUnselect(); destroyPastePopup(); } - hideSelectPopupWithCancelMessage(); - mPopupZoomer.hide(false); - mTextSuggestionHost.hidePopups(); + hidePopups(); if (mWebContents != null) mWebContents.dismissTextHandles(); } @@ -605,6 +585,10 @@ getSelectionPopupController().destroyActionModeAndKeepSelection(); destroyPastePopup(); } + hidePopups(); + } + + private void hidePopups() { hideSelectPopupWithCancelMessage(); mPopupZoomer.hide(false); mTextSuggestionHost.hidePopups(); @@ -634,7 +618,7 @@ GamepadList.onAttachedToWindow(mContext); mAccessibilityManager.addAccessibilityStateChangeListener(this); mSystemCaptioningBridge.addListener(this); - mImeAdapter.onViewAttachedToWindow(); + getImeAdapter().onViewAttachedToWindow(); if (mWebContentsAccessibility != null) { mWebContentsAccessibility.onAttachedToWindow(); } @@ -655,40 +639,31 @@ @Override public void onDetachedFromWindow() { mAttachedToWindow = false; - mImeAdapter.onViewDetachedFromWindow(); removeDisplayAndroidObserver(); GamepadList.onDetachedFromWindow(); mAccessibilityManager.removeAccessibilityStateChangeListener(this); - // WebView uses PopupWindows for handle rendering, which may remain - // unintentionally visible even after the WebView has been detached. - // Override the handle visibility explicitly to address this, but - // preserve the underlying selection for detachment cases like screen - // locking and app switching. - if (mWebContents != null) updateTextSelectionUI(false); + if (mWebContents != null) { + // WebView uses PopupWindows for handle rendering, which may remain + // unintentionally visible even after the WebView has been detached. + // Override the handle visibility explicitly to address this, but + // preserve the underlying selection for detachment cases like screen + // locking and app switching. + updateTextSelectionUI(false); + getImeAdapter().onViewDetachedFromWindow(); + } mSystemCaptioningBridge.removeListener(this); if (mWebContentsAccessibility != null) { mWebContentsAccessibility.onDetachedFromWindow(); } } - @Override - public InputConnection onCreateInputConnection(EditorInfo outAttrs) { - boolean allowKeyboardLearning = getWebContents() != null && !getWebContents().isIncognito(); - return mImeAdapter.onCreateInputConnection(outAttrs, allowKeyboardLearning); - } - - @Override - public boolean onCheckIsTextEditor() { - return mImeAdapter.hasTextInputType(); - } - @SuppressWarnings("javadoc") @Override public void onConfigurationChanged(Configuration newConfig) { try { TraceEvent.begin("ContentViewCore.onConfigurationChanged"); - mImeAdapter.onKeyboardConfigurationChanged(newConfig); + getImeAdapter().onKeyboardConfigurationChanged(newConfig); mContainerViewInternals.super_onConfigurationChanged(newConfig); // To request layout has side effect, but it seems OK as it only happen in // onConfigurationChange and layout has to be changed in most case. @@ -705,30 +680,10 @@ getGestureListenerManager().updateOnTouchDown(); } - private void updateAfterSizeChanged() { - mPopupZoomer.hide(false); - - // Execute a delayed form focus operation because the OSK was brought - // up earlier. - Rect focusPreOSKViewportRect = mImeAdapter.getFocusPreOSKViewportRect(); - if (!focusPreOSKViewportRect.isEmpty()) { - Rect rect = new Rect(); - getContainerView().getWindowVisibleDisplayFrame(rect); - if (!rect.equals(focusPreOSKViewportRect)) { - // Only assume the OSK triggered the onSizeChanged if width was preserved. - if (rect.width() == focusPreOSKViewportRect.width()) { - assert mWebContents != null; - mWebContents.scrollFocusedEditableNodeIntoView(); - } - cancelRequestToScrollFocusedEditableNodeIntoView(); - } - } - } - private void cancelRequestToScrollFocusedEditableNodeIntoView() { // Zero-ing the rect will prevent |updateAfterSizeChanged()| from // issuing the delayed form focus event. - mImeAdapter.getFocusPreOSKViewportRect().setEmpty(); + getImeAdapter().getFocusPreOSKViewportRect().setEmpty(); } @Override @@ -743,9 +698,9 @@ @Override public void onWindowFocusChanged(boolean hasWindowFocus) { - mImeAdapter.onWindowFocusChanged(hasWindowFocus); if (!hasWindowFocus) resetGestureDetection(); if (isAlive()) { + getImeAdapter().onWindowFocusChanged(hasWindowFocus); getSelectionPopupController().onWindowFocusChanged(hasWindowFocus); getGestureListenerManager().updateOnWindowFocusChanged(hasWindowFocus); } @@ -755,7 +710,16 @@ public void onFocusChanged(boolean gainFocus, boolean hideKeyboardOnBlur) { if (mHasViewFocus != null && mHasViewFocus == gainFocus) return; mHasViewFocus = gainFocus; - mImeAdapter.onViewFocusChanged(gainFocus, hideKeyboardOnBlur); + + if (!isAlive()) { + // CVC is on its way to destruction. The rest needs not running as all the states + // will be discarded, or WebContentsUserData-based objects are not reachable + // any more. Simply hide popups and return. + hidePopups(); + return; + } + + getImeAdapter().onViewFocusChanged(gainFocus, hideKeyboardOnBlur); mJoystickScrollEnabled = gainFocus && !getSelectionPopupController().isFocusedNodeEditable(); @@ -772,7 +736,7 @@ // Clear the selection. The selection is cleared on destroying IME // and also here since we may receive destroy first, for example // when focus is lost in webview. - if (isAlive()) getSelectionPopupController().clearSelection(); + getSelectionPopupController().clearSelection(); } } if (mNativeContentViewCore != 0) nativeSetFocus(mNativeContentViewCore, gainFocus); @@ -794,7 +758,7 @@ return mContainerViewInternals.super_dispatchKeyEvent(event); } - if (mImeAdapter.dispatchKeyEvent(event)) return true; + if (getImeAdapter().dispatchKeyEvent(event)) return true; return mContainerViewInternals.super_dispatchKeyEvent(event); } @@ -1051,9 +1015,6 @@ getSelectionPopupController().updateSelectionState(editable, password); } - @Override - public void onBeforeSendKeyEvent(KeyEvent event) {} - /** * Called (from native) when the <select> popup needs to be shown. * @param anchorView View anchored for popup.
diff --git a/content/public/android/java/src/org/chromium/content/browser/input/ChromiumBaseInputConnection.java b/content/public/android/java/src/org/chromium/content/browser/input/ChromiumBaseInputConnection.java index ea6f619..3c39057 100644 --- a/content/public/android/java/src/org/chromium/content/browser/input/ChromiumBaseInputConnection.java +++ b/content/public/android/java/src/org/chromium/content/browser/input/ChromiumBaseInputConnection.java
@@ -20,7 +20,7 @@ * A factory class to create or reuse ChromiumBaseInputConnection. */ public interface Factory { - ChromiumBaseInputConnection initializeAndGet(View view, ImeAdapter imeAdapter, + ChromiumBaseInputConnection initializeAndGet(View view, ImeAdapterImpl imeAdapter, int inputType, int inputFlags, int inputMode, int selectionStart, int selectionEnd, EditorInfo outAttrs);
diff --git a/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java b/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapterImpl.java similarity index 90% rename from content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java rename to content/public/android/java/src/org/chromium/content/browser/input/ImeAdapterImpl.java index 75f2b30..aac7e73 100644 --- a/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java +++ b/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapterImpl.java
@@ -38,6 +38,9 @@ import org.chromium.blink_public.web.WebInputEventType; import org.chromium.blink_public.web.WebTextInputMode; import org.chromium.content.browser.picker.InputDialogContainer; +import org.chromium.content.browser.webcontents.WebContentsUserData; +import org.chromium.content.browser.webcontents.WebContentsUserData.UserDataFactory; +import org.chromium.content_public.browser.ImeAdapter; import org.chromium.content_public.browser.ImeEventObserver; import org.chromium.content_public.browser.WebContents; import org.chromium.ui.base.ViewUtils; @@ -50,8 +53,9 @@ import java.util.List; /** - * Adapts and plumbs android IME service onto the chrome text input API. - * ImeAdapter provides an interface in both ways native <-> java: + * Implementation of the interface {@link ImeAdapter} providing an interface + * in both ways native <-> java: + * * 1. InputConnectionAdapter notifies native code of text composition state and * dispatch key events from java -> WebKit. * 2. Native ImeAdapter notifies java side to clear composition text. @@ -71,13 +75,13 @@ * lifetime of the object. */ @JNINamespace("content") -public class ImeAdapter { +public class ImeAdapterImpl implements ImeAdapter { private static final String TAG = "cr_Ime"; private static final boolean DEBUG_LOGS = false; private static final float SUGGESTION_HIGHLIGHT_BACKGROUND_TRANSPARENCY = 0.4f; - public static final int COMPOSITION_KEY_CODE = 229; + public static final int COMPOSITION_KEY_CODE = ImeAdapter.COMPOSITION_KEY_CODE; private static final int IME_FLAG_NO_PERSONALIZED_LEARNING = 0x1000000; // Color used by AOSP Android for a SuggestionSpan with FLAG_EASY_CORRECT set @@ -99,7 +103,7 @@ // InputMethodManager on appropriate timing, depending on how IME requested the information // via InputConnection. The update request is per InputConnection, hence for each time it is // re-created, the monitoring status will be reset. - private final CursorAnchorInfoController mCursorAnchorInfoController; + private CursorAnchorInfoController mCursorAnchorInfoController; private final List<ImeEventObserver> mEventObservers = new ArrayList<>(); @@ -126,6 +130,9 @@ // True if ImeAdapter is connected to render process. private boolean mIsConnected; + // True if the instance is properly initialized with |init|. + private boolean mInitialized; + /** * {@ResultReceiver} passed in InputMethodManager#showSoftInput}. We need this to scroll to the * editable node at the right timing, which is after input method window shows up. @@ -137,31 +144,71 @@ // showSoftInput(), is in the control of Android's input method framework and IME app, // so we use a weakref to avoid tying ImeAdapter's lifetime to that of ResultReceiver // object. - private final WeakReference<ImeAdapter> mImeAdapter; + private final WeakReference<ImeAdapterImpl> mImeAdapter; - public ShowKeyboardResultReceiver(ImeAdapter imeAdapter, Handler handler) { + public ShowKeyboardResultReceiver(ImeAdapterImpl imeAdapter, Handler handler) { super(handler); mImeAdapter = new WeakReference<>(imeAdapter); } @Override public void onReceiveResult(int resultCode, Bundle resultData) { - ImeAdapter imeAdapter = mImeAdapter.get(); + ImeAdapterImpl imeAdapter = mImeAdapter.get(); if (imeAdapter == null) return; imeAdapter.onShowKeyboardReceiveResult(resultCode); } } + private static final class UserDataFactoryLazyHolder { + private static final UserDataFactory<ImeAdapterImpl> INSTANCE = ImeAdapterImpl::new; + } + /** + * Create {@link ImeAdapterImpl} instance. * @param webContents WebContents instance with which this ImeAdapter is associated. * @param containerView {@link View} instance which input events are posted on. * @param wrapper InputMethodManagerWrapper that should receive all the call directed to * InputMethodManager. */ - public ImeAdapter( + public static ImeAdapterImpl create( WebContents webContents, View containerView, InputMethodManagerWrapper wrapper) { + ImeAdapterImpl imeAdapter = WebContentsUserData.fromWebContents( + webContents, ImeAdapterImpl.class, UserDataFactoryLazyHolder.INSTANCE); + assert imeAdapter != null && !imeAdapter.initialized(); + imeAdapter.init(containerView, wrapper); + return imeAdapter; + } + + private boolean initialized() { + return mInitialized; + } + + /** + * Get {@link ImeAdapter} object used for the give WebContents. + * {@link #create()} should precede any calls to this. + * @param webContents {@link WebContents} object. + * @return {@link ImeAdapter} object. {@code null} if not available because + * {@link #create()} is not called yet. + */ + public static ImeAdapterImpl fromWebContents(WebContents webContents) { + return WebContentsUserData.fromWebContents(webContents, ImeAdapterImpl.class, null); + } + + /** + * Create {@link ImeAdapterImpl} instance. + * @param webContents WebContents instance. + */ + public ImeAdapterImpl(WebContents webContents) { mWebContents = webContents; - mContainerView = containerView; + } + + /** + * @param view {@link View} instance which input events are posted on. + * @param wrapper InputMethodManagerWrapper that should receive all the call directed to + * InputMethodManager. + */ + private void init(View view, InputMethodManagerWrapper wrapper) { + mContainerView = view; mInputMethodManagerWrapper = wrapper; // Deep copy newConfig so that we can notice the difference. @@ -169,8 +216,8 @@ // CursorAnchroInfo is supported only after L. if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { - mCursorAnchorInfoController = CursorAnchorInfoController.create(wrapper, - new CursorAnchorInfoController.ComposingTextDelegate() { + mCursorAnchorInfoController = CursorAnchorInfoController.create( + wrapper, new CursorAnchorInfoController.ComposingTextDelegate() { @Override public CharSequence getText() { return mLastText; @@ -195,7 +242,19 @@ } else { mCursorAnchorInfoController = null; } - mNativeImeAdapterAndroid = nativeInit(webContents); + mNativeImeAdapterAndroid = nativeInit(mWebContents); + mInitialized = true; + } + + @Override + public InputConnection onCreateInputConnection(EditorInfo outAttrs) { + boolean allowKeyboardLearning = mWebContents != null && !mWebContents.isIncognito(); + return onCreateInputConnection(outAttrs, allowKeyboardLearning); + } + + @Override + public boolean onCheckIsTextEditor() { + return isTextInputType(mTextInputType); } /** @@ -206,6 +265,7 @@ mContainerView = containerView; } + @Override public void addEventObserver(ImeEventObserver eventObserver) { mEventObservers.add(eventObserver); } @@ -268,12 +328,7 @@ mInputConnection = inputConnection; } - /** - * Overrides the InputMethodManagerWrapper that ImeAdapter uses to make calls to - * InputMethodManager. - * @param immw InputMethodManagerWrapper that should be used to call InputMethodManager. - */ - @VisibleForTesting + @Override public void setInputMethodManagerWrapperForTest(InputMethodManagerWrapper immw) { mInputMethodManagerWrapper = immw; if (mCursorAnchorInfoController != null) { @@ -295,7 +350,8 @@ * Get the current input connection for testing purposes. */ @VisibleForTesting - public ChromiumBaseInputConnection getInputConnectionForTest() { + @Override + public InputConnection getInputConnectionForTest() { return mInputConnection; } @@ -461,7 +517,7 @@ } } - @VisibleForTesting + @Override public ResultReceiver getNewShowKeyboardReceiver() { if (mShowKeyboardResultReceiver == null) { // Note: the returned object will get leaked by Android framework. @@ -484,7 +540,7 @@ // Detach input connection by returning null from onCreateInputConnection(). if (mTextInputType == TextInputType.NONE && mInputConnection != null) { ChromiumBaseInputConnection inputConnection = mInputConnection; - restartInput(); // resets mInputConnection + restartInput(); // resets mInputConnection // crbug.com/666982: Restart input may not happen if view is detached from window, but // we need to unblock in any case. We want to call this after restartInput() to // ensure that there is no additional IME operation in the queue. @@ -559,19 +615,10 @@ } } - @VisibleForTesting - void setInputTypeForTest(int textInputType) { - mTextInputType = textInputType; - } - private static boolean isTextInputType(int type) { return type != TextInputType.NONE && !InputDialogContainer.isDialogInputType(type); } - public boolean hasTextInputType() { - return isTextInputType(mTextInputType); - } - /** * See {@link View#dispatchKeyEvent(KeyEvent)} */ @@ -694,14 +741,10 @@ public void sendSyntheticKeyPress(int keyCode, int flags) { long eventTime = SystemClock.uptimeMillis(); - sendKeyEvent(new KeyEvent(eventTime, eventTime, - KeyEvent.ACTION_DOWN, keyCode, 0, 0, - KeyCharacterMap.VIRTUAL_KEYBOARD, 0, - flags)); - sendKeyEvent(new KeyEvent(eventTime, eventTime, - KeyEvent.ACTION_UP, keyCode, 0, 0, - KeyCharacterMap.VIRTUAL_KEYBOARD, 0, - flags)); + sendKeyEvent(new KeyEvent(eventTime, eventTime, KeyEvent.ACTION_DOWN, keyCode, 0, 0, + KeyCharacterMap.VIRTUAL_KEYBOARD, 0, flags)); + sendKeyEvent(new KeyEvent(eventTime, eventTime, KeyEvent.ACTION_UP, keyCode, 0, 0, + KeyCharacterMap.VIRTUAL_KEYBOARD, 0, flags)); } private void onImeEvent() { @@ -759,7 +802,7 @@ return nativeSendKeyEvent(mNativeImeAdapterAndroid, event, type, getModifiers(event.getMetaState()), event.getEventTime(), event.getKeyCode(), - event.getScanCode(), /*isSystemKey=*/false, event.getUnicodeChar()); + event.getScanCode(), /*isSystemKey=*/false, event.getUnicodeChar()); } /** @@ -915,8 +958,7 @@ if (!(text instanceof SpannableString)) return; SpannableString spannableString = ((SpannableString) text); - CharacterStyle spans[] = - spannableString.getSpans(0, text.length(), CharacterStyle.class); + CharacterStyle spans[] = spannableString.getSpans(0, text.length(), CharacterStyle.class); for (CharacterStyle span : spans) { if (span instanceof BackgroundColorSpan) { nativeAppendBackgroundColorSpan(imeTextSpans, spannableString.getSpanStart(span), @@ -992,20 +1034,20 @@ private static native void nativeAppendSuggestionSpan(long spanPtr, int start, int end, boolean isMisspelling, int underlineColor, int suggestionHighlightColor, String[] suggestions); - private native void nativeSetComposingText(long nativeImeAdapterAndroid, CharSequence text, - String textStr, int newCursorPosition); + private native void nativeSetComposingText( + long nativeImeAdapterAndroid, CharSequence text, String textStr, int newCursorPosition); private native void nativeCommitText( long nativeImeAdapterAndroid, CharSequence text, String textStr, int newCursorPosition); private native void nativeFinishComposingText(long nativeImeAdapterAndroid); - private native void nativeSetEditableSelectionOffsets(long nativeImeAdapterAndroid, - int start, int end); + private native void nativeSetEditableSelectionOffsets( + long nativeImeAdapterAndroid, int start, int end); private native void nativeSetComposingRegion(long nativeImeAdapterAndroid, int start, int end); - private native void nativeDeleteSurroundingText(long nativeImeAdapterAndroid, - int before, int after); + private native void nativeDeleteSurroundingText( + long nativeImeAdapterAndroid, int before, int after); private native void nativeDeleteSurroundingTextInCodePoints( long nativeImeAdapterAndroid, int before, int after); private native boolean nativeRequestTextInputStateUpdate(long nativeImeAdapterAndroid); - private native void nativeRequestCursorUpdate(long nativeImeAdapterAndroid, - boolean immediateRequest, boolean monitorRequest); + private native void nativeRequestCursorUpdate( + long nativeImeAdapterAndroid, boolean immediateRequest, boolean monitorRequest); private native void nativeAdvanceFocusInForm(long nativeImeAdapterAndroid, int focusType); }
diff --git a/content/public/android/java/src/org/chromium/content/browser/input/ThreadedInputConnection.java b/content/public/android/java/src/org/chromium/content/browser/input/ThreadedInputConnection.java index 6b94b16..3f2f81f 100644 --- a/content/public/android/java/src/org/chromium/content/browser/input/ThreadedInputConnection.java +++ b/content/public/android/java/src/org/chromium/content/browser/input/ThreadedInputConnection.java
@@ -79,7 +79,7 @@ } }; - private final ImeAdapter mImeAdapter; + private final ImeAdapterImpl mImeAdapter; private final Handler mHandler; private int mNumNestedBatchEdits; @@ -91,7 +91,7 @@ private int mCurrentExtractedTextRequestToken; private boolean mShouldUpdateExtractedText; - ThreadedInputConnection(View view, ImeAdapter imeAdapter, Handler handler) { + ThreadedInputConnection(View view, ImeAdapterImpl imeAdapter, Handler handler) { super(view, true); if (DEBUG_LOGS) Log.i(TAG, "constructor"); ImeUtils.checkOnUiThread();
diff --git a/content/public/android/java/src/org/chromium/content/browser/input/ThreadedInputConnectionFactory.java b/content/public/android/java/src/org/chromium/content/browser/input/ThreadedInputConnectionFactory.java index 49c1b6f..28c9d1bf 100644 --- a/content/public/android/java/src/org/chromium/content/browser/input/ThreadedInputConnectionFactory.java +++ b/content/public/android/java/src/org/chromium/content/browser/input/ThreadedInputConnectionFactory.java
@@ -107,8 +107,8 @@ } @Override - public ThreadedInputConnection initializeAndGet(View view, ImeAdapter imeAdapter, int inputType, - int inputFlags, int inputMode, int selectionStart, int selectionEnd, + public ThreadedInputConnection initializeAndGet(View view, ImeAdapterImpl imeAdapter, + int inputType, int inputFlags, int inputMode, int selectionStart, int selectionEnd, EditorInfo outAttrs) { ImeUtils.checkOnUiThread();
diff --git a/content/public/android/java/src/org/chromium/content_public/browser/ImeAdapter.java b/content/public/android/java/src/org/chromium/content_public/browser/ImeAdapter.java new file mode 100644 index 0000000..ec1e761 --- /dev/null +++ b/content/public/android/java/src/org/chromium/content_public/browser/ImeAdapter.java
@@ -0,0 +1,68 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.content_public.browser; + +import android.os.ResultReceiver; +import android.view.inputmethod.EditorInfo; +import android.view.inputmethod.InputConnection; + +import org.chromium.base.VisibleForTesting; +import org.chromium.content.browser.input.ImeAdapterImpl; +import org.chromium.content.browser.input.InputMethodManagerWrapper; + +/** + * Adapts and plumbs android IME service onto the chrome text input API. + */ +public interface ImeAdapter { + /** Composition key code sent when user either hit a key or hit a selection. */ + @VisibleForTesting + static final int COMPOSITION_KEY_CODE = 229; + + /** + * @param webContents {@link WebContents} object. + * @return {@link ImeAdapter} object used for the give WebContents. + * {@code null} if not available. + */ + static ImeAdapter fromWebContents(WebContents webContents) { + return ImeAdapterImpl.fromWebContents(webContents); + } + + /** + * Add {@link ImeEventObserver} object to {@link ImeAdapter}. + * @param observer imeEventObserver instance to add. + */ + void addEventObserver(ImeEventObserver observer); + + /** + * @see View#onCreateInputConnection(EditorInfo) + */ + InputConnection onCreateInputConnection(EditorInfo outAttrs); + + /** + * @see View#onCheckIsTextEditor() + */ + boolean onCheckIsTextEditor(); + + /** + * @return a newly instantiated {@link ResultReceiver} used to scroll to the editable + * node at the right timing. + */ + @VisibleForTesting + ResultReceiver getNewShowKeyboardReceiver(); + + /** + * Get the current input connection for testing purposes. + */ + @VisibleForTesting + InputConnection getInputConnectionForTest(); + + /** + * Overrides the InputMethodManagerWrapper that ImeAdapter uses to make calls to + * InputMethodManager. + * @param immw InputMethodManagerWrapper that should be used to call InputMethodManager. + */ + @VisibleForTesting + void setInputMethodManagerWrapperForTest(InputMethodManagerWrapper immw); +}
diff --git a/content/public/android/java/src/org/chromium/content_public/browser/ImeEventObserver.java b/content/public/android/java/src/org/chromium/content_public/browser/ImeEventObserver.java index 60daa57..d3502437 100644 --- a/content/public/android/java/src/org/chromium/content_public/browser/ImeEventObserver.java +++ b/content/public/android/java/src/org/chromium/content_public/browser/ImeEventObserver.java
@@ -13,18 +13,18 @@ /** * Called to notify the delegate about synthetic/real key events before sending to renderer. */ - void onImeEvent(); + default void onImeEvent() {} /** * Called when the focused node attribute is updated. * @param editable {@code true} if the node becomes editable; else {@code false}. * @param password indicates the node is of type password if {@code true}. */ - void onNodeAttributeUpdated(boolean editable, boolean password); + default void onNodeAttributeUpdated(boolean editable, boolean password) {} /** * Called to notify the delegate that an IME called InputConnection#sendKeyEvent(). * @param event The event passed to InputConnection#sendKeyEvent(). */ - void onBeforeSendKeyEvent(KeyEvent event); + default void onBeforeSendKeyEvent(KeyEvent event) {} }
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/ContentViewCoreSelectionTest.java b/content/public/android/javatests/src/org/chromium/content/browser/ContentViewCoreSelectionTest.java index 157d1b83e6..f9f3923 100644 --- a/content/public/android/javatests/src/org/chromium/content/browser/ContentViewCoreSelectionTest.java +++ b/content/public/android/javatests/src/org/chromium/content/browser/ContentViewCoreSelectionTest.java
@@ -31,6 +31,7 @@ import org.chromium.content.browser.test.util.Criteria; import org.chromium.content.browser.test.util.CriteriaHelper; import org.chromium.content.browser.test.util.DOMUtils; +import org.chromium.content_public.browser.ImeAdapter; import org.chromium.content_public.browser.SelectionClient; import org.chromium.content_shell_apk.ContentShellActivityTestRule; @@ -636,7 +637,9 @@ private CharSequence getTextBeforeCursor(final int length, final int flags) { final ChromiumBaseInputConnection connection = - mContentViewCore.getImeAdapterForTest().getInputConnectionForTest(); + (ChromiumBaseInputConnection) ImeAdapter + .fromWebContents(mContentViewCore.getWebContents()) + .getInputConnectionForTest(); return ImeTestUtils.runBlockingOnHandlerNoException( connection.getHandler(), new Callable<CharSequence>() { @Override
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/PopupZoomerTest.java b/content/public/android/javatests/src/org/chromium/content/browser/PopupZoomerTest.java index 00f6834..312a5233 100644 --- a/content/public/android/javatests/src/org/chromium/content/browser/PopupZoomerTest.java +++ b/content/public/android/javatests/src/org/chromium/content/browser/PopupZoomerTest.java
@@ -23,11 +23,11 @@ import org.chromium.base.ThreadUtils; import org.chromium.base.test.util.Feature; -import org.chromium.content.browser.input.ImeAdapter; import org.chromium.content.browser.input.TextSuggestionHost; import org.chromium.content.browser.test.ContentJUnit4ClassRunner; import org.chromium.content.browser.test.util.TestInputMethodManagerWrapper; import org.chromium.content.browser.webcontents.WebContentsImpl; +import org.chromium.content_public.browser.ImeAdapter; import org.chromium.content_public.browser.WebContents; import org.chromium.content_shell_apk.ContentShellActivityTestRule; @@ -106,8 +106,9 @@ mContentViewCore = (ContentViewCoreImpl) ContentViewCore.create(context, ""); mContentViewCore.setWebContentsForTesting((WebContentsImpl) webContents); ViewGroup containerView = mActivityTestRule.getContentViewCore().getContainerView(); - mContentViewCore.setImeAdapterForTest(new ImeAdapter(webContents, containerView, - new TestInputMethodManagerWrapper(mContentViewCore))); + ImeAdapter imeAdapter = ImeAdapter.fromWebContents(webContents); + imeAdapter.setInputMethodManagerWrapperForTest( + TestInputMethodManagerWrapper.create(imeAdapter)); mPopupZoomer = createPopupZoomerForTest( InstrumentationRegistry.getTargetContext(), webContents, containerView); mContentViewCore.setPopupZoomerForTest(mPopupZoomer);
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/input/ImeActivityTestRule.java b/content/public/android/javatests/src/org/chromium/content/browser/input/ImeActivityTestRule.java index f494d09..19eaea6 100644 --- a/content/public/android/javatests/src/org/chromium/content/browser/input/ImeActivityTestRule.java +++ b/content/public/android/javatests/src/org/chromium/content/browser/input/ImeActivityTestRule.java
@@ -28,6 +28,8 @@ import org.chromium.content.browser.test.util.JavaScriptUtils; import org.chromium.content.browser.test.util.TestCallbackHelperContainer; import org.chromium.content.browser.test.util.TestInputMethodManagerWrapper; +import org.chromium.content.browser.test.util.TestInputMethodManagerWrapper.InputConnectionProvider; +import org.chromium.content_public.browser.ImeAdapter; import org.chromium.content_public.browser.WebContents; import org.chromium.content_shell_apk.ContentShellActivityTestRule; import org.chromium.ui.base.ime.TextInputType; @@ -45,7 +47,7 @@ class ImeActivityTestRule extends ContentShellActivityTestRule { private ChromiumBaseInputConnection mConnection; private TestInputConnectionFactory mConnectionFactory; - private ImeAdapter mImeAdapter; + private ImeAdapterImpl mImeAdapter; static final String INPUT_FORM_HTML = "content/test/data/android/input/input_forms.html"; static final String PASSWORD_FORM_HTML = "content/test/data/android/input/password_form.html"; @@ -60,7 +62,11 @@ mContentViewCore = getContentViewCore(); mSelectionPopupController = SelectionPopupControllerImpl.fromWebContents(mContentViewCore.getWebContents()); - mInputMethodManagerWrapper = new TestInputMethodManagerWrapper(mContentViewCore) { + + final ImeAdapter imeAdapter = getImeAdapter(); + InputConnectionProvider provider = + TestInputMethodManagerWrapper.defaultInputConnectionProvider(imeAdapter); + mInputMethodManagerWrapper = new TestInputMethodManagerWrapper(provider) { private boolean mExpectsSelectionOutsideComposition; @Override @@ -285,8 +291,8 @@ }); } - ImeAdapter getImeAdapter() { - return mContentViewCore.getImeAdapterForTest(); + ImeAdapterImpl getImeAdapter() { + return ImeAdapterImpl.fromWebContents(getWebContents()); } ChromiumBaseInputConnection getInputConnection() { @@ -294,7 +300,8 @@ return ThreadUtils.runOnUiThreadBlocking(new Callable<ChromiumBaseInputConnection>() { @Override public ChromiumBaseInputConnection call() { - return mContentViewCore.getImeAdapterForTest().getInputConnectionForTest(); + return (ChromiumBaseInputConnection) getImeAdapter() + .getInputConnectionForTest(); } }); } catch (ExecutionException e) { @@ -571,7 +578,7 @@ } @Override - public ChromiumBaseInputConnection initializeAndGet(View view, ImeAdapter imeAdapter, + public ChromiumBaseInputConnection initializeAndGet(View view, ImeAdapterImpl imeAdapter, int inputType, int inputFlags, int inputMode, int selectionStart, int selectionEnd, EditorInfo outAttrs) { mTextInputTypeList.add(inputType);
diff --git a/content/public/android/junit/src/org/chromium/content/browser/input/ThreadedInputConnectionFactoryTest.java b/content/public/android/junit/src/org/chromium/content/browser/input/ThreadedInputConnectionFactoryTest.java index 38867f7..bfaf3052 100644 --- a/content/public/android/junit/src/org/chromium/content/browser/input/ThreadedInputConnectionFactoryTest.java +++ b/content/public/android/junit/src/org/chromium/content/browser/input/ThreadedInputConnectionFactoryTest.java
@@ -95,7 +95,7 @@ } @Mock - private ImeAdapter mImeAdapter; + private ImeAdapterImpl mImeAdapter; @Mock private View mContainerView; @Mock @@ -123,7 +123,7 @@ mContext = Mockito.mock(Context.class); mContainerView = Mockito.mock(View.class); - mImeAdapter = Mockito.mock(ImeAdapter.class); + mImeAdapter = Mockito.mock(ImeAdapterImpl.class); mInputMethodManager = Mockito.mock(InputMethodManager.class); mFactory = new TestFactory(new InputMethodManagerWrapper(mContext));
diff --git a/content/public/android/junit/src/org/chromium/content/browser/input/ThreadedInputConnectionTest.java b/content/public/android/junit/src/org/chromium/content/browser/input/ThreadedInputConnectionTest.java index 203eee6..1e9e346 100644 --- a/content/public/android/junit/src/org/chromium/content/browser/input/ThreadedInputConnectionTest.java +++ b/content/public/android/junit/src/org/chromium/content/browser/input/ThreadedInputConnectionTest.java
@@ -47,7 +47,8 @@ @RunWith(LocalRobolectricTestRunner.class) @Config(manifest = Config.NONE) public class ThreadedInputConnectionTest { - @Mock ImeAdapter mImeAdapter; + @Mock + ImeAdapterImpl mImeAdapter; ThreadedInputConnection mConnection; InOrder mInOrder; @@ -59,7 +60,7 @@ public void setUp() throws Exception { MockitoAnnotations.initMocks(this); - mImeAdapter = Mockito.mock(ImeAdapter.class); + mImeAdapter = Mockito.mock(ImeAdapterImpl.class); mInOrder = inOrder(mImeAdapter); // Mocks required to create a ThreadedInputConnection object
diff --git a/content/public/browser/BUILD.gn b/content/public/browser/BUILD.gn index 7e7cd26..43764ce 100644 --- a/content/public/browser/BUILD.gn +++ b/content/public/browser/BUILD.gn
@@ -314,6 +314,7 @@ "//ipc", "//mojo/public/cpp/bindings", "//mojo/public/cpp/system", + "//services/network/public/interfaces", "//services/resource_coordinator/public/cpp:resource_coordinator_cpp", "//services/service_manager/public/cpp",
diff --git a/content/public/browser/browsing_data_remover.h b/content/public/browser/browsing_data_remover.h index 6414b28..f672bcc 100644 --- a/content/public/browser/browsing_data_remover.h +++ b/content/public/browser/browsing_data_remover.h
@@ -96,8 +96,14 @@ // prohibited from deleting history or downloads. DATA_TYPE_NO_CHECKS = 1 << 13, + // AVOID_CLOSING_CONNECTIONS is a pseudo-datatype indicating that when + // deleting COOKIES and CHANNEL IDs, BrowsingDataRemover should skip + // storage backends whose deletion would cause closing network connections. + // TODO(crbug.com/798760): Remove when fixed. + DATA_TYPE_AVOID_CLOSING_CONNECTIONS = 1 << 14, + // Embedders can add more datatypes beyond this point. - DATA_TYPE_CONTENT_END = DATA_TYPE_NO_CHECKS, + DATA_TYPE_CONTENT_END = DATA_TYPE_AVOID_CLOSING_CONNECTIONS, }; enum OriginType {
diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc index 3cb34e7..2e6eff5 100644 --- a/content/public/browser/content_browser_client.cc +++ b/content/public/browser/content_browser_client.cc
@@ -579,16 +579,16 @@ const GURL& frame_url, NonNetworkURLLoaderFactoryMap* factories) {} -mojom::NetworkContextPtr ContentBrowserClient::CreateNetworkContext( +network::mojom::NetworkContextPtr ContentBrowserClient::CreateNetworkContext( BrowserContext* context, bool in_memory, const base::FilePath& relative_partition_path) { if (!base::FeatureList::IsEnabled(features::kNetworkService)) return nullptr; - mojom::NetworkContextPtr network_context; - mojom::NetworkContextParamsPtr context_params = - mojom::NetworkContextParams::New(); + network::mojom::NetworkContextPtr network_context; + network::mojom::NetworkContextParamsPtr context_params = + network::mojom::NetworkContextParams::New(); context_params->enable_data_url_support = true; context_params->enable_file_url_support = true; GetNetworkService()->CreateNetworkContext(MakeRequest(&network_context),
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h index c3c6502..18767b60 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h
@@ -22,7 +22,6 @@ #include "content/public/browser/navigation_throttle.h" #include "content/public/common/content_client.h" #include "content/public/common/media_stream_request.h" -#include "content/public/common/network_service.mojom.h" #include "content/public/common/resource_type.h" #include "content/public/common/socket_permission_request.h" #include "content/public/common/window_container_type.mojom.h" @@ -32,6 +31,7 @@ #include "media/mojo/interfaces/remoting.mojom.h" #include "net/base/mime_util.h" #include "net/cookies/canonical_cookie.h" +#include "services/network/public/interfaces/network_service.mojom.h" #include "services/service_manager/embedder/embedded_service_info.h" #include "services/service_manager/public/cpp/binder_registry.h" #include "services/service_manager/sandbox/sandbox_type.h" @@ -95,6 +95,12 @@ class URLRequestContextGetter; } // namespace net +namespace network { +namespace mojom { +class NetworkContext; +} +} // namespace network + namespace rappor { class RapporService; } @@ -150,10 +156,6 @@ struct Referrer; struct WebPreferences; -namespace mojom { -class NetworkContext; -} - CONTENT_EXPORT void OverrideOnBindInterface( const service_manager::BindSourceInfo& remote_info, const std::string& name, @@ -973,7 +975,7 @@ // // If |relative_partition_path| is the empty string, it means this needs to // create the default NetworkContext for the BrowserContext. - virtual mojom::NetworkContextPtr CreateNetworkContext( + virtual network::mojom::NetworkContextPtr CreateNetworkContext( BrowserContext* context, bool in_memory, const base::FilePath& relative_partition_path);
diff --git a/content/public/browser/network_service_instance.h b/content/public/browser/network_service_instance.h index c15aba87..d3268a0 100644 --- a/content/public/browser/network_service_instance.h +++ b/content/public/browser/network_service_instance.h
@@ -7,12 +7,14 @@ #include "content/common/content_export.h" -namespace content { -class NetworkService; - +namespace network { namespace mojom { class NetworkService; } +} // namespace network + +namespace content { +class NetworkService; // Returns a pointer to the NetworkService, creating / re-creating it as needed. // NetworkService will be running in-process if @@ -20,7 +22,7 @@ // 2) kNetworkService and kNetworkServiceInProcess are enabled // Otherwise it runs out of process. // This method can only be called on the UI thread. -CONTENT_EXPORT mojom::NetworkService* GetNetworkService(); +CONTENT_EXPORT network::mojom::NetworkService* GetNetworkService(); // When network service is disabled, returns the in-process NetworkService // pointer which is used to ease transition to network service.
diff --git a/content/public/browser/storage_partition.h b/content/public/browser/storage_partition.h index 9698d33c..9bf0a87 100644 --- a/content/public/browser/storage_partition.h +++ b/content/public/browser/storage_partition.h
@@ -32,6 +32,7 @@ namespace network { namespace mojom { class CookieManager; +class NetworkContext; class URLLoaderFactory; } } // namespace network @@ -62,10 +63,6 @@ class ZoomLevelDelegate; #endif // !defined(OS_ANDROID) -namespace mojom { -class NetworkContext; -} - // Defines what persistent state a child process can access. // // The StoragePartition defines the view each child process has of the @@ -77,7 +74,7 @@ virtual base::FilePath GetPath() = 0; virtual net::URLRequestContextGetter* GetURLRequestContext() = 0; virtual net::URLRequestContextGetter* GetMediaURLRequestContext() = 0; - virtual mojom::NetworkContext* GetNetworkContext() = 0; + virtual network::mojom::NetworkContext* GetNetworkContext() = 0; // Returns a pointer to a URLLoaderFactory/CookieManager owned by the // storage partition. Prefer to use this instead of creating a new // URLLoaderFactory when issuing requests from the Browser process, to
diff --git a/content/public/common/BUILD.gn b/content/public/common/BUILD.gn index 84d3212..3898737 100644 --- a/content/public/common/BUILD.gn +++ b/content/public/common/BUILD.gn
@@ -369,8 +369,6 @@ "appcache_info.mojom", "download_stream.mojom", "fullscreen_video_element.mojom", - "network_service.mojom", - "network_service_test.mojom", "push_messaging_status.mojom", "webplugininfo.mojom", "window_container_type.mojom", @@ -380,7 +378,6 @@ ":resource_type_bindings", "//mojo/common:common_custom_types", "//services/network/public/interfaces", - "//services/proxy_resolver/public/interfaces", "//url/mojo:url_mojom_gurl", "//url/mojo:url_mojom_origin", ]
diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc index e1bdfee..986e4bb 100644 --- a/content/public/common/content_switches.cc +++ b/content/public/common/content_switches.cc
@@ -624,9 +624,6 @@ // automated testing. const char kMuteAudio[] = "mute-audio"; -// Don't send HTTP-Referer headers. -const char kNoReferrers[] = "no-referrers"; - // Disables the sandbox for all process types that are normally sandboxed. const char kNoSandbox[] = "no-sandbox";
diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h index ddfb951..f9ae1f311 100644 --- a/content/public/common/content_switches.h +++ b/content/public/common/content_switches.h
@@ -183,7 +183,6 @@ CONTENT_EXPORT extern const char kMHTMLSkipNostoreAll[]; CONTENT_EXPORT extern const char kMojoLocalStorage[]; CONTENT_EXPORT extern const char kMuteAudio[]; -CONTENT_EXPORT extern const char kNoReferrers[]; CONTENT_EXPORT extern const char kNoSandbox[]; CONTENT_EXPORT extern const char kNoZygote[]; CONTENT_EXPORT extern const char kEnableAppContainer[];
diff --git a/content/public/common/network_connection_tracker.cc b/content/public/common/network_connection_tracker.cc index cbe277a5..a63fdb7 100644 --- a/content/public/common/network_connection_tracker.cc +++ b/content/public/common/network_connection_tracker.cc
@@ -8,8 +8,8 @@ #include "base/task_runner.h" #include "base/threading/thread_task_runner_handle.h" -#include "content/public/common/network_service.mojom.h" #include "services/network/public/interfaces/network_change_manager.mojom.h" +#include "services/network/public/interfaces/network_service.mojom.h" namespace content { @@ -44,7 +44,7 @@ binding_(this) {} void NetworkConnectionTracker::Initialize( - mojom::NetworkService* network_service) { + network::mojom::NetworkService* network_service) { DCHECK(!binding_.is_bound()); DCHECK(network_service); // Get NetworkChangeManagerPtr.
diff --git a/content/public/common/network_connection_tracker.h b/content/public/common/network_connection_tracker.h index 541a78fe..fa28b37 100644 --- a/content/public/common/network_connection_tracker.h +++ b/content/public/common/network_connection_tracker.h
@@ -15,10 +15,10 @@ #include "base/observer_list_threadsafe.h" #include "base/synchronization/lock.h" #include "content/common/content_export.h" -#include "content/public/common/network_service.mojom.h" #include "mojo/public/cpp/bindings/binding.h" #include "mojo/public/cpp/bindings/binding_set.h" #include "services/network/public/interfaces/network_change_manager.mojom.h" +#include "services/network/public/interfaces/network_service.mojom.h" namespace content { @@ -56,7 +56,7 @@ // this class can be subclassed, and OnInitialConnectionType / // OnNetworkChanged may be called directly, instead of providing a // NetworkService. - void Initialize(mojom::NetworkService* network_service); + void Initialize(network::mojom::NetworkService* network_service); // If connection type can be retrieved synchronously, returns true and |type| // will contain the current connection type; Otherwise, returns false, in
diff --git a/content/public/common/network_connection_tracker_unittest.cc b/content/public/common/network_connection_tracker_unittest.cc index 327f145..07787b1 100644 --- a/content/public/common/network_connection_tracker_unittest.cc +++ b/content/public/common/network_connection_tracker_unittest.cc
@@ -128,8 +128,8 @@ class NetworkConnectionTrackerTest : public testing::Test { public: NetworkConnectionTrackerTest() { - mojom::NetworkServicePtr network_service_ptr; - mojom::NetworkServiceRequest network_service_request = + network::mojom::NetworkServicePtr network_service_ptr; + network::mojom::NetworkServiceRequest network_service_request = mojo::MakeRequest(&network_service_ptr); network_service_ = NetworkService::Create(std::move(network_service_request), @@ -219,8 +219,8 @@ SetConnectionType(net::NetworkChangeNotifier::ConnectionType::CONNECTION_3G); // Creates a new NetworkService so it initializes a NetworkChangeManager // with initial connection type as CONNECTION_3G. - mojom::NetworkServicePtr network_service_ptr; - mojom::NetworkServiceRequest network_service_request = + network::mojom::NetworkServicePtr network_service_ptr; + network::mojom::NetworkServiceRequest network_service_request = mojo::MakeRequest(&network_service_ptr); std::unique_ptr<NetworkService> network_service = NetworkService::Create(std::move(network_service_request), nullptr);
diff --git a/content/public/common/referrer.cc b/content/public/common/referrer.cc index 152211cc..98498699 100644 --- a/content/public/common/referrer.cc +++ b/content/public/common/referrer.cc
@@ -7,8 +7,8 @@ #include <string> #include "base/command_line.h" -#include "content/common/loader_util.h" #include "content/public/common/content_switches.h" +#include "services/network/public/cpp/loader_util.h" namespace content { @@ -87,7 +87,7 @@ // static void Referrer::SetReferrerForRequest(net::URLRequest* request, const Referrer& referrer) { - request->SetReferrer(ComputeReferrer(referrer.url)); + request->SetReferrer(network::ComputeReferrer(referrer.url)); request->set_referrer_policy(ReferrerPolicyForUrlRequest(referrer.policy)); }
diff --git a/content/public/common/simple_url_loader_unittest.cc b/content/public/common/simple_url_loader_unittest.cc index c2ec396d..0781da7 100644 --- a/content/public/common/simple_url_loader_unittest.cc +++ b/content/public/common/simple_url_loader_unittest.cc
@@ -25,7 +25,6 @@ #include "base/strings/string_number_conversions.h" #include "base/strings/stringprintf.h" #include "base/test/scoped_task_environment.h" -#include "content/public/common/network_service.mojom.h" #include "content/public/common/service_manager_connection.h" #include "content/public/common/service_names.mojom.h" #include "content/public/network/network_service.h" @@ -45,6 +44,7 @@ #include "services/network/public/cpp/resource_request.h" #include "services/network/public/cpp/resource_response.h" #include "services/network/public/cpp/url_loader_completion_status.h" +#include "services/network/public/interfaces/network_service.mojom.h" #include "services/network/public/interfaces/url_loader_factory.mojom.h" #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h" @@ -378,14 +378,14 @@ SimpleURLLoaderTestBase() : scoped_task_environment_( base::test::ScopedTaskEnvironment::MainThreadType::IO) { - mojom::NetworkServicePtr network_service_ptr; - mojom::NetworkServiceRequest network_service_request = + network::mojom::NetworkServicePtr network_service_ptr; + network::mojom::NetworkServiceRequest network_service_request = mojo::MakeRequest(&network_service_ptr); network_service_ = NetworkService::Create(std::move(network_service_request), /*netlog=*/nullptr); - mojom::NetworkContextParamsPtr context_params = - mojom::NetworkContextParams::New(); + network::mojom::NetworkContextParamsPtr context_params = + network::mojom::NetworkContextParams::New(); context_params->enable_data_url_support = true; network_service_ptr->CreateNetworkContext( mojo::MakeRequest(&network_context_), std::move(context_params)); @@ -429,8 +429,8 @@ protected: base::test::ScopedTaskEnvironment scoped_task_environment_; - std::unique_ptr<mojom::NetworkService> network_service_; - mojom::NetworkContextPtr network_context_; + std::unique_ptr<network::mojom::NetworkService> network_service_; + network::mojom::NetworkContextPtr network_context_; network::mojom::URLLoaderFactoryPtr url_loader_factory_; net::test_server::EmbeddedTestServer test_server_;
diff --git a/content/public/network/network_service.h b/content/public/network/network_service.h index b69277c..49e6f95c 100644 --- a/content/public/network/network_service.h +++ b/content/public/network/network_service.h
@@ -8,7 +8,7 @@ #include <memory> #include "content/common/content_export.h" -#include "content/public/common/network_service.mojom.h" +#include "services/network/public/interfaces/network_service.mojom.h" namespace net { class NetLog; @@ -20,7 +20,7 @@ class URLRequestContextBuilderMojo; // Allows an in-process NetworkService to be set up. -class CONTENT_EXPORT NetworkService : public mojom::NetworkService { +class CONTENT_EXPORT NetworkService : public network::mojom::NetworkService { public: // Creates a NetworkService instance on the current thread, optionally using // the passed-in NetLog. Does not take ownership of |net_log|. Must be @@ -29,7 +29,7 @@ // TODO(https://crbug.com/767450): Make it so NetworkService can always create // its own NetLog, instead of sharing one. static std::unique_ptr<NetworkService> Create( - mojom::NetworkServiceRequest request, + network::mojom::NetworkServiceRequest request, net::NetLog* net_log = nullptr); // Can be used to seed a NetworkContext with a consumer-configured @@ -42,10 +42,10 @@ // This method is intended to ease the transition to an out-of-process // NetworkService, and will be removed once that ships. It should only be // called if the network service is disabled. - virtual std::unique_ptr<mojom::NetworkContext> + virtual std::unique_ptr<network::mojom::NetworkContext> CreateNetworkContextWithBuilder( - mojom::NetworkContextRequest request, - mojom::NetworkContextParamsPtr params, + network::mojom::NetworkContextRequest request, + network::mojom::NetworkContextParamsPtr params, std::unique_ptr<URLRequestContextBuilderMojo> builder, net::URLRequestContext** url_request_context) = 0;
diff --git a/content/public/network/url_request_context_builder_mojo.h b/content/public/network/url_request_context_builder_mojo.h index 1c097516..98f2a4b 100644 --- a/content/public/network/url_request_context_builder_mojo.h +++ b/content/public/network/url_request_context_builder_mojo.h
@@ -10,10 +10,10 @@ #include "base/macros.h" #include "build/build_config.h" #include "content/common/content_export.h" -#include "content/public/common/network_service.mojom.h" #include "content/public/network/url_request_context_owner.h" #include "net/proxy/dhcp_proxy_script_fetcher_factory.h" #include "net/url_request/url_request_context_builder.h" +#include "services/network/public/interfaces/network_service.mojom.h" #include "services/proxy_resolver/public/interfaces/proxy_resolver.mojom.h" namespace net { @@ -54,7 +54,7 @@ // // This method is intended to ease the transition to an out-of-process // NetworkService, and will be removed once that ships. - URLRequestContextOwner Create(mojom::NetworkContextParams* params, + URLRequestContextOwner Create(network::mojom::NetworkContextParams* params, bool quic_disabled, net::NetLog* net_log);
diff --git a/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/TestContentViewCore.java b/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/TestContentViewCore.java index 8ec1ebb..5d3ac204 100644 --- a/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/TestContentViewCore.java +++ b/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/TestContentViewCore.java
@@ -12,8 +12,6 @@ import android.view.ViewGroup; import android.view.ViewStructure; import android.view.accessibility.AccessibilityNodeProvider; -import android.view.inputmethod.EditorInfo; -import android.view.inputmethod.InputConnection; import org.chromium.base.VisibleForTesting; import org.chromium.content.browser.ContentViewCore; @@ -21,10 +19,8 @@ import org.chromium.content.browser.PopupZoomer; import org.chromium.content.browser.WindowAndroidChangedObserver; import org.chromium.content.browser.accessibility.WebContentsAccessibility; -import org.chromium.content.browser.input.ImeAdapter; import org.chromium.content.browser.input.SelectPopup; import org.chromium.content.browser.input.TextSuggestionHost; -import org.chromium.content_public.browser.ImeEventObserver; import org.chromium.content_public.browser.WebContents; import org.chromium.ui.base.ViewAndroidDelegate; import org.chromium.ui.base.WindowAndroid; @@ -71,18 +67,6 @@ public void removeWindowAndroidChangedObserver(WindowAndroidChangedObserver observer) {} @Override - public void addImeEventObserver(ImeEventObserver imeEventObserver) {} - - @Override - public void setImeAdapterForTest(ImeAdapter imeAdapter) {} - - @VisibleForTesting - @Override - public ImeAdapter getImeAdapterForTest() { - return null; - } - - @Override public void initialize(ViewAndroidDelegate viewDelegate, InternalAccessDelegate internalDispatcher, WebContents webContents, WindowAndroid windowAndroid) {} @@ -155,16 +139,6 @@ public void onDetachedFromWindow() {} @Override - public InputConnection onCreateInputConnection(EditorInfo outAttrs) { - return null; - } - - @Override - public boolean onCheckIsTextEditor() { - return false; - } - - @Override public void onConfigurationChanged(Configuration newConfig) {} @Override
diff --git a/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/TestInputMethodManagerWrapper.java b/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/TestInputMethodManagerWrapper.java index dfe5e555d..85aa32b 100644 --- a/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/TestInputMethodManagerWrapper.java +++ b/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/TestInputMethodManagerWrapper.java
@@ -14,9 +14,9 @@ import org.chromium.base.Log; import org.chromium.base.annotations.UsedByReflection; -import org.chromium.content.browser.ContentViewCore; import org.chromium.content.browser.input.InputMethodManagerWrapper; import org.chromium.content.browser.input.Range; +import org.chromium.content_public.browser.ImeAdapter; import java.util.ArrayList; import java.util.List; @@ -28,7 +28,7 @@ public class TestInputMethodManagerWrapper extends InputMethodManagerWrapper { private static final String TAG = "cr_Ime"; - private final ContentViewCore mContentViewCore; + private final InputConnectionProvider mInputConnectionProvider; private InputConnection mInputConnection; private int mRestartInputCounter; private int mShowSoftInputCounter; @@ -41,10 +41,43 @@ private CursorAnchorInfo mLastCursorAnchorInfo; private final ArrayList<EditorInfo> mEditorInfoList = new ArrayList<>(); - public TestInputMethodManagerWrapper(ContentViewCore contentViewCore) { + /** + * Interface passed that helps this class create {@link InputConnection} instance. + * This helps the wrapper avoid cross-reference {@link ImeAdapter} object. + */ + public interface InputConnectionProvider { + /* + * @param info {@link EditInfo} object used to create a new {@link InputConnection}. + * @return a newly created {@link InputConnection} instance. + */ + InputConnection create(EditorInfo info); + } + + /** + * Default {@InputConnectionProvider} that uses a given {@link ImeAdapter} to create {@link + * InputConnection}. + */ + public static InputConnectionProvider defaultInputConnectionProvider( + final ImeAdapter imeAdapter) { + return new InputConnectionProvider() { + @Override + public InputConnection create(EditorInfo info) { + return imeAdapter.onCreateInputConnection(info); + } + }; + } + + /** + * Default {@link TestInputMethodManagerWrapper} instance good enough for most of test cases. + */ + public static TestInputMethodManagerWrapper create(ImeAdapter imeAdapter) { + return new TestInputMethodManagerWrapper(defaultInputConnectionProvider(imeAdapter)); + } + + public TestInputMethodManagerWrapper(InputConnectionProvider provider) { super(null); Log.d(TAG, "TestInputMethodManagerWrapper constructor"); - mContentViewCore = contentViewCore; + mInputConnectionProvider = provider; mUpdateSelectionList = new ArrayList<>(); } @@ -53,7 +86,7 @@ mRestartInputCounter++; Log.d(TAG, "restartInput: count [%d]", mRestartInputCounter); EditorInfo editorInfo = new EditorInfo(); - mInputConnection = mContentViewCore.onCreateInputConnection(editorInfo); + mInputConnection = mInputConnectionProvider.create(editorInfo); mEditorInfoList.add(editorInfo); } @@ -64,7 +97,7 @@ Log.d(TAG, "showSoftInput: count [%d]", mShowSoftInputCounter); if (mInputConnection != null) return; EditorInfo editorInfo = new EditorInfo(); - mInputConnection = mContentViewCore.onCreateInputConnection(editorInfo); + mInputConnection = mInputConnectionProvider.create(editorInfo); mEditorInfoList.add(editorInfo); }
diff --git a/content/public/test/browser_test_base.cc b/content/public/test/browser_test_base.cc index 16ee8fce1..00f5f4c3 100644 --- a/content/public/test/browser_test_base.cc +++ b/content/public/test/browser_test_base.cc
@@ -31,7 +31,6 @@ #include "content/public/common/content_features.h" #include "content/public/common/content_switches.h" #include "content/public/common/main_function_params.h" -#include "content/public/common/network_service_test.mojom.h" #include "content/public/common/service_manager_connection.h" #include "content/public/common/service_names.mojom.h" #include "content/public/test/browser_test_utils.h" @@ -41,6 +40,7 @@ #include "mojo/public/cpp/bindings/sync_call_restrictions.h" #include "net/dns/mock_host_resolver.h" #include "net/test/embedded_test_server/embedded_test_server.h" +#include "services/network/public/interfaces/network_service_test.mojom.h" #include "services/service_manager/embedder/switches.h" #include "services/service_manager/public/cpp/connector.h" #include "ui/base/platform_window_defaults.h" @@ -432,7 +432,7 @@ return; net::RuleBasedHostResolverProc::RuleList rules = host_resolver()->GetRules(); - std::vector<mojom::RulePtr> mojo_rules; + std::vector<network::mojom::RulePtr> mojo_rules; for (const auto& rule : rules) { // For now, this covers all the rules used in content's tests. // TODO(jam: expand this when we try to make browser_tests and @@ -444,7 +444,7 @@ rule.address_family != net::AddressFamily::ADDRESS_FAMILY_UNSPECIFIED || !!rule.latency_ms || rule.replacement.empty()) continue; - mojom::RulePtr mojo_rule = mojom::Rule::New(); + network::mojom::RulePtr mojo_rule = network::mojom::Rule::New(); mojo_rule->host_pattern = rule.host_pattern; mojo_rule->replacement = rule.replacement; mojo_rules.push_back(std::move(mojo_rule)); @@ -453,7 +453,7 @@ if (mojo_rules.empty()) return; - mojom::NetworkServiceTestPtr network_service_test; + network::mojom::NetworkServiceTestPtr network_service_test; ServiceManagerConnection::GetForProcess()->GetConnector()->BindInterface( mojom::kNetworkServiceName, &network_service_test); mojo::SyncCallRestrictions::ScopedAllowSyncCall allow_sync_call;
diff --git a/content/public/test/browser_test_utils.cc b/content/public/test/browser_test_utils.cc index ac0b19b..0762a43 100644 --- a/content/public/test/browser_test_utils.cc +++ b/content/public/test/browser_test_utils.cc
@@ -71,8 +71,6 @@ #include "content/public/browser/web_contents.h" #include "content/public/common/content_features.h" #include "content/public/common/content_switches.h" -#include "content/public/common/network_service.mojom.h" -#include "content/public/common/network_service_test.mojom.h" #include "content/public/common/service_names.mojom.h" #include "content/public/common/simple_url_loader.h" #include "content/public/test/simple_url_loader_test_helper.h" @@ -95,6 +93,8 @@ #include "net/url_request/url_request_context.h" #include "net/url_request/url_request_context_getter.h" #include "services/network/public/interfaces/cookie_manager.mojom.h" +#include "services/network/public/interfaces/network_service.mojom.h" +#include "services/network/public/interfaces/network_service_test.mojom.h" #include "services/service_manager/public/cpp/connector.h" #include "storage/browser/fileapi/file_system_context.h" #include "testing/gtest/include/gtest/gtest.h" @@ -2402,7 +2402,7 @@ CHECK(base::FeatureList::IsEnabled(features::kNetworkService)); CHECK(!IsNetworkServiceRunningInProcess()) << "Can't crash the network service if it's running in-process!"; - mojom::NetworkServiceTestPtr network_service_test; + network::mojom::NetworkServiceTestPtr network_service_test; ServiceManagerConnection::GetForProcess()->GetConnector()->BindInterface( mojom::kNetworkServiceName, &network_service_test); @@ -2416,7 +2416,7 @@ FlushNetworkServiceInstanceForTesting(); } -int LoadBasicRequest(mojom::NetworkContext* network_context, +int LoadBasicRequest(network::mojom::NetworkContext* network_context, const GURL& url, int process_id, int render_frame_id) {
diff --git a/content/public/test/browser_test_utils.h b/content/public/test/browser_test_utils.h index 660bdc0..30d6c0ef 100644 --- a/content/public/test/browser_test_utils.h +++ b/content/public/test/browser_test_utils.h
@@ -29,9 +29,9 @@ #include "content/public/browser/web_contents_delegate.h" #include "content/public/browser/web_contents_observer.h" #include "content/public/common/context_menu_params.h" -#include "content/public/common/network_service.mojom.h" #include "content/public/common/page_type.h" #include "ipc/message_filter.h" +#include "services/network/public/interfaces/network_service.mojom.h" #include "storage/common/fileapi/file_system_types.h" #include "third_party/WebKit/public/platform/WebInputEvent.h" #include "third_party/WebKit/public/platform/WebMouseEvent.h" @@ -1080,7 +1080,7 @@ void SimulateNetworkServiceCrash(); // Load the given |url| with |network_context| and return the |net::Error| code. -int LoadBasicRequest(mojom::NetworkContext* network_context, +int LoadBasicRequest(network::mojom::NetworkContext* network_context, const GURL& url, int process_id = 0, int render_frame_id = 0);
diff --git a/content/public/test/network_service_test_helper.cc b/content/public/test/network_service_test_helper.cc index e54d4a4..9d20932 100644 --- a/content/public/test/network_service_test_helper.cc +++ b/content/public/test/network_service_test_helper.cc
@@ -34,7 +34,7 @@ namespace content { class NetworkServiceTestHelper::NetworkServiceTestImpl - : public mojom::NetworkServiceTest { + : public network::mojom::NetworkServiceTest { public: NetworkServiceTestImpl() { if (base::CommandLine::ForCurrentProcess()->HasSwitch( @@ -48,8 +48,8 @@ NetworkContext::SetCertVerifierForTesting(nullptr); } - // mojom::NetworkServiceTest: - void AddRules(std::vector<mojom::RulePtr> rules, + // network::mojom::NetworkServiceTest: + void AddRules(std::vector<network::mojom::RulePtr> rules, AddRulesCallback callback) override { for (const auto& rule : rules) { test_host_resolver_.host_resolver()->AddRule(rule->host_pattern, @@ -92,12 +92,12 @@ std::move(callback).Run(); } - void BindRequest(mojom::NetworkServiceTestRequest request) { + void BindRequest(network::mojom::NetworkServiceTestRequest request) { bindings_.AddBinding(this, std::move(request)); } private: - mojo::BindingSet<mojom::NetworkServiceTest> bindings_; + mojo::BindingSet<network::mojom::NetworkServiceTest> bindings_; TestHostResolver test_host_resolver_; std::unique_ptr<net::MockCertVerifier> mock_cert_verifier_; @@ -138,7 +138,7 @@ } void NetworkServiceTestHelper::BindNetworkServiceTestRequest( - mojom::NetworkServiceTestRequest request) { + network::mojom::NetworkServiceTestRequest request) { network_service_test_impl_->BindRequest(std::move(request)); }
diff --git a/content/public/test/network_service_test_helper.h b/content/public/test/network_service_test_helper.h index 243e435f..48a9e2b7 100644 --- a/content/public/test/network_service_test_helper.h +++ b/content/public/test/network_service_test_helper.h
@@ -8,7 +8,7 @@ #include <memory> #include "base/macros.h" -#include "content/public/common/network_service_test.mojom.h" +#include "services/network/public/interfaces/network_service_test.mojom.h" #include "services/service_manager/public/cpp/binder_registry.h" namespace content { @@ -29,7 +29,8 @@ private: class NetworkServiceTestImpl; - void BindNetworkServiceTestRequest(mojom::NetworkServiceTestRequest request); + void BindNetworkServiceTestRequest( + network::mojom::NetworkServiceTestRequest request); std::unique_ptr<NetworkServiceTestImpl> network_service_test_impl_;
diff --git a/content/public/test/test_storage_partition.cc b/content/public/test/test_storage_partition.cc index a86e103..d7fa8cb 100644 --- a/content/public/test/test_storage_partition.cc +++ b/content/public/test/test_storage_partition.cc
@@ -22,7 +22,7 @@ return media_url_request_context_getter_; } -mojom::NetworkContext* TestStoragePartition::GetNetworkContext() { +network::mojom::NetworkContext* TestStoragePartition::GetNetworkContext() { return network_context_; }
diff --git a/content/public/test/test_storage_partition.h b/content/public/test/test_storage_partition.h index 1a4d744..ab196d9 100644 --- a/content/public/test/test_storage_partition.h +++ b/content/public/test/test_storage_partition.h
@@ -52,10 +52,10 @@ } net::URLRequestContextGetter* GetMediaURLRequestContext() override; - void set_network_context(mojom::NetworkContext* context) { + void set_network_context(network::mojom::NetworkContext* context) { network_context_ = context; } - mojom::NetworkContext* GetNetworkContext() override; + network::mojom::NetworkContext* GetNetworkContext() override; void set_url_loader_factory_for_browser_process( network::mojom::URLLoaderFactory* @@ -172,7 +172,7 @@ base::FilePath file_path_; net::URLRequestContextGetter* url_request_context_getter_ = nullptr; net::URLRequestContextGetter* media_url_request_context_getter_ = nullptr; - mojom::NetworkContext* network_context_ = nullptr; + network::mojom::NetworkContext* network_context_ = nullptr; network::mojom::URLLoaderFactory* url_loader_factory_for_browser_process_ = nullptr; network::mojom::CookieManager* cookie_manager_for_browser_process_ = nullptr;
diff --git a/content/renderer/indexed_db/indexed_db_callbacks_impl.cc b/content/renderer/indexed_db/indexed_db_callbacks_impl.cc index 32cbce4..651315b 100644 --- a/content/renderer/indexed_db/indexed_db_callbacks_impl.cc +++ b/content/renderer/indexed_db/indexed_db_callbacks_impl.cc
@@ -106,17 +106,18 @@ std::move(local_blob_info)); } - IndexedDBCallbacksImpl::IndexedDBCallbacksImpl( std::unique_ptr<WebIDBCallbacks> callbacks, int64_t transaction_id, const base::WeakPtr<WebIDBCursorImpl>& cursor, - scoped_refptr<base::SingleThreadTaskRunner> io_runner) + scoped_refptr<base::SingleThreadTaskRunner> io_runner, + scoped_refptr<base::SingleThreadTaskRunner> callback_runner) : internal_state_(new InternalState(std::move(callbacks), transaction_id, cursor, - std::move(io_runner))), - callback_runner_(base::ThreadTaskRunnerHandle::Get()) {} + std::move(io_runner), + callback_runner)), + callback_runner_(std::move(callback_runner)) {} IndexedDBCallbacksImpl::~IndexedDBCallbacksImpl() { callback_runner_->DeleteSoon(FROM_HERE, internal_state_); @@ -236,11 +237,13 @@ std::unique_ptr<blink::WebIDBCallbacks> callbacks, int64_t transaction_id, const base::WeakPtr<WebIDBCursorImpl>& cursor, - scoped_refptr<base::SingleThreadTaskRunner> io_runner) + scoped_refptr<base::SingleThreadTaskRunner> io_runner, + scoped_refptr<base::SingleThreadTaskRunner> callback_runner) : callbacks_(std::move(callbacks)), transaction_id_(transaction_id), cursor_(cursor), - io_runner_(std::move(io_runner)) { + io_runner_(std::move(io_runner)), + callback_runner_(std::move(callback_runner)) { IndexedDBDispatcher::ThreadSpecificInstance()->RegisterMojoOwnedCallbacks( this); } @@ -279,8 +282,8 @@ blink::WebIDBDataLoss data_loss, const std::string& data_loss_message, const content::IndexedDBDatabaseMetadata& metadata) { - WebIDBDatabase* database = - new WebIDBDatabaseImpl(std::move(database_info), io_runner_); + WebIDBDatabase* database = new WebIDBDatabaseImpl( + std::move(database_info), io_runner_, callback_runner_); WebIDBMetadata web_metadata; ConvertDatabaseMetadata(metadata, &web_metadata); callbacks_->OnUpgradeNeeded(old_version, database, web_metadata, data_loss, @@ -292,8 +295,10 @@ DatabaseAssociatedPtrInfo database_info, const content::IndexedDBDatabaseMetadata& metadata) { WebIDBDatabase* database = nullptr; - if (database_info.is_valid()) - database = new WebIDBDatabaseImpl(std::move(database_info), io_runner_); + if (database_info.is_valid()) { + database = new WebIDBDatabaseImpl(std::move(database_info), io_runner_, + callback_runner_); + } WebIDBMetadata web_metadata; ConvertDatabaseMetadata(metadata, &web_metadata); @@ -306,8 +311,8 @@ const IndexedDBKey& key, const IndexedDBKey& primary_key, indexed_db::mojom::ValuePtr value) { - WebIDBCursorImpl* cursor = - new WebIDBCursorImpl(std::move(cursor_info), transaction_id_, io_runner_); + WebIDBCursorImpl* cursor = new WebIDBCursorImpl( + std::move(cursor_info), transaction_id_, io_runner_, callback_runner_); callbacks_->OnSuccess(cursor, WebIDBKeyBuilder::Build(key), WebIDBKeyBuilder::Build(primary_key), ConvertValue(value));
diff --git a/content/renderer/indexed_db/indexed_db_callbacks_impl.h b/content/renderer/indexed_db/indexed_db_callbacks_impl.h index e22ed8d..f60f5862 100644 --- a/content/renderer/indexed_db/indexed_db_callbacks_impl.h +++ b/content/renderer/indexed_db/indexed_db_callbacks_impl.h
@@ -32,7 +32,8 @@ InternalState(std::unique_ptr<blink::WebIDBCallbacks> callbacks, int64_t transaction_id, const base::WeakPtr<WebIDBCursorImpl>& cursor, - scoped_refptr<base::SingleThreadTaskRunner> io_runner); + scoped_refptr<base::SingleThreadTaskRunner> io_runner, + scoped_refptr<base::SingleThreadTaskRunner> callback_runner); ~InternalState(); void Error(int32_t code, const base::string16& message); @@ -66,6 +67,7 @@ int64_t transaction_id_; base::WeakPtr<WebIDBCursorImpl> cursor_; scoped_refptr<base::SingleThreadTaskRunner> io_runner_; + scoped_refptr<base::SingleThreadTaskRunner> callback_runner_; DISALLOW_COPY_AND_ASSIGN(InternalState); }; @@ -73,10 +75,12 @@ static blink::WebIDBValue ConvertValue( const indexed_db::mojom::ValuePtr& value); - IndexedDBCallbacksImpl(std::unique_ptr<blink::WebIDBCallbacks> callbacks, - int64_t transaction_id, - const base::WeakPtr<WebIDBCursorImpl>& cursor, - scoped_refptr<base::SingleThreadTaskRunner> io_runner); + IndexedDBCallbacksImpl( + std::unique_ptr<blink::WebIDBCallbacks> callbacks, + int64_t transaction_id, + const base::WeakPtr<WebIDBCursorImpl>& cursor, + scoped_refptr<base::SingleThreadTaskRunner> io_runner, + scoped_refptr<base::SingleThreadTaskRunner> callback_runner); ~IndexedDBCallbacksImpl() override; // indexed_db::mojom::Callbacks implementation:
diff --git a/content/renderer/indexed_db/indexed_db_database_callbacks_impl.cc b/content/renderer/indexed_db/indexed_db_database_callbacks_impl.cc index b4f5564..1f2f698d 100644 --- a/content/renderer/indexed_db/indexed_db_database_callbacks_impl.cc +++ b/content/renderer/indexed_db/indexed_db_database_callbacks_impl.cc
@@ -67,8 +67,9 @@ } // namespace IndexedDBDatabaseCallbacksImpl::IndexedDBDatabaseCallbacksImpl( - std::unique_ptr<WebIDBDatabaseCallbacks> callbacks) - : callback_runner_(base::ThreadTaskRunnerHandle::Get()), + std::unique_ptr<WebIDBDatabaseCallbacks> callbacks, + scoped_refptr<base::SingleThreadTaskRunner> callback_runner) + : callback_runner_(std::move(callback_runner)), callbacks_(callbacks.release()) { IndexedDBDispatcher::ThreadSpecificInstance() ->RegisterMojoOwnedDatabaseCallbacks(callbacks_);
diff --git a/content/renderer/indexed_db/indexed_db_database_callbacks_impl.h b/content/renderer/indexed_db/indexed_db_database_callbacks_impl.h index 544a90a..f6986dd 100644 --- a/content/renderer/indexed_db/indexed_db_database_callbacks_impl.h +++ b/content/renderer/indexed_db/indexed_db_database_callbacks_impl.h
@@ -17,7 +17,8 @@ : public indexed_db::mojom::DatabaseCallbacks { public: explicit IndexedDBDatabaseCallbacksImpl( - std::unique_ptr<blink::WebIDBDatabaseCallbacks> callbacks); + std::unique_ptr<blink::WebIDBDatabaseCallbacks> callbacks, + scoped_refptr<base::SingleThreadTaskRunner> callback_runner); ~IndexedDBDatabaseCallbacksImpl() override; // indexed_db::mojom::DatabaseCallbacks implementation
diff --git a/content/renderer/indexed_db/webidbcursor_impl.cc b/content/renderer/indexed_db/webidbcursor_impl.cc index baadc184..441ec1a 100644 --- a/content/renderer/indexed_db/webidbcursor_impl.cc +++ b/content/renderer/indexed_db/webidbcursor_impl.cc
@@ -55,10 +55,12 @@ WebIDBCursorImpl::WebIDBCursorImpl( indexed_db::mojom::CursorAssociatedPtrInfo cursor_info, int64_t transaction_id, - scoped_refptr<base::SingleThreadTaskRunner> io_runner) + scoped_refptr<base::SingleThreadTaskRunner> io_runner, + scoped_refptr<base::SingleThreadTaskRunner> callback_runner) : transaction_id_(transaction_id), helper_(new IOThreadHelper()), io_runner_(std::move(io_runner)), + callback_runner_(std::move(callback_runner)), continue_count_(0), used_prefetches_(0), pending_onsuccess_callbacks_(0), @@ -94,7 +96,7 @@ auto callbacks_impl = std::make_unique<IndexedDBCallbacksImpl>( std::move(callbacks), transaction_id_, weak_factory_.GetWeakPtr(), - io_runner_); + io_runner_, callback_runner_); io_runner_->PostTask( FROM_HERE, base::BindOnce(&IOThreadHelper::Advance, base::Unretained(helper_), count, @@ -123,7 +125,7 @@ auto callbacks_impl = std::make_unique<IndexedDBCallbacksImpl>( std::move(callbacks), transaction_id_, weak_factory_.GetWeakPtr(), - io_runner_); + io_runner_, callback_runner_); io_runner_->PostTask( FROM_HERE, base::BindOnce(&IOThreadHelper::Prefetch, base::Unretained(helper_), @@ -147,7 +149,7 @@ auto callbacks_impl = std::make_unique<IndexedDBCallbacksImpl>( std::move(callbacks), transaction_id_, weak_factory_.GetWeakPtr(), - io_runner_); + io_runner_, callback_runner_); io_runner_->PostTask( FROM_HERE, base::BindOnce(&IOThreadHelper::Continue, base::Unretained(helper_),
diff --git a/content/renderer/indexed_db/webidbcursor_impl.h b/content/renderer/indexed_db/webidbcursor_impl.h index b7558fe..a668f9a 100644 --- a/content/renderer/indexed_db/webidbcursor_impl.h +++ b/content/renderer/indexed_db/webidbcursor_impl.h
@@ -31,7 +31,8 @@ public: WebIDBCursorImpl(indexed_db::mojom::CursorAssociatedPtrInfo cursor, int64_t transaction_id, - scoped_refptr<base::SingleThreadTaskRunner> io_runner); + scoped_refptr<base::SingleThreadTaskRunner> io_runner, + scoped_refptr<base::SingleThreadTaskRunner> callback_runner); ~WebIDBCursorImpl() override; void Advance(unsigned long count, blink::WebIDBCallbacks* callback) override; @@ -70,6 +71,7 @@ IOThreadHelper* helper_; scoped_refptr<base::SingleThreadTaskRunner> io_runner_; + scoped_refptr<base::SingleThreadTaskRunner> callback_runner_; // Prefetch cache. base::circular_deque<IndexedDBKey> prefetch_keys_;
diff --git a/content/renderer/indexed_db/webidbcursor_impl_unittest.cc b/content/renderer/indexed_db/webidbcursor_impl_unittest.cc index 9d27e257..7097a775 100644 --- a/content/renderer/indexed_db/webidbcursor_impl_unittest.cc +++ b/content/renderer/indexed_db/webidbcursor_impl_unittest.cc
@@ -128,6 +128,7 @@ mojo::MakeRequestAssociatedWithDedicatedPipe(&ptr)); cursor_ = std::make_unique<WebIDBCursorImpl>( ptr.PassInterface(), 1, + blink::scheduler::GetSingleThreadTaskRunnerForTesting(), blink::scheduler::GetSingleThreadTaskRunnerForTesting()); }
diff --git a/content/renderer/indexed_db/webidbdatabase_impl.cc b/content/renderer/indexed_db/webidbdatabase_impl.cc index 59ee162..c45bc10 100644 --- a/content/renderer/indexed_db/webidbdatabase_impl.cc +++ b/content/renderer/indexed_db/webidbdatabase_impl.cc
@@ -165,8 +165,11 @@ WebIDBDatabaseImpl::WebIDBDatabaseImpl( DatabaseAssociatedPtrInfo database_info, - scoped_refptr<base::SingleThreadTaskRunner> io_runner) - : helper_(new IOThreadHelper()), io_runner_(std::move(io_runner)) { + scoped_refptr<base::SingleThreadTaskRunner> io_runner, + scoped_refptr<base::SingleThreadTaskRunner> callback_runner) + : helper_(new IOThreadHelper()), + io_runner_(std::move(io_runner)), + callback_runner_(std::move(callback_runner)) { io_runner_->PostTask(FROM_HERE, base::BindOnce(&IOThreadHelper::Bind, base::Unretained(helper_), base::Passed(&database_info))); @@ -267,7 +270,8 @@ transaction_id, nullptr); auto callbacks_impl = std::make_unique<IndexedDBCallbacksImpl>( - base::WrapUnique(callbacks), transaction_id, nullptr, io_runner_); + base::WrapUnique(callbacks), transaction_id, nullptr, io_runner_, + callback_runner_); io_runner_->PostTask( FROM_HERE, base::BindOnce(&IOThreadHelper::Get, base::Unretained(helper_), transaction_id, object_store_id, index_id, @@ -286,7 +290,8 @@ transaction_id, nullptr); auto callbacks_impl = std::make_unique<IndexedDBCallbacksImpl>( - base::WrapUnique(callbacks), transaction_id, nullptr, io_runner_); + base::WrapUnique(callbacks), transaction_id, nullptr, io_runner_, + callback_runner_); io_runner_->PostTask( FROM_HERE, base::BindOnce(&IOThreadHelper::GetAll, base::Unretained(helper_), @@ -347,7 +352,8 @@ } auto callbacks_impl = std::make_unique<IndexedDBCallbacksImpl>( - base::WrapUnique(callbacks), transaction_id, nullptr, io_runner_); + base::WrapUnique(callbacks), transaction_id, nullptr, io_runner_, + callback_runner_); io_runner_->PostTask( FROM_HERE, base::BindOnce(&IOThreadHelper::Put, base::Unretained(helper_), @@ -394,7 +400,8 @@ transaction_id, nullptr); auto callbacks_impl = std::make_unique<IndexedDBCallbacksImpl>( - base::WrapUnique(callbacks), transaction_id, nullptr, io_runner_); + base::WrapUnique(callbacks), transaction_id, nullptr, io_runner_, + callback_runner_); io_runner_->PostTask( FROM_HERE, base::BindOnce(&IOThreadHelper::OpenCursor, base::Unretained(helper_), @@ -412,7 +419,8 @@ transaction_id, nullptr); auto callbacks_impl = std::make_unique<IndexedDBCallbacksImpl>( - base::WrapUnique(callbacks), transaction_id, nullptr, io_runner_); + base::WrapUnique(callbacks), transaction_id, nullptr, io_runner_, + callback_runner_); io_runner_->PostTask( FROM_HERE, base::BindOnce(&IOThreadHelper::Count, base::Unretained(helper_), @@ -429,7 +437,8 @@ transaction_id, nullptr); auto callbacks_impl = std::make_unique<IndexedDBCallbacksImpl>( - base::WrapUnique(callbacks), transaction_id, nullptr, io_runner_); + base::WrapUnique(callbacks), transaction_id, nullptr, io_runner_, + callback_runner_); io_runner_->PostTask( FROM_HERE, base::BindOnce(&IOThreadHelper::DeleteRange, base::Unretained(helper_), @@ -446,7 +455,8 @@ transaction_id, nullptr); auto callbacks_impl = std::make_unique<IndexedDBCallbacksImpl>( - base::WrapUnique(callbacks), transaction_id, nullptr, io_runner_); + base::WrapUnique(callbacks), transaction_id, nullptr, io_runner_, + callback_runner_); io_runner_->PostTask( FROM_HERE, base::BindOnce(&IOThreadHelper::DeleteRange, base::Unretained(helper_), @@ -462,7 +472,8 @@ transaction_id, nullptr); auto callbacks_impl = std::make_unique<IndexedDBCallbacksImpl>( - base::WrapUnique(callbacks), transaction_id, nullptr, io_runner_); + base::WrapUnique(callbacks), transaction_id, nullptr, io_runner_, + callback_runner_); io_runner_->PostTask( FROM_HERE, base::BindOnce(&IOThreadHelper::Clear, base::Unretained(helper_),
diff --git a/content/renderer/indexed_db/webidbdatabase_impl.h b/content/renderer/indexed_db/webidbdatabase_impl.h index 22ea77f..bdcb78e9 100644 --- a/content/renderer/indexed_db/webidbdatabase_impl.h +++ b/content/renderer/indexed_db/webidbdatabase_impl.h
@@ -28,8 +28,10 @@ class CONTENT_EXPORT WebIDBDatabaseImpl : public blink::WebIDBDatabase { public: - WebIDBDatabaseImpl(indexed_db::mojom::DatabaseAssociatedPtrInfo database, - scoped_refptr<base::SingleThreadTaskRunner> io_runner); + WebIDBDatabaseImpl( + indexed_db::mojom::DatabaseAssociatedPtrInfo database, + scoped_refptr<base::SingleThreadTaskRunner> io_runner, + scoped_refptr<base::SingleThreadTaskRunner> callback_runner); ~WebIDBDatabaseImpl() override; // blink::WebIDBDatabase @@ -148,6 +150,7 @@ IOThreadHelper* helper_; std::set<int32_t> observer_ids_; scoped_refptr<base::SingleThreadTaskRunner> io_runner_; + scoped_refptr<base::SingleThreadTaskRunner> callback_runner_; }; } // namespace content
diff --git a/content/renderer/indexed_db/webidbdatabase_impl_unittest.cc b/content/renderer/indexed_db/webidbdatabase_impl_unittest.cc index 4114cef1..244daba5 100644 --- a/content/renderer/indexed_db/webidbdatabase_impl_unittest.cc +++ b/content/renderer/indexed_db/webidbdatabase_impl_unittest.cc
@@ -60,7 +60,8 @@ EXPECT_CALL(callbacks, OnError(_)).Times(1); WebIDBDatabaseImpl database_impl( - nullptr, blink::scheduler::GetSingleThreadTaskRunnerForTesting()); + nullptr, blink::scheduler::GetSingleThreadTaskRunnerForTesting(), + blink::scheduler::GetSingleThreadTaskRunnerForTesting()); database_impl.max_put_value_size_ = kMaxValueSizeForTesting; const WebIDBKey idb_key = WebIDBKey::CreateNumber(0); database_impl.Put(transaction_id, object_store_id, value, web_blob_info, @@ -88,7 +89,8 @@ EXPECT_CALL(callbacks, OnError(_)).Times(1); WebIDBDatabaseImpl database_impl( - nullptr, blink::scheduler::GetSingleThreadTaskRunnerForTesting()); + nullptr, blink::scheduler::GetSingleThreadTaskRunnerForTesting(), + blink::scheduler::GetSingleThreadTaskRunnerForTesting()); database_impl.max_put_value_size_ = kMaxValueSizeForTesting; database_impl.Put(transaction_id, object_store_id, value, web_blob_info, key.View(), blink::kWebIDBPutModeAddOrUpdate, &callbacks,
diff --git a/content/renderer/indexed_db/webidbfactory_impl.cc b/content/renderer/indexed_db/webidbfactory_impl.cc index 38854fa3..52cb7ce7 100644 --- a/content/renderer/indexed_db/webidbfactory_impl.cc +++ b/content/renderer/indexed_db/webidbfactory_impl.cc
@@ -65,11 +65,13 @@ io_runner_->DeleteSoon(FROM_HERE, io_helper_); } -void WebIDBFactoryImpl::GetDatabaseNames(WebIDBCallbacks* callbacks, - const WebSecurityOrigin& origin) { +void WebIDBFactoryImpl::GetDatabaseNames( + WebIDBCallbacks* callbacks, + const WebSecurityOrigin& origin, + scoped_refptr<base::SingleThreadTaskRunner> task_runner) { auto callbacks_impl = std::make_unique<IndexedDBCallbacksImpl>( base::WrapUnique(callbacks), IndexedDBCallbacksImpl::kNoTransaction, - nullptr, io_runner_); + nullptr, io_runner_, std::move(task_runner)); io_runner_->PostTask( FROM_HERE, base::BindOnce(&IOThreadHelper::GetDatabaseNames, @@ -77,17 +79,20 @@ base::Passed(&callbacks_impl), url::Origin(origin))); } -void WebIDBFactoryImpl::Open(const WebString& name, - long long version, - long long transaction_id, - WebIDBCallbacks* callbacks, - WebIDBDatabaseCallbacks* database_callbacks, - const WebSecurityOrigin& origin) { +void WebIDBFactoryImpl::Open( + const WebString& name, + long long version, + long long transaction_id, + WebIDBCallbacks* callbacks, + WebIDBDatabaseCallbacks* database_callbacks, + const WebSecurityOrigin& origin, + scoped_refptr<base::SingleThreadTaskRunner> task_runner) { auto callbacks_impl = std::make_unique<IndexedDBCallbacksImpl>( - base::WrapUnique(callbacks), transaction_id, nullptr, io_runner_); + base::WrapUnique(callbacks), transaction_id, nullptr, io_runner_, + task_runner); auto database_callbacks_impl = std::make_unique<IndexedDBDatabaseCallbacksImpl>( - base::WrapUnique(database_callbacks)); + base::WrapUnique(database_callbacks), std::move(task_runner)); io_runner_->PostTask( FROM_HERE, base::BindOnce( @@ -96,13 +101,15 @@ base::Passed(&database_callbacks_impl), url::Origin(origin))); } -void WebIDBFactoryImpl::DeleteDatabase(const WebString& name, - WebIDBCallbacks* callbacks, - const WebSecurityOrigin& origin, - bool force_close) { +void WebIDBFactoryImpl::DeleteDatabase( + const WebString& name, + WebIDBCallbacks* callbacks, + const WebSecurityOrigin& origin, + bool force_close, + scoped_refptr<base::SingleThreadTaskRunner> task_runner) { auto callbacks_impl = std::make_unique<IndexedDBCallbacksImpl>( base::WrapUnique(callbacks), IndexedDBCallbacksImpl::kNoTransaction, - nullptr, io_runner_); + nullptr, io_runner_, std::move(task_runner)); io_runner_->PostTask( FROM_HERE, base::BindOnce(&IOThreadHelper::DeleteDatabase, base::Unretained(io_helper_), name.Utf16(),
diff --git a/content/renderer/indexed_db/webidbfactory_impl.h b/content/renderer/indexed_db/webidbfactory_impl.h index d81c0d8..13df6e0 100644 --- a/content/renderer/indexed_db/webidbfactory_impl.h +++ b/content/renderer/indexed_db/webidbfactory_impl.h
@@ -30,18 +30,23 @@ ~WebIDBFactoryImpl() override; // See WebIDBFactory.h for documentation on these functions. - void GetDatabaseNames(blink::WebIDBCallbacks* callbacks, - const blink::WebSecurityOrigin& origin) override; + void GetDatabaseNames( + blink::WebIDBCallbacks* callbacks, + const blink::WebSecurityOrigin& origin, + scoped_refptr<base::SingleThreadTaskRunner> task_runner) override; void Open(const blink::WebString& name, long long version, long long transaction_id, blink::WebIDBCallbacks* callbacks, blink::WebIDBDatabaseCallbacks* databaseCallbacks, - const blink::WebSecurityOrigin& origin) override; - void DeleteDatabase(const blink::WebString& name, - blink::WebIDBCallbacks* callbacks, - const blink::WebSecurityOrigin& origin, - bool force_close) override; + const blink::WebSecurityOrigin& origin, + scoped_refptr<base::SingleThreadTaskRunner> task_runner) override; + void DeleteDatabase( + const blink::WebString& name, + blink::WebIDBCallbacks* callbacks, + const blink::WebSecurityOrigin& origin, + bool force_close, + scoped_refptr<base::SingleThreadTaskRunner> task_runner) override; private: class IOThreadHelper;
diff --git a/content/renderer/loader/web_url_loader_impl.cc b/content/renderer/loader/web_url_loader_impl.cc index 1d8e21b2..f684e87 100644 --- a/content/renderer/loader/web_url_loader_impl.cc +++ b/content/renderer/loader/web_url_loader_impl.cc
@@ -26,7 +26,6 @@ #include "build/build_config.h" #include "content/child/child_thread_impl.h" #include "content/child/scoped_child_process_reference.h" -#include "content/common/loader_util.h" #include "content/common/service_worker/service_worker_types.h" #include "content/common/weak_wrapper_shared_url_loader_factory.h" #include "content/public/common/browser_side_navigation_policy.h" @@ -46,6 +45,7 @@ #include "content/renderer/loader/weburlresponse_extradata_impl.h" #include "net/base/data_url.h" #include "net/base/filename_util.h" +#include "net/base/load_flags.h" #include "net/base/net_errors.h" #include "net/cert/cert_status_flags.h" #include "net/cert/ct_sct_to_string.h" @@ -55,6 +55,7 @@ #include "net/ssl/ssl_cipher_suite_names.h" #include "net/ssl/ssl_connection_status_flags.h" #include "net/url_request/url_request_data_job.h" +#include "services/network/public/cpp/loader_util.h" #include "services/network/public/cpp/resource_request.h" #include "services/network/public/interfaces/request_context_frame_type.mojom.h" #include "services/network/public/interfaces/url_loader.mojom.h" @@ -660,18 +661,23 @@ resource_request->headers = GetWebURLRequestHeaders(request); if (resource_request->resource_type == RESOURCE_TYPE_STYLESHEET) { - resource_request->headers.SetHeader(kAcceptHeader, kStylesheetAcceptHeader); + resource_request->headers.SetHeader(network::kAcceptHeader, + kStylesheetAcceptHeader); } else if (resource_request->resource_type == RESOURCE_TYPE_FAVICON || resource_request->resource_type == RESOURCE_TYPE_IMAGE) { - resource_request->headers.SetHeader(kAcceptHeader, kImageAcceptHeader); + resource_request->headers.SetHeader(network::kAcceptHeader, + kImageAcceptHeader); } else { // Calling SetHeaderIfMissing() instead of SetHeader() because JS can // manually set an accept header on an XHR. - resource_request->headers.SetHeaderIfMissing(kAcceptHeader, - kDefaultAcceptHeader); + resource_request->headers.SetHeaderIfMissing(network::kAcceptHeader, + network::kDefaultAcceptHeader); } resource_request->load_flags = GetLoadFlagsForWebURLRequest(request); + if (resource_request->resource_type == RESOURCE_TYPE_PREFETCH) + resource_request->load_flags |= net::LOAD_PREFETCH; + // |plugin_child_id| only needs to be non-zero if the request originates // outside the render process, so we can use requestorProcessID even // for requests from in-process plugins.
diff --git a/content/renderer/loader/web_url_request_util.cc b/content/renderer/loader/web_url_request_util.cc index 7dd75276..2245bdb2 100644 --- a/content/renderer/loader/web_url_request_util.cc +++ b/content/renderer/loader/web_url_request_util.cc
@@ -336,6 +336,13 @@ int GetLoadFlagsForWebURLRequest(const WebURLRequest& request) { int load_flags = net::LOAD_NORMAL; + + // Although EV status is irrelevant to sub-frames and sub-resources, we have + // to perform EV certificate verification on all resources because an HTTP + // keep-alive connection created to load a sub-frame or a sub-resource could + // be reused to load a main frame. + load_flags |= net::LOAD_VERIFY_EV_CERT; + GURL url = request.Url(); switch (request.GetCacheMode()) { case FetchCacheMode::kNoStore:
diff --git a/content/renderer/media/mojo_audio_input_ipc.cc b/content/renderer/media/mojo_audio_input_ipc.cc index 414fa35..0b38172 100644 --- a/content/renderer/media/mojo_audio_input_ipc.cc +++ b/content/renderer/media/mojo_audio_input_ipc.cc
@@ -85,11 +85,11 @@ DCHECK_EQ(result, MOJO_RESULT_OK); base::SharedMemoryHandle memory_handle; - bool read_only = true; + mojo::UnwrappedSharedMemoryHandleProtection protection; result = mojo::UnwrapSharedMemoryHandle(std::move(shared_memory), - &memory_handle, nullptr, &read_only); + &memory_handle, nullptr, &protection); DCHECK_EQ(result, MOJO_RESULT_OK); - DCHECK(read_only); + DCHECK_EQ(protection, mojo::UnwrappedSharedMemoryHandleProtection::kReadOnly); delegate_->OnStreamCreated(memory_handle, socket_handle, initially_muted); }
diff --git a/content/renderer/media/mojo_audio_output_ipc.cc b/content/renderer/media/mojo_audio_output_ipc.cc index 5d99bc4..1852ab9 100644 --- a/content/renderer/media/mojo_audio_output_ipc.cc +++ b/content/renderer/media/mojo_audio_output_ipc.cc
@@ -205,12 +205,13 @@ DCHECK_EQ(result, MOJO_RESULT_OK); base::SharedMemoryHandle memory_handle; - bool read_only = false; + mojo::UnwrappedSharedMemoryHandleProtection protection; size_t memory_length = 0; result = mojo::UnwrapSharedMemoryHandle( - std::move(shared_memory), &memory_handle, &memory_length, &read_only); + std::move(shared_memory), &memory_handle, &memory_length, &protection); DCHECK_EQ(result, MOJO_RESULT_OK); - DCHECK(!read_only); + DCHECK_EQ(protection, + mojo::UnwrappedSharedMemoryHandleProtection::kReadWrite); delegate_->OnStreamCreated(memory_handle, socket_handle); }
diff --git a/content/renderer/media/video_capture_impl.cc b/content/renderer/media/video_capture_impl.cc index f658e91..ebdadce9 100644 --- a/content/renderer/media/video_capture_impl.cc +++ b/content/renderer/media/video_capture_impl.cc
@@ -242,13 +242,17 @@ base::SharedMemoryHandle memory_handle; size_t memory_size = 0; - bool read_only_flag = false; + mojo::UnwrappedSharedMemoryHandleProtection protection; const MojoResult result = mojo::UnwrapSharedMemoryHandle( - std::move(handle), &memory_handle, &memory_size, &read_only_flag); + std::move(handle), &memory_handle, &memory_size, &protection); DCHECK_EQ(MOJO_RESULT_OK, result); DCHECK_GT(memory_size, 0u); + // TODO(https://crbug.com/803136): We should also be able to assert that the + // unwrapped handle was shared for read-only mapping. That condition is not + // currently guaranteed to be met. + std::unique_ptr<base::SharedMemory> shm( new base::SharedMemory(memory_handle, true /* read_only */)); if (!shm->Map(memory_size)) {
diff --git a/content/renderer/media/video_capture_impl_unittest.cc b/content/renderer/media/video_capture_impl_unittest.cc index 2b06e1a9c..93ff20f 100644 --- a/content/renderer/media/video_capture_impl_unittest.cc +++ b/content/renderer/media/video_capture_impl_unittest.cc
@@ -135,11 +135,20 @@ video_capture_impl_->StopCapture(client_id); } + bool CreateAndMapSharedMemory(size_t size, base::SharedMemory* shm) { + base::SharedMemoryCreateOptions options; + options.size = size; + options.share_read_only = true; + if (!shm->Create(options)) + return false; + return shm->Map(size); + } + void SimulateOnBufferCreated(int buffer_id, const base::SharedMemory& shm) { - auto handle = base::SharedMemory::DuplicateHandle(shm.handle()); video_capture_impl_->OnBufferCreated( - buffer_id, mojo::WrapSharedMemoryHandle(handle, shm.mapped_size(), - true /* read_only */)); + buffer_id, mojo::WrapSharedMemoryHandle( + shm.GetReadOnlyHandle(), shm.mapped_size(), + mojo::UnwrappedSharedMemoryHandleProtection::kReadOnly)); } void SimulateBufferReceived(int buffer_id, const gfx::Size& size) { @@ -278,7 +287,7 @@ base::SharedMemory shm; const size_t frame_size = media::VideoFrame::AllocationSize( media::PIXEL_FORMAT_I420, params_small_.requested_format.frame_size); - ASSERT_TRUE(shm.CreateAndMapAnonymous(frame_size)); + ASSERT_TRUE(CreateAndMapSharedMemory(frame_size, &shm)); EXPECT_CALL(*this, OnStateUpdate(VIDEO_CAPTURE_STATE_STARTED)); EXPECT_CALL(*this, OnStateUpdate(VIDEO_CAPTURE_STATE_STOPPED)); @@ -303,7 +312,7 @@ base::SharedMemory shm; const size_t frame_size = media::VideoFrame::AllocationSize( media::PIXEL_FORMAT_I420, params_large_.requested_format.frame_size); - ASSERT_TRUE(shm.CreateAndMapAnonymous(frame_size)); + ASSERT_TRUE(CreateAndMapSharedMemory(frame_size, &shm)); EXPECT_CALL(*this, OnStateUpdate(VIDEO_CAPTURE_STATE_STARTED)); EXPECT_CALL(*this, OnStateUpdate(VIDEO_CAPTURE_STATE_STOPPED)); @@ -371,7 +380,7 @@ base::SharedMemory shm; const size_t frame_size = media::VideoFrame::AllocationSize( media::PIXEL_FORMAT_I420, params_small_.requested_format.frame_size); - ASSERT_TRUE(shm.CreateAndMapAnonymous(frame_size)); + ASSERT_TRUE(CreateAndMapSharedMemory(frame_size, &shm)); InSequence s; EXPECT_CALL(mock_video_capture_host_, DoStart(_, kSessionId, params_small_))
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc index 7cc1540..f341fb4a 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc
@@ -4069,6 +4069,16 @@ document_loader->SetSourceLocation(source_location); } + // Mark the loader as user activated if started from a context menu and the + // URLs are matching the user activation persistence rules. + if (navigation_state->common_params().started_from_context_menu && + WebDocumentLoader::ShouldPersistUserActivation( + url::Origin::Create(navigation_state->common_params().url), + url::Origin::Create( + navigation_state->common_params().referrer.url))) { + document_loader->SetUserActivated(); + } + // Create the serviceworker's per-document network observing object if it // does not exist (When navigation happens within a page, the provider already // exists).
diff --git a/content/renderer/render_view_browsertest.cc b/content/renderer/render_view_browsertest.cc index 2d1bec1..d8b4686 100644 --- a/content/renderer/render_view_browsertest.cc +++ b/content/renderer/render_view_browsertest.cc
@@ -2168,52 +2168,37 @@ } TEST_F(RenderViewImplTest, PreferredSizeZoomed) { - LoadHTML( - "<style>::-webkit-scrollbar { width: 20px; height: 20px; } </style>" - "<body style='margin:0;'>" - "<div style='display:inline-block; " - "width:400px; height:400px;'/></body>"); + LoadHTML("<body style='margin:0;'><div style='display:inline-block; " + "width:400px; height:400px;'/></body>"); + view()->webview()->MainFrame()->ToWebLocalFrame()->SetCanHaveScrollbars( + false); EnablePreferredSizeMode(); -#if defined(OS_ANDROID) - // Android ignores scrollbar styling. - int scrollbar_width = 0; -#else - int scrollbar_width = 20; -#endif - gfx::Size size = GetPreferredSize(); - EXPECT_EQ(gfx::Size(400 + scrollbar_width, 400), size); + EXPECT_EQ(gfx::Size(400, 400), size); SetZoomLevel(ZoomFactorToZoomLevel(2.0)); size = GetPreferredSize(); - EXPECT_EQ(gfx::Size(800 + scrollbar_width * 2, 800), size); + EXPECT_EQ(gfx::Size(800, 800), size); } TEST_F(RenderViewImplScaleFactorTest, PreferredSizeWithScaleFactor) { DoSetUp(); - LoadHTML( - "<style>::-webkit-scrollbar { width: 20px; height: 20px; } </style>" - "<body style='margin:0;'><div style='display:inline-block; " - "width:400px; height:400px;'/></body>"); + LoadHTML("<body style='margin:0;'><div style='display:inline-block; " + "width:400px; height:400px;'/></body>"); + view()->webview()->MainFrame()->ToWebLocalFrame()->SetCanHaveScrollbars( + false); EnablePreferredSizeMode(); -#if defined(OS_ANDROID) - // Android ignores scrollbar styling. - int scrollbar_width = 0; -#else - int scrollbar_width = 20; -#endif - gfx::Size size = GetPreferredSize(); - EXPECT_EQ(gfx::Size(400 + scrollbar_width, 400), size); + EXPECT_EQ(gfx::Size(400, 400), size); // The size is in DIP. Changing the scale factor should not change // the preferred size. (Caveat: a page may apply different layout for // high DPI, in which case, the size may differ.) SetDeviceScaleFactor(2.f); size = GetPreferredSize(); - EXPECT_EQ(gfx::Size(400 + scrollbar_width, 400), size); + EXPECT_EQ(gfx::Size(400, 400), size); } // Ensure the RenderViewImpl history list is properly updated when starting a
diff --git a/content/shell/gpu/DEPS b/content/shell/gpu/DEPS index c610d2e..5e5a8082 100644 --- a/content/shell/gpu/DEPS +++ b/content/shell/gpu/DEPS
@@ -1,3 +1,4 @@ include_rules = [ + "+services/network/public/interfaces", "+services/service_manager", ]
diff --git a/content/shell/gpu/shell_content_gpu_client.h b/content/shell/gpu/shell_content_gpu_client.h index 464706f..1db88fe 100644 --- a/content/shell/gpu/shell_content_gpu_client.h +++ b/content/shell/gpu/shell_content_gpu_client.h
@@ -8,8 +8,8 @@ #include <memory> #include "base/macros.h" -#include "content/public/common/network_service_test.mojom.h" #include "content/public/gpu/content_gpu_client.h" +#include "services/network/public/interfaces/network_service_test.mojom.h" namespace content {
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn index 1eb461d..b6283f7 100644 --- a/content/test/BUILD.gn +++ b/content/test/BUILD.gn
@@ -1910,6 +1910,7 @@ if (is_linux || is_mac || is_win) { deps += [ "//third_party/libyuv" ] sources += [ + "../browser/media/capture/frame_sink_video_capture_device_unittest.cc", "../browser/media/capture/web_contents_video_capture_device_unittest.cc", ] if (use_aura) {
diff --git a/device/gamepad/BUILD.gn b/device/gamepad/BUILD.gn index b555155f..f1e9fcde 100644 --- a/device/gamepad/BUILD.gn +++ b/device/gamepad/BUILD.gn
@@ -60,6 +60,8 @@ "gamepad_standard_mappings_win.cc", "gamepad_user_gesture.cc", "gamepad_user_gesture.h", + "hid_dll_functions_win.cc", + "hid_dll_functions_win.h", "raw_input_data_fetcher_win.cc", "raw_input_data_fetcher_win.h", "udev_gamepad_linux.cc",
diff --git a/device/gamepad/gamepad_provider.cc b/device/gamepad/gamepad_provider.cc index 08698ec..e2a273d 100644 --- a/device/gamepad/gamepad_provider.cc +++ b/device/gamepad/gamepad_provider.cc
@@ -90,10 +90,10 @@ mojo::ScopedSharedBufferHandle GamepadProvider::GetSharedBufferHandle() { // TODO(heke): Use mojo::SharedBuffer rather than base::SharedMemory in // GamepadSharedBuffer. See crbug.com/670655 for details - base::SharedMemoryHandle handle = base::SharedMemory::DuplicateHandle( - gamepad_shared_buffer_->shared_memory()->handle()); - return mojo::WrapSharedMemoryHandle(handle, sizeof(GamepadHardwareBuffer), - true /* read_only */); + return mojo::WrapSharedMemoryHandle( + gamepad_shared_buffer_->shared_memory()->GetReadOnlyHandle(), + sizeof(GamepadHardwareBuffer), + mojo::UnwrappedSharedMemoryHandleProtection::kReadOnly); } void GamepadProvider::GetCurrentGamepadData(Gamepads* data) {
diff --git a/device/gamepad/hid_dll_functions_win.cc b/device/gamepad/hid_dll_functions_win.cc new file mode 100644 index 0000000..10bb270 --- /dev/null +++ b/device/gamepad/hid_dll_functions_win.cc
@@ -0,0 +1,41 @@ +// Copyright 2018 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 "device/gamepad/hid_dll_functions_win.h" + +#include "base/files/file_path.h" + +namespace device { + +HidDllFunctionsWin::HidDllFunctionsWin() + : hid_dll_( + base::LoadNativeLibrary(base::FilePath(FILE_PATH_LITERAL("hid.dll")), + nullptr)) { + if (hid_dll_.is_valid()) { + hidp_get_caps_ = reinterpret_cast<HidPGetCapsFunc>( + hid_dll_.GetFunctionPointer("HidP_GetCaps")); + hidp_get_button_caps_ = reinterpret_cast<HidPGetButtonCapsFunc>( + hid_dll_.GetFunctionPointer("HidP_GetButtonCaps")); + hidp_get_value_caps_ = reinterpret_cast<HidPGetValueCapsFunc>( + hid_dll_.GetFunctionPointer("HidP_GetValueCaps")); + hidp_get_usages_ex_ = reinterpret_cast<HidPGetUsagesExFunc>( + hid_dll_.GetFunctionPointer("HidP_GetUsagesEx")); + hidp_get_usage_value_ = reinterpret_cast<HidPGetUsageValueFunc>( + hid_dll_.GetFunctionPointer("HidP_GetUsageValue")); + hidp_get_scaled_usage_value_ = + reinterpret_cast<HidPGetScaledUsageValueFunc>( + hid_dll_.GetFunctionPointer("HidP_GetScaledUsageValue")); + hidd_get_product_string_ = reinterpret_cast<HidDGetStringFunc>( + hid_dll_.GetFunctionPointer("HidD_GetProductString")); + } + + is_valid_ = hidp_get_caps_ != nullptr && hidp_get_button_caps_ != nullptr && + hidp_get_value_caps_ != nullptr && + hidp_get_usages_ex_ != nullptr && + hidp_get_usage_value_ != nullptr && + hidp_get_scaled_usage_value_ != nullptr && + hidd_get_product_string_ != nullptr; +} + +} // namespace device
diff --git a/device/gamepad/hid_dll_functions_win.h b/device/gamepad/hid_dll_functions_win.h new file mode 100644 index 0000000..af5b3fc --- /dev/null +++ b/device/gamepad/hid_dll_functions_win.h
@@ -0,0 +1,103 @@ +// Copyright 2018 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 DEVICE_GAMEPAD_HID_DLL_FUNCTIONS_WIN_ +#define DEVICE_GAMEPAD_HID_DLL_FUNCTIONS_WIN_ + +#include <Unknwn.h> +#include <WinDef.h> +#include <hidsdi.h> +#include <stdint.h> +#include <stdlib.h> +#include <windows.h> + +#include "base/scoped_native_library.h" + +namespace device { + +// Function types we use from hid.dll. +typedef NTSTATUS(__stdcall* HidPGetCapsFunc)(PHIDP_PREPARSED_DATA PreparsedData, + PHIDP_CAPS Capabilities); +typedef NTSTATUS(__stdcall* HidPGetButtonCapsFunc)( + HIDP_REPORT_TYPE ReportType, + PHIDP_BUTTON_CAPS ButtonCaps, + PUSHORT ButtonCapsLength, + PHIDP_PREPARSED_DATA PreparsedData); +typedef NTSTATUS(__stdcall* HidPGetValueCapsFunc)( + HIDP_REPORT_TYPE ReportType, + PHIDP_VALUE_CAPS ValueCaps, + PUSHORT ValueCapsLength, + PHIDP_PREPARSED_DATA PreparsedData); +typedef NTSTATUS(__stdcall* HidPGetUsagesExFunc)( + HIDP_REPORT_TYPE ReportType, + USHORT LinkCollection, + PUSAGE_AND_PAGE ButtonList, + ULONG* UsageLength, + PHIDP_PREPARSED_DATA PreparsedData, + PCHAR Report, + ULONG ReportLength); +typedef NTSTATUS(__stdcall* HidPGetUsageValueFunc)( + HIDP_REPORT_TYPE ReportType, + USAGE UsagePage, + USHORT LinkCollection, + USAGE Usage, + PULONG UsageValue, + PHIDP_PREPARSED_DATA PreparsedData, + PCHAR Report, + ULONG ReportLength); +typedef NTSTATUS(__stdcall* HidPGetScaledUsageValueFunc)( + HIDP_REPORT_TYPE ReportType, + USAGE UsagePage, + USHORT LinkCollection, + USAGE Usage, + PLONG UsageValue, + PHIDP_PREPARSED_DATA PreparsedData, + PCHAR Report, + ULONG ReportLength); +typedef BOOLEAN(__stdcall* HidDGetStringFunc)(HANDLE HidDeviceObject, + PVOID Buffer, + ULONG BufferLength); + +// Loads hid.dll and provides access to HID methods needed for enumeration and +// polling of RawInput devices on Windows. +class HidDllFunctionsWin { + public: + HidDllFunctionsWin(); + ~HidDllFunctionsWin() = default; + + // Return true if the hid.dll functions were successfully loaded. + bool IsValid() const { return is_valid_; } + + // Getters for each hid.dll function. + HidPGetCapsFunc HidPGetCaps() const { return hidp_get_caps_; } + HidPGetButtonCapsFunc HidPGetButtonCaps() const { + return hidp_get_button_caps_; + } + HidPGetValueCapsFunc HidPGetValueCaps() const { return hidp_get_value_caps_; } + HidPGetUsagesExFunc HidPGetUsagesEx() const { return hidp_get_usages_ex_; } + HidPGetUsageValueFunc HidPGetUsageValue() const { + return hidp_get_usage_value_; + } + HidPGetScaledUsageValueFunc HidPGetScaledUsageValue() const { + return hidp_get_scaled_usage_value_; + } + HidDGetStringFunc HidDGetProductString() const { + return hidd_get_product_string_; + } + + private: + bool is_valid_; + base::ScopedNativeLibrary hid_dll_; + HidPGetCapsFunc hidp_get_caps_ = nullptr; + HidPGetButtonCapsFunc hidp_get_button_caps_ = nullptr; + HidPGetValueCapsFunc hidp_get_value_caps_ = nullptr; + HidPGetUsagesExFunc hidp_get_usages_ex_ = nullptr; + HidPGetUsageValueFunc hidp_get_usage_value_ = nullptr; + HidPGetScaledUsageValueFunc hidp_get_scaled_usage_value_ = nullptr; + HidDGetStringFunc hidd_get_product_string_ = nullptr; +}; + +} // namespace device + +#endif // DEVICE_GAMEPAD_HID_DLL_FUNCTIONS_WIN_
diff --git a/device/gamepad/raw_input_data_fetcher_win.cc b/device/gamepad/raw_input_data_fetcher_win.cc index 738f177..9926ca6e 100644 --- a/device/gamepad/raw_input_data_fetcher_win.cc +++ b/device/gamepad/raw_input_data_fetcher_win.cc
@@ -61,9 +61,8 @@ } void RawInputDataFetcher::OnAddedToProvider() { - hid_dll_.Reset(base::LoadNativeLibrary( - base::FilePath(FILE_PATH_LITERAL("hid.dll")), nullptr)); - rawinput_available_ = GetHidDllFunctions(); + hid_functions_ = std::make_unique<HidDllFunctionsWin>(); + rawinput_available_ = hid_functions_->IsValid(); } RAWINPUTDEVICE* RawInputDataFetcher::GetRawInputDevices(DWORD flags) { @@ -247,6 +246,8 @@ } RawGamepadInfo* RawInputDataFetcher::ParseGamepadInfo(HANDLE hDevice) { + DCHECK(hid_functions_); + DCHECK(hid_functions_->IsValid()); UINT size = 0; // Query basic device info. @@ -329,8 +330,8 @@ name_buffer.get(), GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, NULL, NULL); if (hid_handle) { - got_product_string = hidd_get_product_string_(hid_handle, gamepad_info->id, - sizeof(gamepad_info->id)); + got_product_string = hid_functions_->HidDGetProductString()( + hid_handle, gamepad_info->id, sizeof(gamepad_info->id)); CloseHandle(hid_handle); } @@ -357,7 +358,8 @@ DCHECK_EQ(size, result); HIDP_CAPS caps; - NTSTATUS status = hidp_get_caps_(gamepad_info->preparsed_data, &caps); + NTSTATUS status = + hid_functions_->HidPGetCaps()(gamepad_info->preparsed_data, &caps); DCHECK_EQ(HIDP_STATUS_SUCCESS, status); // Query button information. @@ -365,8 +367,8 @@ if (count > 0) { std::unique_ptr<HIDP_BUTTON_CAPS[]> button_caps( new HIDP_BUTTON_CAPS[count]); - status = hidp_get_button_caps_(HidP_Input, button_caps.get(), &count, - gamepad_info->preparsed_data); + status = hid_functions_->HidPGetButtonCaps()( + HidP_Input, button_caps.get(), &count, gamepad_info->preparsed_data); DCHECK_EQ(HIDP_STATUS_SUCCESS, status); for (uint32_t i = 0; i < count; ++i) { @@ -384,8 +386,8 @@ // Query axis information. count = caps.NumberInputValueCaps; std::unique_ptr<HIDP_VALUE_CAPS[]> axes_caps(new HIDP_VALUE_CAPS[count]); - status = hidp_get_value_caps_(HidP_Input, axes_caps.get(), &count, - gamepad_info->preparsed_data); + status = hid_functions_->HidPGetValueCaps()( + HidP_Input, axes_caps.get(), &count, gamepad_info->preparsed_data); bool mapped_all_axes = true; @@ -439,6 +441,8 @@ void RawInputDataFetcher::UpdateGamepad(RAWINPUT* input, RawGamepadInfo* gamepad_info) { + DCHECK(hid_functions_); + DCHECK(hid_functions_->IsValid()); NTSTATUS status; gamepad_info->report_id++; @@ -449,18 +453,18 @@ ZeroMemory(gamepad_info->buttons, sizeof(gamepad_info->buttons)); ULONG buttons_length = 0; - hidp_get_usages_ex_(HidP_Input, 0, NULL, &buttons_length, - gamepad_info->preparsed_data, - reinterpret_cast<PCHAR>(input->data.hid.bRawData), - input->data.hid.dwSizeHid); + hid_functions_->HidPGetUsagesEx()( + HidP_Input, 0, NULL, &buttons_length, gamepad_info->preparsed_data, + reinterpret_cast<PCHAR>(input->data.hid.bRawData), + input->data.hid.dwSizeHid); std::unique_ptr<USAGE_AND_PAGE[]> usages( new USAGE_AND_PAGE[buttons_length]); - status = - hidp_get_usages_ex_(HidP_Input, 0, usages.get(), &buttons_length, - gamepad_info->preparsed_data, - reinterpret_cast<PCHAR>(input->data.hid.bRawData), - input->data.hid.dwSizeHid); + status = hid_functions_->HidPGetUsagesEx()( + HidP_Input, 0, usages.get(), &buttons_length, + gamepad_info->preparsed_data, + reinterpret_cast<PCHAR>(input->data.hid.bRawData), + input->data.hid.dwSizeHid); if (status == HIDP_STATUS_SUCCESS) { // Set each reported button to true. @@ -483,7 +487,7 @@ // If the min is < 0 we have to query the scaled value, otherwise we need // the normal unscaled value. if (axis->caps.LogicalMin < 0) { - status = hidp_get_scaled_usage_value_( + status = hid_functions_->HidPGetScaledUsageValue()( HidP_Input, axis->caps.UsagePage, 0, axis->caps.Range.UsageMin, &scaled_axis_value, gamepad_info->preparsed_data, reinterpret_cast<PCHAR>(input->data.hid.bRawData), @@ -493,7 +497,7 @@ axis->caps.PhysicalMax); } } else { - status = hidp_get_usage_value_( + status = hid_functions_->HidPGetUsageValue()( HidP_Input, axis->caps.UsagePage, 0, axis->caps.Range.UsageMin, &axis_value, gamepad_info->preparsed_data, reinterpret_cast<PCHAR>(input->data.hid.bRawData), @@ -553,48 +557,4 @@ } } -bool RawInputDataFetcher::GetHidDllFunctions() { - hidp_get_caps_ = NULL; - hidp_get_button_caps_ = NULL; - hidp_get_value_caps_ = NULL; - hidp_get_usages_ex_ = NULL; - hidp_get_usage_value_ = NULL; - hidp_get_scaled_usage_value_ = NULL; - hidd_get_product_string_ = NULL; - - if (!hid_dll_.is_valid()) - return false; - - hidp_get_caps_ = reinterpret_cast<HidPGetCapsFunc>( - hid_dll_.GetFunctionPointer("HidP_GetCaps")); - if (!hidp_get_caps_) - return false; - hidp_get_button_caps_ = reinterpret_cast<HidPGetButtonCapsFunc>( - hid_dll_.GetFunctionPointer("HidP_GetButtonCaps")); - if (!hidp_get_button_caps_) - return false; - hidp_get_value_caps_ = reinterpret_cast<HidPGetValueCapsFunc>( - hid_dll_.GetFunctionPointer("HidP_GetValueCaps")); - if (!hidp_get_value_caps_) - return false; - hidp_get_usages_ex_ = reinterpret_cast<HidPGetUsagesExFunc>( - hid_dll_.GetFunctionPointer("HidP_GetUsagesEx")); - if (!hidp_get_usages_ex_) - return false; - hidp_get_usage_value_ = reinterpret_cast<HidPGetUsageValueFunc>( - hid_dll_.GetFunctionPointer("HidP_GetUsageValue")); - if (!hidp_get_usage_value_) - return false; - hidp_get_scaled_usage_value_ = reinterpret_cast<HidPGetScaledUsageValueFunc>( - hid_dll_.GetFunctionPointer("HidP_GetScaledUsageValue")); - if (!hidp_get_scaled_usage_value_) - return false; - hidd_get_product_string_ = reinterpret_cast<HidDGetStringFunc>( - hid_dll_.GetFunctionPointer("HidD_GetProductString")); - if (!hidd_get_product_string_) - return false; - - return true; -} - } // namespace device
diff --git a/device/gamepad/raw_input_data_fetcher_win.h b/device/gamepad/raw_input_data_fetcher_win.h index 8db0e23..06b827a 100644 --- a/device/gamepad/raw_input_data_fetcher_win.h +++ b/device/gamepad/raw_input_data_fetcher_win.h
@@ -23,6 +23,7 @@ #include "build/build_config.h" #include "device/gamepad/gamepad_data_fetcher.h" #include "device/gamepad/gamepad_standard_mappings.h" +#include "device/gamepad/hid_dll_functions_win.h" #include "device/gamepad/public/cpp/gamepad.h" namespace device { @@ -91,55 +92,6 @@ RAWINPUTDEVICE* GetRawInputDevices(DWORD flags); void ClearControllers(); - // Function types we use from hid.dll. - typedef NTSTATUS(__stdcall* HidPGetCapsFunc)( - PHIDP_PREPARSED_DATA PreparsedData, - PHIDP_CAPS Capabilities); - typedef NTSTATUS(__stdcall* HidPGetButtonCapsFunc)( - HIDP_REPORT_TYPE ReportType, - PHIDP_BUTTON_CAPS ButtonCaps, - PUSHORT ButtonCapsLength, - PHIDP_PREPARSED_DATA PreparsedData); - typedef NTSTATUS(__stdcall* HidPGetValueCapsFunc)( - HIDP_REPORT_TYPE ReportType, - PHIDP_VALUE_CAPS ValueCaps, - PUSHORT ValueCapsLength, - PHIDP_PREPARSED_DATA PreparsedData); - typedef NTSTATUS(__stdcall* HidPGetUsagesExFunc)( - HIDP_REPORT_TYPE ReportType, - USHORT LinkCollection, - PUSAGE_AND_PAGE ButtonList, - ULONG* UsageLength, - PHIDP_PREPARSED_DATA PreparsedData, - PCHAR Report, - ULONG ReportLength); - typedef NTSTATUS(__stdcall* HidPGetUsageValueFunc)( - HIDP_REPORT_TYPE ReportType, - USAGE UsagePage, - USHORT LinkCollection, - USAGE Usage, - PULONG UsageValue, - PHIDP_PREPARSED_DATA PreparsedData, - PCHAR Report, - ULONG ReportLength); - typedef NTSTATUS(__stdcall* HidPGetScaledUsageValueFunc)( - HIDP_REPORT_TYPE ReportType, - USAGE UsagePage, - USHORT LinkCollection, - USAGE Usage, - PLONG UsageValue, - PHIDP_PREPARSED_DATA PreparsedData, - PCHAR Report, - ULONG ReportLength); - typedef BOOLEAN(__stdcall* HidDGetStringFunc)(HANDLE HidDeviceObject, - PVOID Buffer, - ULONG BufferLength); - - // Get functions from dynamically loaded hid.dll. Returns true if loading was - // successful. - bool GetHidDllFunctions(); - - base::ScopedNativeLibrary hid_dll_; std::unique_ptr<base::win::MessageWindow> window_; bool rawinput_available_; bool filter_xinput_; @@ -150,15 +102,8 @@ typedef std::map<HANDLE, RawGamepadInfo*> ControllerMap; ControllerMap controllers_; - // Function pointers to HID functionality, retrieved in - // |GetHidDllFunctions|. - HidPGetCapsFunc hidp_get_caps_; - HidPGetButtonCapsFunc hidp_get_button_caps_; - HidPGetValueCapsFunc hidp_get_value_caps_; - HidPGetUsagesExFunc hidp_get_usages_ex_; - HidPGetUsageValueFunc hidp_get_usage_value_; - HidPGetScaledUsageValueFunc hidp_get_scaled_usage_value_; - HidDGetStringFunc hidd_get_product_string_; + // HID functions loaded from hid.dll. + std::unique_ptr<HidDllFunctionsWin> hid_functions_; DISALLOW_COPY_AND_ASSIGN(RawInputDataFetcher); };
diff --git a/device/u2f/mock_u2f_device.cc b/device/u2f/mock_u2f_device.cc index 547d28a..bb5d375 100644 --- a/device/u2f/mock_u2f_device.cc +++ b/device/u2f/mock_u2f_device.cc
@@ -41,7 +41,9 @@ // static void MockU2fDevice::NoErrorSign(U2fApduCommand* cmd, DeviceCallback& cb) { std::move(cb).Run(true, std::make_unique<U2fApduResponse>( - std::vector<uint8_t>({kSign}), + std::vector<uint8_t>( + std::begin(test_data::kTestU2fSignResponse), + std::end(test_data::kTestU2fSignResponse)), U2fApduResponse::Status::SW_NO_ERROR)); } @@ -56,6 +58,17 @@ } // static +void MockU2fDevice::SignWithCorruptedResponse(U2fApduCommand* cmd, + DeviceCallback& cb) { + std::move(cb).Run( + true, std::make_unique<U2fApduResponse>( + std::vector<uint8_t>( + std::begin(test_data::kTestCorruptedU2fSignResponse), + std::end(test_data::kTestCorruptedU2fSignResponse)), + U2fApduResponse::Status::SW_NO_ERROR)); +} + +// static void MockU2fDevice::WinkDoNothing(WinkCallback& cb) { std::move(cb).Run(); }
diff --git a/device/u2f/mock_u2f_device.h b/device/u2f/mock_u2f_device.h index 2658fbe..cd3cbb7 100644 --- a/device/u2f/mock_u2f_device.h +++ b/device/u2f/mock_u2f_device.h
@@ -18,7 +18,6 @@ class MockU2fDevice : public U2fDevice { public: - static constexpr uint8_t kSign = 0x1; MockU2fDevice(); ~MockU2fDevice() override; @@ -44,6 +43,8 @@ static void WrongData(U2fApduCommand* cmd, DeviceCallback& cb); static void NoErrorSign(U2fApduCommand* cmd, DeviceCallback& cb); static void NoErrorRegister(U2fApduCommand* cmd, DeviceCallback& cb); + static void SignWithCorruptedResponse(U2fApduCommand* cmd, + DeviceCallback& cb); static void WinkDoNothing(WinkCallback& cb); private:
diff --git a/device/u2f/u2f_register.cc b/device/u2f/u2f_register.cc index ef35d72..8d2832c 100644 --- a/device/u2f/u2f_register.cc +++ b/device/u2f/u2f_register.cc
@@ -14,16 +14,16 @@ namespace device { U2fRegister::U2fRegister( + std::string relying_party_id, + std::vector<U2fDiscovery*> discoveries, const std::vector<std::vector<uint8_t>>& registered_keys, const std::vector<uint8_t>& challenge_hash, const std::vector<uint8_t>& app_param, - std::string relying_party_id, - std::vector<U2fDiscovery*> discoveries, RegisterResponseCallback completion_callback) : U2fRequest(std::move(relying_party_id), std::move(discoveries)), + registered_keys_(registered_keys), challenge_hash_(challenge_hash), app_param_(app_param), - registered_keys_(registered_keys), completion_callback_(std::move(completion_callback)), weak_factory_(this) {} @@ -31,15 +31,15 @@ // static std::unique_ptr<U2fRequest> U2fRegister::TryRegistration( + std::string relying_party_id, + std::vector<U2fDiscovery*> discoveries, const std::vector<std::vector<uint8_t>>& registered_keys, const std::vector<uint8_t>& challenge_hash, const std::vector<uint8_t>& app_param, - std::string relying_party_id, - std::vector<U2fDiscovery*> discoveries, RegisterResponseCallback completion_callback) { std::unique_ptr<U2fRequest> request = std::make_unique<U2fRegister>( - registered_keys, challenge_hash, app_param, std::move(relying_party_id), - std::move(discoveries), std::move(completion_callback)); + std::move(relying_party_id), std::move(discoveries), registered_keys, + challenge_hash, app_param, std::move(completion_callback)); request->Start(); return request; }
diff --git a/device/u2f/u2f_register.h b/device/u2f/u2f_register.h index 2f5dc25..35a746a 100644 --- a/device/u2f/u2f_register.h +++ b/device/u2f/u2f_register.h
@@ -20,26 +20,24 @@ class U2fRegister : public U2fRequest { public: - // Response is optional, depending on the status and - // the type of request being served. using RegisterResponseCallback = base::OnceCallback<void( U2fReturnCode status_code, base::Optional<RegisterResponseData> response_data)>; - U2fRegister(const std::vector<std::vector<uint8_t>>& registered_keys, + U2fRegister(std::string relying_party_id, + std::vector<U2fDiscovery*> discoveries, + const std::vector<std::vector<uint8_t>>& registered_keys, const std::vector<uint8_t>& challenge_hash, const std::vector<uint8_t>& app_param, - std::string relying_party_id, - std::vector<U2fDiscovery*> discoveries, RegisterResponseCallback completion_callback); ~U2fRegister() override; static std::unique_ptr<U2fRequest> TryRegistration( + std::string relying_party_id, + std::vector<U2fDiscovery*> discoveries, const std::vector<std::vector<uint8_t>>& registered_keys, const std::vector<uint8_t>& challenge_hash, const std::vector<uint8_t>& app_param, - std::string relying_party_id, - std::vector<U2fDiscovery*> discoveries, RegisterResponseCallback completion_callback); private: @@ -62,9 +60,9 @@ // registration for all key handles provided in |registered_keys_|. bool CheckedForDuplicateRegistration(); + const std::vector<std::vector<uint8_t>> registered_keys_; std::vector<uint8_t> challenge_hash_; std::vector<uint8_t> app_param_; - const std::vector<std::vector<uint8_t>> registered_keys_; RegisterResponseCallback completion_callback_; // List of authenticators that did not create any of the key handles in the
diff --git a/device/u2f/u2f_register_unittest.cc b/device/u2f/u2f_register_unittest.cc index d59765b..c1f8358 100644 --- a/device/u2f/u2f_register_unittest.cc +++ b/device/u2f/u2f_register_unittest.cc
@@ -327,8 +327,9 @@ TestRegisterCallback cb; std::vector<std::vector<uint8_t>> registration_keys; std::unique_ptr<U2fRequest> request = U2fRegister::TryRegistration( - registration_keys, std::vector<uint8_t>(32), std::vector<uint8_t>(32), - kTestRelyingPartyId, {&discovery}, std::move(cb.callback())); + kTestRelyingPartyId, {&discovery}, registration_keys, + std::vector<uint8_t>(32), std::vector<uint8_t>(32), + std::move(cb.callback())); request->Start(); discovery.AddDevice(std::move(device)); const std::pair<U2fReturnCode, base::Optional<RegisterResponseData>>& @@ -357,8 +358,9 @@ std::vector<std::vector<uint8_t>> registration_keys; std::unique_ptr<U2fRequest> request = U2fRegister::TryRegistration( - registration_keys, std::vector<uint8_t>(32), std::vector<uint8_t>(32), - kTestRelyingPartyId, {&discovery}, std::move(cb.callback())); + kTestRelyingPartyId, {&discovery}, registration_keys, + std::vector<uint8_t>(32), std::vector<uint8_t>(32), + std::move(cb.callback())); request->Start(); discovery.AddDevice(std::move(device)); const std::pair<U2fReturnCode, base::Optional<RegisterResponseData>>& @@ -393,8 +395,9 @@ TestRegisterCallback cb; std::vector<std::vector<uint8_t>> registration_keys; std::unique_ptr<U2fRequest> request = U2fRegister::TryRegistration( - registration_keys, std::vector<uint8_t>(32), std::vector<uint8_t>(32), - kTestRelyingPartyId, {&discovery}, std::move(cb.callback())); + kTestRelyingPartyId, {&discovery}, registration_keys, + std::vector<uint8_t>(32), std::vector<uint8_t>(32), + std::move(cb.callback())); request->Start(); discovery.AddDevice(std::move(device0)); discovery.AddDevice(std::move(device1)); @@ -443,8 +446,8 @@ TestRegisterCallback cb; std::unique_ptr<U2fRequest> request = U2fRegister::TryRegistration( - handles, std::vector<uint8_t>(32), std::vector<uint8_t>(32), - kTestRelyingPartyId, {&discovery}, std::move(cb.callback())); + kTestRelyingPartyId, {&discovery}, handles, std::vector<uint8_t>(32), + std::vector<uint8_t>(32), std::move(cb.callback())); discovery.AddDevice(std::move(device)); const std::pair<U2fReturnCode, base::Optional<RegisterResponseData>>& @@ -505,8 +508,8 @@ TestRegisterCallback cb; std::unique_ptr<U2fRequest> request = U2fRegister::TryRegistration( - handles, std::vector<uint8_t>(32), std::vector<uint8_t>(32), - kTestRelyingPartyId, {&discovery}, std::move(cb.callback())); + kTestRelyingPartyId, {&discovery}, handles, std::vector<uint8_t>(32), + std::vector<uint8_t>(32), std::move(cb.callback())); discovery.AddDevice(std::move(device0)); discovery.AddDevice(std::move(device1)); @@ -560,8 +563,8 @@ testing::Invoke(&discovery, &MockU2fDiscovery::StartSuccessAsync)); TestRegisterCallback cb; std::unique_ptr<U2fRequest> request = U2fRegister::TryRegistration( - handles, std::vector<uint8_t>(32), std::vector<uint8_t>(32), - kTestRelyingPartyId, {&discovery}, std::move(cb.callback())); + kTestRelyingPartyId, {&discovery}, handles, std::vector<uint8_t>(32), + std::vector<uint8_t>(32), std::move(cb.callback())); discovery.AddDevice(std::move(device)); const std::pair<U2fReturnCode, base::Optional<RegisterResponseData>>& response = cb.WaitForCallback(); @@ -624,8 +627,8 @@ testing::Invoke(&discovery, &MockU2fDiscovery::StartSuccessAsync)); TestRegisterCallback cb; std::unique_ptr<U2fRequest> request = U2fRegister::TryRegistration( - handles, std::vector<uint8_t>(32), std::vector<uint8_t>(32), - kTestRelyingPartyId, {&discovery}, std::move(cb.callback())); + kTestRelyingPartyId, {&discovery}, handles, std::vector<uint8_t>(32), + std::vector<uint8_t>(32), std::move(cb.callback())); discovery.AddDevice(std::move(device0)); discovery.AddDevice(std::move(device1)); const std::pair<U2fReturnCode, base::Optional<RegisterResponseData>>&
diff --git a/device/u2f/u2f_request.h b/device/u2f/u2f_request.h index 8cd1c9e..f75e4d5 100644 --- a/device/u2f/u2f_request.h +++ b/device/u2f/u2f_request.h
@@ -17,13 +17,6 @@ class U2fRequest : public U2fDiscovery::Observer { public: - // Response and key_handle are optional, depending on the status and - // the type of request being served. - using ResponseCallback = - base::RepeatingCallback<void(U2fReturnCode status_code, - const std::vector<uint8_t>& response, - const std::vector<uint8_t>& key_handle)>; - // U2fRequest will register itself as an observer for each entry in // |discoveries|. Clients need to ensure that each discovery outlives this // request.
diff --git a/device/u2f/u2f_request_unittest.cc b/device/u2f/u2f_request_unittest.cc index 47e1dc0b..42134a8 100644 --- a/device/u2f/u2f_request_unittest.cc +++ b/device/u2f/u2f_request_unittest.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include <list> +#include <string> #include <utility> #include "base/memory/ptr_util.h" @@ -23,25 +24,15 @@ class FakeU2fRequest : public U2fRequest { public: FakeU2fRequest(std::string relying_party_id, - std::vector<U2fDiscovery*> discoveries, - const ResponseCallback& cb) - : U2fRequest(std::move(relying_party_id), std::move(discoveries)), - cb_(cb) {} + std::vector<U2fDiscovery*> discoveries) + : U2fRequest(std::move(relying_party_id), std::move(discoveries)) {} ~FakeU2fRequest() override = default; void TryDevice() override { - cb_.Run(U2fReturnCode::SUCCESS, std::vector<uint8_t>(), - std::vector<uint8_t>()); + // Do nothing. } - - private: - ResponseCallback cb_; }; -void ReponseDoNothing(U2fReturnCode status_code, - const std::vector<uint8_t>& response, - const std::vector<uint8_t>& key_handle) {} - } // namespace class U2fRequestTest : public testing::Test { @@ -56,8 +47,7 @@ TEST_F(U2fRequestTest, TestIterateDevice) { MockU2fDiscovery discovery; - FakeU2fRequest request(kTestRelyingPartyId, {&discovery}, - base::BindRepeating(ReponseDoNothing)); + FakeU2fRequest request(kTestRelyingPartyId, {&discovery}); auto device0 = std::make_unique<MockU2fDevice>(); auto device1 = std::make_unique<MockU2fDevice>(); @@ -103,8 +93,7 @@ EXPECT_CALL(discovery, Start()) .WillOnce(testing::Invoke(&discovery, &MockU2fDiscovery::StartSuccess)); - FakeU2fRequest request(kTestRelyingPartyId, {&discovery}, - base::BindRepeating(ReponseDoNothing)); + FakeU2fRequest request(kTestRelyingPartyId, {&discovery}); request.Start(); // Add one U2F device @@ -126,8 +115,7 @@ EXPECT_CALL(discovery, Start()) .WillOnce(testing::Invoke(&discovery, &MockU2fDiscovery::StartSuccess)); - FakeU2fRequest request(kTestRelyingPartyId, {&discovery}, - base::BindRepeating(ReponseDoNothing)); + FakeU2fRequest request(kTestRelyingPartyId, {&discovery}); request.Start(); EXPECT_NE(nullptr, request.current_device_);
diff --git a/device/u2f/u2f_response_test_data.h b/device/u2f/u2f_response_test_data.h index f4977cc..f6cd7e2 100644 --- a/device/u2f/u2f_response_test_data.h +++ b/device/u2f/u2f_response_test_data.h
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// This file declares common data used to test U2F register and sign responses. +// This file contains common data used to test U2F register and sign responses. #ifndef DEVICE_U2F_U2F_RESPONSE_TEST_DATA_H_ #define DEVICE_U2F_U2F_RESPONSE_TEST_DATA_H_ @@ -90,6 +90,18 @@ 0x6F, 0x48, 0xB8, 0x25, 0x69, 0xEA, 0xD8, 0x23, 0x1A, 0x5A, 0x6C, 0x3A, 0x14, 0x48, 0xDE, 0xAA, 0xAF, 0x15, 0xC0, 0xEF, 0x29, 0x63, 0x1A}; +// U2F response blob produced by a U2F sign request. +constexpr uint8_t kTestU2fSignResponse[] = { + 0x01, 0x00, 0x00, 0x00, 0x25, 0x30, 0x45, 0x02, 0x21, 0x00, 0xCA, + 0xA5, 0x3E, 0x91, 0x0D, 0xB7, 0x5E, 0xDE, 0xAF, 0x72, 0xCF, 0x9F, + 0x6F, 0x54, 0xE5, 0x20, 0x5B, 0xBB, 0xB9, 0x2F, 0x0B, 0x9F, 0x7D, + 0xC6, 0xF8, 0xD4, 0x7B, 0x19, 0x70, 0xED, 0xFE, 0xBC, 0x02, 0x20, + 0x06, 0x32, 0x83, 0x65, 0x26, 0x4E, 0xBE, 0xFE, 0x35, 0x3C, 0x95, + 0x91, 0xDF, 0xCE, 0x7D, 0x73, 0x15, 0x98, 0x64, 0xDF, 0xEA, 0xB7, + 0x87, 0xF1, 0x5D, 0xF8, 0xA5, 0x97, 0xD0, 0x85, 0x0C, 0xA2}; + +// A sample corrupted response to a U2F sign request. +constexpr uint8_t kTestCorruptedU2fSignResponse[] = {0x01, 0x00, 0x00, 0x00}; } // namespace test_data } // namespace device
diff --git a/device/u2f/u2f_sign.cc b/device/u2f/u2f_sign.cc index 1a234f51..aa3da41 100644 --- a/device/u2f/u2f_sign.cc +++ b/device/u2f/u2f_sign.cc
@@ -11,32 +11,32 @@ namespace device { -U2fSign::U2fSign(const std::vector<std::vector<uint8_t>>& registered_keys, +U2fSign::U2fSign(std::string relying_party_id, + std::vector<U2fDiscovery*> discoveries, + const std::vector<std::vector<uint8_t>>& registered_keys, const std::vector<uint8_t>& challenge_hash, const std::vector<uint8_t>& app_param, - std::string relying_party_id, - std::vector<U2fDiscovery*> discoveries, - const ResponseCallback& completion_callback) + SignResponseCallback completion_callback) : U2fRequest(std::move(relying_party_id), std::move(discoveries)), - completion_callback_(std::move(completion_callback)), registered_keys_(registered_keys), challenge_hash_(challenge_hash), app_param_(app_param), + completion_callback_(std::move(completion_callback)), weak_factory_(this) {} U2fSign::~U2fSign() = default; // static std::unique_ptr<U2fRequest> U2fSign::TrySign( + std::string relying_party_id, + std::vector<U2fDiscovery*> discoveries, const std::vector<std::vector<uint8_t>>& registered_keys, const std::vector<uint8_t>& challenge_hash, const std::vector<uint8_t>& app_param, - std::string relying_party_id, - std::vector<U2fDiscovery*> discoveries, - const ResponseCallback& completion_callback) { + SignResponseCallback completion_callback) { std::unique_ptr<U2fRequest> request = std::make_unique<U2fSign>( - registered_keys, challenge_hash, app_param, std::move(relying_party_id), - std::move(discoveries), completion_callback); + std::move(relying_party_id), std::move(discoveries), registered_keys, + challenge_hash, app_param, std::move(completion_callback)); request->Start(); return request; @@ -64,16 +64,25 @@ U2fReturnCode return_code, const std::vector<uint8_t>& response_data) { switch (return_code) { - case U2fReturnCode::SUCCESS: + case U2fReturnCode::SUCCESS: { state_ = State::COMPLETE; if (it == registered_keys_.cend()) { // This was a response to a fake enrollment. Return an empty key handle. - completion_callback_.Run(return_code, response_data, - std::vector<uint8_t>()); + std::move(completion_callback_) + .Run(U2fReturnCode::CONDITIONS_NOT_SATISFIED, base::nullopt); } else { - completion_callback_.Run(return_code, response_data, *it); + auto sign_response = SignResponseData::CreateFromU2fSignResponse( + relying_party_id_, std::move(response_data), *it); + if (!sign_response) { + std::move(completion_callback_) + .Run(U2fReturnCode::FAILURE, base::nullopt); + } else { + std::move(completion_callback_) + .Run(U2fReturnCode::SUCCESS, std::move(sign_response)); + } } break; + } case U2fReturnCode::CONDITIONS_NOT_SATISFIED: { // Key handle is accepted by this device, but waiting on user touch. Move // on and try this device again later. @@ -81,7 +90,7 @@ Transition(); break; } - case U2fReturnCode::INVALID_PARAMS: + case U2fReturnCode::INVALID_PARAMS: { if (++it != registered_keys_.end()) { // Key is not for this device. Try signing with the next key. current_device_->Sign( @@ -96,6 +105,7 @@ registered_keys_.cend())); } break; + } default: // Some sort of failure occured. Abandon this device and move on. state_ = State::IDLE;
diff --git a/device/u2f/u2f_sign.h b/device/u2f/u2f_sign.h index 8f8325e..4ab8d2f 100644 --- a/device/u2f/u2f_sign.h +++ b/device/u2f/u2f_sign.h
@@ -9,6 +9,8 @@ #include <string> #include <vector> +#include "base/optional.h" +#include "device/u2f/sign_response_data.h" #include "device/u2f/u2f_request.h" namespace device { @@ -17,21 +19,25 @@ class U2fSign : public U2fRequest { public: - U2fSign(const std::vector<std::vector<uint8_t>>& registered_keys, + using SignResponseCallback = + base::OnceCallback<void(U2fReturnCode status_code, + base::Optional<SignResponseData> response_data)>; + + U2fSign(std::string relying_party_id, + std::vector<U2fDiscovery*> discoveries, + const std::vector<std::vector<uint8_t>>& registered_keys, const std::vector<uint8_t>& challenge_hash, const std::vector<uint8_t>& app_param, - std::string relying_party_id, - std::vector<U2fDiscovery*> discoveries, - const ResponseCallback& completion_callback); + SignResponseCallback completion_callback); ~U2fSign() override; static std::unique_ptr<U2fRequest> TrySign( + std::string relying_party_id, + std::vector<U2fDiscovery*> discoveries, const std::vector<std::vector<uint8_t>>& registered_keys, const std::vector<uint8_t>& challenge_hash, const std::vector<uint8_t>& app_param, - std::string relying_party_id, - std::vector<U2fDiscovery*> discoveries, - const ResponseCallback& completion_callback); + SignResponseCallback completion_callback); private: void TryDevice() override; @@ -39,10 +45,10 @@ U2fReturnCode return_code, const std::vector<uint8_t>& response_data); - ResponseCallback completion_callback_; const std::vector<std::vector<uint8_t>> registered_keys_; std::vector<uint8_t> challenge_hash_; std::vector<uint8_t> app_param_; + SignResponseCallback completion_callback_; base::WeakPtrFactory<U2fSign> weak_factory_; };
diff --git a/device/u2f/u2f_sign_unittest.cc b/device/u2f/u2f_sign_unittest.cc index 23a59ff4..a543b54d 100644 --- a/device/u2f/u2f_sign_unittest.cc +++ b/device/u2f/u2f_sign_unittest.cc
@@ -4,7 +4,6 @@ #include "device/u2f/u2f_sign.h" -#include <tuple> #include <utility> #include "base/run_loop.h" @@ -29,15 +28,6 @@ constexpr uint8_t kTestSignatureCounter[] = {0x00, 0x00, 0x00, 0x25}; // Test data specific to GetAssertion/Sign. -constexpr uint8_t kTestU2fSignResponse[] = { - 0x01, 0x00, 0x00, 0x00, 0x25, 0x30, 0x45, 0x02, 0x21, 0x00, 0xCA, - 0xA5, 0x3E, 0x91, 0x0D, 0xB7, 0x5E, 0xDE, 0xAF, 0x72, 0xCF, 0x9F, - 0x6F, 0x54, 0xE5, 0x20, 0x5B, 0xBB, 0xB9, 0x2F, 0x0B, 0x9F, 0x7D, - 0xC6, 0xF8, 0xD4, 0x7B, 0x19, 0x70, 0xED, 0xFE, 0xBC, 0x02, 0x20, - 0x06, 0x32, 0x83, 0x65, 0x26, 0x4E, 0xBE, 0xFE, 0x35, 0x3C, 0x95, - 0x91, 0xDF, 0xCE, 0x7D, 0x73, 0x15, 0x98, 0x64, 0xDF, 0xEA, 0xB7, - 0x87, 0xF1, 0x5D, 0xF8, 0xA5, 0x97, 0xD0, 0x85, 0x0C, 0xA2}; - constexpr uint8_t kTestAssertionSignature[] = { 0x30, 0x45, 0x02, 0x21, 0x00, 0xCA, 0xA5, 0x3E, 0x91, 0x0D, 0xB7, 0x5E, 0xDE, 0xAF, 0x72, 0xCF, 0x9F, 0x6F, 0x54, 0xE5, 0x20, 0x5B, 0xBB, 0xB9, @@ -64,8 +54,8 @@ } std::vector<uint8_t> GetTestSignResponse() { - return std::vector<uint8_t>(std::begin(kTestU2fSignResponse), - std::end(kTestU2fSignResponse)); + return std::vector<uint8_t>(std::begin(test_data::kTestU2fSignResponse), + std::end(test_data::kTestU2fSignResponse)); } std::vector<uint8_t> GetTestAuthenticatorData() { @@ -85,8 +75,9 @@ // Get a subset of the response for testing error handling. std::vector<uint8_t> GetTestCorruptedSignResponse(size_t length) { - return std::vector<uint8_t>(kTestU2fSignResponse, - kTestU2fSignResponse + length); + DCHECK_LE(length, arraysize(test_data::kTestU2fSignResponse)); + return std::vector<uint8_t>(test_data::kTestU2fSignResponse, + test_data::kTestU2fSignResponse + length); } } // namespace @@ -109,75 +100,71 @@ ~TestSignCallback() = default; void ReceivedCallback(U2fReturnCode status_code, - const std::vector<uint8_t>& response, - const std::vector<uint8_t>& key_handle) { - response_ = std::make_tuple(status_code, response, key_handle); + base::Optional<SignResponseData> response_data) { + response_ = std::make_pair(status_code, std::move(response_data)); closure_.Run(); } - std::tuple<U2fReturnCode, std::vector<uint8_t>, std::vector<uint8_t>>& - WaitForCallback() { + void WaitForCallback() { closure_ = run_loop_.QuitClosure(); run_loop_.Run(); - return response_; } - const U2fRequest::ResponseCallback& callback() { return callback_; } + U2fReturnCode GetReturnCode() { return std::get<0>(response_); } + + const base::Optional<SignResponseData>& GetResponseData() { + return std::get<1>(response_); + } + + U2fSign::SignResponseCallback& callback() { return callback_; } private: - std::tuple<U2fReturnCode, std::vector<uint8_t>, std::vector<uint8_t>> - response_; + std::pair<U2fReturnCode, base::Optional<SignResponseData>> response_; base::Closure closure_; - U2fRequest::ResponseCallback callback_; + U2fSign::SignResponseCallback callback_; base::RunLoop run_loop_; }; TEST_F(U2fSignTest, TestSignSuccess) { - std::vector<uint8_t> key(32, 0xA); - std::vector<std::vector<uint8_t>> handles = {key}; - std::unique_ptr<MockU2fDevice> device(new MockU2fDevice()); + auto device = std::make_unique<MockU2fDevice>(); MockU2fDiscovery discovery; - EXPECT_CALL(*device.get(), GetId()).WillOnce(testing::Return("device")); - EXPECT_CALL(*device.get(), DeviceTransactPtr(_, _)) + EXPECT_CALL(*device, GetId()).WillOnce(testing::Return("device")); + EXPECT_CALL(*device, DeviceTransactPtr(_, _)) .WillOnce(testing::Invoke(MockU2fDevice::NoErrorSign)); - EXPECT_CALL(*device.get(), TryWinkRef(_)) + EXPECT_CALL(*device, TryWinkRef(_)) .WillOnce(testing::Invoke(MockU2fDevice::WinkDoNothing)); EXPECT_CALL(discovery, Start()) .WillOnce( testing::Invoke(&discovery, &MockU2fDiscovery::StartSuccessAsync)); TestSignCallback cb; + std::vector<uint8_t> key(32, 0xA); std::unique_ptr<U2fRequest> request = U2fSign::TrySign( - handles, std::vector<uint8_t>(32), std::vector<uint8_t>(32), - kTestRelyingPartyId, {&discovery}, cb.callback()); - + kTestRelyingPartyId, {&discovery}, + std::vector<std::vector<uint8_t>>({key}), std::vector<uint8_t>(32), + std::vector<uint8_t>(32), std::move(cb.callback())); discovery.AddDevice(std::move(device)); - std::tuple<U2fReturnCode, std::vector<uint8_t>, std::vector<uint8_t>>& - response = cb.WaitForCallback(); - EXPECT_EQ(U2fReturnCode::SUCCESS, std::get<0>(response)); + cb.WaitForCallback(); + EXPECT_EQ(U2fReturnCode::SUCCESS, cb.GetReturnCode()); // Correct key was sent so a sign response is expected - ASSERT_GE(1u, std::get<1>(response).size()); - EXPECT_EQ(static_cast<uint8_t>(MockU2fDevice::kSign), - std::get<1>(response)[0]); + EXPECT_EQ(GetTestAssertionSignature(), cb.GetResponseData()->signature()); - // Verify that we get the key handle used for signing. - EXPECT_EQ(key, std::get<2>(response)); + // Verify that we get the key handle used for signing + EXPECT_EQ(key, cb.GetResponseData()->raw_id()); } TEST_F(U2fSignTest, TestDelayedSuccess) { - std::vector<uint8_t> key(32, 0xA); - std::vector<std::vector<uint8_t>> handles = {key}; - std::unique_ptr<MockU2fDevice> device(new MockU2fDevice()); + auto device = std::make_unique<MockU2fDevice>(); MockU2fDiscovery discovery; // Go through the state machine twice before success EXPECT_CALL(*device, GetId()).WillOnce(testing::Return("device")); - EXPECT_CALL(*device.get(), DeviceTransactPtr(_, _)) + EXPECT_CALL(*device, DeviceTransactPtr(_, _)) .WillOnce(testing::Invoke(MockU2fDevice::NotSatisfied)) .WillOnce(testing::Invoke(MockU2fDevice::NoErrorSign)); - EXPECT_CALL(*device.get(), TryWinkRef(_)) + EXPECT_CALL(*device, TryWinkRef(_)) .Times(2) .WillRepeatedly(testing::Invoke(MockU2fDevice::WinkDoNothing)); EXPECT_CALL(discovery, Start()) @@ -185,23 +172,22 @@ testing::Invoke(&discovery, &MockU2fDiscovery::StartSuccessAsync)); TestSignCallback cb; + std::vector<uint8_t> key(32, 0xA); std::unique_ptr<U2fRequest> request = U2fSign::TrySign( - handles, std::vector<uint8_t>(32), std::vector<uint8_t>(32), - kTestRelyingPartyId, {&discovery}, cb.callback()); + kTestRelyingPartyId, {&discovery}, + std::vector<std::vector<uint8_t>>({key}), std::vector<uint8_t>(32), + std::vector<uint8_t>(32), std::move(cb.callback())); request->Start(); discovery.AddDevice(std::move(device)); - std::tuple<U2fReturnCode, std::vector<uint8_t>, std::vector<uint8_t>>& - response = cb.WaitForCallback(); - EXPECT_EQ(U2fReturnCode::SUCCESS, std::get<0>(response)); + cb.WaitForCallback(); + EXPECT_EQ(U2fReturnCode::SUCCESS, cb.GetReturnCode()); // Correct key was sent so a sign response is expected - ASSERT_GE(1u, std::get<1>(response).size()); - EXPECT_EQ(static_cast<uint8_t>(MockU2fDevice::kSign), - std::get<1>(response)[0]); + EXPECT_EQ(GetTestAssertionSignature(), cb.GetResponseData()->signature()); - // Verify that we get the key handle used for signing. - EXPECT_EQ(key, std::get<2>(response)); + // Verify that we get the key handle used for signing + EXPECT_EQ(key, cb.GetResponseData()->raw_id()); } TEST_F(U2fSignTest, TestMultipleHandles) { @@ -212,18 +198,18 @@ // Put wrong key first to ensure that it will be tested before the correct key std::vector<std::vector<uint8_t>> handles = {wrong_key0, wrong_key1, wrong_key2, key}; - std::unique_ptr<MockU2fDevice> device(new MockU2fDevice()); + auto device = std::make_unique<MockU2fDevice>(); MockU2fDiscovery discovery; // Wrong key would respond with SW_WRONG_DATA - EXPECT_CALL(*device.get(), GetId()).WillOnce(testing::Return("device")); - EXPECT_CALL(*device.get(), DeviceTransactPtr(_, _)) + EXPECT_CALL(*device, GetId()).WillOnce(testing::Return("device")); + EXPECT_CALL(*device, DeviceTransactPtr(_, _)) .WillOnce(testing::Invoke(MockU2fDevice::WrongData)) .WillOnce(testing::Invoke(MockU2fDevice::WrongData)) .WillOnce(testing::Invoke(MockU2fDevice::WrongData)) .WillOnce(testing::Invoke(MockU2fDevice::NoErrorSign)); // Only one wink expected per device - EXPECT_CALL(*device.get(), TryWinkRef(_)) + EXPECT_CALL(*device, TryWinkRef(_)) .WillOnce(testing::Invoke(MockU2fDevice::WinkDoNothing)); EXPECT_CALL(discovery, Start()) .WillOnce( @@ -231,20 +217,18 @@ TestSignCallback cb; std::unique_ptr<U2fRequest> request = U2fSign::TrySign( - handles, std::vector<uint8_t>(32), std::vector<uint8_t>(32), - kTestRelyingPartyId, {&discovery}, cb.callback()); + kTestRelyingPartyId, {&discovery}, handles, std::vector<uint8_t>(32), + std::vector<uint8_t>(32), std::move(cb.callback())); discovery.AddDevice(std::move(device)); - std::tuple<U2fReturnCode, std::vector<uint8_t>, std::vector<uint8_t>>& - response = cb.WaitForCallback(); - EXPECT_EQ(U2fReturnCode::SUCCESS, std::get<0>(response)); + + cb.WaitForCallback(); + EXPECT_EQ(U2fReturnCode::SUCCESS, cb.GetReturnCode()); // Correct key was sent so a sign response is expected - ASSERT_GE(1u, std::get<1>(response).size()); - EXPECT_EQ(static_cast<uint8_t>(MockU2fDevice::kSign), - std::get<1>(response)[0]); + EXPECT_EQ(GetTestAssertionSignature(), cb.GetResponseData()->signature()); - // Verify that we get the key handle used for signing. - EXPECT_EQ(key, std::get<2>(response)); + // Verify that we get the key handle used for signing + EXPECT_EQ(key, cb.GetResponseData()->raw_id()); } TEST_F(U2fSignTest, TestMultipleDevices) { @@ -252,22 +236,22 @@ std::vector<uint8_t> key1(32, 0xB); // Second device will have a successful touch std::vector<std::vector<uint8_t>> handles = {key0, key1}; - std::unique_ptr<MockU2fDevice> device0(new MockU2fDevice()); - std::unique_ptr<MockU2fDevice> device1(new MockU2fDevice()); + auto device0 = std::make_unique<MockU2fDevice>(); + auto device1 = std::make_unique<MockU2fDevice>(); MockU2fDiscovery discovery; EXPECT_CALL(*device0, GetId()).WillOnce(testing::Return("device0")); EXPECT_CALL(*device1, GetId()).WillOnce(testing::Return("device1")); - EXPECT_CALL(*device0.get(), DeviceTransactPtr(_, _)) + EXPECT_CALL(*device0, DeviceTransactPtr(_, _)) .WillOnce(testing::Invoke(MockU2fDevice::WrongData)) .WillOnce(testing::Invoke(MockU2fDevice::NotSatisfied)); // One wink per device - EXPECT_CALL(*device0.get(), TryWinkRef(_)) + EXPECT_CALL(*device0, TryWinkRef(_)) .WillOnce(testing::Invoke(MockU2fDevice::WinkDoNothing)); - EXPECT_CALL(*device1.get(), DeviceTransactPtr(_, _)) + EXPECT_CALL(*device1, DeviceTransactPtr(_, _)) .WillOnce(testing::Invoke(MockU2fDevice::NoErrorSign)); - EXPECT_CALL(*device1.get(), TryWinkRef(_)) + EXPECT_CALL(*device1, TryWinkRef(_)) .WillOnce(testing::Invoke(MockU2fDevice::WinkDoNothing)); EXPECT_CALL(discovery, Start()) .WillOnce( @@ -275,21 +259,19 @@ TestSignCallback cb; std::unique_ptr<U2fRequest> request = U2fSign::TrySign( - handles, std::vector<uint8_t>(32), std::vector<uint8_t>(32), - kTestRelyingPartyId, {&discovery}, cb.callback()); + kTestRelyingPartyId, {&discovery}, handles, std::vector<uint8_t>(32), + std::vector<uint8_t>(32), std::move(cb.callback())); discovery.AddDevice(std::move(device0)); discovery.AddDevice(std::move(device1)); - std::tuple<U2fReturnCode, std::vector<uint8_t>, std::vector<uint8_t>>& - response = cb.WaitForCallback(); - EXPECT_EQ(U2fReturnCode::SUCCESS, std::get<0>(response)); + + cb.WaitForCallback(); + EXPECT_EQ(U2fReturnCode::SUCCESS, cb.GetReturnCode()); // Correct key was sent so a sign response is expected - ASSERT_GE(1u, std::get<1>(response).size()); - EXPECT_EQ(static_cast<uint8_t>(MockU2fDevice::kSign), - std::get<1>(response)[0]); + EXPECT_EQ(GetTestAssertionSignature(), cb.GetResponseData()->signature()); - // Verify that we get the key handle used for signing. - EXPECT_EQ(key0, std::get<2>(response)); + // Verify that we get the key handle used for signing + EXPECT_EQ(key0, cb.GetResponseData()->raw_id()); } TEST_F(U2fSignTest, TestFakeEnroll) { @@ -297,24 +279,24 @@ std::vector<uint8_t> key1(32, 0xB); // Second device will be have a successful touch std::vector<std::vector<uint8_t>> handles = {key0, key1}; - std::unique_ptr<MockU2fDevice> device0(new MockU2fDevice()); - std::unique_ptr<MockU2fDevice> device1(new MockU2fDevice()); + auto device0 = std::make_unique<MockU2fDevice>(); + auto device1 = std::make_unique<MockU2fDevice>(); MockU2fDiscovery discovery; - EXPECT_CALL(*device0.get(), GetId()).WillOnce(testing::Return("device0")); - EXPECT_CALL(*device1.get(), GetId()).WillOnce(testing::Return("device1")); - EXPECT_CALL(*device0.get(), DeviceTransactPtr(_, _)) + EXPECT_CALL(*device0, GetId()).WillOnce(testing::Return("device0")); + EXPECT_CALL(*device1, GetId()).WillOnce(testing::Return("device1")); + EXPECT_CALL(*device0, DeviceTransactPtr(_, _)) .WillOnce(testing::Invoke(MockU2fDevice::WrongData)) .WillOnce(testing::Invoke(MockU2fDevice::NotSatisfied)); // One wink per device - EXPECT_CALL(*device0.get(), TryWinkRef(_)) + EXPECT_CALL(*device0, TryWinkRef(_)) .WillOnce(testing::Invoke(MockU2fDevice::WinkDoNothing)); // Both keys will be tried, when both fail, register is tried on that device - EXPECT_CALL(*device1.get(), DeviceTransactPtr(_, _)) + EXPECT_CALL(*device1, DeviceTransactPtr(_, _)) .WillOnce(testing::Invoke(MockU2fDevice::WrongData)) .WillOnce(testing::Invoke(MockU2fDevice::WrongData)) .WillOnce(testing::Invoke(MockU2fDevice::NoErrorRegister)); - EXPECT_CALL(*device1.get(), TryWinkRef(_)) + EXPECT_CALL(*device1, TryWinkRef(_)) .WillOnce(testing::Invoke(MockU2fDevice::WinkDoNothing)); EXPECT_CALL(discovery, Start()) .WillOnce( @@ -322,24 +304,17 @@ TestSignCallback cb; std::unique_ptr<U2fRequest> request = U2fSign::TrySign( - handles, std::vector<uint8_t>(32), std::vector<uint8_t>(32), - kTestRelyingPartyId, {&discovery}, cb.callback()); + kTestRelyingPartyId, {&discovery}, handles, std::vector<uint8_t>(32), + std::vector<uint8_t>(32), std::move(cb.callback())); request->Start(); discovery.AddDevice(std::move(device0)); discovery.AddDevice(std::move(device1)); - std::tuple<U2fReturnCode, std::vector<uint8_t>, std::vector<uint8_t>>& - response = cb.WaitForCallback(); - EXPECT_EQ(U2fReturnCode::SUCCESS, std::get<0>(response)); - // Device that responded had no correct keys, so a registration response is - // expected. - EXPECT_EQ( - std::vector<uint8_t>(std::begin(test_data::kTestU2fRegisterResponse), - std::end(test_data::kTestU2fRegisterResponse)), - std::get<1>(response)); + cb.WaitForCallback(); - // Verify that we get a blank key handle for the key that was registered. - EXPECT_TRUE(std::get<2>(response).empty()); + // Device that responded had no correct keys. + EXPECT_EQ(U2fReturnCode::CONDITIONS_NOT_SATISFIED, cb.GetReturnCode()); + EXPECT_FALSE(cb.GetResponseData()); } TEST_F(U2fSignTest, TestAuthenticatorDataForSign) { @@ -367,7 +342,7 @@ base::Optional<SignResponseData> response = SignResponseData::CreateFromU2fSignResponse( kTestRelyingPartyId, GetTestSignResponse(), std::vector<uint8_t>()); - EXPECT_EQ(base::nullopt, response); + EXPECT_FALSE(response); } TEST_F(U2fSignTest, TestNullResponse) { @@ -375,7 +350,7 @@ SignResponseData::CreateFromU2fSignResponse( kTestRelyingPartyId, std::vector<uint8_t>(), GetTestCredentialRawIdBytes()); - EXPECT_EQ(base::nullopt, response); + EXPECT_FALSE(response); } TEST_F(U2fSignTest, TestCorruptedCounter) { @@ -384,7 +359,7 @@ SignResponseData::CreateFromU2fSignResponse( kTestRelyingPartyId, GetTestCorruptedSignResponse(3), GetTestCredentialRawIdBytes()); - EXPECT_EQ(base::nullopt, response); + EXPECT_FALSE(response); } TEST_F(U2fSignTest, TestCorruptedSignature) { @@ -393,6 +368,32 @@ SignResponseData::CreateFromU2fSignResponse( kTestRelyingPartyId, GetTestCorruptedSignResponse(5), GetTestCredentialRawIdBytes()); - EXPECT_EQ(base::nullopt, response); + EXPECT_FALSE(response); +} + +// Device returns success, but the response is unparse-able. +TEST_F(U2fSignTest, TestSignWithCorruptedResponse) { + auto device = std::make_unique<MockU2fDevice>(); + MockU2fDiscovery discovery; + + EXPECT_CALL(*device, GetId()).WillOnce(testing::Return("device")); + EXPECT_CALL(*device, DeviceTransactPtr(_, _)) + .WillOnce(testing::Invoke(MockU2fDevice::SignWithCorruptedResponse)); + EXPECT_CALL(*device, TryWinkRef(_)) + .WillOnce(testing::Invoke(MockU2fDevice::WinkDoNothing)); + EXPECT_CALL(discovery, Start()) + .WillOnce( + testing::Invoke(&discovery, &MockU2fDiscovery::StartSuccessAsync)); + TestSignCallback cb; + + std::vector<uint8_t> key(32, 0xA); + std::unique_ptr<U2fRequest> request = U2fSign::TrySign( + kTestRelyingPartyId, {&discovery}, + std::vector<std::vector<uint8_t>>({key}), std::vector<uint8_t>(32), + std::vector<uint8_t>(32), std::move(cb.callback())); + discovery.AddDevice(std::move(device)); + cb.WaitForCallback(); + EXPECT_EQ(U2fReturnCode::FAILURE, cb.GetReturnCode()); + EXPECT_FALSE(cb.GetResponseData()); } } // namespace device
diff --git a/docs/memory/tools.md b/docs/memory/tools.md index dcabe2a7..60dbd15 100644 --- a/docs/memory/tools.md +++ b/docs/memory/tools.md
@@ -12,91 +12,24 @@ Here is a table of common area of inquiry and suggested tools for examining them. -| Topic/Area of Inquiry | Tool(s) | What this is good for | Caveats | -|----------------------- | ------- | --------------------- | ------- | -| Object allocation over time | [`diff_heap_profiler.py`](#diff-heap-profiler), [memory-infra in Chrome Tracing](#tracing-memory-infra) | Finding leaked C++ objects over time. | -| Self-reported stats for resource usage per subsystem | [memory-infra in Chrome Tracing](#tracing-memory-infra) | Gaining a global overview of which subsystems are using memory. | -| Suspected Renderer DOM leaks | [Real World Leak Detector](#real-world-leak-detector) | Finding leaks within the Renderer where C++ objects are refcounted using Oilpan | -| Kernel/Drive Resource Usage | [perfmon (win), ETW](#os-tools) | Finding resource leaks that are not normally considered when the term "memory" is used. | +| Topic/Area of Inquiry | Tool(s) | +|----------------------- | ------- | +| Which subsystems consuming memory per process. | [Global Memory Dumps](#global-memory-dumps), [Taking memory-infra trace](#memory-infra-trace) | +| Tracking C++ object allocation over time | [`diff_heap_profiler.py`](#diff-heap-profiler), [Heap Details in chrome://tracing](#heap-dumps-chrome-tracing) | +| Suspected DOM leaks in the Renderer | [Real World Leak Detector](#real-world-leak-detector) | +| Kernel/Driver Memory and Resource Usage | [perfmon (win), ETW](#os-tools) | | Blackbox examination of process memory | [VMMAP (win)](#os-tools) | Understanding fragmentation of the memory space | +| Symbolized Heap Dump data | [Heap Dumps](#heap-dumps) | Grabs raw data for analysis by other tools | If that seems like a lot of tools and complexity, it is [but there's a reason](#no-one-true-metric). -## <a name="diff-heap-profiler"></a> `diff_heap_profiler.py` - -### What this is good for -Examining allocations that occur within one point in time. This is often useful -for finding leaks as one call-stack will rise to the top as the leak is repeated -triggered. - -Multiple traces can be given at once to show incremental changes. - -TODO(awong): Write about options to script and the flame graph. - -### Blindspots - * Only catches allocations that pass through the allocator shim - -### Instructions - 1. Ensure browser was started with OOPHP enabled and that the right processes - are being profiled. TODO(awong): link instructions. - 2. Visit chrome://memory-internals and click "Save Dump" for a baseline. - 3. Record for a few seconds, then stop. *Warning*: traces grow very fast and - will crash the trace viewer. - 2. Visit chrome://memory-internals and click "Save Dump" for a the next - sample. - 4. Symbolize both dump files by running [`symbolize_trace.py`](https://chromium.googlesource.com/catapult/+/master/tracing/bin/symbolize_trace) - 5. Run resulting traces through [`diff_heap_profiler.py`](https://chromium.googlesource.com/catapult/+/master/experimental/tracing/bin/diff_heap_profiler.py) to show a list of new - allocations. - - -## <a name="tracing-memory-infra"></a> Chrome tracing and Memory-infra -### What this is good for -Examining self-reported statistics from various subsystems on memory usages. -This is most useful for getting a high-level understanding of how memory is -distributed between the different heaps and subsystems in chrome. - -It also provides a way to view heap dump allocation information collected per -process through a progressively expanding stack trace. - -Though chrome://tracing itself is a timeline based plot, this data is snapshot -oriented. Thus the standard chrome://tracing plotting tools do not provide a -good means for measuring changes per snapshot. - -### Blindspots - * Statistics are self-reported via "Memory Dump Provider" interfaces. If there - is an error in the data collection, or if there are privileged resources - that cannot be easily measured from usermode, they will be missed. - * The heap dump also only catches allocations that pass through the allocator shim. - -### Instructions -#### Taking a trace - 1. [optional] Restart browser with OOPHP enabled at startup. - 2. Visit chrome://tracing - 3. Start a trace for memory-infra - 1. Click the "Record" button - 2. Choose "Manually select settings" - 3. [optional] Clear out all other tracing categories. - 4. Select "memory-infra" from the "Disabled by Default Categories" - 5. Click record again. - 4. Do work that triggers events/behaviors to measure. - 5. Click stop - 6. [optional] Symbolize trace - 1. Save trace file. - 2. Run trace file through [`symbolize_trace.py`](../../third_party/catapult/experimental/tracing/bin/symbolize_trace.py) - 3. Reload the trace file - -This should produce a view of the trace file with periodic "light" and "heavy" -memory dumps. - -TODO(ajwong): Add screenshot or at least reference the more detailed -memory-infra docs. - -## <a name="global-memory-dump"></a> Global Memory Dump -### What this is good for +----------- +## <a name="global-memory-dumps"> Global Memory Dumps Many Chrome subsystems implement the [`trace_event::MemoryDumpProvider`](../../ase/trace_event/memory_dump_provider.h) interface to provide self-reported stats detailing their memory usage. The -Global Memory Dump view provides a snapshot-oriented view of these subsystems. +Global Memory Dump view provides a snapshot-oriented view of these subsystems +that can be collected and viewed via the chrome://tracing infrastructure. In the Analysis split screen, a single roll-up number is provided for each of these subsystems. This can give a quick feel for where memory is allocated. The @@ -125,28 +58,22 @@ the viewport of the analysis view. Be sure to scroll down. -## <a name="heap-profile"></a> Viewing a Heap Profile in chrome://tracing -### What this is good for -Heap profiling provides extremely detailed data about object allocations and is -useful for finding code locations that are generating a large number of live -allocations. +----------- +## <a name="heap-dumps-chrome-tracing"> Heap Dumps in chrome://tracing +GUI method of exploring the heap dump for a process. -This view is snapshot oriented. To look at changes between snapshots, consider -a different tool such as [`diff_heap_profiler.py`](#diff-heap-profiler). - -Because it tracks malloc()/free() it is less useful in the Renderer process -where much of the memory allocation is handled via garbage collection in Oilpan. +TODO(awong): Explain how to interpret + interact with the data. (e.g. threads, +bottom-up vs top-down, etc) ### Blindspots - * Allocations are tracked via the allocator shim. This can only catch calls - for which the shim is effective. In Windows, this does not work on a - component build. On Android, this does not register allocations made by - Android framework code. - * On all platforms, calls made directly to the VM subsystem (eg, via - `mmap()` or `VirtualAlloc()`) will not be tracked. + * As this is a viewer of [heap dump](#heap-dump) data, it has the same + blindspots. + * The tool is bound by the memory limits of chrome://tracing. Large dumps + (which generate large JS strings) will not be loadable and may likely crash + chrome://tracing. ### Instructions - 1. Ensure the correct heap-profiling mode is set up. + 1. [Configure Out-of-process heap profiling](#configure-oophp) 2. Take a memory-infra trace and symbolize it. 3. Click on a *dark-purple* M circle. 4. Find the cell corresponding to the allocator (list below) for the process of interest within the `Global Memory Dump` tab of the Analysis View. @@ -160,23 +87,162 @@ the information collected by the given MemoryDumpProvider is often way outside the current viewport of the Analysis View. Be sure to scroll down! -TODO(awong): Explain how to interpret + interact with the data. (e.g. threads, -bottom-up vs top-down, etc) - Currently supported allocators: malloc, PartitionAlloc, Oilpan. Note: PartitionAlloc and Oilpan traces have unsymbolized Javascript frames which often make exploration via this tool hard to consume. +----------- + +## <a name="diff-heap-profiler"></a> `diff_heap_profiler.py` +This is most useful for examining allocations that occur during an interval of +time. This is often useful for finding leaks as one call-stack will rise to the +top as the leak is repeated triggered. + +Multiple traces can be given at once to show incremental changes. A similar +analysis can be had via ctrl-clicking multiple Global Memory Dumps in the +chrome://tracing UI but loading multiiple detailed heapdumps can often crash the +chrome://tracing UI. This tool is more robust to large data sizes. + +The source code can also be used as an example for manually processing heap dump +data in python. + +TODO(awong): Write about options to script and the flame graph. + +### Blindspots + * As this is a viewer of [heap dump](#heap-dumps) data, it has the same + blindspots. + +### Instructions + 1. Get 2 or more [symbolized heap dump](#heap-dumps) + 3. Run resulting traces through [`diff_heap_profiler.py`](https://chromium.googlesource.com/catapult/+/master/experimental/tracing/bin/diff_heap_profiler.py) to show a list of new allocations. + +----------- +## <a name="heap-dumps"></a>Heap Dumps +Heap dumps provide extremely detailed data about object allocations and is +useful for finding code locations that are generating a large number of live +allocations. Data is tracked and recorded using the [Out-of-process Heap +Profiler (OOPHP)](../../src/chrome/profiling/README.md). + +For the Browser and GPU process, this often quickly finds objects that leak over +time. + +This is less useful in the Renderer process. Even though Oilpan and +PartitionAlloc are hooked into the data collection, many of the stacks end up +looking similar due to the nature of DOM node allocation. + +### Blindspots + * Heap dumps only catch allocations that pass through the allocator shim. In particular, + calls made directly to the platform's VM subsystem (eg, via `mmap()` or + `VirtualAlloc()`) will not be tracked. + * Utility processes are currently not profiled. + * Allocations are only recorded after the + [ProfilingService](../../src/chrome/profiling/profiling_service.h) has spun up the + profiling process and created a connection to the target process. The ProfilingService + is a mojo service that can be configured to start early in browser startup + but it still takes time to spin up and early allocations are thus lost. + +### Instructions +#### <a name="configure-oophp"></a>Configuration and setup + 1. [Android Only] For native stack traces, a custom build with + `enable_framepoitners=true` is required. + 2. Configure OOPHP settings in about://flags. (See table below) + 3. Restart browser with new settings if necessary. + 4. Verify target processes are being profiled in chrome://memory-internals. + 5. [Optional] start profiling additional processes in chrome://memory-internals. + +| Flag | Notes | +| ------- | ----- | +| Out of process heap profiling start mode. | This option is somewhat misnamed. It tells OOPHP which processes to profile at startup. Other processes can selected manually later via chrome://memory-internals even if this is set to "disabled". | +| Keep track of even the small allocations in memlog heap dumps. | By default, small allocations are not emitted in the heap dump to reduce dump size. Enabling this track _all_ allocations. | +| The type of stack to record for memlog heap dumps | If possible, use Native stack frames as that provides the best information. When those are not availble either due to performance for build (eg, no frame-pointers on arm32 official) configurations, using trace events for a "pseudo stack" can give good information too. | +| Heap profiling | Deprecated. Enables the in-process heap profiler. Functionality should be fully subsumed by preceeding options. | + +#### Saving a heap dump + 1. On Desktop, click "save dump" in chrome://memory-internals to save a + dump of all the profiled processes. On Android, enable debugging via USB + and use chrome://inspect/?tracing#devices to take a memory-infra trace + which will have the heap dump embedded. + 2. Symbolize trace using [`symbolize_trace.py`](../../third_party/catapult/experimental/tracing/bin/symbolize_trace.py) + 3. Analyze resuing heap dump using [`diff_heap_profiler.py`](#diff-heap-profiler), or [Heap Profile view in Chrome Tracing](#tracing-heap-profile) + +On deskop, using chrome://memory-internals to take a heap dump is more reliable +as it directly saves the heapdump to a file instead of passing the serialized data +through the chrome://tracing renderer process which can easily OOM. For Android, +this native file saving was harder to implement and would still leave the +problem of getting the dump off the phone so memory-infra tracing is the +current recommended path. + +----------- +## <a name="memory-infra-trace"></a> Taking a memory-infra trace. +Examining self-reported statistics from various subsystems on memory usages. +This is most useful for getting a high-level understanding of how memory is +distributed between the different heaps and subsystems in chrome. + +It also provides a way to view heap dump allocation information collected per +process through a progressively expanding stack trace. + +Though chrome://tracing itself is a timeline based plot, this data is snapshot +oriented. Thus the standard chrome://tracing plotting tools do not provide a +good means for measuring changes per snapshot. + +### Blindspots + * Statistics are self-reported via "Memory Dump Provider" interfaces. If there + is an error in the data collection, or if there are privileged resources + that cannot be easily measured from usermode, they will be missed. + +### Instructions + 1. Visit chrome://tracing + 2. Start a trace for memory-infra + 1. Click the "Record" button + 2. Choose "Manually select settings" + 3. [optional] Clear out all other tracing categories. + 4. Select "memory-infra" from the "Disabled by Default Categories" + 5. Click record again. + 3. Wait for a few seconds for a Global Memory Dump to be taken. If OOPHP + is enabled, don't run for more than a few seconds to avoid crashing the + chrome://tracing UI with an over-large trace. + 4. Wait for a few seconds for a Global Memory Dump to be taken. + 5. Click stop + +This should produce a view of the trace file with periodic "light" and "heavy" +memory dumps. These dumps are created periodically so the time spent waiting +in step (3) determines how many dumps (which are snapshots) are taken. + +**Warning:** If OOPHP is enabled, the tracing UI may not be able to handle +deserializing or rendering the memory dump. In this situation, save +the heap dump directly in chrome://memory-internals and use alternate tools to +analyze it. Also, consider leaving `#memlog-keep-small-allocations` Disabled in +`chrome://flags` to reduce the heap dump size. + +TODO(ajwong): Add screenshot or at least reference the more detailed +memory-infra docs. + + +----------- ## <a name="real-world-leak-detector"></a> Real World Leak Detector (Blink-only) +TODO(awong): Fill in. + +----------- ## <a name="os-tools"></a> OS Tools: perfmon, ETW, VMMAP +Each OS provides specialized tools that give the closest to complete information +about resource usage. This is a list of commonly interesting tools per platform. +Use them as search terms to look up new ways to analyze data. +| Platform | Tools | +| -------- | ----- | +| Window | [SysInternals vmmap](https://docs.microsoft.com/en-us/sysinternals/downloads/vmmap), resmon (can track kernel resources like Paged Pool), perfmon, ETW, !heap in WinDbg | +| Mac | [vmmap](https://developer.apple.com/library/content/documentation/Performance/Conceptual/ManagingMemory/Articles/VMPages.html), `vm_stat` | +| Linux/Android | `cat /proc/pid/maps` | + + +----------- ## <a name="no-one-true-metric"></a> No really, I want one tool/metric that views everything. Can I has it plz? Sorry. No. -There is a natrual tradeoff between getting detailed information +There is a natural tradeoff between getting detailed information and getting reliably complete information. Getting detailed information requires instrumentation which adds complexity and selection bias to the measurement. This reduces the reliability and completeness of the metric as code shifts over
diff --git a/extensions/common/api/system_display.idl b/extensions/common/api/system_display.idl index 70fdb6d..fba1d68 100644 --- a/extensions/common/api/system_display.idl +++ b/extensions/common/api/system_display.idl
@@ -182,6 +182,11 @@ // Provided for ChromeOS Settings UI only. TODO(stevenjb): Remove when // Settings switches to a mojo API. NOTE: The name of this may change. [nodoc] boolean hasAccelerometerSupport; + + // The ratio between the display's current and default zoom. + // For example, value 1 is equivalent to 100% zoom, and value 1.5 is + // equivalent to 150% zoom. + double displayZoomFactor; }; dictionary DisplayProperties { @@ -231,6 +236,11 @@ // If set, updates the display mode to the mode matching this value. DisplayMode? displayMode; + + // If set, updates the zoom associated with the display. This zoom performs + // relayout and repaint thus resulting in a better quality zoom than just + // performing a pixel by pixel stretch enlargement. + double? displayZoomFactor; }; dictionary GetInfoFlags {
diff --git a/gpu/ipc/client/command_buffer_proxy_impl.cc b/gpu/ipc/client/command_buffer_proxy_impl.cc index 5d509cc..8b2929b 100644 --- a/gpu/ipc/client/command_buffer_proxy_impl.cc +++ b/gpu/ipc/client/command_buffer_proxy_impl.cc
@@ -751,16 +751,18 @@ base::SharedMemoryHandle platform_handle; size_t shared_memory_size; - bool readonly; + mojo::UnwrappedSharedMemoryHandleProtection protection; MojoResult result = mojo::UnwrapSharedMemoryHandle( - std::move(handle), &platform_handle, &shared_memory_size, &readonly); + std::move(handle), &platform_handle, &shared_memory_size, &protection); if (result != MOJO_RESULT_OK) { DLOG(ERROR) << "AllocateAndMapSharedMemory: Unwrap failed"; return nullptr; } DCHECK_EQ(shared_memory_size, size); - auto shm = std::make_unique<base::SharedMemory>(platform_handle, readonly); + bool read_only = + protection == mojo::UnwrappedSharedMemoryHandleProtection::kReadOnly; + auto shm = std::make_unique<base::SharedMemory>(platform_handle, read_only); if (!shm->Map(size)) { DLOG(ERROR) << "AllocateAndMapSharedMemory: Map failed"; return nullptr;
diff --git a/ios/chrome/app/application_delegate/app_state_unittest.mm b/ios/chrome/app/application_delegate/app_state_unittest.mm index 0621861..9c6c22f6 100644 --- a/ios/chrome/app/application_delegate/app_state_unittest.mm +++ b/ios/chrome/app/application_delegate/app_state_unittest.mm
@@ -6,9 +6,10 @@ #import <QuartzCore/QuartzCore.h> +#include <memory> + #include "base/ios/block_types.h" #include "base/mac/scoped_block.h" -#include "base/memory/ptr_util.h" #include "base/synchronization/lock.h" #import "ios/chrome/app/application_delegate/app_navigation.h" #import "ios/chrome/app/application_delegate/app_state_testing.h" @@ -94,8 +95,8 @@ public: FakeChromeBrowserProvider() : app_distribution_provider_( - base::MakeUnique<FakeAppDistributionProvider>()), - user_feedback_provider_(base::MakeUnique<FakeUserFeedbackProvider>()) {} + std::make_unique<FakeAppDistributionProvider>()), + user_feedback_provider_(std::make_unique<FakeUserFeedbackProvider>()) {} ~FakeChromeBrowserProvider() override {} AppDistributionProvider* GetAppDistributionProvider() const override { @@ -512,7 +513,7 @@ TEST_F(AppStateWithThreadTest, willTerminate) { // Setup. IOSChromeScopedTestingChromeBrowserProvider provider_( - base::MakeUnique<FakeChromeBrowserProvider>()); + std::make_unique<FakeChromeBrowserProvider>()); id browserViewController = OCMClassMock([BrowserViewController class]); OCMExpect([browserViewController setActive:NO]); @@ -734,7 +735,7 @@ TEST_F(AppStateTest, applicationWillEnterForeground) { // Setup. IOSChromeScopedTestingChromeBrowserProvider provider_( - base::MakeUnique<FakeChromeBrowserProvider>()); + std::make_unique<FakeChromeBrowserProvider>()); id application = [OCMockObject mockForClass:[UIApplication class]]; id metricsMediator = [OCMockObject mockForClass:[MetricsMediator class]]; id memoryHelper = [OCMockObject mockForClass:[MemoryWarningHelper class]];
diff --git a/ios/chrome/app/startup/chrome_main_starter.mm b/ios/chrome/app/startup/chrome_main_starter.mm index ebdd8f5..a9ac3d6 100644 --- a/ios/chrome/app/startup/chrome_main_starter.mm +++ b/ios/chrome/app/startup/chrome_main_starter.mm
@@ -4,7 +4,6 @@ #include "ios/chrome/app/startup/chrome_main_starter.h" -#include "base/memory/ptr_util.h" #include "ios/chrome/app/startup/ios_chrome_main.h" #if !defined(__has_feature) || !__has_feature(objc_arc) @@ -14,7 +13,7 @@ @implementation ChromeMainStarter + (std::unique_ptr<IOSChromeMain>)startChromeMain { - return base::MakeUnique<IOSChromeMain>(); + return std::make_unique<IOSChromeMain>(); } @end
diff --git a/ios/chrome/app/startup/network_stack_setup.mm b/ios/chrome/app/startup/network_stack_setup.mm index b3e426b..9b81f7bb 100644 --- a/ios/chrome/app/startup/network_stack_setup.mm +++ b/ios/chrome/app/startup/network_stack_setup.mm
@@ -4,7 +4,8 @@ #include "ios/chrome/app/startup/network_stack_setup.h" -#include "base/memory/ptr_util.h" +#include <memory> + #include "ios/chrome/browser/application_context.h" #include "ios/chrome/browser/chrome_url_constants.h" #import "ios/net/empty_nsurlcache.h" @@ -29,7 +30,7 @@ // Configuration for the HTTP protocol handler. // TODO(crbug.com/585700): Remove this code. *httpProtocolHandlerDelegate = - base::MakeUnique<web::WebHTTPProtocolHandlerDelegate>( + std::make_unique<web::WebHTTPProtocolHandlerDelegate>( GetApplicationContext()->GetSystemURLRequestContext()); net::HTTPProtocolHandlerDelegate::SetInstance( httpProtocolHandlerDelegate->get()); @@ -40,7 +41,7 @@ BOOL success = [NSURLProtocol registerClass:[CRNHTTPProtocolHandler class]]; DCHECK(success); *requestTrackerFactory = - base::MakeUnique<web::RequestTrackerFactoryImpl>(kChromeUIScheme); + std::make_unique<web::RequestTrackerFactoryImpl>(kChromeUIScheme); net::RequestTracker::SetRequestTrackerFactory(requestTrackerFactory->get()); DCHECK(success);
diff --git a/ios/chrome/browser/application_context_impl.cc b/ios/chrome/browser/application_context_impl.cc index 7b5e5fc..04b70cc 100644 --- a/ios/chrome/browser/application_context_impl.cc +++ b/ios/chrome/browser/application_context_impl.cc
@@ -211,7 +211,7 @@ if (!metrics_services_manager_) { metrics_services_manager_.reset( new metrics_services_manager::MetricsServicesManager( - base::MakeUnique<IOSChromeMetricsServicesManagerClient>( + std::make_unique<IOSChromeMetricsServicesManagerClient>( GetLocalState()))); } return metrics_services_manager_.get();
diff --git a/ios/chrome/browser/autocomplete/autocomplete_classifier_factory.cc b/ios/chrome/browser/autocomplete/autocomplete_classifier_factory.cc index 11cdca53..41b35e7 100644 --- a/ios/chrome/browser/autocomplete/autocomplete_classifier_factory.cc +++ b/ios/chrome/browser/autocomplete/autocomplete_classifier_factory.cc
@@ -24,7 +24,7 @@ web::BrowserState* context) { ios::ChromeBrowserState* browser_state = ios::ChromeBrowserState::FromBrowserState(context); - return base::MakeUnique<AutocompleteClassifier>( + return std::make_unique<AutocompleteClassifier>( base::WrapUnique(new AutocompleteController( base::WrapUnique(new AutocompleteProviderClientImpl(browser_state)), nullptr, AutocompleteClassifier::DefaultOmniboxProviders())),
diff --git a/ios/chrome/browser/autocomplete/shortcuts_backend_factory.mm b/ios/chrome/browser/autocomplete/shortcuts_backend_factory.mm index 68ec7a1b..8e394a2 100644 --- a/ios/chrome/browser/autocomplete/shortcuts_backend_factory.mm +++ b/ios/chrome/browser/autocomplete/shortcuts_backend_factory.mm
@@ -4,7 +4,8 @@ #include "ios/chrome/browser/autocomplete/shortcuts_backend_factory.h" -#include "base/memory/ptr_util.h" +#include <memory> + #include "base/memory/singleton.h" #include "components/keyed_service/core/service_access_type.h" #include "components/keyed_service/ios/browser_state_dependency_manager.h" @@ -30,7 +31,7 @@ bool suppress_db) { scoped_refptr<ShortcutsBackend> shortcuts_backend(new ShortcutsBackend( ios::TemplateURLServiceFactory::GetForBrowserState(browser_state), - base::MakeUnique<ios::UIThreadSearchTermsData>(browser_state), + std::make_unique<ios::UIThreadSearchTermsData>(browser_state), ios::HistoryServiceFactory::GetForBrowserState( browser_state, ServiceAccessType::EXPLICIT_ACCESS), browser_state->GetStatePath().Append(kShortcutsDatabaseName),
diff --git a/ios/chrome/browser/bookmarks/bookmark_model_factory.cc b/ios/chrome/browser/bookmarks/bookmark_model_factory.cc index 311a34c..18af3b5 100644 --- a/ios/chrome/browser/bookmarks/bookmark_model_factory.cc +++ b/ios/chrome/browser/bookmarks/bookmark_model_factory.cc
@@ -6,7 +6,6 @@ #include <utility> -#include "base/memory/ptr_util.h" #include "base/memory/singleton.h" #include "components/bookmarks/browser/bookmark_model.h" #include "components/bookmarks/browser/bookmark_utils.h" @@ -64,7 +63,7 @@ ios::ChromeBrowserState::FromBrowserState(context); std::unique_ptr<bookmarks::BookmarkModel> bookmark_model( new bookmarks::BookmarkModel( - base::MakeUnique<BookmarkClientImpl>(browser_state))); + std::make_unique<BookmarkClientImpl>(browser_state))); bookmark_model->Load( browser_state->GetPrefs(), browser_state->GetStatePath(),
diff --git a/ios/chrome/browser/bookmarks/startup_task_runner_service_factory.cc b/ios/chrome/browser/bookmarks/startup_task_runner_service_factory.cc index e1fa604..b9e69aa 100644 --- a/ios/chrome/browser/bookmarks/startup_task_runner_service_factory.cc +++ b/ios/chrome/browser/bookmarks/startup_task_runner_service_factory.cc
@@ -4,7 +4,6 @@ #include "ios/chrome/browser/bookmarks/startup_task_runner_service_factory.h" -#include "base/memory/ptr_util.h" #include "base/memory/singleton.h" #include "base/sequenced_task_runner.h" #include "components/bookmarks/browser/startup_task_runner_service.h" @@ -41,7 +40,7 @@ web::BrowserState* context) const { ios::ChromeBrowserState* browser_state = ios::ChromeBrowserState::FromBrowserState(context); - return base::MakeUnique<bookmarks::StartupTaskRunnerService>( + return std::make_unique<bookmarks::StartupTaskRunnerService>( browser_state->GetIOTaskRunner()); }
diff --git a/ios/chrome/browser/browser_state/chrome_browser_state_impl_io_data.mm b/ios/chrome/browser/browser_state/chrome_browser_state_impl_io_data.mm index 20311271..c8499eb 100644 --- a/ios/chrome/browser/browser_state/chrome_browser_state_impl_io_data.mm +++ b/ios/chrome/browser/browser_state/chrome_browser_state_impl_io_data.mm
@@ -11,7 +11,6 @@ #include "base/bind.h" #include "base/callback.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/sequenced_task_runner.h" #include "base/task_scheduler/post_task.h" #include "base/threading/sequenced_worker_pool.h" @@ -313,7 +312,7 @@ // TODO(crbug.com/779106): Check if cookiestore type should be changed. std::unique_ptr<net::CookieStore> cookie_store = cookie_util::CreateCookieStore( - ios_cookie_config, base::MakeUnique<net::NSHTTPSystemCookieStore>()); + ios_cookie_config, std::make_unique<net::NSHTTPSystemCookieStore>()); // Transfer ownership of the ChannelIDStore, HttpNetworkSession, cookies, and // cache to AppRequestContext.
diff --git a/ios/chrome/browser/browser_state/chrome_browser_state_io_data.mm b/ios/chrome/browser/browser_state/chrome_browser_state_io_data.mm index 9a4c01d..ad3e7e29 100644 --- a/ios/chrome/browser/browser_state/chrome_browser_state_io_data.mm +++ b/ios/chrome/browser/browser_state/chrome_browser_state_io_data.mm
@@ -399,7 +399,7 @@ "Not implemented, this is a feature that websites can opt into and " "thus there is no Chrome-wide policy to disable it." })"); - certificate_report_sender_ = base::MakeUnique<net::ReportSender>( + certificate_report_sender_ = std::make_unique<net::ReportSender>( main_request_context_.get(), traffic_annotation); transport_security_state_->SetReportSender(certificate_report_sender_.get()); @@ -435,19 +435,19 @@ // ChromeBrowserStateIOData::IsHandledProtocol(). bool set_protocol = job_factory->SetProtocolHandler( url::kFileScheme, - base::MakeUnique<net::FileProtocolHandler>( + std::make_unique<net::FileProtocolHandler>( base::CreateTaskRunnerWithTraits( {base::MayBlock(), base::TaskPriority::BACKGROUND, base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}))); DCHECK(set_protocol); set_protocol = job_factory->SetProtocolHandler( - url::kDataScheme, base::MakeUnique<net::DataProtocolHandler>()); + url::kDataScheme, std::make_unique<net::DataProtocolHandler>()); DCHECK(set_protocol); job_factory->SetProtocolHandler( url::kAboutScheme, - base::MakeUnique<about_handler::AboutProtocolHandler>()); + std::make_unique<about_handler::AboutProtocolHandler>()); return job_factory; }
diff --git a/ios/chrome/browser/browser_state/test_chrome_browser_state.mm b/ios/chrome/browser/browser_state/test_chrome_browser_state.mm index 7d12c68..7404745 100644 --- a/ios/chrome/browser/browser_state/test_chrome_browser_state.mm +++ b/ios/chrome/browser/browser_state/test_chrome_browser_state.mm
@@ -55,7 +55,7 @@ std::unique_ptr<KeyedService> BuildHistoryService(web::BrowserState* context) { ios::ChromeBrowserState* browser_state = ios::ChromeBrowserState::FromBrowserState(context); - return base::MakeUnique<history::HistoryService>( + return std::make_unique<history::HistoryService>( base::WrapUnique(new HistoryClientImpl( ios::BookmarkModelFactory::GetForBrowserState(browser_state))), nullptr); @@ -66,7 +66,7 @@ ios::ChromeBrowserState::FromBrowserState(context); std::unique_ptr<bookmarks::BookmarkModel> bookmark_model( new bookmarks::BookmarkModel( - base::MakeUnique<BookmarkClientImpl>(browser_state))); + std::make_unique<BookmarkClientImpl>(browser_state))); bookmark_model->Load( browser_state->GetPrefs(), browser_state->GetStatePath(), browser_state->GetIOTaskRunner(), @@ -82,7 +82,7 @@ std::unique_ptr<KeyedService> BuildWebDataService(web::BrowserState* context) { const base::FilePath& browser_state_path = context->GetStatePath(); - return base::MakeUnique<WebDataServiceWrapper>( + return std::make_unique<WebDataServiceWrapper>( browser_state_path, GetApplicationContext()->GetApplicationLocale(), web::WebThread::GetTaskRunnerForThread(web::WebThread::UI), ios::sync_start_util::GetFlareForSyncableService(browser_state_path),
diff --git a/ios/chrome/browser/browsing_data/ios_browsing_data_counter_factory.cc b/ios/chrome/browser/browsing_data/ios_browsing_data_counter_factory.cc index 4279e45..e3048ad 100644 --- a/ios/chrome/browser/browsing_data/ios_browsing_data_counter_factory.cc +++ b/ios/chrome/browser/browsing_data/ios_browsing_data_counter_factory.cc
@@ -6,7 +6,6 @@ #include "base/bind.h" #include "base/bind_helpers.h" -#include "base/memory/ptr_util.h" #include "components/browser_sync/profile_sync_service.h" #include "components/browsing_data/core/counters/autofill_counter.h" #include "components/browsing_data/core/counters/browsing_data_counter.h" @@ -32,7 +31,7 @@ return nullptr; if (pref_name == browsing_data::prefs::kDeleteBrowsingHistory) { - return base::MakeUnique<browsing_data::HistoryCounter>( + return std::make_unique<browsing_data::HistoryCounter>( ios::HistoryServiceFactory::GetForBrowserStateIfExists( browser_state, ServiceAccessType::EXPLICIT_ACCESS), base::Bind(&ios::WebHistoryServiceFactory::GetForBrowserState, @@ -41,17 +40,17 @@ } if (pref_name == browsing_data::prefs::kDeleteCache) - return base::MakeUnique<CacheCounter>(browser_state); + return std::make_unique<CacheCounter>(browser_state); if (pref_name == browsing_data::prefs::kDeletePasswords) { - return base::MakeUnique<browsing_data::PasswordsCounter>( + return std::make_unique<browsing_data::PasswordsCounter>( IOSChromePasswordStoreFactory::GetForBrowserState( browser_state, ServiceAccessType::EXPLICIT_ACCESS), IOSChromeProfileSyncServiceFactory::GetForBrowserState(browser_state)); } if (pref_name == browsing_data::prefs::kDeleteFormData) { - return base::MakeUnique<browsing_data::AutofillCounter>( + return std::make_unique<browsing_data::AutofillCounter>( ios::WebDataServiceFactory::GetAutofillWebDataForBrowserState( browser_state, ServiceAccessType::EXPLICIT_ACCESS), IOSChromeProfileSyncServiceFactory::GetForBrowserState(browser_state));
diff --git a/ios/chrome/browser/chrome_browser_provider_observer_bridge_unittest.mm b/ios/chrome/browser/chrome_browser_provider_observer_bridge_unittest.mm index 906b7af..c573737 100644 --- a/ios/chrome/browser/chrome_browser_provider_observer_bridge_unittest.mm +++ b/ios/chrome/browser/chrome_browser_provider_observer_bridge_unittest.mm
@@ -6,7 +6,6 @@ #include <memory> -#include "base/memory/ptr_util.h" #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" #include "ios/public/provider/chrome/browser/signin/chrome_identity_service.h" #include "testing/gtest_mac.h" @@ -38,7 +37,7 @@ - (instancetype)init { if (self == [super init]) { _observerBridge = - base::MakeUnique<ChromeBrowserProviderObserverBridge>(self); + std::make_unique<ChromeBrowserProviderObserverBridge>(self); } return self; }
diff --git a/ios/chrome/browser/desktop_promotion/desktop_promotion_sync_service_factory.cc b/ios/chrome/browser/desktop_promotion/desktop_promotion_sync_service_factory.cc index f3acea0..eab4a97 100644 --- a/ios/chrome/browser/desktop_promotion/desktop_promotion_sync_service_factory.cc +++ b/ios/chrome/browser/desktop_promotion/desktop_promotion_sync_service_factory.cc
@@ -4,7 +4,7 @@ #include "ios/chrome/browser/desktop_promotion/desktop_promotion_sync_service_factory.h" -#include "base/memory/ptr_util.h" +#include <memory> #include "components/keyed_service/ios/browser_state_dependency_manager.h" #include "ios/chrome/browser/browser_state/chrome_browser_state.h" @@ -40,7 +40,7 @@ web::BrowserState* context) const { ios::ChromeBrowserState* browser_state = ios::ChromeBrowserState::FromBrowserState(context); - return base::MakeUnique<DesktopPromotionSyncService>( + return std::make_unique<DesktopPromotionSyncService>( browser_state->GetPrefs(), IOSChromeProfileSyncServiceFactory::GetForBrowserState(browser_state)); }
diff --git a/ios/chrome/browser/dom_distiller/dom_distiller_service_factory.cc b/ios/chrome/browser/dom_distiller/dom_distiller_service_factory.cc index c6decb7..a023baa 100644 --- a/ios/chrome/browser/dom_distiller/dom_distiller_service_factory.cc +++ b/ios/chrome/browser/dom_distiller/dom_distiller_service_factory.cc
@@ -8,7 +8,6 @@ #include "base/files/file_path.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/memory/singleton.h" #include "base/threading/sequenced_worker_pool.h" #include "components/dom_distiller/core/article_entry.h" @@ -74,23 +73,22 @@ std::unique_ptr<KeyedService> DomDistillerServiceFactory::BuildServiceInstanceFor( web::BrowserState* context) const { - std::unique_ptr<DistillerPageFactory> distiller_page_factory = - base::MakeUnique<DistillerPageFactoryIOS>(context); + std::make_unique<DistillerPageFactoryIOS>(context); std::unique_ptr<DistillerURLFetcherFactory> distiller_url_fetcher_factory = - base::MakeUnique<DistillerURLFetcherFactory>( + std::make_unique<DistillerURLFetcherFactory>( context->GetRequestContext()); dom_distiller::proto::DomDistillerOptions options; std::unique_ptr<DistillerFactory> distiller_factory = - base::MakeUnique<DistillerFactoryImpl>( + std::make_unique<DistillerFactoryImpl>( std::move(distiller_url_fetcher_factory), options); std::unique_ptr<DistilledPagePrefs> distilled_page_prefs = - base::MakeUnique<DistilledPagePrefs>( + std::make_unique<DistilledPagePrefs>( ios::ChromeBrowserState::FromBrowserState(context)->GetPrefs()); - return base::MakeUnique<DomDistillerKeyedService>( + return std::make_unique<DomDistillerKeyedService>( nullptr, std::move(distiller_factory), std::move(distiller_page_factory), std::move(distilled_page_prefs)); }
diff --git a/ios/chrome/browser/favicon/favicon_client_impl.mm b/ios/chrome/browser/favicon/favicon_client_impl.mm index 9edeb25..0379124 100644 --- a/ios/chrome/browser/favicon/favicon_client_impl.mm +++ b/ios/chrome/browser/favicon/favicon_client_impl.mm
@@ -8,7 +8,6 @@ #include "base/bind.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/task/cancelable_task_tracker.h" #include "base/threading/thread_task_runner_handle.h" #include "components/favicon/core/favicon_service.h" @@ -94,7 +93,7 @@ DCHECK(IsNativeApplicationURL(url)); auto favicon_bitmap_results = - base::MakeUnique<std::vector<favicon_base::FaviconRawBitmapResult>>(); + std::make_unique<std::vector<favicon_base::FaviconRawBitmapResult>>(); GetFaviconBitmapForNativeURL(url, desired_sizes_in_pixel, favicon_bitmap_results.get());
diff --git a/ios/chrome/browser/favicon/favicon_service_factory.cc b/ios/chrome/browser/favicon/favicon_service_factory.cc index 536ec18..33e8bdd 100644 --- a/ios/chrome/browser/favicon/favicon_service_factory.cc +++ b/ios/chrome/browser/favicon/favicon_service_factory.cc
@@ -4,7 +4,6 @@ #include "ios/chrome/browser/favicon/favicon_service_factory.h" -#include "base/memory/ptr_util.h" #include "base/memory/singleton.h" #include "components/favicon/core/favicon_service_impl.h" #include "components/keyed_service/core/service_access_type.h" @@ -52,8 +51,8 @@ web::BrowserState* context) const { ios::ChromeBrowserState* browser_state = ios::ChromeBrowserState::FromBrowserState(context); - return base::MakeUnique<favicon::FaviconServiceImpl>( - base::MakeUnique<FaviconClientImpl>(), + return std::make_unique<favicon::FaviconServiceImpl>( + std::make_unique<FaviconClientImpl>(), ios::HistoryServiceFactory::GetForBrowserState( browser_state, ServiceAccessType::EXPLICIT_ACCESS)); }
diff --git a/ios/chrome/browser/favicon/ios_chrome_favicon_loader_factory.mm b/ios/chrome/browser/favicon/ios_chrome_favicon_loader_factory.mm index c839d07a..09447f5 100644 --- a/ios/chrome/browser/favicon/ios_chrome_favicon_loader_factory.mm +++ b/ios/chrome/browser/favicon/ios_chrome_favicon_loader_factory.mm
@@ -4,7 +4,6 @@ #include "ios/chrome/browser/favicon/ios_chrome_favicon_loader_factory.h" -#include "base/memory/ptr_util.h" #include "base/memory/singleton.h" #include "components/keyed_service/core/service_access_type.h" #include "components/keyed_service/ios/browser_state_dependency_manager.h" @@ -47,7 +46,7 @@ web::BrowserState* context) const { ios::ChromeBrowserState* browser_state = ios::ChromeBrowserState::FromBrowserState(context); - return base::MakeUnique<FaviconLoader>( + return std::make_unique<FaviconLoader>( ios::FaviconServiceFactory::GetForBrowserState( browser_state, ServiceAccessType::IMPLICIT_ACCESS)); }
diff --git a/ios/chrome/browser/google/google_logo_service_factory.mm b/ios/chrome/browser/google/google_logo_service_factory.mm index 1e4cfbd5..36969ba 100644 --- a/ios/chrome/browser/google/google_logo_service_factory.mm +++ b/ios/chrome/browser/google/google_logo_service_factory.mm
@@ -4,7 +4,6 @@ #include "ios/chrome/browser/google/google_logo_service_factory.h" -#include "base/memory/ptr_util.h" #include "base/memory/singleton.h" #include "components/keyed_service/ios/browser_state_dependency_manager.h" #include "ios/chrome/browser/browser_state/browser_state_otr_helper.h" @@ -42,7 +41,7 @@ web::BrowserState* context) const { ios::ChromeBrowserState* browser_state = ios::ChromeBrowserState::FromBrowserState(context); - return base::MakeUnique<GoogleLogoService>( + return std::make_unique<GoogleLogoService>( ios::TemplateURLServiceFactory::GetForBrowserState(browser_state), browser_state->GetRequestContext()); }
diff --git a/ios/chrome/browser/google/google_url_tracker_factory.cc b/ios/chrome/browser/google/google_url_tracker_factory.cc index c8aa240..33cbdf6 100644 --- a/ios/chrome/browser/google/google_url_tracker_factory.cc +++ b/ios/chrome/browser/google/google_url_tracker_factory.cc
@@ -47,7 +47,7 @@ browser_state->GetOriginalChromeBrowserState()->GetPrefs()->ClearPref( prefs::kLastPromptedGoogleURL); - return base::MakeUnique<GoogleURLTracker>( + return std::make_unique<GoogleURLTracker>( base::WrapUnique(new GoogleURLTrackerClientImpl(browser_state)), GoogleURLTracker::NORMAL_MODE); }
diff --git a/ios/chrome/browser/history/history_client_impl.cc b/ios/chrome/browser/history/history_client_impl.cc index d9cec28..182afdc2 100644 --- a/ios/chrome/browser/history/history_client_impl.cc +++ b/ios/chrome/browser/history/history_client_impl.cc
@@ -7,7 +7,6 @@ #include "base/bind.h" #include "base/callback.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "components/bookmarks/browser/bookmark_model.h" #include "components/history/core/browser/history_service.h" #include "ios/chrome/browser/history/history_backend_client_impl.h" @@ -65,7 +64,7 @@ std::unique_ptr<history::HistoryBackendClient> HistoryClientImpl::CreateBackendClient() { - return base::MakeUnique<HistoryBackendClientImpl>(bookmark_model_); + return std::make_unique<HistoryBackendClientImpl>(bookmark_model_); } void HistoryClientImpl::BookmarkModelChanged() {
diff --git a/ios/chrome/browser/history/history_service_factory.cc b/ios/chrome/browser/history/history_service_factory.cc index 8dbca43b..b77ffcd 100644 --- a/ios/chrome/browser/history/history_service_factory.cc +++ b/ios/chrome/browser/history/history_service_factory.cc
@@ -6,7 +6,6 @@ #include <utility> -#include "base/memory/ptr_util.h" #include "base/memory/singleton.h" #include "components/history/core/browser/history_database_params.h" #include "components/history/core/browser/history_service.h" @@ -74,7 +73,7 @@ ios::ChromeBrowserState::FromBrowserState(context); std::unique_ptr<history::HistoryService> history_service( new history::HistoryService( - base::MakeUnique<HistoryClientImpl>( + std::make_unique<HistoryClientImpl>( ios::BookmarkModelFactory::GetForBrowserState(browser_state)), nullptr)); if (!history_service->Init(history::HistoryDatabaseParamsForPath(
diff --git a/ios/chrome/browser/history/web_history_service_factory.cc b/ios/chrome/browser/history/web_history_service_factory.cc index 16e381c2..fa81e0d 100644 --- a/ios/chrome/browser/history/web_history_service_factory.cc +++ b/ios/chrome/browser/history/web_history_service_factory.cc
@@ -4,7 +4,6 @@ #include "ios/chrome/browser/history/web_history_service_factory.h" -#include "base/memory/ptr_util.h" #include "base/memory/singleton.h" #include "components/browser_sync/profile_sync_service.h" #include "components/history/core/browser/web_history_service.h" @@ -65,7 +64,7 @@ web::BrowserState* context) const { ios::ChromeBrowserState* browser_state = ios::ChromeBrowserState::FromBrowserState(context); - return base::MakeUnique<history::WebHistoryService>( + return std::make_unique<history::WebHistoryService>( IdentityManagerFactory::GetForBrowserState(browser_state), browser_state->GetRequestContext()); }
diff --git a/ios/chrome/browser/invalidation/ios_chrome_profile_invalidation_provider_factory.mm b/ios/chrome/browser/invalidation/ios_chrome_profile_invalidation_provider_factory.mm index 00bdf14..d55b8d8 100644 --- a/ios/chrome/browser/invalidation/ios_chrome_profile_invalidation_provider_factory.mm +++ b/ios/chrome/browser/invalidation/ios_chrome_profile_invalidation_provider_factory.mm
@@ -8,7 +8,6 @@ #include <utility> #include "base/callback.h" -#include "base/memory/ptr_util.h" #include "base/memory/singleton.h" #include "components/gcm_driver/gcm_profile_service.h" #include "components/invalidation/impl/invalidator_storage.h" @@ -78,15 +77,15 @@ std::unique_ptr<TiclInvalidationService> service(new TiclInvalidationService( web::GetWebClient()->GetUserAgent(web::UserAgentType::MOBILE), std::move(identity_provider), - base::MakeUnique<invalidation::TiclProfileSettingsProvider>( + std::make_unique<invalidation::TiclProfileSettingsProvider>( browser_state->GetPrefs()), IOSChromeGCMProfileServiceFactory::GetForBrowserState(browser_state) ->driver(), browser_state->GetRequestContext())); service->Init( - base::MakeUnique<InvalidatorStorage>(browser_state->GetPrefs())); + std::make_unique<InvalidatorStorage>(browser_state->GetPrefs())); - return base::MakeUnique<ProfileInvalidationProvider>(std::move(service)); + return std::make_unique<ProfileInvalidationProvider>(std::move(service)); } void IOSChromeProfileInvalidationProviderFactory::RegisterBrowserStatePrefs(
diff --git a/ios/chrome/browser/ios_chrome_io_thread.mm b/ios/chrome/browser/ios_chrome_io_thread.mm index 1d6a4875..46262070 100644 --- a/ios/chrome/browser/ios_chrome_io_thread.mm +++ b/ios/chrome/browser/ios_chrome_io_thread.mm
@@ -4,7 +4,6 @@ #include "ios/chrome/browser/ios_chrome_io_thread.h" -#include "base/memory/ptr_util.h" #include "ios/chrome/browser/net/ios_chrome_network_delegate.h" #include "ios/chrome/common/channel_info.h" @@ -22,7 +21,7 @@ std::unique_ptr<net::NetworkDelegate> IOSChromeIOThread::CreateSystemNetworkDelegate() { - return base::MakeUnique<IOSChromeNetworkDelegate>(); + return std::make_unique<IOSChromeNetworkDelegate>(); } std::string IOSChromeIOThread::GetChannelString() const {
diff --git a/ios/chrome/browser/language/language_model_factory.cc b/ios/chrome/browser/language/language_model_factory.cc index 73d2d73..0659ff5 100644 --- a/ios/chrome/browser/language/language_model_factory.cc +++ b/ios/chrome/browser/language/language_model_factory.cc
@@ -5,7 +5,6 @@ #include "ios/chrome/browser/language/language_model_factory.h" #include "base/feature_list.h" -#include "base/memory/ptr_util.h" #include "components/keyed_service/core/keyed_service.h" #include "components/keyed_service/ios/browser_state_dependency_manager.h" #include "components/language/core/browser/baseline_language_model.h" @@ -44,13 +43,13 @@ ios::ChromeBrowserState::FromBrowserState(state); if (base::FeatureList::IsEnabled(language::kUseHeuristicLanguageModel)) { - return base::MakeUnique<language::HeuristicLanguageModel>( + return std::make_unique<language::HeuristicLanguageModel>( chrome_state->GetPrefs(), GetApplicationContext()->GetApplicationLocale(), prefs::kAcceptLanguages, language::prefs::kUserLanguageProfile); } - return base::MakeUnique<language::BaselineLanguageModel>( + return std::make_unique<language::BaselineLanguageModel>( chrome_state->GetPrefs(), GetApplicationContext()->GetApplicationLocale(), prefs::kAcceptLanguages); }
diff --git a/ios/chrome/browser/language/url_language_histogram_factory.cc b/ios/chrome/browser/language/url_language_histogram_factory.cc index 21fb22c..f91e2b1 100644 --- a/ios/chrome/browser/language/url_language_histogram_factory.cc +++ b/ios/chrome/browser/language/url_language_histogram_factory.cc
@@ -4,7 +4,6 @@ #include "ios/chrome/browser/language/url_language_histogram_factory.h" -#include "base/memory/ptr_util.h" #include "components/keyed_service/core/keyed_service.h" #include "components/keyed_service/ios/browser_state_dependency_manager.h" #include "components/language/core/browser/url_language_histogram.h" @@ -35,7 +34,7 @@ web::BrowserState* const context) const { ios::ChromeBrowserState* browser_state = ios::ChromeBrowserState::FromBrowserState(context); - return base::MakeUnique<language::UrlLanguageHistogram>( + return std::make_unique<language::UrlLanguageHistogram>( browser_state->GetPrefs()); }
diff --git a/ios/chrome/browser/metrics/ios_chrome_metrics_service_client.mm b/ios/chrome/browser/metrics/ios_chrome_metrics_service_client.mm index c141286..3f5f6ad 100644 --- a/ios/chrome/browser/metrics/ios_chrome_metrics_service_client.mm +++ b/ios/chrome/browser/metrics/ios_chrome_metrics_service_client.mm
@@ -14,7 +14,6 @@ #include "base/command_line.h" #include "base/files/file_path.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/metrics/histogram_macros.h" #include "base/process/process_metrics.h" #include "base/rand_util.h" @@ -150,7 +149,7 @@ base::StringPiece mime_type, metrics::MetricsLogUploader::MetricServiceType service_type, const metrics::MetricsLogUploader::UploadCallback& on_upload_complete) { - return base::MakeUnique<metrics::NetMetricsLogUploader>( + return std::make_unique<metrics::NetMetricsLogUploader>( GetApplicationContext()->GetSystemURLRequestContext(), server_url, insecure_server_url, mime_type, service_type, on_upload_complete); } @@ -175,26 +174,26 @@ void IOSChromeMetricsServiceClient::Initialize() { PrefService* local_state = GetApplicationContext()->GetLocalState(); - metrics_service_ = base::MakeUnique<metrics::MetricsService>( + metrics_service_ = std::make_unique<metrics::MetricsService>( metrics_state_manager_, this, local_state); if (base::FeatureList::IsEnabled(ukm::kUkmFeature)) - ukm_service_ = base::MakeUnique<ukm::UkmService>(local_state, this); + ukm_service_ = std::make_unique<ukm::UkmService>(local_state, this); // Register metrics providers. metrics_service_->RegisterMetricsProvider( - base::MakeUnique<metrics::NetworkMetricsProvider>()); + std::make_unique<metrics::NetworkMetricsProvider>()); // Currently, we configure OmniboxMetricsProvider to not log events to UMA // if there is a single incognito session visible. In the future, it may // be worth revisiting this to still log events from non-incognito sessions. metrics_service_->RegisterMetricsProvider( - base::MakeUnique<OmniboxMetricsProvider>( + std::make_unique<OmniboxMetricsProvider>( base::Bind(&TabModelList::IsOffTheRecordSessionActive))); { auto stability_metrics_provider = - base::MakeUnique<IOSChromeStabilityMetricsProvider>( + std::make_unique<IOSChromeStabilityMetricsProvider>( GetApplicationContext()->GetLocalState()); stability_metrics_provider_ = stability_metrics_provider.get(); metrics_service_->RegisterMetricsProvider( @@ -202,28 +201,28 @@ } metrics_service_->RegisterMetricsProvider( - base::MakeUnique<metrics::ScreenInfoMetricsProvider>()); + std::make_unique<metrics::ScreenInfoMetricsProvider>()); metrics_service_->RegisterMetricsProvider( - base::MakeUnique<metrics::DriveMetricsProvider>(ios::FILE_LOCAL_STATE)); + std::make_unique<metrics::DriveMetricsProvider>(ios::FILE_LOCAL_STATE)); metrics_service_->RegisterMetricsProvider( - base::MakeUnique<metrics::CallStackProfileMetricsProvider>()); + std::make_unique<metrics::CallStackProfileMetricsProvider>()); metrics_service_->RegisterMetricsProvider( SigninStatusMetricsProvider::CreateInstance( - base::MakeUnique<IOSChromeSigninStatusMetricsProviderDelegate>())); + std::make_unique<IOSChromeSigninStatusMetricsProviderDelegate>())); metrics_service_->RegisterMetricsProvider( - base::MakeUnique<MobileSessionShutdownMetricsProvider>( + std::make_unique<MobileSessionShutdownMetricsProvider>( metrics_service_.get())); metrics_service_->RegisterMetricsProvider( - base::MakeUnique<syncer::DeviceCountMetricsProvider>( + std::make_unique<syncer::DeviceCountMetricsProvider>( base::Bind(&IOSChromeSyncClient::GetDeviceInfoTrackers))); metrics_service_->RegisterMetricsProvider( - base::MakeUnique<translate::TranslateRankerMetricsProvider>()); + std::make_unique<translate::TranslateRankerMetricsProvider>()); } void IOSChromeMetricsServiceClient::CollectFinalHistograms() {
diff --git a/ios/chrome/browser/metrics/ios_chrome_metrics_services_manager_client.mm b/ios/chrome/browser/metrics/ios_chrome_metrics_services_manager_client.mm index e0f12102..18dcb048 100644 --- a/ios/chrome/browser/metrics/ios_chrome_metrics_services_manager_client.mm +++ b/ios/chrome/browser/metrics/ios_chrome_metrics_services_manager_client.mm
@@ -6,7 +6,6 @@ #include "base/command_line.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/strings/string16.h" #include "components/metrics/enabled_state_provider.h" #include "components/metrics/metrics_state_manager.h" @@ -51,7 +50,7 @@ IOSChromeMetricsServicesManagerClient::IOSChromeMetricsServicesManagerClient( PrefService* local_state) : enabled_state_provider_( - base::MakeUnique<IOSChromeEnabledStateProvider>()), + std::make_unique<IOSChromeEnabledStateProvider>()), local_state_(local_state) { DCHECK(local_state); } @@ -62,7 +61,7 @@ std::unique_ptr<rappor::RapporServiceImpl> IOSChromeMetricsServicesManagerClient::CreateRapporServiceImpl() { DCHECK(thread_checker_.CalledOnValidThread()); - return base::MakeUnique<rappor::RapporServiceImpl>( + return std::make_unique<rappor::RapporServiceImpl>( local_state_, base::Bind(&TabModelList::IsOffTheRecordSessionActive)); } @@ -74,7 +73,7 @@ // a dummy value for the name of the switch that disables background // networking. return variations::VariationsService::Create( - base::MakeUnique<IOSChromeVariationsServiceClient>(), local_state_, + std::make_unique<IOSChromeVariationsServiceClient>(), local_state_, GetMetricsStateManager(), "dummy-disable-background-switch", ::CreateUIStringOverrider()); }
diff --git a/ios/chrome/browser/metrics/tab_usage_recorder_egtest.mm b/ios/chrome/browser/metrics/tab_usage_recorder_egtest.mm index f24c86c3..f4b039f 100644 --- a/ios/chrome/browser/metrics/tab_usage_recorder_egtest.mm +++ b/ios/chrome/browser/metrics/tab_usage_recorder_egtest.mm
@@ -2,9 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <memory> + #include "base/ios/ios_util.h" #include "base/mac/bind_objc_block.h" -#include "base/memory/ptr_util.h" #include "base/strings/stringprintf.h" #include "base/strings/sys_string_conversions.h" #include "base/strings/utf_string_conversions.h" @@ -392,8 +393,8 @@ const GURL slowURL = web::test::HttpServer::MakeUrl("http://slow"); responses[slowURL] = "Slow Page"; - web::test::SetUpHttpServer(base::MakeUnique<web::DelayedResponseProvider>( - base::MakeUnique<HtmlResponseProvider>(responses), kSlowURLDelay)); + web::test::SetUpHttpServer(std::make_unique<web::DelayedResponseProvider>( + std::make_unique<HtmlResponseProvider>(responses), kSlowURLDelay)); chrome_test_util::HistogramTester histogramTester; FailureBlock failureBlock = ^(NSString* error) { @@ -406,8 +407,8 @@ chrome_test_util::LoadUrl(slowURL); OpenNewIncognitoTabUsingUIAndEvictMainTabs(); - web::test::SetUpHttpServer(base::MakeUnique<web::DelayedResponseProvider>( - base::MakeUnique<HtmlResponseProvider>(responses), kSlowURLDelay)); + web::test::SetUpHttpServer(std::make_unique<web::DelayedResponseProvider>( + std::make_unique<HtmlResponseProvider>(responses), kSlowURLDelay)); SwitchToNormalMode(); @@ -442,7 +443,7 @@ const GURL slowURL = web::test::HttpServer::MakeUrl("http://slow"); responses[slowURL] = "Slow Page"; - web::test::SetUpHttpServer(base::MakeUnique<HtmlResponseProvider>(responses)); + web::test::SetUpHttpServer(std::make_unique<HtmlResponseProvider>(responses)); chrome_test_util::HistogramTester histogramTester; FailureBlock failureBlock = ^(NSString* error) { @@ -452,8 +453,8 @@ NewMainTabWithURL(slowURL, "Slow"); OpenNewIncognitoTabUsingUIAndEvictMainTabs(); - web::test::SetUpHttpServer(base::MakeUnique<web::DelayedResponseProvider>( - base::MakeUnique<HtmlResponseProvider>(responses), kSlowURLDelay)); + web::test::SetUpHttpServer(std::make_unique<web::DelayedResponseProvider>( + std::make_unique<HtmlResponseProvider>(responses), kSlowURLDelay)); SwitchToNormalMode(); @@ -485,8 +486,8 @@ const GURL slowURL = web::test::HttpServer::MakeUrl("http://slow"); responses[slowURL] = "Slow Page"; - web::test::SetUpHttpServer(base::MakeUnique<web::DelayedResponseProvider>( - base::MakeUnique<HtmlResponseProvider>(responses), kSlowURLDelay)); + web::test::SetUpHttpServer(std::make_unique<web::DelayedResponseProvider>( + std::make_unique<HtmlResponseProvider>(responses), kSlowURLDelay)); chrome_test_util::HistogramTester histogramTester; FailureBlock failureBlock = ^(NSString* error) { @@ -518,7 +519,7 @@ const GURL slowURL = web::test::HttpServer::MakeUrl("http://slow"); responses[slowURL] = "Slow Page"; - web::test::SetUpHttpServer(base::MakeUnique<HtmlResponseProvider>(responses)); + web::test::SetUpHttpServer(std::make_unique<HtmlResponseProvider>(responses)); chrome_test_util::HistogramTester histogramTester; chrome_test_util::OpenNewTab(); @@ -526,8 +527,8 @@ OpenNewIncognitoTabUsingUIAndEvictMainTabs(); - web::test::SetUpHttpServer(base::MakeUnique<web::DelayedResponseProvider>( - base::MakeUnique<HtmlResponseProvider>(responses), kSlowURLDelay)); + web::test::SetUpHttpServer(std::make_unique<web::DelayedResponseProvider>( + std::make_unique<HtmlResponseProvider>(responses), kSlowURLDelay)); SwitchToNormalMode(); // TODO(crbug.com/640977): EarlGrey synchronize on some animations when a @@ -562,8 +563,8 @@ const GURL slowURL = web::test::HttpServer::MakeUrl("http://slow"); responses[slowURL] = "Slow Page"; - web::test::SetUpHttpServer(base::MakeUnique<web::DelayedResponseProvider>( - base::MakeUnique<HtmlResponseProvider>(responses), kSlowURLDelay)); + web::test::SetUpHttpServer(std::make_unique<web::DelayedResponseProvider>( + std::make_unique<HtmlResponseProvider>(responses), kSlowURLDelay)); chrome_test_util::HistogramTester histogramTester; @@ -641,7 +642,7 @@ "<body><a style='margin-left:50px' href='%s' id='link'>link</a></body>", destinationURL.spec().c_str()); responses[destinationURL] = "Whee!"; - web::test::SetUpHttpServer(base::MakeUnique<HtmlResponseProvider>(responses)); + web::test::SetUpHttpServer(std::make_unique<HtmlResponseProvider>(responses)); chrome_test_util::HistogramTester histogramTester; ResetTabUsageRecorder(); @@ -692,7 +693,7 @@ "height:100%%;'>link</div></a></body>", destinationURL.spec().c_str()); responses[destinationURL] = "Whee!"; - web::test::SetUpHttpServer(base::MakeUnique<HtmlResponseProvider>(responses)); + web::test::SetUpHttpServer(std::make_unique<HtmlResponseProvider>(responses)); chrome_test_util::HistogramTester histogramTester; ResetTabUsageRecorder();
diff --git a/ios/chrome/browser/net/cookie_util.mm b/ios/chrome/browser/net/cookie_util.mm index 458162d4..ad043ea 100644 --- a/ios/chrome/browser/net/cookie_util.mm +++ b/ios/chrome/browser/net/cookie_util.mm
@@ -11,7 +11,6 @@ #include "base/logging.h" #import "base/mac/bind_objc_block.h" -#include "base/memory/ptr_util.h" #include "base/memory/ref_counted.h" #include "base/task_scheduler/post_task.h" #include "ios/chrome/browser/browser_state/chrome_browser_state.h" @@ -56,7 +55,7 @@ const CookieStoreConfig& config) { if (config.path.empty()) { // Empty path means in-memory store. - return base::MakeUnique<net::CookieMonster>(nullptr); + return std::make_unique<net::CookieMonster>(nullptr); } const bool restore_old_session_cookies = @@ -100,7 +99,7 @@ config.path, true /* restore_old_session_cookies */, config.crypto_delegate); } - return base::MakeUnique<net::CookieStoreIOSPersistent>( + return std::make_unique<net::CookieStoreIOSPersistent>( persistent_store.get(), std::move(system_cookie_store)); }
diff --git a/ios/chrome/browser/net/ios_chrome_url_request_context_getter.cc b/ios/chrome/browser/net/ios_chrome_url_request_context_getter.cc index f4ffb87d..8141cca 100644 --- a/ios/chrome/browser/net/ios_chrome_url_request_context_getter.cc +++ b/ios/chrome/browser/net/ios_chrome_url_request_context_getter.cc
@@ -7,7 +7,6 @@ #include "base/bind.h" #include "base/compiler_specific.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/message_loop/message_loop.h" #include "ios/chrome/browser/browser_state/chrome_browser_state_io_data.h" #include "ios/chrome/browser/ios_chrome_io_thread.h" @@ -127,7 +126,7 @@ const ChromeBrowserStateIOData* io_data, ProtocolHandlerMap* protocol_handlers) { return new IOSChromeURLRequestContextGetter( - base::MakeUnique<FactoryForMain>(io_data, protocol_handlers)); + std::make_unique<FactoryForMain>(io_data, protocol_handlers)); } // static @@ -137,6 +136,6 @@ const ChromeBrowserStateIOData* io_data, const base::FilePath& partition_path) { return new IOSChromeURLRequestContextGetter( - base::MakeUnique<FactoryForIsolatedApp>(io_data, partition_path, + std::make_unique<FactoryForIsolatedApp>(io_data, partition_path, main_context)); }
diff --git a/ios/chrome/browser/notification_promo.cc b/ios/chrome/browser/notification_promo.cc index ed54160..426b9e7 100644 --- a/ios/chrome/browser/notification_promo.cc +++ b/ios/chrome/browser/notification_promo.cc
@@ -8,7 +8,6 @@ #include <utility> -#include "base/memory/ptr_util.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" #include "base/time/time.h" @@ -141,7 +140,7 @@ double first_view_time, int views, bool closed) { - auto ntp_promo = base::MakeUnique<base::DictionaryValue>(); + auto ntp_promo = std::make_unique<base::DictionaryValue>(); ntp_promo->SetDouble(kPrefPromoFirstViewTime, first_view_time); ntp_promo->SetInteger(kPrefPromoViews, views); ntp_promo->SetBoolean(kPrefPromoClosed, closed);
diff --git a/ios/chrome/browser/notification_promo_unittest.cc b/ios/chrome/browser/notification_promo_unittest.cc index bb1c076..59ca369c 100644 --- a/ios/chrome/browser/notification_promo_unittest.cc +++ b/ios/chrome/browser/notification_promo_unittest.cc
@@ -9,7 +9,6 @@ #include <vector> #include "base/json/json_reader.h" -#include "base/memory/ptr_util.h" #include "base/metrics/field_trial.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" @@ -52,8 +51,8 @@ public: NotificationPromoTest() : notification_promo_(&local_state_), - field_trial_list_(base::MakeUnique<base::FieldTrialList>( - base::MakeUnique<base::MockEntropyProvider>())), + field_trial_list_(std::make_unique<base::FieldTrialList>( + std::make_unique<base::MockEntropyProvider>())), received_notification_(false), start_(0.0), end_(0.0),
diff --git a/ios/chrome/browser/ntp_snippets/ios_chrome_content_suggestions_service_factory_util.cc b/ios/chrome/browser/ntp_snippets/ios_chrome_content_suggestions_service_factory_util.cc index 2b97a94..22885e65 100644 --- a/ios/chrome/browser/ntp_snippets/ios_chrome_content_suggestions_service_factory_util.cc +++ b/ios/chrome/browser/ntp_snippets/ios_chrome_content_suggestions_service_factory_util.cc
@@ -7,7 +7,6 @@ #include "base/feature_list.h" #include "base/files/file_path.h" #include "base/json/json_reader.h" -#include "base/memory/ptr_util.h" #include "base/memory/singleton.h" #include "base/task_scheduler/post_task.h" #include "base/threading/sequenced_worker_pool.h" @@ -111,13 +110,13 @@ DCHECK(!browser_state->IsOffTheRecord()); PrefService* prefs = chrome_browser_state->GetPrefs(); - auto user_classifier = base::MakeUnique<UserClassifier>( + auto user_classifier = std::make_unique<UserClassifier>( prefs, base::DefaultClock::GetInstance()); - auto debug_logger = base::MakeUnique<Logger>(); + auto debug_logger = std::make_unique<Logger>(); // TODO(crbug.com/676249): Implement a persistent scheduler for iOS. - auto scheduler = base::MakeUnique<RemoteSuggestionsSchedulerImpl>( + auto scheduler = std::make_unique<RemoteSuggestionsSchedulerImpl>( /*persistent_scheduler=*/nullptr, user_classifier.get(), prefs, GetApplicationContext()->GetLocalState(), base::DefaultClock::GetInstance(), debug_logger.get()); @@ -135,7 +134,7 @@ ntp_snippets::BuildSelectedCategoryRanker( prefs, base::DefaultClock::GetInstance(), /*is_chrome_home_enabled=*/false); - return base::MakeUnique<ContentSuggestionsService>( + return std::make_unique<ContentSuggestionsService>( State::ENABLED, signin_manager, history_service, large_icon_service, prefs, std::move(category_ranker), std::move(user_classifier), std::move(scheduler), std::move(debug_logger)); @@ -150,7 +149,7 @@ ReadingListModelFactory::GetForBrowserState(chrome_browser_state); std::unique_ptr<ntp_snippets::ReadingListSuggestionsProvider> reading_list_suggestions_provider = - base::MakeUnique<ntp_snippets::ReadingListSuggestionsProvider>( + std::make_unique<ntp_snippets::ReadingListSuggestionsProvider>( service, reading_list_model); service->RegisterProvider(std::move(reading_list_suggestions_provider)); } @@ -177,7 +176,7 @@ api_key = is_stable_channel ? google_apis::GetAPIKey() : google_apis::GetNonStableAPIKey(); } - auto suggestions_fetcher = base::MakeUnique<RemoteSuggestionsFetcherImpl>( + auto suggestions_fetcher = std::make_unique<RemoteSuggestionsFetcherImpl>( identity_manager, request_context, prefs, nullptr, base::BindRepeating(&ParseJson), GetFetchEndpoint(GetChannel()), api_key, service->user_classifier()); @@ -185,14 +184,14 @@ // This pref is also used for logging. If it is changed, change it in the // other places. std::string pref_name = prefs::kArticlesForYouEnabled; - auto provider = base::MakeUnique<RemoteSuggestionsProviderImpl>( + auto provider = std::make_unique<RemoteSuggestionsProviderImpl>( service, prefs, GetApplicationContext()->GetApplicationLocale(), service->category_ranker(), service->remote_suggestions_scheduler(), std::move(suggestions_fetcher), - base::MakeUnique<ImageFetcherImpl>(CreateIOSImageDecoder(), + std::make_unique<ImageFetcherImpl>(CreateIOSImageDecoder(), request_context.get()), - base::MakeUnique<RemoteSuggestionsDatabase>(database_dir), - base::MakeUnique<RemoteSuggestionsStatusServiceImpl>( + std::make_unique<RemoteSuggestionsDatabase>(database_dir), + std::make_unique<RemoteSuggestionsStatusServiceImpl>( signin_manager->IsAuthenticated(), prefs, pref_name), /*prefetched_pages_tracker=*/nullptr, /*breaking_news_raw_data_provider*/ nullptr, service->debug_logger(),
diff --git a/ios/chrome/browser/ntp_tiles/ios_most_visited_sites_factory.cc b/ios/chrome/browser/ntp_tiles/ios_most_visited_sites_factory.cc index 3771ff9f..6f26a4f 100644 --- a/ios/chrome/browser/ntp_tiles/ios_most_visited_sites_factory.cc +++ b/ios/chrome/browser/ntp_tiles/ios_most_visited_sites_factory.cc
@@ -4,7 +4,6 @@ #include "ios/chrome/browser/ntp_tiles/ios_most_visited_sites_factory.h" -#include "base/memory/ptr_util.h" #include "base/task_scheduler/post_task.h" #include "components/history/core/browser/top_sites.h" #include "components/image_fetcher/core/image_fetcher_impl.h" @@ -22,16 +21,16 @@ std::unique_ptr<ntp_tiles::MostVisitedSites> IOSMostVisitedSitesFactory::NewForBrowserState( ios::ChromeBrowserState* browser_state) { - return base::MakeUnique<ntp_tiles::MostVisitedSites>( + return std::make_unique<ntp_tiles::MostVisitedSites>( browser_state->GetPrefs(), ios::TopSitesFactory::GetForBrowserState(browser_state), suggestions::SuggestionsServiceFactory::GetForBrowserState(browser_state), IOSPopularSitesFactory::NewForBrowserState(browser_state), - base::MakeUnique<ntp_tiles::IconCacherImpl>( + std::make_unique<ntp_tiles::IconCacherImpl>( ios::FaviconServiceFactory::GetForBrowserState( browser_state, ServiceAccessType::IMPLICIT_ACCESS), IOSChromeLargeIconServiceFactory::GetForBrowserState(browser_state), - base::MakeUnique<image_fetcher::ImageFetcherImpl>( + std::make_unique<image_fetcher::ImageFetcherImpl>( image_fetcher::CreateIOSImageDecoder(), browser_state->GetRequestContext())), nil);
diff --git a/ios/chrome/browser/ntp_tiles/ios_popular_sites_factory.cc b/ios/chrome/browser/ntp_tiles/ios_popular_sites_factory.cc index 58e87b3..bd9ff63 100644 --- a/ios/chrome/browser/ntp_tiles/ios_popular_sites_factory.cc +++ b/ios/chrome/browser/ntp_tiles/ios_popular_sites_factory.cc
@@ -6,7 +6,6 @@ #include "base/bind.h" #include "base/files/file_path.h" -#include "base/memory/ptr_util.h" #include "components/ntp_tiles/json_unsafe_parser.h" #include "components/ntp_tiles/popular_sites_impl.h" #include "ios/chrome/browser/application_context.h" @@ -17,7 +16,7 @@ std::unique_ptr<ntp_tiles::PopularSites> IOSPopularSitesFactory::NewForBrowserState( ios::ChromeBrowserState* browser_state) { - return base::MakeUnique<ntp_tiles::PopularSitesImpl>( + return std::make_unique<ntp_tiles::PopularSitesImpl>( browser_state->GetPrefs(), ios::TemplateURLServiceFactory::GetForBrowserState(browser_state), GetApplicationContext()->GetVariationsService(),
diff --git a/ios/chrome/browser/omaha/omaha_service.mm b/ios/chrome/browser/omaha/omaha_service.mm index 2c4b0e7..6ae9dc3 100644 --- a/ios/chrome/browser/omaha/omaha_service.mm +++ b/ios/chrome/browser/omaha/omaha_service.mm
@@ -13,7 +13,6 @@ #include "base/i18n/time_formatting.h" #include "base/ios/device_util.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/metrics/field_trial.h" #include "base/rand_util.h" #include "base/strings/stringprintf.h" @@ -235,7 +234,7 @@ urlIsParsed_ = YES; manifestIsParsed_ = YES; } else if ([status isEqualToString:@"ok"]) { - updateInformation_ = base::MakeUnique<UpgradeRecommendedDetails>(); + updateInformation_ = std::make_unique<UpgradeRecommendedDetails>(); } else { hasError_ = YES; } @@ -639,7 +638,7 @@ void OmahaService::GetDebugInformationOnIOThread( const base::Callback<void(base::DictionaryValue*)> callback) { - auto result = base::MakeUnique<base::DictionaryValue>(); + auto result = std::make_unique<base::DictionaryValue>(); result->SetString("message", GetCurrentPingContent()); result->SetString("last_sent_time",
diff --git a/ios/chrome/browser/omaha/omaha_service_unittest.mm b/ios/chrome/browser/omaha/omaha_service_unittest.mm index 4c2642d..51c080a 100644 --- a/ios/chrome/browser/omaha/omaha_service_unittest.mm +++ b/ios/chrome/browser/omaha/omaha_service_unittest.mm
@@ -43,7 +43,7 @@ OmahaServiceTest() : need_update_(false), scoped_browser_state_manager_( - base::MakeUnique<TestChromeBrowserStateManager>( + std::make_unique<TestChromeBrowserStateManager>( base::FilePath(kUserDataDir))) { GetApplicationContext()->GetLocalState()->SetInt64( metrics::prefs::kInstallDate, install_time_util::kUnknownInstallDate);
diff --git a/ios/chrome/browser/open_from_clipboard/create_clipboard_recent_content.mm b/ios/chrome/browser/open_from_clipboard/create_clipboard_recent_content.mm index 52f6cc78..174dcdf 100644 --- a/ios/chrome/browser/open_from_clipboard/create_clipboard_recent_content.mm +++ b/ios/chrome/browser/open_from_clipboard/create_clipboard_recent_content.mm
@@ -4,7 +4,6 @@ #include "ios/chrome/browser/open_from_clipboard/create_clipboard_recent_content.h" -#include "base/memory/ptr_util.h" #import "components/open_from_clipboard/clipboard_recent_content_ios.h" #include "ios/chrome/browser/chrome_url_constants.h" #include "ios/chrome/common/app_group/app_group_constants.h" @@ -14,6 +13,6 @@ #endif std::unique_ptr<ClipboardRecentContent> CreateClipboardRecentContentIOS() { - return base::MakeUnique<ClipboardRecentContentIOS>( + return std::make_unique<ClipboardRecentContentIOS>( kChromeUIScheme, app_group::GetGroupUserDefaults()); }
diff --git a/ios/chrome/browser/passwords/credential_manager_egtest.mm b/ios/chrome/browser/passwords/credential_manager_egtest.mm index a792818..18a31f3 100644 --- a/ios/chrome/browser/passwords/credential_manager_egtest.mm +++ b/ios/chrome/browser/passwords/credential_manager_egtest.mm
@@ -8,6 +8,8 @@ #import <UIKit/UIKit.h> #import <XCTest/XCTest.h> +#include <memory> + #include "base/strings/utf_string_conversions.h" #include "base/test/scoped_feature_list.h" #include "components/keyed_service/core/service_access_type.h" @@ -37,7 +39,7 @@ std::unique_ptr<net::test_server::HttpResponse> StandardResponse( const net::test_server::HttpRequest& request) { std::unique_ptr<net::test_server::BasicHttpResponse> http_response = - base::MakeUnique<net::test_server::BasicHttpResponse>(); + std::make_unique<net::test_server::BasicHttpResponse>(); http_response->set_code(net::HTTP_OK); http_response->set_content( "<head><title>Example website</title></head>"
diff --git a/ios/chrome/browser/passwords/credential_manager_unittest.mm b/ios/chrome/browser/passwords/credential_manager_unittest.mm index f95ecc36..b52c89dd 100644 --- a/ios/chrome/browser/passwords/credential_manager_unittest.mm +++ b/ios/chrome/browser/passwords/credential_manager_unittest.mm
@@ -4,6 +4,8 @@ #import "ios/chrome/browser/passwords/credential_manager.h" +#include <memory> + #include "base/mac/foundation_util.h" #include "base/strings/utf_string_conversions.h" #include "components/password_manager/core/browser/password_manager.h" @@ -200,8 +202,8 @@ void SetUp() override { CredentialManagerBaseTest::SetUp(); - client_ = base::MakeUnique<MockPasswordManagerClient>(); - manager_ = base::MakeUnique<CredentialManager>(client_.get(), web_state()); + client_ = std::make_unique<MockPasswordManagerClient>(); + manager_ = std::make_unique<CredentialManager>(client_.get(), web_state()); // Inject JavaScript and set up secure context. LoadHtml(@"<html></html>", GURL(kHttpsWebOrigin));
diff --git a/ios/chrome/browser/passwords/credential_manager_util_unittest.cc b/ios/chrome/browser/passwords/credential_manager_util_unittest.cc index ae4f981..f4f17f23 100644 --- a/ios/chrome/browser/passwords/credential_manager_util_unittest.cc +++ b/ios/chrome/browser/passwords/credential_manager_util_unittest.cc
@@ -4,7 +4,8 @@ #include "ios/chrome/browser/passwords/credential_manager_util.h" -#include "base/memory/ptr_util.h" +#include <memory> + #include "base/strings/string16.h" #include "base/strings/utf_string_conversions.h" #include "base/values.h" @@ -230,7 +231,7 @@ // Build example valid |providers| list. std::unique_ptr<base::ListValue> list_ptr = - base::MakeUnique<base::ListValue>(); + std::make_unique<base::ListValue>(); list_ptr->GetList().emplace_back(kTestWebOrigin); list_ptr->GetList().emplace_back("https://google.com"); json.SetList(kCredentialRequestProvidersKey, std::move(list_ptr)); @@ -242,7 +243,7 @@ GURL("https://google.com"))); // ParseFederations should skip invalid URLs. - list_ptr = base::MakeUnique<base::ListValue>(); + list_ptr = std::make_unique<base::ListValue>(); list_ptr->GetList().emplace_back(kTestWebOrigin); list_ptr->GetList().emplace_back("not a valid url"); json.SetList(kCredentialRequestProvidersKey, std::move(list_ptr));
diff --git a/ios/chrome/browser/passwords/password_controller.mm b/ios/chrome/browser/passwords/password_controller.mm index 2aaed06..11a2036 100644 --- a/ios/chrome/browser/passwords/password_controller.mm +++ b/ios/chrome/browser/passwords/password_controller.mm
@@ -16,7 +16,6 @@ #include "base/json/json_writer.h" #import "base/mac/bind_objc_block.h" #include "base/mac/foundation_util.h" -#include "base/memory/ptr_util.h" #include "base/strings/string16.h" #include "base/strings/sys_string_conversions.h" #include "base/strings/utf_string_conversions.h" @@ -217,14 +216,14 @@ rootDict.SetString("origin", origin.spec()); rootDict.SetString("action", action.spec()); - auto fieldList = base::MakeUnique<base::ListValue>(); + auto fieldList = std::make_unique<base::ListValue>(); - auto usernameField = base::MakeUnique<base::DictionaryValue>(); + auto usernameField = std::make_unique<base::DictionaryValue>(); usernameField->SetString("name", username_element); usernameField->SetString("value", username_value); fieldList->Append(std::move(usernameField)); - auto passwordField = base::MakeUnique<base::DictionaryValue>(); + auto passwordField = std::make_unique<base::DictionaryValue>(); passwordField->SetString("name", password_element); passwordField->SetString("value", password_value); fieldList->Append(std::move(passwordField)); @@ -333,7 +332,7 @@ sentRequestToStore_ = NO; if (base::FeatureList::IsEnabled(features::kCredentialManager)) { - credentialManager_ = base::MakeUnique<CredentialManager>( + credentialManager_ = std::make_unique<CredentialManager>( passwordManagerClient_.get(), webState_); }
diff --git a/ios/chrome/browser/passwords/password_controller_unittest.mm b/ios/chrome/browser/passwords/password_controller_unittest.mm index 553e94ad..77ee2d7 100644 --- a/ios/chrome/browser/passwords/password_controller_unittest.mm +++ b/ios/chrome/browser/passwords/password_controller_unittest.mm
@@ -11,7 +11,6 @@ #include "base/json/json_reader.h" #include "base/mac/bind_objc_block.h" -#include "base/memory/ptr_util.h" #include "base/memory/ref_counted.h" #include "base/strings/sys_string_conversions.h" #include "base/strings/utf_string_conversions.h" @@ -106,7 +105,7 @@ web::WebState* web_state, password_manager::PasswordStore* store, MockPasswordManagerClient** weak_client) { - auto client = base::MakeUnique<NiceMock<MockPasswordManagerClient>>(store); + auto client = std::make_unique<NiceMock<MockPasswordManagerClient>>(store); if (weak_client) *weak_client = client.get(); return [[PasswordController alloc] initWithWebState:web_state
diff --git a/ios/chrome/browser/payments/ios_payment_instrument_finder.mm b/ios/chrome/browser/payments/ios_payment_instrument_finder.mm index 6578fba67..4caabb3 100644 --- a/ios/chrome/browser/payments/ios_payment_instrument_finder.mm +++ b/ios/chrome/browser/payments/ios_payment_instrument_finder.mm
@@ -12,7 +12,6 @@ #include "base/bind.h" #include "base/json/json_reader.h" -#include "base/memory/ptr_util.h" #include "base/strings/sys_string_conversions.h" #include "base/threading/sequenced_worker_pool.h" #include "base/values.h" @@ -342,7 +341,7 @@ if (data) { UIImage* icon = [UIImage imageWithData:data scale:[UIScreen mainScreen].scale]; - instruments_found_.push_back(base::MakeUnique<IOSPaymentInstrument>( + instruments_found_.push_back(std::make_unique<IOSPaymentInstrument>( local_method_name.spec(), local_universal_link, local_app_name, icon, payment_request_ui_delegate_)); }
diff --git a/ios/chrome/browser/payments/ios_payment_instrument_finder_unittest.mm b/ios/chrome/browser/payments/ios_payment_instrument_finder_unittest.mm index 5a3342c..3ca1d94 100644 --- a/ios/chrome/browser/payments/ios_payment_instrument_finder_unittest.mm +++ b/ios/chrome/browser/payments/ios_payment_instrument_finder_unittest.mm
@@ -4,7 +4,6 @@ #include "ios/chrome/browser/payments/ios_payment_instrument_finder.h" -#include "base/memory/ptr_util.h" #include "base/run_loop.h" #include "base/strings/utf_string_conversions.h" #include "base/test/scoped_task_environment.h" @@ -44,7 +43,7 @@ context_getter_(new net::TestURLRequestContextGetter( base::ThreadTaskRunnerHandle::Get())), ios_payment_instrument_finder_( - base::MakeUnique<TestIOSPaymentInstrumentFinder>( + std::make_unique<TestIOSPaymentInstrumentFinder>( context_getter_.get())) {} ~PaymentRequestIOSPaymentInstrumentFinderTest() override {}
diff --git a/ios/chrome/browser/payments/ios_payment_instrument_launcher.mm b/ios/chrome/browser/payments/ios_payment_instrument_launcher.mm index 3bb5bc0..a2ea27f 100644 --- a/ios/chrome/browser/payments/ios_payment_instrument_launcher.mm +++ b/ios/chrome/browser/payments/ios_payment_instrument_launcher.mm
@@ -5,12 +5,12 @@ #import "ios/chrome/browser/payments/ios_payment_instrument_launcher.h" #include <map> +#include <memory> #include "base/base64.h" #include "base/ios/ios_util.h" #include "base/json/json_reader.h" #include "base/json/json_writer.h" -#include "base/memory/ptr_util.h" #include "base/strings/sys_string_conversions.h" #include "base/strings/utf_string_conversions.h" #include "base/values.h" @@ -71,7 +71,7 @@ delegate_ = delegate; std::unique_ptr<base::DictionaryValue> params_to_payment_app = - base::MakeUnique<base::DictionaryValue>(); + std::make_unique<base::DictionaryValue>(); // TODO(crbug.com/748556): Filter the following list to only show method names // that we know the payment app supports. For now, sending all the requested @@ -80,7 +80,7 @@ // information, but this is not ideal nor is this consistent with Android // implementation. std::unique_ptr<base::ListValue> method_names = - base::MakeUnique<base::ListValue>(); + std::make_unique<base::ListValue>(); for (auto const& it : payment_request->stringified_method_data()) method_names->GetList().emplace_back(it.first); params_to_payment_app->SetList(kMethodNames, std::move(method_names)); @@ -196,7 +196,7 @@ const std::map<std::string, std::set<std::string>>& stringified_method_data) { std::unique_ptr<base::DictionaryValue> method_data = - base::MakeUnique<base::DictionaryValue>(); + std::make_unique<base::DictionaryValue>(); for (auto const& map_it : stringified_method_data) { base::ListValue data_list; @@ -217,7 +217,7 @@ IOSPaymentInstrumentLauncher::SerializeCertificateChain( web::NavigationItem* item) { std::unique_ptr<base::ListValue> cert_chain_list = - base::MakeUnique<base::ListValue>(); + std::make_unique<base::ListValue>(); if (!item) return cert_chain_list; @@ -251,7 +251,7 @@ std::unique_ptr<base::ListValue> IOSPaymentInstrumentLauncher::SerializeModifiers(PaymentDetails details) { std::unique_ptr<base::ListValue> modifiers = - base::MakeUnique<base::ListValue>(); + std::make_unique<base::ListValue>(); size_t numModifiers = details.modifiers.size(); for (size_t i = 0; i < numModifiers; ++i) { std::unique_ptr<base::DictionaryValue> modifier =
diff --git a/ios/chrome/browser/payments/ios_payment_instrument_launcher_unittest.mm b/ios/chrome/browser/payments/ios_payment_instrument_launcher_unittest.mm index 588e9e0..4fe4b57 100644 --- a/ios/chrome/browser/payments/ios_payment_instrument_launcher_unittest.mm +++ b/ios/chrome/browser/payments/ios_payment_instrument_launcher_unittest.mm
@@ -120,7 +120,7 @@ method_datum1.supported_methods.push_back("https://jefpay.com"); method_datum1.supported_methods.push_back("https://bobpay.com"); std::unique_ptr<base::DictionaryValue> data = - base::MakeUnique<base::DictionaryValue>(); + std::make_unique<base::DictionaryValue>(); data->SetString("Some data", "Some stringified data"); std::string stringified_data; base::JSONWriter::Write(*data, &stringified_data); @@ -171,7 +171,7 @@ LaunchIOSPaymentInstrument_MalformedUniversalLink) { if (base::ios::IsRunningOnIOS10OrLater()) { std::unique_ptr<web::TestNavigationManager> navigation_manager = - base::MakeUnique<web::TestNavigationManager>(); + std::make_unique<web::TestNavigationManager>(); web_state_.SetNavigationManager(std::move(navigation_manager)); WebPaymentRequest web_payment_request =
diff --git a/ios/chrome/browser/payments/payment_request.mm b/ios/chrome/browser/payments/payment_request.mm index 04de7e51..d2dbfde 100644 --- a/ios/chrome/browser/payments/payment_request.mm +++ b/ios/chrome/browser/payments/payment_request.mm
@@ -10,7 +10,6 @@ #include "base/containers/adapters.h" #include "base/feature_list.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/strings/utf_string_conversions.h" #include "components/autofill/core/browser/autofill_data_util.h" #include "components/autofill/core/browser/autofill_profile.h" @@ -263,7 +262,7 @@ CurrencyFormatter* PaymentRequest::GetOrCreateCurrencyFormatter() { if (!currency_formatter_) { DCHECK(web_payment_request_.details.total); - currency_formatter_ = base::MakeUnique<CurrencyFormatter>( + currency_formatter_ = std::make_unique<CurrencyFormatter>( web_payment_request_.details.total->amount->currency, web_payment_request_.details.total->amount->currency_system, GetApplicationLocale()); @@ -285,7 +284,7 @@ autofill::AutofillProfile* PaymentRequest::AddAutofillProfile( const autofill::AutofillProfile& profile) { profile_cache_.push_back( - base::MakeUnique<autofill::AutofillProfile>(profile)); + std::make_unique<autofill::AutofillProfile>(profile)); contact_profiles_.push_back(profile_cache_.back().get()); shipping_profiles_.push_back(profile_cache_.back().get()); @@ -338,7 +337,7 @@ for (const auto* profile : profiles_to_suggest) { profile_cache_.push_back( - base::MakeUnique<autofill::AutofillProfile>(*profile)); + std::make_unique<autofill::AutofillProfile>(*profile)); } } @@ -393,7 +392,7 @@ // AutofillPaymentInstrument makes a copy of |credit_card| so it is // effectively owned by this object. - payment_method_cache_.push_back(base::MakeUnique<AutofillPaymentInstrument>( + payment_method_cache_.push_back(std::make_unique<AutofillPaymentInstrument>( method_name, credit_card, matches_merchant_card_type_exactly, billing_profiles(), GetApplicationLocale(), this)); @@ -436,7 +435,7 @@ void PaymentRequest::InvokePaymentApp( id<PaymentResponseHelperConsumer> consumer) { DCHECK(selected_payment_method()); - response_helper_ = base::MakeUnique<PaymentResponseHelper>(consumer, this); + response_helper_ = std::make_unique<PaymentResponseHelper>(consumer, this); selected_payment_method()->InvokePaymentApp(response_helper_.get()); }
diff --git a/ios/chrome/browser/payments/payment_request_test_util.mm b/ios/chrome/browser/payments/payment_request_test_util.mm index 440c72a..8268e7d1 100644 --- a/ios/chrome/browser/payments/payment_request_test_util.mm +++ b/ios/chrome/browser/payments/payment_request_test_util.mm
@@ -4,7 +4,8 @@ #include "ios/chrome/browser/payments/payment_request_test_util.h" -#include "base/memory/ptr_util.h" +#include <memory> + #include "base/strings/utf_string_conversions.h" #include "components/payments/core/payment_item.h" #include "components/payments/core/payment_method_data.h" @@ -23,7 +24,7 @@ method_datum.supported_methods.push_back("visa"); method_datum.supported_methods.push_back("amex"); web_payment_request.method_data.push_back(method_datum); - web_payment_request.details.total = base::MakeUnique<payments::PaymentItem>(); + web_payment_request.details.total = std::make_unique<payments::PaymentItem>(); web_payment_request.details.total->label = "Total"; web_payment_request.details.total->amount->value = "1.00"; web_payment_request.details.total->amount->currency = "USD";
diff --git a/ios/chrome/browser/payments/payment_request_unittest.mm b/ios/chrome/browser/payments/payment_request_unittest.mm index 896940b..bc18a3f 100644 --- a/ios/chrome/browser/payments/payment_request_unittest.mm +++ b/ios/chrome/browser/payments/payment_request_unittest.mm
@@ -6,7 +6,6 @@ #include <memory> -#include "base/memory/ptr_util.h" #include "base/strings/utf_string_conversions.h" #include "base/test/scoped_feature_list.h" #include "base/test/scoped_task_environment.h" @@ -94,7 +93,7 @@ WebPaymentRequest web_payment_request; autofill::TestPersonalDataManager personal_data_manager; - web_payment_request.details.total = base::MakeUnique<PaymentItem>(); + web_payment_request.details.total = std::make_unique<PaymentItem>(); web_payment_request.details.total->amount->currency = "USD"; TestPaymentRequest payment_request1(web_payment_request, chrome_browser_state_.get(), &web_state_, @@ -378,7 +377,7 @@ autofill::TestPersonalDataManager personal_data_manager; PaymentDetails details; - details.total = base::MakeUnique<PaymentItem>(); + details.total = std::make_unique<PaymentItem>(); std::vector<PaymentShippingOption> shipping_options; PaymentShippingOption option1; option1.id = "option:1"; @@ -414,7 +413,7 @@ autofill::TestPersonalDataManager personal_data_manager; PaymentDetails details; - details.total = base::MakeUnique<PaymentItem>(); + details.total = std::make_unique<PaymentItem>(); details.total->amount->value = "10.00"; details.total->amount->currency = "USD"; web_payment_request.details = std::move(details); @@ -425,7 +424,7 @@ // Simulate an update with a new total amount. PaymentDetails new_details; - new_details.total = base::MakeUnique<PaymentItem>(); + new_details.total = std::make_unique<PaymentItem>(); new_details.total->amount->value = "20.00"; new_details.total->amount->currency = "CAD"; payment_request.UpdatePaymentDetails(std::move(new_details)); @@ -440,7 +439,7 @@ autofill::TestPersonalDataManager personal_data_manager; PaymentDetails details; - details.total = base::MakeUnique<PaymentItem>(); + details.total = std::make_unique<PaymentItem>(); details.total->amount->value = "10.00"; details.total->amount->currency = "USD"; web_payment_request.details = std::move(details); @@ -885,7 +884,7 @@ PaymentDetailsModifier modifier; modifier.method_data.supported_methods.push_back("basic-card"); modifier.method_data.supported_networks.push_back("amex"); - modifier.total = base::MakeUnique<payments::PaymentItem>(); + modifier.total = std::make_unique<payments::PaymentItem>(); modifier.total->label = "Discounted Total"; modifier.total->amount->value = "0.99"; modifier.total->amount->currency = "USD"; @@ -923,7 +922,7 @@ PaymentDetailsModifier modifier; modifier.method_data.supported_methods.push_back("basic-card"); modifier.method_data.supported_networks.push_back("amex"); - modifier.total = base::MakeUnique<payments::PaymentItem>(); + modifier.total = std::make_unique<payments::PaymentItem>(); modifier.total->label = "Discounted Total"; modifier.total->amount->value = "0.99"; modifier.total->amount->currency = "USD"; @@ -973,7 +972,7 @@ modifier.method_data.supported_networks.push_back("amex"); modifier.method_data.supported_types.insert( autofill::CreditCard::CARD_TYPE_CREDIT); - modifier.total = base::MakeUnique<payments::PaymentItem>(); + modifier.total = std::make_unique<payments::PaymentItem>(); modifier.total->label = "Discounted Total"; modifier.total->amount->value = "0.99"; modifier.total->amount->currency = "USD"; @@ -1016,7 +1015,7 @@ modifier.method_data.supported_networks.push_back("amex"); modifier.method_data.supported_types.insert( autofill::CreditCard::CARD_TYPE_CREDIT); - modifier.total = base::MakeUnique<payments::PaymentItem>(); + modifier.total = std::make_unique<payments::PaymentItem>(); modifier.total->label = "Discounted Total"; modifier.total->amount->value = "0.99"; modifier.total->amount->currency = "USD";
diff --git a/ios/chrome/browser/payments/payment_request_unittest_base.mm b/ios/chrome/browser/payments/payment_request_unittest_base.mm index eb42c9f..eb1075cc 100644 --- a/ios/chrome/browser/payments/payment_request_unittest_base.mm +++ b/ios/chrome/browser/payments/payment_request_unittest_base.mm
@@ -4,7 +4,6 @@ #include "ios/chrome/browser/payments/payment_request_unittest_base.h" -#include "base/memory/ptr_util.h" #include "components/payments/core/payment_prefs.h" #include "components/payments/core/payments_test_util.h" #include "components/signin/core/browser/signin_manager.h" @@ -35,7 +34,7 @@ } void PaymentRequestUnitTestBase::CreateTestPaymentRequest() { - payment_request_ = base::MakeUnique<payments::TestPaymentRequest>( + payment_request_ = std::make_unique<payments::TestPaymentRequest>( payment_request_test_util::CreateTestWebPaymentRequest(), chrome_browser_state_.get(), &web_state_, &personal_data_manager_); payment_request_->SetPrefService(pref_service_.get());
diff --git a/ios/chrome/browser/payments/payment_response_helper_unittest.mm b/ios/chrome/browser/payments/payment_response_helper_unittest.mm index 4b51e95..6c79182 100644 --- a/ios/chrome/browser/payments/payment_response_helper_unittest.mm +++ b/ios/chrome/browser/payments/payment_response_helper_unittest.mm
@@ -4,11 +4,11 @@ #import "ios/chrome/browser/payments/payment_response_helper.h" +#include <memory> #include <string> #include "base/json/json_writer.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/strings/string16.h" #include "base/strings/utf_string_conversions.h" #include "base/test/scoped_task_environment.h" @@ -67,7 +67,7 @@ credit_card_(autofill::test::GetCreditCard()), chrome_browser_state_(TestChromeBrowserState::Builder().Build()) { personal_data_manager_.AddProfile(profile_); - payment_request_ = base::MakeUnique<TestPaymentRequest>( + payment_request_ = std::make_unique<TestPaymentRequest>( payment_request_test_util::CreateTestWebPaymentRequest(), chrome_browser_state_.get(), &web_state_, &personal_data_manager_); }
diff --git a/ios/chrome/browser/prerender/prerender_service_factory.mm b/ios/chrome/browser/prerender/prerender_service_factory.mm index 3afde79..5a30fb1 100644 --- a/ios/chrome/browser/prerender/prerender_service_factory.mm +++ b/ios/chrome/browser/prerender/prerender_service_factory.mm
@@ -4,7 +4,6 @@ #import "ios/chrome/browser/prerender/prerender_service_factory.h" -#include "base/memory/ptr_util.h" #include "base/memory/singleton.h" #include "components/keyed_service/ios/browser_state_dependency_manager.h" #include "ios/chrome/browser/browser_state/chrome_browser_state.h" @@ -38,7 +37,7 @@ web::BrowserState* context) const { ios::ChromeBrowserState* browser_state = ios::ChromeBrowserState::FromBrowserState(context); - return base::MakeUnique<PrerenderService>(browser_state); + return std::make_unique<PrerenderService>(browser_state); } bool PrerenderServiceFactory::ServiceIsNULLWhileTesting() const {
diff --git a/ios/chrome/browser/prerender/prerender_service_unittest.mm b/ios/chrome/browser/prerender/prerender_service_unittest.mm index ba61dfa..e5509fe 100644 --- a/ios/chrome/browser/prerender/prerender_service_unittest.mm +++ b/ios/chrome/browser/prerender/prerender_service_unittest.mm
@@ -7,7 +7,6 @@ #include <memory> #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "ios/chrome/browser/browser_state/test_chrome_browser_state.h" #import "ios/web/public/test/fakes/test_web_state.h" #include "ios/web/public/test/test_web_thread_bundle.h" @@ -24,7 +23,7 @@ PrerenderServiceTest() { TestChromeBrowserState::Builder builder; browser_state_ = builder.Build(); - service_ = base::MakeUnique<PrerenderService>(browser_state_.get()); + service_ = std::make_unique<PrerenderService>(browser_state_.get()); } ~PrerenderServiceTest() override = default;
diff --git a/ios/chrome/browser/providers/chromium_browser_provider.mm b/ios/chrome/browser/providers/chromium_browser_provider.mm index 4e50926..9291c1a 100644 --- a/ios/chrome/browser/providers/chromium_browser_provider.mm +++ b/ios/chrome/browser/providers/chromium_browser_provider.mm
@@ -4,7 +4,8 @@ #import "ios/chrome/browser/providers/chromium_browser_provider.h" -#include "base/memory/ptr_util.h" +#include <memory> + #import "ios/chrome/browser/providers/chromium_logo_controller.h" #import "ios/chrome/browser/providers/chromium_spotlight_provider.h" #import "ios/chrome/browser/providers/chromium_voice_search_provider.h" @@ -22,15 +23,15 @@ #endif ChromiumBrowserProvider::ChromiumBrowserProvider() - : app_distribution_provider_(base::MakeUnique<AppDistributionProvider>()), - branded_image_provider_(base::MakeUnique<ChromiumBrandedImageProvider>()), - signin_error_provider_(base::MakeUnique<ios::SigninErrorProvider>()), + : app_distribution_provider_(std::make_unique<AppDistributionProvider>()), + branded_image_provider_(std::make_unique<ChromiumBrandedImageProvider>()), + signin_error_provider_(std::make_unique<ios::SigninErrorProvider>()), signin_resources_provider_( - base::MakeUnique<ChromiumSigninResourcesProvider>()), - user_feedback_provider_(base::MakeUnique<UserFeedbackProvider>()), - voice_search_provider_(base::MakeUnique<ChromiumVoiceSearchProvider>()), - spotlight_provider_(base::MakeUnique<ChromiumSpotlightProvider>()), - external_search_provider_(base::MakeUnique<ExternalSearchProvider>()) {} + std::make_unique<ChromiumSigninResourcesProvider>()), + user_feedback_provider_(std::make_unique<UserFeedbackProvider>()), + voice_search_provider_(std::make_unique<ChromiumVoiceSearchProvider>()), + spotlight_provider_(std::make_unique<ChromiumSpotlightProvider>()), + external_search_provider_(std::make_unique<ExternalSearchProvider>()) {} ChromiumBrowserProvider::~ChromiumBrowserProvider() {} @@ -51,7 +52,7 @@ ios::ChromeIdentityService* ChromiumBrowserProvider::GetChromeIdentityService() { if (!chrome_identity_service_) { - chrome_identity_service_ = base::MakeUnique<ios::ChromeIdentityService>(); + chrome_identity_service_ = std::make_unique<ios::ChromeIdentityService>(); } return chrome_identity_service_.get(); }
diff --git a/ios/chrome/browser/providers/chromium_browser_provider_factory.mm b/ios/chrome/browser/providers/chromium_browser_provider_factory.mm index 58cd935..13f7811 100644 --- a/ios/chrome/browser/providers/chromium_browser_provider_factory.mm +++ b/ios/chrome/browser/providers/chromium_browser_provider_factory.mm
@@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/memory/ptr_util.h" #import "ios/chrome/browser/providers/chromium_browser_provider.h" #import "ios/public/provider/chrome/browser/chrome_browser_provider.h" @@ -12,6 +11,6 @@ namespace ios { std::unique_ptr<ChromeBrowserProvider> CreateChromeBrowserProvider() { - return base::MakeUnique<ChromiumBrowserProvider>(); + return std::make_unique<ChromiumBrowserProvider>(); } } // namespace ios
diff --git a/ios/chrome/browser/reading_list/offline_url_utils_unittest.cc b/ios/chrome/browser/reading_list/offline_url_utils_unittest.cc index 60b03dc..57782a8 100644 --- a/ios/chrome/browser/reading_list/offline_url_utils_unittest.cc +++ b/ios/chrome/browser/reading_list/offline_url_utils_unittest.cc
@@ -4,10 +4,10 @@ #include "ios/chrome/browser/reading_list/offline_url_utils.h" +#include <memory> #include <string> #include "base/files/file_path.h" -#include "base/memory/ptr_util.h" #include "base/strings/utf_string_conversions.h" #include "base/test/gtest_util.h" #include "base/time/default_clock.h" @@ -126,8 +126,8 @@ // Checks that the offline URLs are correctly detected by |IsOfflineURL|. TEST_F(OfflineURLUtilsTest, IsOfflineURLValid) { - auto reading_list_model = base::MakeUnique<ReadingListModelImpl>( - nullptr, nullptr, base::MakeUnique<base::DefaultClock>()); + auto reading_list_model = std::make_unique<ReadingListModelImpl>( + nullptr, nullptr, std::make_unique<base::DefaultClock>()); GURL entry_url("http://entry_url.com"); base::FilePath distilled_path("distilled/page.html"); GURL distilled_url("http://distilled_url.com");
diff --git a/ios/chrome/browser/reading_list/reading_list_distiller_page_factory.mm b/ios/chrome/browser/reading_list/reading_list_distiller_page_factory.mm index 6335290..f9f7dd2 100644 --- a/ios/chrome/browser/reading_list/reading_list_distiller_page_factory.mm +++ b/ios/chrome/browser/reading_list/reading_list_distiller_page_factory.mm
@@ -4,7 +4,6 @@ #include "ios/chrome/browser/reading_list/reading_list_distiller_page_factory.h" -#include "base/memory/ptr_util.h" #include "ios/chrome/browser/reading_list/favicon_web_state_dispatcher_impl.h" #include "ios/chrome/browser/reading_list/reading_list_distiller_page.h" #include "ios/web/public/browser_state.h" @@ -19,7 +18,7 @@ web::BrowserState* browser_state) : browser_state_(browser_state) { web_state_dispatcher_ = - base::MakeUnique<reading_list::FaviconWebStateDispatcherImpl>( + std::make_unique<reading_list::FaviconWebStateDispatcherImpl>( browser_state_, -1); } @@ -29,7 +28,7 @@ ReadingListDistillerPageFactory::CreateReadingListDistillerPage( const GURL& url, ReadingListDistillerPageDelegate* delegate) const { - return base::MakeUnique<ReadingListDistillerPage>( + return std::make_unique<ReadingListDistillerPage>( url, browser_state_, web_state_dispatcher_.get(), delegate); }
diff --git a/ios/chrome/browser/reading_list/reading_list_download_service.cc b/ios/chrome/browser/reading_list/reading_list_download_service.cc index 6c86fc8..da588501 100644 --- a/ios/chrome/browser/reading_list/reading_list_download_service.cc +++ b/ios/chrome/browser/reading_list/reading_list_download_service.cc
@@ -4,13 +4,13 @@ #include "ios/chrome/browser/reading_list/reading_list_download_service.h" +#include <memory> #include <utility> #include "base/bind.h" #include "base/files/file_enumerator.h" #include "base/files/file_path.h" #include "base/files/file_util.h" -#include "base/memory/ptr_util.h" #include "base/metrics/histogram_macros.h" #include "base/strings/string_util.h" #include "base/task_scheduler/post_task.h" @@ -75,7 +75,7 @@ weak_ptr_factory_(this) { DCHECK(reading_list_model); - url_downloader_ = base::MakeUnique<URLDownloader>( + url_downloader_ = std::make_unique<URLDownloader>( distiller_factory_.get(), distiller_page_factory_.get(), prefs, chrome_profile_path, url_request_context_getter, base::Bind(&ReadingListDownloadService::OnDownloadEnd,
diff --git a/ios/chrome/browser/reading_list/reading_list_download_service_factory.cc b/ios/chrome/browser/reading_list/reading_list_download_service_factory.cc index f9bdefc3..fd70a2fe 100644 --- a/ios/chrome/browser/reading_list/reading_list_download_service_factory.cc +++ b/ios/chrome/browser/reading_list/reading_list_download_service_factory.cc
@@ -50,19 +50,19 @@ std::unique_ptr<reading_list::ReadingListDistillerPageFactory> distiller_page_factory = - base::MakeUnique<reading_list::ReadingListDistillerPageFactory>( + std::make_unique<reading_list::ReadingListDistillerPageFactory>( context); auto distiller_url_fetcher_factory = - base::MakeUnique<dom_distiller::DistillerURLFetcherFactory>( + std::make_unique<dom_distiller::DistillerURLFetcherFactory>( context->GetRequestContext()); dom_distiller::proto::DomDistillerOptions options; auto distiller_factory = - base::MakeUnique<dom_distiller::DistillerFactoryImpl>( + std::make_unique<dom_distiller::DistillerFactoryImpl>( std::move(distiller_url_fetcher_factory), options); - return base::MakeUnique<ReadingListDownloadService>( + return std::make_unique<ReadingListDownloadService>( ReadingListModelFactory::GetForBrowserState(chrome_browser_state), chrome_browser_state->GetPrefs(), chrome_browser_state->GetStatePath(), chrome_browser_state->GetRequestContext(), std::move(distiller_factory),
diff --git a/ios/chrome/browser/reading_list/reading_list_model_factory.cc b/ios/chrome/browser/reading_list/reading_list_model_factory.cc index f35b6f5..851ca1e 100644 --- a/ios/chrome/browser/reading_list/reading_list_model_factory.cc +++ b/ios/chrome/browser/reading_list/reading_list_model_factory.cc
@@ -7,7 +7,6 @@ #include <utility> #include "base/files/file_path.h" -#include "base/memory/ptr_util.h" #include "base/memory/singleton.h" #include "base/time/default_clock.h" #include "components/browser_sync/profile_sync_service.h" @@ -64,16 +63,16 @@ const syncer::ModelTypeStoreFactory& store_factory = browser_sync::ProfileSyncService::GetModelTypeStoreFactory( chrome_browser_state->GetStatePath()); - std::unique_ptr<ReadingListStore> store = base::MakeUnique<ReadingListStore>( + std::unique_ptr<ReadingListStore> store = std::make_unique<ReadingListStore>( store_factory, base::Bind(&syncer::ModelTypeChangeProcessor::Create, base::BindRepeating(&syncer::ReportUnrecoverableError, GetChannel()))); std::unique_ptr<KeyedService> reading_list_model = - base::MakeUnique<ReadingListModelImpl>( + std::make_unique<ReadingListModelImpl>( std::move(store), chrome_browser_state->GetPrefs(), - base::MakeUnique<base::DefaultClock>()); + std::make_unique<base::DefaultClock>()); return reading_list_model; }
diff --git a/ios/chrome/browser/reading_list/reading_list_web_state_observer_unittest.mm b/ios/chrome/browser/reading_list/reading_list_web_state_observer_unittest.mm index ccfae69..57165b8 100644 --- a/ios/chrome/browser/reading_list/reading_list_web_state_observer_unittest.mm +++ b/ios/chrome/browser/reading_list/reading_list_web_state_observer_unittest.mm
@@ -4,7 +4,8 @@ #include "ios/chrome/browser/reading_list/reading_list_web_state_observer.h" -#include "base/memory/ptr_util.h" +#include <memory> + #include "base/time/default_clock.h" #include "components/reading_list/core/reading_list_model_impl.h" #include "ios/chrome/browser/reading_list/offline_url_utils.h" @@ -64,15 +65,15 @@ class ReadingListWebStateObserverTest : public web::WebTest { public: ReadingListWebStateObserverTest() { - auto test_navigation_manager = base::MakeUnique<TestNavigationManager>(); + auto test_navigation_manager = std::make_unique<TestNavigationManager>(); test_navigation_manager_ = test_navigation_manager.get(); pending_item_ = web::NavigationItem::Create(); last_committed_item_ = web::NavigationItem::Create(); test_navigation_manager->SetPendingItem(pending_item_.get()); test_navigation_manager->SetLastCommittedItem(last_committed_item_.get()); test_web_state_.SetNavigationManager(std::move(test_navigation_manager)); - reading_list_model_ = base::MakeUnique<ReadingListModelImpl>( - nullptr, nullptr, base::MakeUnique<base::DefaultClock>()); + reading_list_model_ = std::make_unique<ReadingListModelImpl>( + nullptr, nullptr, std::make_unique<base::DefaultClock>()); reading_list_model_->AddEntry(GURL(kTestURL), kTestTitle, reading_list::ADDED_VIA_CURRENT_APP); ReadingListWebStateObserver::CreateForWebState(&test_web_state_,
diff --git a/ios/chrome/browser/search_engines/search_engines_util.cc b/ios/chrome/browser/search_engines/search_engines_util.cc index 5ec1c0e7..900fbb39 100644 --- a/ios/chrome/browser/search_engines/search_engines_util.cc +++ b/ios/chrome/browser/search_engines/search_engines_util.cc
@@ -6,8 +6,9 @@ #include <stddef.h> +#include <memory> + #include "base/location.h" -#include "base/memory/ptr_util.h" #include "base/single_thread_task_runner.h" #include "base/threading/thread_task_runner_handle.h" #include "components/prefs/pref_service.h" @@ -51,7 +52,7 @@ } for (const auto& engine : new_engines) { if (engine->prepopulate_id != kGoogleEnginePrepopulatedId) - service->Add(base::MakeUnique<TemplateURL>(*engine)); + service->Add(std::make_unique<TemplateURL>(*engine)); } }
diff --git a/ios/chrome/browser/search_engines/template_url_service_factory.cc b/ios/chrome/browser/search_engines/template_url_service_factory.cc index 1a95c85..6816dc20 100644 --- a/ios/chrome/browser/search_engines/template_url_service_factory.cc +++ b/ios/chrome/browser/search_engines/template_url_service_factory.cc
@@ -43,7 +43,7 @@ web::BrowserState* context) { ios::ChromeBrowserState* browser_state = ios::ChromeBrowserState::FromBrowserState(context); - return base::MakeUnique<TemplateURLService>( + return std::make_unique<TemplateURLService>( browser_state->GetPrefs(), base::WrapUnique(new ios::UIThreadSearchTermsData(browser_state)), ios::WebDataServiceFactory::GetKeywordWebDataForBrowserState(
diff --git a/ios/chrome/browser/services/gcm/ios_chrome_gcm_profile_service_factory.cc b/ios/chrome/browser/services/gcm/ios_chrome_gcm_profile_service_factory.cc index ef636750..3d6f7ec 100644 --- a/ios/chrome/browser/services/gcm/ios_chrome_gcm_profile_service_factory.cc +++ b/ios/chrome/browser/services/gcm/ios_chrome_gcm_profile_service_factory.cc
@@ -62,7 +62,7 @@ base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN})); ios::ChromeBrowserState* browser_state = ios::ChromeBrowserState::FromBrowserState(context); - return base::MakeUnique<gcm::GCMProfileService>( + return std::make_unique<gcm::GCMProfileService>( browser_state->GetPrefs(), browser_state->GetStatePath(), browser_state->GetRequestContext(), ::GetChannel(), GetProductCategoryForSubtypes(),
diff --git a/ios/chrome/browser/sessions/ios_chrome_tab_restore_service_factory.cc b/ios/chrome/browser/sessions/ios_chrome_tab_restore_service_factory.cc index dd7eb0a7..5e2d11c 100644 --- a/ios/chrome/browser/sessions/ios_chrome_tab_restore_service_factory.cc +++ b/ios/chrome/browser/sessions/ios_chrome_tab_restore_service_factory.cc
@@ -19,7 +19,7 @@ ios::ChromeBrowserState* browser_state = ios::ChromeBrowserState::FromBrowserState(context); - return base::MakeUnique<sessions::PersistentTabRestoreService>( + return std::make_unique<sessions::PersistentTabRestoreService>( base::WrapUnique(new IOSChromeTabRestoreServiceClient(browser_state)), nullptr); }
diff --git a/ios/chrome/browser/sessions/tab_restore_service_delegate_impl_ios_factory.mm b/ios/chrome/browser/sessions/tab_restore_service_delegate_impl_ios_factory.mm index d91db3a9..3df9e04 100644 --- a/ios/chrome/browser/sessions/tab_restore_service_delegate_impl_ios_factory.mm +++ b/ios/chrome/browser/sessions/tab_restore_service_delegate_impl_ios_factory.mm
@@ -6,7 +6,6 @@ #include <memory> -#include "base/memory/ptr_util.h" #include "base/memory/singleton.h" #include "components/keyed_service/ios/browser_state_dependency_manager.h" #include "ios/chrome/browser/browser_state/chrome_browser_state.h" @@ -42,6 +41,6 @@ std::unique_ptr<KeyedService> TabRestoreServiceDelegateImplIOSFactory::BuildServiceInstanceFor( web::BrowserState* context) const { - return base::MakeUnique<TabRestoreServiceDelegateImplIOS>( + return std::make_unique<TabRestoreServiceDelegateImplIOS>( ios::ChromeBrowserState::FromBrowserState(context)); }
diff --git a/ios/chrome/browser/share_extension/share_extension_service_factory.mm b/ios/chrome/browser/share_extension/share_extension_service_factory.mm index 75ac86a77..234d0bc0 100644 --- a/ios/chrome/browser/share_extension/share_extension_service_factory.mm +++ b/ios/chrome/browser/share_extension/share_extension_service_factory.mm
@@ -4,7 +4,6 @@ #include "ios/chrome/browser/share_extension/share_extension_service_factory.h" -#include "base/memory/ptr_util.h" #include "base/memory/singleton.h" #include "components/keyed_service/ios/browser_state_dependency_manager.h" #include "ios/chrome/browser/bookmarks/bookmark_model_factory.h" @@ -51,7 +50,7 @@ web::BrowserState* context) const { ios::ChromeBrowserState* chrome_browser_state = ios::ChromeBrowserState::FromBrowserState(context); - return base::MakeUnique<ShareExtensionService>( + return std::make_unique<ShareExtensionService>( ios::BookmarkModelFactory::GetForBrowserState(chrome_browser_state), ReadingListModelFactory::GetForBrowserState(chrome_browser_state)); }
diff --git a/ios/chrome/browser/signin/account_consistency_service_factory.mm b/ios/chrome/browser/signin/account_consistency_service_factory.mm index 318db6a..5b3fe1d 100644 --- a/ios/chrome/browser/signin/account_consistency_service_factory.mm +++ b/ios/chrome/browser/signin/account_consistency_service_factory.mm
@@ -4,7 +4,6 @@ #include "ios/chrome/browser/signin/account_consistency_service_factory.h" -#include "base/memory/ptr_util.h" #include "base/memory/singleton.h" #include "components/keyed_service/ios/browser_state_dependency_manager.h" #include "components/signin/ios/browser/account_consistency_service.h" @@ -57,7 +56,7 @@ web::BrowserState* context) const { ios::ChromeBrowserState* chrome_browser_state = ios::ChromeBrowserState::FromBrowserState(context); - return base::MakeUnique<AccountConsistencyService>( + return std::make_unique<AccountConsistencyService>( chrome_browser_state, ios::AccountReconcilorFactory::GetForBrowserState(chrome_browser_state), ios::CookieSettingsFactory::GetForBrowserState(chrome_browser_state),
diff --git a/ios/chrome/browser/signin/browser_state_data_remover.mm b/ios/chrome/browser/signin/browser_state_data_remover.mm index 712b01e..8902b5c 100644 --- a/ios/chrome/browser/signin/browser_state_data_remover.mm +++ b/ios/chrome/browser/signin/browser_state_data_remover.mm
@@ -4,6 +4,8 @@ #import "ios/chrome/browser/signin/browser_state_data_remover.h" +#include <memory> + #include "base/logging.h" #include "base/threading/thread_task_runner_handle.h" #include "components/prefs/pref_service.h" @@ -72,7 +74,7 @@ CHECK(RemoveAllUserBookmarksIOS(browser_state_)) << "Failed to remove all user bookmarks."; reading_list_remover_helper_ = - base::MakeUnique<reading_list::ReadingListRemoverHelper>(browser_state_); + std::make_unique<reading_list::ReadingListRemoverHelper>(browser_state_); reading_list_remover_helper_->RemoveAllUserReadingListItemsIOS( base::Bind(&BrowserStateDataRemover::ReadingListCleaned, base::Unretained(this), details));
diff --git a/ios/chrome/browser/signin/fake_oauth2_token_service_builder.mm b/ios/chrome/browser/signin/fake_oauth2_token_service_builder.mm index 60efed2..33989ac 100644 --- a/ios/chrome/browser/signin/fake_oauth2_token_service_builder.mm +++ b/ios/chrome/browser/signin/fake_oauth2_token_service_builder.mm
@@ -4,7 +4,6 @@ #include "ios/chrome/browser/signin/fake_oauth2_token_service_builder.h" -#include "base/memory/ptr_util.h" #include "components/signin/core/browser/fake_profile_oauth2_token_service.h" #include "components/signin/ios/browser/profile_oauth2_token_service_ios_delegate.h" #include "ios/chrome/browser/browser_state/chrome_browser_state.h" @@ -22,10 +21,10 @@ ios::ChromeBrowserState* browser_state = ios::ChromeBrowserState::FromBrowserState(context); std::unique_ptr<OAuth2TokenServiceDelegate> delegate = - base::MakeUnique<ProfileOAuth2TokenServiceIOSDelegate>( + std::make_unique<ProfileOAuth2TokenServiceIOSDelegate>( SigninClientFactory::GetForBrowserState(browser_state), - base::MakeUnique<ProfileOAuth2TokenServiceIOSProviderImpl>(), + std::make_unique<ProfileOAuth2TokenServiceIOSProviderImpl>(), ios::AccountTrackerServiceFactory::GetForBrowserState(browser_state), ios::SigninErrorControllerFactory::GetForBrowserState(browser_state)); - return base::MakeUnique<FakeProfileOAuth2TokenService>(std::move(delegate)); + return std::make_unique<FakeProfileOAuth2TokenService>(std::move(delegate)); }
diff --git a/ios/chrome/browser/signin/gaia_cookie_manager_service_factory.cc b/ios/chrome/browser/signin/gaia_cookie_manager_service_factory.cc index 74c18da..66c2921 100644 --- a/ios/chrome/browser/signin/gaia_cookie_manager_service_factory.cc +++ b/ios/chrome/browser/signin/gaia_cookie_manager_service_factory.cc
@@ -4,7 +4,6 @@ #include "ios/chrome/browser/signin/gaia_cookie_manager_service_factory.h" -#include "base/memory/ptr_util.h" #include "base/memory/singleton.h" #include "components/keyed_service/core/service_access_type.h" #include "components/keyed_service/ios/browser_state_dependency_manager.h" @@ -45,7 +44,7 @@ web::BrowserState* context) const { ios::ChromeBrowserState* chrome_browser_state = ios::ChromeBrowserState::FromBrowserState(context); - return base::MakeUnique<GaiaCookieManagerService>( + return std::make_unique<GaiaCookieManagerService>( OAuth2TokenServiceFactory::GetForBrowserState(chrome_browser_state), GaiaConstants::kChromeSource, SigninClientFactory::GetForBrowserState(chrome_browser_state));
diff --git a/ios/chrome/browser/signin/identity_manager_factory.cc b/ios/chrome/browser/signin/identity_manager_factory.cc index 63a19b7..74cfc2c 100644 --- a/ios/chrome/browser/signin/identity_manager_factory.cc +++ b/ios/chrome/browser/signin/identity_manager_factory.cc
@@ -4,7 +4,8 @@ #include "ios/chrome/browser/signin/identity_manager_factory.h" -#include "base/memory/ptr_util.h" +#include <memory> + #include "components/keyed_service/core/keyed_service.h" #include "components/keyed_service/ios/browser_state_dependency_manager.h" #include "components/signin/core/browser/signin_manager.h" @@ -56,6 +57,6 @@ std::unique_ptr<KeyedService> IdentityManagerFactory::BuildServiceInstanceFor( web::BrowserState* browser_state) const { - return base::MakeUnique<IdentityManagerHolder>( + return std::make_unique<IdentityManagerHolder>( ios::ChromeBrowserState::FromBrowserState(browser_state)); }
diff --git a/ios/chrome/browser/signin/identity_service_creator.cc b/ios/chrome/browser/signin/identity_service_creator.cc index ca1787f..56ed7e7a 100644 --- a/ios/chrome/browser/signin/identity_service_creator.cc +++ b/ios/chrome/browser/signin/identity_service_creator.cc
@@ -4,6 +4,8 @@ #include "ios/chrome/browser/signin/identity_service_creator.h" +#include <memory> + #include "components/signin/core/browser/signin_manager.h" #include "ios/chrome/browser/signin/account_tracker_service_factory.h" #include "ios/chrome/browser/signin/oauth2_token_service_factory.h" @@ -24,7 +26,7 @@ ios::SigninManagerFactory::GetForBrowserState(browser_state); ProfileOAuth2TokenService* token_service = OAuth2TokenServiceFactory::GetForBrowserState(browser_state); - return base::MakeUnique<identity::IdentityService>( + return std::make_unique<identity::IdentityService>( account_tracker, signin_manager, token_service); }
diff --git a/ios/chrome/browser/signin/oauth2_token_service_factory.mm b/ios/chrome/browser/signin/oauth2_token_service_factory.mm index 854ff888..ce3a5d4 100644 --- a/ios/chrome/browser/signin/oauth2_token_service_factory.mm +++ b/ios/chrome/browser/signin/oauth2_token_service_factory.mm
@@ -4,7 +4,6 @@ #include "ios/chrome/browser/signin/oauth2_token_service_factory.h" -#include "base/memory/ptr_util.h" #include "base/memory/singleton.h" #include "components/keyed_service/ios/browser_state_dependency_manager.h" #include "components/pref_registry/pref_registry_syncable.h" @@ -52,12 +51,12 @@ web::BrowserState* context) const { ios::ChromeBrowserState* chrome_browser_state = ios::ChromeBrowserState::FromBrowserState(context); - auto delegate = base::MakeUnique<ProfileOAuth2TokenServiceIOSDelegate>( + auto delegate = std::make_unique<ProfileOAuth2TokenServiceIOSDelegate>( SigninClientFactory::GetForBrowserState(chrome_browser_state), - base::MakeUnique<ProfileOAuth2TokenServiceIOSProviderImpl>(), + std::make_unique<ProfileOAuth2TokenServiceIOSProviderImpl>(), ios::AccountTrackerServiceFactory::GetForBrowserState( chrome_browser_state), ios::SigninErrorControllerFactory::GetForBrowserState( chrome_browser_state)); - return base::MakeUnique<ProfileOAuth2TokenService>(std::move(delegate)); + return std::make_unique<ProfileOAuth2TokenService>(std::move(delegate)); }
diff --git a/ios/chrome/browser/snapshots/lru_cache.mm b/ios/chrome/browser/snapshots/lru_cache.mm index 5116cfe1..e899269 100644 --- a/ios/chrome/browser/snapshots/lru_cache.mm +++ b/ios/chrome/browser/snapshots/lru_cache.mm
@@ -11,7 +11,6 @@ #include "base/containers/mru_cache.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support." @@ -48,7 +47,7 @@ - (instancetype)initWithCacheSize:(NSUInteger)maxCacheSize { if ((self = [super init])) { - _cache = base::MakeUnique<NSObjectMRUCache>(maxCacheSize); + _cache = std::make_unique<NSObjectMRUCache>(maxCacheSize); } return self; }
diff --git a/ios/chrome/browser/ssl/captive_portal_detector_tab_helper.mm b/ios/chrome/browser/ssl/captive_portal_detector_tab_helper.mm index f715910..a5ccb0e 100644 --- a/ios/chrome/browser/ssl/captive_portal_detector_tab_helper.mm +++ b/ios/chrome/browser/ssl/captive_portal_detector_tab_helper.mm
@@ -4,6 +4,8 @@ #import "ios/chrome/browser/ssl/captive_portal_detector_tab_helper.h" +#include <memory> + #include "base/memory/ptr_util.h" #include "components/captive_portal/captive_portal_detector.h" #import "ios/chrome/browser/ssl/captive_portal_detector_tab_helper_delegate.h" @@ -32,7 +34,7 @@ web::WebState* web_state, id<CaptivePortalDetectorTabHelperDelegate> delegate) : delegate_(delegate), - detector_(base::MakeUnique<captive_portal::CaptivePortalDetector>( + detector_(std::make_unique<captive_portal::CaptivePortalDetector>( web_state->GetBrowserState()->GetRequestContext())) { DCHECK(delegate); }
diff --git a/ios/chrome/browser/ssl/insecure_input_tab_helper.mm b/ios/chrome/browser/ssl/insecure_input_tab_helper.mm index ef62f746..b1d9e8ed 100644 --- a/ios/chrome/browser/ssl/insecure_input_tab_helper.mm +++ b/ios/chrome/browser/ssl/insecure_input_tab_helper.mm
@@ -6,8 +6,9 @@ #import <Foundation/Foundation.h> +#include <memory> + #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "components/security_state/ios/ssl_status_input_event_data.h" #import "ios/web/public/navigation_item.h" #import "ios/web/public/navigation_manager.h" @@ -38,7 +39,7 @@ static_cast<security_state::SSLStatusInputEventData*>( ssl.user_data.get()); if (!input_events) { - ssl.user_data = base::MakeUnique<security_state::SSLStatusInputEventData>(); + ssl.user_data = std::make_unique<security_state::SSLStatusInputEventData>(); input_events = static_cast<security_state::SSLStatusInputEventData*>( ssl.user_data.get()); }
diff --git a/ios/chrome/browser/ssl/ios_security_state_tab_helper.mm b/ios/chrome/browser/ssl/ios_security_state_tab_helper.mm index 9e48b34..8cde47e 100644 --- a/ios/chrome/browser/ssl/ios_security_state_tab_helper.mm +++ b/ios/chrome/browser/ssl/ios_security_state_tab_helper.mm
@@ -6,7 +6,6 @@ #include "base/bind.h" #include "base/command_line.h" -#include "base/memory/ptr_util.h" #include "base/metrics/field_trial.h" #include "base/metrics/histogram_macros.h" #include "components/security_state/core/security_state.h" @@ -40,7 +39,7 @@ std::unique_ptr<security_state::VisibleSecurityState> IOSSecurityStateTabHelper::GetVisibleSecurityState() const { - auto state = base::MakeUnique<security_state::VisibleSecurityState>(); + auto state = std::make_unique<security_state::VisibleSecurityState>(); web::NavigationItem* item = web_state_->GetNavigationManager()->GetVisibleItem();
diff --git a/ios/chrome/browser/tabs/tab_model.mm b/ios/chrome/browser/tabs/tab_model.mm index 5e1f0b2..1d4d59b 100644 --- a/ios/chrome/browser/tabs/tab_model.mm +++ b/ios/chrome/browser/tabs/tab_model.mm
@@ -216,8 +216,8 @@ _observers = [TabModelObservers observers]; _webStateListDelegate = - base::MakeUnique<TabModelWebStateListDelegate>(self); - _webStateList = base::MakeUnique<WebStateList>(_webStateListDelegate.get()); + std::make_unique<TabModelWebStateListDelegate>(self); + _webStateList = std::make_unique<WebStateList>(_webStateListDelegate.get()); _browserState = browserState; DCHECK(_browserState); @@ -227,12 +227,12 @@ // important to the backend code to always have a sync window delegate. if (!_browserState->IsOffTheRecord()) { // Set up the usage recorder before tabs are created. - _tabUsageRecorder = base::MakeUnique<TabUsageRecorder>( + _tabUsageRecorder = std::make_unique<TabUsageRecorder>( _webStateList.get(), PrerenderServiceFactory::GetForBrowserState(browserState)); } _syncedWindowDelegate = - base::MakeUnique<TabModelSyncedWindowDelegate>(_webStateList.get()); + std::make_unique<TabModelSyncedWindowDelegate>(_webStateList.get()); // There must be a valid session service defined to consume session windows. DCHECK(service); @@ -249,23 +249,23 @@ [retainedWebStateListObservers addObject:tabModelClosingWebStateObserver]; _webStateListObservers.push_back( - base::MakeUnique<WebStateListObserverBridge>( + std::make_unique<WebStateListObserverBridge>( tabModelClosingWebStateObserver)); SnapshotCache* snapshotCache = SnapshotCacheFactory::GetForBrowserState(_browserState); if (snapshotCache) { _webStateListObservers.push_back( - base::MakeUnique<SnapshotCacheWebStateListObserver>(snapshotCache)); + std::make_unique<SnapshotCacheWebStateListObserver>(snapshotCache)); } - _webStateListObservers.push_back(base::MakeUnique<TabParentingObserver>()); + _webStateListObservers.push_back(std::make_unique<TabParentingObserver>()); TabModelSelectedTabObserver* tabModelSelectedTabObserver = [[TabModelSelectedTabObserver alloc] initWithTabModel:self]; [retainedWebStateListObservers addObject:tabModelSelectedTabObserver]; _webStateListObservers.push_back( - base::MakeUnique<WebStateListObserverBridge>( + std::make_unique<WebStateListObserverBridge>( tabModelSelectedTabObserver)); TabModelObserversBridge* tabModelObserversBridge = @@ -273,21 +273,21 @@ tabModelObservers:_observers]; [retainedWebStateListObservers addObject:tabModelObserversBridge]; _webStateListObservers.push_back( - base::MakeUnique<WebStateListObserverBridge>(tabModelObserversBridge)); + std::make_unique<WebStateListObserverBridge>(tabModelObserversBridge)); _webStateListObservers.push_back( std::make_unique<TabModelFaviconDriverObserver>(self, _observers)); auto webStateListMetricsObserver = - base::MakeUnique<WebStateListMetricsObserver>(); + std::make_unique<WebStateListMetricsObserver>(); _webStateListMetricsObserver = webStateListMetricsObserver.get(); _webStateListObservers.push_back(std::move(webStateListMetricsObserver)); _webStateListObservers.push_back( - base::MakeUnique<TabModelWebUsageEnabledObserver>(self)); + std::make_unique<TabModelWebUsageEnabledObserver>(self)); auto tabModelNotificationObserver = - base::MakeUnique<TabModelNotificationObserver>(self); + std::make_unique<TabModelNotificationObserver>(self); _tabModelNotificationObserver = tabModelNotificationObserver.get(); _webStateListObservers.push_back(std::move(tabModelNotificationObserver));
diff --git a/ios/chrome/browser/tabs/tab_model_unittest.mm b/ios/chrome/browser/tabs/tab_model_unittest.mm index e04452d..8ebe39244 100644 --- a/ios/chrome/browser/tabs/tab_model_unittest.mm +++ b/ios/chrome/browser/tabs/tab_model_unittest.mm
@@ -5,7 +5,6 @@ #import <objc/runtime.h> #include "base/files/file_path.h" -#include "base/memory/ptr_util.h" #include "base/run_loop.h" #include "base/strings/sys_string_conversions.h" #include "ios/chrome/browser/browser_state/test_chrome_browser_state.h" @@ -76,8 +75,8 @@ public: TabModelTest() : scoped_browser_state_manager_( - base::MakeUnique<TestChromeBrowserStateManager>(base::FilePath())), - web_client_(base::MakeUnique<ChromeWebClient>()) { + std::make_unique<TestChromeBrowserStateManager>(base::FilePath())), + web_client_(std::make_unique<ChromeWebClient>()) { DCHECK_CURRENTLY_ON(web::WebThread::UI); TestChromeBrowserState::Builder test_cbs_builder;
diff --git a/ios/chrome/browser/tabs/tab_unittest.mm b/ios/chrome/browser/tabs/tab_unittest.mm index 50464387..d5cd5f6e 100644 --- a/ios/chrome/browser/tabs/tab_unittest.mm +++ b/ios/chrome/browser/tabs/tab_unittest.mm
@@ -9,7 +9,6 @@ #include "base/callback.h" #include "base/files/file_path.h" #include "base/ios/block_types.h" -#include "base/memory/ptr_util.h" #include "base/memory/ref_counted.h" #include "base/run_loop.h" #include "base/strings/stringprintf.h" @@ -148,7 +147,7 @@ public: TabTest() : scoped_browser_state_manager_( - base::MakeUnique<TestChromeBrowserStateManager>(base::FilePath())), + std::make_unique<TestChromeBrowserStateManager>(base::FilePath())), web_state_impl_(nullptr) {} void SetUp() override { @@ -176,7 +175,7 @@ mock_web_controller_ = [OCMockObject niceMockForClass:[CRWWebController class]]; web::WebState::CreateParams create_params(browser_state); - web_state_impl_ = base::MakeUnique<web::WebStateImpl>(create_params); + web_state_impl_ = std::make_unique<web::WebStateImpl>(create_params); web_state_impl_->SetWebController(mock_web_controller_); web_state_impl_->GetNavigationManagerImpl().InitializeSession(); web::WebStateImpl* web_state_impl = web_state_impl_.get();
diff --git a/ios/chrome/browser/test/perf_test_with_bvc_ios.mm b/ios/chrome/browser/test/perf_test_with_bvc_ios.mm index b9cf160..3fd6ed1 100644 --- a/ios/chrome/browser/test/perf_test_with_bvc_ios.mm +++ b/ios/chrome/browser/test/perf_test_with_bvc_ios.mm
@@ -7,7 +7,6 @@ #import <UIKit/UIKit.h> #include "base/files/file_path.h" -#include "base/memory/ptr_util.h" #include "base/strings/sys_string_conversions.h" #include "components/bookmarks/test/bookmark_test_helpers.h" #include "ios/chrome/browser/autocomplete/autocomplete_classifier_factory.h" @@ -40,10 +39,10 @@ PerfTestWithBVC::PerfTestWithBVC(std::string testGroup) : PerfTest(testGroup), slow_teardown_(false), - web_client_(base::MakeUnique<ChromeWebClient>()), + web_client_(std::make_unique<ChromeWebClient>()), provider_(ios::CreateChromeBrowserProvider()), browser_state_manager_( - base::MakeUnique<TestChromeBrowserStateManager>(base::FilePath())) {} + std::make_unique<TestChromeBrowserStateManager>(base::FilePath())) {} PerfTestWithBVC::PerfTestWithBVC(std::string testGroup, std::string firstLabel, @@ -59,10 +58,10 @@ verbose, repeat), slow_teardown_(slowTeardown), - web_client_(base::MakeUnique<ChromeWebClient>()), + web_client_(std::make_unique<ChromeWebClient>()), provider_(ios::CreateChromeBrowserProvider()), browser_state_manager_( - base::MakeUnique<TestChromeBrowserStateManager>(base::FilePath())) {} + std::make_unique<TestChromeBrowserStateManager>(base::FilePath())) {} PerfTestWithBVC::~PerfTestWithBVC() {}
diff --git a/ios/chrome/browser/translate/chrome_ios_translate_client.mm b/ios/chrome/browser/translate/chrome_ios_translate_client.mm index 27af683..78af9eb 100644 --- a/ios/chrome/browser/translate/chrome_ios_translate_client.mm +++ b/ios/chrome/browser/translate/chrome_ios_translate_client.mm
@@ -68,7 +68,7 @@ web::WebState* web_state, id<LanguageSelectionHandler> language_selection_handler) : web_state_(web_state), - translate_manager_(base::MakeUnique<translate::TranslateManager>( + translate_manager_(std::make_unique<translate::TranslateManager>( this, translate::TranslateRankerFactory::GetForBrowserState( ios::ChromeBrowserState::FromBrowserState( @@ -154,7 +154,7 @@ if (item == nullptr) return; - auto specifics = base::MakeUnique<sync_pb::UserEventSpecifics>(); + auto specifics = std::make_unique<sync_pb::UserEventSpecifics>(); // We only log the event we care about. const bool needs_logging = translate::ConstructTranslateEvent( item->GetTimestamp().ToInternalValue(), translate_event, specifics.get());
diff --git a/ios/chrome/browser/translate/translate_accept_languages_factory.cc b/ios/chrome/browser/translate/translate_accept_languages_factory.cc index ae8e90a..70aa6cb 100644 --- a/ios/chrome/browser/translate/translate_accept_languages_factory.cc +++ b/ios/chrome/browser/translate/translate_accept_languages_factory.cc
@@ -5,7 +5,6 @@ #include "ios/chrome/browser/translate/translate_accept_languages_factory.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "components/keyed_service/core/keyed_service.h" #include "components/keyed_service/ios/browser_state_dependency_manager.h" #include "components/prefs/pref_service.h" @@ -73,7 +72,7 @@ web::BrowserState* context) const { ios::ChromeBrowserState* browser_state = ios::ChromeBrowserState::FromBrowserState(context); - return base::MakeUnique<TranslateAcceptLanguagesService>( + return std::make_unique<TranslateAcceptLanguagesService>( browser_state->GetPrefs()); }
diff --git a/ios/chrome/browser/translate/translate_egtest.mm b/ios/chrome/browser/translate/translate_egtest.mm index 76fd13d..dbe5acd9 100644 --- a/ios/chrome/browser/translate/translate_egtest.mm +++ b/ios/chrome/browser/translate/translate_egtest.mm
@@ -4,6 +4,8 @@ #import <XCTest/XCTest.h> +#include <memory> + #include "base/command_line.h" #include "base/ios/ios_util.h" #include "base/mac/bind_objc_block.h" @@ -324,7 +326,7 @@ language::IOSLanguageDetectionTabHelper::Callback copyDetailsCallback = base::BindBlockArc(^(const translate::LanguageDetectionDetails& details) { _language_detection_details = - base::MakeUnique<translate::LanguageDetectionDetails>(details); + std::make_unique<translate::LanguageDetectionDetails>(details); }); SetTestingLanguageDetectionCallback(copyDetailsCallback); }
diff --git a/ios/chrome/browser/translate/translate_ranker_factory.cc b/ios/chrome/browser/translate/translate_ranker_factory.cc index c14ea53..2fedf51 100644 --- a/ios/chrome/browser/translate/translate_ranker_factory.cc +++ b/ios/chrome/browser/translate/translate_ranker_factory.cc
@@ -4,7 +4,6 @@ #include "ios/chrome/browser/translate/translate_ranker_factory.h" -#include "base/memory/ptr_util.h" #include "base/memory/singleton.h" #include "components/keyed_service/core/keyed_service.h" #include "components/keyed_service/ios/browser_state_dependency_manager.h" @@ -37,7 +36,7 @@ web::BrowserState* context) const { ios::ChromeBrowserState* browser_state = ios::ChromeBrowserState::FromBrowserState(context); - return base::MakeUnique<TranslateRankerImpl>( + return std::make_unique<TranslateRankerImpl>( TranslateRankerImpl::GetModelPath(browser_state->GetStatePath()), TranslateRankerImpl::GetModelURL(), nullptr /* ukm::UkmRecorder */); }
diff --git a/ios/chrome/browser/ui/activity_services/activity_service_controller_egtest.mm b/ios/chrome/browser/ui/activity_services/activity_service_controller_egtest.mm index 54ab5fa..7b9915d 100644 --- a/ios/chrome/browser/ui/activity_services/activity_service_controller_egtest.mm +++ b/ios/chrome/browser/ui/activity_services/activity_service_controller_egtest.mm
@@ -4,8 +4,9 @@ #import <XCTest/XCTest.h> +#include <memory> + #include "base/ios/ios_util.h" -#include "base/memory/ptr_util.h" #include "components/strings/grit/components_strings.h" #import "ios/chrome/browser/ui/browser_view_controller_dependency_factory.h" #import "ios/chrome/browser/ui/uikit_ui_util.h" @@ -77,7 +78,7 @@ const GURL regularPageURL = web::test::HttpServer::MakeUrl("http://choux"); responses[regularPageURL] = "fleur"; web::test::SetUpHttpServer( - base::MakeUnique<ErrorPageResponseProvider>(responses)); + std::make_unique<ErrorPageResponseProvider>(responses)); // Open a regular page and verify that you can share. [ChromeEarlGrey loadURL:regularPageURL];
diff --git a/ios/chrome/browser/ui/authentication/re_signin_infobar_delegate.mm b/ios/chrome/browser/ui/authentication/re_signin_infobar_delegate.mm index ec7e8f89..06815f0e 100644 --- a/ios/chrome/browser/ui/authentication/re_signin_infobar_delegate.mm +++ b/ios/chrome/browser/ui/authentication/re_signin_infobar_delegate.mm
@@ -10,7 +10,6 @@ #include <utility> #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/metrics/user_metrics.h" #include "components/infobars/core/infobar_manager.h" #include "components/strings/grit/components_strings.h" @@ -82,7 +81,7 @@ base::UserMetricsAction("Signin_Impression_FromReSigninInfobar")); // User needs to be reminded to sign in again. Creates a new infobar delegate // and returns it. - return base::MakeUnique<ReSignInInfoBarDelegate>(browser_state, presenter); + return std::make_unique<ReSignInInfoBarDelegate>(browser_state, presenter); } ReSignInInfoBarDelegate::ReSignInInfoBarDelegate(
diff --git a/ios/chrome/browser/ui/authentication/signin_promo_view_mediator.mm b/ios/chrome/browser/ui/authentication/signin_promo_view_mediator.mm index f0175670..1a66806 100644 --- a/ios/chrome/browser/ui/authentication/signin_promo_view_mediator.mm +++ b/ios/chrome/browser/ui/authentication/signin_promo_view_mediator.mm
@@ -4,7 +4,8 @@ #import "ios/chrome/browser/ui/authentication/signin_promo_view_mediator.h" -#include "base/memory/ptr_util.h" +#include <memory> + #include "base/metrics/histogram_macros.h" #include "base/metrics/user_metrics.h" #include "base/metrics/user_metrics_action.h" @@ -365,9 +366,9 @@ [self selectIdentity:identities[0]]; } _identityServiceObserver = - base::MakeUnique<ChromeIdentityServiceObserverBridge>(self); + std::make_unique<ChromeIdentityServiceObserverBridge>(self); _browserProviderObserver = - base::MakeUnique<ChromeBrowserProviderObserverBridge>(self); + std::make_unique<ChromeBrowserProviderObserverBridge>(self); } return self; } @@ -572,7 +573,7 @@ - (void)chromeIdentityServiceDidChange:(ios::ChromeIdentityService*)identity { DCHECK(!_identityServiceObserver.get()); _identityServiceObserver = - base::MakeUnique<ChromeIdentityServiceObserverBridge>(self); + std::make_unique<ChromeIdentityServiceObserverBridge>(self); } - (void)chromeBrowserProviderWillBeDestroyed {
diff --git a/ios/chrome/browser/ui/autofill/chrome_autofill_client_ios.mm b/ios/chrome/browser/ui/autofill/chrome_autofill_client_ios.mm index 2faa2a7..330c120 100644 --- a/ios/chrome/browser/ui/autofill/chrome_autofill_client_ios.mm +++ b/ios/chrome/browser/ui/autofill/chrome_autofill_client_ios.mm
@@ -9,7 +9,6 @@ #include "base/bind.h" #include "base/feature_list.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "components/autofill/core/browser/autofill_credit_card_filling_infobar_delegate_mobile.h" #include "components/autofill/core/browser/autofill_save_card_infobar_delegate_mobile.h" #include "components/autofill/core/browser/autofill_save_card_infobar_mobile.h" @@ -122,7 +121,7 @@ // InfoBarService is a WebContentsUserData, it must also be alive at this // time. infobar_manager_->AddInfoBar(CreateSaveCardInfoBarMobile( - base::MakeUnique<AutofillSaveCardInfoBarDelegateMobile>( + std::make_unique<AutofillSaveCardInfoBarDelegateMobile>( false, card, std::unique_ptr<base::DictionaryValue>(nullptr), callback, GetPrefs()))); } @@ -133,7 +132,7 @@ bool should_cvc_be_requested, const base::Closure& callback) { infobar_manager_->AddInfoBar(CreateSaveCardInfoBarMobile( - base::MakeUnique<AutofillSaveCardInfoBarDelegateMobile>( + std::make_unique<AutofillSaveCardInfoBarDelegateMobile>( true, card, std::move(legal_message), callback, GetPrefs()))); } @@ -141,7 +140,7 @@ const CreditCard& card, const base::Closure& callback) { auto infobar_delegate = - base::MakeUnique<AutofillCreditCardFillingInfoBarDelegateMobile>( + std::make_unique<AutofillCreditCardFillingInfoBarDelegateMobile>( card, callback); auto* raw_delegate = infobar_delegate.get(); if (infobar_manager_->AddInfoBar(
diff --git a/ios/chrome/browser/ui/bookmarks/bookmark_utils_ios.mm b/ios/chrome/browser/ui/bookmarks/bookmark_utils_ios.mm index 613631e3..69178c6 100644 --- a/ios/chrome/browser/ui/bookmarks/bookmark_utils_ios.mm +++ b/ios/chrome/browser/ui/bookmarks/bookmark_utils_ios.mm
@@ -12,7 +12,6 @@ #include "base/hash.h" #include "base/i18n/string_compare.h" #include "base/mac/bind_objc_block.h" -#include "base/memory/ptr_util.h" #include "base/metrics/user_metrics_action.h" #include "base/strings/sys_string_conversions.h" #include "base/strings/utf_string_conversions.h" @@ -456,7 +455,7 @@ continue; // No NodesSection found. - auto nodesSection = base::MakeUnique<NodesSection>(); + auto nodesSection = std::make_unique<NodesSection>(); nodesSection->time = dateAdded; nodesSection->timeRepresentation = timeRepresentation; nodesSection->vector.push_back(node);
diff --git a/ios/chrome/browser/ui/browser_list/browser_list_session_service_factory.mm b/ios/chrome/browser/ui/browser_list/browser_list_session_service_factory.mm index fb59279..b9651d2 100644 --- a/ios/chrome/browser/ui/browser_list/browser_list_session_service_factory.mm +++ b/ios/chrome/browser/ui/browser_list/browser_list_session_service_factory.mm
@@ -9,7 +9,6 @@ #include "base/bind.h" #include "base/files/file_path.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/memory/singleton.h" #include "base/strings/sys_string_conversions.h" #include "components/keyed_service/ios/browser_state_dependency_manager.h" @@ -70,7 +69,7 @@ ios::ChromeBrowserState::FromBrowserState(context); // It is safe to use base::Unretained here as BrowserListSessionServiceImpl // will be destroyed before the ChromeBrowserState (as it is a KeyedService). - return base::MakeUnique<BrowserListSessionServiceImpl>( + return std::make_unique<BrowserListSessionServiceImpl>( BrowserListFactory::GetForBrowserState(browser_state), base::SysUTF8ToNSString(browser_state->GetStatePath().AsUTF8Unsafe()), [SessionServiceIOS sharedService],
diff --git a/ios/chrome/browser/ui/browser_list/browser_list_session_service_impl.mm b/ios/chrome/browser/ui/browser_list/browser_list_session_service_impl.mm index 7e1fb01..afbf0e97 100644 --- a/ios/chrome/browser/ui/browser_list/browser_list_session_service_impl.mm +++ b/ios/chrome/browser/ui/browser_list/browser_list_session_service_impl.mm
@@ -9,7 +9,6 @@ #include "base/bind.h" #include "base/callback.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/scoped_observer.h" #include "ios/chrome/browser/chrome_url_constants.h" #import "ios/chrome/browser/sessions/session_ios.h" @@ -157,7 +156,7 @@ DCHECK_EQ(browser_list, browser_list_); DCHECK(observers_.find(browser) == observers_.end()); observers_.insert(std::make_pair( - browser, base::MakeUnique<BrowserListSessionServiceWebStateListObserver>( + browser, std::make_unique<BrowserListSessionServiceWebStateListObserver>( &browser->web_state_list(), closure_))); } @@ -188,7 +187,7 @@ DCHECK(create_web_state_); // It is safe to use base::Unretained as the closure is indirectly owned by // the BrowserListSessionServiceImpl instance and will be deleted before it. - observer_ = base::MakeUnique<BrowserListSessionServiceBrowserListObserver>( + observer_ = std::make_unique<BrowserListSessionServiceBrowserListObserver>( browser_list, base::BindRepeating(&BrowserListSessionServiceImpl::ScheduleSaveSession, base::Unretained(this), false));
diff --git a/ios/chrome/browser/ui/browser_view_controller.mm b/ios/chrome/browser/ui/browser_view_controller.mm index 5df6a364..1b3c59c 100644 --- a/ios/chrome/browser/ui/browser_view_controller.mm +++ b/ios/chrome/browser/ui/browser_view_controller.mm
@@ -25,7 +25,6 @@ #include "base/mac/bundle_locations.h" #include "base/mac/foundation_util.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/metrics/histogram_macros.h" #include "base/metrics/user_metrics.h" #include "base/metrics/user_metrics_action.h" @@ -1201,7 +1200,7 @@ webStateList:[_model webStateList]]; StartBroadcastingMainContentUI(self, broadcaster); - _fullscreenUIUpdater = base::MakeUnique<FullscreenUIUpdater>(self); + _fullscreenUIUpdater = std::make_unique<FullscreenUIUpdater>(self); fullscreenController->AddObserver(_fullscreenUIUpdater.get()); fullscreenController->SetWebStateList([_model webStateList]); @@ -1877,7 +1876,7 @@ for (NSUInteger index = 0; index < count; ++index) [self installDelegatesForTab:[_model tabAtIndex:index]]; - _imageFetcher = base::MakeUnique<image_fetcher::IOSImageDataFetcherWrapper>( + _imageFetcher = std::make_unique<image_fetcher::IOSImageDataFetcherWrapper>( _browserState->GetRequestContext()); self.imageSaver = [[ImageSaver alloc] initWithBaseViewController:self];
diff --git a/ios/chrome/browser/ui/browser_view_controller_unittest.mm b/ios/chrome/browser/ui/browser_view_controller_unittest.mm index 6660ceed..774d2f4 100644 --- a/ios/chrome/browser/ui/browser_view_controller_unittest.mm +++ b/ios/chrome/browser/ui/browser_view_controller_unittest.mm
@@ -9,7 +9,6 @@ #include "base/files/file_path.h" #include "base/files/file_util.h" -#include "base/memory/ptr_util.h" #include "base/path_service.h" #include "base/strings/sys_string_conversions.h" #include "base/test/scoped_feature_list.h" @@ -126,7 +125,7 @@ if ((self = [super initWithRepresentedObject:[OCMockObject niceMockForClass:[TabModel class]]])) { - _webStateList = base::MakeUnique<WebStateList>(&_webStateListDelegate); + _webStateList = std::make_unique<WebStateList>(&_webStateListDelegate); } return self; }
diff --git a/ios/chrome/browser/ui/chrome_web_view_factory_unittest.mm b/ios/chrome/browser/ui/chrome_web_view_factory_unittest.mm index d6568a2..ce8f21b 100644 --- a/ios/chrome/browser/ui/chrome_web_view_factory_unittest.mm +++ b/ios/chrome/browser/ui/chrome_web_view_factory_unittest.mm
@@ -4,7 +4,8 @@ #import "ios/chrome/browser/ui/chrome_web_view_factory.h" -#include "base/memory/ptr_util.h" +#include <memory> + #include "base/run_loop.h" #include "ios/chrome/browser/browser_state/test_chrome_browser_state_isolated_context.h" #import "ios/chrome/browser/web/chrome_web_client.h" @@ -29,7 +30,7 @@ class ChromeWebViewFactoryTest : public PlatformTest { public: ChromeWebViewFactoryTest() - : web_client_(base::MakeUnique<ChromeWebClient>()) {} + : web_client_(std::make_unique<ChromeWebClient>()) {} protected: web::TestWebThreadBundle thread_bundle_;
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils_unittest.mm b/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils_unittest.mm index 961c446..bb51e62d 100644 --- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils_unittest.mm +++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils_unittest.mm
@@ -4,7 +4,8 @@ #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils.h" -#include "base/memory/ptr_util.h" +#include <memory> + #import "ios/chrome/test/base/scoped_block_swizzler.h" #include "testing/platform_test.h" #import "third_party/ocmock/OCMock/OCMock.h" @@ -18,28 +19,28 @@ class ContentSuggestionsCollectionUtilsTest : public PlatformTest { public: void SetAsIPad() { - device_type_swizzler_ = base::MakeUnique<ScopedBlockSwizzler>( + device_type_swizzler_ = std::make_unique<ScopedBlockSwizzler>( [UIDevice class], @selector(userInterfaceIdiom), ^UIUserInterfaceIdiom(id self) { return UIUserInterfaceIdiomPad; }); } void SetAsIPhone() { - device_type_swizzler_ = base::MakeUnique<ScopedBlockSwizzler>( + device_type_swizzler_ = std::make_unique<ScopedBlockSwizzler>( [UIDevice class], @selector(userInterfaceIdiom), ^UIUserInterfaceIdiom(id self) { return UIUserInterfaceIdiomPhone; }); } void SetAsPortrait() { - orientation_swizzler_ = base::MakeUnique<ScopedBlockSwizzler>( + orientation_swizzler_ = std::make_unique<ScopedBlockSwizzler>( [UIApplication class], @selector(statusBarOrientation), ^UIInterfaceOrientation(id self) { return UIInterfaceOrientationPortrait; }); } void SetAsLandscape() { - orientation_swizzler_ = base::MakeUnique<ScopedBlockSwizzler>( + orientation_swizzler_ = std::make_unique<ScopedBlockSwizzler>( [UIApplication class], @selector(statusBarOrientation), ^UIInterfaceOrientation(id self) { return UIInterfaceOrientationLandscapeLeft;
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_egtest.mm b/ios/chrome/browser/ui/content_suggestions/content_suggestions_egtest.mm index ee7c60b..f80f8ed3d 100644 --- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_egtest.mm +++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_egtest.mm
@@ -5,10 +5,10 @@ #import <EarlGrey/EarlGrey.h> #import <XCTest/XCTest.h> +#include <memory> #include <vector> #include "base/mac/foundation_util.h" -#include "base/memory/ptr_util.h" #include "base/strings/sys_string_conversions.h" #include "base/strings/utf_string_conversions.h" #import "base/test/ios/wait_util.h" @@ -76,7 +76,7 @@ return nullptr; } std::unique_ptr<net::test_server::BasicHttpResponse> http_response = - base::MakeUnique<net::test_server::BasicHttpResponse>(); + std::make_unique<net::test_server::BasicHttpResponse>(); http_response->set_code(net::HTTP_OK); http_response->set_content("<html><head><title>" + std::string(kPageTitle) + "</title></head><body>" +
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_header_synchronizer_unittest.mm b/ios/chrome/browser/ui/content_suggestions/content_suggestions_header_synchronizer_unittest.mm index 5f879d1..364412c 100644 --- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_header_synchronizer_unittest.mm +++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_header_synchronizer_unittest.mm
@@ -4,7 +4,8 @@ #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_header_synchronizer.h" -#include "base/memory/ptr_util.h" +#include <memory> + #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_controlling.h" #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_header_controlling.h" #import "ios/chrome/test/base/scoped_block_swizzler.h" @@ -36,7 +37,7 @@ id CollectionController() { return collection_controller_; } void SetAsIPhone() { - device_type_swizzler_ = base::MakeUnique<ScopedBlockSwizzler>( + device_type_swizzler_ = std::make_unique<ScopedBlockSwizzler>( [UIDevice class], @selector(userInterfaceIdiom), ^UIUserInterfaceIdiom(id self) { return UIUserInterfaceIdiomPhone;
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_mediator.mm b/ios/chrome/browser/ui/content_suggestions/content_suggestions_mediator.mm index c91b267..f797794 100644 --- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_mediator.mm +++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_mediator.mm
@@ -6,7 +6,6 @@ #include "base/mac/bind_objc_block.h" #include "base/mac/foundation_util.h" -#include "base/memory/ptr_util.h" #include "base/optional.h" #include "base/strings/sys_string_conversions.h" #include "components/ntp_snippets/category.h" @@ -127,7 +126,7 @@ self = [super init]; if (self) { _suggestionBridge = - base::MakeUnique<ContentSuggestionsServiceBridge>(self, contentService); + std::make_unique<ContentSuggestionsServiceBridge>(self, contentService); _contentService = contentService; _sectionInformationByCategory = [[NSMutableDictionary alloc] init]; @@ -143,13 +142,13 @@ _learnMoreItem = [[ContentSuggestionsLearnMoreItem alloc] init]; - _notificationPromo = base::MakeUnique<NotificationPromoWhatsNew>( + _notificationPromo = std::make_unique<NotificationPromoWhatsNew>( GetApplicationContext()->GetLocalState()); _notificationPromo->Init(); _mostVisitedSites = std::move(mostVisitedSites); _mostVisitedBridge = - base::MakeUnique<ntp_tiles::MostVisitedSitesObserverBridge>(self); + std::make_unique<ntp_tiles::MostVisitedSitesObserverBridge>(self); _mostVisitedSites->SetMostVisitedURLsObserver(_mostVisitedBridge.get(), kMaxNumMostVisitedTiles); }
diff --git a/ios/chrome/browser/ui/content_suggestions/ntp_home_egtest.mm b/ios/chrome/browser/ui/content_suggestions/ntp_home_egtest.mm index f55d7fc..cc25628 100644 --- a/ios/chrome/browser/ui/content_suggestions/ntp_home_egtest.mm +++ b/ios/chrome/browser/ui/content_suggestions/ntp_home_egtest.mm
@@ -5,6 +5,8 @@ #import <EarlGrey/EarlGrey.h> #import <XCTest/XCTest.h> +#include <memory> + #include "base/ios/ios_util.h" #include "base/strings/sys_string_conversions.h" #include "base/test/scoped_command_line.h" @@ -57,7 +59,7 @@ return nullptr; } std::unique_ptr<net::test_server::BasicHttpResponse> http_response = - base::MakeUnique<net::test_server::BasicHttpResponse>(); + std::make_unique<net::test_server::BasicHttpResponse>(); http_response->set_code(net::HTTP_OK); http_response->set_content("<html><head><title>" + std::string(kPageTitle) + "</title></head><body>" +
diff --git a/ios/chrome/browser/ui/content_suggestions/ntp_home_mediator.mm b/ios/chrome/browser/ui/content_suggestions/ntp_home_mediator.mm index 1857409..5023431c 100644 --- a/ios/chrome/browser/ui/content_suggestions/ntp_home_mediator.mm +++ b/ios/chrome/browser/ui/content_suggestions/ntp_home_mediator.mm
@@ -4,6 +4,8 @@ #import "ios/chrome/browser/ui/content_suggestions/ntp_home_mediator.h" +#include <memory> + #include "base/mac/foundation_util.h" #include "base/metrics/user_metrics.h" #include "base/metrics/user_metrics_action.h" @@ -104,7 +106,7 @@ self = [super init]; if (self) { _webStateList = webStateList; - _webStateListObserver = base::MakeUnique<WebStateListObserverBridge>(self); + _webStateListObserver = std::make_unique<WebStateListObserverBridge>(self); _webStateList->AddObserver(_webStateListObserver.get()); _templateURLService = templateURLService; // Listen for default search engine changes.
diff --git a/ios/chrome/browser/ui/content_suggestions/ntp_home_mediator_unittest.mm b/ios/chrome/browser/ui/content_suggestions/ntp_home_mediator_unittest.mm index 9d1fd69..c50dfcd 100644 --- a/ios/chrome/browser/ui/content_suggestions/ntp_home_mediator_unittest.mm +++ b/ios/chrome/browser/ui/content_suggestions/ntp_home_mediator_unittest.mm
@@ -4,7 +4,8 @@ #import "ios/chrome/browser/ui/content_suggestions/ntp_home_mediator.h" -#include "base/memory/ptr_util.h" +#include <memory> + #include "ios/chrome/browser/browser_state/test_chrome_browser_state.h" #include "ios/chrome/browser/chrome_url_constants.h" #include "ios/chrome/browser/ntp_snippets/ios_chrome_content_suggestions_service_factory.h" @@ -56,7 +57,7 @@ chrome_browser_state_ = test_cbs_builder.Build(); std::unique_ptr<ToolbarTestNavigationManager> navigation_manager = - base::MakeUnique<ToolbarTestNavigationManager>(); + std::make_unique<ToolbarTestNavigationManager>(); navigation_manager_ = navigation_manager.get(); test_web_state_ = std::make_unique<web::TestWebState>(); test_web_state_->SetNavigationManager(std::move(navigation_manager)); @@ -86,13 +87,13 @@ protected: void SetUpWebStateList() { - web_state_list_ = base::MakeUnique<WebStateList>(&web_state_list_delegate_); + web_state_list_ = std::make_unique<WebStateList>(&web_state_list_delegate_); web_state_list_->InsertWebState(0, std::move(test_web_state_), WebStateList::INSERT_FORCE_INDEX, WebStateOpener()); web_state_list_->ActivateWebStateAt(0); for (int i = 1; i < kNumberOfWebStates; i++) { - auto web_state = base::MakeUnique<web::TestWebState>(); + auto web_state = std::make_unique<web::TestWebState>(); GURL url("http://test/" + std::to_string(i)); web_state->SetCurrentURL(url); web_state_list_->InsertWebState(i, std::move(web_state), @@ -176,7 +177,7 @@ OCMExpect([consumer_ setTabCount:kNumberOfWebStates + 1]); // Action. - auto web_state = base::MakeUnique<web::TestWebState>(); + auto web_state = std::make_unique<web::TestWebState>(); web_state_list_->InsertWebState(1, std::move(web_state), WebStateList::INSERT_FORCE_INDEX, WebStateOpener()); @@ -204,7 +205,7 @@ // Setup. [mediator_ setUp]; std::unique_ptr<ToolbarTestNavigationManager> navigation_manager = - base::MakeUnique<ToolbarTestNavigationManager>(); + std::make_unique<ToolbarTestNavigationManager>(); ToolbarTestNavigationManager* nav = navigation_manager.get(); std::unique_ptr<web::TestWebState> web_state = std::make_unique<web::TestWebState>();
diff --git a/ios/chrome/browser/ui/content_suggestions/ntp_home_provider_test_singleton.mm b/ios/chrome/browser/ui/content_suggestions/ntp_home_provider_test_singleton.mm index a2a8cc6..7c45332 100644 --- a/ios/chrome/browser/ui/content_suggestions/ntp_home_provider_test_singleton.mm +++ b/ios/chrome/browser/ui/content_suggestions/ntp_home_provider_test_singleton.mm
@@ -4,7 +4,8 @@ #import "ios/chrome/browser/ui/content_suggestions/ntp_home_provider_test_singleton.h" -#include "base/memory/ptr_util.h" +#include <memory> + #include "components/ntp_snippets/content_suggestion.h" #if !defined(__has_feature) || !__has_feature(objc_arc) @@ -32,7 +33,7 @@ - (void)registerArticleProvider: (ntp_snippets::ContentSuggestionsService*)service { std::unique_ptr<ntp_snippets::MockContentSuggestionsProvider> provider = - base::MakeUnique<ntp_snippets::MockContentSuggestionsProvider>( + std::make_unique<ntp_snippets::MockContentSuggestionsProvider>( service, std::vector<ntp_snippets::Category>{ ntp_snippets::Category::FromKnownCategory( ntp_snippets::KnownCategories::ARTICLES)});
diff --git a/ios/chrome/browser/ui/contextual_search/touch_to_search_permissions_mediator_unittest.mm b/ios/chrome/browser/ui/contextual_search/touch_to_search_permissions_mediator_unittest.mm index 59dab1f..bea3669 100644 --- a/ios/chrome/browser/ui/contextual_search/touch_to_search_permissions_mediator_unittest.mm +++ b/ios/chrome/browser/ui/contextual_search/touch_to_search_permissions_mediator_unittest.mm
@@ -8,7 +8,6 @@ #include <memory> #include "base/command_line.h" -#include "base/memory/ptr_util.h" #include "base/metrics/field_trial.h" #include "base/run_loop.h" #include "base/strings/utf_string_conversions.h" @@ -61,7 +60,7 @@ syncer::SyncService* sync_service = IOSChromeProfileSyncServiceFactory::GetForBrowserState( chrome_browser_state); - return base::MakeUnique<SyncSetupServiceMock>( + return std::make_unique<SyncSetupServiceMock>( sync_service, chrome_browser_state->GetPrefs()); }
diff --git a/ios/chrome/browser/ui/dialogs/java_script_dialog_blocking_state_unittest.mm b/ios/chrome/browser/ui/dialogs/java_script_dialog_blocking_state_unittest.mm index d5df528..7b825735 100644 --- a/ios/chrome/browser/ui/dialogs/java_script_dialog_blocking_state_unittest.mm +++ b/ios/chrome/browser/ui/dialogs/java_script_dialog_blocking_state_unittest.mm
@@ -4,7 +4,8 @@ #import "ios/chrome/browser/ui/dialogs/java_script_dialog_blocking_state.h" -#include "base/memory/ptr_util.h" +#include <memory> + #include "ios/web/public/load_committed_details.h" #import "ios/web/public/navigation_item.h" #import "ios/web/public/test/fakes/fake_navigation_context.h" @@ -25,7 +26,7 @@ JavaScriptBlockingTestWebState() : web::TestWebState() { last_committed_item_ = web::NavigationItem::Create(); std::unique_ptr<web::TestNavigationManager> manager = - base::MakeUnique<web::TestNavigationManager>(); + std::make_unique<web::TestNavigationManager>(); manager->SetLastCommittedItem(last_committed_item_.get()); manager_ = manager.get(); SetNavigationManager(std::move(manager));
diff --git a/ios/chrome/browser/ui/download/pass_kit_egtest.mm b/ios/chrome/browser/ui/download/pass_kit_egtest.mm index 5d57d864..c1a5d70 100644 --- a/ios/chrome/browser/ui/download/pass_kit_egtest.mm +++ b/ios/chrome/browser/ui/download/pass_kit_egtest.mm
@@ -5,7 +5,8 @@ #import <EarlGrey/EarlGrey.h> #import <PassKit/PassKit.h> -#include "base/memory/ptr_util.h" +#include <memory> + #import "ios/chrome/app/main_controller.h" #include "ios/chrome/browser/download/pass_kit_mime_type.h" #include "ios/chrome/browser/download/pass_kit_test_util.h" @@ -40,7 +41,7 @@ // PassKit landing page and download request handler. std::unique_ptr<net::test_server::HttpResponse> GetResponse( const net::test_server::HttpRequest& request) { - auto result = base::MakeUnique<net::test_server::BasicHttpResponse>(); + auto result = std::make_unique<net::test_server::BasicHttpResponse>(); result->set_code(net::HTTP_OK); if (request.GetURL().path() == "/") {
diff --git a/ios/chrome/browser/ui/fullscreen/chrome_coordinator+fullscreen_disabling.mm b/ios/chrome/browser/ui/fullscreen/chrome_coordinator+fullscreen_disabling.mm index 66cb81a..e64dc938 100644 --- a/ios/chrome/browser/ui/fullscreen/chrome_coordinator+fullscreen_disabling.mm +++ b/ios/chrome/browser/ui/fullscreen/chrome_coordinator+fullscreen_disabling.mm
@@ -6,8 +6,9 @@ #import <objc/runtime.h> +#include <memory> + #include "base/logging.h" -#include "base/memory/ptr_util.h" #import "ios/chrome/browser/ui/fullscreen/fullscreen_controller.h" #import "ios/chrome/browser/ui/fullscreen/fullscreen_controller_factory.h" #import "ios/chrome/browser/ui/fullscreen/scoped_fullscreen_disabler.h" @@ -82,7 +83,7 @@ } - (void)createDisabler { - _disabler = base::MakeUnique<ScopedFullscreenDisabler>(self.controller); + _disabler = std::make_unique<ScopedFullscreenDisabler>(self.controller); } - (void)resetDisabler {
diff --git a/ios/chrome/browser/ui/fullscreen/fullscreen_controller_factory.mm b/ios/chrome/browser/ui/fullscreen/fullscreen_controller_factory.mm index 750d293e..6cfe28a 100644 --- a/ios/chrome/browser/ui/fullscreen/fullscreen_controller_factory.mm +++ b/ios/chrome/browser/ui/fullscreen/fullscreen_controller_factory.mm
@@ -6,7 +6,6 @@ #include <memory> -#include "base/memory/ptr_util.h" #include "base/memory/singleton.h" #include "components/keyed_service/ios/browser_state_dependency_manager.h" #include "ios/chrome/browser/browser_state/browser_state_otr_helper.h" @@ -37,7 +36,7 @@ std::unique_ptr<KeyedService> FullscreenControllerFactory::BuildServiceInstanceFor( web::BrowserState* context) const { - return base::MakeUnique<FullscreenControllerImpl>(); + return std::make_unique<FullscreenControllerImpl>(); } web::BrowserState* FullscreenControllerFactory::GetBrowserStateToUse(
diff --git a/ios/chrome/browser/ui/fullscreen/fullscreen_controller_impl.mm b/ios/chrome/browser/ui/fullscreen/fullscreen_controller_impl.mm index 8bc38a9..8eba2f5 100644 --- a/ios/chrome/browser/ui/fullscreen/fullscreen_controller_impl.mm +++ b/ios/chrome/browser/ui/fullscreen/fullscreen_controller_impl.mm
@@ -4,7 +4,6 @@ #import "ios/chrome/browser/ui/fullscreen/fullscreen_controller_impl.h" -#include "base/memory/ptr_util.h" #import "ios/chrome/browser/ui/broadcaster/chrome_broadcast_observer_bridge.h" #import "ios/chrome/browser/ui/broadcaster/chrome_broadcaster.h" #import "ios/chrome/browser/ui/fullscreen/fullscreen_mediator.h" @@ -19,12 +18,12 @@ FullscreenControllerImpl::FullscreenControllerImpl() : FullscreenController(), broadcaster_([[ChromeBroadcaster alloc] init]), - model_(base::MakeUnique<FullscreenModel>()), + model_(std::make_unique<FullscreenModel>()), bridge_( [[ChromeBroadcastOberverBridge alloc] initWithObserver:model_.get()]), disabler_([[SystemNotificationFullscreenDisabler alloc] initWithController:this]), - mediator_(base::MakeUnique<FullscreenMediator>(this, model_.get())) { + mediator_(std::make_unique<FullscreenMediator>(this, model_.get())) { DCHECK(broadcaster_); [broadcaster_ addObserver:bridge_ forSelector:@selector(broadcastContentScrollOffset:)]; @@ -47,7 +46,7 @@ web_state_list_observer_->Disconnect(); web_state_list_ = web_state_list; web_state_list_observer_ = - web_state_list_ ? base::MakeUnique<FullscreenWebStateListObserver>( + web_state_list_ ? std::make_unique<FullscreenWebStateListObserver>( this, model_.get(), web_state_list_) : nullptr; }
diff --git a/ios/chrome/browser/ui/fullscreen/fullscreen_scroll_end_animator.mm b/ios/chrome/browser/ui/fullscreen/fullscreen_scroll_end_animator.mm index 5c4e86b..c61ecd55 100644 --- a/ios/chrome/browser/ui/fullscreen/fullscreen_scroll_end_animator.mm +++ b/ios/chrome/browser/ui/fullscreen/fullscreen_scroll_end_animator.mm
@@ -6,9 +6,9 @@ #include <math.h> #include <algorithm> +#include <memory> #include "base/logging.h" -#include "base/memory/ptr_util.h" #import "ios/chrome/common/material_timing.h" #include "ui/gfx/geometry/cubic_bezier.h" @@ -47,7 +47,7 @@ DCHECK_LE(startProgress, 1.0); _startProgress = startProgress; _finalProgress = roundf(_startProgress); - _bezier = base::MakeUnique<gfx::CubicBezier>( + _bezier = std::make_unique<gfx::CubicBezier>( timingParams.controlPoint1.x, timingParams.controlPoint1.y, timingParams.controlPoint2.x, timingParams.controlPoint2.y); }
diff --git a/ios/chrome/browser/ui/fullscreen/fullscreen_web_state_list_observer_unittest.mm b/ios/chrome/browser/ui/fullscreen/fullscreen_web_state_list_observer_unittest.mm index 1333401..a76e900 100644 --- a/ios/chrome/browser/ui/fullscreen/fullscreen_web_state_list_observer_unittest.mm +++ b/ios/chrome/browser/ui/fullscreen/fullscreen_web_state_list_observer_unittest.mm
@@ -4,7 +4,8 @@ #import "ios/chrome/browser/ui/fullscreen/fullscreen_web_state_list_observer.h" -#include "base/memory/ptr_util.h" +#include <memory> + #import "ios/chrome/browser/ui/fullscreen/fullscreen_model.h" #import "ios/chrome/browser/ui/fullscreen/test/fullscreen_model_test_util.h" #import "ios/chrome/browser/ui/fullscreen/test/test_fullscreen_controller.h" @@ -52,7 +53,7 @@ // Insert a WebState into the list. The observer should create a // FullscreenWebStateObserver for the newly activated WebState. std::unique_ptr<web::TestWebState> inserted_web_state = - base::MakeUnique<web::TestWebState>(); + std::make_unique<web::TestWebState>(); web::TestWebState* web_state = inserted_web_state.get(); web_state_list().InsertWebState(0, std::move(inserted_web_state), WebStateList::INSERT_ACTIVATE,
diff --git a/ios/chrome/browser/ui/fullscreen/fullscreen_web_state_observer.mm b/ios/chrome/browser/ui/fullscreen/fullscreen_web_state_observer.mm index 23b6056..f0368cb 100644 --- a/ios/chrome/browser/ui/fullscreen/fullscreen_web_state_observer.mm +++ b/ios/chrome/browser/ui/fullscreen/fullscreen_web_state_observer.mm
@@ -5,7 +5,6 @@ #import "ios/chrome/browser/ui/fullscreen/fullscreen_web_state_observer.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #import "ios/chrome/browser/ui/fullscreen/fullscreen_model.h" #import "ios/chrome/browser/ui/fullscreen/fullscreen_web_scroll_view_replacement_handler.h" #import "ios/chrome/browser/ui/fullscreen/scoped_fullscreen_disabler.h" @@ -92,7 +91,7 @@ if (!!ssl_disabler_.get() == broken) return; ssl_disabler_ = broken - ? base::MakeUnique<ScopedFullscreenDisabler>(controller_) + ? std::make_unique<ScopedFullscreenDisabler>(controller_) : nullptr; } @@ -100,6 +99,6 @@ if (!!loading_disabler_.get() == loading) return; loading_disabler_ = - loading ? base::MakeUnique<ScopedFullscreenDisabler>(controller_) + loading ? std::make_unique<ScopedFullscreenDisabler>(controller_) : nullptr; }
diff --git a/ios/chrome/browser/ui/fullscreen/fullscreen_web_state_observer_unittest.mm b/ios/chrome/browser/ui/fullscreen/fullscreen_web_state_observer_unittest.mm index fd48eba6cd..a4ca0dc5 100644 --- a/ios/chrome/browser/ui/fullscreen/fullscreen_web_state_observer_unittest.mm +++ b/ios/chrome/browser/ui/fullscreen/fullscreen_web_state_observer_unittest.mm
@@ -4,7 +4,6 @@ #import "ios/chrome/browser/ui/fullscreen/fullscreen_web_state_observer.h" -#include "base/memory/ptr_util.h" #import "ios/chrome/browser/ui/fullscreen/fullscreen_model.h" #import "ios/chrome/browser/ui/fullscreen/test/fullscreen_model_test_util.h" #import "ios/chrome/browser/ui/fullscreen/test/test_fullscreen_controller.h" @@ -27,7 +26,7 @@ SetUpFullscreenModelForTesting(&model_, 100.0); // Set up a TestNavigationManager. std::unique_ptr<web::TestNavigationManager> navigation_manager = - base::MakeUnique<web::TestNavigationManager>(); + std::make_unique<web::TestNavigationManager>(); navigation_manager_ = navigation_manager.get(); web_state_.SetNavigationManager(std::move(navigation_manager)); // Begin observing the WebState.
diff --git a/ios/chrome/browser/ui/fullscreen/system_notification_fullscreen_disabler.mm b/ios/chrome/browser/ui/fullscreen/system_notification_fullscreen_disabler.mm index ebbd2621a..0754f9e6 100644 --- a/ios/chrome/browser/ui/fullscreen/system_notification_fullscreen_disabler.mm +++ b/ios/chrome/browser/ui/fullscreen/system_notification_fullscreen_disabler.mm
@@ -4,8 +4,9 @@ #import "ios/chrome/browser/ui/fullscreen/system_notification_fullscreen_disabler.h" +#include <memory> + #include "base/logging.h" -#include "base/memory/ptr_util.h" #import "ios/chrome/browser/ui/fullscreen/fullscreen_controller.h" #import "ios/chrome/browser/ui/fullscreen/scoped_fullscreen_disabler.h" @@ -54,7 +55,7 @@ // Create a disabler if VoiceOver is enabled. if (UIAccessibilityIsVoiceOverRunning()) { _voiceOverDisabler = - base::MakeUnique<ScopedFullscreenDisabler>(_controller); + std::make_unique<ScopedFullscreenDisabler>(_controller); } // Regsiter for keyboard visibility notifications. [[NSNotificationCenter defaultCenter] @@ -88,13 +89,13 @@ - (void)voiceOverStatusChanged { _voiceOverDisabler = UIAccessibilityIsVoiceOverRunning() - ? base::MakeUnique<ScopedFullscreenDisabler>(self.controller) + ? std::make_unique<ScopedFullscreenDisabler>(self.controller) : nullptr; } - (void)keyboardWillShow { _keyboardDisabler = - base::MakeUnique<ScopedFullscreenDisabler>(self.controller); + std::make_unique<ScopedFullscreenDisabler>(self.controller); } - (void)keyboardDidHide {
diff --git a/ios/chrome/browser/ui/history/history_collection_view_controller_unittest.mm b/ios/chrome/browser/ui/history/history_collection_view_controller_unittest.mm index 85bee1ee..d296503 100644 --- a/ios/chrome/browser/ui/history/history_collection_view_controller_unittest.mm +++ b/ios/chrome/browser/ui/history/history_collection_view_controller_unittest.mm
@@ -7,7 +7,6 @@ #include <memory> #include "base/callback.h" -#include "base/memory/ptr_util.h" #include "base/strings/string16.h" #import "base/test/ios/wait_util.h" #include "base/time/time.h" @@ -60,7 +59,7 @@ ios::ChromeBrowserState::FromBrowserState(context); syncer::SyncService* sync_service = IOSChromeProfileSyncServiceFactory::GetForBrowserState(browser_state); - return base::MakeUnique<SyncSetupServiceMock>(sync_service, + return std::make_unique<SyncSetupServiceMock>(sync_service, browser_state->GetPrefs()); }
diff --git a/ios/chrome/browser/ui/main_content/web_scroll_view_main_content_ui_forwarder.mm b/ios/chrome/browser/ui/main_content/web_scroll_view_main_content_ui_forwarder.mm index 60bd2ab..a357b17c 100644 --- a/ios/chrome/browser/ui/main_content/web_scroll_view_main_content_ui_forwarder.mm +++ b/ios/chrome/browser/ui/main_content/web_scroll_view_main_content_ui_forwarder.mm
@@ -4,8 +4,9 @@ #import "ios/chrome/browser/ui/main_content/web_scroll_view_main_content_ui_forwarder.h" +#include <memory> + #include "base/logging.h" -#include "base/memory/ptr_util.h" #import "ios/chrome/browser/ui/main_content/main_content_ui_state.h" #import "ios/chrome/browser/web_state_list/web_state_list.h" #import "ios/chrome/browser/web_state_list/web_state_list_observer_bridge.h" @@ -47,7 +48,7 @@ DCHECK(_updater); _webStateList = webStateList; DCHECK(_webStateList); - _bridge = base::MakeUnique<WebStateListObserverBridge>(self); + _bridge = std::make_unique<WebStateListObserverBridge>(self); _webStateList->AddObserver(_bridge.get()); web::WebState* activeWebState = webStateList->GetActiveWebState(); if (activeWebState) {
diff --git a/ios/chrome/browser/ui/ntp/recent_tabs/recent_tabs_table_coordinator.mm b/ios/chrome/browser/ui/ntp/recent_tabs/recent_tabs_table_coordinator.mm index 7c0eb02..2cf15fe 100644 --- a/ios/chrome/browser/ui/ntp/recent_tabs/recent_tabs_table_coordinator.mm +++ b/ios/chrome/browser/ui/ntp/recent_tabs/recent_tabs_table_coordinator.mm
@@ -168,12 +168,12 @@ - (void)initObservers { if (!_syncedSessionsObserver) { _syncedSessionsObserver = - base::MakeUnique<synced_sessions::SyncedSessionsObserverBridge>( + std::make_unique<synced_sessions::SyncedSessionsObserverBridge>( self, _browserState); } if (!_closedTabsObserver) { _closedTabsObserver = - base::MakeUnique<recent_tabs::ClosedTabsObserverBridge>(self); + std::make_unique<recent_tabs::ClosedTabsObserverBridge>(self); sessions::TabRestoreService* restoreService = IOSChromeTabRestoreServiceFactory::GetForBrowserState(_browserState); if (restoreService)
diff --git a/ios/chrome/browser/ui/ntp/recent_tabs/recent_tabs_table_coordinator_unittest.mm b/ios/chrome/browser/ui/ntp/recent_tabs/recent_tabs_table_coordinator_unittest.mm index a9af654..b0f61fd7 100644 --- a/ios/chrome/browser/ui/ntp/recent_tabs/recent_tabs_table_coordinator_unittest.mm +++ b/ios/chrome/browser/ui/ntp/recent_tabs/recent_tabs_table_coordinator_unittest.mm
@@ -8,7 +8,6 @@ #include <memory> -#include "base/memory/ptr_util.h" #include "components/browser_sync/profile_sync_service.h" #include "components/browser_sync/profile_sync_service_mock.h" #include "components/signin/core/browser/signin_manager.h" @@ -46,7 +45,7 @@ syncer::SyncService* sync_service = IOSChromeProfileSyncServiceFactory::GetForBrowserState( chrome_browser_state); - return base::MakeUnique<SyncSetupServiceMock>( + return std::make_unique<SyncSetupServiceMock>( sync_service, chrome_browser_state->GetPrefs()); } @@ -64,7 +63,7 @@ std::unique_ptr<KeyedService> BuildMockProfileSyncServiceForRecentTabsTableCoordinator( web::BrowserState* context) { - return base::MakeUnique<ProfileSyncServiceMockForRecentTabsTableCoordinator>( + return std::make_unique<ProfileSyncServiceMockForRecentTabsTableCoordinator>( CreateProfileSyncServiceParamsForTest( nullptr, ios::ChromeBrowserState::FromBrowserState(context))); }
diff --git a/ios/chrome/browser/ui/ntp/recent_tabs/synced_sessions.mm b/ios/chrome/browser/ui/ntp/recent_tabs/synced_sessions.mm index a51cd79..bf48708 100644 --- a/ios/chrome/browser/ui/ntp/recent_tabs/synced_sessions.mm +++ b/ios/chrome/browser/ui/ntp/recent_tabs/synced_sessions.mm
@@ -8,7 +8,6 @@ #include <memory> #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/metrics/field_trial.h" #include "base/strings/utf_string_conversions.h" #include "components/sync/driver/sync_service.h" @@ -36,7 +35,7 @@ synced_sessions::DistantSession* distant_session) { if (session_tab.navigations.size() > 0) { distant_session->tabs.push_back( - base::MakeUnique<synced_sessions::DistantTab>()); + std::make_unique<synced_sessions::DistantTab>()); synced_sessions::DistantTab& distant_tab = *distant_session->tabs.back(); distant_tab.session_tag = session_tag; distant_tab.tab_id = session_tab.tab_id.id();
diff --git a/ios/chrome/browser/ui/omnibox/chrome_omnibox_client_ios.mm b/ios/chrome/browser/ui/omnibox/chrome_omnibox_client_ios.mm index b4fa58d..9cb50414 100644 --- a/ios/chrome/browser/ui/omnibox/chrome_omnibox_client_ios.mm +++ b/ios/chrome/browser/ui/omnibox/chrome_omnibox_client_ios.mm
@@ -4,7 +4,6 @@ #include "ios/chrome/browser/ui/omnibox/chrome_omnibox_client_ios.h" -#include "base/memory/ptr_util.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "components/favicon/ios/web_favicon_driver.h" @@ -41,7 +40,7 @@ std::unique_ptr<AutocompleteProviderClient> ChromeOmniboxClientIOS::CreateAutocompleteProviderClient() { - return base::MakeUnique<AutocompleteProviderClientImpl>(browser_state_); + return std::make_unique<AutocompleteProviderClientImpl>(browser_state_); } std::unique_ptr<OmniboxNavigationObserver>
diff --git a/ios/chrome/browser/ui/omnibox/location_bar_controller_impl.mm b/ios/chrome/browser/ui/omnibox/location_bar_controller_impl.mm index c7f506f..a8961c2 100644 --- a/ios/chrome/browser/ui/omnibox/location_bar_controller_impl.mm +++ b/ios/chrome/browser/ui/omnibox/location_bar_controller_impl.mm
@@ -10,7 +10,6 @@ #include "base/logging.h" #include "base/mac/foundation_util.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/strings/string16.h" #include "components/omnibox/browser/omnibox_edit_model.h" #include "components/security_state/core/security_state_ui.h" @@ -150,7 +149,7 @@ ios::ChromeBrowserState* browser_state, id<LocationBarDelegate> delegate, id<BrowserCommands> dispatcher) - : edit_view_(base::MakeUnique<OmniboxViewIOS>(location_bar_view.textField, + : edit_view_(std::make_unique<OmniboxViewIOS>(location_bar_view.textField, this, this, browser_state)), @@ -171,7 +170,7 @@ OmniboxPopupCoordinator* LocationBarControllerImpl::CreatePopupCoordinator( id<OmniboxPopupPositioner> positioner) { std::unique_ptr<OmniboxPopupViewIOS> popup_view = - base::MakeUnique<OmniboxPopupViewIOS>(edit_view_->model(), + std::make_unique<OmniboxPopupViewIOS>(edit_view_->model(), edit_view_.get()); edit_view_->model()->set_popup_model(popup_view->model()); @@ -311,7 +310,7 @@ // Disable fullscreen while focused so that the location bar cannot be scolled // offscreen. if (base::FeatureList::IsEnabled(fullscreen::features::kNewFullscreen)) { - fullscreen_disabler_ = base::MakeUnique<ScopedFullscreenDisabler>( + fullscreen_disabler_ = std::make_unique<ScopedFullscreenDisabler>( FullscreenControllerFactory::GetInstance()->GetForBrowserState( browser_state_)); }
diff --git a/ios/chrome/browser/ui/omnibox/omnibox_view_ios.mm b/ios/chrome/browser/ui/omnibox/omnibox_view_ios.mm index 45d21c1a..bc7f5a3 100644 --- a/ios/chrome/browser/ui/omnibox/omnibox_view_ios.mm +++ b/ios/chrome/browser/ui/omnibox/omnibox_view_ios.mm
@@ -11,7 +11,6 @@ #include "base/command_line.h" #include "base/ios/device_util.h" #include "base/ios/ios_util.h" -#include "base/memory/ptr_util.h" #include "base/metrics/user_metrics.h" #include "base/metrics/user_metrics_action.h" #include "base/strings/string16.h" @@ -164,7 +163,7 @@ ios::ChromeBrowserState* browser_state) : OmniboxView( controller, - base::MakeUnique<ChromeOmniboxClientIOS>(controller, browser_state)), + std::make_unique<ChromeOmniboxClientIOS>(controller, browser_state)), browser_state_(browser_state), field_(field), controller_(controller),
diff --git a/ios/chrome/browser/ui/omnibox_perftest.mm b/ios/chrome/browser/ui/omnibox_perftest.mm index 6277064..1d0f0ec 100644 --- a/ios/chrome/browser/ui/omnibox_perftest.mm +++ b/ios/chrome/browser/ui/omnibox_perftest.mm
@@ -6,7 +6,6 @@ #include <memory> -#include "base/memory/ptr_util.h" #import "base/test/ios/wait_util.h" #include "base/time/time.h" #include "components/toolbar/test_toolbar_model.h" @@ -81,11 +80,11 @@ // Create a WebStateList that will always return the test WebState as // the active WebState. - web_state_list_ = base::MakeUnique<WebStateList>(&web_state_list_delegate_); + web_state_list_ = std::make_unique<WebStateList>(&web_state_list_delegate_); std::unique_ptr<web::TestWebState> web_state = - base::MakeUnique<web::TestWebState>(); + std::make_unique<web::TestWebState>(); std::unique_ptr<web::TestNavigationManager> navigation_manager = - base::MakeUnique<web::TestNavigationManager>(); + std::make_unique<web::TestNavigationManager>(); web_state->SetNavigationManager(std::move(navigation_manager)); web_state_list_->InsertWebState(0, std::move(web_state), WebStateList::INSERT_FORCE_INDEX,
diff --git a/ios/chrome/browser/ui/overlays/overlay_queue_manager_unittest.mm b/ios/chrome/browser/ui/overlays/overlay_queue_manager_unittest.mm index 040ad58..3d6704f 100644 --- a/ios/chrome/browser/ui/overlays/overlay_queue_manager_unittest.mm +++ b/ios/chrome/browser/ui/overlays/overlay_queue_manager_unittest.mm
@@ -6,7 +6,6 @@ #include <memory> -#include "base/memory/ptr_util.h" #include "ios/chrome/browser/browser_state/chrome_browser_state.h" #import "ios/chrome/browser/ui/browser_list/browser.h" #import "ios/chrome/browser/ui/coordinators/browser_coordinator_test.h" @@ -80,7 +79,7 @@ // Create a WebState and add it to the WebStateList, verifying that the // manager's queues are updated and that the observer callback is received. std::unique_ptr<web::WebState> web_state = - base::MakeUnique<web::TestWebState>(); + std::make_unique<web::TestWebState>(); web_state_list()->InsertWebState(0, std::move(web_state), WebStateList::INSERT_FORCE_INDEX, WebStateOpener()); @@ -104,7 +103,7 @@ // Create a WebState and add it to the WebStateList, verifying that the // manager's queues are updated and that the observer callback is received. std::unique_ptr<web::WebState> web_state = - base::MakeUnique<web::TestWebState>(); + std::make_unique<web::TestWebState>(); web_state_list()->InsertWebState(0, std::move(web_state), WebStateList::INSERT_FORCE_INDEX, WebStateOpener()); @@ -118,7 +117,7 @@ // that the queues were successfully added and removed. observer()->reset(); std::unique_ptr<web::WebState> replacement = - base::MakeUnique<web::TestWebState>(); + std::make_unique<web::TestWebState>(); web_state_list()->ReplaceWebStateAt(0, std::move(replacement)); EXPECT_TRUE(observer()->will_remove_called()); EXPECT_TRUE(observer()->did_add_called());
diff --git a/ios/chrome/browser/ui/overlays/overlay_scheduler_unittest.mm b/ios/chrome/browser/ui/overlays/overlay_scheduler_unittest.mm index 4fc8739..e55a0351 100644 --- a/ios/chrome/browser/ui/overlays/overlay_scheduler_unittest.mm +++ b/ios/chrome/browser/ui/overlays/overlay_scheduler_unittest.mm
@@ -4,7 +4,6 @@ #import "ios/chrome/browser/ui/overlays/overlay_scheduler.h" -#include "base/memory/ptr_util.h" #include "ios/chrome/browser/browser_state/chrome_browser_state.h" #import "ios/chrome/browser/ui/coordinators/browser_coordinator_test.h" #import "ios/chrome/browser/ui/coordinators/browser_coordinator_test_util.h" @@ -107,7 +106,7 @@ // Tests that adding an overlay to a WebStateOverlayQueue triggers successful // presentation. TEST_F(OverlaySchedulerTest, AddWebStateOverlay) { - web_state_list()->InsertWebState(0, base::MakeUnique<web::TestWebState>(), + web_state_list()->InsertWebState(0, std::make_unique<web::TestWebState>(), WebStateList::INSERT_FORCE_INDEX, WebStateOpener()); web_state_list()->ActivateWebStateAt(0); @@ -133,11 +132,11 @@ // correctly switch the active WebState before presenting. TEST_F(OverlaySchedulerTest, SwitchWebStateForOverlay) { // Add two WebStates and activate the second. - web_state_list()->InsertWebState(0, base::MakeUnique<web::TestWebState>(), + web_state_list()->InsertWebState(0, std::make_unique<web::TestWebState>(), WebStateList::INSERT_FORCE_INDEX, WebStateOpener()); ASSERT_EQ(web_state_list()->count(), 1); - web_state_list()->InsertWebState(1, base::MakeUnique<web::TestWebState>(), + web_state_list()->InsertWebState(1, std::make_unique<web::TestWebState>(), WebStateList::INSERT_FORCE_INDEX, WebStateOpener()); web_state_list()->ActivateWebStateAt(1); @@ -166,11 +165,11 @@ // correctly switch the active WebState before presenting. TEST_F(OverlaySchedulerTest, SwitchWebStateForQueuedOverlays) { // Add two WebStates and activate the second. - web_state_list()->InsertWebState(0, base::MakeUnique<web::TestWebState>(), + web_state_list()->InsertWebState(0, std::make_unique<web::TestWebState>(), WebStateList::INSERT_FORCE_INDEX, WebStateOpener()); ASSERT_EQ(web_state_list()->count(), 1); - web_state_list()->InsertWebState(1, base::MakeUnique<web::TestWebState>(), + web_state_list()->InsertWebState(1, std::make_unique<web::TestWebState>(), WebStateList::INSERT_FORCE_INDEX, WebStateOpener()); web_state_list()->ActivateWebStateAt(1);
diff --git a/ios/chrome/browser/ui/overlays/overlay_service_factory.mm b/ios/chrome/browser/ui/overlays/overlay_service_factory.mm index a5f465e..e3e4bc8 100644 --- a/ios/chrome/browser/ui/overlays/overlay_service_factory.mm +++ b/ios/chrome/browser/ui/overlays/overlay_service_factory.mm
@@ -7,7 +7,6 @@ #include <memory> #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/memory/singleton.h" #include "components/keyed_service/ios/browser_state_dependency_manager.h" #include "ios/chrome/browser/browser_state/browser_state_otr_helper.h" @@ -47,7 +46,7 @@ web::BrowserState* context) const { ios::ChromeBrowserState* browser_state = ios::ChromeBrowserState::FromBrowserState(context); - return base::MakeUnique<OverlayServiceImpl>( + return std::make_unique<OverlayServiceImpl>( BrowserListFactory::GetForBrowserState(browser_state)); }
diff --git a/ios/chrome/browser/ui/overscroll_actions/overscroll_actions_controller.mm b/ios/chrome/browser/ui/overscroll_actions/overscroll_actions_controller.mm index 1e8e8b3..10dadb7 100644 --- a/ios/chrome/browser/ui/overscroll_actions/overscroll_actions_controller.mm +++ b/ios/chrome/browser/ui/overscroll_actions/overscroll_actions_controller.mm
@@ -7,9 +7,9 @@ #import <QuartzCore/QuartzCore.h> #include <algorithm> +#include <memory> #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/metrics/histogram_macros.h" #import "ios/chrome/browser/ui/browser_view_controller.h" #import "ios/chrome/browser/ui/fullscreen/fullscreen_controller.h" @@ -759,7 +759,7 @@ FullscreenController* fullscreenController = FullscreenControllerFactory::GetInstance()->GetForBrowserState( self.browserState); - _fullscreenDisabler = base::MakeUnique<ScopedFullscreenDisabler>( + _fullscreenDisabler = std::make_unique<ScopedFullscreenDisabler>( fullscreenController); } }
diff --git a/ios/chrome/browser/ui/payments/address_edit_coordinator_unittest.mm b/ios/chrome/browser/ui/payments/address_edit_coordinator_unittest.mm index af77409..2c64fd6f1 100644 --- a/ios/chrome/browser/ui/payments/address_edit_coordinator_unittest.mm +++ b/ios/chrome/browser/ui/payments/address_edit_coordinator_unittest.mm
@@ -4,9 +4,10 @@ #import "ios/chrome/browser/ui/payments/address_edit_coordinator.h" +#include <memory> + #include "base/logging.h" #include "base/mac/foundation_util.h" -#include "base/memory/ptr_util.h" #include "base/strings/utf_string_conversions.h" #include "base/test/ios/wait_util.h" #include "components/autofill/core/browser/autofill_profile.h" @@ -116,11 +117,11 @@ autofill::CountryNames::SetLocaleString("en-US"); personal_data_manager_.SetPrefService(pref_service()); - payment_request_ = base::MakeUnique<MockTestPaymentRequest>( + payment_request_ = std::make_unique<MockTestPaymentRequest>( payment_request_test_util::CreateTestWebPaymentRequest(), browser_state(), web_state(), &personal_data_manager_); - profile_comparator_ = base::MakeUnique<MockPaymentsProfileComparator>( + profile_comparator_ = std::make_unique<MockPaymentsProfileComparator>( payment_request_->GetApplicationLocale(), *payment_request_.get()); payment_request_->SetProfileComparator(profile_comparator_.get());
diff --git a/ios/chrome/browser/ui/payments/address_edit_mediator.mm b/ios/chrome/browser/ui/payments/address_edit_mediator.mm index dbbc9f1..0953794 100644 --- a/ios/chrome/browser/ui/payments/address_edit_mediator.mm +++ b/ios/chrome/browser/ui/payments/address_edit_mediator.mm
@@ -11,7 +11,6 @@ #include "base/callback.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/strings/sys_string_conversions.h" #include "base/values.h" #include "components/autofill/core/browser/address_i18n.h" @@ -292,7 +291,7 @@ // Queries the region names based on the selected country code. - (void)loadRegions { - _regionDataLoader = base::MakeUnique<RegionDataLoader>(self); + _regionDataLoader = std::make_unique<RegionDataLoader>(self); _regionDataLoader->LoadRegionData( base::SysNSStringToUTF8(self.selectedCountryCode), _paymentRequest->GetRegionDataLoader());
diff --git a/ios/chrome/browser/ui/payments/contact_info_edit_coordinator_unittest.mm b/ios/chrome/browser/ui/payments/contact_info_edit_coordinator_unittest.mm index f395bf2..31825e2 100644 --- a/ios/chrome/browser/ui/payments/contact_info_edit_coordinator_unittest.mm +++ b/ios/chrome/browser/ui/payments/contact_info_edit_coordinator_unittest.mm
@@ -4,9 +4,10 @@ #import "ios/chrome/browser/ui/payments/contact_info_edit_coordinator.h" +#include <memory> + #include "base/logging.h" #include "base/mac/foundation_util.h" -#include "base/memory/ptr_util.h" #include "base/strings/utf_string_conversions.h" #include "base/test/ios/wait_util.h" #include "components/autofill/core/browser/autofill_profile.h" @@ -105,11 +106,11 @@ personal_data_manager_.SetPrefService(pref_service()); - payment_request_ = base::MakeUnique<MockTestPaymentRequest>( + payment_request_ = std::make_unique<MockTestPaymentRequest>( payment_request_test_util::CreateTestWebPaymentRequest(), browser_state(), web_state(), &personal_data_manager_); - profile_comparator_ = base::MakeUnique<MockPaymentsProfileComparator>( + profile_comparator_ = std::make_unique<MockPaymentsProfileComparator>( payment_request_->GetApplicationLocale(), *payment_request_.get()); payment_request_->SetProfileComparator(profile_comparator_.get());
diff --git a/ios/chrome/browser/ui/payments/credit_card_edit_coordinator_unittest.mm b/ios/chrome/browser/ui/payments/credit_card_edit_coordinator_unittest.mm index 8ca124ad..4336165 100644 --- a/ios/chrome/browser/ui/payments/credit_card_edit_coordinator_unittest.mm +++ b/ios/chrome/browser/ui/payments/credit_card_edit_coordinator_unittest.mm
@@ -4,9 +4,10 @@ #import "ios/chrome/browser/ui/payments/credit_card_edit_coordinator.h" +#include <memory> + #include "base/logging.h" #include "base/mac/foundation_util.h" -#include "base/memory/ptr_util.h" #include "base/strings/utf_string_conversions.h" #include "base/test/ios/wait_util.h" #include "components/autofill/core/browser/credit_card.h" @@ -121,7 +122,7 @@ void SetUp() override { PaymentRequestUnitTestBase::SetUp(); - payment_request_ = base::MakeUnique<MockPaymentRequest>( + payment_request_ = std::make_unique<MockPaymentRequest>( payment_request_test_util::CreateTestWebPaymentRequest(), browser_state(), web_state(), &personal_data_manager_); }
diff --git a/ios/chrome/browser/ui/payments/payment_items_display_mediator_unittest.mm b/ios/chrome/browser/ui/payments/payment_items_display_mediator_unittest.mm index 407332d..e1c6780a 100644 --- a/ios/chrome/browser/ui/payments/payment_items_display_mediator_unittest.mm +++ b/ios/chrome/browser/ui/payments/payment_items_display_mediator_unittest.mm
@@ -6,6 +6,8 @@ #import <Foundation/Foundation.h> +#include <memory> + #include "base/mac/foundation_util.h" #import "ios/chrome/browser/payments/payment_request_unittest_base.h" #include "ios/chrome/browser/payments/test_payment_request.h" @@ -28,7 +30,7 @@ // Tests that the expected total item is created. TEST_F(PaymentRequestPaymentItemsDisplayMediatorTest, TotalItem) { payments::WebPaymentRequest web_payment_request; - web_payment_request.details.total = base::MakeUnique<payments::PaymentItem>(); + web_payment_request.details.total = std::make_unique<payments::PaymentItem>(); web_payment_request.details.total->label = "Total Cost"; web_payment_request.details.total->amount->value = "9.99"; web_payment_request.details.total->amount->currency = "USD"; @@ -50,7 +52,7 @@ // Tests that the expected line items are created. TEST_F(PaymentRequestPaymentItemsDisplayMediatorTest, LineItems) { payments::WebPaymentRequest web_payment_request; - web_payment_request.details.total = base::MakeUnique<payments::PaymentItem>(); + web_payment_request.details.total = std::make_unique<payments::PaymentItem>(); payments::TestPaymentRequest payment_request1(web_payment_request, browser_state(), web_state(),
diff --git a/ios/chrome/browser/ui/payments/payment_request_coordinator.mm b/ios/chrome/browser/ui/payments/payment_request_coordinator.mm index c2e1994..5ced1f3e 100644 --- a/ios/chrome/browser/ui/payments/payment_request_coordinator.mm +++ b/ios/chrome/browser/ui/payments/payment_request_coordinator.mm
@@ -4,8 +4,9 @@ #import "ios/chrome/browser/ui/payments/payment_request_coordinator.h" +#include <memory> + #include "base/json/json_reader.h" -#include "base/memory/ptr_util.h" #include "components/autofill/core/browser/autofill_profile.h" #include "components/autofill/core/browser/credit_card.h" #include "components/payments/core/autofill_payment_instrument.h" @@ -180,7 +181,7 @@ (base::WeakPtr<autofill::payments::FullCardRequest::ResultDelegate>) resultDelegate { _fullCardRequester = - base::MakeUnique<FullCardRequester>(_navigationController, _browserState); + std::make_unique<FullCardRequester>(_navigationController, _browserState); _fullCardRequester->GetFullCard(card, _autofillManager, resultDelegate); }
diff --git a/ios/chrome/browser/ui/payments/payment_request_debit_egtest.mm b/ios/chrome/browser/ui/payments/payment_request_debit_egtest.mm index 3134f78..4d63419e 100644 --- a/ios/chrome/browser/ui/payments/payment_request_debit_egtest.mm +++ b/ios/chrome/browser/ui/payments/payment_request_debit_egtest.mm
@@ -5,7 +5,6 @@ #include <memory> #include <vector> -#include "base/memory/ptr_util.h" #include "base/strings/sys_string_conversions.h" #include "components/autofill/core/browser/autofill_profile.h" #include "components/autofill/core/browser/autofill_test_utils.h" @@ -68,7 +67,7 @@ - (void)setUp { [super setUp]; - _profile = base::MakeUnique<autofill::AutofillProfile>( + _profile = std::make_unique<autofill::AutofillProfile>( autofill::test::GetFullProfile()); [self addAutofillProfile:*_profile]; }
diff --git a/ios/chrome/browser/ui/payments/payment_request_egtest_base.mm b/ios/chrome/browser/ui/payments/payment_request_egtest_base.mm index 7b746ae0..7b2e619 100644 --- a/ios/chrome/browser/ui/payments/payment_request_egtest_base.mm +++ b/ios/chrome/browser/ui/payments/payment_request_egtest_base.mm
@@ -9,7 +9,6 @@ #include "base/feature_list.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/strings/stringprintf.h" #include "base/strings/sys_string_conversions.h" #include "components/autofill/core/browser/autofill_profile.h" @@ -108,7 +107,7 @@ - (void)addServerCreditCard:(const autofill::CreditCard&)card { DCHECK(card.record_type() != autofill::CreditCard::LOCAL_CARD); [self personalDataManager]->AddServerCreditCardForTest( - base::MakeUnique<autofill::CreditCard>(card)); + std::make_unique<autofill::CreditCard>(card)); } - (payments::PaymentRequestCache::PaymentRequestSet&)paymentRequestsForWebState:
diff --git a/ios/chrome/browser/ui/payments/payment_request_manager.mm b/ios/chrome/browser/ui/payments/payment_request_manager.mm index cc61f55..0d39745 100644 --- a/ios/chrome/browser/ui/payments/payment_request_manager.mm +++ b/ios/chrome/browser/ui/payments/payment_request_manager.mm
@@ -17,7 +17,6 @@ #include "base/logging.h" #import "base/mac/bind_objc_block.h" #include "base/mac/foundation_util.h" -#include "base/memory/ptr_util.h" #include "base/strings/string16.h" #include "base/strings/sys_string_conversions.h" #include "base/strings/utf_string_conversions.h" @@ -496,7 +495,7 @@ } return _paymentRequestCache->AddPaymentRequest( - _activeWebState, base::MakeUnique<payments::PaymentRequest>( + _activeWebState, std::make_unique<payments::PaymentRequest>( webPaymentRequest, _browserState, _activeWebState, _personalDataManager, self)); }
diff --git a/ios/chrome/browser/ui/payments/shipping_option_selection_mediator_unittest.mm b/ios/chrome/browser/ui/payments/shipping_option_selection_mediator_unittest.mm index f3f80bf..10c595f 100644 --- a/ios/chrome/browser/ui/payments/shipping_option_selection_mediator_unittest.mm +++ b/ios/chrome/browser/ui/payments/shipping_option_selection_mediator_unittest.mm
@@ -4,6 +4,8 @@ #import "ios/chrome/browser/ui/payments/shipping_option_selection_mediator.h" +#include <memory> + #include "base/mac/foundation_util.h" #include "components/payments/core/payment_details.h" #include "components/payments/core/payment_shipping_option.h" @@ -27,7 +29,7 @@ // Returns a PaymentDetails instance with two unselected shipping options. payments::PaymentDetails CreateDetailsWithUnselectedShippingOptions() { payments::PaymentDetails details; - details.total = base::MakeUnique<payments::PaymentItem>(); + details.total = std::make_unique<payments::PaymentItem>(); details.total->label = "Total Cost"; details.total->amount->value = "9.99"; details.total->amount->currency = "USD";
diff --git a/ios/chrome/browser/ui/reading_list/reading_list_collection_view_controller_unittest.mm b/ios/chrome/browser/ui/reading_list/reading_list_collection_view_controller_unittest.mm index f730a90..09e1b07 100644 --- a/ios/chrome/browser/ui/reading_list/reading_list_collection_view_controller_unittest.mm +++ b/ios/chrome/browser/ui/reading_list/reading_list_collection_view_controller_unittest.mm
@@ -4,10 +4,10 @@ #import "ios/chrome/browser/ui/reading_list/reading_list_collection_view_controller.h" +#include <memory> #include <unordered_set> #import "base/mac/foundation_util.h" -#include "base/memory/ptr_util.h" #include "base/strings/sys_string_conversions.h" #include "base/time/default_clock.h" #include "components/favicon/core/large_icon_service.h" @@ -58,7 +58,7 @@ .WillRepeatedly(PostReply<5>(favicon_base::FaviconRawBitmapResult())); reading_list_model_.reset(new ReadingListModelImpl( - nullptr, nullptr, base::MakeUnique<base::DefaultClock>())); + nullptr, nullptr, std::make_unique<base::DefaultClock>())); large_icon_service_.reset(new favicon::LargeIconService( &mock_favicon_service_, /*image_fetcher=*/nullptr)); mediator_ =
diff --git a/ios/chrome/browser/ui/reading_list/reading_list_coordinator_unittest.mm b/ios/chrome/browser/ui/reading_list/reading_list_coordinator_unittest.mm index 066b6ff8..a9e9f70 100644 --- a/ios/chrome/browser/ui/reading_list/reading_list_coordinator_unittest.mm +++ b/ios/chrome/browser/ui/reading_list/reading_list_coordinator_unittest.mm
@@ -4,7 +4,8 @@ #import "ios/chrome/browser/ui/reading_list/reading_list_coordinator.h" -#include "base/memory/ptr_util.h" +#include <memory> + #include "base/time/default_clock.h" #include "components/favicon/core/large_icon_service.h" #include "components/favicon/core/test/mock_favicon_service.h" @@ -114,7 +115,7 @@ browser_state_ = builder.Build(); reading_list_model_.reset(new ReadingListModelImpl( - nullptr, nullptr, base::MakeUnique<base::DefaultClock>())); + nullptr, nullptr, std::make_unique<base::DefaultClock>())); large_icon_service_.reset(new favicon::LargeIconService( &mock_favicon_service_, /*image_fetcher=*/nullptr)); mediator_ = @@ -149,7 +150,7 @@ static std::unique_ptr<KeyedService> BuildFeatureEngagementMockTracker( web::BrowserState*) { - return base::MakeUnique<feature_engagement::test::MockTracker>(); + return std::make_unique<feature_engagement::test::MockTracker>(); } private:
diff --git a/ios/chrome/browser/ui/reading_list/reading_list_egtest.mm b/ios/chrome/browser/ui/reading_list/reading_list_egtest.mm index caf67d0..37e756b 100644 --- a/ios/chrome/browser/ui/reading_list/reading_list_egtest.mm +++ b/ios/chrome/browser/ui/reading_list/reading_list_egtest.mm
@@ -6,8 +6,9 @@ #import <UIKit/UIKit.h> #import <XCTest/XCTest.h> +#include <memory> + #include "base/ios/ios_util.h" -#include "base/memory/ptr_util.h" #include "base/strings/sys_string_conversions.h" #include "base/strings/utf_string_conversions.h" #include "base/test/ios/wait_util.h" @@ -459,8 +460,8 @@ #endif - (void)MAYBE_testSavingToReadingListAndLoadDistilled { auto network_change_disabler = - base::MakeUnique<net::NetworkChangeNotifier::DisableForTest>(); - auto wifi_network = base::MakeUnique<WifiNetworkChangeNotifier>(); + std::make_unique<net::NetworkChangeNotifier::DisableForTest>(); + auto wifi_network = std::make_unique<WifiNetworkChangeNotifier>(); web::test::SetUpSimpleHttpServer(ResponsesForDistillationServer()); GURL distillablePageURL(web::test::HttpServer::MakeUrl(kDistillableURL)); GURL nonDistillablePageURL( @@ -515,8 +516,8 @@ #endif - (void)MAYBE_testSavingToReadingListAndLoadNormal { auto network_change_disabler = - base::MakeUnique<net::NetworkChangeNotifier::DisableForTest>(); - auto wifi_network = base::MakeUnique<WifiNetworkChangeNotifier>(); + std::make_unique<net::NetworkChangeNotifier::DisableForTest>(); + auto wifi_network = std::make_unique<WifiNetworkChangeNotifier>(); web::test::SetUpSimpleHttpServer(ResponsesForDistillationServer()); web::test::HttpServer& server = web::test::HttpServer::GetSharedInstance(); std::string pageTitle(kDistillableTitle); @@ -562,8 +563,8 @@ #endif - (void)MAYBE_testSavingToReadingListAndLoadNoNetwork { auto network_change_disabler = - base::MakeUnique<net::NetworkChangeNotifier::DisableForTest>(); - auto wifi_network = base::MakeUnique<WifiNetworkChangeNotifier>(); + std::make_unique<net::NetworkChangeNotifier::DisableForTest>(); + auto wifi_network = std::make_unique<WifiNetworkChangeNotifier>(); web::test::SetUpSimpleHttpServer(ResponsesForDistillationServer()); std::string pageTitle(kDistillableTitle); web::test::HttpServer& server = web::test::HttpServer::GetSharedInstance(); @@ -614,8 +615,8 @@ #endif - (void)MAYBE_testSavingToReadingListAndLoadBadNetwork { auto network_change_disabler = - base::MakeUnique<net::NetworkChangeNotifier::DisableForTest>(); - auto wifi_network = base::MakeUnique<WifiNetworkChangeNotifier>(); + std::make_unique<net::NetworkChangeNotifier::DisableForTest>(); + auto wifi_network = std::make_unique<WifiNetworkChangeNotifier>(); web::test::SetUpSimpleHttpServer(ResponsesForDistillationServer()); std::string pageTitle(kDistillableTitle); // Open http://potato @@ -632,8 +633,8 @@ AssertEntryVisible(pageTitle); WaitForDistillation(); - web::test::SetUpHttpServer(base::MakeUnique<web::DelayedResponseProvider>( - base::MakeUnique<HtmlResponseProvider>(ResponsesForDistillationServer()), + web::test::SetUpHttpServer(std::make_unique<web::DelayedResponseProvider>( + std::make_unique<HtmlResponseProvider>(ResponsesForDistillationServer()), kDelayForSlowWebServer)); // Long press the entry, and open it offline. TapEntry(pageTitle);
diff --git a/ios/chrome/browser/ui/reading_list/reading_list_mediator_unittest.mm b/ios/chrome/browser/ui/reading_list/reading_list_mediator_unittest.mm index 811ed74..3c4da76 100644 --- a/ios/chrome/browser/ui/reading_list/reading_list_mediator_unittest.mm +++ b/ios/chrome/browser/ui/reading_list/reading_list_mediator_unittest.mm
@@ -4,7 +4,8 @@ #import "ios/chrome/browser/ui/reading_list/reading_list_mediator.h" -#include "base/memory/ptr_util.h" +#include <memory> + #include "base/strings/sys_string_conversions.h" #include "base/test/simple_test_clock.h" #include "components/favicon/core/large_icon_service.h" @@ -30,9 +31,9 @@ public: ReadingListMediatorTest() { std::unique_ptr<base::SimpleTestClock> clock = - base::MakeUnique<base::SimpleTestClock>(); + std::make_unique<base::SimpleTestClock>(); clock_ = clock.get(); - model_ = base::MakeUnique<ReadingListModelImpl>(nullptr, nullptr, + model_ = std::make_unique<ReadingListModelImpl>(nullptr, nullptr, std::move(clock)); EXPECT_CALL(mock_favicon_service_, GetLargestRawFaviconForPageURL(_, _, _, _, _))
diff --git a/ios/chrome/browser/ui/settings/passphrase_collection_view_controller_test.mm b/ios/chrome/browser/ui/settings/passphrase_collection_view_controller_test.mm index de141a38..5059363 100644 --- a/ios/chrome/browser/ui/settings/passphrase_collection_view_controller_test.mm +++ b/ios/chrome/browser/ui/settings/passphrase_collection_view_controller_test.mm
@@ -8,7 +8,6 @@ #include <memory> -#include "base/memory/ptr_util.h" #include "base/message_loop/message_loop.h" #include "base/strings/sys_string_conversions.h" #include "components/browser_sync/profile_sync_service_mock.h" @@ -53,7 +52,7 @@ browser_sync::ProfileSyncService::InitParams init_params = CreateProfileSyncServiceParamsForTest( nullptr, ios::ChromeBrowserState::FromBrowserState(context)); - return base::MakeUnique<NiceMock<browser_sync::ProfileSyncServiceMock>>( + return std::make_unique<NiceMock<browser_sync::ProfileSyncServiceMock>>( &init_params); }
diff --git a/ios/chrome/browser/ui/settings/save_passwords_collection_view_controller.mm b/ios/chrome/browser/ui/settings/save_passwords_collection_view_controller.mm index 046d575..ab53f18 100644 --- a/ios/chrome/browser/ui/settings/save_passwords_collection_view_controller.mm +++ b/ios/chrome/browser/ui/settings/save_passwords_collection_view_controller.mm
@@ -10,7 +10,6 @@ #include "base/logging.h" #include "base/mac/foundation_util.h" -#include "base/memory/ptr_util.h" #include "base/numerics/safe_conversions.h" #include "base/strings/sys_string_conversions.h" #include "base/strings/utf_string_conversions.h" @@ -446,7 +445,7 @@ (const std::vector<std::unique_ptr<autofill::PasswordForm>>&)result { for (auto it = result.begin(); it != result.end(); ++it) { // PasswordForm is needed when user wants to delete the site/password. - auto form = base::MakeUnique<autofill::PasswordForm>(**it); + auto form = std::make_unique<autofill::PasswordForm>(**it); if (form->blacklisted_by_user) blacklistedForms_.push_back(std::move(form)); else
diff --git a/ios/chrome/browser/ui/settings/save_passwords_collection_view_controller_unittest.mm b/ios/chrome/browser/ui/settings/save_passwords_collection_view_controller_unittest.mm index db04991..dc0016f 100644 --- a/ios/chrome/browser/ui/settings/save_passwords_collection_view_controller_unittest.mm +++ b/ios/chrome/browser/ui/settings/save_passwords_collection_view_controller_unittest.mm
@@ -8,7 +8,6 @@ #include <utility> #include "base/compiler_specific.h" -#include "base/memory/ptr_util.h" #include "base/strings/utf_string_conversions.h" #include "base/test/scoped_feature_list.h" #include "components/autofill/core/common/password_form.h" @@ -91,7 +90,7 @@ // Creates and adds a saved password form. void AddSavedForm1() { - auto form = base::MakeUnique<autofill::PasswordForm>(); + auto form = std::make_unique<autofill::PasswordForm>(); form->origin = GURL("http://www.example.com/accounts/LoginAuth"); form->action = GURL("http://www.example.com/accounts/Login"); form->username_element = base::ASCIIToUTF16("Email"); @@ -108,7 +107,7 @@ // Creates and adds a saved password form. void AddSavedForm2() { - auto form = base::MakeUnique<autofill::PasswordForm>(); + auto form = std::make_unique<autofill::PasswordForm>(); form->origin = GURL("http://www.example2.com/accounts/LoginAuth"); form->action = GURL("http://www.example2.com/accounts/Login"); form->username_element = base::ASCIIToUTF16("Email"); @@ -126,7 +125,7 @@ // Creates and adds a blacklisted site form to never offer to save // user's password to those sites. void AddBlacklistedForm1() { - auto form = base::MakeUnique<autofill::PasswordForm>(); + auto form = std::make_unique<autofill::PasswordForm>(); form->origin = GURL("http://www.secret.com/login"); form->action = GURL("http://www.secret.com/action"); form->username_element = base::ASCIIToUTF16("email"); @@ -144,7 +143,7 @@ // Creates and adds another blacklisted site form to never offer to save // user's password to those sites. void AddBlacklistedForm2() { - auto form = base::MakeUnique<autofill::PasswordForm>(); + auto form = std::make_unique<autofill::PasswordForm>(); form->origin = GURL("http://www.secret2.com/login"); form->action = GURL("http://www.secret2.com/action"); form->username_element = base::ASCIIToUTF16("email");
diff --git a/ios/chrome/browser/ui/settings/settings_egtest.mm b/ios/chrome/browser/ui/settings/settings_egtest.mm index e7d51d0..0ef7e04 100644 --- a/ios/chrome/browser/ui/settings/settings_egtest.mm +++ b/ios/chrome/browser/ui/settings/settings_egtest.mm
@@ -6,11 +6,11 @@ #import <UIKit/UIKit.h> #import <XCTest/XCTest.h> #include <map> +#include <memory> #include "base/bind.h" #import "base/mac/bind_objc_block.h" #include "base/mac/foundation_util.h" -#include "base/memory/ptr_util.h" #include "base/strings/sys_string_conversions.h" #include "components/browsing_data/core/pref_names.h" #include "components/metrics/metrics_pref_names.h" @@ -167,7 +167,7 @@ channel_id_service->GetChannelIDStore(); base::Time now = base::Time::Now(); channel_id_store->SetChannelID( - base::MakeUnique<net::ChannelIDStore::ChannelID>( + std::make_unique<net::ChannelIDStore::ChannelID>( kTestOrigin1, now, crypto::ECPrivateKey::Create())); }));
diff --git a/ios/chrome/browser/ui/settings/settings_navigation_controller_unittest.mm b/ios/chrome/browser/ui/settings/settings_navigation_controller_unittest.mm index 6f2fa68..d414aa4e 100644 --- a/ios/chrome/browser/ui/settings/settings_navigation_controller_unittest.mm +++ b/ios/chrome/browser/ui/settings/settings_navigation_controller_unittest.mm
@@ -8,7 +8,6 @@ #include <memory> -#include "base/memory/ptr_util.h" #include "components/search_engines/template_url_service.h" #include "ios/chrome/browser/browser_state/test_chrome_browser_state.h" #include "ios/chrome/browser/browser_state/test_chrome_browser_state_manager.h" @@ -41,7 +40,7 @@ protected: SettingsNavigationControllerTest() : scoped_browser_state_manager_( - base::MakeUnique<TestChromeBrowserStateManager>(base::FilePath())) { + std::make_unique<TestChromeBrowserStateManager>(base::FilePath())) { TestChromeBrowserState::Builder test_cbs_builder; test_cbs_builder.AddTestingFactory( AuthenticationServiceFactory::GetInstance(),
diff --git a/ios/chrome/browser/ui/settings/sync_encryption_collection_view_controller.mm b/ios/chrome/browser/ui/settings/sync_encryption_collection_view_controller.mm index ce52220..719f2502 100644 --- a/ios/chrome/browser/ui/settings/sync_encryption_collection_view_controller.mm +++ b/ios/chrome/browser/ui/settings/sync_encryption_collection_view_controller.mm
@@ -4,7 +4,8 @@ #import "ios/chrome/browser/ui/settings/sync_encryption_collection_view_controller.h" -#include "base/memory/ptr_util.h" +#include <memory> + #include "base/strings/sys_string_conversions.h" #include "components/browser_sync/profile_sync_service.h" #include "components/google/core/browser/google_util.h" @@ -75,7 +76,7 @@ IOSChromeProfileSyncServiceFactory::GetForBrowserState(_browserState); _isUsingSecondaryPassphrase = syncService->IsEngineInitialized() && syncService->IsUsingSecondaryPassphrase(); - _syncObserver = base::MakeUnique<SyncObserverBridge>(self, syncService); + _syncObserver = std::make_unique<SyncObserverBridge>(self, syncService); // TODO(crbug.com/764578): -loadModel should not be called from // initializer. A possible fix is to move this call to -viewDidLoad. [self loadModel];
diff --git a/ios/chrome/browser/ui/settings/sync_encryption_collection_view_controller_unittest.mm b/ios/chrome/browser/ui/settings/sync_encryption_collection_view_controller_unittest.mm index 08a13aa..a7eb0fd 100644 --- a/ios/chrome/browser/ui/settings/sync_encryption_collection_view_controller_unittest.mm +++ b/ios/chrome/browser/ui/settings/sync_encryption_collection_view_controller_unittest.mm
@@ -7,7 +7,6 @@ #include <memory> #include "base/compiler_specific.h" -#include "base/memory/ptr_util.h" #include "components/browser_sync/profile_sync_service_mock.h" #include "components/strings/grit/components_strings.h" #include "ios/chrome/browser/browser_state/test_chrome_browser_state.h" @@ -36,7 +35,7 @@ browser_sync::ProfileSyncService::InitParams init_params = CreateProfileSyncServiceParamsForTest( nullptr, ios::ChromeBrowserState::FromBrowserState(context)); - return base::MakeUnique<NiceMock<browser_sync::ProfileSyncServiceMock>>( + return std::make_unique<NiceMock<browser_sync::ProfileSyncServiceMock>>( &init_params); }
diff --git a/ios/chrome/browser/ui/settings/sync_encryption_passphrase_collection_view_controller_unittest.mm b/ios/chrome/browser/ui/settings/sync_encryption_passphrase_collection_view_controller_unittest.mm index ece8f578..7daec67 100644 --- a/ios/chrome/browser/ui/settings/sync_encryption_passphrase_collection_view_controller_unittest.mm +++ b/ios/chrome/browser/ui/settings/sync_encryption_passphrase_collection_view_controller_unittest.mm
@@ -9,7 +9,6 @@ #include <memory> #include "base/compiler_specific.h" -#include "base/memory/ptr_util.h" #include "base/message_loop/message_loop.h" #include "base/strings/sys_string_conversions.h" #include "components/browser_sync/profile_sync_service_mock.h" @@ -52,7 +51,7 @@ syncer::SyncService* sync_service = IOSChromeProfileSyncServiceFactory::GetForBrowserState( chrome_browser_state); - return base::MakeUnique<SyncSetupServiceMock>( + return std::make_unique<SyncSetupServiceMock>( sync_service, chrome_browser_state->GetPrefs()); }
diff --git a/ios/chrome/browser/ui/settings/sync_settings_collection_view_controller_unittest.mm b/ios/chrome/browser/ui/settings/sync_settings_collection_view_controller_unittest.mm index 62d95c36..ac44e08 100644 --- a/ios/chrome/browser/ui/settings/sync_settings_collection_view_controller_unittest.mm +++ b/ios/chrome/browser/ui/settings/sync_settings_collection_view_controller_unittest.mm
@@ -7,7 +7,6 @@ #include <memory> #import "base/mac/foundation_util.h" -#include "base/memory/ptr_util.h" #include "base/strings/sys_string_conversions.h" #include "components/browser_sync/profile_sync_service_mock.h" #include "components/google/core/browser/google_util.h" @@ -95,7 +94,7 @@ browser_sync::ProfileSyncService* sync_service = IOSChromeProfileSyncServiceFactory::GetForBrowserState( chrome_browser_state); - return base::MakeUnique<NiceMock<SyncSetupServiceMock>>( + return std::make_unique<NiceMock<SyncSetupServiceMock>>( sync_service, chrome_browser_state->GetPrefs()); } @@ -106,7 +105,7 @@ browser_sync::ProfileSyncService* sync_service = IOSChromeProfileSyncServiceFactory::GetForBrowserState( chrome_browser_state); - return base::MakeUnique<NiceMock<SyncSetupServiceMockThatSucceeds>>( + return std::make_unique<NiceMock<SyncSetupServiceMockThatSucceeds>>( sync_service, chrome_browser_state->GetPrefs()); } @@ -117,7 +116,7 @@ browser_sync::ProfileSyncService* sync_service = IOSChromeProfileSyncServiceFactory::GetForBrowserState( chrome_browser_state); - return base::MakeUnique<NiceMock<SyncSetupServiceMockThatFails>>( + return std::make_unique<NiceMock<SyncSetupServiceMockThatFails>>( sync_service, chrome_browser_state->GetPrefs()); } @@ -126,7 +125,7 @@ browser_sync::ProfileSyncService::InitParams init_params = CreateProfileSyncServiceParamsForTest( nullptr, ios::ChromeBrowserState::FromBrowserState(context)); - return base::MakeUnique<NiceMock<browser_sync::ProfileSyncServiceMock>>( + return std::make_unique<NiceMock<browser_sync::ProfileSyncServiceMock>>( &init_params); }
diff --git a/ios/chrome/browser/ui/settings/utils/pref_backed_boolean_unittest.mm b/ios/chrome/browser/ui/settings/utils/pref_backed_boolean_unittest.mm index 2584c24..aa8e615 100644 --- a/ios/chrome/browser/ui/settings/utils/pref_backed_boolean_unittest.mm +++ b/ios/chrome/browser/ui/settings/utils/pref_backed_boolean_unittest.mm
@@ -4,9 +4,9 @@ #import "ios/chrome/browser/ui/settings/utils/pref_backed_boolean.h" +#include <memory> #include <utility> -#include "base/memory/ptr_util.h" #include "base/values.h" #include "components/prefs/pref_registry_simple.h" #include "components/prefs/testing_pref_service.h" @@ -36,7 +36,7 @@ bool GetPref() { return pref_service_.GetBoolean(kTestSwitchPref); } void SetPref(bool value) { - auto booleanValue = base::MakeUnique<base::Value>(value); + auto booleanValue = std::make_unique<base::Value>(value); pref_service_.SetUserPref(kTestSwitchPref, std::move(booleanValue)); }
diff --git a/ios/chrome/browser/ui/side_swipe/side_swipe_controller.mm b/ios/chrome/browser/ui/side_swipe/side_swipe_controller.mm index 2da738bb..473fd5a 100644 --- a/ios/chrome/browser/ui/side_swipe/side_swipe_controller.mm +++ b/ios/chrome/browser/ui/side_swipe/side_swipe_controller.mm
@@ -7,7 +7,6 @@ #include <memory> #include "base/feature_list.h" -#include "base/memory/ptr_util.h" #include "base/scoped_observer.h" #include "components/reading_list/core/reading_list_model.h" #import "ios/chrome/browser/browser_state/chrome_browser_state.h" @@ -322,7 +321,7 @@ if (gesture.state == UIGestureRecognizerStateBegan) { if (base::FeatureList::IsEnabled(fullscreen::features::kNewFullscreen)) { // Disable fullscreen while the side swipe gesture is occurring. - fullscreenDisabler_ = base::MakeUnique<ScopedFullscreenDisabler>( + fullscreenDisabler_ = std::make_unique<ScopedFullscreenDisabler>( FullscreenControllerFactory::GetInstance()->GetForBrowserState( browserState_)); } else {
diff --git a/ios/chrome/browser/ui/static_content/static_html_view_controller_unittest.mm b/ios/chrome/browser/ui/static_content/static_html_view_controller_unittest.mm index e0316299..0687cee 100644 --- a/ios/chrome/browser/ui/static_content/static_html_view_controller_unittest.mm +++ b/ios/chrome/browser/ui/static_content/static_html_view_controller_unittest.mm
@@ -7,7 +7,6 @@ #include <memory> #import "base/mac/foundation_util.h" -#include "base/memory/ptr_util.h" #import "base/test/ios/wait_util.h" #include "ios/chrome/browser/browser_state/test_chrome_browser_state.h" #import "ios/chrome/browser/ui/url_loader.h" @@ -99,7 +98,7 @@ class StaticHtmlViewControllerTest : public PlatformTest { public: StaticHtmlViewControllerTest() - : web_client_(base::MakeUnique<web::TestWebClient>()) {} + : web_client_(std::make_unique<web::TestWebClient>()) {} protected: void SetUp() override {
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_model.mm b/ios/chrome/browser/ui/tab_switcher/tab_switcher_model.mm index 964739d..ad6b9cc 100644 --- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_model.mm +++ b/ios/chrome/browser/ui/tab_switcher/tab_switcher_model.mm
@@ -6,7 +6,6 @@ #include <memory> -#include "base/memory/ptr_util.h" #include "components/browser_sync/profile_sync_service.h" #include "components/sessions/core/session_id.h" #include "components/signin/core/browser/signin_manager.h" @@ -196,14 +195,14 @@ NOTREACHED(); break; } - return base::MakeUnique<TabModelSnapshot>(tm); + return std::make_unique<TabModelSnapshot>(tm); } - (std::unique_ptr<const synced_sessions::DistantSession>)distantSessionForTag: (std::string const&)tag { syncer::SyncService* syncService = IOSChromeProfileSyncServiceFactory::GetForBrowserState(_browserState); - return base::MakeUnique<synced_sessions::DistantSession>(syncService, tag); + return std::make_unique<synced_sessions::DistantSession>(syncService, tag); } - (std::string const&)tagOfDistantSessionAtIndex:(int)index {
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_model_unittest.mm b/ios/chrome/browser/ui/tab_switcher/tab_switcher_model_unittest.mm index 18c6bca..af2bf4ce 100644 --- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_model_unittest.mm +++ b/ios/chrome/browser/ui/tab_switcher/tab_switcher_model_unittest.mm
@@ -4,7 +4,8 @@ #include "ios/chrome/browser/ui/tab_switcher/tab_switcher_model.h" -#include "base/memory/ptr_util.h" +#include <memory> + #include "base/strings/utf_string_conversions.h" #include "ios/chrome/browser/browser_state/test_chrome_browser_state.h" #include "ios/chrome/browser/ui/ntp/recent_tabs/synced_sessions.h" @@ -121,7 +122,7 @@ std::unique_ptr<synced_sessions::SyncedSessions> syncedSessionsFromTestData( LightSS const& lightSyncedSessions) { - auto syncedSessions = base::MakeUnique<synced_sessions::SyncedSessions>(); + auto syncedSessions = std::make_unique<synced_sessions::SyncedSessions>(); for (auto& lightdistantSession : lightSyncedSessions) { AddDetailedSessionToSessions(*syncedSessions, lightdistantSession.tag, lightdistantSession.distantTabs); @@ -135,11 +136,11 @@ std::vector<LightDT> const& light_distant_tabs) { // Create a new DistantSession and initialize it with |sessionTag| and // |tabTags|. - auto distant_session = base::MakeUnique<synced_sessions::DistantSession>(); + auto distant_session = std::make_unique<synced_sessions::DistantSession>(); distant_session->tag = session_tag; for (auto const& light_distant_tab : light_distant_tabs) { - auto temp_tab = base::MakeUnique<synced_sessions::DistantTab>(); + auto temp_tab = std::make_unique<synced_sessions::DistantTab>(); temp_tab->virtual_url = GURL(light_distant_tab.url); temp_tab->title = base::ASCIIToUTF16(light_distant_tab.title); distant_session->tabs.push_back(std::move(temp_tab));
diff --git a/ios/chrome/browser/ui/tabs/tab_strip_controller.mm b/ios/chrome/browser/ui/tabs/tab_strip_controller.mm index 017628e4..01b30570 100644 --- a/ios/chrome/browser/ui/tabs/tab_strip_controller.mm +++ b/ios/chrome/browser/ui/tabs/tab_strip_controller.mm
@@ -5,12 +5,12 @@ #import "ios/chrome/browser/ui/tabs/tab_strip_controller.h" #include <cmath> +#include <memory> #include <vector> #include "base/i18n/rtl.h" #include "base/mac/bundle_locations.h" #include "base/mac/foundation_util.h" -#include "base/memory/ptr_util.h" #include "base/metrics/user_metrics.h" #include "base/metrics/user_metrics_action.h" #include "base/strings/sys_string_conversions.h" @@ -731,7 +731,7 @@ // Disable fullscreen during drags. if (base::FeatureList::IsEnabled(fullscreen::features::kNewFullscreen)) { - _fullscreenDisabler = base::MakeUnique<ScopedFullscreenDisabler>( + _fullscreenDisabler = std::make_unique<ScopedFullscreenDisabler>( FullscreenControllerFactory::GetInstance()->GetForBrowserState( _tabModel.browserState)); }
diff --git a/ios/chrome/browser/ui/toolbar/clean/toolbar_coordinator.mm b/ios/chrome/browser/ui/toolbar/clean/toolbar_coordinator.mm index 551288a..a3d0f2f 100644 --- a/ios/chrome/browser/ui/toolbar/clean/toolbar_coordinator.mm +++ b/ios/chrome/browser/ui/toolbar/clean/toolbar_coordinator.mm
@@ -4,8 +4,9 @@ #import "ios/chrome/browser/ui/toolbar/clean/toolbar_coordinator.h" +#include <memory> + #include "base/mac/foundation_util.h" -#include "base/memory/ptr_util.h" #include "base/metrics/user_metrics.h" #include "base/metrics/user_metrics_action.h" #include "base/strings/sys_string_conversions.h" @@ -134,7 +135,7 @@ // TODO(crbug.com/785253): Move this to the LocationBarCoordinator once it is // created. - _locationBar = base::MakeUnique<LocationBarControllerImpl>( + _locationBar = std::make_unique<LocationBarControllerImpl>( self.locationBarCoordinator.locationBarView, self.browserState, self, self.dispatcher); self.locationBarCoordinator.locationBarController = _locationBar.get(); @@ -163,7 +164,7 @@ if (base::FeatureList::IsEnabled(fullscreen::features::kNewFullscreen)) { _fullscreenObserver = - base::MakeUnique<FullscreenUIUpdater>(self.toolbarViewController); + std::make_unique<FullscreenUIUpdater>(self.toolbarViewController); FullscreenControllerFactory::GetInstance() ->GetForBrowserState(self.browserState) ->AddObserver(_fullscreenObserver.get());
diff --git a/ios/chrome/browser/ui/toolbar/clean/toolbar_mediator_unittest.mm b/ios/chrome/browser/ui/toolbar/clean/toolbar_mediator_unittest.mm index 358f2ecb..243f223 100644 --- a/ios/chrome/browser/ui/toolbar/clean/toolbar_mediator_unittest.mm +++ b/ios/chrome/browser/ui/toolbar/clean/toolbar_mediator_unittest.mm
@@ -4,7 +4,8 @@ #import "ios/chrome/browser/ui/toolbar/clean/toolbar_mediator.h" -#include "base/memory/ptr_util.h" +#include <memory> + #include "base/strings/sys_string_conversions.h" #include "components/bookmarks/browser/bookmark_model.h" #include "components/bookmarks/browser/bookmark_node.h" @@ -64,7 +65,7 @@ chrome_browser_state_.get()); bookmarks::test::WaitForBookmarkModelToLoad(bookmark_model_); std::unique_ptr<ToolbarTestNavigationManager> navigation_manager = - base::MakeUnique<ToolbarTestNavigationManager>(); + std::make_unique<ToolbarTestNavigationManager>(); navigation_manager_ = navigation_manager.get(); test_web_state_ = std::make_unique<ToolbarTestWebState>(); test_web_state_->SetNavigationManager(std::move(navigation_manager)); @@ -83,7 +84,7 @@ protected: web::TestWebThreadBundle thread_bundle_; void SetUpWebStateList() { - web_state_list_ = base::MakeUnique<WebStateList>(&web_state_list_delegate_); + web_state_list_ = std::make_unique<WebStateList>(&web_state_list_delegate_); web_state_list_->InsertWebState(0, std::move(test_web_state_), WebStateList::INSERT_FORCE_INDEX, WebStateOpener()); @@ -102,7 +103,7 @@ } void InsertNewWebState(int index) { - auto web_state = base::MakeUnique<web::TestWebState>(); + auto web_state = std::make_unique<web::TestWebState>(); GURL url("http://test/" + std::to_string(index)); web_state->SetCurrentURL(url); web_state_list_->InsertWebState(index, std::move(web_state),
diff --git a/ios/chrome/browser/ui/toolbar/legacy_toolbar_coordinator.mm b/ios/chrome/browser/ui/toolbar/legacy_toolbar_coordinator.mm index 0cd4382..d39bf1f 100644 --- a/ios/chrome/browser/ui/toolbar/legacy_toolbar_coordinator.mm +++ b/ios/chrome/browser/ui/toolbar/legacy_toolbar_coordinator.mm
@@ -4,7 +4,6 @@ #import "ios/chrome/browser/ui/toolbar/legacy_toolbar_coordinator.h" -#include "base/memory/ptr_util.h" #import "ios/chrome/browser/tabs/tab_model.h" #import "ios/chrome/browser/ui/commands/toolbar_commands.h" #import "ios/chrome/browser/ui/fullscreen/fullscreen_controller.h" @@ -307,7 +306,7 @@ self.browserState); DCHECK(fullscreenController); _fullscreenUpdater = - base::MakeUnique<FullscreenUIUpdater>(self.toolbarController); + std::make_unique<FullscreenUIUpdater>(self.toolbarController); fullscreenController->AddObserver(_fullscreenUpdater.get()); }
diff --git a/ios/chrome/browser/ui/toolbar/legacy_toolbar_ui_updater.mm b/ios/chrome/browser/ui/toolbar/legacy_toolbar_ui_updater.mm index 8e9c50f..92688a99 100644 --- a/ios/chrome/browser/ui/toolbar/legacy_toolbar_ui_updater.mm +++ b/ios/chrome/browser/ui/toolbar/legacy_toolbar_ui_updater.mm
@@ -4,8 +4,9 @@ #import "ios/chrome/browser/ui/toolbar/legacy_toolbar_ui_updater.h" +#include <memory> + #include "base/logging.h" -#include "base/memory/ptr_util.h" #import "ios/chrome/browser/ui/toolbar/toolbar_owner.h" #import "ios/chrome/browser/ui/toolbar/toolbar_ui.h" #import "ios/chrome/browser/web_state_list/web_state_list.h" @@ -69,7 +70,7 @@ } _webState = webState; if (_webState) { - _webStateObserver = base::MakeUnique<web::WebStateObserverBridge>(self); + _webStateObserver = std::make_unique<web::WebStateObserverBridge>(self); _webState->AddObserver(_webStateObserver.get()); [self updateState]; } @@ -80,7 +81,7 @@ - (void)startUpdating { DCHECK(!_webStateListObserver); DCHECK(!_webStateObserver); - _webStateListObserver = base::MakeUnique<WebStateListObserverBridge>(self); + _webStateListObserver = std::make_unique<WebStateListObserverBridge>(self); self.webStateList->AddObserver(_webStateListObserver.get()); self.webState = self.webStateList->GetActiveWebState(); [self updateState];
diff --git a/ios/chrome/browser/ui/toolbar/legacy_toolbar_ui_updater_unittest.mm b/ios/chrome/browser/ui/toolbar/legacy_toolbar_ui_updater_unittest.mm index bdbcb4a8..a562948a 100644 --- a/ios/chrome/browser/ui/toolbar/legacy_toolbar_ui_updater_unittest.mm +++ b/ios/chrome/browser/ui/toolbar/legacy_toolbar_ui_updater_unittest.mm
@@ -4,7 +4,8 @@ #import "ios/chrome/browser/ui/toolbar/legacy_toolbar_ui_updater.h" -#include "base/memory/ptr_util.h" +#include <memory> + #import "ios/chrome/browser/ui/toolbar/toolbar_owner.h" #import "ios/chrome/browser/ui/toolbar/toolbar_ui.h" #include "ios/chrome/browser/ui/ui_util.h" @@ -69,7 +70,7 @@ // pointer to the inserted WebState. web::TestWebState* InsertActiveWebState() { std::unique_ptr<web::TestWebState> web_state = - base::MakeUnique<web::TestWebState>(); + std::make_unique<web::TestWebState>(); web::TestWebState* inserted_web_state = web_state.get(); web_state_list_.InsertWebState(0, std::move(web_state), WebStateList::INSERT_ACTIVATE,
diff --git a/ios/chrome/browser/ui/toolbar/toolbar_model_impl_ios_unittest.mm b/ios/chrome/browser/ui/toolbar/toolbar_model_impl_ios_unittest.mm index 5466a3c..2223947 100644 --- a/ios/chrome/browser/ui/toolbar/toolbar_model_impl_ios_unittest.mm +++ b/ios/chrome/browser/ui/toolbar/toolbar_model_impl_ios_unittest.mm
@@ -6,7 +6,6 @@ #include <memory> -#include "base/memory/ptr_util.h" #include "base/message_loop/message_loop.h" #include "base/strings/utf_string_conversions.h" #include "components/bookmarks/browser/bookmark_model.h" @@ -53,9 +52,9 @@ // Create a WebStateList that will always return the test WebState as // the active WebState. - web_state_list_ = base::MakeUnique<WebStateList>(&web_state_list_delegate_); + web_state_list_ = std::make_unique<WebStateList>(&web_state_list_delegate_); std::unique_ptr<ToolbarTestWebState> web_state = - base::MakeUnique<ToolbarTestWebState>(); + std::make_unique<ToolbarTestWebState>(); web_state->SetBrowserState(chrome_browser_state_.get()); web_state_ = web_state.get(); web_state_list_->InsertWebState( @@ -116,7 +115,7 @@ TEST_F(ToolbarModelImplIOSTest, TestCanGoBack) { web_state_->SetNavigationManager( - base::MakeUnique<ToolbarTestNavigationManager>()); + std::make_unique<ToolbarTestNavigationManager>()); ToolbarTestNavigationManager* manager = static_cast<ToolbarTestNavigationManager*>( web_state_->GetNavigationManager()); @@ -130,7 +129,7 @@ TEST_F(ToolbarModelImplIOSTest, TestCanGoForward) { web_state_->SetNavigationManager( - base::MakeUnique<ToolbarTestNavigationManager>()); + std::make_unique<ToolbarTestNavigationManager>()); ToolbarTestNavigationManager* manager = static_cast<ToolbarTestNavigationManager*>( web_state_->GetNavigationManager());
diff --git a/ios/chrome/browser/ui/toolbar/tools_menu_button_observer_bridge.mm b/ios/chrome/browser/ui/toolbar/tools_menu_button_observer_bridge.mm index 67dad84e..66d4211 100644 --- a/ios/chrome/browser/ui/toolbar/tools_menu_button_observer_bridge.mm +++ b/ios/chrome/browser/ui/toolbar/tools_menu_button_observer_bridge.mm
@@ -4,8 +4,9 @@ #import "ios/chrome/browser/ui/toolbar/tools_menu_button_observer_bridge.h" +#include <memory> + #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "components/reading_list/core/reading_list_model.h" #import "ios/chrome/browser/ui/toolbar/clean/toolbar_tools_menu_button.h" @@ -33,7 +34,7 @@ [_button addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchUpInside]; - _modelBridge = base::MakeUnique<ReadingListModelBridge>(self, _model); + _modelBridge = std::make_unique<ReadingListModelBridge>(self, _model); } return self; }
diff --git a/ios/chrome/browser/ui/toolbar/web_toolbar_controller.mm b/ios/chrome/browser/ui/toolbar/web_toolbar_controller.mm index 35ea2ebf8..a20b5c9 100644 --- a/ios/chrome/browser/ui/toolbar/web_toolbar_controller.mm +++ b/ios/chrome/browser/ui/toolbar/web_toolbar_controller.mm
@@ -17,7 +17,6 @@ #include "base/logging.h" #include "base/mac/bundle_locations.h" #include "base/mac/foundation_util.h" -#include "base/memory/ptr_util.h" #include "base/metrics/histogram_macros.h" #include "base/metrics/user_metrics.h" #include "base/metrics/user_metrics_action.h" @@ -507,7 +506,7 @@ [_webToolbar setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin]; [_webToolbar setFrame:[self specificControlsArea]]; - _locationBar = base::MakeUnique<LocationBarControllerImpl>( + _locationBar = std::make_unique<LocationBarControllerImpl>( _locationBarView, _browserState, self, self.dispatcher); _omniboxPopupCoordinator = _locationBar->CreatePopupCoordinator(self); _locationBar->SetURLLoader(self); @@ -734,7 +733,7 @@ } - (void)currentPageLoadStarted { - [self startProgressBar]; + [self updateToolbarState]; } - (CGRect)visibleOmniboxFrame {
diff --git a/ios/chrome/browser/ui/webui/chrome_web_ui_ios_controller_factory.mm b/ios/chrome/browser/ui/webui/chrome_web_ui_ios_controller_factory.mm index 8f9ecbb..dcc053f 100644 --- a/ios/chrome/browser/ui/webui/chrome_web_ui_ios_controller_factory.mm +++ b/ios/chrome/browser/ui/webui/chrome_web_ui_ios_controller_factory.mm
@@ -6,7 +6,6 @@ #include "base/bind.h" #include "base/location.h" -#include "base/memory/ptr_util.h" #include "ios/chrome/browser/chrome_url_constants.h" #include "ios/chrome/browser/experimental_flags.h" #include "ios/chrome/browser/ui/webui/about_ui.h" @@ -41,13 +40,13 @@ template <class T> std::unique_ptr<WebUIIOSController> NewWebUIIOS(WebUIIOS* web_ui, const GURL& url) { - return base::MakeUnique<T>(web_ui); + return std::make_unique<T>(web_ui); } template <class T> std::unique_ptr<WebUIIOSController> NewWebUIIOSWithHost(WebUIIOS* web_ui, const GURL& url) { - return base::MakeUnique<T>(web_ui, url.host()); + return std::make_unique<T>(web_ui, url.host()); } // Returns a function that can be used to create the right type of WebUIIOS for
diff --git a/ios/chrome/browser/ui/webui/crashes_ui.cc b/ios/chrome/browser/ui/webui/crashes_ui.cc index e44714f8..31fc779 100644 --- a/ios/chrome/browser/ui/webui/crashes_ui.cc +++ b/ios/chrome/browser/ui/webui/crashes_ui.cc
@@ -6,10 +6,11 @@ #include <stddef.h> +#include <memory> + #include "base/bind.h" #include "base/bind_helpers.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/strings/utf_string_conversions.h" #include "base/sys_info.h" #include "base/values.h" @@ -150,7 +151,7 @@ /////////////////////////////////////////////////////////////////////////////// CrashesUI::CrashesUI(web::WebUIIOS* web_ui) : web::WebUIIOSController(web_ui) { - web_ui->AddMessageHandler(base::MakeUnique<CrashesDOMHandler>()); + web_ui->AddMessageHandler(std::make_unique<CrashesDOMHandler>()); // Set up the chrome://crashes/ source. web::WebUIIOSDataSource::Add(ios::ChromeBrowserState::FromWebUIIOS(web_ui),
diff --git a/ios/chrome/browser/ui/webui/flags_ui.cc b/ios/chrome/browser/ui/webui/flags_ui.cc index 1e60a57..837fc24 100644 --- a/ios/chrome/browser/ui/webui/flags_ui.cc +++ b/ios/chrome/browser/ui/webui/flags_ui.cc
@@ -4,6 +4,7 @@ #include "ios/chrome/browser/ui/webui/flags_ui.h" +#include <memory> #include <string> #include <utility> @@ -131,8 +132,8 @@ base::DictionaryValue results; - auto supported_features = base::MakeUnique<base::ListValue>(); - auto unsupported_features = base::MakeUnique<base::ListValue>(); + auto supported_features = std::make_unique<base::ListValue>(); + auto unsupported_features = std::make_unique<base::ListValue>(); GetFlagFeatureEntries(flags_storage_.get(), access_, supported_features.get(), unsupported_features.get()); results.Set(flags_ui::kSupportedFeatures, std::move(supported_features)); @@ -192,7 +193,7 @@ web_ui->AddMessageHandler(base::WrapUnique(handler)); flags_ui::FlagAccess flag_access = flags_ui::kOwnerAccessToFlags; - handler->Init(base::MakeUnique<flags_ui::PrefServiceFlagsStorage>( + handler->Init(std::make_unique<flags_ui::PrefServiceFlagsStorage>( GetApplicationContext()->GetLocalState()), flag_access);
diff --git a/ios/chrome/browser/ui/webui/gcm/gcm_internals_ui.cc b/ios/chrome/browser/ui/webui/gcm/gcm_internals_ui.cc index c099112a..1f3b964 100644 --- a/ios/chrome/browser/ui/webui/gcm/gcm_internals_ui.cc +++ b/ios/chrome/browser/ui/webui/gcm/gcm_internals_ui.cc
@@ -4,12 +4,12 @@ #include "ios/chrome/browser/ui/webui/gcm/gcm_internals_ui.h" +#include <memory> #include <vector> #include "base/bind.h" #include "base/bind_helpers.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/memory/weak_ptr.h" #include "base/values.h" #include "components/gcm_driver/gcm_client.h" @@ -173,7 +173,7 @@ web::WebUIIOSDataSource::Add(ios::ChromeBrowserState::FromWebUIIOS(web_ui), html_source); - web_ui->AddMessageHandler(base::MakeUnique<GcmInternalsUIMessageHandler>()); + web_ui->AddMessageHandler(std::make_unique<GcmInternalsUIMessageHandler>()); } GCMInternalsUI::~GCMInternalsUI() {}
diff --git a/ios/chrome/browser/ui/webui/net_export/net_export_ui.mm b/ios/chrome/browser/ui/webui/net_export/net_export_ui.mm index a01a379..7ab09f00 100644 --- a/ios/chrome/browser/ui/webui/net_export/net_export_ui.mm +++ b/ios/chrome/browser/ui/webui/net_export/net_export_ui.mm
@@ -10,7 +10,6 @@ #include "base/bind.h" #include "base/location.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/scoped_observer.h" #include "base/strings/string_util.h" #include "base/values.h" @@ -212,7 +211,7 @@ NetExportUI::NetExportUI(web::WebUIIOS* web_ui) : web::WebUIIOSController(web_ui) { - web_ui->AddMessageHandler(base::MakeUnique<NetExportMessageHandler>()); + web_ui->AddMessageHandler(std::make_unique<NetExportMessageHandler>()); web::WebUIIOSDataSource::Add(ios::ChromeBrowserState::FromWebUIIOS(web_ui), CreateNetExportHTMLSource()); }
diff --git a/ios/chrome/browser/ui/webui/ntp_tiles_internals_ui.cc b/ios/chrome/browser/ui/webui/ntp_tiles_internals_ui.cc index 9032b29..350690c 100644 --- a/ios/chrome/browser/ui/webui/ntp_tiles_internals_ui.cc +++ b/ios/chrome/browser/ui/webui/ntp_tiles_internals_ui.cc
@@ -4,7 +4,8 @@ #include "ios/chrome/browser/ui/webui/ntp_tiles_internals_ui.h" -#include "base/memory/ptr_util.h" +#include <memory> + #include "components/grit/components_resources.h" #include "components/keyed_service/core/service_access_type.h" #include "components/ntp_tiles/field_trial.h" @@ -121,7 +122,7 @@ web::WebUIIOSDataSource::Add(browser_state, CreateNTPTilesInternalsHTMLSource()); web_ui->AddMessageHandler( - base::MakeUnique<IOSNTPTilesInternalsMessageHandlerBridge>( + std::make_unique<IOSNTPTilesInternalsMessageHandlerBridge>( ios::FaviconServiceFactory::GetForBrowserState( browser_state, ServiceAccessType::EXPLICIT_ACCESS))); }
diff --git a/ios/chrome/browser/ui/webui/omaha_ui.cc b/ios/chrome/browser/ui/webui/omaha_ui.cc index ef258d7a..20ecbdd 100644 --- a/ios/chrome/browser/ui/webui/omaha_ui.cc +++ b/ios/chrome/browser/ui/webui/omaha_ui.cc
@@ -4,7 +4,8 @@ #include "ios/chrome/browser/ui/webui/omaha_ui.h" -#include "base/memory/ptr_util.h" +#include <memory> + #include "base/memory/weak_ptr.h" #include "base/values.h" #include "ios/chrome/browser/browser_state/chrome_browser_state.h" @@ -83,7 +84,7 @@ // OmahaUI OmahaUI::OmahaUI(web::WebUIIOS* web_ui) : WebUIIOSController(web_ui) { - web_ui->AddMessageHandler(base::MakeUnique<OmahaDOMHandler>()); + web_ui->AddMessageHandler(std::make_unique<OmahaDOMHandler>()); // Set up the chrome://omaha/ source. ios::ChromeBrowserState* browser_state =
diff --git a/ios/chrome/browser/ui/webui/version_ui.mm b/ios/chrome/browser/ui/webui/version_ui.mm index 5c47d49..201a536a 100644 --- a/ios/chrome/browser/ui/webui/version_ui.mm +++ b/ios/chrome/browser/ui/webui/version_ui.mm
@@ -4,8 +4,9 @@ #include "ios/chrome/browser/ui/webui/version_ui.h" +#include <memory> + #include "base/command_line.h" -#include "base/memory/ptr_util.h" #include "base/strings/string_number_conversions.h" #include "base/strings/stringprintf.h" #include "build/build_config.h" @@ -107,7 +108,7 @@ } // namespace VersionUI::VersionUI(web::WebUIIOS* web_ui) : web::WebUIIOSController(web_ui) { - web_ui->AddMessageHandler(base::MakeUnique<VersionHandler>()); + web_ui->AddMessageHandler(std::make_unique<VersionHandler>()); web::WebUIIOSDataSource::Add(ios::ChromeBrowserState::FromWebUIIOS(web_ui), CreateVersionUIDataSource()); }
diff --git a/ios/chrome/browser/upgrade/upgrade_center.mm b/ios/chrome/browser/upgrade/upgrade_center.mm index b831999..a1cc862c 100644 --- a/ios/chrome/browser/upgrade/upgrade_center.mm +++ b/ios/chrome/browser/upgrade/upgrade_center.mm
@@ -9,7 +9,6 @@ #include <utility> #include "base/mac/bundle_locations.h" -#include "base/memory/ptr_util.h" #include "base/scoped_observer.h" #include "base/strings/sys_string_conversions.h" #include "base/version.h" @@ -317,7 +316,7 @@ if ([upgradeInfoBarDelegates_ objectForKey:tabId]) return; - auto infobarDelegate = base::MakeUnique<UpgradeInfoBarDelegate>(); + auto infobarDelegate = std::make_unique<UpgradeInfoBarDelegate>(); DelegateHolder* delegateHolder = [[DelegateHolder alloc] initWithInfoBarManager:infoBarManager infoBarDelegate:infobarDelegate.get()
diff --git a/ios/chrome/browser/voice/voice_search_navigations_tab_helper.mm b/ios/chrome/browser/voice/voice_search_navigations_tab_helper.mm index 3e895df8..a5535aa 100644 --- a/ios/chrome/browser/voice/voice_search_navigations_tab_helper.mm +++ b/ios/chrome/browser/voice/voice_search_navigations_tab_helper.mm
@@ -4,8 +4,9 @@ #import "ios/chrome/browser/voice/voice_search_navigations_tab_helper.h" +#include <memory> + #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "ios/web/public/load_committed_details.h" #import "ios/web/public/navigation_item.h" #import "ios/web/public/navigation_manager.h" @@ -60,7 +61,7 @@ DCHECK_EQ(web_state_, web_state); if (will_navigate_to_voice_search_result_) { load_details.item->SetUserData( - kNavigationMarkerKey, base::MakeUnique<VoiceSearchNavigationMarker>()); + kNavigationMarkerKey, std::make_unique<VoiceSearchNavigationMarker>()); will_navigate_to_voice_search_result_ = false; } }
diff --git a/ios/chrome/browser/web/blocked_popup_tab_helper.mm b/ios/chrome/browser/web/blocked_popup_tab_helper.mm index fb32ad7..a119c5c 100644 --- a/ios/chrome/browser/web/blocked_popup_tab_helper.mm +++ b/ios/chrome/browser/web/blocked_popup_tab_helper.mm
@@ -12,7 +12,6 @@ #include "base/format_macros.h" #include "base/mac/bundle_locations.h" #include "base/mac/foundation_util.h" -#include "base/memory/ptr_util.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "components/content_settings/core/browser/host_content_settings_map.h" @@ -142,7 +141,7 @@ RegisterAsInfoBarManagerObserverIfNeeded(infobar_manager); std::unique_ptr<BlockPopupInfoBarDelegate> delegate( - base::MakeUnique<BlockPopupInfoBarDelegate>(GetBrowserState(), web_state_, + std::make_unique<BlockPopupInfoBarDelegate>(GetBrowserState(), web_state_, popups_)); std::unique_ptr<infobars::InfoBar> infobar = infobar_manager->CreateConfirmInfoBar(std::move(delegate));
diff --git a/ios/chrome/browser/web/cache_egtest.mm b/ios/chrome/browser/web/cache_egtest.mm index 9a35923..665bf11 100644 --- a/ios/chrome/browser/web/cache_egtest.mm +++ b/ios/chrome/browser/web/cache_egtest.mm
@@ -4,8 +4,9 @@ #import <EarlGrey/EarlGrey.h> +#include <memory> + #include "base/ios/ios_util.h" -#include "base/memory/ptr_util.h" #include "base/strings/stringprintf.h" #include "ios/chrome/browser/ui/ui_util.h" #import "ios/chrome/test/app/chrome_test_util.h" @@ -126,7 +127,7 @@ EARL_GREY_TEST_DISABLED(@"Disabled on iOS 10.3.1 and afterwards."); } - web::test::SetUpHttpServer(base::MakeUnique<CacheTestResponseProvider>()); + web::test::SetUpHttpServer(std::make_unique<CacheTestResponseProvider>()); const GURL cacheTestFirstPageURL = HttpServer::MakeUrl(kCacheTestFirstPageURL); @@ -156,7 +157,7 @@ // Tests caching behavior when opening new tab. New tab should not use the // cached page. - (void)testCachingBehaviorOnOpenNewTab { - web::test::SetUpHttpServer(base::MakeUnique<CacheTestResponseProvider>()); + web::test::SetUpHttpServer(std::make_unique<CacheTestResponseProvider>()); const GURL cacheTestFirstPageURL = HttpServer::MakeUrl(kCacheTestFirstPageURL); @@ -192,7 +193,7 @@ EARL_GREY_TEST_DISABLED(@"Test disabled on iOS 11."); } - web::test::SetUpHttpServer(base::MakeUnique<CacheTestResponseProvider>()); + web::test::SetUpHttpServer(std::make_unique<CacheTestResponseProvider>()); // Clear the history to ensure expected omnibox autocomplete results. chrome_test_util::ClearBrowsingHistory();
diff --git a/ios/chrome/browser/web/chrome_web_client.mm b/ios/chrome/browser/web/chrome_web_client.mm index 2843c5c..2a0f9c0c 100644 --- a/ios/chrome/browser/web/chrome_web_client.mm +++ b/ios/chrome/browser/web/chrome_web_client.mm
@@ -10,7 +10,6 @@ #include "base/ios/ios_util.h" #include "base/json/json_reader.h" #include "base/mac/bundle_locations.h" -#include "base/memory/ptr_util.h" #include "base/strings/sys_string_conversions.h" #include "components/dom_distiller/core/url_constants.h" #include "components/payments/core/features.h" @@ -70,7 +69,7 @@ ChromeWebClient::~ChromeWebClient() {} std::unique_ptr<web::WebMainParts> ChromeWebClient::CreateWebMainParts() { - return base::MakeUnique<IOSChromeMainParts>( + return std::make_unique<IOSChromeMainParts>( *base::CommandLine::ForCurrentProcess()); }
diff --git a/ios/chrome/browser/web/chrome_web_client_unittest.mm b/ios/chrome/browser/web/chrome_web_client_unittest.mm index 1fdbb67..9088bd95 100644 --- a/ios/chrome/browser/web/chrome_web_client_unittest.mm +++ b/ios/chrome/browser/web/chrome_web_client_unittest.mm
@@ -9,7 +9,6 @@ #include <memory> #include "base/command_line.h" -#include "base/memory/ptr_util.h" #include "base/strings/string_split.h" #include "base/strings/sys_string_conversions.h" #include "base/test/scoped_feature_list.h" @@ -95,7 +94,7 @@ WKWebView* web_view = web::BuildWKWebView(CGRectZero, browser_state()); web::ExecuteJavaScript(web_view, @"__gCrWeb = {};"); - web::ScopedTestingWebClient web_client(base::MakeUnique<ChromeWebClient>()); + web::ScopedTestingWebClient web_client(std::make_unique<ChromeWebClient>()); NSString* script = web_client.Get()->GetDocumentStartScriptForMainFrame(browser_state()); web::ExecuteJavaScript(web_view, script); @@ -109,7 +108,7 @@ WKWebView* web_view = web::BuildWKWebView(CGRectZero, browser_state()); web::ExecuteJavaScript(web_view, @"__gCrWeb = {};"); - web::ScopedTestingWebClient web_client(base::MakeUnique<ChromeWebClient>()); + web::ScopedTestingWebClient web_client(std::make_unique<ChromeWebClient>()); NSString* script = web_client.Get()->GetDocumentStartScriptForMainFrame(browser_state()); web::ExecuteJavaScript(web_view, script); @@ -124,7 +123,7 @@ WKWebView* web_view = web::BuildWKWebView(CGRectZero, browser_state()); web::ExecuteJavaScript(web_view, @"__gCrWeb = {};"); - web::ScopedTestingWebClient web_client(base::MakeUnique<ChromeWebClient>()); + web::ScopedTestingWebClient web_client(std::make_unique<ChromeWebClient>()); NSString* script = web_client.Get()->GetDocumentStartScriptForMainFrame(browser_state()); web::ExecuteJavaScript(web_view, script); @@ -147,7 +146,7 @@ WKWebView* web_view = web::BuildWKWebView(CGRectZero, browser_state()); web::ExecuteJavaScript(web_view, @"__gCrWeb = {};"); - web::ScopedTestingWebClient web_client(base::MakeUnique<ChromeWebClient>()); + web::ScopedTestingWebClient web_client(std::make_unique<ChromeWebClient>()); base::test::ScopedFeatureList feature_list; feature_list.InitAndEnableFeature(payments::features::kWebPayments); NSString* script = @@ -164,7 +163,7 @@ WKWebView* web_view = web::BuildWKWebView(CGRectZero, browser_state()); web::ExecuteJavaScript(web_view, @"__gCrWeb = {};"); - web::ScopedTestingWebClient web_client(base::MakeUnique<ChromeWebClient>()); + web::ScopedTestingWebClient web_client(std::make_unique<ChromeWebClient>()); base::test::ScopedFeatureList feature_list; feature_list.InitAndDisableFeature(payments::features::kWebPayments); NSString* script =
diff --git a/ios/chrome/browser/web/forms_egtest.mm b/ios/chrome/browser/web/forms_egtest.mm index aaceaba..46a3974 100644 --- a/ios/chrome/browser/web/forms_egtest.mm +++ b/ios/chrome/browser/web/forms_egtest.mm
@@ -4,7 +4,8 @@ #import <XCTest/XCTest.h> -#include "base/memory/ptr_util.h" +#include <memory> + #include "base/strings/stringprintf.h" #include "base/strings/sys_string_conversions.h" #include "components/strings/grit/components_strings.h" @@ -341,7 +342,7 @@ // Tests that a POST followed by a redirect does not show the popup. - (void)testRepostFormCancellingAfterRedirect { - web::test::SetUpHttpServer(base::MakeUnique<TestFormResponseProvider>()); + web::test::SetUpHttpServer(std::make_unique<TestFormResponseProvider>()); const GURL destinationURL = GetDestinationUrl(); [ChromeEarlGrey loadURL:GetRedirectFormUrl()]; @@ -376,7 +377,7 @@ #define MAYBE_testPostFormToSamePage FLAKY_testPostFormToSamePage #endif - (void)MAYBE_testPostFormToSamePage { - web::test::SetUpHttpServer(base::MakeUnique<TestFormResponseProvider>()); + web::test::SetUpHttpServer(std::make_unique<TestFormResponseProvider>()); const GURL formURL = GetFormPostOnSamePageUrl(); // Open the first URL so it's in history.
diff --git a/ios/chrome/browser/web/http_auth_egtest.mm b/ios/chrome/browser/web/http_auth_egtest.mm index 2ac4ce2..d96e3d6 100644 --- a/ios/chrome/browser/web/http_auth_egtest.mm +++ b/ios/chrome/browser/web/http_auth_egtest.mm
@@ -4,7 +4,8 @@ #import <EarlGrey/EarlGrey.h> -#include "base/memory/ptr_util.h" +#include <memory> + #include "base/strings/sys_string_conversions.h" #include "components/strings/grit/components_strings.h" #include "ios/chrome/browser/ui/ui_util.h" @@ -83,7 +84,7 @@ } GURL URL = web::test::HttpServer::MakeUrl("http://good-auth"); - web::test::SetUpHttpServer(base::MakeUnique<web::HttpAuthResponseProvider>( + web::test::SetUpHttpServer(std::make_unique<web::HttpAuthResponseProvider>( URL, "GoodRealm", "gooduser", "goodpass")); chrome_test_util::LoadUrl(URL); WaitForHttpAuthDialog(); @@ -109,7 +110,7 @@ } GURL URL = web::test::HttpServer::MakeUrl("http://bad-auth"); - web::test::SetUpHttpServer(base::MakeUnique<web::HttpAuthResponseProvider>( + web::test::SetUpHttpServer(std::make_unique<web::HttpAuthResponseProvider>( URL, "BadRealm", "baduser", "badpass")); chrome_test_util::LoadUrl(URL); WaitForHttpAuthDialog(); @@ -135,7 +136,7 @@ } GURL URL = web::test::HttpServer::MakeUrl("http://cancel-auth"); - web::test::SetUpHttpServer(base::MakeUnique<web::HttpAuthResponseProvider>( + web::test::SetUpHttpServer(std::make_unique<web::HttpAuthResponseProvider>( URL, "CancellingRealm", "", "")); chrome_test_util::LoadUrl(URL); WaitForHttpAuthDialog();
diff --git a/ios/chrome/browser/web/progress_indicator_egtest.mm b/ios/chrome/browser/web/progress_indicator_egtest.mm index 08dc876..77535e6 100644 --- a/ios/chrome/browser/web/progress_indicator_egtest.mm +++ b/ios/chrome/browser/web/progress_indicator_egtest.mm
@@ -4,8 +4,9 @@ #import <EarlGrey/EarlGrey.h> +#include <memory> + #include "base/mac/foundation_util.h" -#include "base/memory/ptr_util.h" #include "base/run_loop.h" #include "base/strings/stringprintf.h" #include "base/synchronization/condition_variable.h" @@ -180,7 +181,7 @@ const GURL infinitePendingURL = web::test::HttpServer::MakeUrl(kInfinitePendingPageURL); auto uniqueInfinitePendingProvider = - base::MakeUnique<InfinitePendingResponseProvider>(infinitePendingURL); + std::make_unique<InfinitePendingResponseProvider>(infinitePendingURL); InfinitePendingResponseProvider* infinitePendingProvider = uniqueInfinitePendingProvider.get(); web::test::SetUpHttpServer(std::move(uniqueInfinitePendingProvider)); @@ -217,7 +218,7 @@ // Add responseProvider for page that never finishes loading. auto uniqueInfinitePendingProvider = - base::MakeUnique<InfinitePendingResponseProvider>(infinitePendingURL); + std::make_unique<InfinitePendingResponseProvider>(infinitePendingURL); InfinitePendingResponseProvider* infinitePendingProvider = uniqueInfinitePendingProvider.get(); web::test::AddResponseProvider(std::move(uniqueInfinitePendingProvider));
diff --git a/ios/chrome/browser/web/sad_tab_tab_helper.mm b/ios/chrome/browser/web/sad_tab_tab_helper.mm index 4f68a64..03ae967 100644 --- a/ios/chrome/browser/web/sad_tab_tab_helper.mm +++ b/ios/chrome/browser/web/sad_tab_tab_helper.mm
@@ -7,6 +7,8 @@ #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> +#include <memory> + #include "base/logging.h" #include "base/memory/ptr_util.h" #include "base/strings/sys_string_conversions.h" @@ -133,7 +135,7 @@ repeatedFailure:repeated_failure]; last_failed_url_ = url_causing_failure; - last_failed_timer_ = base::MakeUnique<base::ElapsedTimer>(); + last_failed_timer_ = std::make_unique<base::ElapsedTimer>(); } void SadTabTabHelper::ReloadTab() {
diff --git a/ios/chrome/browser/web/sad_tab_tab_helper_unittest.mm b/ios/chrome/browser/web/sad_tab_tab_helper_unittest.mm index 1947770..d9727ac 100644 --- a/ios/chrome/browser/web/sad_tab_tab_helper_unittest.mm +++ b/ios/chrome/browser/web/sad_tab_tab_helper_unittest.mm
@@ -55,7 +55,7 @@ // Setup navigation manager. std::unique_ptr<web::TestNavigationManager> navigation_manager = - base::MakeUnique<web::TestNavigationManager>(); + std::make_unique<web::TestNavigationManager>(); navigation_manager->SetBrowserState(browser_state_.get()); navigation_manager_ = navigation_manager.get(); web_state_.SetNavigationManager(std::move(navigation_manager));
diff --git a/ios/chrome/browser/web/stop_loading_egtest.mm b/ios/chrome/browser/web/stop_loading_egtest.mm index 72cba25..bb2b9cce 100644 --- a/ios/chrome/browser/web/stop_loading_egtest.mm +++ b/ios/chrome/browser/web/stop_loading_egtest.mm
@@ -4,7 +4,8 @@ #import <EarlGrey/EarlGrey.h> -#include "base/memory/ptr_util.h" +#include <memory> + #include "base/strings/stringprintf.h" #include "base/time/time.h" #include "ios/chrome/browser/ui/ui_util.h" @@ -91,7 +92,7 @@ // Load a page which never finishes loading. GURL infinitePendingURL = web::test::HttpServer::MakeUrl("http://infinite"); web::test::SetUpHttpServer( - base::MakeUnique<InfinitePendingResponseProvider>(infinitePendingURL)); + std::make_unique<InfinitePendingResponseProvider>(infinitePendingURL)); // The page being loaded never completes, so call the LoadUrl helper that // does not wait for the page to complete loading.
diff --git a/ios/chrome/browser/web/visible_url_egtest.mm b/ios/chrome/browser/web/visible_url_egtest.mm index 2ed5ee6c..f1addf1 100644 --- a/ios/chrome/browser/web/visible_url_egtest.mm +++ b/ios/chrome/browser/web/visible_url_egtest.mm
@@ -4,8 +4,9 @@ #import <EarlGrey/EarlGrey.h> +#include <memory> + #include "base/compiler_specific.h" -#include "base/memory/ptr_util.h" #include "base/strings/stringprintf.h" #include "base/strings/sys_string_conversions.h" #include "base/strings/utf_string_conversions.h" @@ -155,7 +156,7 @@ responses[_testURL3] = std::string(kTestPage3) + pageContent; std::unique_ptr<PausableResponseProvider> unique_provider = - base::MakeUnique<PausableResponseProvider>(responses); + std::make_unique<PausableResponseProvider>(responses); _responseProvider = unique_provider.get(); web::test::SetUpHttpServer(std::move(unique_provider));
diff --git a/ios/chrome/browser/web_data_service_factory.cc b/ios/chrome/browser/web_data_service_factory.cc index f169f4e..fb7d704 100644 --- a/ios/chrome/browser/web_data_service_factory.cc +++ b/ios/chrome/browser/web_data_service_factory.cc
@@ -7,7 +7,6 @@ #include "base/bind.h" #include "base/files/file_path.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/memory/singleton.h" #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" #include "components/keyed_service/core/service_access_type.h" @@ -97,7 +96,7 @@ std::unique_ptr<KeyedService> WebDataServiceFactory::BuildServiceInstanceFor( web::BrowserState* context) const { const base::FilePath& browser_state_path = context->GetStatePath(); - return base::MakeUnique<WebDataServiceWrapper>( + return std::make_unique<WebDataServiceWrapper>( browser_state_path, GetApplicationContext()->GetApplicationLocale(), web::WebThread::GetTaskRunnerForThread(web::WebThread::UI), ios::sync_start_util::GetFlareForSyncableService(browser_state_path),
diff --git a/ios/chrome/browser/web_state_list/web_state_list.mm b/ios/chrome/browser/web_state_list/web_state_list.mm index 402e25d6..189adc30 100644 --- a/ios/chrome/browser/web_state_list/web_state_list.mm +++ b/ios/chrome/browser/web_state_list/web_state_list.mm
@@ -8,7 +8,6 @@ #include <utility> #include "base/logging.h" -#include "base/memory/ptr_util.h" #import "ios/chrome/browser/web_state_list/web_state_list_delegate.h" #import "ios/chrome/browser/web_state_list/web_state_list_observer.h" #import "ios/chrome/browser/web_state_list/web_state_list_order_controller.h" @@ -97,7 +96,7 @@ WebStateList::WebStateList(WebStateListDelegate* delegate) : delegate_(delegate), - order_controller_(base::MakeUnique<WebStateListOrderController>(this)) { + order_controller_(std::make_unique<WebStateListOrderController>(this)) { DCHECK(delegate_); } @@ -170,7 +169,7 @@ web::WebState* web_state_ptr = web_state.get(); web_state_wrappers_.insert( web_state_wrappers_.begin() + index, - base::MakeUnique<WebStateWrapper>(std::move(web_state))); + std::make_unique<WebStateWrapper>(std::move(web_state))); if (active_index_ >= index) ++active_index_;
diff --git a/ios/chrome/browser/web_state_list/web_state_list_order_controller_unittest.mm b/ios/chrome/browser/web_state_list/web_state_list_order_controller_unittest.mm index 6ab3a06f..0c06ca21 100644 --- a/ios/chrome/browser/web_state_list/web_state_list_order_controller_unittest.mm +++ b/ios/chrome/browser/web_state_list/web_state_list_order_controller_unittest.mm
@@ -7,7 +7,6 @@ #include <memory> #include "base/macros.h" -#include "base/memory/ptr_util.h" #import "ios/chrome/browser/web_state_list/fake_web_state_list_delegate.h" #import "ios/chrome/browser/web_state_list/web_state_list.h" #import "ios/chrome/browser/web_state_list/web_state_opener.h" @@ -49,10 +48,10 @@ WebStateListOrderController order_controller_; void InsertNewWebState(int index, WebStateOpener opener) { - auto test_web_state = base::MakeUnique<web::TestWebState>(); + auto test_web_state = std::make_unique<web::TestWebState>(); test_web_state->SetCurrentURL(GURL(kURL)); test_web_state->SetNavigationManager( - base::MakeUnique<FakeNavigationManager>()); + std::make_unique<FakeNavigationManager>()); web_state_list_.InsertWebState(index, std::move(test_web_state), WebStateList::INSERT_FORCE_INDEX, opener); }
diff --git a/ios/chrome/browser/web_state_list/web_state_list_serialization_unittest.mm b/ios/chrome/browser/web_state_list/web_state_list_serialization_unittest.mm index 18ce154..4f6acaa1 100644 --- a/ios/chrome/browser/web_state_list/web_state_list_serialization_unittest.mm +++ b/ios/chrome/browser/web_state_list/web_state_list_serialization_unittest.mm
@@ -7,7 +7,6 @@ #include <memory> #include "base/bind.h" -#include "base/memory/ptr_util.h" #import "ios/chrome/browser/sessions/session_window_ios.h" #import "ios/chrome/browser/web_state_list/fake_web_state_list_delegate.h" #import "ios/chrome/browser/web_state_list/web_state_list.h" @@ -28,7 +27,7 @@ class SerializableTestWebState : public web::TestWebState { public: static std::unique_ptr<web::WebState> Create() { - return base::MakeUnique<SerializableTestWebState>(); + return std::make_unique<SerializableTestWebState>(); } static std::unique_ptr<web::WebState> CreateWithSessionStorage(
diff --git a/ios/chrome/browser/web_state_list/web_state_list_unittest.mm b/ios/chrome/browser/web_state_list/web_state_list_unittest.mm index 83d25ae..c585451e 100644 --- a/ios/chrome/browser/web_state_list/web_state_list_unittest.mm +++ b/ios/chrome/browser/web_state_list/web_state_list_unittest.mm
@@ -5,7 +5,6 @@ #import "ios/chrome/browser/web_state_list/web_state_list.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/supports_user_data.h" #import "ios/chrome/browser/web_state_list/fake_web_state_list_delegate.h" #import "ios/chrome/browser/web_state_list/web_state_list_observer.h" @@ -152,10 +151,10 @@ WebStateListTestObserver observer_; std::unique_ptr<web::TestWebState> CreateWebState(const char* url) { - auto test_web_state = base::MakeUnique<web::TestWebState>(); + auto test_web_state = std::make_unique<web::TestWebState>(); test_web_state->SetCurrentURL(GURL(url)); test_web_state->SetNavigationManager( - base::MakeUnique<FakeNavigationManager>()); + std::make_unique<FakeNavigationManager>()); return test_web_state; }
diff --git a/ios/chrome/browser/web_state_list/web_state_opener_unittest.mm b/ios/chrome/browser/web_state_list/web_state_opener_unittest.mm index 8240f3d..271ce341 100644 --- a/ios/chrome/browser/web_state_list/web_state_opener_unittest.mm +++ b/ios/chrome/browser/web_state_list/web_state_opener_unittest.mm
@@ -6,7 +6,6 @@ #include <memory> -#include "base/memory/ptr_util.h" #import "ios/web/public/test/fakes/test_navigation_manager.h" #import "ios/web/public/test/fakes/test_web_state.h" #include "testing/gtest/include/gtest/gtest.h" @@ -41,9 +40,9 @@ WebStateOpenerTest() = default; std::unique_ptr<web::WebState> CreateWebState(int last_committed_item_index) { - auto test_web_state = base::MakeUnique<web::TestWebState>(); + auto test_web_state = std::make_unique<web::TestWebState>(); test_web_state->SetNavigationManager( - base::MakeUnique<FakeNavigationManager>(last_committed_item_index)); + std::make_unique<FakeNavigationManager>(last_committed_item_index)); return test_web_state; }
diff --git a/ios/chrome/test/base/perf_test_ios.mm b/ios/chrome/test/base/perf_test_ios.mm index 26a2c43..6b92b235 100644 --- a/ios/chrome/test/base/perf_test_ios.mm +++ b/ios/chrome/test/base/perf_test_ios.mm
@@ -2,8 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <memory> + #include "base/logging.h" -#include "base/memory/ptr_util.h" #import "ios/chrome/browser/web/chrome_web_client.h" #import "ios/chrome/test/base/perf_test_ios.h" @@ -19,7 +20,7 @@ isWaterfall_(false), verbose_(true), repeatCount_(10), - web_client_(base::MakeUnique<ChromeWebClient>()) {} + web_client_(std::make_unique<ChromeWebClient>()) {} PerfTest::PerfTest(std::string testGroup, std::string firstLabel, std::string averageLabel, @@ -33,7 +34,7 @@ isWaterfall_(isWaterfall), verbose_(verbose), repeatCount_(repeat), - web_client_(base::MakeUnique<ChromeWebClient>()) {} + web_client_(std::make_unique<ChromeWebClient>()) {} PerfTest::~PerfTest() {}
diff --git a/ios/chrome/test/earl_grey/chrome_test_case.mm b/ios/chrome/test/earl_grey/chrome_test_case.mm index 81cb3bbe..7fff857f 100644 --- a/ios/chrome/test/earl_grey/chrome_test_case.mm +++ b/ios/chrome/test/earl_grey/chrome_test_case.mm
@@ -8,6 +8,8 @@ #import <EarlGrey/EarlGrey.h> +#include <memory> + #include "base/command_line.h" #include "base/mac/scoped_block.h" #include "base/strings/sys_string_conversions.h" @@ -164,7 +166,7 @@ - (net::EmbeddedTestServer*)testServer { if (!_testServer) { - _testServer = base::MakeUnique<net::EmbeddedTestServer>(); + _testServer = std::make_unique<net::EmbeddedTestServer>(); _testServer->AddDefaultHandlers(base::FilePath( FILE_PATH_LITERAL("ios/testing/data/http_server_files/"))); }
diff --git a/ios/components/io_thread/ios_io_thread.mm b/ios/components/io_thread/ios_io_thread.mm index dc034c643..ccc265f7 100644 --- a/ios/components/io_thread/ios_io_thread.mm +++ b/ios/components/io_thread/ios_io_thread.mm
@@ -17,7 +17,6 @@ #include "base/environment.h" #include "base/logging.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/metrics/field_trial.h" #include "base/stl_util.h" #include "base/strings/string_number_conversions.h" @@ -446,7 +445,7 @@ // Data URLs are always loaded through the system request context on iOS // (due to UIWebView limitations). bool set_protocol = system_job_factory->SetProtocolHandler( - url::kDataScheme, base::MakeUnique<net::DataProtocolHandler>()); + url::kDataScheme, std::make_unique<net::DataProtocolHandler>()); DCHECK(set_protocol); globals->system_url_request_job_factory.reset(system_job_factory); context->set_job_factory(globals->system_url_request_job_factory.get());
diff --git a/ios/net/cookies/cookie_store_ios.mm b/ios/net/cookies/cookie_store_ios.mm index 2d65a736..d84d1e3 100644 --- a/ios/net/cookies/cookie_store_ios.mm +++ b/ios/net/cookies/cookie_store_ios.mm
@@ -16,7 +16,6 @@ #import "base/mac/bind_objc_block.h" #include "base/mac/foundation_util.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/memory/weak_ptr.h" #include "base/metrics/histogram_macros.h" #include "base/observer_list.h" @@ -248,7 +247,7 @@ CookieStoreIOS::CookieStoreIOS(NSHTTPCookieStorage* ns_cookie_store) : CookieStoreIOS( - base::MakeUnique<NSHTTPSystemCookieStore>(ns_cookie_store)) {} + std::make_unique<NSHTTPSystemCookieStore>(ns_cookie_store)) {} CookieStoreIOS::~CookieStoreIOS() { NotificationTrampoline::GetInstance()->RemoveObserver(this); @@ -621,7 +620,7 @@ std::pair<GURL, std::string> key(gurl, name); if (hook_map_.count(key) == 0) { UpdateCacheForCookieFromSystem(gurl, name, /*run_callbacks=*/false); - hook_map_[key] = base::MakeUnique<CookieChangedCallbackList>(); + hook_map_[key] = std::make_unique<CookieChangedCallbackList>(); } DCHECK(hook_map_.find(key) != hook_map_.end());
diff --git a/ios/net/cookies/cookie_store_ios_persistent.mm b/ios/net/cookies/cookie_store_ios_persistent.mm index 1348cdb..107954c 100644 --- a/ios/net/cookies/cookie_store_ios_persistent.mm +++ b/ios/net/cookies/cookie_store_ios_persistent.mm
@@ -6,7 +6,8 @@ #import <Foundation/Foundation.h> -#include "base/memory/ptr_util.h" +#include <memory> + #import "ios/net/cookies/ns_http_system_cookie_store.h" #import "ios/net/cookies/system_cookie_util.h" #include "net/cookies/cookie_monster.h" @@ -23,7 +24,7 @@ CookieStoreIOSPersistent::CookieStoreIOSPersistent( net::CookieMonster::PersistentCookieStore* persistent_store) : CookieStoreIOS(persistent_store, - base::MakeUnique<net::NSHTTPSystemCookieStore>()) {} + std::make_unique<net::NSHTTPSystemCookieStore>()) {} CookieStoreIOSPersistent::CookieStoreIOSPersistent( net::CookieMonster::PersistentCookieStore* persistent_store,
diff --git a/ios/net/cookies/cookie_store_ios_persistent_unittest.mm b/ios/net/cookies/cookie_store_ios_persistent_unittest.mm index 51b2f49..6286e853 100644 --- a/ios/net/cookies/cookie_store_ios_persistent_unittest.mm +++ b/ios/net/cookies/cookie_store_ios_persistent_unittest.mm
@@ -9,7 +9,6 @@ #include <memory> #include "base/bind_helpers.h" -#include "base/memory/ptr_util.h" #include "base/memory/ref_counted.h" #include "base/message_loop/message_loop.h" #include "base/run_loop.h" @@ -26,7 +25,7 @@ struct InactiveCookieStoreIOSTestTraits { static std::unique_ptr<net::CookieStore> Create() { - return base::MakeUnique<CookieStoreIOSPersistent>(nullptr); + return std::make_unique<CookieStoreIOSPersistent>(nullptr); } static const bool is_cookie_monster = false; @@ -58,10 +57,10 @@ CookieStoreIOSPersistentTest() : kTestCookieURL("http://foo.google.com/bar"), scoped_cookie_store_ios_client_( - base::MakeUnique<TestCookieStoreIOSClient>()), + std::make_unique<TestCookieStoreIOSClient>()), backend_(new net::TestPersistentCookieStore), store_( - base::MakeUnique<net::CookieStoreIOSPersistent>(backend_.get())) { + std::make_unique<net::CookieStoreIOSPersistent>(backend_.get())) { cookie_changed_callback_ = store_->AddCallbackForCookie( kTestCookieURL, "abc", base::Bind(&net::RecordCookieChanges, &cookies_changed_,
diff --git a/ios/net/cookies/cookie_store_ios_test_util.mm b/ios/net/cookies/cookie_store_ios_test_util.mm index c48b7b93..dc43803 100644 --- a/ios/net/cookies/cookie_store_ios_test_util.mm +++ b/ios/net/cookies/cookie_store_ios_test_util.mm
@@ -6,7 +6,8 @@ #import <Foundation/Foundation.h> -#include "base/memory/ptr_util.h" +#include <memory> + #include "base/run_loop.h" #include "base/test/test_simple_task_runner.h" #include "base/threading/thread_task_runner_handle.h" @@ -48,7 +49,7 @@ cookies.push_back(std::move(cookie)); std::unique_ptr<net::CanonicalCookie> bad_canonical_cookie( - base::MakeUnique<net::CanonicalCookie>( + std::make_unique<net::CanonicalCookie>( "name", "\x81r\xe4\xbd\xa0\xe5\xa5\xbd", "domain", "/path/", base::Time(), // creation base::Time(), // expires
diff --git a/ios/net/cookies/cookie_store_ios_unittest.mm b/ios/net/cookies/cookie_store_ios_unittest.mm index b4f9dae..47d3eb8 100644 --- a/ios/net/cookies/cookie_store_ios_unittest.mm +++ b/ios/net/cookies/cookie_store_ios_unittest.mm
@@ -10,7 +10,6 @@ #include "base/bind_helpers.h" #import "base/mac/bind_objc_block.h" -#include "base/memory/ptr_util.h" #include "base/memory/ref_counted.h" #include "base/message_loop/message_loop.h" #include "base/run_loop.h" @@ -34,7 +33,7 @@ TestingCookieStoreIOS(std::unique_ptr<SystemCookieStore> system_store) : CookieStoreIOS(std::move(system_store)), scoped_cookie_store_ios_client_( - base::MakeUnique<TestCookieStoreIOSClient>()) {} + std::make_unique<TestCookieStoreIOSClient>()) {} private: ScopedTestingCookieStoreIOSClient scoped_cookie_store_ios_client_; @@ -43,8 +42,8 @@ struct CookieStoreIOSTestTraits { static std::unique_ptr<net::CookieStore> Create() { ClearCookies(); - return base::MakeUnique<TestingCookieStoreIOS>( - base::MakeUnique<NSHTTPSystemCookieStore>()); + return std::make_unique<TestingCookieStoreIOS>( + std::make_unique<NSHTTPSystemCookieStore>()); } static const bool supports_http_only = false; @@ -106,16 +105,16 @@ kTestCookieURLFoo("http://foo.google.com"), kTestCookieURLBarBar("http://bar.google.com/bar"), scoped_cookie_store_ios_client_( - base::MakeUnique<TestCookieStoreIOSClient>()), + std::make_unique<TestCookieStoreIOSClient>()), backend_(new TestPersistentCookieStore) { ClearCookies(); std::unique_ptr<NSHTTPSystemCookieStore> system_store( - base::MakeUnique<NSHTTPSystemCookieStore>()); + std::make_unique<NSHTTPSystemCookieStore>()); // |system_store_| doesn't own the NSHTTPSystemCookieStore object, the // object is owned by store_, this will work as we will not use // |system_store_| after |store_| is deleted. system_store_ = system_store.get(); - store_ = base::MakeUnique<net::CookieStoreIOS>(std::move(system_store)); + store_ = std::make_unique<net::CookieStoreIOS>(std::move(system_store)); cookie_changed_callback_ = store_->AddCallbackForCookie( kTestCookieURLFooBar, "abc", base::Bind(&RecordCookieChanges, &cookies_changed_, &cookies_removed_)); @@ -235,10 +234,10 @@ TEST_F(CookieStoreIOSTest, GetAllCookiesForURLAsync) { const GURL kTestCookieURLFooBar("http://foo.google.com/bar"); ScopedTestingCookieStoreIOSClient scoped_cookie_store_ios_client( - base::MakeUnique<TestCookieStoreIOSClient>()); + std::make_unique<TestCookieStoreIOSClient>()); ClearCookies(); - std::unique_ptr<CookieStoreIOS> cookie_store(base::MakeUnique<CookieStoreIOS>( - base::MakeUnique<NSHTTPSystemCookieStore>())); + std::unique_ptr<CookieStoreIOS> cookie_store(std::make_unique<CookieStoreIOS>( + std::make_unique<NSHTTPSystemCookieStore>())); // Add a cookie. net::CookieOptions options;
diff --git a/ios/net/cookies/ns_http_system_cookie_store_unittest.mm b/ios/net/cookies/ns_http_system_cookie_store_unittest.mm index 938b8acb..2bf3a118 100644 --- a/ios/net/cookies/ns_http_system_cookie_store_unittest.mm +++ b/ios/net/cookies/ns_http_system_cookie_store_unittest.mm
@@ -6,6 +6,8 @@ #import <Foundation/Foundation.h> +#include <memory> + #include "base/message_loop/message_loop.h" #include "ios/net/cookies/system_cookie_store_unittest_template.h" @@ -22,9 +24,9 @@ public: NSHTTPSystemCookieStoreTestDelegate() : scoped_cookie_store_ios_client_( - base::MakeUnique<TestCookieStoreIOSClient>()), + std::make_unique<TestCookieStoreIOSClient>()), shared_store_([NSHTTPCookieStorage sharedHTTPCookieStorage]), - store_(base::MakeUnique<net::NSHTTPSystemCookieStore>(shared_store_)) {} + store_(std::make_unique<net::NSHTTPSystemCookieStore>(shared_store_)) {} bool IsTestEnabled() { return true; }
diff --git a/ios/net/cookies/system_cookie_store.mm b/ios/net/cookies/system_cookie_store.mm index 14761be..4f4387b1 100644 --- a/ios/net/cookies/system_cookie_store.mm +++ b/ios/net/cookies/system_cookie_store.mm
@@ -4,7 +4,8 @@ #import "ios/net/cookies/system_cookie_store.h" -#include "base/memory/ptr_util.h" +#include <memory> + #import "ios/net/cookies/cookie_creation_time_manager.h" #include "ios/net/ios_net_features.h" @@ -17,7 +18,7 @@ SystemCookieStore::~SystemCookieStore() = default; SystemCookieStore::SystemCookieStore() - : creation_time_manager_(base::MakeUnique<CookieCreationTimeManager>()), + : creation_time_manager_(std::make_unique<CookieCreationTimeManager>()), weak_factory_(this) {} void SystemCookieStore::SetCookieAsync(NSHTTPCookie* cookie,
diff --git a/ios/net/crn_http_protocol_handler.mm b/ios/net/crn_http_protocol_handler.mm index 5cf1ffd1..c7bc9c7 100644 --- a/ios/net/crn_http_protocol_handler.mm +++ b/ios/net/crn_http_protocol_handler.mm
@@ -15,7 +15,6 @@ #include "base/mac/bind_objc_block.h" #include "base/mac/foundation_util.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/memory/ref_counted.h" #include "base/single_thread_task_runner.h" #include "base/strings/string_util.h" @@ -266,7 +265,7 @@ if (!post_data_readers_.empty()) { // NOTE: This call will result in |post_data_readers_| being cleared, // which is the desired behavior. - net_request_->set_upload(base::MakeUnique<ElementsUploadDataStream>( + net_request_->set_upload(std::make_unique<ElementsUploadDataStream>( std::move(post_data_readers_), 0)); DCHECK(post_data_readers_.empty()); } @@ -286,7 +285,7 @@ std::vector<char> owned_data(read_buffer_.get(), read_buffer_.get() + length); post_data_readers_.push_back( - base::MakeUnique<UploadOwnedBytesElementReader>(&owned_data)); + std::make_unique<UploadOwnedBytesElementReader>(&owned_data)); } else if (length < 0) { // Error StopRequestWithError(stream.streamError.code, ERR_FAILED); }
diff --git a/ios/public/provider/chrome/browser/test_chrome_browser_provider.mm b/ios/public/provider/chrome/browser/test_chrome_browser_provider.mm index bf479f0..c02bb22 100644 --- a/ios/public/provider/chrome/browser/test_chrome_browser_provider.mm +++ b/ios/public/provider/chrome/browser/test_chrome_browser_provider.mm
@@ -7,7 +7,6 @@ #import <UIKit/UIKit.h> #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "ios/public/provider/chrome/browser/distribution/test_app_distribution_provider.h" #include "ios/public/provider/chrome/browser/external_search/test_external_search_provider.h" #include "ios/public/provider/chrome/browser/images/test_branded_image_provider.h" @@ -28,16 +27,16 @@ TestChromeBrowserProvider::TestChromeBrowserProvider() : app_distribution_provider_( - base::MakeUnique<TestAppDistributionProvider>()), - branded_image_provider_(base::MakeUnique<TestBrandedImageProvider>()), - omaha_service_provider_(base::MakeUnique<TestOmahaServiceProvider>()), + std::make_unique<TestAppDistributionProvider>()), + branded_image_provider_(std::make_unique<TestBrandedImageProvider>()), + omaha_service_provider_(std::make_unique<TestOmahaServiceProvider>()), signin_resources_provider_( - base::MakeUnique<TestSigninResourcesProvider>()), - voice_search_provider_(base::MakeUnique<TestVoiceSearchProvider>()), - user_feedback_provider_(base::MakeUnique<TestUserFeedbackProvider>()), - spotlight_provider_(base::MakeUnique<TestSpotlightProvider>()), + std::make_unique<TestSigninResourcesProvider>()), + voice_search_provider_(std::make_unique<TestVoiceSearchProvider>()), + user_feedback_provider_(std::make_unique<TestUserFeedbackProvider>()), + spotlight_provider_(std::make_unique<TestSpotlightProvider>()), external_search_provider_( - base::MakeUnique<TestExternalSearchProvider>()) {} + std::make_unique<TestExternalSearchProvider>()) {} TestChromeBrowserProvider::~TestChromeBrowserProvider() {}
diff --git a/ios/web/app/web_main_loop.mm b/ios/web/app/web_main_loop.mm index 7d9c08d..2ea239b 100644 --- a/ios/web/app/web_main_loop.mm +++ b/ios/web/app/web_main_loop.mm
@@ -207,7 +207,7 @@ int WebMainLoop::WebThreadsStarted() { cookie_notification_bridge_.reset(new CookieNotificationBridge); - service_manager_context_ = base::MakeUnique<ServiceManagerContext>(); + service_manager_context_ = std::make_unique<ServiceManagerContext>(); return result_code_; }
diff --git a/ios/web/browser_state.mm b/ios/web/browser_state.mm index cdf1418..64aaca0 100644 --- a/ios/web/browser_state.mm +++ b/ios/web/browser_state.mm
@@ -4,10 +4,11 @@ #include "ios/web/public/browser_state.h" +#include <memory> + #include "base/guid.h" #include "base/lazy_instance.h" #include "base/location.h" -#include "base/memory/ptr_util.h" #include "base/memory/ref_counted.h" #include "base/process/process_handle.h" #include "ios/web/public/certificate_policy_cache.h" @@ -106,7 +107,7 @@ DCHECK_CURRENTLY_ON(WebThread::UI); if (!browser_state->GetUserData(kCertificatePolicyCacheKeyName)) { browser_state->SetUserData(kCertificatePolicyCacheKeyName, - base::MakeUnique<CertificatePolicyCacheHandle>( + std::make_unique<CertificatePolicyCacheHandle>( new CertificatePolicyCache())); } @@ -122,7 +123,7 @@ // may be passed a content::BrowserContext instead of a BrowserState, attach // an empty object to this via a private key. SetUserData(kBrowserStateIdentifierKey, - base::MakeUnique<SupportsUserData::Data>()); + std::make_unique<SupportsUserData::Data>()); } BrowserState::~BrowserState() { @@ -176,10 +177,10 @@ RemoveBrowserStateFromUserIdMap(browser_state); g_user_id_to_browser_state.Get()[new_id] = browser_state; browser_state->SetUserData(kServiceUserId, - base::MakeUnique<ServiceUserIdHolder>(new_id)); + std::make_unique<ServiceUserIdHolder>(new_id)); browser_state->SetUserData(kMojoWasInitialized, - base::MakeUnique<base::SupportsUserData::Data>()); + std::make_unique<base::SupportsUserData::Data>()); ServiceManagerConnection* service_manager_connection = ServiceManagerConnection::Get(); @@ -201,7 +202,7 @@ service_manager_connection->GetConnector()->StartService(identity); auto connection_holder = - base::MakeUnique<BrowserStateServiceManagerConnectionHolder>( + std::make_unique<BrowserStateServiceManagerConnectionHolder>( std::move(service_request)); ServiceManagerConnection* connection =
diff --git a/ios/web/browser_state_web_view_partition_inttest.mm b/ios/web/browser_state_web_view_partition_inttest.mm index c97daf5..7ebd8b80 100644 --- a/ios/web/browser_state_web_view_partition_inttest.mm +++ b/ios/web/browser_state_web_view_partition_inttest.mm
@@ -8,7 +8,6 @@ #include <string> #include "base/mac/foundation_util.h" -#include "base/memory/ptr_util.h" #import "base/test/ios/wait_util.h" #include "base/test/test_timeouts.h" #include "ios/web/public/browser_state.h" @@ -57,7 +56,7 @@ ASSERT_TRUE(server.IsRunning()); auto provider = - base::MakeUnique<web::StringResponseProvider>("Hello World"); + std::make_unique<web::StringResponseProvider>("Hello World"); provider_ = provider.get(); // Keep a weak copy to allow unregistration. server.AddResponseProvider(std::move(provider)); }
diff --git a/ios/web/download/download_inttest.mm b/ios/web/download/download_inttest.mm index c31eb3d..88db63c 100644 --- a/ios/web/download/download_inttest.mm +++ b/ios/web/download/download_inttest.mm
@@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/memory/ptr_util.h" +#include <memory> + #include "base/run_loop.h" #include "base/strings/utf_string_conversions.h" #import "ios/testing/wait_util.h" @@ -33,7 +34,7 @@ // Returns HTTP response which causes WebState to start the download. std::unique_ptr<net::test_server::HttpResponse> GetDownloadResponse( const net::test_server::HttpRequest& request) { - auto result = base::MakeUnique<net::test_server::BasicHttpResponse>(); + auto result = std::make_unique<net::test_server::BasicHttpResponse>(); result->set_code(net::HTTP_OK); result->set_content(kContent); result->AddCustomHeader("Content-Type", kMimeType); @@ -91,7 +92,7 @@ EXPECT_EQ("download.test", base::UTF16ToUTF8(task->GetSuggestedFilename())); // Start the download task and wait for completion. - task->Start(base::MakeUnique<net::URLFetcherStringWriter>()); + task->Start(std::make_unique<net::URLFetcherStringWriter>()); ASSERT_TRUE(WaitUntilConditionOrTimeout(testing::kWaitForPageLoadTimeout, ^{ base::RunLoop().RunUntilIdle(); return task->IsDone();
diff --git a/ios/web/interstitials/html_web_interstitial_unittest.mm b/ios/web/interstitials/html_web_interstitial_unittest.mm index 2d15b64..2fbd003 100644 --- a/ios/web/interstitials/html_web_interstitial_unittest.mm +++ b/ios/web/interstitials/html_web_interstitial_unittest.mm
@@ -4,6 +4,8 @@ #import "ios/web/interstitials/html_web_interstitial_impl.h" +#include <memory> + #import "ios/web/navigation/navigation_manager_impl.h" #import "ios/web/public/interstitials/web_interstitial_delegate.h" #include "ios/web/public/test/fakes/test_web_state_observer.h" @@ -40,7 +42,7 @@ void SetUp() override { WebTest::SetUp(); WebState::CreateParams params(GetBrowserState()); - web_state_ = base::MakeUnique<WebStateImpl>(params); + web_state_ = std::make_unique<WebStateImpl>(params); web_state_->GetNavigationManagerImpl().InitializeSession(); // Transient item can only be added for pending non-app-specific loads. @@ -60,7 +62,7 @@ GURL url(kTestHostName); std::unique_ptr<MockInterstitialDelegate> delegate = - base::MakeUnique<MockInterstitialDelegate>(); + std::make_unique<MockInterstitialDelegate>(); EXPECT_CALL(*delegate.get(), OnProceed()); // Raw pointer to |interstitial| because it deletes itself when dismissed. @@ -78,7 +80,7 @@ ASSERT_FALSE(web_state_->IsShowingWebInterstitial()); std::unique_ptr<MockInterstitialDelegate> delegate = - base::MakeUnique<MockInterstitialDelegate>(); + std::make_unique<MockInterstitialDelegate>(); EXPECT_CALL(*delegate.get(), OnDontProceed()); // Raw pointer to |interstitial| because it deletes itself when dismissed. @@ -96,7 +98,7 @@ TestWebStateObserver observer(web_state_.get()); std::unique_ptr<MockInterstitialDelegate> delegate = - base::MakeUnique<MockInterstitialDelegate>(); + std::make_unique<MockInterstitialDelegate>(); // Raw pointer to |interstitial| because it deletes itself when dismissed. HtmlWebInterstitialImpl* interstitial = new HtmlWebInterstitialImpl( web_state_.get(), true, GURL(kTestHostName), std::move(delegate)); @@ -111,7 +113,7 @@ // Tests that the interstitial is dismissed when the web state is destroyed. TEST_F(HtmlWebInterstitialImplTest, WebStateDestroyed) { std::unique_ptr<MockInterstitialDelegate> delegate = - base::MakeUnique<MockInterstitialDelegate>(); + std::make_unique<MockInterstitialDelegate>(); // Interstitial should be dismissed if web state is destroyed. EXPECT_CALL(*delegate.get(), OnDontProceed());
diff --git a/ios/web/navigation/crw_navigation_item_holder_unittest.mm b/ios/web/navigation/crw_navigation_item_holder_unittest.mm index b4d4a7e..272369d 100644 --- a/ios/web/navigation/crw_navigation_item_holder_unittest.mm +++ b/ios/web/navigation/crw_navigation_item_holder_unittest.mm
@@ -4,7 +4,6 @@ #import "ios/web/navigation/crw_navigation_item_holder.h" -#include "base/memory/ptr_util.h" #import "ios/web/navigation/navigation_item_impl.h" #include "testing/gtest/include/gtest/gtest.h" #import "testing/gtest_mac.h" @@ -29,7 +28,7 @@ // Tests that stored NavigationItemImpl can be retrieved. TEST_F(CRWNavigationItemHolderTest, SetNavigationItem) { GURL url("http://www.0.com"); - auto navigation_item = base::MakeUnique<web::NavigationItemImpl>(); + auto navigation_item = std::make_unique<web::NavigationItemImpl>(); navigation_item->SetURL(url); WKBackForwardListItem* item = OCMClassMock([WKBackForwardListItem class]); @@ -47,14 +46,14 @@ // Tests that each WKBackForwardListItem has its unique CRWNavigationItemHolder. TEST_F(CRWNavigationItemHolderTest, OneHolderPerWKItem) { GURL url1("http://www.1.com"); - auto navigation_item1 = base::MakeUnique<web::NavigationItemImpl>(); + auto navigation_item1 = std::make_unique<web::NavigationItemImpl>(); navigation_item1->SetURL(url1); WKBackForwardListItem* item1 = OCMClassMock([WKBackForwardListItem class]); [[CRWNavigationItemHolder holderForBackForwardListItem:item1] setNavigationItem:std::move(navigation_item1)]; GURL url2("http://www.2.com"); - auto navigation_item2 = base::MakeUnique<web::NavigationItemImpl>(); + auto navigation_item2 = std::make_unique<web::NavigationItemImpl>(); navigation_item2->SetURL(url2); WKBackForwardListItem* item2 = OCMClassMock([WKBackForwardListItem class]); [[CRWNavigationItemHolder holderForBackForwardListItem:item2]
diff --git a/ios/web/navigation/crw_session_controller.mm b/ios/web/navigation/crw_session_controller.mm index a84f919..8d66f36 100644 --- a/ios/web/navigation/crw_session_controller.mm +++ b/ios/web/navigation/crw_session_controller.mm
@@ -7,12 +7,12 @@ #include <stddef.h> #include <algorithm> +#include <memory> #include <utility> #include "base/format_macros.h" #include "base/logging.h" #import "base/mac/foundation_util.h" -#include "base/memory/ptr_util.h" #include "base/strings/sys_string_conversions.h" #include "ios/web/history_state_util.h" #import "ios/web/navigation/crw_session_controller+private_constructors.h" @@ -494,7 +494,7 @@ 2); for (size_t index = 0; index <= sourceLastCommittedItemIndex; ++index) { mergedItems[index] = - base::MakeUnique<web::NavigationItemImpl>(*sourceItems[index]); + std::make_unique<web::NavigationItemImpl>(*sourceItems[index]); } mergedItems.back() = std::move(_items[self.lastCommittedItemIndex]);
diff --git a/ios/web/navigation/crw_session_controller_unittest.mm b/ios/web/navigation/crw_session_controller_unittest.mm index 2890662..299b68e 100644 --- a/ios/web/navigation/crw_session_controller_unittest.mm +++ b/ios/web/navigation/crw_session_controller_unittest.mm
@@ -6,10 +6,10 @@ #import <Foundation/Foundation.h> +#include <memory> #include <utility> #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/strings/sys_string_conversions.h" #import "ios/web/navigation/crw_session_controller+private_constructors.h" #import "ios/web/navigation/legacy_navigation_manager_impl.h" @@ -65,7 +65,7 @@ void CreateNavigationManagerForSessionController( CRWSessionController* session_controller) { auto navigation_manager = - base::MakeUnique<web::LegacyNavigationManagerImpl>(); + std::make_unique<web::LegacyNavigationManagerImpl>(); navigation_manager->SetBrowserState(&browser_state_); navigation_manager->SetDelegate(&delegate_); navigation_manager->SetSessionController(session_controller); @@ -739,7 +739,7 @@ web::Referrer referrer_object(GURL(referrer), web::ReferrerPolicyDefault); std::unique_ptr<web::NavigationItemImpl> navigation_item = - base::MakeUnique<web::NavigationItemImpl>(); + std::make_unique<web::NavigationItemImpl>(); navigation_item->SetURL(GURL(url)); navigation_item->SetReferrer(referrer_object); navigation_item->SetTitle(base::SysNSStringToUTF16(title));
diff --git a/ios/web/navigation/navigation_manager_impl.mm b/ios/web/navigation/navigation_manager_impl.mm index e56ba9a..826bf84c 100644 --- a/ios/web/navigation/navigation_manager_impl.mm +++ b/ios/web/navigation/navigation_manager_impl.mm
@@ -4,7 +4,6 @@ #import "ios/web/navigation/navigation_manager_impl.h" -#include "base/memory/ptr_util.h" #import "ios/web/navigation/navigation_manager_delegate.h" #import "ios/web/public/web_client.h" #include "ui/base/page_transition_types.h" @@ -347,7 +346,7 @@ loaded_url = url; } - auto item = base::MakeUnique<NavigationItemImpl>(); + auto item = std::make_unique<NavigationItemImpl>(); item->SetOriginalRequestURL(loaded_url); item->SetURL(loaded_url); item->SetReferrer(referrer);
diff --git a/ios/web/navigation/serializable_user_data_manager_impl.mm b/ios/web/navigation/serializable_user_data_manager_impl.mm index d503b47..dc1f249 100644 --- a/ios/web/navigation/serializable_user_data_manager_impl.mm +++ b/ios/web/navigation/serializable_user_data_manager_impl.mm
@@ -5,7 +5,6 @@ #import "ios/web/navigation/serializable_user_data_manager_impl.h" #import "base/mac/foundation_util.h" -#include "base/memory/ptr_util.h" #import "ios/web/public/web_state/web_state.h" #if !defined(__has_feature) || !__has_feature(objc_arc) @@ -38,7 +37,7 @@ web_state->SetUserData( kSerializableUserDataManagerKey, - base::MakeUnique<SerializableUserDataManagerWrapper>()); + std::make_unique<SerializableUserDataManagerWrapper>()); return static_cast<SerializableUserDataManagerWrapper*>( web_state->GetUserData(kSerializableUserDataManagerKey)); } @@ -54,7 +53,7 @@ // static std::unique_ptr<SerializableUserData> SerializableUserData::Create() { - return base::MakeUnique<SerializableUserDataImpl>(); + return std::make_unique<SerializableUserDataImpl>(); } SerializableUserDataImpl::SerializableUserDataImpl() : data_(@{}) {} @@ -138,7 +137,7 @@ std::unique_ptr<SerializableUserData> SerializableUserDataManagerImpl::CreateSerializableUserData() const { - return base::MakeUnique<SerializableUserDataImpl>(data_); + return std::make_unique<SerializableUserDataImpl>(data_); } void SerializableUserDataManagerImpl::AddSerializableUserData(
diff --git a/ios/web/navigation/session_storage_builder.mm b/ios/web/navigation/session_storage_builder.mm index c1f1ee2..795b14b3 100644 --- a/ios/web/navigation/session_storage_builder.mm +++ b/ios/web/navigation/session_storage_builder.mm
@@ -8,7 +8,6 @@ #include "base/logging.h" #include "base/mac/foundation_util.h" -#include "base/memory/ptr_util.h" #import "ios/web/navigation/legacy_navigation_manager_impl.h" #import "ios/web/navigation/navigation_item_impl.h" #import "ios/web/navigation/navigation_item_storage_builder.h" @@ -82,7 +81,7 @@ cert_builder.BuildSessionCertificatePolicyCache( storage.certPolicyCacheStorage); if (!cert_policy_cache) - cert_policy_cache = base::MakeUnique<SessionCertificatePolicyCacheImpl>(); + cert_policy_cache = std::make_unique<SessionCertificatePolicyCacheImpl>(); web_state->certificate_policy_cache_ = std::move(cert_policy_cache); web::SerializableUserDataManager::FromWebState(web_state) ->AddSerializableUserData(storage.userData);
diff --git a/ios/web/navigation/wk_based_navigation_manager_impl_unittest.mm b/ios/web/navigation/wk_based_navigation_manager_impl_unittest.mm index 69fdca8..a8159a5 100644 --- a/ios/web/navigation/wk_based_navigation_manager_impl_unittest.mm +++ b/ios/web/navigation/wk_based_navigation_manager_impl_unittest.mm
@@ -7,7 +7,6 @@ #include <WebKit/WebKit.h> #include <memory> -#include "base/memory/ptr_util.h" #include "base/strings/stringprintf.h" #include "base/strings/sys_string_conversions.h" #include "base/strings/utf_string_conversions.h" @@ -570,10 +569,10 @@ // Tests that non-empty session history can be restored. TEST_F(WKBasedNavigationManagerTest, RestoreSessionWithHistory) { - auto item0 = base::MakeUnique<NavigationItemImpl>(); + auto item0 = std::make_unique<NavigationItemImpl>(); item0->SetURL(GURL("http://www.0.com")); item0->SetTitle(base::ASCIIToUTF16("Test Website 0")); - auto item1 = base::MakeUnique<NavigationItemImpl>(); + auto item1 = std::make_unique<NavigationItemImpl>(); item1->SetURL(GURL("http://www.1.com")); std::vector<std::unique_ptr<NavigationItem>> items; @@ -638,7 +637,7 @@ // Restores a fake session. std::vector<std::unique_ptr<NavigationItem>> items; - items.push_back(base::MakeUnique<NavigationItemImpl>()); + items.push_back(std::make_unique<NavigationItemImpl>()); manager_->Restore(0 /* last_committed_item_index */, std::move(items)); // Check that last_committed_index, previous_item_index and pending_item_index
diff --git a/ios/web/net/cookies/wk_http_system_cookie_store_unittest.mm b/ios/web/net/cookies/wk_http_system_cookie_store_unittest.mm index 1d0ab7a..76f9da0 100644 --- a/ios/web/net/cookies/wk_http_system_cookie_store_unittest.mm +++ b/ios/web/net/cookies/wk_http_system_cookie_store_unittest.mm
@@ -7,6 +7,8 @@ #import <Foundation/Foundation.h> #import <WebKit/Webkit.h> +#include <memory> + #include "ios/net/cookies/system_cookie_store_unittest_template.h" #import "ios/testing/wait_util.h" #include "ios/web/public/test/test_web_thread_bundle.h" @@ -28,7 +30,7 @@ if (@available(iOS 11, *)) { shared_store_ = [WKWebsiteDataStore nonPersistentDataStore].httpCookieStore; - store_ = base::MakeUnique<web::WKHTTPSystemCookieStore>(shared_store_); + store_ = std::make_unique<web::WKHTTPSystemCookieStore>(shared_store_); } }
diff --git a/ios/web/net/request_tracker_impl.mm b/ios/web/net/request_tracker_impl.mm index c0ec4a9..f934e23 100644 --- a/ios/web/net/request_tracker_impl.mm +++ b/ios/web/net/request_tracker_impl.mm
@@ -11,7 +11,6 @@ #include "base/logging.h" #import "base/mac/bind_objc_block.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/strings/sys_string_conversions.h" #include "base/synchronization/lock.h" #include "ios/web/history_state_util.h" @@ -321,7 +320,7 @@ } const GURL& url = request->original_url(); auto counts = - base::MakeUnique<TrackerCounts>(GURLByRemovingRefFromGURL(url), request); + std::make_unique<TrackerCounts>(GURLByRemovingRefFromGURL(url), request); counts_by_request_[request] = counts.get(); counts_.push_back(std::move(counts)); if (page_url_.SchemeIsCryptographic() && !url.SchemeIsCryptographic())
diff --git a/ios/web/net/request_tracker_impl_unittest.mm b/ios/web/net/request_tracker_impl_unittest.mm index e0893bc..287f933 100644 --- a/ios/web/net/request_tracker_impl_unittest.mm +++ b/ios/web/net/request_tracker_impl_unittest.mm
@@ -187,7 +187,7 @@ url = GetURL(requests_.size()); while (i >= requests_.size()) { - contexts_.push_back(base::MakeUnique<net::URLRequestContext>()); + contexts_.push_back(std::make_unique<net::URLRequestContext>()); requests_.push_back(contexts_[i]->CreateRequest( url, net::DEFAULT_PRIORITY, &request_delegate_));
diff --git a/ios/web/public/ssl_status_unittest.cc b/ios/web/public/ssl_status_unittest.cc index 19a0529..763248d 100644 --- a/ios/web/public/ssl_status_unittest.cc +++ b/ios/web/public/ssl_status_unittest.cc
@@ -4,7 +4,6 @@ #include "ios/web/public/ssl_status.h" -#include "base/memory/ptr_util.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" @@ -23,7 +22,7 @@ int value() { return value_; } std::unique_ptr<SSLStatus::UserData> Clone() override { - return base::MakeUnique<TrivialUserData>(value_); + return std::make_unique<TrivialUserData>(value_); } private: @@ -53,7 +52,7 @@ // Verify a copied SSLStatus still Equals() the original after a UserData is // assigned to it. - copied_status.user_data = base::MakeUnique<TrivialUserData>(); + copied_status.user_data = std::make_unique<TrivialUserData>(); EXPECT_TRUE(status.Equals(copied_status)); EXPECT_TRUE(copied_status.Equals(status)); } @@ -62,7 +61,7 @@ TEST_F(SSLStatusTest, SSLStatusCloningTest) { const int kMagic = 1234; SSLStatus status; - status.user_data = base::MakeUnique<TrivialUserData>(kMagic); + status.user_data = std::make_unique<TrivialUserData>(kMagic); // Verify that copying a SSLStatus with a UserData assigned will Clone() // the UserData to the new copy.
diff --git a/ios/web/public/test/fakes/crw_test_web_state_observer.mm b/ios/web/public/test/fakes/crw_test_web_state_observer.mm index 9c51cf34..15b6f1f 100644 --- a/ios/web/public/test/fakes/crw_test_web_state_observer.mm +++ b/ios/web/public/test/fakes/crw_test_web_state_observer.mm
@@ -4,7 +4,8 @@ #import "ios/web/public/test/fakes/crw_test_web_state_observer.h" -#include "base/memory/ptr_util.h" +#include <memory> + #include "ios/web/public/web_state/form_activity_params.h" #import "ios/web/public/web_state/navigation_context.h" #import "ios/web/web_state/navigation_context_impl.h" @@ -156,7 +157,7 @@ - (void)webState:(web::WebState*)webState didPruneNavigationItemsWithCount:(size_t)pruned_item_count { _navigationItemsPrunedInfo = - base::MakeUnique<web::TestNavigationItemsPrunedInfo>(); + std::make_unique<web::TestNavigationItemsPrunedInfo>(); _navigationItemsPrunedInfo->web_state = webState; _navigationItemsPrunedInfo->count = pruned_item_count; } @@ -164,7 +165,7 @@ - (void)webState:(web::WebState*)webState didStartNavigation:(web::NavigationContext*)navigation { ASSERT_TRUE(!navigation->GetError() || !navigation->IsSameDocument()); - _didStartNavigationInfo = base::MakeUnique<web::TestDidStartNavigationInfo>(); + _didStartNavigationInfo = std::make_unique<web::TestDidStartNavigationInfo>(); _didStartNavigationInfo->web_state = webState; std::unique_ptr<web::NavigationContextImpl> context = web::NavigationContextImpl::CreateNavigationContext( @@ -178,7 +179,7 @@ - (void)webState:(web::WebState*)webState didCommitNavigationWithDetails: (const web::LoadCommittedDetails&)load_details { - _commitNavigationInfo = base::MakeUnique<web::TestCommitNavigationInfo>(); + _commitNavigationInfo = std::make_unique<web::TestCommitNavigationInfo>(); _commitNavigationInfo->web_state = webState; _commitNavigationInfo->load_details = load_details; } @@ -187,7 +188,7 @@ didFinishNavigation:(web::NavigationContext*)navigation { ASSERT_TRUE(!navigation->GetError() || !navigation->IsSameDocument()); _didFinishNavigationInfo = - base::MakeUnique<web::TestDidFinishNavigationInfo>(); + std::make_unique<web::TestDidFinishNavigationInfo>(); _didFinishNavigationInfo->web_state = webState; std::unique_ptr<web::NavigationContextImpl> context = web::NavigationContextImpl::CreateNavigationContext( @@ -199,7 +200,7 @@ } - (void)webState:(web::WebState*)webState didLoadPageWithSuccess:(BOOL)success { - _loadPageInfo = base::MakeUnique<web::TestLoadPageInfo>(); + _loadPageInfo = std::make_unique<web::TestLoadPageInfo>(); _loadPageInfo->web_state = webState; _loadPageInfo->success = success; } @@ -207,24 +208,24 @@ - (void)webState:(web::WebState*)webState didChangeLoadingProgress:(double)progress { _changeLoadingProgressInfo = - base::MakeUnique<web::TestChangeLoadingProgressInfo>(); + std::make_unique<web::TestChangeLoadingProgressInfo>(); _changeLoadingProgressInfo->web_state = webState; _changeLoadingProgressInfo->progress = progress; } - (void)webStateDidChangeTitle:(web::WebState*)webState { - _titleWasSetInfo = base::MakeUnique<web::TestTitleWasSetInfo>(); + _titleWasSetInfo = std::make_unique<web::TestTitleWasSetInfo>(); _titleWasSetInfo->web_state = webState; } - (void)webStateDidChangeVisibleSecurityState:(web::WebState*)webState { _didChangeVisibleSecurityStateInfo = - base::MakeUnique<web::TestDidChangeVisibleSecurityStateInfo>(); + std::make_unique<web::TestDidChangeVisibleSecurityStateInfo>(); _didChangeVisibleSecurityStateInfo->web_state = webState; } - (void)webStateDidSuppressDialog:(web::WebState*)webState { - _didSuppressDialogInfo = base::MakeUnique<web::TestDidSuppressDialogInfo>(); + _didSuppressDialogInfo = std::make_unique<web::TestDidSuppressDialogInfo>(); _didSuppressDialogInfo->web_state = webState; } @@ -232,7 +233,7 @@ didSubmitDocumentWithFormNamed:(const std::string&)formName userInitiated:(BOOL)userInitiated isMainFrame:(BOOL)isMainFrame { - _submitDocumentInfo = base::MakeUnique<web::TestSubmitDocumentInfo>(); + _submitDocumentInfo = std::make_unique<web::TestSubmitDocumentInfo>(); _submitDocumentInfo->web_state = webState; _submitDocumentInfo->form_name = formName; _submitDocumentInfo->user_initiated = userInitiated; @@ -241,7 +242,7 @@ - (void)webState:(web::WebState*)webState didRegisterFormActivity:(const web::FormActivityParams&)params { - _formActivityInfo = base::MakeUnique<web::TestFormActivityInfo>(); + _formActivityInfo = std::make_unique<web::TestFormActivityInfo>(); _formActivityInfo->web_state = webState; _formActivityInfo->form_activity = params; } @@ -250,28 +251,28 @@ didUpdateFaviconURLCandidates: (const std::vector<web::FaviconURL>&)candidates { _updateFaviconUrlCandidatesInfo = - base::MakeUnique<web::TestUpdateFaviconUrlCandidatesInfo>(); + std::make_unique<web::TestUpdateFaviconUrlCandidatesInfo>(); _updateFaviconUrlCandidatesInfo->web_state = webState; _updateFaviconUrlCandidatesInfo->candidates = candidates; } - (void)renderProcessGoneForWebState:(web::WebState*)webState { - _renderProcessGoneInfo = base::MakeUnique<web::TestRenderProcessGoneInfo>(); + _renderProcessGoneInfo = std::make_unique<web::TestRenderProcessGoneInfo>(); _renderProcessGoneInfo->web_state = webState; } - (void)webStateDestroyed:(web::WebState*)webState { - _webStateDestroyedInfo = base::MakeUnique<web::TestWebStateDestroyedInfo>(); + _webStateDestroyedInfo = std::make_unique<web::TestWebStateDestroyedInfo>(); _webStateDestroyedInfo->web_state = webState; } - (void)webStateDidStopLoading:(web::WebState*)webState { - _stopLoadingInfo = base::MakeUnique<web::TestStopLoadingInfo>(); + _stopLoadingInfo = std::make_unique<web::TestStopLoadingInfo>(); _stopLoadingInfo->web_state = webState; } - (void)webStateDidStartLoading:(web::WebState*)webState { - _startLoadingInfo = base::MakeUnique<web::TestStartLoadingInfo>(); + _startLoadingInfo = std::make_unique<web::TestStartLoadingInfo>(); _startLoadingInfo->web_state = webState; }
diff --git a/ios/web/public/test/fakes/test_web_state_delegate.mm b/ios/web/public/test/fakes/test_web_state_delegate.mm index 32f5fa5..3ce069c 100644 --- a/ios/web/public/test/fakes/test_web_state_delegate.mm +++ b/ios/web/public/test/fakes/test_web_state_delegate.mm
@@ -4,7 +4,6 @@ #import "ios/web/public/test/fakes/test_web_state_delegate.h" -#include "base/memory/ptr_util.h" #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support." @@ -46,7 +45,7 @@ const GURL& opener_url, bool initiated_by_user) { last_create_new_web_state_request_ = - base::MakeUnique<TestCreateNewWebStateRequest>(); + std::make_unique<TestCreateNewWebStateRequest>(); last_create_new_web_state_request_->web_state = source; last_create_new_web_state_request_->url = url; last_create_new_web_state_request_->opener_url = opener_url; @@ -67,7 +66,7 @@ } void TestWebStateDelegate::CloseWebState(WebState* source) { - last_close_web_state_request_ = base::MakeUnique<TestCloseWebStateRequest>(); + last_close_web_state_request_ = std::make_unique<TestCloseWebStateRequest>(); last_close_web_state_request_->web_state = source; // Remove WebState from |child_windows_|. @@ -83,7 +82,7 @@ WebState* TestWebStateDelegate::OpenURLFromWebState( WebState* web_state, const WebState::OpenURLParams& params) { - last_open_url_request_ = base::MakeUnique<TestOpenURLRequest>(); + last_open_url_request_ = std::make_unique<TestOpenURLRequest>(); last_open_url_request_->web_state = web_state; last_open_url_request_->params = params; return nullptr; @@ -103,7 +102,7 @@ void TestWebStateDelegate::ShowRepostFormWarningDialog( WebState* source, const base::Callback<void(bool)>& callback) { - last_repost_form_request_ = base::MakeUnique<TestRepostFormRequest>(); + last_repost_form_request_ = std::make_unique<TestRepostFormRequest>(); last_repost_form_request_->web_state = source; last_repost_form_request_->callback = callback; } @@ -118,7 +117,7 @@ NSURLProtectionSpace* protection_space, NSURLCredential* credential, const AuthCallback& callback) { - last_authentication_request_ = base::MakeUnique<TestAuthenticationRequest>(); + last_authentication_request_ = std::make_unique<TestAuthenticationRequest>(); last_authentication_request_->web_state = source; last_authentication_request_->protection_space = protection_space; last_authentication_request_->credential = credential;
diff --git a/ios/web/public/test/fakes/test_web_state_observer.mm b/ios/web/public/test/fakes/test_web_state_observer.mm index 3033ed0..7faa1a8 100644 --- a/ios/web/public/test/fakes/test_web_state_observer.mm +++ b/ios/web/public/test/fakes/test_web_state_observer.mm
@@ -4,7 +4,8 @@ #include "ios/web/public/test/fakes/test_web_state_observer.h" -#include "base/memory/ptr_util.h" +#include <memory> + #include "ios/web/public/web_state/form_activity_params.h" #import "ios/web/public/web_state/navigation_context.h" #include "ios/web/public/web_state/web_state.h" @@ -32,13 +33,13 @@ void TestWebStateObserver::WasShown(WebState* web_state) { ASSERT_EQ(web_state_, web_state); - was_shown_info_ = base::MakeUnique<web::TestWasShownInfo>(); + was_shown_info_ = std::make_unique<web::TestWasShownInfo>(); was_shown_info_->web_state = web_state; } void TestWebStateObserver::WasHidden(WebState* web_state) { ASSERT_EQ(web_state_, web_state); - was_hidden_info_ = base::MakeUnique<web::TestWasHiddenInfo>(); + was_hidden_info_ = std::make_unique<web::TestWasHiddenInfo>(); was_hidden_info_->web_state = web_state; } @@ -46,7 +47,7 @@ WebState* web_state, const LoadCommittedDetails& load_details) { ASSERT_EQ(web_state_, web_state); - commit_navigation_info_ = base::MakeUnique<web::TestCommitNavigationInfo>(); + commit_navigation_info_ = std::make_unique<web::TestCommitNavigationInfo>(); commit_navigation_info_->web_state = web_state; commit_navigation_info_->load_details = load_details; } @@ -55,7 +56,7 @@ WebState* web_state, PageLoadCompletionStatus load_completion_status) { ASSERT_EQ(web_state_, web_state); - load_page_info_ = base::MakeUnique<web::TestLoadPageInfo>(); + load_page_info_ = std::make_unique<web::TestLoadPageInfo>(); load_page_info_->web_state = web_state; load_page_info_->success = load_completion_status == PageLoadCompletionStatus::SUCCESS; @@ -65,7 +66,7 @@ double progress) { ASSERT_EQ(web_state_, web_state); change_loading_progress_info_ = - base::MakeUnique<web::TestChangeLoadingProgressInfo>(); + std::make_unique<web::TestChangeLoadingProgressInfo>(); change_loading_progress_info_->web_state = web_state; change_loading_progress_info_->progress = progress; } @@ -74,7 +75,7 @@ size_t pruned_item_count) { ASSERT_EQ(web_state_, web_state); navigation_items_pruned_info_ = - base::MakeUnique<web::TestNavigationItemsPrunedInfo>(); + std::make_unique<web::TestNavigationItemsPrunedInfo>(); navigation_items_pruned_info_->web_state = web_state; navigation_items_pruned_info_->count = pruned_item_count; } @@ -82,7 +83,7 @@ void TestWebStateObserver::NavigationItemChanged(WebState* web_state) { ASSERT_EQ(web_state_, web_state); navigation_item_changed_info_ = - base::MakeUnique<web::TestNavigationItemChangedInfo>(); + std::make_unique<web::TestNavigationItemChangedInfo>(); navigation_item_changed_info_->web_state = web_state; } @@ -91,7 +92,7 @@ ASSERT_EQ(web_state_, web_state); ASSERT_TRUE(!navigation->GetError() || !navigation->IsSameDocument()); did_start_navigation_info_ = - base::MakeUnique<web::TestDidStartNavigationInfo>(); + std::make_unique<web::TestDidStartNavigationInfo>(); did_start_navigation_info_->web_state = web_state; std::unique_ptr<web::NavigationContextImpl> context = web::NavigationContextImpl::CreateNavigationContext( @@ -107,7 +108,7 @@ ASSERT_EQ(web_state_, web_state); ASSERT_TRUE(!navigation->GetError() || !navigation->IsSameDocument()); did_finish_navigation_info_ = - base::MakeUnique<web::TestDidFinishNavigationInfo>(); + std::make_unique<web::TestDidFinishNavigationInfo>(); did_finish_navigation_info_->web_state = web_state; std::unique_ptr<web::NavigationContextImpl> context = web::NavigationContextImpl::CreateNavigationContext( @@ -120,21 +121,21 @@ void TestWebStateObserver::TitleWasSet(WebState* web_state) { ASSERT_EQ(web_state_, web_state); - title_was_set_info_ = base::MakeUnique<web::TestTitleWasSetInfo>(); + title_was_set_info_ = std::make_unique<web::TestTitleWasSetInfo>(); title_was_set_info_->web_state = web_state; } void TestWebStateObserver::DidChangeVisibleSecurityState(WebState* web_state) { ASSERT_EQ(web_state_, web_state); did_change_visible_security_state_info_ = - base::MakeUnique<web::TestDidChangeVisibleSecurityStateInfo>(); + std::make_unique<web::TestDidChangeVisibleSecurityStateInfo>(); did_change_visible_security_state_info_->web_state = web_state; } void TestWebStateObserver::DidSuppressDialog(WebState* web_state) { ASSERT_EQ(web_state_, web_state); did_suppress_dialog_info_ = - base::MakeUnique<web::TestDidSuppressDialogInfo>(); + std::make_unique<web::TestDidSuppressDialogInfo>(); did_suppress_dialog_info_->web_state = web_state; } @@ -143,7 +144,7 @@ bool user_initiated, bool is_main_frame) { ASSERT_EQ(web_state_, web_state); - submit_document_info_ = base::MakeUnique<web::TestSubmitDocumentInfo>(); + submit_document_info_ = std::make_unique<web::TestSubmitDocumentInfo>(); submit_document_info_->web_state = web_state; submit_document_info_->form_name = form_name; submit_document_info_->user_initiated = user_initiated; @@ -154,7 +155,7 @@ WebState* web_state, const FormActivityParams& params) { ASSERT_EQ(web_state_, web_state); - form_activity_info_ = base::MakeUnique<web::TestFormActivityInfo>(); + form_activity_info_ = std::make_unique<web::TestFormActivityInfo>(); form_activity_info_->web_state = web_state; form_activity_info_->form_activity = params; } @@ -164,7 +165,7 @@ const std::vector<FaviconURL>& candidates) { ASSERT_EQ(web_state_, web_state); update_favicon_url_candidates_info_ = - base::MakeUnique<web::TestUpdateFaviconUrlCandidatesInfo>(); + std::make_unique<web::TestUpdateFaviconUrlCandidatesInfo>(); update_favicon_url_candidates_info_->web_state = web_state; update_favicon_url_candidates_info_->candidates = candidates; } @@ -172,7 +173,7 @@ void TestWebStateObserver::RenderProcessGone(WebState* web_state) { ASSERT_EQ(web_state_, web_state); render_process_gone_info_ = - base::MakeUnique<web::TestRenderProcessGoneInfo>(); + std::make_unique<web::TestRenderProcessGoneInfo>(); render_process_gone_info_->web_state = web_state; } @@ -180,7 +181,7 @@ ASSERT_EQ(web_state_, web_state); EXPECT_TRUE(web_state->IsBeingDestroyed()); web_state_destroyed_info_ = - base::MakeUnique<web::TestWebStateDestroyedInfo>(); + std::make_unique<web::TestWebStateDestroyedInfo>(); web_state_destroyed_info_->web_state = web_state; web_state_->RemoveObserver(this); web_state_ = nullptr; @@ -188,13 +189,13 @@ void TestWebStateObserver::DidStartLoading(WebState* web_state) { ASSERT_EQ(web_state_, web_state); - start_loading_info_ = base::MakeUnique<web::TestStartLoadingInfo>(); + start_loading_info_ = std::make_unique<web::TestStartLoadingInfo>(); start_loading_info_->web_state = web_state; } void TestWebStateObserver::DidStopLoading(WebState* web_state) { ASSERT_EQ(web_state_, web_state); - stop_loading_info_ = base::MakeUnique<web::TestStopLoadingInfo>(); + stop_loading_info_ = std::make_unique<web::TestStopLoadingInfo>(); stop_loading_info_->web_state = web_state; }
diff --git a/ios/web/public/test/http_server/blank_page_response_provider.mm b/ios/web/public/test/http_server/blank_page_response_provider.mm index 8b28895..dbc4158 100644 --- a/ios/web/public/test/http_server/blank_page_response_provider.mm +++ b/ios/web/public/test/http_server/blank_page_response_provider.mm
@@ -6,7 +6,6 @@ #include <map> -#include "base/memory/ptr_util.h" #import "ios/web/public/test/http_server/html_response_provider.h" #include "url/gurl.h" @@ -24,7 +23,7 @@ const GURL& url) { std::map<GURL, std::string> responses; responses[url] = kBlankTestPageHtml; - return base::MakeUnique<HtmlResponseProvider>(responses); + return std::make_unique<HtmlResponseProvider>(responses); } } // namespace test
diff --git a/ios/web/public/test/http_server/data_response_provider.mm b/ios/web/public/test/http_server/data_response_provider.mm index 8edfe34..ebf6119 100644 --- a/ios/web/public/test/http_server/data_response_provider.mm +++ b/ios/web/public/test/http_server/data_response_provider.mm
@@ -4,7 +4,8 @@ #import "ios/web/public/test/http_server/data_response_provider.h" -#include "base/memory/ptr_util.h" +#include <memory> + #include "base/strings/sys_string_conversions.h" #if !defined(__has_feature) || !__has_feature(objc_arc) @@ -20,7 +21,7 @@ GetResponseHeadersAndBody(request, &response_headers, &response_body); std::unique_ptr<net::test_server::BasicHttpResponse> data_response = - base::MakeUnique<net::test_server::BasicHttpResponse>(); + std::make_unique<net::test_server::BasicHttpResponse>(); data_response->set_code( static_cast<net::HttpStatusCode>(response_headers->response_code()));
diff --git a/ios/web/public/test/http_server/delayed_response_provider.mm b/ios/web/public/test/http_server/delayed_response_provider.mm index 83f34bae..708b51b 100644 --- a/ios/web/public/test/http_server/delayed_response_provider.mm +++ b/ios/web/public/test/http_server/delayed_response_provider.mm
@@ -8,7 +8,6 @@ #include "base/bind.h" #import "base/mac/foundation_util.h" -#include "base/memory/ptr_util.h" #include "base/threading/thread_task_runner_handle.h" #include "net/test/embedded_test_server/http_response.h" @@ -53,7 +52,7 @@ std::unique_ptr<net::test_server::HttpResponse> DelayedResponseProvider::GetEmbeddedTestServerResponse(const Request& request) { std::unique_ptr<net::test_server::BasicHttpResponse> http_response( - base::MakeUnique<DelayedHttpResponse>(delay_)); + std::make_unique<DelayedHttpResponse>(delay_)); http_response->set_content_type("text/html"); http_response->set_content("Slow Page"); return std::move(http_response);
diff --git a/ios/web/public/test/http_server/http_server.mm b/ios/web/public/test/http_server/http_server.mm index aaa2a448..d59145d 100644 --- a/ios/web/public/test/http_server/http_server.mm +++ b/ios/web/public/test/http_server/http_server.mm
@@ -9,7 +9,6 @@ #include <string> #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/path_service.h" #include "base/strings/string_number_conversions.h" #include "base/strings/sys_string_conversions.h" @@ -75,7 +74,7 @@ std::unique_ptr<net::test_server::HttpResponse> HttpServer::GetResponse( const net::test_server::HttpRequest& request) { if (isSuspended) { - return base::MakeUnique<net::test_server::HungResponse>(); + return std::make_unique<net::test_server::HungResponse>(); } ResponseProvider::Request provider_request = ResponseProviderRequestFromEmbeddedTestServerRequest(request); @@ -107,7 +106,7 @@ // Registers request handler which serves files from the http test files // directory. The current tests calls full path relative to DIR_SOURCE_ROOT. // Registers the DIR_SOURCE_ROOT to avoid massive test changes. - embedded_test_server_ = base::MakeUnique<net::EmbeddedTestServer>(); + embedded_test_server_ = std::make_unique<net::EmbeddedTestServer>(); embedded_test_server_->ServeFilesFromSourceDirectory("."); embedded_test_server_->RegisterDefaultHandler(
diff --git a/ios/web/public/test/http_server/http_server_util.mm b/ios/web/public/test/http_server/http_server_util.mm index af41f8726..e0d9a58 100644 --- a/ios/web/public/test/http_server/http_server_util.mm +++ b/ios/web/public/test/http_server/http_server_util.mm
@@ -4,7 +4,8 @@ #include "ios/web/public/test/http_server/http_server_util.h" -#include "base/memory/ptr_util.h" +#include <memory> + #include "base/path_service.h" #import "ios/web/public/test/http_server/html_response_provider.h" #import "ios/web/public/test/http_server/http_server.h" @@ -17,12 +18,12 @@ namespace test { void SetUpSimpleHttpServer(const std::map<GURL, std::string>& responses) { - SetUpHttpServer(base::MakeUnique<HtmlResponseProvider>(responses)); + SetUpHttpServer(std::make_unique<HtmlResponseProvider>(responses)); } void SetUpSimpleHttpServerWithSetCookies( const std::map<GURL, std::pair<std::string, std::string>>& responses) { - SetUpHttpServer(base::MakeUnique<HtmlResponseProvider>(responses)); + SetUpHttpServer(std::make_unique<HtmlResponseProvider>(responses)); } // TODO(crbug.com/694859): Cleanup tests and remove the function. Not
diff --git a/ios/web/public/test/web_test.mm b/ios/web/public/test/web_test.mm index f51b9b4..c031f5a 100644 --- a/ios/web/public/test/web_test.mm +++ b/ios/web/public/test/web_test.mm
@@ -28,7 +28,7 @@ WebTest::WebTest(std::unique_ptr<web::WebClient> web_client) : web_client_(std::move(web_client)), - crash_observer_(base::MakeUnique<WebTestRenderProcessCrashObserver>()) {} + crash_observer_(std::make_unique<WebTestRenderProcessCrashObserver>()) {} WebTest::~WebTest() {} @@ -44,7 +44,7 @@ if (allow) { crash_observer_ = nullptr; } else { - crash_observer_ = base::MakeUnique<WebTestRenderProcessCrashObserver>(); + crash_observer_ = std::make_unique<WebTestRenderProcessCrashObserver>(); } }
diff --git a/ios/web/service_manager_connection_impl.cc b/ios/web/service_manager_connection_impl.cc index 4af8aa12..557d161 100644 --- a/ios/web/service_manager_connection_impl.cc +++ b/ios/web/service_manager_connection_impl.cc
@@ -12,7 +12,6 @@ #include "base/callback_helpers.h" #include "base/lazy_instance.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/message_loop/message_loop.h" #include "base/threading/thread_checker.h" #include "base/threading/thread_task_runner_handle.h" @@ -132,7 +131,7 @@ DCHECK(io_thread_checker_.CalledOnValidThread()); DCHECK(!service_context_); service_context_.reset(new service_manager::ServiceContext( - base::MakeUnique<service_manager::ForwardingService>(this), + std::make_unique<service_manager::ForwardingService>(this), std::move(pending_service_request_), std::move(io_thread_connector_), std::move(pending_connector_request_))); @@ -171,7 +170,7 @@ const service_manager::EmbeddedServiceInfo& info) { DCHECK(io_thread_checker_.CalledOnValidThread()); auto service = - base::MakeUnique<service_manager::EmbeddedServiceRunner>(name, info); + std::make_unique<service_manager::EmbeddedServiceRunner>(name, info); AddServiceRequestHandlerOnIoThread( name, base::Bind(&service_manager::EmbeddedServiceRunner::BindServiceRequest, @@ -290,7 +289,7 @@ std::unique_ptr<ServiceManagerConnection> ServiceManagerConnection::Create( service_manager::mojom::ServiceRequest request, scoped_refptr<base::SequencedTaskRunner> io_task_runner) { - return base::MakeUnique<ServiceManagerConnectionImpl>(std::move(request), + return std::make_unique<ServiceManagerConnectionImpl>(std::move(request), io_task_runner); }
diff --git a/ios/web/service_manager_connection_impl_unittest.cc b/ios/web/service_manager_connection_impl_unittest.cc index cd265f9..4b190e3 100644 --- a/ios/web/service_manager_connection_impl_unittest.cc +++ b/ios/web/service_manager_connection_impl_unittest.cc
@@ -22,7 +22,7 @@ std::unique_ptr<service_manager::Service> LaunchService( base::WaitableEvent* event) { event->Signal(); - return base::MakeUnique<service_manager::Service>(); + return std::make_unique<service_manager::Service>(); } } // namespace
diff --git a/ios/web/service_manager_context.mm b/ios/web/service_manager_context.mm index 4b87e66..b36abf6 100644 --- a/ios/web/service_manager_context.mm +++ b/ios/web/service_manager_context.mm
@@ -14,7 +14,6 @@ #include "base/json/json_reader.h" #include "base/lazy_instance.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/process/process_handle.h" #include "base/single_thread_task_runner.h" #include "base/strings/utf_string_conversions.h" @@ -126,7 +125,7 @@ std::unique_ptr<BuiltinManifestProvider> manifest_provider, service_manager::mojom::ServicePtrInfo packaged_services_service_info) { manifest_provider_ = std::move(manifest_provider); - service_manager_ = base::MakeUnique<service_manager::ServiceManager>( + service_manager_ = std::make_unique<service_manager::ServiceManager>( nullptr, nullptr, manifest_provider_.get()); service_manager::mojom::ServicePtr packaged_services_service; @@ -152,7 +151,7 @@ service_manager::mojom::ServiceRequest packaged_services_request; DCHECK(!service_manager::ServiceManagerIsRemote()); std::unique_ptr<BuiltinManifestProvider> manifest_provider = - base::MakeUnique<BuiltinManifestProvider>(); + std::make_unique<BuiltinManifestProvider>(); const std::array<ManifestInfo, 3> manifests = {{ {mojom::kBrowserServiceName, IDR_MOJO_WEB_BROWSER_MANIFEST},
diff --git a/ios/web/shell/app_delegate.mm b/ios/web/shell/app_delegate.mm index 6e241c40..adc543f5 100644 --- a/ios/web/shell/app_delegate.mm +++ b/ios/web/shell/app_delegate.mm
@@ -6,7 +6,6 @@ #include <memory> -#include "base/memory/ptr_util.h" #include "ios/web/public/app/web_main.h" #import "ios/web/public/web_client.h" #import "ios/web/public/web_state/web_state.h" @@ -39,7 +38,7 @@ _delegate.reset(new web::ShellMainDelegate()); web::WebMainParams params(_delegate.get()); - _webMain = base::MakeUnique<web::WebMain>(std::move(params)); + _webMain = std::make_unique<web::WebMain>(std::move(params)); web::ShellWebClient* client = static_cast<web::ShellWebClient*>(web::GetWebClient());
diff --git a/ios/web/shell/shell_url_request_context_getter.mm b/ios/web/shell/shell_url_request_context_getter.mm index fb9ffa08..ccc66f60 100644 --- a/ios/web/shell/shell_url_request_context_getter.mm +++ b/ios/web/shell/shell_url_request_context_getter.mm
@@ -86,7 +86,7 @@ std::string user_agent = web::GetWebClient()->GetUserAgent(web::UserAgentType::MOBILE); storage_->set_http_user_agent_settings( - base::MakeUnique<net::StaticHttpUserAgentSettings>("en-us,en", + std::make_unique<net::StaticHttpUserAgentSettings>("en-us,en", user_agent)); storage_->set_proxy_service( net::ProxyService::CreateUsingSystemProxyResolver( @@ -95,7 +95,7 @@ storage_->set_cert_verifier(net::CertVerifier::CreateDefault()); storage_->set_transport_security_state( - base::MakeUnique<net::TransportSecurityState>()); + std::make_unique<net::TransportSecurityState>()); storage_->set_cert_transparency_verifier( base::WrapUnique(new net::MultiLogCTVerifier)); storage_->set_ct_policy_enforcer( @@ -105,7 +105,7 @@ url_request_context_->transport_security_state(), base_path_, base::CreateSequencedTaskRunnerWithTraits( {base::MayBlock(), base::TaskPriority::BACKGROUND})); - storage_->set_channel_id_service(base::MakeUnique<net::ChannelIDService>( + storage_->set_channel_id_service(std::make_unique<net::ChannelIDService>( new net::DefaultChannelIDStore(nullptr))); storage_->set_http_server_properties( std::unique_ptr<net::HttpServerProperties>( @@ -147,9 +147,9 @@ net::DISK_CACHE, net::CACHE_BACKEND_DEFAULT, cache_path, 0)); storage_->set_http_network_session( - base::MakeUnique<net::HttpNetworkSession>( + std::make_unique<net::HttpNetworkSession>( net::HttpNetworkSession::Params(), network_session_context)); - storage_->set_http_transaction_factory(base::MakeUnique<net::HttpCache>( + storage_->set_http_transaction_factory(std::make_unique<net::HttpCache>( storage_->http_network_session(), std::move(main_backend), true /* set_up_quic_server_info */));
diff --git a/ios/web/shell/shell_web_client.mm b/ios/web/shell/shell_web_client.mm index bbd9038..53286a1 100644 --- a/ios/web/shell/shell_web_client.mm +++ b/ios/web/shell/shell_web_client.mm
@@ -7,7 +7,6 @@ #import <UIKit/UIKit.h> #include "base/json/json_reader.h" -#include "base/memory/ptr_util.h" #include "ios/web/public/service_names.mojom.h" #include "ios/web/public/user_agent.h" #include "ios/web/public/web_state/web_state.h" @@ -35,7 +34,7 @@ static void Create(mojo::InterfaceRequest<mojom::WebUsageController> request, WebState* web_state) { - mojo::MakeStrongBinding(base::MakeUnique<WebUsageController>(web_state), + mojo::MakeStrongBinding(std::make_unique<WebUsageController>(web_state), std::move(request)); } @@ -57,7 +56,7 @@ } std::unique_ptr<web::WebMainParts> ShellWebClient::CreateWebMainParts() { - auto web_main_parts = base::MakeUnique<ShellWebMainParts>(); + auto web_main_parts = std::make_unique<ShellWebMainParts>(); web_main_parts_ = web_main_parts.get(); return web_main_parts; } @@ -159,9 +158,9 @@ } void ShellWebClient::InitMainFrameInterfaces() { - main_frame_interfaces_ = base::MakeUnique<service_manager::BinderRegistry>(); + main_frame_interfaces_ = std::make_unique<service_manager::BinderRegistry>(); main_frame_interfaces_parameterized_ = - base::MakeUnique<service_manager::BinderRegistryWithArgs<WebState*>>(); + std::make_unique<service_manager::BinderRegistryWithArgs<WebState*>>(); main_frame_interfaces_parameterized_->AddInterface( base::Bind(WebUsageController::Create)); }
diff --git a/ios/web/test/test_web_thread_bundle.cc b/ios/web/test/test_web_thread_bundle.cc index 22883ff..fc6541f 100644 --- a/ios/web/test/test_web_thread_bundle.cc +++ b/ios/web/test/test_web_thread_bundle.cc
@@ -4,7 +4,8 @@ #include "ios/web/public/test/test_web_thread_bundle.h" -#include "base/memory/ptr_util.h" +#include <memory> + #include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "base/test/scoped_task_environment.h" @@ -49,7 +50,7 @@ void TestWebThreadBundle::Init(int options) { scoped_task_environment_ = - base::MakeUnique<base::test::ScopedTaskEnvironment>( + std::make_unique<base::test::ScopedTaskEnvironment>( options & TestWebThreadBundle::IO_MAINLOOP ? base::test::ScopedTaskEnvironment::MainThreadType::IO : base::test::ScopedTaskEnvironment::MainThreadType::UI);
diff --git a/ios/web/web_state/http_auth_inttest.mm b/ios/web/web_state/http_auth_inttest.mm index 5b28b77..92cae78 100644 --- a/ios/web/web_state/http_auth_inttest.mm +++ b/ios/web/web_state/http_auth_inttest.mm
@@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/memory/ptr_util.h" +#include <memory> + #include "base/strings/sys_string_conversions.h" #include "base/test/ios/wait_util.h" #import "ios/web/public/navigation_manager.h" @@ -54,7 +55,7 @@ TEST_F(HttpAuthTest, SuccessfullBasicAuth) { // Load the page which requests basic HTTP authentication. GURL url = HttpServer::MakeUrl("http://good-auth"); - test::SetUpHttpServer(base::MakeUnique<HttpAuthResponseProvider>( + test::SetUpHttpServer(std::make_unique<HttpAuthResponseProvider>( url, "GoodRealm", "gooduser", "goodpass")); LoadUrlWithAuthChallenge(url); @@ -87,7 +88,7 @@ TEST_F(HttpAuthTest, UnsucessfulBasicAuth) { // Load the page which requests basic HTTP authentication. GURL url = HttpServer::MakeUrl("http://bad-auth"); - test::SetUpHttpServer(base::MakeUnique<HttpAuthResponseProvider>( + test::SetUpHttpServer(std::make_unique<HttpAuthResponseProvider>( url, "BadRealm", "baduser", "badpass")); LoadUrlWithAuthChallenge(url);
diff --git a/ios/web/web_state/navigation_and_load_callbacks_inttest.mm b/ios/web/web_state/navigation_and_load_callbacks_inttest.mm index ef931a8..3fcefeb 100644 --- a/ios/web/web_state/navigation_and_load_callbacks_inttest.mm +++ b/ios/web/web_state/navigation_and_load_callbacks_inttest.mm
@@ -5,7 +5,6 @@ #include <memory> #include <string> -#include "base/memory/ptr_util.h" #include "base/scoped_observer.h" #include "base/strings/stringprintf.h" #import "ios/testing/wait_util.h" @@ -373,7 +372,7 @@ void SetUp() override { WebIntTest::SetUp(); - decider_ = base::MakeUnique<StrictMock<PolicyDeciderMock>>(web_state()); + decider_ = std::make_unique<StrictMock<PolicyDeciderMock>>(web_state()); scoped_observer_.Add(web_state()); // Stub out NativeContent objects.
diff --git a/ios/web/web_state/session_certificate_policy_cache_storage_builder.mm b/ios/web/web_state/session_certificate_policy_cache_storage_builder.mm index 36e7351..399a598 100644 --- a/ios/web/web_state/session_certificate_policy_cache_storage_builder.mm +++ b/ios/web/web_state/session_certificate_policy_cache_storage_builder.mm
@@ -6,7 +6,6 @@ #import <Foundation/Foundation.h> -#include "base/memory/ptr_util.h" #import "ios/web/public/crw_session_certificate_policy_cache_storage.h" #import "ios/web/web_state/session_certificate_policy_cache_impl.h" @@ -29,7 +28,7 @@ SessionCertificatePolicyCacheStorageBuilder::BuildSessionCertificatePolicyCache( CRWSessionCertificatePolicyCacheStorage* cache_storage) const { std::unique_ptr<SessionCertificatePolicyCacheImpl> cache = - base::MakeUnique<SessionCertificatePolicyCacheImpl>(); + std::make_unique<SessionCertificatePolicyCacheImpl>(); cache->SetAllowedCerts(cache_storage.certificateStorages); return cache; }
diff --git a/ios/web/web_state/ui/crw_web_controller_unittest.mm b/ios/web/web_state/ui/crw_web_controller_unittest.mm index 4772e956..a93c195 100644 --- a/ios/web/web_state/ui/crw_web_controller_unittest.mm +++ b/ios/web/web_state/ui/crw_web_controller_unittest.mm
@@ -6,6 +6,7 @@ #import <WebKit/WebKit.h> +#include <memory> #include <utility> #include "base/ios/ios_util.h" @@ -1022,7 +1023,7 @@ protected: void SetUp() override { WebTest::SetUp(); - web_state_ = base::MakeUnique<WebStateImpl>( + web_state_ = std::make_unique<WebStateImpl>( WebState::CreateParams(GetBrowserState()), GetTestSessionStorage()); }
diff --git a/ios/web/web_state/ui/crw_web_view_scroll_view_proxy.mm b/ios/web/web_state/ui/crw_web_view_scroll_view_proxy.mm index 7af7a2e..31f1b96 100644 --- a/ios/web/web_state/ui/crw_web_view_scroll_view_proxy.mm +++ b/ios/web/web_state/ui/crw_web_view_scroll_view_proxy.mm
@@ -6,10 +6,11 @@ #import <objc/runtime.h> +#include <memory> + #include "base/auto_reset.h" #import "base/ios/crb_protocol_observers.h" #include "base/mac/foundation_util.h" -#include "base/memory/ptr_util.h" #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support." @@ -189,7 +190,7 @@ setContentInsetAdjustmentBehavior:contentInsetAdjustmentBehavior]; } else { _pendingContentInsetAdjustmentBehavior = - base::MakeUnique<UIScrollViewContentInsetAdjustmentBehavior>( + std::make_unique<UIScrollViewContentInsetAdjustmentBehavior>( contentInsetAdjustmentBehavior); } }
diff --git a/ios/web/web_state/ui/web_view_js_utils.mm b/ios/web/web_state/ui/web_view_js_utils.mm index 807522f..121e576 100644 --- a/ios/web/web_state/ui/web_view_js_utils.mm +++ b/ios/web/web_state/ui/web_view_js_utils.mm
@@ -9,7 +9,6 @@ #include "base/logging.h" #include "base/mac/foundation_util.h" -#include "base/memory/ptr_util.h" #include "base/strings/sys_string_conversions.h" #include "base/values.h" @@ -44,11 +43,11 @@ result.reset(new base::Value(static_cast<bool>([wk_result boolValue]))); DCHECK(result->is_bool()); } else if (result_type == CFNullGetTypeID()) { - result = base::MakeUnique<base::Value>(); + result = std::make_unique<base::Value>(); DCHECK(result->is_none()); } else if (result_type == CFDictionaryGetTypeID()) { std::unique_ptr<base::DictionaryValue> dictionary = - base::MakeUnique<base::DictionaryValue>(); + std::make_unique<base::DictionaryValue>(); for (id key in wk_result) { NSString* obj_c_string = base::mac::ObjCCast<NSString>(key); const std::string path = base::SysNSStringToUTF8(obj_c_string); @@ -60,7 +59,7 @@ } result = std::move(dictionary); } else if (result_type == CFArrayGetTypeID()) { - std::unique_ptr<base::ListValue> list = base::MakeUnique<base::ListValue>(); + std::unique_ptr<base::ListValue> list = std::make_unique<base::ListValue>(); for (id list_item in wk_result) { std::unique_ptr<base::Value> value = ValueResultFromWKResult(list_item, max_depth - 1);
diff --git a/ios/web/web_state/web_state_impl.mm b/ios/web/web_state/web_state_impl.mm index d86faf4d..dde3fe99 100644 --- a/ios/web/web_state/web_state_impl.mm +++ b/ios/web/web_state/web_state_impl.mm
@@ -83,9 +83,9 @@ interstitial_(nullptr), created_with_opener_(params.created_with_opener) { if (web::GetWebClient()->IsSlimNavigationManagerEnabled()) { - navigation_manager_ = base::MakeUnique<WKBasedNavigationManagerImpl>(); + navigation_manager_ = std::make_unique<WKBasedNavigationManagerImpl>(); } else { - navigation_manager_ = base::MakeUnique<LegacyNavigationManagerImpl>(); + navigation_manager_ = std::make_unique<LegacyNavigationManagerImpl>(); } navigation_manager_->SetDelegate(this); @@ -100,7 +100,7 @@ RestoreSessionStorage(session_storage); } else { certificate_policy_cache_ = - base::MakeUnique<SessionCertificatePolicyCacheImpl>(); + std::make_unique<SessionCertificatePolicyCacheImpl>(); } } @@ -470,7 +470,7 @@ WebUIIOSControllerFactoryRegistry::GetInstance(); if (!factory) return nullptr; - std::unique_ptr<web::WebUIIOS> web_ui = base::MakeUnique<WebUIIOSImpl>(this); + std::unique_ptr<web::WebUIIOS> web_ui = std::make_unique<WebUIIOSImpl>(this); auto controller = factory->CreateWebUIIOSControllerForURL(web_ui.get(), url); if (!controller) return nullptr; @@ -523,7 +523,7 @@ WebStateInterfaceProvider* WebStateImpl::GetWebStateInterfaceProvider() { if (!web_state_interface_provider_) { web_state_interface_provider_ = - base::MakeUnique<WebStateInterfaceProvider>(); + std::make_unique<WebStateInterfaceProvider>(); } return web_state_interface_provider_.get(); }
diff --git a/ios/web/web_state/web_state_impl_unittest.mm b/ios/web/web_state/web_state_impl_unittest.mm index fc1b4cc3..c95e9945 100644 --- a/ios/web/web_state/web_state_impl_unittest.mm +++ b/ios/web/web_state/web_state_impl_unittest.mm
@@ -14,7 +14,6 @@ #include "base/bind.h" #include "base/logging.h" #import "base/mac/bind_objc_block.h" -#include "base/memory/ptr_util.h" #import "base/test/ios/wait_util.h" #include "ios/web/navigation/placeholder_navigation_util.h" #import "ios/web/public/java_script_dialog_presenter.h" @@ -185,7 +184,7 @@ protected: WebStateImplTest() : web::WebTest() { web::WebState::CreateParams params(GetBrowserState()); - web_state_ = base::MakeUnique<web::WebStateImpl>(params); + web_state_ = std::make_unique<web::WebStateImpl>(params); } std::unique_ptr<WebStateImpl> web_state_; @@ -463,7 +462,7 @@ EXPECT_TRUE(observer->load_page_info()->success); // Test that OnTitleChanged() is called. - observer = base::MakeUnique<TestWebStateObserver>(web_state_.get()); + observer = std::make_unique<TestWebStateObserver>(web_state_.get()); ASSERT_FALSE(observer->title_was_set_info()); web_state_->OnTitleChanged(); ASSERT_TRUE(observer->title_was_set_info()); @@ -828,7 +827,7 @@ EXPECT_FALSE(observer->update_favicon_url_candidates_info()); // Callback is called when icons were fetched. - observer = base::MakeUnique<TestWebStateObserver>(web_state_.get()); + observer = std::make_unique<TestWebStateObserver>(web_state_.get()); web::FaviconURL favicon_url(GURL("https://chromium.test/"), web::FaviconURL::IconType::kTouchIcon, {gfx::Size(5, 6)});
diff --git a/ios/web/webui/crw_web_ui_manager.mm b/ios/web/webui/crw_web_ui_manager.mm index 42ef565..1ffdd745 100644 --- a/ios/web/webui/crw_web_ui_manager.mm +++ b/ios/web/webui/crw_web_ui_manager.mm
@@ -9,7 +9,6 @@ #include "base/json/string_escape.h" #import "base/mac/bind_objc_block.h" -#include "base/memory/ptr_util.h" #include "base/memory/ref_counted_memory.h" #include "base/strings/stringprintf.h" #import "base/strings/sys_string_conversions.h" @@ -204,7 +203,7 @@ - (std::unique_ptr<web::URLFetcherBlockAdapter>) fetcherForURL:(const GURL&)URL completionHandler:(web::URLFetcherBlockAdapterCompletion)handler { - return base::MakeUnique<web::URLFetcherBlockAdapter>( + return std::make_unique<web::URLFetcherBlockAdapter>( URL, _webState->GetBrowserState()->GetRequestContext(), handler); }
diff --git a/ios/web/webui/mojo_facade.mm b/ios/web/webui/mojo_facade.mm index 0cb7b4a..69b397c 100644 --- a/ios/web/webui/mojo_facade.mm +++ b/ios/web/webui/mojo_facade.mm
@@ -15,7 +15,6 @@ #include "base/json/json_reader.h" #include "base/json/json_writer.h" #import "base/mac/bind_objc_block.h" -#include "base/memory/ptr_util.h" #include "base/strings/string_number_conversions.h" #include "base/values.h" #import "ios/web/public/web_state/js/crw_js_injection_evaluator.h" @@ -34,7 +33,7 @@ // Wraps an integer into |base::Value| as |Type::INTEGER|. template <typename IntegerT> std::unique_ptr<base::Value> ValueFromInteger(IntegerT handle) { - return base::MakeUnique<base::Value>(static_cast<int>(handle)); + return std::make_unique<base::Value>(static_cast<int>(handle)); } } // namespace @@ -142,7 +141,7 @@ base::DictionaryValue* args) { mojo::ScopedMessagePipeHandle handle0, handle1; MojoResult mojo_result = mojo::CreateMessagePipe(nullptr, &handle0, &handle1); - auto result = base::MakeUnique<base::DictionaryValue>(); + auto result = std::make_unique<base::DictionaryValue>(); result->SetInteger("result", mojo_result); if (mojo_result == MOJO_RESULT_OK) { result->SetInteger("handle0", handle0.release().value()); @@ -202,15 +201,15 @@ mojo::MessagePipeHandle handle(static_cast<MojoHandle>(handle_as_int)); MojoResult mojo_result = mojo::ReadMessageRaw(handle, &bytes, &handles, flags); - auto result = base::MakeUnique<base::DictionaryValue>(); + auto result = std::make_unique<base::DictionaryValue>(); if (mojo_result == MOJO_RESULT_OK) { - auto handles_list = base::MakeUnique<base::ListValue>(); + auto handles_list = std::make_unique<base::ListValue>(); for (uint32_t i = 0; i < handles.size(); i++) { handles_list->AppendInteger(handles[i].release().value()); } result->Set("handles", std::move(handles_list)); - auto buffer = base::MakeUnique<base::ListValue>(); + auto buffer = std::make_unique<base::ListValue>(); for (uint32_t i = 0; i < bytes.size(); i++) { buffer->AppendInteger(bytes[i]); } @@ -238,7 +237,7 @@ callback_id, result]; [script_evaluator_ executeJavaScript:script completionHandler:nil]; }); - auto watcher = base::MakeUnique<mojo::SimpleWatcher>( + auto watcher = std::make_unique<mojo::SimpleWatcher>( FROM_HERE, mojo::SimpleWatcher::ArmingPolicy::AUTOMATIC); watcher->Watch(static_cast<mojo::Handle>(handle), signals, callback); watchers_.insert(std::make_pair(++last_watch_id_, std::move(watcher)));
diff --git a/ios/web/webui/mojo_facade_unittest.mm b/ios/web/webui/mojo_facade_unittest.mm index f4a92fa1..9f3f8d6 100644 --- a/ios/web/webui/mojo_facade_unittest.mm +++ b/ios/web/webui/mojo_facade_unittest.mm
@@ -51,12 +51,12 @@ class MojoFacadeTest : public WebTest { protected: MojoFacadeTest() { - interface_provider_ = base::MakeUnique<WebStateInterfaceProvider>(); + interface_provider_ = std::make_unique<WebStateInterfaceProvider>(); interface_provider_->registry()->AddInterface(base::Bind( &MojoFacadeTest::BindTestUIHandlerMojoRequest, base::Unretained(this))); evaluator_ = [OCMockObject mockForProtocol:@protocol(CRWJSInjectionEvaluator)]; - facade_ = base::MakeUnique<MojoFacade>( + facade_ = std::make_unique<MojoFacade>( interface_provider_.get(), static_cast<id<CRWJSInjectionEvaluator>>(evaluator_)); }
diff --git a/ios/web/webui/url_data_manager_ios.cc b/ios/web/webui/url_data_manager_ios.cc index 047bcfda..6fb66ae4 100644 --- a/ios/web/webui/url_data_manager_ios.cc +++ b/ios/web/webui/url_data_manager_ios.cc
@@ -6,11 +6,11 @@ #include <stddef.h> +#include <memory> #include <vector> #include "base/bind.h" #include "base/lazy_instance.h" -#include "base/memory/ptr_util.h" #include "base/memory/ref_counted_memory.h" #include "base/message_loop/message_loop.h" #include "base/stl_util.h" @@ -34,7 +34,7 @@ if (!browser_state->GetUserData(kURLDataManagerIOSKeyName)) { browser_state->SetUserData( kURLDataManagerIOSKeyName, - base::MakeUnique<URLDataManagerIOS>(browser_state)); + std::make_unique<URLDataManagerIOS>(browser_state)); } return static_cast<URLDataManagerIOS*>( browser_state->GetUserData(kURLDataManagerIOSKeyName));
diff --git a/ios/web/webui/url_data_manager_ios_backend.mm b/ios/web/webui/url_data_manager_ios_backend.mm index aa8f8040..e69e54e 100644 --- a/ios/web/webui/url_data_manager_ios_backend.mm +++ b/ios/web/webui/url_data_manager_ios_backend.mm
@@ -12,7 +12,6 @@ #include "base/debug/alias.h" #include "base/lazy_instance.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/memory/ref_counted.h" #include "base/memory/ref_counted_memory.h" #include "base/memory/weak_ptr.h" @@ -444,7 +443,7 @@ std::unique_ptr<net::URLRequestJobFactory::ProtocolHandler> URLDataManagerIOSBackend::CreateProtocolHandler(BrowserState* browser_state) { DCHECK(browser_state); - return base::MakeUnique<ChromeProtocolHandler>( + return std::make_unique<ChromeProtocolHandler>( browser_state, browser_state->IsOffTheRecord()); }
diff --git a/ios/web/webui/web_ui_mojo_inttest.mm b/ios/web/webui/web_ui_mojo_inttest.mm index b6e5781..c70634660 100644 --- a/ios/web/webui/web_ui_mojo_inttest.mm +++ b/ios/web/webui/web_ui_mojo_inttest.mm
@@ -4,7 +4,6 @@ #include <memory> -#include "base/memory/ptr_util.h" #include "base/run_loop.h" #include "base/threading/thread_task_runner_handle.h" #import "ios/testing/wait_util.h" @@ -127,7 +126,7 @@ const GURL& url) const override { DCHECK_EQ(url.scheme(), kTestWebUIScheme); DCHECK_EQ(url.host(), kTestWebUIURLHost); - return base::MakeUnique<TestUI>(web_ui, ui_handler_); + return std::make_unique<TestUI>(web_ui, ui_handler_); } private: @@ -141,9 +140,9 @@ protected: void SetUp() override { WebIntTest::SetUp(); - ui_handler_ = base::MakeUnique<TestUIHandler>(); + ui_handler_ = std::make_unique<TestUIHandler>(); web::WebState::CreateParams params(GetBrowserState()); - web_state_ = base::MakeUnique<web::WebStateImpl>(params); + web_state_ = std::make_unique<web::WebStateImpl>(params); web_state_->GetNavigationManagerImpl().InitializeSession(); WebUIIOSControllerFactory::RegisterFactory( new TestWebUIControllerFactory(ui_handler_.get()));
diff --git a/ios/web_view/internal/app/application_context.cc b/ios/web_view/internal/app/application_context.cc index d5e8b6e..c9b15eb 100644 --- a/ios/web_view/internal/app/application_context.cc +++ b/ios/web_view/internal/app/application_context.cc
@@ -5,7 +5,6 @@ #include "ios/web_view/internal/app/application_context.h" #include "base/command_line.h" -#include "base/memory/ptr_util.h" #include "base/memory/singleton.h" #include "base/path_service.h" #include "components/flags_ui/pref_service_flags_storage.h" @@ -30,7 +29,7 @@ } ApplicationContext::ApplicationContext() { - net_log_ = base::MakeUnique<net_log::ChromeNetLog>(); + net_log_ = std::make_unique<net_log::ChromeNetLog>(); SetApplicationLocale(l10n_util::GetLocaleOverride()); } @@ -40,7 +39,7 @@ void ApplicationContext::PreCreateThreads() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); web_view_io_thread_ = - base::MakeUnique<WebViewIOThread>(GetLocalState(), GetNetLog()); + std::make_unique<WebViewIOThread>(GetLocalState(), GetNetLog()); } void ApplicationContext::SaveState() {
diff --git a/ios/web_view/internal/app/web_view_io_thread.mm b/ios/web_view/internal/app/web_view_io_thread.mm index 1cd3d64..d964634 100644 --- a/ios/web_view/internal/app/web_view_io_thread.mm +++ b/ios/web_view/internal/app/web_view_io_thread.mm
@@ -4,7 +4,6 @@ #include "ios/web_view/internal/app/web_view_io_thread.h" -#include "base/memory/ptr_util.h" #include "ios/web_view/internal/web_view_network_delegate.h" #if !defined(__has_feature) || !__has_feature(objc_arc) @@ -21,7 +20,7 @@ std::unique_ptr<net::NetworkDelegate> WebViewIOThread::CreateSystemNetworkDelegate() { - return base::MakeUnique<ios_web_view::WebViewNetworkDelegate>(); + return std::make_unique<ios_web_view::WebViewNetworkDelegate>(); } std::string WebViewIOThread::GetChannelString() const {
diff --git a/ios/web_view/internal/cwv_web_view.mm b/ios/web_view/internal/cwv_web_view.mm index 43e348b..f87757d 100644 --- a/ios/web_view/internal/cwv_web_view.mm +++ b/ios/web_view/internal/cwv_web_view.mm
@@ -8,7 +8,6 @@ #include <utility> #include "base/mac/foundation_util.h" -#include "base/memory/ptr_util.h" #include "base/strings/sys_string_conversions.h" #import "components/autofill/ios/browser/autofill_agent.h" #import "components/autofill/ios/browser/js_autofill_manager.h" @@ -452,15 +451,15 @@ } _webState->AddObserver(_webStateObserver.get()); - _webStateDelegate = base::MakeUnique<web::WebStateDelegateBridge>(self); + _webStateDelegate = std::make_unique<web::WebStateDelegateBridge>(self); _webState->SetDelegate(_webStateDelegate.get()); _webStatePolicyDecider = - base::MakeUnique<ios_web_view::WebViewWebStatePolicyDecider>( + std::make_unique<ios_web_view::WebViewWebStatePolicyDecider>( _webState.get(), self); _javaScriptDialogPresenter = - base::MakeUnique<ios_web_view::WebViewJavaScriptDialogPresenter>(self, + std::make_unique<ios_web_view::WebViewJavaScriptDialogPresenter>(self, nullptr); _scrollView.proxy = _webState.get()->GetWebViewProxy().scrollViewProxy;
diff --git a/ios/web_view/internal/cwv_web_view_configuration.mm b/ios/web_view/internal/cwv_web_view_configuration.mm index c788837c..2ba65e5 100644 --- a/ios/web_view/internal/cwv_web_view_configuration.mm +++ b/ios/web_view/internal/cwv_web_view_configuration.mm
@@ -4,8 +4,9 @@ #import "ios/web_view/internal/cwv_web_view_configuration_internal.h" +#include <memory> + #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/threading/thread_restrictions.h" #include "ios/web_view/internal/app/application_context.h" #import "ios/web_view/internal/cwv_preferences_internal.h" @@ -53,7 +54,7 @@ static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ auto browserState = - base::MakeUnique<ios_web_view::WebViewBrowserState>(false); + std::make_unique<ios_web_view::WebViewBrowserState>(false); gDefaultConfiguration = [[CWVWebViewConfiguration alloc] initWithBrowserState:std::move(browserState)]; }); @@ -64,7 +65,7 @@ static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ auto browserState = - base::MakeUnique<ios_web_view::WebViewBrowserState>(true); + std::make_unique<ios_web_view::WebViewBrowserState>(true); gIncognitoConfiguration = [[CWVWebViewConfiguration alloc] initWithBrowserState:std::move(browserState)]; });
diff --git a/ios/web_view/internal/language/web_view_language_model_factory.cc b/ios/web_view/internal/language/web_view_language_model_factory.cc index 73ddf94..34ad0be 100644 --- a/ios/web_view/internal/language/web_view_language_model_factory.cc +++ b/ios/web_view/internal/language/web_view_language_model_factory.cc
@@ -5,7 +5,6 @@ #include "ios/web_view/internal/language/web_view_language_model_factory.h" #include "base/feature_list.h" -#include "base/memory/ptr_util.h" #include "base/memory/singleton.h" #include "components/keyed_service/core/keyed_service.h" #include "components/keyed_service/ios/browser_state_dependency_manager.h" @@ -45,13 +44,13 @@ WebViewBrowserState::FromBrowserState(context); if (base::FeatureList::IsEnabled(language::kUseHeuristicLanguageModel)) { - return base::MakeUnique<language::HeuristicLanguageModel>( + return std::make_unique<language::HeuristicLanguageModel>( web_view_browser_state->GetPrefs(), ApplicationContext::GetInstance()->GetApplicationLocale(), prefs::kAcceptLanguages, language::prefs::kUserLanguageProfile); } - return base::MakeUnique<language::BaselineLanguageModel>( + return std::make_unique<language::BaselineLanguageModel>( web_view_browser_state->GetPrefs(), ApplicationContext::GetInstance()->GetApplicationLocale(), prefs::kAcceptLanguages);
diff --git a/ios/web_view/internal/language/web_view_url_language_histogram_factory.cc b/ios/web_view/internal/language/web_view_url_language_histogram_factory.cc index 21a85b2..d14c8369 100644 --- a/ios/web_view/internal/language/web_view_url_language_histogram_factory.cc +++ b/ios/web_view/internal/language/web_view_url_language_histogram_factory.cc
@@ -4,7 +4,6 @@ #include "ios/web_view/internal/language/web_view_url_language_histogram_factory.h" -#include "base/memory/ptr_util.h" #include "base/memory/singleton.h" #include "components/keyed_service/core/keyed_service.h" #include "components/keyed_service/ios/browser_state_dependency_manager.h" @@ -38,7 +37,7 @@ web::BrowserState* const context) const { WebViewBrowserState* const web_view_browser_state = WebViewBrowserState::FromBrowserState(context); - return base::MakeUnique<language::UrlLanguageHistogram>( + return std::make_unique<language::UrlLanguageHistogram>( web_view_browser_state->GetPrefs()); }
diff --git a/ios/web_view/internal/signin/ios_web_view_signin_client.mm b/ios/web_view/internal/signin/ios_web_view_signin_client.mm index cd58835..6872833 100644 --- a/ios/web_view/internal/signin/ios_web_view_signin_client.mm +++ b/ios/web_view/internal/signin/ios_web_view_signin_client.mm
@@ -115,7 +115,7 @@ GaiaAuthConsumer* consumer, const std::string& source, net::URLRequestContextGetter* getter) { - return base::MakeUnique<GaiaAuthFetcher>(consumer, source, getter); + return std::make_unique<GaiaAuthFetcher>(consumer, source, getter); } void IOSWebViewSigninClient::OnErrorChanged() {}
diff --git a/ios/web_view/internal/signin/web_view_account_fetcher_service_factory.mm b/ios/web_view/internal/signin/web_view_account_fetcher_service_factory.mm index ac472dd..277a9a2 100644 --- a/ios/web_view/internal/signin/web_view_account_fetcher_service_factory.mm +++ b/ios/web_view/internal/signin/web_view_account_fetcher_service_factory.mm
@@ -6,7 +6,6 @@ #include <utility> -#include "base/memory/ptr_util.h" #include "base/memory/singleton.h" #include "components/keyed_service/ios/browser_state_dependency_manager.h" #include "components/signin/core/browser/account_fetcher_service.h" @@ -56,7 +55,7 @@ WebViewBrowserState* browser_state = WebViewBrowserState::FromBrowserState(context); std::unique_ptr<AccountFetcherService> service = - base::MakeUnique<AccountFetcherService>(); + std::make_unique<AccountFetcherService>(); service->Initialize( WebViewSigninClientFactory::GetForBrowserState(browser_state), WebViewOAuth2TokenServiceFactory::GetForBrowserState(browser_state),
diff --git a/ios/web_view/internal/signin/web_view_account_tracker_service_factory.mm b/ios/web_view/internal/signin/web_view_account_tracker_service_factory.mm index 8f5bb72..1ec93fdc9 100644 --- a/ios/web_view/internal/signin/web_view_account_tracker_service_factory.mm +++ b/ios/web_view/internal/signin/web_view_account_tracker_service_factory.mm
@@ -6,7 +6,6 @@ #include <utility> -#include "base/memory/ptr_util.h" #include "base/memory/singleton.h" #include "components/keyed_service/ios/browser_state_dependency_manager.h" #include "components/signin/core/browser/account_tracker_service.h" @@ -51,7 +50,7 @@ WebViewBrowserState* browser_state = WebViewBrowserState::FromBrowserState(context); std::unique_ptr<AccountTrackerService> service = - base::MakeUnique<AccountTrackerService>(); + std::make_unique<AccountTrackerService>(); service->Initialize( WebViewSigninClientFactory::GetForBrowserState(browser_state)); return service;
diff --git a/ios/web_view/internal/signin/web_view_gaia_cookie_manager_service_factory.mm b/ios/web_view/internal/signin/web_view_gaia_cookie_manager_service_factory.mm index b903a05..5e53c568 100644 --- a/ios/web_view/internal/signin/web_view_gaia_cookie_manager_service_factory.mm +++ b/ios/web_view/internal/signin/web_view_gaia_cookie_manager_service_factory.mm
@@ -4,7 +4,6 @@ #include "ios/web_view/internal/signin/web_view_gaia_cookie_manager_service_factory.h" -#include "base/memory/ptr_util.h" #include "base/memory/singleton.h" #include "components/keyed_service/core/service_access_type.h" #include "components/keyed_service/ios/browser_state_dependency_manager.h" @@ -49,7 +48,7 @@ web::BrowserState* context) const { WebViewBrowserState* browser_state = WebViewBrowserState::FromBrowserState(context); - return base::MakeUnique<GaiaCookieManagerService>( + return std::make_unique<GaiaCookieManagerService>( WebViewOAuth2TokenServiceFactory::GetForBrowserState(browser_state), GaiaConstants::kChromeSource, WebViewSigninClientFactory::GetForBrowserState(browser_state));
diff --git a/ios/web_view/internal/signin/web_view_oauth2_token_service_factory.mm b/ios/web_view/internal/signin/web_view_oauth2_token_service_factory.mm index 8e46967..14aa563 100644 --- a/ios/web_view/internal/signin/web_view_oauth2_token_service_factory.mm +++ b/ios/web_view/internal/signin/web_view_oauth2_token_service_factory.mm
@@ -4,7 +4,6 @@ #include "ios/web_view/internal/signin/web_view_oauth2_token_service_factory.h" -#include "base/memory/ptr_util.h" #include "base/memory/singleton.h" #include "components/keyed_service/ios/browser_state_dependency_manager.h" #include "components/pref_registry/pref_registry_syncable.h" @@ -57,13 +56,13 @@ IOSWebViewSigninClient* signin_client = WebViewSigninClientFactory::GetForBrowserState(browser_state); auto token_service_provider = - base::MakeUnique<WebViewProfileOAuth2TokenServiceIOSProviderImpl>( + std::make_unique<WebViewProfileOAuth2TokenServiceIOSProviderImpl>( signin_client); - auto delegate = base::MakeUnique<ProfileOAuth2TokenServiceIOSDelegate>( + auto delegate = std::make_unique<ProfileOAuth2TokenServiceIOSDelegate>( signin_client, std::move(token_service_provider), WebViewAccountTrackerServiceFactory::GetForBrowserState(browser_state), WebViewSigninErrorControllerFactory::GetForBrowserState(browser_state)); - return base::MakeUnique<ProfileOAuth2TokenService>(std::move(delegate)); + return std::make_unique<ProfileOAuth2TokenService>(std::move(delegate)); } } // namespace ios_web_view
diff --git a/ios/web_view/internal/signin/web_view_signin_client_factory.mm b/ios/web_view/internal/signin/web_view_signin_client_factory.mm index 609ad2c6..2efa771 100644 --- a/ios/web_view/internal/signin/web_view_signin_client_factory.mm +++ b/ios/web_view/internal/signin/web_view_signin_client_factory.mm
@@ -4,7 +4,6 @@ #include "ios/web_view/internal/signin/web_view_signin_client_factory.h" -#include "base/memory/ptr_util.h" #include "base/memory/singleton.h" #include "components/keyed_service/core/service_access_type.h" #include "components/keyed_service/ios/browser_state_dependency_manager.h" @@ -47,7 +46,7 @@ web::BrowserState* context) const { WebViewBrowserState* browser_state = WebViewBrowserState::FromBrowserState(context); - return base::MakeUnique<IOSWebViewSigninClient>( + return std::make_unique<IOSWebViewSigninClient>( browser_state->GetPrefs(), browser_state->GetRequestContext(), WebViewSigninErrorControllerFactory::GetForBrowserState(browser_state), WebViewCookieSettingsFactory::GetForBrowserState(browser_state),
diff --git a/ios/web_view/internal/translate/web_view_translate_accept_languages_factory.cc b/ios/web_view/internal/translate/web_view_translate_accept_languages_factory.cc index 1e24463..26ebe728 100644 --- a/ios/web_view/internal/translate/web_view_translate_accept_languages_factory.cc +++ b/ios/web_view/internal/translate/web_view_translate_accept_languages_factory.cc
@@ -4,7 +4,6 @@ #include "ios/web_view/internal/translate/web_view_translate_accept_languages_factory.h" -#include "base/memory/ptr_util.h" #include "base/memory/singleton.h" #include "components/keyed_service/core/keyed_service.h" #include "components/keyed_service/ios/browser_state_dependency_manager.h" @@ -72,7 +71,7 @@ web::BrowserState* context) const { WebViewBrowserState* browser_state = WebViewBrowserState::FromBrowserState(context); - return base::MakeUnique<TranslateAcceptLanguagesService>( + return std::make_unique<TranslateAcceptLanguagesService>( browser_state->GetPrefs()); }
diff --git a/ios/web_view/internal/translate/web_view_translate_client.mm b/ios/web_view/internal/translate/web_view_translate_client.mm index fea719e..9d0670f 100644 --- a/ios/web_view/internal/translate/web_view_translate_client.mm +++ b/ios/web_view/internal/translate/web_view_translate_client.mm
@@ -7,7 +7,6 @@ #include <vector> #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "components/infobars/core/infobar.h" #include "components/prefs/pref_service.h" #include "components/translate/core/browser/page_translated_details.h" @@ -45,7 +44,7 @@ } // namespace WebViewTranslateClient::WebViewTranslateClient(web::WebState* web_state) - : translate_manager_(base::MakeUnique<translate::TranslateManager>( + : translate_manager_(std::make_unique<translate::TranslateManager>( this, WebViewTranslateRankerFactory::GetForBrowserState( WebViewBrowserState::FromBrowserState(GetMainBrowserState())), @@ -90,7 +89,7 @@ std::unique_ptr<translate::TranslatePrefs> WebViewTranslateClient::GetTranslatePrefs() { - return base::MakeUnique<translate::TranslatePrefs>( + return std::make_unique<translate::TranslatePrefs>( GetPrefs(), prefs::kAcceptLanguages, nullptr); }
diff --git a/ios/web_view/internal/translate/web_view_translate_ranker_factory.cc b/ios/web_view/internal/translate/web_view_translate_ranker_factory.cc index e792b8b..46895c6 100644 --- a/ios/web_view/internal/translate/web_view_translate_ranker_factory.cc +++ b/ios/web_view/internal/translate/web_view_translate_ranker_factory.cc
@@ -6,7 +6,6 @@ #include <utility> -#include "base/memory/ptr_util.h" #include "base/memory/singleton.h" #include "components/keyed_service/core/keyed_service.h" #include "components/keyed_service/ios/browser_state_dependency_manager.h" @@ -41,7 +40,7 @@ WebViewBrowserState* web_view_browser_state = WebViewBrowserState::FromBrowserState(context); std::unique_ptr<translate::TranslateRankerImpl> ranker = - base::MakeUnique<translate::TranslateRankerImpl>( + std::make_unique<translate::TranslateRankerImpl>( translate::TranslateRankerImpl::GetModelPath( web_view_browser_state->GetStatePath()), translate::TranslateRankerImpl::GetModelURL(),
diff --git a/ios/web_view/internal/web_view_global_state_util.mm b/ios/web_view/internal/web_view_global_state_util.mm index ae281c31..fcf62ef 100644 --- a/ios/web_view/internal/web_view_global_state_util.mm +++ b/ios/web_view/internal/web_view_global_state_util.mm
@@ -4,7 +4,8 @@ #include "ios/web_view/internal/web_view_global_state_util.h" -#include "base/memory/ptr_util.h" +#include <memory> + #include "ios/web/public/app/web_main.h" #import "ios/web_view/internal/web_view_web_client.h" #import "ios/web_view/internal/web_view_web_main_delegate.h" @@ -22,13 +23,13 @@ static std::unique_ptr<web::WebMain> web_main; static dispatch_once_t once_token; dispatch_once(&once_token, ^{ - web_client = base::MakeUnique<ios_web_view::WebViewWebClient>(); + web_client = std::make_unique<ios_web_view::WebViewWebClient>(); web::SetWebClient(web_client.get()); web_main_delegate = - base::MakeUnique<ios_web_view::WebViewWebMainDelegate>(); + std::make_unique<ios_web_view::WebViewWebMainDelegate>(); web::WebMainParams params(web_main_delegate.get()); - web_main = base::MakeUnique<web::WebMain>(std::move(params)); + web_main = std::make_unique<web::WebMain>(std::move(params)); }); }
diff --git a/ios/web_view/internal/web_view_url_request_context_getter.mm b/ios/web_view/internal/web_view_url_request_context_getter.mm index 5056495..c518507 100644 --- a/ios/web_view/internal/web_view_url_request_context_getter.mm +++ b/ios/web_view/internal/web_view_url_request_context_getter.mm
@@ -61,7 +61,7 @@ url_request_context_.reset(new net::URLRequestContext()); url_request_context_->set_net_log(net_log_.get()); DCHECK(!network_delegate_.get()); - network_delegate_ = base::MakeUnique<WebViewNetworkDelegate>(); + network_delegate_ = std::make_unique<WebViewNetworkDelegate>(); url_request_context_->set_network_delegate(network_delegate_.get()); storage_.reset( @@ -86,7 +86,7 @@ web::GetWebClient()->GetUserAgent(web::UserAgentType::MOBILE); storage_->set_http_user_agent_settings( - base::MakeUnique<net::StaticHttpUserAgentSettings>("en-us,en", + std::make_unique<net::StaticHttpUserAgentSettings>("en-us,en", user_agent)); storage_->set_proxy_service( net::ProxyService::CreateUsingSystemProxyResolver( @@ -95,7 +95,7 @@ storage_->set_cert_verifier(net::CertVerifier::CreateDefault()); storage_->set_transport_security_state( - base::MakeUnique<net::TransportSecurityState>()); + std::make_unique<net::TransportSecurityState>()); storage_->set_cert_transparency_verifier( base::WrapUnique(new net::MultiLogCTVerifier)); storage_->set_ct_policy_enforcer( @@ -116,7 +116,7 @@ channel_id_path, base::CreateSequencedTaskRunnerWithTraits( {base::MayBlock(), base::TaskPriority::BACKGROUND})); - storage_->set_channel_id_service(base::MakeUnique<net::ChannelIDService>( + storage_->set_channel_id_service(std::make_unique<net::ChannelIDService>( new net::DefaultChannelIDStore(channel_id_db.get()))); storage_->set_http_server_properties( std::unique_ptr<net::HttpServerProperties>( @@ -158,16 +158,16 @@ net::DISK_CACHE, net::CACHE_BACKEND_DEFAULT, cache_path, 0)); storage_->set_http_network_session( - base::MakeUnique<net::HttpNetworkSession>( + std::make_unique<net::HttpNetworkSession>( net::HttpNetworkSession::Params(), network_session_context)); - storage_->set_http_transaction_factory(base::MakeUnique<net::HttpCache>( + storage_->set_http_transaction_factory(std::make_unique<net::HttpCache>( storage_->http_network_session(), std::move(main_backend), true /* set_up_quic_server_info */)); std::unique_ptr<net::URLRequestJobFactoryImpl> job_factory( new net::URLRequestJobFactoryImpl()); bool set_protocol = job_factory->SetProtocolHandler( - "data", base::MakeUnique<net::DataProtocolHandler>()); + "data", std::make_unique<net::DataProtocolHandler>()); DCHECK(set_protocol); storage_->set_job_factory(std::move(job_factory));
diff --git a/ios/web_view/internal/web_view_web_client.mm b/ios/web_view/internal/web_view_web_client.mm index a88af60..a2674ad3 100644 --- a/ios/web_view/internal/web_view_web_client.mm +++ b/ios/web_view/internal/web_view_web_client.mm
@@ -6,7 +6,6 @@ #include "base/logging.h" #include "base/mac/bundle_locations.h" -#include "base/memory/ptr_util.h" #include "base/strings/sys_string_conversions.h" #include "ios/web/public/user_agent.h" #include "ios/web_view/internal/web_view_browser_state.h" @@ -46,7 +45,7 @@ WebViewWebClient::~WebViewWebClient() = default; std::unique_ptr<web::WebMainParts> WebViewWebClient::CreateWebMainParts() { - return base::MakeUnique<WebViewWebMainParts>(); + return std::make_unique<WebViewWebMainParts>(); } std::string WebViewWebClient::GetProduct() const {
diff --git a/ios/web_view/internal/webdata_services/web_view_web_data_service_wrapper_factory.cc b/ios/web_view/internal/webdata_services/web_view_web_data_service_wrapper_factory.cc index a4a16799..a42ecdcf 100644 --- a/ios/web_view/internal/webdata_services/web_view_web_data_service_wrapper_factory.cc +++ b/ios/web_view/internal/webdata_services/web_view_web_data_service_wrapper_factory.cc
@@ -8,7 +8,6 @@ #include "base/callback.h" #include "base/files/file_path.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/memory/singleton.h" #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" #include "components/keyed_service/core/service_access_type.h" @@ -76,7 +75,7 @@ WebViewWebDataServiceWrapperFactory::BuildServiceInstanceFor( web::BrowserState* context) const { const base::FilePath& browser_state_path = context->GetStatePath(); - return base::MakeUnique<WebDataServiceWrapper>( + return std::make_unique<WebDataServiceWrapper>( browser_state_path, ApplicationContext::GetInstance()->GetApplicationLocale(), web::WebThread::GetTaskRunnerForThread(web::WebThread::UI),
diff --git a/ios/web_view/shell/test/shell_egtest.mm b/ios/web_view/shell/test/shell_egtest.mm index 10c094da..4982db5 100644 --- a/ios/web_view/shell/test/shell_egtest.mm +++ b/ios/web_view/shell/test/shell_egtest.mm
@@ -8,7 +8,6 @@ #import <EarlGrey/EarlGrey.h> #import <XCTest/XCTest.h> -#include "base/memory/ptr_util.h" #include "base/strings/sys_string_conversions.h" #import "ios/web_view/shell/shell_view_controller.h" #import "ios/web_view/shell/test/earl_grey/web_view_shell_matchers.h" @@ -68,7 +67,7 @@ - (void)setUp { [super setUp]; - _testServer = base::MakeUnique<net::EmbeddedTestServer>( + _testServer = std::make_unique<net::EmbeddedTestServer>( net::test_server::EmbeddedTestServer::TYPE_HTTP); _testServer->ServeFilesFromSourceDirectory( base::FilePath(FILE_PATH_LITERAL("ios/testing/data/http_server_files/")));
diff --git a/ios/web_view/test/web_view_int_test.mm b/ios/web_view/test/web_view_int_test.mm index ae75ebf..e1bf3a01 100644 --- a/ios/web_view/test/web_view_int_test.mm +++ b/ios/web_view/test/web_view_int_test.mm
@@ -38,7 +38,7 @@ "<html><head><title>%s</title></head><body>%s</body></html>", title.c_str(), body.c_str()); - auto http_response = base::MakeUnique<net::test_server::BasicHttpResponse>(); + auto http_response = std::make_unique<net::test_server::BasicHttpResponse>(); http_response->set_content(html); return std::move(http_response); } @@ -98,7 +98,7 @@ WebViewIntTest::WebViewIntTest() : web_view_(test::CreateWebView()), - test_server_(base::MakeUnique<net::EmbeddedTestServer>( + test_server_(std::make_unique<net::EmbeddedTestServer>( net::test_server::EmbeddedTestServer::TYPE_HTTP)) { test_server_->RegisterRequestHandler(base::Bind(&TestRequestHandler)); }
diff --git a/media/audio/win/audio_low_latency_input_win.cc b/media/audio/win/audio_low_latency_input_win.cc index 1ba690b..16b6a88f 100644 --- a/media/audio/win/audio_low_latency_input_win.cc +++ b/media/audio/win/audio_low_latency_input_win.cc
@@ -32,6 +32,17 @@ namespace { +// Errors when initializing the audio client related to the audio format. Split +// by whether we're using format conversion or not. Used for reporting stats - +// do not renumber entries. +enum FormatRelatedInitError { + kUnsupportedFormat = 0, + kUnsupportedFormatWithFormatConversion = 1, + kInvalidArgument = 2, + kInvalidArgumentWithFormatConversion = 3, + kCount +}; + bool IsSupportedFormatForConversion(const WAVEFORMATEX& format) { if (format.nSamplesPerSec < limits::kMinSampleRate || format.nSamplesPerSec > limits::kMaxSampleRate) { @@ -776,6 +787,7 @@ if (FAILED(hr)) { open_result_ = OPEN_RESULT_AUDIO_CLIENT_INIT_FAILED; base::UmaHistogramSparse("Media.Audio.Capture.Win.InitError", hr); + MaybeReportFormatRelatedInitError(hr); return hr; } @@ -904,6 +916,25 @@ } } +void WASAPIAudioInputStream::MaybeReportFormatRelatedInitError( + HRESULT hr) const { + if (hr != AUDCLNT_E_UNSUPPORTED_FORMAT && hr != E_INVALIDARG) + return; + + const FormatRelatedInitError format_related_error = + hr == AUDCLNT_E_UNSUPPORTED_FORMAT + ? converter_.get() + ? FormatRelatedInitError::kUnsupportedFormatWithFormatConversion + : FormatRelatedInitError::kUnsupportedFormat + // Otherwise |hr| == E_INVALIDARG. + : converter_.get() + ? FormatRelatedInitError::kInvalidArgumentWithFormatConversion + : FormatRelatedInitError::kInvalidArgument; + base::UmaHistogramEnumeration( + "Media.Audio.Capture.Win.InitError.FormatRelated", format_related_error, + FormatRelatedInitError::kCount); +} + double WASAPIAudioInputStream::ProvideInput(AudioBus* audio_bus, uint32_t frames_delayed) { fifo_->Consume()->CopyTo(audio_bus);
diff --git a/media/audio/win/audio_low_latency_input_win.h b/media/audio/win/audio_low_latency_input_win.h index 8d93349..631826aa 100644 --- a/media/audio/win/audio_low_latency_input_win.h +++ b/media/audio/win/audio_low_latency_input_win.h
@@ -133,6 +133,11 @@ HRESULT InitializeAudioEngine(); void ReportOpenResult(HRESULT hr) const; + // Reports stats for format related audio client initilization + // (IAudioClient::Initialize) errors, that is if |hr| is an error related to + // the format. + void MaybeReportFormatRelatedInitError(HRESULT hr) const; + // AudioConverter::InputCallback implementation. double ProvideInput(AudioBus* audio_bus, uint32_t frames_delayed) override;
diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc index 45a8d7bc..988f661 100644 --- a/media/base/media_switches.cc +++ b/media/base/media_switches.cc
@@ -376,7 +376,12 @@ // Allows Media Engagement to use preloaded data to decide whether an origin has // a high media engagement. +#if defined(OS_ANDROID) || defined(OS_IOS) const base::Feature kPreloadMediaEngagementData{ "PreloadMediaEngagementData", base::FEATURE_DISABLED_BY_DEFAULT}; +#else +const base::Feature kPreloadMediaEngagementData{ + "PreloadMediaEngagementData", base::FEATURE_ENABLED_BY_DEFAULT}; +#endif } // namespace media
diff --git a/media/capture/video/shared_memory_handle_provider.cc b/media/capture/video/shared_memory_handle_provider.cc index 9d82d32..72a90933 100644 --- a/media/capture/video/shared_memory_handle_provider.cc +++ b/media/capture/video/shared_memory_handle_provider.cc
@@ -52,11 +52,13 @@ DCHECK(!shared_memory_); base::SharedMemoryHandle memory_handle; - const MojoResult result = - mojo::UnwrapSharedMemoryHandle(std::move(buffer_handle), &memory_handle, - &mapped_size_, &read_only_flag_); + mojo::UnwrappedSharedMemoryHandleProtection protection; + const MojoResult result = mojo::UnwrapSharedMemoryHandle( + std::move(buffer_handle), &memory_handle, &mapped_size_, &protection); if (result != MOJO_RESULT_OK) return false; + read_only_flag_ = + protection == mojo::UnwrappedSharedMemoryHandleProtection::kReadOnly; shared_memory_.emplace(memory_handle, read_only_flag_); return true; } @@ -68,9 +70,17 @@ NOTREACHED(); return mojo::ScopedSharedBufferHandle(); } + // TODO(https://crbug.com/803136): This does not actually obey |read_only| in + // any capacity because it uses DuplicateHandle. In order to properly obey + // |read_only| (when true), we need to use |SharedMemory::GetReadOnlyHandle()| + // but that is not possible. With the base::SharedMemory API and this + // SharedMemoryHandleProvider API as they are today, it isn't possible to know + // whether |shared_memory_| even supports read-only duplication. Note that + // changing |kReadWrite| to |kReadOnly| does NOT affect the ability to map + // the handle read-write. return mojo::WrapSharedMemoryHandle( base::SharedMemory::DuplicateHandle(shared_memory_->handle()), - mapped_size_, read_only); + mapped_size_, mojo::UnwrappedSharedMemoryHandleProtection::kReadWrite); } base::SharedMemoryHandle
diff --git a/media/capture/video/shared_memory_handle_provider_unittest.cc b/media/capture/video/shared_memory_handle_provider_unittest.cc index fffa0a8..ac24e22 100644 --- a/media/capture/video/shared_memory_handle_provider_unittest.cc +++ b/media/capture/video/shared_memory_handle_provider_unittest.cc
@@ -28,18 +28,18 @@ SharedMemoryHandleProviderTest() = default; ~SharedMemoryHandleProviderTest() override = default; - void UnwrapAndVerifyMojoHandle(mojo::ScopedSharedBufferHandle buffer_handle, - size_t expected_size, - bool expected_read_only_flag) { + void UnwrapAndVerifyMojoHandle( + mojo::ScopedSharedBufferHandle buffer_handle, + size_t expected_size, + mojo::UnwrappedSharedMemoryHandleProtection expected_protection) { base::SharedMemoryHandle memory_handle; size_t memory_size = 0; - bool read_only_flag = false; - const MojoResult result = - mojo::UnwrapSharedMemoryHandle(std::move(buffer_handle), &memory_handle, - &memory_size, &read_only_flag); + mojo::UnwrappedSharedMemoryHandleProtection protection; + const MojoResult result = mojo::UnwrapSharedMemoryHandle( + std::move(buffer_handle), &memory_handle, &memory_size, &protection); EXPECT_EQ(MOJO_RESULT_OK, result); EXPECT_EQ(expected_size, memory_size); - EXPECT_EQ(expected_read_only_flag, read_only_flag); + EXPECT_EQ(expected_protection, protection); } protected: @@ -55,7 +55,13 @@ auto mojo_handle = handle_provider_.GetHandleForInterProcessTransit(true /* read_only */); - UnwrapAndVerifyMojoHandle(std::move(mojo_handle), kMemorySize, true); + + // TODO(https://crbug.com/803136): See comment within + // GetHandleForInterProcessTransit() for an explanation of why this + // intentionally read-write even though it ought to be read-only. + UnwrapAndVerifyMojoHandle( + std::move(mojo_handle), kMemorySize, + mojo::UnwrappedSharedMemoryHandleProtection::kReadWrite); } TEST_F(SharedMemoryHandleProviderTest, @@ -64,7 +70,9 @@ auto mojo_handle = handle_provider_.GetHandleForInterProcessTransit(false /* read_only */); - UnwrapAndVerifyMojoHandle(std::move(mojo_handle), kMemorySize, false); + UnwrapAndVerifyMojoHandle( + std::move(mojo_handle), kMemorySize, + mojo::UnwrappedSharedMemoryHandleProtection::kReadWrite); } -}; // namespace media +} // namespace media
diff --git a/media/mojo/clients/mojo_jpeg_decode_accelerator.cc b/media/mojo/clients/mojo_jpeg_decode_accelerator.cc index b9e235c..8783eb4 100644 --- a/media/mojo/clients/mojo_jpeg_decode_accelerator.cc +++ b/media/mojo/clients/mojo_jpeg_decode_accelerator.cc
@@ -65,8 +65,9 @@ size_t output_buffer_size = VideoFrame::AllocationSize( video_frame->format(), video_frame->coded_size()); mojo::ScopedSharedBufferHandle output_frame_handle = - mojo::WrapSharedMemoryHandle(output_handle, output_buffer_size, - false /* read_only */); + mojo::WrapSharedMemoryHandle( + output_handle, output_buffer_size, + mojo::UnwrappedSharedMemoryHandleProtection::kReadWrite); // base::Unretained is safe because |this| owns |jpeg_decoder_|. jpeg_decoder_->Decode(bitstream_buffer, video_frame->coded_size(),
diff --git a/media/mojo/clients/mojo_video_encode_accelerator.cc b/media/mojo/clients/mojo_video_encode_accelerator.cc index d1cc5e4..da480d13 100644 --- a/media/mojo/clients/mojo_video_encode_accelerator.cc +++ b/media/mojo/clients/mojo_video_encode_accelerator.cc
@@ -142,9 +142,13 @@ // WrapSharedMemoryHandle() takes ownership of the handle passed to it, but we // don't have ownership of frame->shared_memory_handle(), so Duplicate() it. - mojo::ScopedSharedBufferHandle handle = - mojo::WrapSharedMemoryHandle(frame->shared_memory_handle().Duplicate(), - allocation_size, true /* read_only */); + // + // TODO(https://crbug.com/793446): This should be changed to wrap the frame + // buffer handle as read-only, but VideoFrame does not seem to guarantee that + // its shared_memory_handle() is in fact read-only. + mojo::ScopedSharedBufferHandle handle = mojo::WrapSharedMemoryHandle( + frame->shared_memory_handle().Duplicate(), allocation_size, + mojo::UnwrappedSharedMemoryHandleProtection::kReadWrite); const size_t y_offset = frame->shared_memory_offset(); const size_t u_offset = y_offset + frame->data(VideoFrame::kUPlane) - @@ -174,11 +178,13 @@ << " buffer.size()= " << buffer.size() << "B"; DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - // WrapSharedMemoryHandle() takes ownership of the handle passed to it, but we - // don't have ownership of the |buffer|s underlying handle, so Duplicate() it. DCHECK(buffer.handle().IsValid()); + + // TODO(https://crbug.com/793446): Only wrap read-only handles here and change + // the protection status to kReadOnly. mojo::ScopedSharedBufferHandle buffer_handle = mojo::WrapSharedMemoryHandle( - buffer.handle().Duplicate(), buffer.size(), true /* read_only */); + buffer.handle().Duplicate(), buffer.size(), + mojo::UnwrappedSharedMemoryHandleProtection::kReadWrite); vea_->UseOutputBitstreamBuffer(buffer.id(), std::move(buffer_handle)); }
diff --git a/media/mojo/interfaces/jpeg_decode_accelerator_typemap_traits.cc b/media/mojo/interfaces/jpeg_decode_accelerator_typemap_traits.cc index 7d96de0..afaec30 100644 --- a/media/mojo/interfaces/jpeg_decode_accelerator_typemap_traits.cc +++ b/media/mojo/interfaces/jpeg_decode_accelerator_typemap_traits.cc
@@ -72,8 +72,13 @@ DLOG(ERROR) << "Failed to duplicate handle of BitstreamBuffer"; return mojo::ScopedSharedBufferHandle(); } - return mojo::WrapSharedMemoryHandle(input_handle, input.size(), - true /* read_only */); + + // TODO(https://crbug.com/793446): Update this to |kReadOnly| protection once + // BitstreamBuffer can guarantee that its handle() field always corresponds to + // a read-only SharedMemoryHandle. + return mojo::WrapSharedMemoryHandle( + input_handle, input.size(), + mojo::UnwrappedSharedMemoryHandleProtection::kReadWrite); } // static
diff --git a/media/mojo/interfaces/video_frame_struct_traits.cc b/media/mojo/interfaces/video_frame_struct_traits.cc index 220017f..8390938c 100644 --- a/media/mojo/interfaces/video_frame_struct_traits.cc +++ b/media/mojo/interfaces/video_frame_struct_traits.cc
@@ -26,8 +26,11 @@ media::MojoSharedBufferVideoFrame* mojo_frame = static_cast<media::MojoSharedBufferVideoFrame*>(input.get()); + // TODO(https://crbug.com/803136): This should duplicate as READ_ONLY, but + // can't because there is no guarantee that the input handle is sharable as + // read-only. mojo::ScopedSharedBufferHandle dup = mojo_frame->Handle().Clone( - mojo::SharedBufferHandle::AccessMode::READ_ONLY); + mojo::SharedBufferHandle::AccessMode::READ_WRITE); DCHECK(dup.is_valid()); return media::mojom::VideoFrameData::NewSharedBufferData(
diff --git a/media/mojo/services/mojo_audio_input_stream.cc b/media/mojo/services/mojo_audio_input_stream.cc index 87b98972..9dba860 100644 --- a/media/mojo/services/mojo_audio_input_stream.cc +++ b/media/mojo/services/mojo_audio_input_stream.cc
@@ -84,7 +84,7 @@ mojo::ScopedSharedBufferHandle buffer_handle = mojo::WrapSharedMemoryHandle( foreign_memory_handle, shared_memory->requested_size(), - /*read_only*/ true); + mojo::UnwrappedSharedMemoryHandleProtection::kReadOnly); mojo::ScopedHandle socket_handle = mojo::WrapPlatformFile(foreign_socket->Release());
diff --git a/media/mojo/services/mojo_audio_input_stream_unittest.cc b/media/mojo/services/mojo_audio_input_stream_unittest.cc index c8e8359..5f5cc50 100644 --- a/media/mojo/services/mojo_audio_input_stream_unittest.cc +++ b/media/mojo/services/mojo_audio_input_stream_unittest.cc
@@ -109,13 +109,15 @@ size_t memory_length; base::SharedMemoryHandle shmem_handle; - bool read_only; + mojo::UnwrappedSharedMemoryHandleProtection protection; EXPECT_EQ( mojo::UnwrapSharedMemoryHandle(std::move(shared_buffer), &shmem_handle, - &memory_length, &read_only), + &memory_length, &protection), MOJO_RESULT_OK); - EXPECT_TRUE(read_only); - buffer_ = std::make_unique<base::SharedMemory>(shmem_handle, read_only); + EXPECT_EQ(protection, + mojo::UnwrappedSharedMemoryHandleProtection::kReadOnly); + buffer_ = std::make_unique<base::SharedMemory>(shmem_handle, + true /* read_only */); GotNotification(initially_muted); }
diff --git a/media/mojo/services/mojo_audio_output_stream.cc b/media/mojo/services/mojo_audio_output_stream.cc index 4b60f1e..dc099729 100644 --- a/media/mojo/services/mojo_audio_output_stream.cc +++ b/media/mojo/services/mojo_audio_output_stream.cc
@@ -87,7 +87,8 @@ } mojo::ScopedSharedBufferHandle buffer_handle = mojo::WrapSharedMemoryHandle( - foreign_memory_handle, shared_memory->requested_size(), false); + foreign_memory_handle, shared_memory->requested_size(), + mojo::UnwrappedSharedMemoryHandleProtection::kReadWrite); mojo::ScopedHandle socket_handle = mojo::WrapPlatformFile(foreign_socket->Release());
diff --git a/media/mojo/services/mojo_audio_output_stream_unittest.cc b/media/mojo/services/mojo_audio_output_stream_unittest.cc index 7c6c358..f91064e2 100644 --- a/media/mojo/services/mojo_audio_output_stream_unittest.cc +++ b/media/mojo/services/mojo_audio_output_stream_unittest.cc
@@ -107,13 +107,15 @@ size_t memory_length; base::SharedMemoryHandle shmem_handle; - bool read_only; + mojo::UnwrappedSharedMemoryHandleProtection protection; EXPECT_EQ( mojo::UnwrapSharedMemoryHandle(std::move(shared_buffer), &shmem_handle, - &memory_length, &read_only), + &memory_length, &protection), MOJO_RESULT_OK); - EXPECT_FALSE(read_only); - buffer_ = std::make_unique<base::SharedMemory>(shmem_handle, read_only); + EXPECT_EQ(protection, + mojo::UnwrappedSharedMemoryHandleProtection::kReadWrite); + buffer_ = std::make_unique<base::SharedMemory>(shmem_handle, + false /* read_only */); GotNotification(); }
diff --git a/media/mojo/services/mojo_video_encode_accelerator_service.cc b/media/mojo/services/mojo_video_encode_accelerator_service.cc index 813b24f..83b959a 100644 --- a/media/mojo/services/mojo_video_encode_accelerator_service.cc +++ b/media/mojo/services/mojo_video_encode_accelerator_service.cc
@@ -136,9 +136,8 @@ base::SharedMemoryHandle handle; size_t memory_size = 0; - bool read_only = false; auto result = mojo::UnwrapSharedMemoryHandle(std::move(buffer), &handle, - &memory_size, &read_only); + &memory_size, nullptr); if (result != MOJO_RESULT_OK || memory_size == 0u) { DLOG(ERROR) << __func__ << " mojo::UnwrapSharedMemoryHandle() failed"; NotifyError(::media::VideoEncodeAccelerator::kPlatformFailureError);
diff --git a/mojo/edk/system/core.cc b/mojo/edk/system/core.cc index 4863856..d99ab85 100644 --- a/mojo/edk/system/core.cc +++ b/mojo/edk/system/core.cc
@@ -1052,7 +1052,8 @@ base::UnguessableToken token = base::UnguessableToken::Deserialize(guid->high, guid->low); - bool read_only = flags & MOJO_PLATFORM_SHARED_BUFFER_HANDLE_FLAG_READ_ONLY; + const bool read_only = + flags & MOJO_PLATFORM_SHARED_BUFFER_HANDLE_FLAG_HANDLE_IS_READ_ONLY; scoped_refptr<PlatformSharedBuffer> platform_buffer = PlatformSharedBuffer::CreateFromPlatformHandle(size, read_only, token, std::move(handle)); @@ -1111,7 +1112,7 @@ DCHECK(flags); *flags = MOJO_PLATFORM_SHARED_BUFFER_HANDLE_FLAG_NONE; if (platform_shared_buffer->IsReadOnly()) - *flags |= MOJO_PLATFORM_SHARED_BUFFER_HANDLE_FLAG_READ_ONLY; + *flags |= MOJO_PLATFORM_SHARED_BUFFER_HANDLE_FLAG_HANDLE_IS_READ_ONLY; ScopedPlatformHandle handle = platform_shared_buffer->PassPlatformHandle(); return ScopedPlatformHandleToMojoPlatformHandle(std::move(handle),
diff --git a/mojo/public/c/system/platform_handle.h b/mojo/public/c/system/platform_handle.h index 665d7f80..d160228 100644 --- a/mojo/public/c/system/platform_handle.h +++ b/mojo/public/c/system/platform_handle.h
@@ -79,9 +79,14 @@ // |MojoPlatformSharedBufferHandleFlags|: Flags relevant to wrapped platform // shared buffers. // -// |MOJO_PLATFORM_SHARED_BUFFER_HANDLE_NONE| - No flags. -// |MOJO_PLATFORM_SHARED_BUFFER_HANDLE_READ_ONLY| - Indicates that the wrapped -// buffer handle may only be mapped for reading. +// |MOJO_PLATFORM_SHARED_BUFFER_HANDLE_FLAG_NONE| - No flags. +// |MOJO_PLATFORM_SHARED_BUFFER_HANDLE_FLAG_HANDLE_IS_READ_ONLY| - Indicates +// that the handle being wrapped is mappable only to read-only memory. +// +// IMPORTANT: THIS DOES NOT CONTROL MEMORY PROTECTION ON THE WRAPPED +// HANDLE. It merely conveys a |MojoWrapPlatformSharedBufferHandle()| +// caller's knowledge about whether or not the handle being wrapped is +// already read-only. typedef uint32_t MojoPlatformSharedBufferHandleFlags; @@ -90,12 +95,12 @@ MOJO_PLATFORM_SHARED_BUFFER_HANDLE_FLAG_NONE = 0; const MojoPlatformSharedBufferHandleFlags - MOJO_PLATFORM_SHARED_BUFFER_HANDLE_FLAG_READ_ONLY = 1 << 0; + MOJO_PLATFORM_SHARED_BUFFER_HANDLE_FLAG_HANDLE_IS_READ_ONLY = 1 << 0; #else #define MOJO_PLATFORM_SHARED_BUFFER_HANDLE_FLAG_NONE \ ((MojoPlatformSharedBufferHandleFlags)0) -#define MOJO_PLATFORM_SHARED_BUFFER_HANDLE_FLAG_READ_ONLY \ +#define MOJO_PLATFORM_SHARED_BUFFER_HANDLE_FLAG_HANDLE_IS_READ_ONLY \ ((MojoPlatformSharedBufferHandleFlags)1 << 0) #endif @@ -145,14 +150,7 @@ // shared buffer object. // |num_bytes|: The size of the shared buffer in bytes. // |flags|: Flags which influence the treatment of the shared buffer object. See -// below. -// -// Flags: -// |MOJO_PLATFORM_SHARED_BUFFER_HANDLE_FLAG_NONE| indicates default behavior. -// No flags set. -// |MOJO_PLATFORM_SHARED_BUFFER_HANDLE_FLAG_READ_ONLY| indicates that the -// buffer handled to be wrapped may only be mapped as read-only. This -// flag does NOT change the access control of the buffer in any way. +// the |MojoPlatformSharedBufferHandleFlags| definition for details. // // Returns: // |MOJO_RESULT_OK| if the handle was successfully wrapped. In this case @@ -186,8 +184,9 @@ // shared buffer handle. // // Flags which may be set in |*flags| upon success: -// |MOJO_PLATFORM_SHARED_BUFFER_FLAG_READ_ONLY| is set iff the unwrapped -// shared buffer handle may only be mapped as read-only. +// |MOJO_PLATFORM_SHARED_BUFFER_HANDLE_FLAG_HANDLE_IS_READ_ONLY| is set iff +// the unwrapped shared buffer handle can only be mapped to a read-only +// memory segment. MOJO_SYSTEM_EXPORT MojoResult MojoUnwrapPlatformSharedBufferHandle( MojoHandle mojo_handle, struct MojoPlatformHandle* platform_handle,
diff --git a/mojo/public/cpp/system/platform_handle.cc b/mojo/public/cpp/system/platform_handle.cc index a2fdd9df..c8e9ef3 100644 --- a/mojo/public/cpp/system/platform_handle.cc +++ b/mojo/public/cpp/system/platform_handle.cc
@@ -65,7 +65,7 @@ ScopedSharedBufferHandle WrapSharedMemoryHandle( const base::SharedMemoryHandle& memory_handle, size_t size, - bool read_only) { + UnwrappedSharedMemoryHandleProtection protection) { if (!memory_handle.IsValid()) return ScopedSharedBufferHandle(); MojoPlatformHandle platform_handle; @@ -81,8 +81,8 @@ MojoPlatformSharedBufferHandleFlags flags = MOJO_PLATFORM_SHARED_BUFFER_HANDLE_FLAG_NONE; - if (read_only) - flags |= MOJO_PLATFORM_SHARED_BUFFER_HANDLE_FLAG_READ_ONLY; + if (protection == UnwrappedSharedMemoryHandleProtection::kReadOnly) + flags |= MOJO_PLATFORM_SHARED_BUFFER_HANDLE_FLAG_HANDLE_IS_READ_ONLY; MojoSharedBufferGuid guid; guid.high = memory_handle.GetGUID().GetHighForSerialization(); @@ -95,10 +95,11 @@ return ScopedSharedBufferHandle(SharedBufferHandle(mojo_handle)); } -MojoResult UnwrapSharedMemoryHandle(ScopedSharedBufferHandle handle, - base::SharedMemoryHandle* memory_handle, - size_t* size, - bool* read_only) { +MojoResult UnwrapSharedMemoryHandle( + ScopedSharedBufferHandle handle, + base::SharedMemoryHandle* memory_handle, + size_t* size, + UnwrappedSharedMemoryHandleProtection* protection) { if (!handle.is_valid()) return MOJO_RESULT_INVALID_ARGUMENT; MojoPlatformHandle platform_handle; @@ -116,8 +117,12 @@ if (size) *size = num_bytes; - if (read_only) - *read_only = flags & MOJO_PLATFORM_SHARED_BUFFER_HANDLE_FLAG_READ_ONLY; + if (protection) { + *protection = + flags & MOJO_PLATFORM_SHARED_BUFFER_HANDLE_FLAG_HANDLE_IS_READ_ONLY + ? UnwrappedSharedMemoryHandleProtection::kReadOnly + : UnwrappedSharedMemoryHandleProtection::kReadWrite; + } base::UnguessableToken guid = base::UnguessableToken::Deserialize(mojo_guid.high, mojo_guid.low);
diff --git a/mojo/public/cpp/system/platform_handle.h b/mojo/public/cpp/system/platform_handle.h index 8250fcf..1522bf3 100644 --- a/mojo/public/cpp/system/platform_handle.h +++ b/mojo/public/cpp/system/platform_handle.h
@@ -53,6 +53,20 @@ MOJO_PLATFORM_HANDLE_TYPE_WINDOWS_HANDLE; #endif // defined(OS_POSIX) +// Used to specify the protection status of a base::SharedMemoryHandle memory +// handle wrapped or unwrapped by mojo::WrapSharedMemoryHandle or +// mojo::UnwrapSharedMemoryHandle below. See those functions for additional +// details. +enum class UnwrappedSharedMemoryHandleProtection { + // Indicates that the base::SharedMemoryHandle supports being mapped to + // writable memory regions. + kReadWrite, + + // Indicates that the base::SharedMemoryHandle supports being mapped only to + // read-only memory regions. + kReadOnly, +}; + // Wraps a PlatformFile as a Mojo handle. Takes ownership of the file object. MOJO_CPP_SYSTEM_EXPORT ScopedHandle WrapPlatformFile(base::PlatformFile platform_file); @@ -62,22 +76,49 @@ MojoResult UnwrapPlatformFile(ScopedHandle handle, base::PlatformFile* file); // Wraps a base::SharedMemoryHandle as a Mojo handle. Takes ownership of the -// SharedMemoryHandle. Note that |read_only| is only an indicator of whether -// |memory_handle| only supports read-only mapping. It does NOT have any -// influence on the access control of the shared buffer object. +// SharedMemoryHandle. |size| indicates the size of the underlying +// base::SharedMemory object, and |current_protection| indicates whether or +// not |memory_handle| supports being mapped to writable memory segments. +// +// ***** IMPORTANT. PLEASE READ BELOW CAREFULLY. ***** +// +// THIS CALL DOES NOT IN ANY WAY AFFECT THE MEMORY PROTECTION STATUS OF THE +// WRAPPED HANDLE. +// +// The |current_protection| argument is only an indication of the current memory +// protection status of |memory_handle| as known by the caller. +// +// DO NOT wrap a writable |memory_handle| with |current_protection| set to +// |UnwrappedSharedMemoryHandleProtection::kReadOnly|, as this will mislead +// corresponding callers to |UnwrapSharedMemoryHandle()|: the subsequently +// unwrapped SharedMemoryHandle will appear to be read-only on the surface, but +// will still be mappable to a writable memory segment. +// +// Use base::SharedMemory::GetReadOnlyHandle() to acquire a read-only handle to +// a shared memory object if you intend to wrap the handle with +// |UnwrappedSharedMemoryHandleProtection::kReadOnly|. MOJO_CPP_SYSTEM_EXPORT ScopedSharedBufferHandle WrapSharedMemoryHandle( const base::SharedMemoryHandle& memory_handle, size_t size, - bool read_only); + UnwrappedSharedMemoryHandleProtection current_protection); // Unwraps a base::SharedMemoryHandle from a Mojo handle. The caller assumes -// responsibility for the lifetime of the SharedMemoryHandle. +// responsibility for the lifetime of the SharedMemoryHandle. On success, +// |*memory_handle| is set to a valid handle, |*size| is is set to the size of +// that handle's underlying base::SharedMemory object, and +// |*protection| indicates whether or not the handle may only be mapped +// to a read-only memory segment. +// +// Note that if |*protection| is +// |UnwrappedSharedMemoryHandleProtection::kReadOnly| upon return, writable +// mapping of |*memory_handle| should not be attempted, and (unless there +// is buggy code misusing WrapSharedMemoryHandle above) will always fail. MOJO_CPP_SYSTEM_EXPORT MojoResult UnwrapSharedMemoryHandle(ScopedSharedBufferHandle handle, base::SharedMemoryHandle* memory_handle, size_t* size, - bool* read_only); + UnwrappedSharedMemoryHandleProtection* protection); #if defined(OS_MACOSX) && !defined(OS_IOS) // Wraps a mach_port_t as a Mojo handle. This takes a reference to the
diff --git a/mojo/public/cpp/system/tests/BUILD.gn b/mojo/public/cpp/system/tests/BUILD.gn index f580601d..7acc44b 100644 --- a/mojo/public/cpp/system/tests/BUILD.gn +++ b/mojo/public/cpp/system/tests/BUILD.gn
@@ -19,6 +19,7 @@ deps = [ "//base", "//base/test:test_support", + "//mojo/edk/test:test_support", "//mojo/public/c/system/tests", "//mojo/public/cpp/system", "//mojo/public/cpp/test_support:test_utils",
diff --git a/net/http/http_basic_state.cc b/net/http/http_basic_state.cc index 041d73f..cee4a40 100644 --- a/net/http/http_basic_state.cc +++ b/net/http/http_basic_state.cc
@@ -23,6 +23,7 @@ : read_buf_(new GrowableIOBuffer()), connection_(std::move(connection)), using_proxy_(using_proxy), + can_send_early_(false), http_09_on_non_default_ports_enabled_( http_09_on_non_default_ports_enabled) { CHECK(connection_) << "ClientSocketHandle passed to HttpBasicState must " @@ -32,6 +33,7 @@ HttpBasicState::~HttpBasicState() = default; int HttpBasicState::Initialize(const HttpRequestInfo* request_info, + bool can_send_early, RequestPriority priority, const NetLogWithSource& net_log, const CompletionCallback& callback) { @@ -42,6 +44,7 @@ connection_.get(), request_info, read_buf_.get(), net_log)); parser_->set_http_09_on_non_default_ports_enabled( http_09_on_non_default_ports_enabled_); + can_send_early_ = can_send_early; return OK; }
diff --git a/net/http/http_basic_state.h b/net/http/http_basic_state.h index c89beab..5ce7945e 100644 --- a/net/http/http_basic_state.h +++ b/net/http/http_basic_state.h
@@ -35,6 +35,7 @@ // Initialize() must be called before using any of the other methods. int Initialize(const HttpRequestInfo* request_info, + bool can_send_early, RequestPriority priority, const NetLogWithSource& net_log, const CompletionCallback& callback); @@ -43,6 +44,7 @@ bool using_proxy() const { return using_proxy_; } + bool can_send_early() const { return can_send_early_; } bool http_09_on_non_default_ports_enabled() const { return http_09_on_non_default_ports_enabled_; } @@ -69,6 +71,8 @@ const bool using_proxy_; + bool can_send_early_; + const bool http_09_on_non_default_ports_enabled_; GURL url_;
diff --git a/net/http/http_basic_state_unittest.cc b/net/http/http_basic_state_unittest.cc index c0d337ab..0d6621c 100644 --- a/net/http/http_basic_state_unittest.cc +++ b/net/http/http_basic_state_unittest.cc
@@ -46,7 +46,7 @@ TEST(HttpBasicStateTest, InitializeWorks) { HttpBasicState state(std::make_unique<ClientSocketHandle>(), false, false); const HttpRequestInfo request_info; - EXPECT_EQ(OK, state.Initialize(&request_info, LOW, NetLogWithSource(), + EXPECT_EQ(OK, state.Initialize(&request_info, false, LOW, NetLogWithSource(), CompletionCallback())); EXPECT_TRUE(state.parser()); } @@ -54,7 +54,7 @@ TEST(HttpBasicStateTest, DeleteParser) { HttpBasicState state(std::make_unique<ClientSocketHandle>(), false, false); const HttpRequestInfo request_info; - state.Initialize(&request_info, LOW, NetLogWithSource(), + state.Initialize(&request_info, false, LOW, NetLogWithSource(), CompletionCallback()); EXPECT_TRUE(state.parser()); state.DeleteParser(); @@ -68,7 +68,7 @@ HttpRequestInfo request_info; request_info.url = GURL("http://www.example.com/path?foo=bar#hoge"); request_info.method = "PUT"; - state.Initialize(&request_info, LOW, NetLogWithSource(), + state.Initialize(&request_info, false, LOW, NetLogWithSource(), CompletionCallback()); EXPECT_EQ("PUT /path?foo=bar HTTP/1.1\r\n", state.GenerateRequestLine()); } @@ -80,7 +80,7 @@ HttpRequestInfo request_info; request_info.url = GURL("http://www.example.com/path?foo=bar#hoge"); request_info.method = "PUT"; - state.Initialize(&request_info, LOW, NetLogWithSource(), + state.Initialize(&request_info, false, LOW, NetLogWithSource(), CompletionCallback()); EXPECT_EQ("PUT http://www.example.com/path?foo=bar HTTP/1.1\r\n", state.GenerateRequestLine());
diff --git a/net/http/http_basic_stream.cc b/net/http/http_basic_stream.cc index 5498b78..aada0ab 100644 --- a/net/http/http_basic_stream.cc +++ b/net/http/http_basic_stream.cc
@@ -25,10 +25,11 @@ HttpBasicStream::~HttpBasicStream() = default; int HttpBasicStream::InitializeStream(const HttpRequestInfo* request_info, + bool can_send_early, RequestPriority priority, const NetLogWithSource& net_log, const CompletionCallback& callback) { - state_.Initialize(request_info, priority, net_log, callback); + state_.Initialize(request_info, can_send_early, priority, net_log, callback); return OK; }
diff --git a/net/http/http_basic_stream.h b/net/http/http_basic_stream.h index d1f5493..15b74c60 100644 --- a/net/http/http_basic_stream.h +++ b/net/http/http_basic_stream.h
@@ -40,6 +40,7 @@ // HttpStream methods: int InitializeStream(const HttpRequestInfo* request_info, + bool can_send_early, RequestPriority priority, const NetLogWithSource& net_log, const CompletionCallback& callback) override;
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc index fc8171b2..44e52f4 100644 --- a/net/http/http_network_transaction.cc +++ b/net/http/http_network_transaction.cc
@@ -86,6 +86,7 @@ request_(NULL), priority_(priority), headers_valid_(false), + can_send_early_data_(false), request_headers_(), read_buf_len_(0), total_received_bytes_(0), @@ -133,6 +134,10 @@ proxy_ssl_config_.rev_checking_enabled = false; } + if (request_info->method != "POST") { + can_send_early_data_ = true; + } + if (request_->load_flags & LOAD_PREFETCH) response_.unused_since_prefetch = true; @@ -908,7 +913,8 @@ stream_->GetRemoteEndpoint(&remote_endpoint_); - return stream_->InitializeStream(request_, priority_, net_log_, io_callback_); + return stream_->InitializeStream(request_, can_send_early_data_, priority_, + net_log_, io_callback_); } int HttpNetworkTransaction::DoInitStreamComplete(int result) {
diff --git a/net/http/http_network_transaction.h b/net/http/http_network_transaction.h index 866b5a2..554a725 100644 --- a/net/http/http_network_transaction.h +++ b/net/http/http_network_transaction.h
@@ -339,6 +339,9 @@ // True if we've validated the headers that the stream parser has returned. bool headers_valid_; + // True if we can send the request over early data. + bool can_send_early_data_; + SSLConfig server_ssl_config_; SSLConfig proxy_ssl_config_;
diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc index 3d001304..a2f6033 100644 --- a/net/http/http_network_transaction_unittest.cc +++ b/net/http/http_network_transaction_unittest.cc
@@ -15719,6 +15719,7 @@ RequestPriority priority() const { return priority_; } int InitializeStream(const HttpRequestInfo* request_info, + bool can_send_early, RequestPriority priority, const NetLogWithSource& net_log, const CompletionCallback& callback) override { @@ -15972,10 +15973,12 @@ // the fact that the WebSocket code is not compiled on iOS makes that // difficult. int InitializeStream(const HttpRequestInfo* request_info, + bool can_send_early, RequestPriority priority, const NetLogWithSource& net_log, const CompletionCallback& callback) override { - state_.Initialize(request_info, priority, net_log, callback); + state_.Initialize(request_info, can_send_early, priority, net_log, + callback); return OK; }
diff --git a/net/http/http_proxy_client_socket_pool_unittest.cc b/net/http/http_proxy_client_socket_pool_unittest.cc index 8bc6e55..90069d8e 100644 --- a/net/http/http_proxy_client_socket_pool_unittest.cc +++ b/net/http/http_proxy_client_socket_pool_unittest.cc
@@ -768,22 +768,22 @@ // Timeout should be |transport_rtt_multiplier| times the transport RTT // estimate. base::TimeDelta rtt_estimate = base::TimeDelta::FromSeconds(7); - estimator()->set_start_time_null_transport_rtt(rtt_estimate); + estimator()->SetStartTimeNullTransportRtt(rtt_estimate); EXPECT_EQ(rtt_estimate + rtt_estimate, pool_->ConnectionTimeout()); // A change in RTT estimate should also change the connection timeout. rtt_estimate = base::TimeDelta::FromSeconds(8); - estimator()->set_start_time_null_transport_rtt(rtt_estimate); + estimator()->SetStartTimeNullTransportRtt(rtt_estimate); EXPECT_EQ(rtt_estimate + rtt_estimate, pool_->ConnectionTimeout()); // Connection timeout should not exceed |max_timeout|. rtt_estimate = base::TimeDelta::FromSeconds(25); - estimator()->set_start_time_null_transport_rtt(rtt_estimate); + estimator()->SetStartTimeNullTransportRtt(rtt_estimate); EXPECT_EQ(max_timeout, pool_->ConnectionTimeout()); // Connection timeout should not be less than |min_timeout|. rtt_estimate = base::TimeDelta::FromSeconds(0); - estimator()->set_start_time_null_transport_rtt(rtt_estimate); + estimator()->SetStartTimeNullTransportRtt(rtt_estimate); EXPECT_EQ(min_timeout, pool_->ConnectionTimeout()); } @@ -802,24 +802,24 @@ // Timeout should be |transport_rtt_multiplier| times the transport RTT // estimate. base::TimeDelta rtt_estimate = base::TimeDelta::FromSeconds(2); - estimator()->set_start_time_null_transport_rtt(rtt_estimate); + estimator()->SetStartTimeNullTransportRtt(rtt_estimate); EXPECT_EQ(rtt_estimate + rtt_estimate + rtt_estimate, pool_->ConnectionTimeout()); // A change in RTT estimate should also change the connection timeout. rtt_estimate = base::TimeDelta::FromSeconds(7); - estimator()->set_start_time_null_transport_rtt(rtt_estimate); + estimator()->SetStartTimeNullTransportRtt(rtt_estimate); EXPECT_EQ(rtt_estimate + rtt_estimate + rtt_estimate, pool_->ConnectionTimeout()); // Connection timeout should not exceed |max_timeout|. rtt_estimate = base::TimeDelta::FromSeconds(35); - estimator()->set_start_time_null_transport_rtt(rtt_estimate); + estimator()->SetStartTimeNullTransportRtt(rtt_estimate); EXPECT_EQ(max_timeout, pool_->ConnectionTimeout()); // Connection timeout should not be less than |min_timeout|. rtt_estimate = base::TimeDelta::FromSeconds(0); - estimator()->set_start_time_null_transport_rtt(rtt_estimate); + estimator()->SetStartTimeNullTransportRtt(rtt_estimate); EXPECT_EQ(min_timeout, pool_->ConnectionTimeout()); } @@ -834,24 +834,24 @@ // Timeout should be |transport_rtt_multiplier| times the transport RTT // estimate. base::TimeDelta rtt_estimate = base::TimeDelta::FromMilliseconds(10); - estimator()->set_start_time_null_transport_rtt(rtt_estimate); + estimator()->SetStartTimeNullTransportRtt(rtt_estimate); // Connection timeout should not be less than the transport RTT estimate. EXPECT_LE(rtt_estimate, pool_->ConnectionTimeout()); // A change in RTT estimate should also change the connection timeout. rtt_estimate = base::TimeDelta::FromSeconds(10); - estimator()->set_start_time_null_transport_rtt(rtt_estimate); + estimator()->SetStartTimeNullTransportRtt(rtt_estimate); // Connection timeout should not be less than the transport RTT estimate. EXPECT_LE(rtt_estimate, pool_->ConnectionTimeout()); // Set RTT to a very large value. rtt_estimate = base::TimeDelta::FromMinutes(60); - estimator()->set_start_time_null_transport_rtt(rtt_estimate); + estimator()->SetStartTimeNullTransportRtt(rtt_estimate); EXPECT_GT(rtt_estimate, pool_->ConnectionTimeout()); // Set RTT to a very small value. rtt_estimate = base::TimeDelta::FromSeconds(0); - estimator()->set_start_time_null_transport_rtt(rtt_estimate); + estimator()->SetStartTimeNullTransportRtt(rtt_estimate); EXPECT_LT(rtt_estimate, pool_->ConnectionTimeout()); }
diff --git a/net/http/http_response_body_drainer_unittest.cc b/net/http/http_response_body_drainer_unittest.cc index 9c5dfa8..c3a0fafa 100644 --- a/net/http/http_response_body_drainer_unittest.cc +++ b/net/http/http_response_body_drainer_unittest.cc
@@ -88,6 +88,7 @@ // HttpStream implementation. int InitializeStream(const HttpRequestInfo* request_info, + bool can_send_early, RequestPriority priority, const NetLogWithSource& net_log, const CompletionCallback& callback) override {
diff --git a/net/http/http_stream.h b/net/http/http_stream.h index 1763722a..35146de3 100644 --- a/net/http/http_stream.h +++ b/net/http/http_stream.h
@@ -51,9 +51,12 @@ // Initialize stream. Must be called before calling SendRequest(). // The consumer should ensure that request_info points to a valid value till // final response headers are received; after that point, the HttpStream - // will not access |*request_info| and it may be deleted. + // will not access |*request_info| and it may be deleted. If |can_send_early| + // is true, this stream may send data early without confirming the handshake + // if this is a resumption of a previously established connection. // Returns a net error code, possibly ERR_IO_PENDING. virtual int InitializeStream(const HttpRequestInfo* request_info, + bool can_send_early, RequestPriority priority, const NetLogWithSource& net_log, const CompletionCallback& callback) = 0;
diff --git a/net/http/http_stream_factory_impl_unittest.cc b/net/http/http_stream_factory_impl_unittest.cc index f0c1d788..b7ff549 100644 --- a/net/http/http_stream_factory_impl_unittest.cc +++ b/net/http/http_stream_factory_impl_unittest.cc
@@ -100,6 +100,7 @@ // HttpStream methods int InitializeStream(const HttpRequestInfo* request_info, + bool can_send_early, RequestPriority priority, const NetLogWithSource& net_log, const CompletionCallback& callback) override {
diff --git a/net/http/proxy_connect_redirect_http_stream.cc b/net/http/proxy_connect_redirect_http_stream.cc index 2fc8eb8..699d71a 100644 --- a/net/http/proxy_connect_redirect_http_stream.cc +++ b/net/http/proxy_connect_redirect_http_stream.cc
@@ -22,6 +22,7 @@ int ProxyConnectRedirectHttpStream::InitializeStream( const HttpRequestInfo* request_info, + bool can_send_early, RequestPriority priority, const NetLogWithSource& net_log, const CompletionCallback& callback) {
diff --git a/net/http/proxy_connect_redirect_http_stream.h b/net/http/proxy_connect_redirect_http_stream.h index 5df1ffa..285a9b4 100644 --- a/net/http/proxy_connect_redirect_http_stream.h +++ b/net/http/proxy_connect_redirect_http_stream.h
@@ -29,6 +29,7 @@ // marked one. int InitializeStream(const HttpRequestInfo* request_info, + bool can_send_early, RequestPriority priority, const NetLogWithSource& net_log, const CompletionCallback& callback) override;
diff --git a/net/http/transport_security_state_static.json b/net/http/transport_security_state_static.json index d42b004..26d8c0d 100644 --- a/net/http/transport_security_state_static.json +++ b/net/http/transport_security_state_static.json
@@ -2048,7 +2048,6 @@ { "name": "leonklingele.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "madars.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "magneticanvil.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, - { "name": "mimeit.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "mobilcom-debitel-empfehlen.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "morethanadream.lv", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "narodniki.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, @@ -3770,7 +3769,6 @@ { "name": "sifls.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "smkn1lengkong.sch.id", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "ssldecoder.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, - { "name": "startupsort.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "sx3.no", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "tech-seminar.jp", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "tncnanet.com.br", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, @@ -5413,7 +5411,6 @@ { "name": "ronwo.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "rootwpn.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "russmarshall.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, - { "name": "rww.name", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "saltercane.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "saveyour.biz", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "scienceathome.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, @@ -6941,7 +6938,6 @@ { "name": "tsumi.it", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "tty.space", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "tuvalie.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, - { "name": "tuxcall.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "ty2u.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "uat-activesg.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "ukrgadget.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, @@ -7356,7 +7352,6 @@ { "name": "kleinerarchitekturfuehrer.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "klicktojob.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "kmkz.jp", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, - { "name": "kojima-life.co.jp", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "kolmann.eu", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "krasota.ru", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "krmela.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, @@ -7703,7 +7698,6 @@ { "name": "xn--3lqp21gwna.xn--fiqs8s", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "xn--3lqt7ir4md4tzwa.cn", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "xn--3lqt7ir4md4tzwa.xn--fiqs8s", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, - { "name": "xn--jobbrse-d1a.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "xn--qckss0j.tk", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "xqin.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "xuri.me", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, @@ -8451,7 +8445,6 @@ { "name": "polypet.com.sg", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "posylka.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "ppro.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, - { "name": "prezola.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "pro-link.eu", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "projectarmy.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "punknews.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, @@ -11228,7 +11221,6 @@ { "name": "waylaydesign.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "wdt.cz", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "wealthcentral.com.au", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, - { "name": "wealthfactory.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "wealthreport.com.au", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "wear2work.nl", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "wearandcare.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, @@ -12338,7 +12330,6 @@ { "name": "svatba-frantovi.cz", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "sumoatm.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "tails.com.ar", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, - { "name": "tabelfirme.ro", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "sv-turm-hohenlimburg.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "taravancil.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "tangibilizing.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, @@ -15809,7 +15800,6 @@ { "name": "itilo.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "jamessmith.me.uk", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "justmy.website", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, - { "name": "johnmcgovern.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "karmaassurance.ca", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "jiyuu-ni.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "joe-pagan.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, @@ -16029,7 +16019,6 @@ { "name": "magnets.jp", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "mfxbe.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "miegl.cz", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, - { "name": "lmkts.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "logicio.ch", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "lwl12.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "mockmyapp.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, @@ -18237,7 +18226,6 @@ { "name": "xn--yoamomisuasbcn-ynb.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "yuzu.tk", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "zlc1994.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, - { "name": "xuwei.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "woufbox.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "zenycosta.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "worldsbeststory.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, @@ -18595,7 +18583,6 @@ { "name": "bundespolizei-forum.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "carbon12.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "cesipagano.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, - { "name": "businesshub.cz", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "c3vo.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "card-toka.jp", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "achterstieg.dedyn.io", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, @@ -22543,7 +22530,6 @@ { "name": "planktonholland.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "premiership-predictors.co.uk", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "pikeitservices.com.au", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, - { "name": "pnyxnet.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "pottshome.co.uk", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "philia-sa.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "proxybay.eu.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, @@ -25753,7 +25739,6 @@ { "name": "fitea.cz", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "fivestepfunnels.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "fixmyalarmpanel.co.uk", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, - { "name": "fixvoltage.ru", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "fktpm.ru", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "flairbros.at", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "flaretechnologies.io", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, @@ -26433,7 +26418,6 @@ { "name": "kineto.space", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "kingclass.cn", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "kingdomcrc.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, - { "name": "kingopen.cn", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "kintoandar.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "kirainmoe.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "kisallatorvos.hu", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, @@ -27871,7 +27855,6 @@ { "name": "sugarcitycon.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "suiranfes.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "sumguy.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, - { "name": "sungo.wtf", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "sunsmartresorts.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "supa.sexy", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "supercalorias.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, @@ -28042,7 +28025,6 @@ { "name": "tiste.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "titusetcompagnies.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "tjandpals.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, - { "name": "tjullrich.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "tkacz.pro", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "tkts.cl", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "tkusano.jp", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, @@ -31204,7 +31186,6 @@ { "name": "pokemontabletopadventures.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "portalcarriers.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "pixelfou.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, - { "name": "popcultureshack.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "plut.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "plaque-funeraire.fr", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "phdwuda.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, @@ -31271,7 +31252,6 @@ { "name": "privacynow.eu", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "promods.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "privacyscore.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, - { "name": "polkam.go.id", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "propepper.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "prodinger.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "plantastique.ch", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, @@ -34308,7 +34288,6 @@ { "name": "sonoecoracao.com.br", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "sobelift.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "staxflax.tk", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, - { "name": "studentshare.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "stephsolis.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "steinbergmedia.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "soldout-app.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, @@ -34907,7 +34886,6 @@ { "name": "ripmixmake.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "00001.am", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "pascalmathis.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, - { "name": "zqwqz.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "scrumbleship.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "sidpod.ru", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "saintaardvarkthecarpeted.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, @@ -35066,7 +35044,6 @@ { "name": "globalprojetores.com.br", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "great.nagoya", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "grouphomes.com.au", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, - { "name": "gym-old.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "halitopuroprodutos.com.br", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "hanys.xyz", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "haogoodair.ca", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, @@ -36577,7 +36554,6 @@ { "name": "dnfc.rocks", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "dockerm.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "documaniatv.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, - { "name": "doesnotscale.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "domengrad.ru", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "domian.cz", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "dominik-schlueter.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, @@ -37328,7 +37304,6 @@ { "name": "owl-stat.ch", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "owlishmedia.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "paazmaya.fi", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, - { "name": "pagalworld.la", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "painlessproperty.co.uk", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "paktolos.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "pantallasled.com.mx", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, @@ -37800,10 +37775,6 @@ { "name": "votercircle.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "voyagesdetective.fr", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "vozami.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, - { "name": "vpls.co.th", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, - { "name": "vpls.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, - { "name": "vpls.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, - { "name": "vplssolutions.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "vranjske.co.rs", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "vsamsonov.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, { "name": "vuzi.fr", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true }, @@ -40202,7 +40173,6 @@ { "name": "mncr.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, { "name": "monolithindustries.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, { "name": "mystatus24.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, - { "name": "nil2.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, { "name": "ortho-graz.at", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, { "name": "os24.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, { "name": "oyesunn.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, @@ -41480,7 +41450,6 @@ { "name": "urcentral.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, { "name": "vaindil.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, { "name": "vales.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, - { "name": "vampyrium.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, { "name": "vapecom-shop.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, { "name": "vectro.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, { "name": "venninvestorplatform.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, @@ -42075,7 +42044,6 @@ { "name": "violet-letter.delivery", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, { "name": "vize.ai", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, { "name": "vliegensvlug.services", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, - { "name": "voeux.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, { "name": "vvdbronckhorst.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, { "name": "vww-8522.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, { "name": "w10club.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, @@ -42108,6 +42076,2113 @@ { "name": "z-coder.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, { "name": "zenics.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, { "name": "zoomseoservices.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "00100010.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "00120012.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "00130013.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "00140014.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "00150015.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "00160016.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "00180018.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "00190019.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "00330033.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "00440044.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "00550055.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "00660066.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "00770077.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "00880088.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "00990099.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "110110110.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "112112112.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "113113113.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "118118118.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "1481481.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "1481481.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "1481482.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "1481482.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "1481483.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "1481483.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "1481485.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "1481485.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "1481486.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "1481486.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "168bet9.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "168bo9.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "168bo9.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "168esb.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "174343.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "1day1ac.red", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "2333blog.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "233boy.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "24hourscienceprojects.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "2fl.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "2li.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "304squadron.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "3839.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "404.guide", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "439050.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "4flex.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "5214889.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "5214889.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "52b9.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "52b9.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "5310899.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "5310899.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "53ningen.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "546802.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "598598598.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "788da.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "7bwin.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "81uc.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "8888esb.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "8901178.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "8901178.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "8910899.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "8910899.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "8917168.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "8917168.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "8917818.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "8917818.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "8951889.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "8951889.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "8992088.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "8992088.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "9617818.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "9617818.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "9696178.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "9696178.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "9bingo.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "a-1basements.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "aa6688.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "abckam.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "aboutyou.at", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "aboutyou.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "aboutyou.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "aboutyou.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "aboutyou.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "abstractbarista.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "abstractbarista.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "accredit.ly", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "aceanswering.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "acroso.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "actom.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "actom.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "adamcoffee.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "adhd-inattentive.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "admin-forms.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "adminwerk.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "adminwerk.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "advancyte.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "agelesscitizen.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "agelesscitizens.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "agoravm.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "agouraelectrician.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ai1989.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "aimerworld.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "aimrom.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "akcounselingservices.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "alainodea.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "alcoholapi.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "alexsinnott.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "alextjam.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "alibababee.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "allenosgood.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "allenscaravans.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "allgrass.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "allgrass.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "allgreenturf.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "allincoin.shop", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "alljamin.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "allpropertyservices.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "allseasons-cleaning.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "allsync.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "allsync.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "alpinechaletrental.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "alpinetrek.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "alpiniste.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "altaplana.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "altitudemoversdenver.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "altruistgroup.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "alwaysonssl.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "alzonaprinting.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "amaderelectronics.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "amalficoastchauffeur.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "amalfitabula.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "amauf.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "america.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ameriikanpoijat.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "amielucha.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "amitpatra.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ammanagingdirectors.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "amosng.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "andariegocusco.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "andys-place.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ankya9.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ansermfg.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "antennisti.milano.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "anthony.codes", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "antyblokada.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "apache-portal.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "apination.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "appformacpc.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "apps4all.sytes.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "archivero.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "arcridge.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "areqgaming.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "arimarie.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "arlingtonwine.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "armedpoet.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "aromacos.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "artboja.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "arteaga.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "arteaga.tech", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "arteaga.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "arteaga.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "artecat.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "artisansoftaste.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "artmarketingnews.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ashlocklawgroup.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "asspinter.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "astal.rs", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "atac.no", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ateamsport.dk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "atedificacion.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "atelierdeloulou.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "atheist-refugees.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "attac.us", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "audividi.shop", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "augix.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "aupasdecourses.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "aurelienaltarriba.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "auroware.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "austinuniversityhouse.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "australianarmedforces.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "australianimmigrationadvisors.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "autocrypt.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "autopapo.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "autostock.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "autres-talents.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "av0ndale.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "avanet.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "avatarrecruit.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "avexon.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "avia-krasnoyarsk.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "avia-ufa.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "aviapoisk.kz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "avietech.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "awxg.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ayon.group", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b0618.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b0618.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b0868.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b0868.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b1236.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b1758.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b1758.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b1768.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b1768.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b1788.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b1788.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b1rd.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b2486.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b2486.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b5189.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b5189.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b5289.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b5289.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b5989.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b5989.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b61688.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b8591.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b8591.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b8979.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b8979.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9018.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9018.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9108.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9108.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9110.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9112.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9112.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b911gt.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b911gt.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9168.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b91688.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b91688.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b91688.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b91688.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9175.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9175.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9258.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9258.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9318.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9318.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9418.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9418.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9428.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9428.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9453.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9453.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9468.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9468.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9488.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9488.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9498.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9498.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9518.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9518.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9518.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9518.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9520.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9528.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9528.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9538.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9538.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9568.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9586.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9588.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b95888.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9589.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9598.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9598.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9658.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9658.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b96899.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9758.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9758.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9818.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9818.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9858.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9858.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9880.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9883.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9884.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9885.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9886.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9886.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9887.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9888.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b98886.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9889.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9920.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9930.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9948.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9948.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b99520.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9960.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9970.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9980.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b99881.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b99882.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b99883.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b99885.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b99886.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9best.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9best.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9king.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9king.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9king.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9winner.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9winner.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "b9winner.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bachata.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "baka-gamer.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ballinarsl.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bamboorelay.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "banduhn.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "banknet.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bao-in.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bao-in.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "baodan666.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "baptistedeleris.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "barabrume.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "barryswebdesign.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bat909.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bat9vip.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bat9vip.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "batvip9.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bayz.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bbnbb.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bbswin9.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bbswin9.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bbxin9.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bbxin9.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bcdonadio.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bcdonadio.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bcodeur.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "be9418.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "be9418.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "be9418.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "be9418.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "be9458.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "be9458.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "be9458.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "be9458.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "be958.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "be958.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "be958.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "be958.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "be9966.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bealpha.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bebout.domains", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "beerview.ga", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bellthrogh.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bellthrough.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "benevisim.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "benjii.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "benriya.shiga.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "benzi.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bergfreunde.dk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bergfreunde.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bergfreunde.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bergfreunde.fi", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bergfreunde.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bergfreunde.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bergfreunde.no", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bergfreunde.se", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "berodes.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bessettenotaire.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bestattorney.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bestbatteriesonline.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bestesb.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bestesb.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bestinductioncooktop.us", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bestoffert.club", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bet-99.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bet-99.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bet168wy.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bet168wy.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bet909.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bet990.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bet9bet9.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "betgo9.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "betterjapanese.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "betwin9.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "betwin9.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "beylikduzum.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "beylikduzuvaillant.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bh.sb", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bicecontracting.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bihub.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "biletyplus.by", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "biletyplus.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "biletyplus.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "biletyplus.ua", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bill-nye-the.science", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "binbin9.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "binbin9.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bingo9.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "binkanhada.biz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "biocheminee.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "birgitandmerlin.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bistrotdelagare.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bitcoinwalletscript.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bitenose.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bitenose.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bitgrapes.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bitxel.com.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bjl5689.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bjl5689.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bkhayes.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "blackislegroup.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "blackscreen.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "blazing.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bling9.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bling999.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bling999.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bling999.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "blip.website", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "blobfolio.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "blockshopauto.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "blok56.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bludnykoren.ml", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "blueblou.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bluecardlottery.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bluedeck.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "blunderify.se", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bluproducts.com.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bmriv.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bo1689.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bo1689.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bo9club.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bo9club.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bo9club.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bo9fun.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bo9fun.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bo9game.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bo9game.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bo9king.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "boards.ie", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bodypainting.waw.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bolgarnyelv.hu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bondingwithbaby.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "booksearch.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bopiweb.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bordes.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "boredhackers.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "boundarybrighton.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bovenwebdesign.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bozit.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bramburek.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bramstaps.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "breatheav.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "breatheproduction.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "briandwells.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "brownihc.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "brztec.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bsa157.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bsd-box.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bsdes.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bserved.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "budget.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bulario.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "burtplasticsurgery.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "buryit.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "busybee360.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "buybike.shop", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "buycarpet.shop", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "buycook.shop", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "buyhealth.shop", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "buyjewel.shop", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "buyplussize.shop", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "buyprofessional.shop", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "buywine.shop", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "buywood.shop", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bx-web.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bytema.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bytema.sk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bythen.cn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "bywin9.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "caarecord.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cadams.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cadra.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "calcedge.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "campingskyhooks.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "canglong.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "canker.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "canterbury.ws", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "canx.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "captainark.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "car-rental24.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "carlscatering.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "carolinaclimatecontrolsc.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cartadeviajes.cl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cartadeviajes.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cartadeviajes.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cartadeviajes.com.ar", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cartadeviajes.com.ve", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cartadeviajes.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cartadeviajes.ec", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cartadeviajes.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cartadeviajes.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cartadeviajes.mx", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cartadeviajes.pe", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cartadeviajes.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "casacameo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "caseplus-daem.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cashsector.ga", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "casino-trio.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "caspar.ai", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cayounglab.co.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cdbtech.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cdsdigital.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "centralebigmat.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cerberusinformatica.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cercevelet.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "certifiednurses.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cfpa-formation.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "changes.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "chaosriftgames.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "chasse-et-plaisir.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "chd-expert.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "checkspf.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cheladmin.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "chemicalcrux.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "chemiphys.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cherie-belle.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cherylsoleway.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "chiboard.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "chikazawa.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "chinwag.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "chloca.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "chrisaitch.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "christopherkennelly.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "chriswald.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cidersus.com.ec", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "circulatedigital.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "civicunicorn.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "civicunicorn.us", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ckenelley.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ckenelly.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ckenely.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ckenneley.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ckennelley.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ckennely.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "claritysrv.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "clash.lol", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "classroomcountdown.co.nz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "clazzrooms.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cleansewellness.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "clearbreezesecuritydoors.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "clicksaveandprint.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "clinicminds.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "clnc.to", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "clorophilla.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "club-duomo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "clubcall.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "clubiconkenosha.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cmdtelecom.net.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cmrss.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cocktail-shaken.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cocubes.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cokebar.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "coldstreamcreekfarm.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "collectorknives.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "coltonrb.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "comidasperuanas.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "commco.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "comoeliminarlaspapulasperladasenelglande.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "comosatisfaceraunhombreenlacamaydejarloloco.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "compeat.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "compusolve.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "concertsenboite.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "conory.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "contentdesign.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "convergencela.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cookeatup.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "coolprylar.se", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "corintech.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "corporateclash.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "corpsepaint.life", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "corrbee.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cosmechic.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "couscous.recipes", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "creatieven.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "creativeconceptsvernon.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "creato.top", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "creatujoya.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "creditreporttips.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cribcore.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "crimevictims.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cronologie.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "crose.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "crypteianetworks.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cryptolinc.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "csehnyelv.hu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "csgoswap.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ctcue.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cubix.host", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cueca.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cumplegenial.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cupcakesandcrinoline.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cupcao.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cybercrew.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cyberseguranca.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cyelint.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "cygnaltech.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "czfa.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "d-msg.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "dabuttonfactory.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "damienpontifex.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "daminiphysio.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "darknetlive.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "datacave.is", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "daverandom.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "davidbranco.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "davidbrito.tech", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "deanisa.ninja", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "decaffeinated.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "decs.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "dedg3.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "deeps.cat", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "deeps.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "dekonix.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "delfino.cr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "deltaonlineguards.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "deparis.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "depedtayo.ph", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "desuperheroes.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "devagency.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "dewaard.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "dicio.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "digitalcitizen.life", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "digitalcitizen.ro", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "digitalfishfun.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "dildoexperten.se", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "direct-sel.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "directspa.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "dischempharmacie.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "disinfestazioni.venezia.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "distiduffer.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "dj-leszwolle.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "djcursuszwolle.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "djursland-psykologen.dk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "dnscrawler.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "doc-justice.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "doesburg-comp.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "dogcontrol.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "domen-reg.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "dominique-haas.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "domquixoteepi.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "dongxuwang.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "dotshule.ug", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "doubleaste.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "downrightcute.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "dp.cx", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "dreadd.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "dreax.win", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "dreischneidiger.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "drillingsupplystore.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "drmtransit.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "dronnet.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "drugs.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "drvr.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "dsmjs.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "dsouzamusic.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "dsrw.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "dubai-company.ae", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "dunklau.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "duoquadragintien.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "durfteparticiperen.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "dusnan.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "dustplanet.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "dzytdl.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "e-tech-solution.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "e-techsolution.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "e-techsolutions.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "e-vo-linka.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "e1488.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "e4metech.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "e52888.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "e52888.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "e53888.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "e53888.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "e59888.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "e59888.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "eagle.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "eaglemessaging.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "eastsidecottages.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "easycontentplan.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ebene-bpo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ebizarts.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ecodedi.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "eddokloosterman.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "edehsa.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "edincmovie.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "edservicing.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "edxn.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "egrp365.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ekati.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ekb-avia.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ekyu.moe", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "electric-vault.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "electricalagourahills.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "electricalcalabasas.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "electricalcamarillo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "electricalconejovalley.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "eleicoes2018.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "elektronickakancelar.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "eleonorengland.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "eline168.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "elviraszabo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "elvispresley.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "elwix.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "elysiria.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "empyrean-advisors.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "emvoiceapp.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "en4u.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "enderbycamping.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "endoftenancycleaninglondon.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "enginx.cn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ensemble-vos-idees.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "entheorie.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "enviatufoto.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "epa.com.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ephesusbreeze.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "epreskripce.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "equinetherapy.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "eroimatome.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "eroma.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "erwinpaal.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "es888.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "es8888.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "es888999.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "es999.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "es9999.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb-in.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb-top.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb-top.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb111.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb116.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb1314.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb1668.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb168168.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb168168.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb168168.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb168168.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb1688.biz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb1688.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb1688.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb1688.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb1688.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb16888.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb1711.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb1711.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb1788.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb1788.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb1788.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb1788.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb17888.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb2013.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb2013.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb2099.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb2099.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb222.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb258.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb325.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb325.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb333.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb336.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb369.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb433.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb518.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb553.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb555.biz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb555.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb555.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb556.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb5889.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb5889.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb6.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb666.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb666.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb66666.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb677.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb688.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb68888.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb775.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb777.biz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb777.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb777.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb777.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb777.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb777.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb777.us", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb886.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb888.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb8886.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb9527.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb9588.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb9588.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb9588.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb9588.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb999.biz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb999.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb999.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb999.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esb999.us", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esba11.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esba11.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esba11.in", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esba11.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esba11.us", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esball-in.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esball-in.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esball.bz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esball.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esball.in", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esball.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esball.mx", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esball.online", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esball.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esball.win", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esball.ws", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esball518.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esball518.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esball518.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esball518.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esball888.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esballs.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esbbon.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esbbon.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esbfun.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esbfun.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esbgood.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esbin.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esbjon.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esbjon.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esbm4.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esbm5.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esmoney.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "esmoney.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "etech-solution.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "etech-solution.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "etech-solutions.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "etechsolution.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ethandelany.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "eurolocarno.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "europeantimberconnectors.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "europeos.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "euroskano.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "eurousa.us", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "euvo.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "eva-select.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "evailoil.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "evamira.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "event64.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "everydaywp.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "evilsite.cf", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "exatmiseis.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "exchaser.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "exploringenderby.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "extreme.co.th", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "eyona.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "f2h.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "f3nws.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "facekungfu.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "factcool.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "faerb.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "fanboi.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "faradome.ws", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "farmaciamedicom.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "fastvistorias.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "faui2k17.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "fbiic.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "fbtholdings.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "fedemo.top", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "federatedbank.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "fedpartnership.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "feeriedesign-event.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "feetpa.ws", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "felger-times.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "feng-in.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "feng-in.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "feudaltactics.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "feuerwehr-mehring.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ffiec.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "fibo-forex.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "filanthropystar.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "finchnest.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "fingerscrossed.style", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "fintry.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "firefly-iii.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "fireworkcoaching.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "fitfitup.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "fiveboosts.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "fixvoltage.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "flamero.fi", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "flangaapis.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "fleurenplume.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "flextribly.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "fliino.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "fliino.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "fliino.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "fliino.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "flipbell.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "flirtycourts.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "flmortgagebank.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "florenceapp.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "floro.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "flowinvoice.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "flugsportvereinigungcelle.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "fluhrers.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "fluitbeurt.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "fmussatmd.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "focuspointtechnologies.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "forbid.life", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "force-des-maths.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "fordlibrarymuseum.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "forecastcity.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "forfunssake.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "forpc.us", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "fotonjan.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "fowlsmurf.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "francescoservida.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "frankenhost.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "frankslaughterinsurance.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "frederikvig.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "freelancecollab.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "freepnglogos.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "frejasdal.dk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "frosthall.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "frugal-millennial.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "fs-community.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "fu-li88.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "fu-li88.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "fullhost.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "futurehack.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "fwest98.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "gaff-rig.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "galle.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "gamecdn.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ganaenergia.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ganasoku.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "gaudeamus-folklor.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "gavinsblog.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "gayukai.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "gazachallenge.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "generalinsuranceservices.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "generationsweldom.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "geojs.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "georgewbushlibrary.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "getenergized2018.kpn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "getpagespeed.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "getteamninja.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "gfms.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "gfw.moe", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ghid-pitesti.ro", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "giethoorn.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "gigime.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ginza-luce.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "gites-alizea.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "gkvsc.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "glaciernursery.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "gladystudio.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "globalgovernancewatch.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "god-esb.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "godbo9.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "godbo9.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "godbo9.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "godesb.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "goedkopeonesies.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "goetic.space", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "goozp.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "goquiq.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "gorgias.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "gorognyelv.hu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "gotrail.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "gowin9.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "gowin9.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "grahamcluley.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "gram.tips", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "grandcafetwist.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "gratiswifivoorjegasten.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "greatagain.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "greenitpark.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "grengine.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "grexx.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "grexx.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "grifomarchetti.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "grimstveit.no", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "groenewoud.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "gruenderwoche-dresden.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "grumpygamers.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "guiacidade.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "guideline.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "guidelines.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "guishem.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "gumannp.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "gumballs.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "guoliang.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "gutschein-spezialist.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "h1z1swap.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ha-kunamatata.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "habbixed.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "habitat-domotique.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "habview.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "haccp.bergamo.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "hakase.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "hamon.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "hanoibuffet.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "hansbijster.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "haptemic.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "has-no-email-set.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "hasecuritysolutions.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "hashimoto-jimusho.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "hayleishop.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "hdnastudio.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "healey.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "health.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "healthfinder.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "healthypeople.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "hearty.gq", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "hearty.ml", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "hebocon.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "heijdel.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "heinemann.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "heinemeier.dk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "heistheguy.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "helpfute.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "helpverif.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "helpwithmybank.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "henkboelman.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "hermann.in", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "herrenmuehle-wein.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "heute.training", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "heyjournal.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "hf-tekst.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "hf51.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "hibari.moe", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "hideout.agency", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "hightechgadgets.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "hipnoseinstitute.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "hireprofs.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "hitokoto-mania.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "hiyobi.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "hl8999.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "hnyp.hu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "hoaas.no", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "hochzeitsgezwitscher.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "hodnos.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "homepage.shiga.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "homyremedies.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "honeycreeper.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "hoorr.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "hope-line-earth.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "horizonmoto.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "horvatnyelvkonyv.hu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "hotesb.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "hotesb.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "housekeeperlondon.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "howgoodwasmysex.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "hstspreload.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "hua-in.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "hua-li88.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "hua-li88.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "huangting.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "hubrecht.at", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "hui-in.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "hui-in.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "huislijn.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "humboldtmfg.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "hunstoncanoeclub.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "huntexpired.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "hyperactive.am", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "hztgzz.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "i-scream.space", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "i5y.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "iainsimms.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "iainsimms.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "iane-ccs.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ich-hab-die-schnauze-voll-von-der-suche-nach-ner-kurzen-domain.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "icnsoft.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ideapaisajistas.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ideasenfoto.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "idered.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "idesignstudio.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "idrissi.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ig.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "iha6.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ikkbb.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ikkev.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "imeid.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "immaternity.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "imponet.com.ar", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "imprenta-es.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "inetsoftware.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "infinite.hosting", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "infruction.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ing89.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ing89.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ingatlanneked.hu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ingi.ga", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "inmoodforsex.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "inspirationconcepts.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "instamojo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "intergenx.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "intergenx.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "intergenx.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "intergenx.org.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "interiery-waters.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "interiorprofesional.com.ar", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "interspot.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "invitethemhome.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "invuelto.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "iodine.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "iplayradio.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ironhide.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "isaaczais.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "iskkk.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "istheinternetonfire.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "it-maker.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "iwch.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "iworos.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "iyassu.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "izzys.casa", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "j0bs.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "jakob-server.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "jamalfi.bio", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "janhermann.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "jape.today", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "jastrow.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "javiermixdjs.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "jaysenjohnson.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "jci.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "jdgonzalez95.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "jedayoshi.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "jeepeg.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "jenniferchan.id.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "jetapi.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "jetbrains.pw", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "jexler.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "jfsa.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "jiid.ga", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "jing-in.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "jing-in.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "jiosongs.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "jldp.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "jlot.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "jobers.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "jobers.pt", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "joblab.com.ua", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "joel.coffee", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "joeyhoer.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "johannes-bugenhagen.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "johanneskonrad.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "johego.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "jonespayne.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "jonincharacter.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "jonlu.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "joonatoona.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "jose-alexand.re", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "joshuadmiller.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "journalof.tech", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "jselby.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "judge2020.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "judge2020.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "juliohernandezgt.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "jungundwild-design.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "juridiqueo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "justiceo.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "justinrudio.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "jzachpearson.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "k38.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "k4r.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "kaeru-seitai.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "kai.cool", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "kakuto.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "kalamos-psychiatrie.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "kaleidoskop-freiburg.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "kalwestelectric.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "kamppailusali.fi", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "kana-mono.biz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "kanag.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "kanr.in", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "kanzakiranko.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "kanzlei-myca.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "kaotik4266.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "kargl.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "keematdekho.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "kescher.site", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "kfirba.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "kidsareatrip.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "kin.life", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "kinderjugendfreizeitverein.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "kirwandigital.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "kissesb.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "kissesb.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "kivitelezesbiztositas.hu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "klseet.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "kocherev.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "kochereva.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "kochhar.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "kogcoder.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "koka-shop.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "koninkrijk.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "konventa.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "kopio.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "kopjethee.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "koppelvlak.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "korben.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "kostal.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "kotly-marten.com.ua", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "kouten-jp.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "koval.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "kowalstwo.com.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "kpforme.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "kraftzeiten.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "kraken.site", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "krasnodar-avia.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "krausen.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "kreditkarte-fuer-backpacker.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "kryptomodkingz.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "kupinska.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "kuroinu.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "kwench.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "kyprexxo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "la-compagnie-des-elfes.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "laatjeniethackmaken.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "laboutiquedejuliette.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "labrat.mobi", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "lachosetypo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ladyanna.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "lafcheta.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "lagit.in", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "lalalab.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "lalunecreative.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "lamaisondelatransformationculturelle.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "lamereabizix.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "langstreckensaufen.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "lanternhealth.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "lassesworld.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "lassesworld.se", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "launchpadder2.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "lauraofrank.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "lauriemilne.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "laut.digital", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "law.co.il", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "lc-cs.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "lcrmscp.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "le-drive-de-just-vet.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "leaderoftheresistance.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "leaderoftheresistance.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "leadquest.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "learnforestry.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "lecoinchocolat.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ledlampor365.se", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "legaleus.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "lengyelnyelvoktatas.hu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "lengyelul.hu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "leodraxler.at", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "leonauto.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "lesaffre.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "lesh.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "letempsdunefleur.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "leviaan.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "lhajn.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "lian-in.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "lian-in.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "liang-li88.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "liang-li88.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "librarytools.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "libre-service.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "lichttechnik-tumler.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "lieblingsholz.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "lieuu.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "lifeinsurances.pro", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "lifeinsurances24.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "light-up.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "limbo.services", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "limn.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "lincnaarzorg.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "linux.im", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "linuxincluded.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "liquimoly.market", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "littlegreece.ae", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "liufengyu.cn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "livelifewithintent.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "localdata.us", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "locomotive.net.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "lojadarenda.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "lojavirtualfc.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "loket.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "loli.ski", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "losangelestown.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "lovebo9.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "lovebo9.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "lovingpenguin.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "lswim.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ltaake.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "lucaslarson.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ludum.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "luedeke-bremen.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "lufu.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "lui.pink", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "lxd.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "lycly.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "lyscnd.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mackiehouse.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "maddreefer.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "madridartcollection.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "maelstrom-fury.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mahraartisan.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "maisonpaulmier.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "makemyvape.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "makeurbiz.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "malone.link", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mamaasia.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mamafit.club", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mamuko.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "manageathome.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mantabiofuel.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "marcelinofranchini.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "marcelinofranchini.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "marcelinofranchini.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "marcelinofranchini.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "marco-goltz.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "marjoriecarvalho.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mark-armstrong-gaming.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "marketingco.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "marketingromania.ro", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "marklauman.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "marpa-wohnen.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "marshyplay.live", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "martijnhielema.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "marustat.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "math.hamburg", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "matrixim.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mattari-app.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mattmcshane.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mauricedb.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "maxpl0it.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mchan.us", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mcpaoffice.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "md-clinica.com.ua", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mdlayher.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mediarocks.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "medinside.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "medinside.li", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "medinsider.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "medinsider.li", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "medschat.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "medvet.com.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "melopie.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "memo.ee", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mendozagenevieve.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mennace.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "menntagatt.is", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "metro-web.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "meujeitodigital.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "meyash.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mfen.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mfxer.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "miaonagemi.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "michal-s.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "micomi.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "midkam.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mikewritesstuff.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mikhirev.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "min.kiwi", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "minehattan.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "minerva2015.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ministeriumfuerinternet.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "minu.link", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mirabalphoto.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mirrorsedgearchive.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mirrorsedgearchive.ga", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mitigationcommission.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mixer.cash", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mjscustomcreations.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mlmjam.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mlpvector.club", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mms.is", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mobilebingoclub.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mobilecasinoclub.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mobilemalin.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mobimalin.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mobmp4.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mobmp4.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mobmp4.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mockerel.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "modding-forum.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "modelclub-draveil.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "moebel-vergleichen.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "moisesbarrio.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "momfulfilled.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "momy-genealogie.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mon-mobile.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "monalyse.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "monicabeckstrom.no", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "monodukuri.cafe", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "monodzukuri.cafe", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "monozukuri.cafe", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "moodforsex.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "moolah.rocks", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "moonbot.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "moreal.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "morepopcorn.co.nz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "motowilliams.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "movienized.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mozartgroup.hu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mrbuckykat.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mrknee.gr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mrparker.pw", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mufibot.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mushman.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mustafaturhan.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "myabcm.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mycareersfuture.sg", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "myessaygeek.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mygreatlakes.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mymarketingcourses.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mypaperdone.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "myref.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mysexydate24.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mysongbird.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "mytun.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "n64chan.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "nakada4610.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "nameme.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "namskra.is", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "naomi.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "nataniel-perissier.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "nationalbank.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "nationalbanknet.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "nay.moe", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "nba669.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "nba686.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "nbad.al", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "nc-beautypro.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "nc-formation.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "nc-network.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "necio.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "neilfarrington.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "nekox.ml", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "neocyd.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "neoeliteconsulting.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "neonataleducationalresources.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "neonatalgoldenhours.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "nepageeks.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "nepremicninar.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "nepremicnine.click", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "nepremicnine.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "net-masters.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "nethask.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "netsparker.com.tr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "nettamente.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "neurolab.no", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "news4c.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ngc.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "nhsuites.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "nicholaswilliams.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "nickscomputers.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "nightsi.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "nikkasystems.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "nimidam.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ninepints.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "nirjonmela.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "noelblog.ga", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "noise.agency", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "noisetor.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "nolimits.net.nz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "nomenclator.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "nordlichter-brv.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "norichanmama.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "normanschwaneberg.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "northokanaganbookkeeping.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "novgorod-avia.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "novosibavia.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "nsa.ovh", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "nsapwn.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "nutriciametabolics-shop.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "nutrishop.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "o8b.club", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "oclausen.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "octo.im", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "octohost.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ohohrazi.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "oisd.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "olgui.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "oliveoil.bot", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "oliverclausen.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "oliviervaillancourt.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ollies.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "onahonavi.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ondcp.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "oneidentity.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "onetly.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "oni.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "online-calculator.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "online-stopwatch.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "online.net.gr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "onlyesb.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "onlyesb.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "onsgenoegen-waz.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "onspring.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "opalesurfcasting.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "openclima.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "opentuition.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "operationforever.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "oppag.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "optm.us", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "orbitdefence.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "oregonmu.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "orum.in", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "osla.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "osmre.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "otus-magnum.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ouowo.gq", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pablo.scot", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pablo.sh", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pabloarteaga.com.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pabloarteaga.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pabloarteaga.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pabloarteaga.nom.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pabloarteaga.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pabloarteaga.science", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pabloarteaga.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pacifique-web.nc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "packshot-creator.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "padron.com.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pagalworld.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pagalworld.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pagalworld.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pagalworld.la", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "paincareehr.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "paket.ml", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "palawan.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "palazzotalamo.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pangci.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "papapa-members.club", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "papotage.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "paradependentesquimicos.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "parisderriere.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pasearch.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "passvanille-reservation.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "patentados.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "patika-biztositas.hu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "paulmeier.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pay.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pb.ax", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pcdocjim.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "peaceispossible.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pearlcohen.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "peddy.dyndns.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pedro.com.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pelotonimports.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "penguinprotocols.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "penispumpen.se", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pepper.dog", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "perm-avia.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "permajackofstlouis.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "petit-archer.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pflan.dk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pflegesalon-siebke.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pi-net.dedyn.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pierreprinetti.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pimpmypaper.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pinklittlenotebook.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pixiv.cat", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pixloc.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "plagiarismcheck.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "planer.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "planetanim.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "plannedlink.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "planujemywesele.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "plasticsurgerynola.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "playreal.city", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "plerion.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pm25.im", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pmgnet.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pneu01.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pneu74.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pocakdrops.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pocakking.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pocitacezababku.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pocket-lint.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pohlmann.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pointworksacademy.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "policereferencecheck.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pomfeed.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pomozmruczkom.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "poolspondsandwaterscapes.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "popcultureshack.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "port.im", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "posijson.stream", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "powerserg.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "powersergholdings.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "powertothebuilder.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pozlife.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "praktijkdevecht.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pritchett.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "privatecapsecurity.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pro-esb.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pro-esb.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "prodware.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "proesb.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "proesb.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "projectl1b1t1na.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "promotioncentre.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "proteogenix-products.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "protocol.ai", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "prylarprylar.se", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "psdsuc.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pthsec.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "publicinquiry.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pulpproject.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "punchunique.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "purplehippie.in", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "putman-it.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "puzzlage.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pvda.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pvpctutorials.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pycycle.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "pzsearch.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "qc.immo", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "qclt.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "qruiser.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "quanwuji.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "quartix.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "quartzclinical.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "quilmo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "quimsertek.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "qwdqwd.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "qwq.moe", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "r1ch.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "radartatska.se", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "radartek.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "radiorsvp.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "rammstein-portugal.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "rangsmo.se", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ranyeh.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "raphrfg.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "rapidemobile.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "rapidflow.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "raucris.ro", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "raviparekh.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "raystark.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "raywin168.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "raywin168.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "raywin88.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "recipex.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "red-trigger.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "red2fred2.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "redactieco.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "regency-fire.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "regency-fire.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "regisearch.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "registerra.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "renewmedispa.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "resfriatech.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "reviewninja.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "richamorindonesia.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ricky.capital", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ristrutturazioneappartamento.roma.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "rizalpalawan.gov.ph", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "rlnunez.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "robertnemec.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "robertocasares.no-ip.biz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "roboth.am", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "rodarion.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "roelbazuin.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "roligprylar.se", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "rollercoasteritalia.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "rollingbarge.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "rook-playz.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "roopakv.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "rootkea.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ropd.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "roseparkhouse.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "rosetiger.life", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "rostov-avia.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ruaneattorneys.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ruobr.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "rushyo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "rwx.ovh", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "s-n-unso.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "s-s-paint.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "s3cases.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "s44.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sabtunes.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "saintw.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sajamstudija.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "salon1.ee", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "samanthasicecream.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "samara-avia.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sandiegotown.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sapphireblue.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sarahplusdrei.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sasrobotics.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sativatunja.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "saxeandthecity.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sbrouwer.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "schollbox.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "schwerkraftlabor.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "scib.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "scicomm.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "scijinks.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "scrapmalin.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "screenmachine.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sdxcentral.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sean-wright.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "season.moe", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sebastianpedersen.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sebasveeke.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sec.red", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sec455.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sec530.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sec555.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "secureim.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "seehimnaked.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "seehimnude.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "seehisnudes.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "seobutler.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sergiozygmunt.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "servida.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "setenforce.one", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sevenicealimentos.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sexdocka.nu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sharelovenotsecrets.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "shaunandamyswedding.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "shico.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "shiga1.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "shihadwiki.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "shouttag.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "shteiman.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "shura.eu.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "silerfamily.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sim-minaoshi.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "simhaf.cf", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "simplyregister.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sinclairinat0r.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sinn.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sipsik.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sjaakgilsingfashion.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "skanword.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "skedda.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "skepneklaw.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "skiddle.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "skippy.dog", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sknclinics.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "skolagatt.is", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "skyderby.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "slashcrypto.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sleepstar.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "slonep.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "smadav.ml", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "smalle-voet.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "smartcpa.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "smilingmiao.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "smx.net.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "socialtrends.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "societe-chablaisienne-de-revetements.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "societe-chablaisienne-de-revetements.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sodadigital.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "softart.club", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sokouchousa.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "solvingproblems.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sommefeldt.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sompani.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sonicdoe.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sorenam.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sortesim.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "soruly.moe", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "spaconnection.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "spaldingwall.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "spanyolul.hu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sparendirekt.at", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sparprofi.at", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "spcx.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "specialtyalloys.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "speechdrop.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "speedof.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "speedway.com.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "spellchecker.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "spindrift.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "splintermail.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "spoluck.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sponsormatch.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "spookyinternet.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "spot-lumiere-led.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "spotrebitelskecentrum.sk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sr-33.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ssbgportal.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ssc8689.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ssc8689.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ssdservers.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ssready.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "staktrace.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "startle.cloud", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "stdev.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "steamhours.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "stemapp.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "steuerberater-essen-steele.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "stevemonteyne.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "stickeramoi.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "stiffordacademy.org.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "stouter.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "striata.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "stuudium.cloud", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "stuudium.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "subrosr.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "succesprojekter.dk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sudo.org.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sunfulong.blog", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sunriseafricarelief.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "super-demarche.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "supperclub.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "surfocal.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "suroil.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "swallsoft.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "swallsoft.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "swap.gg", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sweep.cards", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sweet-orr.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sweets-mimatsu.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "swisstechtalks.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "swordfighting.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "sym01.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "symetria.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "systemadmin.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "systemd.eu.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "szerbnyelvkonyv.hu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "szlovaknyelv.hu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "szlovennyelv.hu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "tacklinglife.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "tadluedtke.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "tai-in.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "tai-in.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "takebackyourstate.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "takebackyourstate.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "takebackyourstate.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "tangsisi.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "taniafitness.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "taniafitness.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "tanie-uslugi-ksiegowe.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "tariff.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "tass.nu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "tbys.us", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "tchaka.top", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "teambodyproject.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "teamninjaapp.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "techdroid.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "techformator.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "technosuport.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "tecnologiasurbanas.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "telefonogratuito.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "telfordwhitehouse.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "tematicas.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "tennisapp.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "tenpo-iku.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "tenzer.dk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "termax.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "terra.fitness", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "tfreeman.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "theadultswiki.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "theconcordbridge.azurewebsites.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "theemasphere.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "thefasterweb.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "thefengshuioffice.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "thegemriverside.com.vn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "thehiddenbay.ws", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "theplaidpoodle.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "thesaurus.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "thesignacademy.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "thesmallbusinesswebsiteguy.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "thewarrencenter.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "thewoolroom.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "thinegen.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "thisdot.site", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "thomas.love", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "thriveweb.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "tigit.co.nz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "tiglitub.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "timetech.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "timothybjacobs.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "tinlc.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "tiny.ee", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "titanpointe.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "tju.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "to2mbn.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "tobias-kleinmann.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "tobyx.is", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "todacarreira.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "toekomstperspectief.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "tokinoha.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "tokky.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "tomaspatera.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "tomlowenthal.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "tomosm.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "toolkits.design", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "toothdoc.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "top-esb.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "topbilan.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "topesb.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "topicdesk.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "toponlinecasinosites.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "topwindowcleaners.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "torngalaxy.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "torte.roma.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "totodil.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "totolabs.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "touchweb.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "touhou.fm", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "tourtrektrip.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "tovp.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "toyota-kinenkan.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "trackingstream.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "trade-arcade.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "travel1x1.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "travellovers.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "treaslockbox.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "treetopsecurity.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "tribly.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "troomcafe.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "trouver-son-chemin.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "troykelly.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "trustednetworks.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "tryfm.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "trygarciniaslimdiet.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ttyystudio.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "turnaroundforum.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "tutorme.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "tuwaner.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "tuza.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "tv-programme.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "tv-programme.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "txbi.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "uahs.org.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "uhlhosting.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ultimate-uk.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ultrasite.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "umbriel.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "unblock-zh.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "unccelearn.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "unefleur.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "unidevgroup.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "unifiednetwork.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "uno.fi", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "upperroommission.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "urbanmic.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "urth.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "usbr.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "utcast-mate.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "utgifter.no", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "valudo.st", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "vanderbiltcisa.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "vantagepointpreneed.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "vasilikieleftheriou.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "vats.im", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "vatsim-uk.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "vatsim.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "vaughanrisher.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "vcps.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "vega-motor.com.ua", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "vegalengd.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "vegguide.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "veit.zone", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ventilateurs-plafond.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "veraandsteve.date", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "verbier-lechable.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "vernonfigureskatingclub.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "very-kids.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "victoreriksson.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "victoreriksson.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "victoreriksson.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "victoreriksson.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "victoreriksson.nu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "victoreriksson.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "vidadu.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "vidb.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "videoload.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "videospornogratis.pt", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "villamariaamalfi.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "vinogradovka.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "vintagebandfestival.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "vintagesouthernpicks.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "vipesball.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "vipesball.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "vipesball.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "vipesball.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "visit-montenegro.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "vizija-nepremicnine.si", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "vjhfoundation.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "vmstan.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "volbyzive.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "vrijgezellenfeestzwolle.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "vucdn.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "vynedmusic.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "w50.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "w84.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "wai-in.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "waka168.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "waka168.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "waka88.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "wakfu.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "wakiminblog.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "waltzmanplasticsurgery.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "walvi.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "wannaridecostarica.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "warcraftjournal.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "wasatchcrest.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "waylee.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "web-demarche.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "webdesignlabor.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "webev.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "websitesabq.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "webwednesday.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "weiltoast.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "weld.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "wen-in.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "wen-in.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "werkenvoorphiladelphia.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "wezl.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "whistler-transfers.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "whitehousedrugpolicy.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "whoasome.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "whocybered.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "willowtree.school", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "wisak.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "woktoss.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "woodcoin.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "woonboulevardvolendam.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "worf.in", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "workissime.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "workshopszwolle.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "workshopzwolle.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "worldcareers.dk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "wpformation.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "wphelpwithhomework.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "writemyessay.today", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "wrmea.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "wuxiaohen.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "wybar.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "wzfetish.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "xanadu-taxi.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "xilegames.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "xin-in.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "xin-in.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "xing-in.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "xinghuokeji.xin", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "xn--lnakuten-9za.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "xn--n8jubz39q0g0afpa985c.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "xn--pckqk6xk43lunk.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "xn--zr9h.cf", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "xn--zr9h.ga", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "xn--zr9h.ml", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "xn--zr9h.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "xnu.kr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "xsec.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "xuan-li88.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "xuan-li88.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "xxxlbox.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "yacineboumaza.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "yakaz.cl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "yakaz.com.ar", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "yakaz.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "yakaz.com.mx", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "yakaz.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "yakaz.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "yakaz.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "yakaz.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "yannick.cloud", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "yao-in.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "yao-in.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ybscareers.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "yenibilgi.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "yetishirt.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "yimgo.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "yocchan1513.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "yoga-alliance-teacher-training.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "yongbin.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "yourfriendlytech.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "ysx.me.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "yubico.se", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "yubikey.se", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "yuema.net.cn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "yummylooks.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "yurisviridov.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "yusu.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "yutang.vn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "yvetteerasmus.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "yzcloud.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "z-latko.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "zacharyschneider.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "zachschneider.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "zaem.tv", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "zaghyr.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "zalohovaniburian.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "zargescases.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "zekesnider.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "zeroseteatacado.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "zgan.ga", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "zhiwei.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "zhuweiyou.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "zitseng.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "zorki.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "zrnieckapresny.sk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "zuan-in.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "zyciedogorynogami.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, + { "name": "zyrillezuno.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true }, // END OF 1-YEAR BULK HSTS ENTRIES // Only eTLD+1 domains can be submitted automatically to hstspreload.org,
diff --git a/net/nqe/network_quality_estimator.h b/net/nqe/network_quality_estimator.h index d8c5cae2..343f735 100644 --- a/net/nqe/network_quality_estimator.h +++ b/net/nqe/network_quality_estimator.h
@@ -359,6 +359,10 @@ // the signal quality. virtual int32_t GetCurrentSignalStrength() const; + // Forces computation of effective connection type, and notifies observers + // if there is a change in its value. + void ComputeEffectiveConnectionType(); + // Observer list for RTT or throughput estimates. Protected for testing. base::ObserverList<RTTAndThroughputEstimatesObserver> rtt_and_throughput_estimates_observer_list_; @@ -530,10 +534,6 @@ // Periodically updates |increase_in_transport_rtt_| by posting delayed tasks. void IncreaseInTransportRTTUpdater(); - // Forces computation of effective connection type, and notifies observers - // if there is a change in its value. - void ComputeEffectiveConnectionType(); - const char* GetNameForStatistic(int i) const; // Gathers metrics for the next connection type. Called when there is a change
diff --git a/net/nqe/network_quality_estimator_test_util.cc b/net/nqe/network_quality_estimator_test_util.cc index a5f76649..3e82cbfc4 100644 --- a/net/nqe/network_quality_estimator_test_util.cc +++ b/net/nqe/network_quality_estimator_test_util.cc
@@ -361,4 +361,24 @@ observer); } +void TestNetworkQualityEstimator::SetStartTimeNullHttpRtt( + const base::TimeDelta http_rtt) { + start_time_null_http_rtt_ = http_rtt; + // Force compute effective connection type so that the new RTT value is + // immediately picked up. This ensures that the next call to + // GetEffectiveConnectionType() returns the effective connnection type + // that was computed based on |http_rtt|. + ComputeEffectiveConnectionType(); +} + +void TestNetworkQualityEstimator::SetStartTimeNullTransportRtt( + const base::TimeDelta transport_rtt) { + start_time_null_transport_rtt_ = transport_rtt; + // Force compute effective connection type so that the new RTT value is + // immediately picked up. This ensures that the next call to + // GetEffectiveConnectionType() returns the effective connnection type + // that was computed based on |transport_rtt|. + ComputeEffectiveConnectionType(); +} + } // namespace net
diff --git a/net/nqe/network_quality_estimator_test_util.h b/net/nqe/network_quality_estimator_test_util.h index e6cba70..3b18867 100644 --- a/net/nqe/network_quality_estimator_test_util.h +++ b/net/nqe/network_quality_estimator_test_util.h
@@ -122,9 +122,8 @@ void NotifyRTTAndThroughputEstimatesObserverIfPresent( RTTAndThroughputEstimatesObserver* observer) const override; - void set_start_time_null_http_rtt(const base::TimeDelta& http_rtt) { - start_time_null_http_rtt_ = http_rtt; - } + // Force set the HTTP RTT estimate. + void SetStartTimeNullHttpRtt(const base::TimeDelta http_rtt); void set_recent_http_rtt(const base::TimeDelta& recent_http_rtt) { // Callers should not set effective connection type along with the @@ -138,9 +137,8 @@ bool GetRecentHttpRTT(const base::TimeTicks& start_time, base::TimeDelta* rtt) const override; - void set_start_time_null_transport_rtt(const base::TimeDelta& transport_rtt) { - start_time_null_transport_rtt_ = transport_rtt; - } + // Force set the transport RTT estimate. + void SetStartTimeNullTransportRtt(const base::TimeDelta transport_rtt); void set_recent_transport_rtt(const base::TimeDelta& recent_transport_rtt) { // Callers should not set effective connection type along with the
diff --git a/net/nqe/network_quality_estimator_unittest.cc b/net/nqe/network_quality_estimator_unittest.cc index 66948dd..45a1b31 100644 --- a/net/nqe/network_quality_estimator_unittest.cc +++ b/net/nqe/network_quality_estimator_unittest.cc
@@ -930,15 +930,12 @@ }; for (const auto& test : tests) { - estimator.set_start_time_null_http_rtt( - base::TimeDelta::FromMilliseconds(test.rtt_msec)); estimator.set_recent_http_rtt( base::TimeDelta::FromMilliseconds(test.rtt_msec)); estimator.set_start_time_null_downlink_throughput_kbps(INT32_MAX); estimator.set_recent_downlink_throughput_kbps(INT32_MAX); - // Run one main frame request to force recomputation of effective connection - // type. - estimator.RunOneRequest(); + estimator.SetStartTimeNullHttpRtt( + base::TimeDelta::FromMilliseconds(test.rtt_msec)); EXPECT_EQ(test.expected_conn_type, estimator.GetEffectiveConnectionType()); } } @@ -988,7 +985,7 @@ estimator.SimulateNetworkChange(NetworkChangeNotifier::CONNECTION_WIFI, "test"); - estimator.set_start_time_null_transport_rtt( + estimator.SetStartTimeNullTransportRtt( base::TimeDelta::FromMilliseconds(test.transport_rtt_msec)); estimator.set_recent_transport_rtt( base::TimeDelta::FromMilliseconds(test.transport_rtt_msec)); @@ -1044,15 +1041,12 @@ estimator.SimulateNetworkChange(NetworkChangeNotifier::CONNECTION_WIFI, "test"); - estimator.set_start_time_null_http_rtt( + estimator.SetStartTimeNullHttpRtt( base::TimeDelta::FromMilliseconds(test.http_rtt_msec)); estimator.set_recent_http_rtt( base::TimeDelta::FromMilliseconds(test.http_rtt_msec)); estimator.set_start_time_null_downlink_throughput_kbps(INT32_MAX); estimator.set_recent_downlink_throughput_kbps(INT32_MAX); - // Run one main frame request to force recomputation of effective connection - // type. - estimator.RunOneRequest(); EXPECT_EQ(test.expected_conn_type, estimator.GetEffectiveConnectionType()); } } @@ -1103,15 +1097,12 @@ }; for (const auto& test : tests) { - estimator.set_start_time_null_transport_rtt( - base::TimeDelta::FromMilliseconds(test.transport_rtt_msec)); estimator.set_recent_transport_rtt( base::TimeDelta::FromMilliseconds(test.transport_rtt_msec)); estimator.set_start_time_null_downlink_throughput_kbps(INT32_MAX); estimator.set_recent_downlink_throughput_kbps(INT32_MAX); - // Run one main frame request to force recomputation of effective connection - // type. - estimator.RunOneRequest(); + estimator.SetStartTimeNullTransportRtt( + base::TimeDelta::FromMilliseconds(test.transport_rtt_msec)); EXPECT_EQ(test.expected_conn_type, estimator.GetEffectiveConnectionType()); } } @@ -1164,7 +1155,7 @@ }; for (const auto& test : tests) { - estimator.set_start_time_null_http_rtt( + estimator.SetStartTimeNullHttpRtt( base::TimeDelta::FromMilliseconds(test.rtt_msec)); estimator.set_recent_http_rtt( base::TimeDelta::FromMilliseconds(test.rtt_msec)); @@ -1229,17 +1220,14 @@ }; for (const auto& test : tests) { - estimator.set_start_time_null_transport_rtt( - base::TimeDelta::FromMilliseconds(test.transport_rtt_msec)); estimator.set_recent_transport_rtt( base::TimeDelta::FromMilliseconds(test.transport_rtt_msec)); estimator.set_start_time_null_downlink_throughput_kbps( test.downlink_throughput_kbps); estimator.set_recent_downlink_throughput_kbps( test.downlink_throughput_kbps); - // Run one main frame request to force recomputation of effective connection - // type. - estimator.RunOneRequest(); + estimator.SetStartTimeNullTransportRtt( + base::TimeDelta::FromMilliseconds(test.transport_rtt_msec)); EXPECT_EQ(test.expected_conn_type, estimator.GetEffectiveConnectionType()); } } @@ -1689,8 +1677,7 @@ EXPECT_EQ(0U, observer.effective_connection_types().size()); - estimator.set_start_time_null_http_rtt( - base::TimeDelta::FromMilliseconds(1500)); + estimator.SetStartTimeNullHttpRtt(base::TimeDelta::FromMilliseconds(1500)); estimator.set_start_time_null_downlink_throughput_kbps(100000); tick_clock.Advance(base::TimeDelta::FromMinutes(60)); @@ -1733,18 +1720,16 @@ EXPECT_EQ(1U, observer.effective_connection_types().size()); // Change in connection type should send out notification to the observers. - estimator.set_start_time_null_http_rtt( - base::TimeDelta::FromMilliseconds(500)); + estimator.SetStartTimeNullHttpRtt(base::TimeDelta::FromMilliseconds(500)); estimator.SimulateNetworkChange(NetworkChangeNotifier::CONNECTION_WIFI, "test"); - EXPECT_EQ(2U, observer.effective_connection_types().size()); + EXPECT_EQ(3U, observer.effective_connection_types().size()); // A change in effective connection type does not trigger notification to the // observers, since it is not accompanied by any new observation or a network // change event. - estimator.set_start_time_null_http_rtt( - base::TimeDelta::FromMilliseconds(100)); - EXPECT_EQ(2U, observer.effective_connection_types().size()); + estimator.SetStartTimeNullHttpRtt(base::TimeDelta::FromMilliseconds(100)); + EXPECT_EQ(4U, observer.effective_connection_types().size()); TestEffectiveConnectionTypeObserver observer_2; estimator.AddEffectiveConnectionTypeObserver(&observer_2); @@ -1876,8 +1861,8 @@ tick_clock.Advance(base::TimeDelta::FromSeconds(1)); estimator.SetTickClockForTesting(&tick_clock); - estimator.set_start_time_null_http_rtt(test.http_rtt); - estimator.set_start_time_null_transport_rtt(test.transport_rtt); + estimator.SetStartTimeNullHttpRtt(test.http_rtt); + estimator.SetStartTimeNullTransportRtt(test.transport_rtt); // Minimum number of transport RTT samples that should be present before // transport RTT estimate can be used to clamp the HTTP RTT. @@ -1889,7 +1874,6 @@ test.http_rtt.InMilliseconds(), tick_clock.NowTicks(), INT32_MIN, NETWORK_QUALITY_OBSERVATION_SOURCE_HTTP)); - estimator.RunOneRequest(); EXPECT_EQ(test.expected_http_rtt, estimator.GetHttpRTT()); EXPECT_EQ(test.transport_rtt, estimator.GetTransportRTT()); EXPECT_EQ(test.expected_type, estimator.GetEffectiveConnectionType()) @@ -1925,8 +1909,8 @@ base::TimeDelta http_rtt(base::TimeDelta::FromMilliseconds(100)); base::TimeDelta transport_rtt(base::TimeDelta::FromMilliseconds(200)); int32_t downstream_throughput_kbps(300); - estimator.set_start_time_null_http_rtt(http_rtt); - estimator.set_start_time_null_transport_rtt(transport_rtt); + estimator.SetStartTimeNullHttpRtt(http_rtt); + estimator.SetStartTimeNullTransportRtt(transport_rtt); estimator.set_start_time_null_downlink_throughput_kbps( downstream_throughput_kbps); tick_clock.Advance(base::TimeDelta::FromMinutes(60)); @@ -1965,10 +1949,9 @@ // A change in effective connection type does not trigger notification to the // observers, since it is not accompanied by any new observation or a network // change event. - estimator.set_start_time_null_http_rtt( - base::TimeDelta::FromMilliseconds(10000)); - estimator.set_start_time_null_http_rtt(base::TimeDelta::FromMilliseconds(1)); - EXPECT_EQ(0, observer.notifications_received() - notifications_received); + estimator.SetStartTimeNullHttpRtt(base::TimeDelta::FromMilliseconds(10000)); + estimator.SetStartTimeNullHttpRtt(base::TimeDelta::FromMilliseconds(1)); + EXPECT_EQ(2, observer.notifications_received() - notifications_received); TestRTTAndThroughputEstimatesObserver observer_2; estimator.AddRTTAndThroughputEstimatesObserver(&observer_2); @@ -2496,10 +2479,10 @@ // RTT is higher than threshold. Network is slow. // Network was predicted to be slow and actually was slow. - estimator.set_start_time_null_http_rtt(test.rtt); + estimator.SetStartTimeNullHttpRtt(test.rtt); estimator.set_recent_http_rtt(test.recent_rtt); estimator.set_rtt_estimate_internal(test.recent_rtt); - estimator.set_start_time_null_transport_rtt(test.rtt); + estimator.SetStartTimeNullTransportRtt(test.rtt); estimator.set_recent_transport_rtt(test.recent_rtt); estimator.set_start_time_null_downlink_throughput_kbps( test.downstream_throughput_kbps); @@ -2836,26 +2819,17 @@ // Set the RTT and throughput values to the typical values for // |effective_connection_type|. The effective connection type should be // computed as |effective_connection_type|. - estimator.set_start_time_null_http_rtt( + estimator.SetStartTimeNullHttpRtt( estimator.params_ ->TypicalNetworkQuality(static_cast<EffectiveConnectionType>( effective_connection_type)) .http_rtt()); - estimator.set_start_time_null_transport_rtt( + estimator.set_start_time_null_downlink_throughput_kbps(INT32_MAX); + estimator.SetStartTimeNullTransportRtt( estimator.params_ ->TypicalNetworkQuality(static_cast<EffectiveConnectionType>( effective_connection_type)) .transport_rtt()); - estimator.set_start_time_null_downlink_throughput_kbps(INT32_MAX); - - // Force recomputation of effective connection type by starting a main - // frame request. - std::unique_ptr<URLRequest> request( - context.CreateRequest(estimator.GetEchoURL(), DEFAULT_PRIORITY, - &test_delegate, TRAFFIC_ANNOTATION_FOR_TESTS)); - request->SetLoadFlags(request->load_flags() | LOAD_MAIN_FRAME_DEPRECATED); - request->Start(); - base::RunLoop().Run(); EXPECT_EQ(effective_connection_type, static_cast<size_t>(estimator.GetEffectiveConnectionType())); @@ -3358,7 +3332,7 @@ ->hanging_request_upper_bound_min_http_rtt() .InMilliseconds(); - estimator.set_start_time_null_http_rtt(base::TimeDelta::FromMilliseconds(5)); + estimator.SetStartTimeNullHttpRtt(base::TimeDelta::FromMilliseconds(5)); base::RunLoop().RunUntilIdle(); estimator.SimulateNetworkChange( NetworkChangeNotifier::ConnectionType::CONNECTION_UNKNOWN, "test"); @@ -3417,7 +3391,7 @@ ->hanging_request_http_rtt_upper_bound_transport_rtt_multiplier(); estimator.DisableOfflineCheckForTesting(true); - estimator.set_start_time_null_http_rtt(base::TimeDelta::FromMilliseconds(5)); + estimator.SetStartTimeNullHttpRtt(base::TimeDelta::FromMilliseconds(5)); for (size_t i = 0; i < 100; ++i) { // Throw enough transport RTT samples so that transport RTT estimate is
diff --git a/net/quic/chromium/quic_http_stream.cc b/net/quic/chromium/quic_http_stream.cc index 826f4e96..9c503970 100644 --- a/net/quic/chromium/quic_http_stream.cc +++ b/net/quic/chromium/quic_http_stream.cc
@@ -50,6 +50,7 @@ next_state_(STATE_NONE), stream_(nullptr), request_info_(nullptr), + can_send_early_(false), request_body_stream_(nullptr), priority_(MINIMUM_PRIORITY), response_info_(nullptr), @@ -98,6 +99,7 @@ } int QuicHttpStream::InitializeStream(const HttpRequestInfo* request_info, + bool can_send_early, RequestPriority priority, const NetLogWithSource& stream_net_log, const CompletionCallback& callback) { @@ -122,6 +124,7 @@ stream_net_log_ = stream_net_log; request_info_ = request_info; + can_send_early_ = can_send_early; request_time_ = base::Time::Now(); priority_ = priority; @@ -518,7 +521,7 @@ next_state_ = STATE_REQUEST_STREAM_COMPLETE; return quic_session()->RequestStream( - request_info_->method == "POST", + !can_send_early_, base::Bind(&QuicHttpStream::OnIOComplete, weak_factory_.GetWeakPtr())); }
diff --git a/net/quic/chromium/quic_http_stream.h b/net/quic/chromium/quic_http_stream.h index 77945b8..55d7732 100644 --- a/net/quic/chromium/quic_http_stream.h +++ b/net/quic/chromium/quic_http_stream.h
@@ -44,6 +44,7 @@ // HttpStream implementation. int InitializeStream(const HttpRequestInfo* request_info, + bool can_send_early, RequestPriority priority, const NetLogWithSource& net_log, const CompletionCallback& callback) override; @@ -150,6 +151,9 @@ // Only valid before the response body is read. const HttpRequestInfo* request_info_; + // Whether this request can be sent without confirmation. + bool can_send_early_; + // The request body to send, if any, owned by the caller. UploadDataStream* request_body_stream_; // Time the request was issued.
diff --git a/net/quic/chromium/quic_http_stream_test.cc b/net/quic/chromium/quic_http_stream_test.cc index caee250..a1e3b7a 100644 --- a/net/quic/chromium/quic_http_stream_test.cc +++ b/net/quic/chromium/quic_http_stream_test.cc
@@ -632,7 +632,7 @@ request_.load_flags |= LOAD_DISABLE_CONNECTION_MIGRATION; Initialize(); EXPECT_EQ(OK, - stream_->InitializeStream(&request_, DEFAULT_PRIORITY, + stream_->InitializeStream(&request_, false, DEFAULT_PRIORITY, net_log_.bound(), callback_.callback())); QuicChromiumClientStream::Handle* client_stream = QuicHttpStreamPeer::GetQuicChromiumClientStream(stream_.get()); @@ -659,7 +659,7 @@ EXPECT_TRUE(stream_->GetLoadTimingInfo(&load_timing_info)); EXPECT_EQ(OK, - stream_->InitializeStream(&request_, DEFAULT_PRIORITY, + stream_->InitializeStream(&request_, true, DEFAULT_PRIORITY, net_log_.bound(), callback_.callback())); EXPECT_EQ(OK, stream_->SendRequest(headers_, &response_, callback_.callback())); @@ -725,7 +725,7 @@ request_.url = GURL("https://www.example.org/"); // Start first request. EXPECT_EQ(OK, - stream_->InitializeStream(&request_, DEFAULT_PRIORITY, + stream_->InitializeStream(&request_, true, DEFAULT_PRIORITY, net_log_.bound(), callback_.callback())); EXPECT_EQ(OK, stream_->SendRequest(headers_, &response_, callback_.callback())); @@ -735,7 +735,7 @@ session_->CreateHandle(HostPortPair("www.example.org", 443))); TestCompletionCallback callback2; EXPECT_EQ(OK, - stream2.InitializeStream(&request_, DEFAULT_PRIORITY, + stream2.InitializeStream(&request_, true, DEFAULT_PRIORITY, net_log_.bound(), callback2.callback())); EXPECT_EQ(OK, stream2.SendRequest(headers_, &response_, callback2.callback())); @@ -806,7 +806,7 @@ request_.url = GURL("https://www.example.org/"); EXPECT_EQ(OK, - stream_->InitializeStream(&request_, DEFAULT_PRIORITY, + stream_->InitializeStream(&request_, true, DEFAULT_PRIORITY, net_log_.bound(), callback_.callback())); EXPECT_EQ(OK, @@ -899,7 +899,7 @@ request_.url = GURL("https://www.example.org/"); EXPECT_EQ(OK, - stream_->InitializeStream(&request_, DEFAULT_PRIORITY, + stream_->InitializeStream(&request_, true, DEFAULT_PRIORITY, net_log_.bound(), callback_.callback())); EXPECT_EQ(OK, stream_->SendRequest(headers_, &response_, callback_.callback())); @@ -949,7 +949,7 @@ request_.url = GURL("https://www.example.org/"); EXPECT_EQ(OK, - stream_->InitializeStream(&request_, DEFAULT_PRIORITY, + stream_->InitializeStream(&request_, true, DEFAULT_PRIORITY, net_log_.bound(), callback_.callback())); session_->connection()->CloseConnection( @@ -971,7 +971,7 @@ request_.url = GURL("https://www.example.org/"); EXPECT_EQ(OK, - stream_->InitializeStream(&request_, DEFAULT_PRIORITY, + stream_->InitializeStream(&request_, true, DEFAULT_PRIORITY, net_log_.bound(), callback_.callback())); SSLInfo ssl_info; @@ -995,7 +995,7 @@ request_.url = GURL("https://www.example.org/"); EXPECT_EQ(OK, - stream_->InitializeStream(&request_, DEFAULT_PRIORITY, + stream_->InitializeStream(&request_, true, DEFAULT_PRIORITY, net_log_.bound(), callback_.callback())); AlternativeService alternative_service; @@ -1028,7 +1028,7 @@ request_.url = GURL("https://www.example.org/"); EXPECT_EQ(OK, - stream_->InitializeStream(&request_, DEFAULT_PRIORITY, + stream_->InitializeStream(&request_, true, DEFAULT_PRIORITY, net_log_.bound(), callback_.callback())); EXPECT_EQ(OK, stream_->SendRequest(headers_, &response_, callback_.callback())); @@ -1067,7 +1067,7 @@ request_.url = GURL("https://www.example.org/"); EXPECT_EQ(OK, - stream_->InitializeStream(&request_, DEFAULT_PRIORITY, + stream_->InitializeStream(&request_, true, DEFAULT_PRIORITY, net_log_.bound(), callback_.callback())); EXPECT_EQ(OK, stream_->SendRequest(headers_, &response_, callback_.callback())); @@ -1102,7 +1102,7 @@ request_.url = GURL("https://www.example.org/"); EXPECT_EQ(OK, - stream_->InitializeStream(&request_, DEFAULT_PRIORITY, + stream_->InitializeStream(&request_, true, DEFAULT_PRIORITY, net_log_.bound(), callback_.callback())); EXPECT_EQ(OK, @@ -1147,7 +1147,7 @@ IsOk()); EXPECT_EQ(OK, - stream_->InitializeStream(&request_, DEFAULT_PRIORITY, + stream_->InitializeStream(&request_, false, DEFAULT_PRIORITY, net_log_.bound(), callback_.callback())); EXPECT_EQ(OK, stream_->SendRequest(headers_, &response_, callback_.callback())); @@ -1218,7 +1218,7 @@ IsOk()); EXPECT_EQ(OK, - stream_->InitializeStream(&request_, DEFAULT_PRIORITY, + stream_->InitializeStream(&request_, false, DEFAULT_PRIORITY, net_log_.bound(), callback_.callback())); EXPECT_EQ(OK, stream_->SendRequest(headers_, &response_, callback_.callback())); @@ -1293,7 +1293,7 @@ TestCompletionCallback().callback(), NetLogWithSource())); ASSERT_EQ(OK, - stream_->InitializeStream(&request_, DEFAULT_PRIORITY, + stream_->InitializeStream(&request_, false, DEFAULT_PRIORITY, net_log_.bound(), callback_.callback())); ASSERT_EQ(ERR_IO_PENDING, stream_->SendRequest(headers_, &response_, callback_.callback())); @@ -1367,7 +1367,7 @@ TestCompletionCallback().callback(), NetLogWithSource())); ASSERT_EQ(OK, - stream_->InitializeStream(&request_, DEFAULT_PRIORITY, + stream_->InitializeStream(&request_, false, DEFAULT_PRIORITY, net_log_.bound(), callback_.callback())); ASSERT_EQ(ERR_IO_PENDING, stream_->SendRequest(headers_, &response_, callback_.callback())); @@ -1435,7 +1435,7 @@ TestCompletionCallback().callback(), NetLogWithSource())); ASSERT_EQ(OK, - stream_->InitializeStream(&request_, DEFAULT_PRIORITY, + stream_->InitializeStream(&request_, false, DEFAULT_PRIORITY, net_log_.bound(), callback_.callback())); ASSERT_EQ(ERR_IO_PENDING, stream_->SendRequest(headers_, &response_, callback_.callback())); @@ -1495,7 +1495,7 @@ request_.url = GURL("https://www.example.org/"); EXPECT_EQ(OK, - stream_->InitializeStream(&request_, DEFAULT_PRIORITY, + stream_->InitializeStream(&request_, true, DEFAULT_PRIORITY, net_log_.bound(), callback_.callback())); EXPECT_EQ(OK, stream_->SendRequest(headers_, &response_, callback_.callback())); @@ -1539,8 +1539,9 @@ request_.method = "GET"; request_.url = GURL("https://www.example.org/"); - EXPECT_EQ(OK, stream_->InitializeStream(&request_, MEDIUM, net_log_.bound(), - callback_.callback())); + EXPECT_EQ(OK, + stream_->InitializeStream(&request_, true, MEDIUM, net_log_.bound(), + callback_.callback())); // Check that priority is highest. QuicChromiumClientStream::Handle* reliable_stream = @@ -1606,7 +1607,7 @@ size_t chunk_size = strlen(kUploadData); chunked_upload_stream->AppendData(kUploadData, chunk_size, false); ASSERT_EQ(OK, - stream_->InitializeStream(&request_, DEFAULT_PRIORITY, + stream_->InitializeStream(&request_, false, DEFAULT_PRIORITY, net_log_.bound(), callback_.callback())); QuicHttpStream* stream = stream_.get(); DeleteStreamCallback delete_stream_callback(std::move(stream_)); @@ -1634,7 +1635,7 @@ TestCompletionCallback().callback(), NetLogWithSource())); ASSERT_EQ(OK, - stream_->InitializeStream(&request_, DEFAULT_PRIORITY, + stream_->InitializeStream(&request_, false, DEFAULT_PRIORITY, net_log_.bound(), callback_.callback())); ASSERT_EQ(ERR_QUIC_PROTOCOL_ERROR, stream_->SendRequest(headers_, &response_, callback_.callback())); @@ -1668,7 +1669,7 @@ TestCompletionCallback().callback(), NetLogWithSource())); ASSERT_EQ(OK, - stream_->InitializeStream(&request_, DEFAULT_PRIORITY, + stream_->InitializeStream(&request_, false, DEFAULT_PRIORITY, net_log_.bound(), callback_.callback())); ASSERT_EQ(ERR_QUIC_PROTOCOL_ERROR, stream_->SendRequest(headers_, &response_, callback_.callback())); @@ -1683,7 +1684,7 @@ request_.url = GURL("https://www.example.org/"); EXPECT_EQ(OK, - stream_->InitializeStream(&request_, DEFAULT_PRIORITY, + stream_->InitializeStream(&request_, true, DEFAULT_PRIORITY, net_log_.bound(), callback_.callback())); // TODO(ckrasic) - could do this via constructing a PUSH_PROMISE @@ -1695,9 +1696,9 @@ // Make the second stream that will exercise the first step of the // server push rendezvous mechanism. - EXPECT_EQ(OK, promised_stream_->InitializeStream(&request_, DEFAULT_PRIORITY, - net_log_.bound(), - callback_.callback())); + EXPECT_EQ(OK, promised_stream_->InitializeStream( + &request_, true, DEFAULT_PRIORITY, net_log_.bound(), + callback_.callback())); // Receive the promised response headers. response_headers_ = promised_response_.Clone(); @@ -1749,7 +1750,7 @@ request_.url = GURL("https://www.example.org/"); EXPECT_EQ(OK, - stream_->InitializeStream(&request_, DEFAULT_PRIORITY, + stream_->InitializeStream(&request_, true, DEFAULT_PRIORITY, net_log_.bound(), callback_.callback())); // TODO(ckrasic) - could do this via constructing a PUSH_PROMISE @@ -1761,9 +1762,9 @@ // Make the second stream that will exercise the first step of the // server push rendezvous mechanism. - EXPECT_EQ(OK, promised_stream_->InitializeStream(&request_, DEFAULT_PRIORITY, - net_log_.bound(), - callback_.callback())); + EXPECT_EQ(OK, promised_stream_->InitializeStream( + &request_, true, DEFAULT_PRIORITY, net_log_.bound(), + callback_.callback())); // Now sending a matching request will rendezvous with the promised // stream, but pending secondary validation. @@ -1823,7 +1824,7 @@ request_.url = GURL("https://www.example.org/"); EXPECT_EQ(OK, - stream_->InitializeStream(&request_, DEFAULT_PRIORITY, + stream_->InitializeStream(&request_, true, DEFAULT_PRIORITY, net_log_.bound(), callback_.callback())); // TODO(ckrasic) - could do this via constructing a PUSH_PROMISE @@ -1835,9 +1836,9 @@ // Make the second stream that will exercise the first step of the // server push rendezvous mechanism. - EXPECT_EQ(OK, promised_stream_->InitializeStream(&request_, DEFAULT_PRIORITY, - net_log_.bound(), - callback_.callback())); + EXPECT_EQ(OK, promised_stream_->InitializeStream( + &request_, true, DEFAULT_PRIORITY, net_log_.bound(), + callback_.callback())); // Now sending a matching request will rendezvous with the promised // stream, but pending secondary validation. @@ -1865,7 +1866,7 @@ request_.url = GURL("https://www.example.org/"); EXPECT_EQ(OK, - stream_->InitializeStream(&request_, DEFAULT_PRIORITY, + stream_->InitializeStream(&request_, true, DEFAULT_PRIORITY, net_log_.bound(), callback_.callback())); // TODO(ckrasic) - could do this via constructing a PUSH_PROMISE @@ -1881,9 +1882,9 @@ // Make the second stream that will exercise the first step of the // server push rendezvous mechanism. - EXPECT_EQ(OK, promised_stream_->InitializeStream(&request_, DEFAULT_PRIORITY, - net_log_.bound(), - callback_.callback())); + EXPECT_EQ(OK, promised_stream_->InitializeStream( + &request_, true, DEFAULT_PRIORITY, net_log_.bound(), + callback_.callback())); // Receive the promised response headers. response_headers_ = promised_response_.Clone(); @@ -1935,7 +1936,7 @@ request_.url = GURL("https://www.example.org/"); EXPECT_EQ(OK, - stream_->InitializeStream(&request_, DEFAULT_PRIORITY, + stream_->InitializeStream(&request_, true, DEFAULT_PRIORITY, net_log_.bound(), callback_.callback())); // TODO(ckrasic) - could do this via constructing a PUSH_PROMISE @@ -1958,7 +1959,7 @@ request_.url = GURL("https://www.example.org/"); EXPECT_EQ(OK, - stream_->InitializeStream(&request_, DEFAULT_PRIORITY, + stream_->InitializeStream(&request_, true, DEFAULT_PRIORITY, net_log_.bound(), callback_.callback())); push_promise_["accept-encoding"] = "gzip"; @@ -1972,9 +1973,9 @@ // Make the second stream that will exercise the first step of the // server push rendezvous mechanism. - EXPECT_EQ(OK, promised_stream_->InitializeStream(&request_, DEFAULT_PRIORITY, - net_log_.bound(), - callback_.callback())); + EXPECT_EQ(OK, promised_stream_->InitializeStream( + &request_, true, DEFAULT_PRIORITY, net_log_.bound(), + callback_.callback())); headers_.SetHeader("accept-encoding", "gzip"); @@ -2049,7 +2050,7 @@ request_.url = GURL("https://www.example.org/"); EXPECT_EQ(OK, - stream_->InitializeStream(&request_, DEFAULT_PRIORITY, + stream_->InitializeStream(&request_, true, DEFAULT_PRIORITY, net_log_.bound(), callback_.callback())); push_promise_["accept-encoding"] = "gzip"; @@ -2063,9 +2064,9 @@ // Make the second stream that will exercise the first step of the // server push rendezvous mechanism. - EXPECT_EQ(OK, promised_stream_->InitializeStream(&request_, DEFAULT_PRIORITY, - net_log_.bound(), - callback_.callback())); + EXPECT_EQ(OK, promised_stream_->InitializeStream( + &request_, true, DEFAULT_PRIORITY, net_log_.bound(), + callback_.callback())); headers_.SetHeader("accept-encoding", "sdch"); @@ -2164,7 +2165,7 @@ TestCompletionCallback().callback(), NetLogWithSource())); EXPECT_EQ(OK, - stream_->InitializeStream(&request_, DEFAULT_PRIORITY, + stream_->InitializeStream(&request_, false, DEFAULT_PRIORITY, net_log_.bound(), callback_.callback())); int result = stream_->SendRequest(headers_, &response_, callback_.callback()); @@ -2200,7 +2201,7 @@ TestCompletionCallback().callback(), NetLogWithSource())); EXPECT_EQ(OK, - stream_->InitializeStream(&request_, DEFAULT_PRIORITY, + stream_->InitializeStream(&request_, false, DEFAULT_PRIORITY, net_log_.bound(), callback_.callback())); int result = stream_->SendRequest(headers_, &response_, callback_.callback());
diff --git a/net/quic/chromium/quic_stream_factory_fuzzer.cc b/net/quic/chromium/quic_stream_factory_fuzzer.cc index 87596614..55ea51e2 100644 --- a/net/quic/chromium/quic_stream_factory_fuzzer.cc +++ b/net/quic/chromium/quic_stream_factory_fuzzer.cc
@@ -159,7 +159,7 @@ HttpRequestInfo request_info; request_info.method = kMethod; request_info.url = GURL(kUrl); - stream->InitializeStream(&request_info, DEFAULT_PRIORITY, env->net_log, + stream->InitializeStream(&request_info, true, DEFAULT_PRIORITY, env->net_log, CompletionCallback()); HttpResponseInfo response;
diff --git a/net/quic/chromium/quic_stream_factory_test.cc b/net/quic/chromium/quic_stream_factory_test.cc index 5fe659a..5cec9cc 100644 --- a/net/quic/chromium/quic_stream_factory_test.cc +++ b/net/quic/chromium/quic_stream_factory_test.cc
@@ -517,8 +517,9 @@ HttpRequestInfo request_info; request_info.method = "GET"; request_info.url = GURL("https://www.example.org/"); - EXPECT_EQ(OK, stream->InitializeStream(&request_info, DEFAULT_PRIORITY, - net_log_, CompletionCallback())); + EXPECT_EQ(OK, + stream->InitializeStream(&request_info, true, DEFAULT_PRIORITY, + net_log_, CompletionCallback())); // Ensure that session is alive and active. QuicChromiumClientSession* session = GetActiveSession(host_port_pair_); EXPECT_TRUE(QuicStreamFactoryPeer::IsLiveSession(factory_.get(), session)); @@ -1591,8 +1592,9 @@ } std::unique_ptr<HttpStream> stream = CreateStream(&request); EXPECT_TRUE(stream); - EXPECT_EQ(OK, stream->InitializeStream(&request_info, DEFAULT_PRIORITY, - net_log_, CompletionCallback())); + EXPECT_EQ(OK, + stream->InitializeStream(&request_info, false, DEFAULT_PRIORITY, + net_log_, CompletionCallback())); streams.push_back(std::move(stream)); } @@ -1604,8 +1606,8 @@ std::unique_ptr<HttpStream> stream = CreateStream(&request); EXPECT_TRUE(stream); EXPECT_EQ(ERR_IO_PENDING, - stream->InitializeStream(&request_info, DEFAULT_PRIORITY, net_log_, - callback_.callback())); + stream->InitializeStream(&request_info, false, DEFAULT_PRIORITY, + net_log_, callback_.callback())); // Close the first stream. streams.front()->Close(false); @@ -1722,7 +1724,7 @@ EXPECT_THAT(callback_.WaitForResult(), IsOk()); std::unique_ptr<HttpStream> stream = CreateStream(&request); HttpRequestInfo request_info; - EXPECT_EQ(OK, stream->InitializeStream(&request_info, DEFAULT_PRIORITY, + EXPECT_EQ(OK, stream->InitializeStream(&request_info, false, DEFAULT_PRIORITY, net_log_, CompletionCallback())); // Close the session and verify that stream saw the error. @@ -1906,7 +1908,7 @@ EXPECT_THAT(callback_.WaitForResult(), IsOk()); std::unique_ptr<HttpStream> stream = CreateStream(&request); HttpRequestInfo request_info; - EXPECT_EQ(OK, stream->InitializeStream(&request_info, DEFAULT_PRIORITY, + EXPECT_EQ(OK, stream->InitializeStream(&request_info, false, DEFAULT_PRIORITY, net_log_, CompletionCallback())); IPAddress last_address; @@ -1961,7 +1963,7 @@ EXPECT_THAT(callback_.WaitForResult(), IsOk()); std::unique_ptr<HttpStream> stream = CreateStream(&request); HttpRequestInfo request_info; - EXPECT_EQ(OK, stream->InitializeStream(&request_info, DEFAULT_PRIORITY, + EXPECT_EQ(OK, stream->InitializeStream(&request_info, false, DEFAULT_PRIORITY, net_log_, CompletionCallback())); IPAddress last_address; @@ -2030,7 +2032,7 @@ HttpRequestInfo request_info; request_info.method = "GET"; request_info.url = url_; - EXPECT_EQ(OK, stream->InitializeStream(&request_info, DEFAULT_PRIORITY, + EXPECT_EQ(OK, stream->InitializeStream(&request_info, true, DEFAULT_PRIORITY, net_log_, CompletionCallback())); // Ensure that session is alive and active. @@ -2162,7 +2164,7 @@ HttpRequestInfo request_info; request_info.method = "GET"; request_info.url = url_; - EXPECT_EQ(OK, stream->InitializeStream(&request_info, DEFAULT_PRIORITY, + EXPECT_EQ(OK, stream->InitializeStream(&request_info, true, DEFAULT_PRIORITY, net_log_, CompletionCallback())); // Ensure that session is alive and active. @@ -2272,7 +2274,7 @@ // Cause QUIC stream to be created. HttpRequestInfo request_info; - EXPECT_EQ(OK, stream->InitializeStream(&request_info, DEFAULT_PRIORITY, + EXPECT_EQ(OK, stream->InitializeStream(&request_info, false, DEFAULT_PRIORITY, net_log_, CompletionCallback())); // Ensure that session is alive and active. @@ -2332,7 +2334,7 @@ // Cause QUIC stream to be created, but marked as non-migratable. HttpRequestInfo request_info; request_info.load_flags |= LOAD_DISABLE_CONNECTION_MIGRATION; - EXPECT_EQ(OK, stream->InitializeStream(&request_info, DEFAULT_PRIORITY, + EXPECT_EQ(OK, stream->InitializeStream(&request_info, false, DEFAULT_PRIORITY, net_log_, CompletionCallback())); // Ensure that session is alive and active. @@ -2382,7 +2384,7 @@ // Cause QUIC stream to be created, but marked as non-migratable. HttpRequestInfo request_info; request_info.load_flags |= LOAD_DISABLE_CONNECTION_MIGRATION; - EXPECT_EQ(OK, stream->InitializeStream(&request_info, DEFAULT_PRIORITY, + EXPECT_EQ(OK, stream->InitializeStream(&request_info, false, DEFAULT_PRIORITY, net_log_, CompletionCallback())); // Ensure that session is alive and active. @@ -2431,7 +2433,7 @@ // Cause QUIC stream to be created. HttpRequestInfo request_info; - EXPECT_EQ(OK, stream->InitializeStream(&request_info, DEFAULT_PRIORITY, + EXPECT_EQ(OK, stream->InitializeStream(&request_info, false, DEFAULT_PRIORITY, net_log_, CompletionCallback())); // Ensure that session is alive and active. @@ -2485,7 +2487,7 @@ // Cause QUIC stream to be created. HttpRequestInfo request_info; - EXPECT_EQ(OK, stream->InitializeStream(&request_info, DEFAULT_PRIORITY, + EXPECT_EQ(OK, stream->InitializeStream(&request_info, false, DEFAULT_PRIORITY, net_log_, CompletionCallback())); // Ensure that session is alive and active. @@ -2539,7 +2541,7 @@ // Cause QUIC stream to be created, but marked as non-migratable. HttpRequestInfo request_info; request_info.load_flags |= LOAD_DISABLE_CONNECTION_MIGRATION; - EXPECT_EQ(OK, stream->InitializeStream(&request_info, DEFAULT_PRIORITY, + EXPECT_EQ(OK, stream->InitializeStream(&request_info, false, DEFAULT_PRIORITY, net_log_, CompletionCallback())); // Ensure that session is alive and active. @@ -2587,7 +2589,7 @@ // Cause QUIC stream to be created, but marked as non-migratable. HttpRequestInfo request_info; request_info.load_flags |= LOAD_DISABLE_CONNECTION_MIGRATION; - EXPECT_EQ(OK, stream->InitializeStream(&request_info, DEFAULT_PRIORITY, + EXPECT_EQ(OK, stream->InitializeStream(&request_info, false, DEFAULT_PRIORITY, net_log_, CompletionCallback())); // Ensure that session is alive and active. @@ -2635,7 +2637,7 @@ // Cause QUIC stream to be created. HttpRequestInfo request_info; - EXPECT_EQ(OK, stream->InitializeStream(&request_info, DEFAULT_PRIORITY, + EXPECT_EQ(OK, stream->InitializeStream(&request_info, false, DEFAULT_PRIORITY, net_log_, CompletionCallback())); // Ensure that session is alive and active. @@ -2687,7 +2689,7 @@ // Cause QUIC stream to be created. HttpRequestInfo request_info; - EXPECT_EQ(OK, stream->InitializeStream(&request_info, DEFAULT_PRIORITY, + EXPECT_EQ(OK, stream->InitializeStream(&request_info, false, DEFAULT_PRIORITY, net_log_, CompletionCallback())); // Ensure that session is alive and active. @@ -2904,7 +2906,7 @@ HttpRequestInfo request_info; request_info.method = "GET"; request_info.url = url_; - EXPECT_EQ(OK, stream->InitializeStream(&request_info, DEFAULT_PRIORITY, + EXPECT_EQ(OK, stream->InitializeStream(&request_info, true, DEFAULT_PRIORITY, net_log_, CompletionCallback())); // Ensure that session is alive and active. @@ -3011,7 +3013,7 @@ HttpRequestInfo request_info; request_info.method = "GET"; request_info.url = url_; - EXPECT_EQ(OK, stream->InitializeStream(&request_info, DEFAULT_PRIORITY, + EXPECT_EQ(OK, stream->InitializeStream(&request_info, true, DEFAULT_PRIORITY, net_log_, CompletionCallback())); // Ensure that session is alive and active. @@ -3150,8 +3152,9 @@ HttpRequestInfo request_info1; request_info1.method = "GET"; request_info1.url = url_; - EXPECT_EQ(OK, stream1->InitializeStream(&request_info1, DEFAULT_PRIORITY, - net_log_, CompletionCallback())); + EXPECT_EQ(OK, + stream1->InitializeStream(&request_info1, true, DEFAULT_PRIORITY, + net_log_, CompletionCallback())); HttpResponseInfo response1; HttpRequestHeaders request_headers1; EXPECT_EQ(OK, stream1->SendRequest(request_headers1, &response1, @@ -3162,8 +3165,9 @@ HttpRequestInfo request_info2; request_info2.method = "GET"; request_info2.url = url_; - EXPECT_EQ(OK, stream2->InitializeStream(&request_info2, DEFAULT_PRIORITY, - net_log_, CompletionCallback())); + EXPECT_EQ(OK, + stream2->InitializeStream(&request_info2, true, DEFAULT_PRIORITY, + net_log_, CompletionCallback())); HttpResponseInfo response2; HttpRequestHeaders request_headers2; EXPECT_EQ(OK, stream2->SendRequest(request_headers2, &response2, @@ -3232,7 +3236,7 @@ HttpRequestInfo request_info; request_info.method = "GET"; request_info.url = url_; - EXPECT_EQ(OK, stream->InitializeStream(&request_info, DEFAULT_PRIORITY, + EXPECT_EQ(OK, stream->InitializeStream(&request_info, true, DEFAULT_PRIORITY, net_log_, CompletionCallback())); // Ensure that session is alive and active. @@ -3359,7 +3363,7 @@ HttpRequestInfo request_info; request_info.method = "GET"; request_info.url = url_; - EXPECT_EQ(OK, stream->InitializeStream(&request_info, DEFAULT_PRIORITY, + EXPECT_EQ(OK, stream->InitializeStream(&request_info, true, DEFAULT_PRIORITY, net_log_, CompletionCallback())); // Ensure that session is alive and active. @@ -3478,7 +3482,7 @@ // Cause QUIC stream to be created. HttpRequestInfo request_info; - EXPECT_EQ(OK, stream->InitializeStream(&request_info, DEFAULT_PRIORITY, + EXPECT_EQ(OK, stream->InitializeStream(&request_info, false, DEFAULT_PRIORITY, net_log_, CompletionCallback())); // Ensure that session is alive and active. @@ -3532,7 +3536,7 @@ // Cause QUIC stream to be created, but marked as non-migratable. HttpRequestInfo request_info; request_info.load_flags |= LOAD_DISABLE_CONNECTION_MIGRATION; - EXPECT_EQ(OK, stream->InitializeStream(&request_info, DEFAULT_PRIORITY, + EXPECT_EQ(OK, stream->InitializeStream(&request_info, false, DEFAULT_PRIORITY, net_log_, CompletionCallback())); // Ensure that session is alive and active. @@ -3584,7 +3588,7 @@ // Cause QUIC stream to be created. HttpRequestInfo request_info; - EXPECT_EQ(OK, stream->InitializeStream(&request_info, DEFAULT_PRIORITY, + EXPECT_EQ(OK, stream->InitializeStream(&request_info, false, DEFAULT_PRIORITY, net_log_, CompletionCallback())); // Ensure that session is alive and active. @@ -3645,7 +3649,7 @@ HttpRequestInfo request_info; request_info.method = "GET"; request_info.url = GURL("https://www.example.org/"); - EXPECT_EQ(OK, stream->InitializeStream(&request_info, DEFAULT_PRIORITY, + EXPECT_EQ(OK, stream->InitializeStream(&request_info, true, DEFAULT_PRIORITY, net_log_, CompletionCallback())); // Ensure that session is alive and active. @@ -3735,7 +3739,7 @@ HttpRequestInfo request_info; request_info.method = "GET"; request_info.url = GURL("https://www.example.org/"); - EXPECT_EQ(OK, stream->InitializeStream(&request_info, DEFAULT_PRIORITY, + EXPECT_EQ(OK, stream->InitializeStream(&request_info, true, DEFAULT_PRIORITY, net_log_, CompletionCallback())); // Ensure that session is alive and active. @@ -3826,7 +3830,7 @@ request_info.load_flags |= LOAD_DISABLE_CONNECTION_MIGRATION; request_info.method = "GET"; request_info.url = GURL("https://www.example.org/"); - EXPECT_EQ(OK, stream->InitializeStream(&request_info, DEFAULT_PRIORITY, + EXPECT_EQ(OK, stream->InitializeStream(&request_info, true, DEFAULT_PRIORITY, net_log_, CompletionCallback())); // Ensure that session is alive and active. @@ -3890,7 +3894,7 @@ HttpRequestInfo request_info; request_info.method = "GET"; request_info.url = GURL("https://www.example.org/"); - EXPECT_EQ(OK, stream->InitializeStream(&request_info, DEFAULT_PRIORITY, + EXPECT_EQ(OK, stream->InitializeStream(&request_info, true, DEFAULT_PRIORITY, net_log_, CompletionCallback())); // Ensure that session is alive and active. @@ -3970,7 +3974,7 @@ HttpRequestInfo request_info; request_info.method = "GET"; request_info.url = GURL("https://www.example.org/"); - EXPECT_EQ(OK, stream->InitializeStream(&request_info, DEFAULT_PRIORITY, + EXPECT_EQ(OK, stream->InitializeStream(&request_info, true, DEFAULT_PRIORITY, net_log_, CompletionCallback())); // Ensure that session is alive and active. @@ -4051,7 +4055,7 @@ HttpRequestInfo request_info; request_info.method = "GET"; request_info.url = GURL("https://www.example.org/"); - EXPECT_EQ(OK, stream->InitializeStream(&request_info, DEFAULT_PRIORITY, + EXPECT_EQ(OK, stream->InitializeStream(&request_info, true, DEFAULT_PRIORITY, net_log_, CompletionCallback())); // Ensure that session is alive and active. @@ -4150,7 +4154,7 @@ HttpRequestInfo request_info; request_info.method = "GET"; request_info.url = GURL("https://www.example.org/"); - EXPECT_EQ(OK, stream->InitializeStream(&request_info, DEFAULT_PRIORITY, + EXPECT_EQ(OK, stream->InitializeStream(&request_info, true, DEFAULT_PRIORITY, net_log_, CompletionCallback())); // Ensure that session is alive and active. @@ -4250,7 +4254,7 @@ HttpRequestInfo request_info; request_info.method = "GET"; request_info.url = GURL("https://www.example.org/"); - EXPECT_EQ(OK, stream->InitializeStream(&request_info, DEFAULT_PRIORITY, + EXPECT_EQ(OK, stream->InitializeStream(&request_info, true, DEFAULT_PRIORITY, net_log_, CompletionCallback())); // Ensure that session is alive and active. @@ -4385,7 +4389,7 @@ HttpRequestInfo request_info; request_info.method = "GET"; request_info.url = GURL("https://www.example.org/"); - EXPECT_EQ(OK, stream->InitializeStream(&request_info, DEFAULT_PRIORITY, + EXPECT_EQ(OK, stream->InitializeStream(&request_info, true, DEFAULT_PRIORITY, net_log_, CompletionCallback())); // Ensure that session is alive and active. @@ -4541,7 +4545,7 @@ HttpRequestInfo request_info; request_info.method = "GET"; request_info.url = url_; - EXPECT_EQ(OK, stream->InitializeStream(&request_info, DEFAULT_PRIORITY, + EXPECT_EQ(OK, stream->InitializeStream(&request_info, true, DEFAULT_PRIORITY, net_log_, CompletionCallback())); // Ensure that session is alive and active. @@ -4605,7 +4609,7 @@ HttpRequestInfo request_info; request_info.method = "GET"; request_info.url = GURL("https://www.example.org/"); - EXPECT_EQ(OK, stream->InitializeStream(&request_info, DEFAULT_PRIORITY, + EXPECT_EQ(OK, stream->InitializeStream(&request_info, true, DEFAULT_PRIORITY, net_log_, CompletionCallback())); // Ensure that session is alive and active. @@ -4749,7 +4753,7 @@ HttpRequestInfo request_info; request_info.method = "GET"; request_info.url = GURL("https://www.example.org/"); - EXPECT_EQ(OK, stream->InitializeStream(&request_info, DEFAULT_PRIORITY, + EXPECT_EQ(OK, stream->InitializeStream(&request_info, true, DEFAULT_PRIORITY, net_log_, CompletionCallback())); // Ensure that session is alive and active. @@ -4800,7 +4804,7 @@ EXPECT_THAT(callback_.WaitForResult(), IsOk()); std::unique_ptr<HttpStream> stream = CreateStream(&request); HttpRequestInfo request_info; - EXPECT_EQ(OK, stream->InitializeStream(&request_info, DEFAULT_PRIORITY, + EXPECT_EQ(OK, stream->InitializeStream(&request_info, false, DEFAULT_PRIORITY, net_log_, CompletionCallback())); ssl_config_service_->NotifySSLConfigChange(); @@ -4855,7 +4859,7 @@ EXPECT_THAT(callback_.WaitForResult(), IsOk()); std::unique_ptr<HttpStream> stream = CreateStream(&request); HttpRequestInfo request_info; - EXPECT_EQ(OK, stream->InitializeStream(&request_info, DEFAULT_PRIORITY, + EXPECT_EQ(OK, stream->InitializeStream(&request_info, false, DEFAULT_PRIORITY, net_log_, CompletionCallback())); // Change the CA cert and verify that stream saw the event. @@ -5035,7 +5039,7 @@ std::unique_ptr<HttpStream> stream = CreateStream(&request); EXPECT_TRUE(stream.get()); HttpRequestInfo request_info; - EXPECT_EQ(OK, stream->InitializeStream(&request_info, DEFAULT_PRIORITY, + EXPECT_EQ(OK, stream->InitializeStream(&request_info, false, DEFAULT_PRIORITY, net_log_, CompletionCallback())); DVLOG(1) @@ -5066,8 +5070,9 @@ std::unique_ptr<HttpStream> stream2 = CreateStream(&request2); EXPECT_TRUE(stream2.get()); - EXPECT_EQ(OK, stream2->InitializeStream(&request_info, DEFAULT_PRIORITY, - net_log_, CompletionCallback())); + EXPECT_EQ(OK, + stream2->InitializeStream(&request_info, false, DEFAULT_PRIORITY, + net_log_, CompletionCallback())); session2->connection()->CloseConnection( QUIC_NETWORK_IDLE_TIMEOUT, "test", ConnectionCloseBehavior::SILENT_CLOSE); // Need to spin the loop now to ensure that
diff --git a/net/spdy/chromium/spdy_http_stream.cc b/net/spdy/chromium/spdy_http_stream.cc index 64fec70..c8207af 100644 --- a/net/spdy/chromium/spdy_http_stream.cc +++ b/net/spdy/chromium/spdy_http_stream.cc
@@ -70,6 +70,7 @@ } int SpdyHttpStream::InitializeStream(const HttpRequestInfo* request_info, + bool can_send_early, RequestPriority priority, const NetLogWithSource& stream_net_log, const CompletionCallback& callback) {
diff --git a/net/spdy/chromium/spdy_http_stream.h b/net/spdy/chromium/spdy_http_stream.h index 7dac145..4eb48c5 100644 --- a/net/spdy/chromium/spdy_http_stream.h +++ b/net/spdy/chromium/spdy_http_stream.h
@@ -49,6 +49,7 @@ // HttpStream implementation. int InitializeStream(const HttpRequestInfo* request_info, + bool can_send_early, RequestPriority priority, const NetLogWithSource& net_log, const CompletionCallback& callback) override;
diff --git a/net/spdy/chromium/spdy_http_stream_unittest.cc b/net/spdy/chromium/spdy_http_stream_unittest.cc index 1f0fde7..83f92b95 100644 --- a/net/spdy/chromium/spdy_http_stream_unittest.cc +++ b/net/spdy/chromium/spdy_http_stream_unittest.cc
@@ -203,8 +203,8 @@ LoadTimingInfo load_timing_info; EXPECT_FALSE(http_stream->GetLoadTimingInfo(&load_timing_info)); - ASSERT_THAT(http_stream->InitializeStream(&request, DEFAULT_PRIORITY, net_log, - CompletionCallback()), + ASSERT_THAT(http_stream->InitializeStream(&request, true, DEFAULT_PRIORITY, + net_log, CompletionCallback()), IsOk()); EXPECT_FALSE(http_stream->GetLoadTimingInfo(&load_timing_info)); @@ -257,9 +257,10 @@ auto http_stream = std::make_unique<SpdyHttpStream>( session_, kNoPushedStreamFound, true, net_log.source()); - ASSERT_THAT(http_stream->InitializeStream(request.get(), DEFAULT_PRIORITY, - net_log, CompletionCallback()), - IsOk()); + ASSERT_THAT( + http_stream->InitializeStream(request.get(), true, DEFAULT_PRIORITY, + net_log, CompletionCallback()), + IsOk()); EXPECT_THAT(http_stream->SendRequest(headers, &response, callback.callback()), IsError(ERR_IO_PENDING)); EXPECT_TRUE(HasSpdySession(http_session_->spdy_session_pool(), key_)); @@ -329,7 +330,7 @@ session_, kNoPushedStreamFound, true, net_log.source()); // First write. - ASSERT_THAT(http_stream1->InitializeStream(&request1, DEFAULT_PRIORITY, + ASSERT_THAT(http_stream1->InitializeStream(&request1, true, DEFAULT_PRIORITY, net_log, CompletionCallback()), IsOk()); EXPECT_THAT( @@ -346,7 +347,7 @@ EXPECT_FALSE(http_stream2->GetLoadTimingInfo(&load_timing_info2)); // Second write. - ASSERT_THAT(http_stream2->InitializeStream(&request2, DEFAULT_PRIORITY, + ASSERT_THAT(http_stream2->InitializeStream(&request2, true, DEFAULT_PRIORITY, net_log, CompletionCallback()), IsOk()); EXPECT_THAT( @@ -425,8 +426,8 @@ NetLogWithSource net_log; SpdyHttpStream http_stream(session_, kNoPushedStreamFound, true, net_log.source()); - ASSERT_THAT(http_stream.InitializeStream(&request, DEFAULT_PRIORITY, net_log, - CompletionCallback()), + ASSERT_THAT(http_stream.InitializeStream(&request, false, DEFAULT_PRIORITY, + net_log, CompletionCallback()), IsOk()); EXPECT_THAT(http_stream.SendRequest(headers, &response, callback.callback()), @@ -481,8 +482,8 @@ NetLogWithSource net_log; SpdyHttpStream http_stream(session_, kNoPushedStreamFound, true, net_log.source()); - ASSERT_THAT(http_stream.InitializeStream(&request, DEFAULT_PRIORITY, net_log, - CompletionCallback()), + ASSERT_THAT(http_stream.InitializeStream(&request, false, DEFAULT_PRIORITY, + net_log, CompletionCallback()), IsOk()); EXPECT_THAT(http_stream.SendRequest(headers, &response, callback.callback()), IsError(ERR_IO_PENDING)); @@ -536,8 +537,8 @@ NetLogWithSource net_log; SpdyHttpStream http_stream(session_, kNoPushedStreamFound, true, net_log.source()); - ASSERT_THAT(http_stream.InitializeStream(&request, DEFAULT_PRIORITY, net_log, - CompletionCallback()), + ASSERT_THAT(http_stream.InitializeStream(&request, false, DEFAULT_PRIORITY, + net_log, CompletionCallback()), IsOk()); EXPECT_THAT(http_stream.SendRequest(headers, &response, callback.callback()), @@ -605,8 +606,8 @@ NetLogWithSource net_log; auto http_stream = std::make_unique<SpdyHttpStream>( session_, kNoPushedStreamFound, true, net_log.source()); - ASSERT_THAT(http_stream->InitializeStream(&request, DEFAULT_PRIORITY, net_log, - CompletionCallback()), + ASSERT_THAT(http_stream->InitializeStream(&request, false, DEFAULT_PRIORITY, + net_log, CompletionCallback()), IsOk()); TestCompletionCallback callback; @@ -700,8 +701,8 @@ NetLogWithSource net_log; auto http_stream = std::make_unique<SpdyHttpStream>( session_, kNoPushedStreamFound, true, net_log.source()); - ASSERT_THAT(http_stream->InitializeStream(&request, DEFAULT_PRIORITY, net_log, - CompletionCallback()), + ASSERT_THAT(http_stream->InitializeStream(&request, false, DEFAULT_PRIORITY, + net_log, CompletionCallback()), IsOk()); TestCompletionCallback callback; @@ -784,8 +785,8 @@ NetLogWithSource net_log; auto http_stream = std::make_unique<SpdyHttpStream>( session_, kNoPushedStreamFound, true, net_log.source()); - ASSERT_THAT(http_stream->InitializeStream(&request, DEFAULT_PRIORITY, net_log, - CompletionCallback()), + ASSERT_THAT(http_stream->InitializeStream(&request, false, DEFAULT_PRIORITY, + net_log, CompletionCallback()), IsOk()); TestCompletionCallback callback; @@ -844,8 +845,8 @@ NetLogWithSource net_log; auto http_stream = std::make_unique<SpdyHttpStream>( session_, kNoPushedStreamFound, true, net_log.source()); - ASSERT_THAT(http_stream->InitializeStream(&request, DEFAULT_PRIORITY, net_log, - CompletionCallback()), + ASSERT_THAT(http_stream->InitializeStream(&request, true, DEFAULT_PRIORITY, + net_log, CompletionCallback()), IsOk()); EXPECT_THAT(http_stream->SendRequest(headers, &response, callback.callback()), @@ -897,8 +898,8 @@ NetLogWithSource net_log; auto http_stream = std::make_unique<SpdyHttpStream>( session_, kNoPushedStreamFound, true, net_log.source()); - ASSERT_THAT(http_stream->InitializeStream(&request, DEFAULT_PRIORITY, net_log, - CompletionCallback()), + ASSERT_THAT(http_stream->InitializeStream(&request, false, DEFAULT_PRIORITY, + net_log, CompletionCallback()), IsOk()); HttpRequestHeaders headers; @@ -1002,8 +1003,8 @@ NetLogWithSource net_log; SpdyHttpStream http_stream(session_, kNoPushedStreamFound, true, net_log.source()); - ASSERT_THAT(http_stream.InitializeStream(&request, DEFAULT_PRIORITY, net_log, - CompletionCallback()), + ASSERT_THAT(http_stream.InitializeStream(&request, false, DEFAULT_PRIORITY, + net_log, CompletionCallback()), IsOk()); int result = http_stream.SendRequest(headers, &response, callback.callback()); @@ -1056,8 +1057,8 @@ NetLogWithSource net_log; SpdyHttpStream http_stream(session_, kNoPushedStreamFound, true, net_log.source()); - ASSERT_THAT(http_stream.InitializeStream(&request, DEFAULT_PRIORITY, net_log, - CompletionCallback()), + ASSERT_THAT(http_stream.InitializeStream(&request, false, DEFAULT_PRIORITY, + net_log, CompletionCallback()), IsOk()); int result = http_stream.SendRequest(headers, &response, callback.callback()); @@ -1099,8 +1100,8 @@ NetLogWithSource net_log; SpdyHttpStream http_stream(session_, kNoPushedStreamFound, true, net_log.source()); - ASSERT_THAT(http_stream.InitializeStream(&request, DEFAULT_PRIORITY, net_log, - CompletionCallback()), + ASSERT_THAT(http_stream.InitializeStream(&request, false, DEFAULT_PRIORITY, + net_log, CompletionCallback()), IsOk()); CancelStreamCallback callback(&http_stream);
diff --git a/net/test/python_utils.cc b/net/test/python_utils.cc index 5742962..e439813 100644 --- a/net/test/python_utils.cc +++ b/net/test/python_utils.cc
@@ -23,11 +23,16 @@ #endif const char kPythonPathEnv[] = "PYTHONPATH"; -const char kPythonVirtualEnv[] = "VIRTUAL_ENV"; +const char kVPythonClearPathEnv[] = "VPYTHON_CLEAR_PYTHONPATH"; void ClearPythonPath() { std::unique_ptr<base::Environment> env(base::Environment::Create()); env->UnSetVar(kPythonPathEnv); + + // vpython has instructions on BuildBot (not swarming or LUCI) to clear + // PYTHONPATH on invocation. Since we are clearing and manipulating it + // ourselves, we don't want vpython to throw out our hard work. + env->UnSetVar(kVPythonClearPathEnv); } void AppendToPythonPath(const base::FilePath& dir) { @@ -83,53 +88,19 @@ return false; } -#if defined(OS_WIN) -struct PythonExePath { - PythonExePath() { - // This is test-only code, so CHECK with a subprocess invocation is ok. - base::CommandLine command(base::FilePath(FILE_PATH_LITERAL("cmd"))); - command.AppendArg("/c"); - command.AppendArg("python"); - command.AppendArg("-c"); - command.AppendArg("import sys; print sys.executable"); - std::string output; - CHECK(GetAppOutput(command, &output)); - // This does only work if cmd.exe doesn't use a non-US codepage. - path_ = base::ASCIIToUTF16(output); - TrimWhitespace(path_, base::TRIM_ALL, &path_); - } - base::string16 path_; -}; -static base::LazyInstance<PythonExePath>::Leaky g_python_path; -#endif - -bool IsInPythonVirtualEnv() { - return base::Environment::Create()->HasVar(kPythonVirtualEnv); -} - bool GetPythonCommand(base::CommandLine* python_cmd) { DCHECK(python_cmd); +// Use vpython to pick up src.git's vpython VirtualEnv spec. #if defined(OS_WIN) - // Most developers have depot_tools in their path, which only has a - // python.bat, not a python.exe. Go through cmd to find the path to - // the python executable. - // (Don't just return a a "cmd /c python" command line, because then tests - // that try to kill the python process will kill the cmd process instead, - // which can cause flakiness.) - python_cmd->SetProgram(base::FilePath(g_python_path.Get().path_)); + python_cmd->SetProgram(base::FilePath(FILE_PATH_LITERAL("vpython.bat"))); #else - python_cmd->SetProgram(base::FilePath(FILE_PATH_LITERAL("python"))); + python_cmd->SetProgram(base::FilePath(FILE_PATH_LITERAL("vpython"))); #endif // Launch python in unbuffered mode, so that python output doesn't mix with // gtest output in buildbot log files. See http://crbug.com/147368. python_cmd->AppendArg("-u"); - if (!IsInPythonVirtualEnv()) { - // Prevent using system-installed libraries. Use hermetic versioned copies. - python_cmd->AppendArg("-S"); - } - return true; }
diff --git a/net/test/spawned_test_server/local_test_server.cc b/net/test/spawned_test_server/local_test_server.cc index eec6235..8528663 100644 --- a/net/test/spawned_test_server/local_test_server.cc +++ b/net/test/spawned_test_server/local_test_server.cc
@@ -167,15 +167,8 @@ } third_party_dir = third_party_dir.AppendASCII("third_party"); - // For simplejson. (simplejson, unlike all the other Python modules - // we include, doesn't have an extra 'simplejson' directory, so we - // need to include its parent directory, i.e. third_party_dir). - AppendToPythonPath(third_party_dir); - AppendToPythonPath(third_party_dir.AppendASCII("tlslite")); AppendToPythonPath( - third_party_dir.AppendASCII("pyftpdlib").AppendASCII("src")); - AppendToPythonPath( third_party_dir.AppendASCII("pywebsocket").AppendASCII("src")); // Locate the Python code generated by the protocol buffers compiler.
diff --git a/net/tools/testserver/testserver.py b/net/tools/testserver/testserver.py index 0576ac6..4ec4831 100755 --- a/net/tools/testserver/testserver.py +++ b/net/tools/testserver/testserver.py
@@ -39,21 +39,9 @@ BASE_DIR = os.path.dirname(os.path.abspath(__file__)) ROOT_DIR = os.path.dirname(os.path.dirname(os.path.dirname(BASE_DIR))) -# Temporary hack to deal with tlslite 0.3.8 -> 0.4.6 upgrade. -# -# TODO(davidben): Remove this when it has cycled through all the bots and -# developer checkouts or when http://crbug.com/356276 is resolved. -try: - os.remove(os.path.join(ROOT_DIR, 'third_party', 'tlslite', - 'tlslite', 'utils', 'hmac.pyc')) -except Exception: - pass - -# Append at the end of sys.path, it's fine to use the system library. -sys.path.append(os.path.join(ROOT_DIR, 'third_party', 'pyftpdlib', 'src')) - # Insert at the beginning of the path, we want to use our copies of the library -# unconditionally. +# unconditionally (since they contain modifications from anything that might be +# obtained from e.g. PyPi). sys.path.insert(0, os.path.join(ROOT_DIR, 'third_party', 'pywebsocket', 'src')) sys.path.insert(0, os.path.join(ROOT_DIR, 'third_party', 'tlslite'))
diff --git a/net/url_request/url_request_http_job_unittest.cc b/net/url_request/url_request_http_job_unittest.cc index 9d9aaaf1..10b36de2 100644 --- a/net/url_request/url_request_http_job_unittest.cc +++ b/net/url_request/url_request_http_job_unittest.cc
@@ -1575,6 +1575,7 @@ // Fake implementation of HttpStreamBase methods. int InitializeStream(const HttpRequestInfo* request_info, + bool can_send_early, RequestPriority priority, const NetLogWithSource& net_log, const CompletionCallback& callback) override {
diff --git a/net/websockets/websocket_basic_handshake_stream.cc b/net/websockets/websocket_basic_handshake_stream.cc index 2462e0f..47113a24 100644 --- a/net/websockets/websocket_basic_handshake_stream.cc +++ b/net/websockets/websocket_basic_handshake_stream.cc
@@ -312,11 +312,12 @@ int WebSocketBasicHandshakeStream::InitializeStream( const HttpRequestInfo* request_info, + bool can_send_early, RequestPriority priority, const NetLogWithSource& net_log, const CompletionCallback& callback) { url_ = request_info->url; - state_.Initialize(request_info, priority, net_log, callback); + state_.Initialize(request_info, can_send_early, priority, net_log, callback); return OK; }
diff --git a/net/websockets/websocket_basic_handshake_stream.h b/net/websockets/websocket_basic_handshake_stream.h index 06bc333..10be350 100644 --- a/net/websockets/websocket_basic_handshake_stream.h +++ b/net/websockets/websocket_basic_handshake_stream.h
@@ -44,6 +44,7 @@ // HttpStreamBase methods int InitializeStream(const HttpRequestInfo* request_info, + bool can_send_early, RequestPriority priority, const NetLogWithSource& net_log, const CompletionCallback& callback) override;
diff --git a/net/websockets/websocket_handshake_stream_create_helper_test.cc b/net/websockets/websocket_handshake_stream_create_helper_test.cc index b191e448..17e2d26 100644 --- a/net/websockets/websocket_handshake_stream_create_helper_test.cc +++ b/net/websockets/websocket_handshake_stream_create_helper_test.cc
@@ -123,7 +123,7 @@ request_info.method = "GET"; request_info.load_flags = LOAD_DISABLE_CACHE; int rv = - handshake->InitializeStream(&request_info, DEFAULT_PRIORITY, + handshake->InitializeStream(&request_info, true, DEFAULT_PRIORITY, NetLogWithSource(), CompletionCallback()); EXPECT_THAT(rv, IsOk());
diff --git a/remoting/base/buffered_socket_writer.cc b/remoting/base/buffered_socket_writer.cc index 256dd21..2c90639 100644 --- a/remoting/base/buffered_socket_writer.cc +++ b/remoting/base/buffered_socket_writer.cc
@@ -6,7 +6,6 @@ #include "base/bind.h" #include "base/callback_helpers.h" -#include "base/memory/ptr_util.h" #include "net/base/io_buffer.h" #include "net/base/net_errors.h" #include "net/socket/socket.h" @@ -73,7 +72,7 @@ if (closed_) return; - queue_.push_back(base::MakeUnique<PendingPacket>( + queue_.push_back(std::make_unique<PendingPacket>( new net::DrainableIOBuffer(data.get(), data->size()), done_task, traffic_annotation));
diff --git a/remoting/base/chromium_url_request.cc b/remoting/base/chromium_url_request.cc index 18a49ec..9f42496 100644 --- a/remoting/base/chromium_url_request.cc +++ b/remoting/base/chromium_url_request.cc
@@ -4,8 +4,9 @@ #include "remoting/base/chromium_url_request.h" +#include <memory> + #include "base/callback_helpers.h" -#include "base/memory/ptr_util.h" #include "net/base/load_flags.h" #include "net/url_request/url_fetcher.h" #include "net/url_request/url_request_context_getter.h" @@ -78,7 +79,7 @@ UrlRequest::Type type, const std::string& url, const net::NetworkTrafficAnnotationTag& traffic_annotation) { - return base::MakeUnique<ChromiumUrlRequest>(url_context_, type, url, + return std::make_unique<ChromiumUrlRequest>(url_context_, type, url, traffic_annotation); }
diff --git a/remoting/client/chromoting_client.cc b/remoting/client/chromoting_client.cc index d7f4896..21f47d8 100644 --- a/remoting/client/chromoting_client.cc +++ b/remoting/client/chromoting_client.cc
@@ -6,7 +6,6 @@ #include <utility> -#include "base/memory/ptr_util.h" #include "remoting/base/capabilities.h" #include "remoting/base/constants.h" #include "remoting/client/client_context.h" @@ -259,7 +258,7 @@ DCHECK(thread_checker_.CalledOnValidThread()); auto session = session_manager_->Connect( SignalingAddress(host_jid_), - base::MakeUnique<protocol::NegotiatingClientAuthenticator>( + std::make_unique<protocol::NegotiatingClientAuthenticator>( signal_strategy_->GetLocalAddress().id(), host_jid_, client_auth_config_)); if (host_experiment_sender_) {
diff --git a/remoting/client/chromoting_client_runtime.cc b/remoting/client/chromoting_client_runtime.cc index d9933a0..f1586f4 100644 --- a/remoting/client/chromoting_client_runtime.cc +++ b/remoting/client/chromoting_client_runtime.cc
@@ -6,7 +6,6 @@ #include "base/bind.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/memory/singleton.h" #include "base/message_loop/message_loop.h" #include "base/task_scheduler/task_scheduler.h" @@ -95,7 +94,7 @@ } log_writer_.reset(new TelemetryLogWriter( kTelemetryBaseUrl, - base::MakeUnique<ChromiumUrlRequestFactory>(url_requester()))); + std::make_unique<ChromiumUrlRequestFactory>(url_requester()))); log_writer_->SetAuthClosure( base::Bind(&ChromotingClientRuntime::RequestAuthTokenForLogger, base::Unretained(this)));
diff --git a/remoting/client/chromoting_session.cc b/remoting/client/chromoting_session.cc index 48948b16..81942384 100644 --- a/remoting/client/chromoting_session.cc +++ b/remoting/client/chromoting_session.cc
@@ -12,7 +12,6 @@ #include "base/callback_helpers.h" #include "base/format_macros.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "jingle/glue/thread_wrapper.h" #include "net/socket/client_socket_factory.h" #include "remoting/base/chromium_url_request.h" @@ -443,8 +442,8 @@ scoped_refptr<protocol::TransportContext> transport_context = new protocol::TransportContext( signaling_.get(), - base::MakeUnique<protocol::ChromiumPortAllocatorFactory>(), - base::MakeUnique<ChromiumUrlRequestFactory>( + std::make_unique<protocol::ChromiumPortAllocatorFactory>(), + std::make_unique<ChromiumUrlRequestFactory>( runtime_->url_requester()), protocol::NetworkSettings( protocol::NetworkSettings::NAT_TRAVERSAL_FULL),
diff --git a/remoting/client/display/gl_desktop.cc b/remoting/client/display/gl_desktop.cc index 9362bd3..fd7fb441 100644 --- a/remoting/client/display/gl_desktop.cc +++ b/remoting/client/display/gl_desktop.cc
@@ -121,7 +121,7 @@ max_texture_size_); rect.IntersectWith(desktop_rect); std::unique_ptr<GlDesktopTextureContainer> container = base::WrapUnique( - new GlDesktopTextureContainer{base::MakeUnique<GlRenderLayer>( + new GlDesktopTextureContainer{std::make_unique<GlRenderLayer>( texture_id, canvas_->GetWeakPtr()), rect}); FillRectangleVertexPositions(rect.left(), rect.top(), rect.width(),
diff --git a/remoting/client/display/gl_renderer_unittest.cc b/remoting/client/display/gl_renderer_unittest.cc index 92b8dd7..2dce491 100644 --- a/remoting/client/display/gl_renderer_unittest.cc +++ b/remoting/client/display/gl_renderer_unittest.cc
@@ -4,9 +4,10 @@ #include "remoting/client/display/gl_renderer.h" +#include <memory> + #include "base/bind.h" #include "base/bind_helpers.h" -#include "base/memory/ptr_util.h" #include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "base/threading/thread_task_runner_handle.h" @@ -151,7 +152,7 @@ void GlRendererTest::SetDesktopFrameWithSize(const webrtc::DesktopSize& size) { renderer_->OnFrameReceived( - base::MakeUnique<webrtc::BasicDesktopFrame>(size), + std::make_unique<webrtc::BasicDesktopFrame>(size), base::Bind(&GlRendererTest::OnDesktopFrameProcessed, base::Unretained(this))); } @@ -252,24 +253,24 @@ // TODO(yuweih): Add tests to validate the rendered output. TEST_F(GlRendererTest, TestAddDrawable) { - std::unique_ptr<FakeDrawable> drawable0 = base::MakeUnique<FakeDrawable>(); + std::unique_ptr<FakeDrawable> drawable0 = std::make_unique<FakeDrawable>(); drawable0->SetId(0); renderer_->AddDrawable(drawable0->GetWeakPtr()); ASSERT_EQ(1, GetDrawablesCount()); } TEST_F(GlRendererTest, TestAddDrawableDefaultOrder) { - std::unique_ptr<FakeDrawable> drawable0 = base::MakeUnique<FakeDrawable>(); + std::unique_ptr<FakeDrawable> drawable0 = std::make_unique<FakeDrawable>(); drawable0->SetId(0); renderer_->AddDrawable(drawable0->GetWeakPtr()); ASSERT_EQ(1, GetDrawablesCount()); - std::unique_ptr<FakeDrawable> drawable1 = base::MakeUnique<FakeDrawable>(); + std::unique_ptr<FakeDrawable> drawable1 = std::make_unique<FakeDrawable>(); drawable1->SetId(1); renderer_->AddDrawable(drawable1->GetWeakPtr()); ASSERT_EQ(2, GetDrawablesCount()); - std::unique_ptr<FakeDrawable> drawable2 = base::MakeUnique<FakeDrawable>(); + std::unique_ptr<FakeDrawable> drawable2 = std::make_unique<FakeDrawable>(); drawable2->SetId(2); renderer_->AddDrawable(drawable2->GetWeakPtr()); ASSERT_EQ(3, GetDrawablesCount()); @@ -284,18 +285,18 @@ } TEST_F(GlRendererTest, TestAddDrawableOrder) { - std::unique_ptr<FakeDrawable> drawable2 = base::MakeUnique<FakeDrawable>(); + std::unique_ptr<FakeDrawable> drawable2 = std::make_unique<FakeDrawable>(); drawable2->SetId(2); drawable2->SetZIndex(2); renderer_->AddDrawable(drawable2->GetWeakPtr()); ASSERT_EQ(1, GetDrawablesCount()); - std::unique_ptr<FakeDrawable> drawable0 = base::MakeUnique<FakeDrawable>(); + std::unique_ptr<FakeDrawable> drawable0 = std::make_unique<FakeDrawable>(); drawable0->SetId(0); renderer_->AddDrawable(drawable0->GetWeakPtr()); ASSERT_EQ(2, GetDrawablesCount()); - std::unique_ptr<FakeDrawable> drawable1 = base::MakeUnique<FakeDrawable>(); + std::unique_ptr<FakeDrawable> drawable1 = std::make_unique<FakeDrawable>(); drawable1->SetId(1); drawable1->SetZIndex(1); renderer_->AddDrawable(drawable1->GetWeakPtr()); @@ -311,16 +312,16 @@ } TEST_F(GlRendererTest, TestAddDrawableDrawn) { - std::unique_ptr<Canvas> fakeCanvas = base::MakeUnique<FakeCanvas>(); + std::unique_ptr<Canvas> fakeCanvas = std::make_unique<FakeCanvas>(); renderer_->OnSurfaceCreated(std::move(fakeCanvas)); delegate_.can_render_frame_ = true; PostSetDesktopFrameTasks(webrtc::DesktopSize(16, 16), 1); - std::unique_ptr<FakeDrawable> drawable0 = base::MakeUnique<FakeDrawable>(); + std::unique_ptr<FakeDrawable> drawable0 = std::make_unique<FakeDrawable>(); drawable0->SetId(3); renderer_->AddDrawable(drawable0->GetWeakPtr()); RequestRender(); RunTasksInCurrentQueue(); - std::unique_ptr<FakeDrawable> drawable1 = base::MakeUnique<FakeDrawable>(); + std::unique_ptr<FakeDrawable> drawable1 = std::make_unique<FakeDrawable>(); drawable1->SetId(2); drawable1->SetZIndex(1); renderer_->AddDrawable(drawable1->GetWeakPtr()); @@ -328,7 +329,7 @@ RequestRender(); RunTasksInCurrentQueue(); - std::unique_ptr<FakeDrawable> drawable2 = base::MakeUnique<FakeDrawable>(); + std::unique_ptr<FakeDrawable> drawable2 = std::make_unique<FakeDrawable>(); drawable2->SetId(1); drawable2->SetZIndex(2); renderer_->AddDrawable(drawable2->GetWeakPtr());
diff --git a/remoting/client/dual_buffer_frame_consumer.cc b/remoting/client/dual_buffer_frame_consumer.cc index 6008d80..cc5c04d 100644 --- a/remoting/client/dual_buffer_frame_consumer.cc +++ b/remoting/client/dual_buffer_frame_consumer.cc
@@ -10,7 +10,6 @@ #include "base/bind_helpers.h" #include "base/location.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/threading/thread_task_runner_handle.h" namespace remoting { @@ -112,9 +111,9 @@ // Both buffers are reallocated whenever screen size changes. if (!buffers_[0] || !buffers_[0]->size().equals(size)) { buffers_[0] = webrtc::SharedDesktopFrame::Wrap( - base::MakeUnique<PaddedDesktopFrame>(size)); + std::make_unique<PaddedDesktopFrame>(size)); buffers_[1] = webrtc::SharedDesktopFrame::Wrap( - base::MakeUnique<PaddedDesktopFrame>(size)); + std::make_unique<PaddedDesktopFrame>(size)); buffer_1_mask_.Clear(); current_buffer_ = 0; } else {
diff --git a/remoting/client/jni/jni_gl_display_handler.cc b/remoting/client/jni/jni_gl_display_handler.cc index b7adcf89..6bfb017 100644 --- a/remoting/client/jni/jni_gl_display_handler.cc +++ b/remoting/client/jni/jni_gl_display_handler.cc
@@ -6,11 +6,11 @@ #include <android/native_window_jni.h> #include <array> +#include <memory> #include "base/android/jni_android.h" #include "base/bind.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "jni/GlDisplay_jni.h" #include "remoting/client/chromoting_client_runtime.h" #include "remoting/client/cursor_shape_stub_proxy.h" @@ -149,7 +149,7 @@ egl_context_.reset(new EglThreadContext()); egl_context_->BindToWindow(window_); - renderer_->OnSurfaceCreated(base::MakeUnique<GlCanvas>( + renderer_->OnSurfaceCreated(std::make_unique<GlCanvas>( static_cast<int>(egl_context_->client_version()))); runtime_->network_task_runner()->PostTask( @@ -234,13 +234,13 @@ std::unique_ptr<protocol::CursorShapeStub> JniGlDisplayHandler::CreateCursorShapeStub() { - return base::MakeUnique<CursorShapeStubProxy>( + return std::make_unique<CursorShapeStubProxy>( core_->GetWeakPtr(), runtime_->display_task_runner()); } std::unique_ptr<protocol::VideoRenderer> JniGlDisplayHandler::CreateVideoRenderer() { - return base::MakeUnique<SoftwareVideoRenderer>(core_->GrabFrameConsumer()); + return std::make_unique<SoftwareVideoRenderer>(core_->GrabFrameConsumer()); } void JniGlDisplayHandler::OnSurfaceCreated(
diff --git a/remoting/client/plugin/chromoting_instance.cc b/remoting/client/plugin/chromoting_instance.cc index e8e348af..7d27fbd 100644 --- a/remoting/client/plugin/chromoting_instance.cc +++ b/remoting/client/plugin/chromoting_instance.cc
@@ -18,7 +18,6 @@ #include "base/json/json_writer.h" #include "base/lazy_instance.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_split.h" #include "base/strings/stringprintf.h" @@ -194,7 +193,7 @@ rtc::InitRandom(random_seed, sizeof(random_seed)); // Send hello message. - PostLegacyJsonMessage("hello", base::MakeUnique<base::DictionaryValue>()); + PostLegacyJsonMessage("hello", std::make_unique<base::DictionaryValue>()); } ChromotingInstance::~ChromotingInstance() { @@ -345,7 +344,7 @@ void ChromotingInstance::OnVideoFirstFrameReceived() { PostLegacyJsonMessage("onFirstFrameReceived", - base::MakeUnique<base::DictionaryValue>()); + std::make_unique<base::DictionaryValue>()); } void ChromotingInstance::OnVideoFrameDirtyRegion( @@ -693,8 +692,8 @@ scoped_refptr<protocol::TransportContext> transport_context( new protocol::TransportContext( signal_strategy_.get(), - base::MakeUnique<PepperPortAllocatorFactory>(this), - base::MakeUnique<PepperUrlRequestFactory>(this), + std::make_unique<PepperPortAllocatorFactory>(this), + std::make_unique<PepperUrlRequestFactory>(this), protocol::NetworkSettings( protocol::NetworkSettings::NAT_TRAVERSAL_FULL), protocol::TransportRole::CLIENT));
diff --git a/remoting/client/plugin/pepper_main_thread_task_runner.cc b/remoting/client/plugin/pepper_main_thread_task_runner.cc index 634dfab9..bd1ce57 100644 --- a/remoting/client/plugin/pepper_main_thread_task_runner.cc +++ b/remoting/client/plugin/pepper_main_thread_task_runner.cc
@@ -8,7 +8,6 @@ #include <utility> #include "base/bind.h" -#include "base/memory/ptr_util.h" #include "ppapi/cpp/completion_callback.h" #include "ppapi/cpp/core.h" #include "ppapi/cpp/module.h" @@ -34,7 +33,7 @@ const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) { - auto task_ptr = base::MakeUnique<base::OnceClosure>(base::Bind( + auto task_ptr = std::make_unique<base::OnceClosure>(base::Bind( &PepperMainThreadTaskRunner::RunTask, weak_ptr_, base::Passed(&task))); core_->CallOnMainThread( delay.InMillisecondsRoundedUp(),
diff --git a/remoting/client/plugin/pepper_port_allocator_factory.cc b/remoting/client/plugin/pepper_port_allocator_factory.cc index c3255f4..f71b730 100644 --- a/remoting/client/plugin/pepper_port_allocator_factory.cc +++ b/remoting/client/plugin/pepper_port_allocator_factory.cc
@@ -21,7 +21,7 @@ std::unique_ptr<cricket::PortAllocator> PepperPortAllocatorFactory::CreatePortAllocator( scoped_refptr<protocol::TransportContext> transport_context) { - return base::MakeUnique<protocol::PortAllocator>( + return std::make_unique<protocol::PortAllocator>( base::WrapUnique(new PepperNetworkManager(pp_instance_)), base::WrapUnique(new PepperPacketSocketFactory(pp_instance_)), transport_context);
diff --git a/remoting/client/plugin/pepper_url_request.cc b/remoting/client/plugin/pepper_url_request.cc index 05779a9..1555f5a 100644 --- a/remoting/client/plugin/pepper_url_request.cc +++ b/remoting/client/plugin/pepper_url_request.cc
@@ -4,9 +4,10 @@ #include "remoting/client/plugin/pepper_url_request.h" +#include <memory> + #include "base/callback_helpers.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "net/traffic_annotation/network_traffic_annotation.h" #include "ppapi/cpp/url_response_info.h" @@ -115,7 +116,7 @@ UrlRequest::Type type, const std::string& url, const net::NetworkTrafficAnnotationTag& traffic_annotation) { - return base::MakeUnique<PepperUrlRequest>(pp_instance_, type, url, + return std::make_unique<PepperUrlRequest>(pp_instance_, type, url, traffic_annotation); }
diff --git a/remoting/client/plugin/pepper_video_renderer_2d.cc b/remoting/client/plugin/pepper_video_renderer_2d.cc index 730ddf6..e7b7201 100644 --- a/remoting/client/plugin/pepper_video_renderer_2d.cc +++ b/remoting/client/plugin/pepper_video_renderer_2d.cc
@@ -178,7 +178,7 @@ if (!done.is_null()) { pending_frames_done_callbacks_.push_back( - base::MakeUnique<base::ScopedClosureRunner>(done)); + std::make_unique<base::ScopedClosureRunner>(done)); } need_flush_ = true;
diff --git a/remoting/client/software_video_renderer_unittest.cc b/remoting/client/software_video_renderer_unittest.cc index 4947272..68faa7b 100644 --- a/remoting/client/software_video_renderer_unittest.cc +++ b/remoting/client/software_video_renderer_unittest.cc
@@ -11,7 +11,6 @@ #include <vector> #include "base/bind.h" -#include "base/memory/ptr_util.h" #include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "base/threading/thread.h" @@ -52,7 +51,7 @@ std::unique_ptr<DesktopFrame> AllocateFrame( const webrtc::DesktopSize& size) override { EXPECT_TRUE(thread_checker_.CalledOnValidThread()); - return base::MakeUnique<webrtc::BasicDesktopFrame>(size); + return std::make_unique<webrtc::BasicDesktopFrame>(size); } void DrawFrame(std::unique_ptr<DesktopFrame> frame,
diff --git a/remoting/codec/cast_software_video_encoder_adapter.cc b/remoting/codec/cast_software_video_encoder_adapter.cc index 5a2d5f3..8051a81 100644 --- a/remoting/codec/cast_software_video_encoder_adapter.cc +++ b/remoting/codec/cast_software_video_encoder_adapter.cc
@@ -9,7 +9,6 @@ #include <utility> #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "media/base/video_frame.h" #include "media/base/video_types.h" #include "media/cast/sender/sender_encoded_frame.h" @@ -76,7 +75,7 @@ CastSoftwareVideoEncoderAdapter::CreateEncodedFrame( const webrtc::DesktopFrame& frame, media::cast::SenderEncodedFrame&& media_frame) const { - std::unique_ptr<EncodedFrame> result = base::MakeUnique<EncodedFrame>(); + std::unique_ptr<EncodedFrame> result = std::make_unique<EncodedFrame>(); result->size = frame.size(); // TODO(zijiehe): Should INDEPENDENT frames also be considered as key frames? result->key_frame =
diff --git a/remoting/codec/webrtc_video_encoder_gpu.cc b/remoting/codec/webrtc_video_encoder_gpu.cc index b143d88..901fc5b 100644 --- a/remoting/codec/webrtc_video_encoder_gpu.cc +++ b/remoting/codec/webrtc_video_encoder_gpu.cc
@@ -4,6 +4,7 @@ #include "remoting/codec/webrtc_video_encoder_gpu.h" +#include <memory> #include <utility> #include "base/bind.h" @@ -157,7 +158,7 @@ output_buffers_.clear(); for (unsigned int i = 0; i < kWebrtcVideoEncoderGpuOutputBufferCount; ++i) { - auto shm = base::MakeUnique<base::SharedMemory>(); + auto shm = std::make_unique<base::SharedMemory>(); // TODO(gusss): Do we need to handle mapping failure more gracefully? CHECK(shm->CreateAndMapAnonymous(output_buffer_size_)); output_buffers_.push_back(std::move(shm)); @@ -182,7 +183,7 @@ << "timestamp ms = " << timestamp.InMilliseconds(); std::unique_ptr<EncodedFrame> encoded_frame = - base::MakeUnique<EncodedFrame>(); + std::make_unique<EncodedFrame>(); base::SharedMemory* output_buffer = output_buffers_[bitstream_buffer_id].get(); DCHECK(output_buffer->memory());
diff --git a/remoting/codec/webrtc_video_encoder_selector_unittest.cc b/remoting/codec/webrtc_video_encoder_selector_unittest.cc index da24df0..fbb7e23 100644 --- a/remoting/codec/webrtc_video_encoder_selector_unittest.cc +++ b/remoting/codec/webrtc_video_encoder_selector_unittest.cc
@@ -7,7 +7,6 @@ #include <string> #include "base/bind.h" -#include "base/memory/ptr_util.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" @@ -80,7 +79,7 @@ // Returns a FakeWebrtcVideoEncoder with |index| as its index. std::unique_ptr<WebrtcVideoEncoder> CreateEncoder(int index) { - return base::MakeUnique<FakeWebrtcVideoEncoder>(index); + return std::make_unique<FakeWebrtcVideoEncoder>(index); } };
diff --git a/remoting/host/basic_desktop_environment.cc b/remoting/host/basic_desktop_environment.cc index 0c422e6a..434ea023 100644 --- a/remoting/host/basic_desktop_environment.cc +++ b/remoting/host/basic_desktop_environment.cc
@@ -6,7 +6,6 @@ #include "base/bind.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/single_thread_task_runner.h" #include "build/build_config.h" #include "remoting/host/audio_capturer.h" @@ -53,7 +52,7 @@ std::unique_ptr<webrtc::MouseCursorMonitor> BasicDesktopEnvironment::CreateMouseCursorMonitor() { - return base::MakeUnique<MouseCursorMonitorProxy>(video_capture_task_runner_, + return std::make_unique<MouseCursorMonitorProxy>(video_capture_task_runner_, desktop_capture_options()); }
diff --git a/remoting/host/chromoting_host.cc b/remoting/host/chromoting_host.cc index 872a613b..435f784 100644 --- a/remoting/host/chromoting_host.cc +++ b/remoting/host/chromoting_host.cc
@@ -250,7 +250,7 @@ std::vector<HostExtension*> extension_ptrs; for (const auto& extension : extensions_) extension_ptrs.push_back(extension.get()); - clients_.push_back(base::MakeUnique<ClientSession>( + clients_.push_back(std::make_unique<ClientSession>( this, std::move(connection), desktop_environment_factory_, desktop_environment_options_, max_session_duration_, pairing_registry_, extension_ptrs));
diff --git a/remoting/host/client_session.cc b/remoting/host/client_session.cc index a9026a7..63d21c5 100644 --- a/remoting/host/client_session.cc +++ b/remoting/host/client_session.cc
@@ -8,7 +8,6 @@ #include <utility> #include "base/command_line.h" -#include "base/memory/ptr_util.h" #include "base/optional.h" #include "base/single_thread_task_runner.h" #include "base/threading/thread_task_runner_handle.h" @@ -177,7 +176,7 @@ } // Compute the set of capabilities supported by both client and host. - client_capabilities_ = base::MakeUnique<std::string>(); + client_capabilities_ = std::make_unique<std::string>(); if (capabilities.has_capabilities()) *client_capabilities_ = capabilities.capabilities(); capabilities_ = IntersectCapabilities(*client_capabilities_, @@ -442,7 +441,7 @@ std::unique_ptr<protocol::ClipboardStub> ClientSession::CreateClipboardProxy() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - return base::MakeUnique<protocol::ClipboardThreadProxy>( + return std::make_unique<protocol::ClipboardThreadProxy>( client_clipboard_factory_.GetWeakPtr(), base::ThreadTaskRunnerHandle::Get()); }
diff --git a/remoting/host/client_session_unittest.cc b/remoting/host/client_session_unittest.cc index 0bd7b35..47d9f275 100644 --- a/remoting/host/client_session_unittest.cc +++ b/remoting/host/client_session_unittest.cc
@@ -191,7 +191,7 @@ } void ClientSessionTest::CreateClientSession() { - CreateClientSession(base::MakeUnique<protocol::FakeSession>()); + CreateClientSession(std::make_unique<protocol::FakeSession>()); } void ClientSessionTest::ConnectClientSession() { @@ -454,8 +454,8 @@ } TEST_F(ClientSessionTest, ForwardHostSessionOptions1) { - auto session = base::MakeUnique<protocol::FakeSession>(); - auto configuration = base::MakeUnique<buzz::XmlElement>( + auto session = std::make_unique<protocol::FakeSession>(); + auto configuration = std::make_unique<buzz::XmlElement>( buzz::QName(kChromotingXmlNamespace, "host-configuration")); configuration->SetBodyText("Detect-Updated-Region:true"); session->SetAttachment(0, std::move(configuration)); @@ -468,8 +468,8 @@ } TEST_F(ClientSessionTest, ForwardHostSessionOptions2) { - auto session = base::MakeUnique<protocol::FakeSession>(); - auto configuration = base::MakeUnique<buzz::XmlElement>( + auto session = std::make_unique<protocol::FakeSession>(); + auto configuration = std::make_unique<buzz::XmlElement>( buzz::QName(kChromotingXmlNamespace, "host-configuration")); configuration->SetBodyText("Detect-Updated-Region:false"); session->SetAttachment(0, std::move(configuration)); @@ -483,8 +483,8 @@ #if defined(OS_WIN) TEST_F(ClientSessionTest, ForwardDirectXHostSessionOptions1) { - auto session = base::MakeUnique<protocol::FakeSession>(); - auto configuration = base::MakeUnique<buzz::XmlElement>( + auto session = std::make_unique<protocol::FakeSession>(); + auto configuration = std::make_unique<buzz::XmlElement>( buzz::QName(kChromotingXmlNamespace, "host-configuration")); configuration->SetBodyText("DirectX-Capturer:true"); session->SetAttachment(0, std::move(configuration)); @@ -497,8 +497,8 @@ } TEST_F(ClientSessionTest, ForwardDirectXHostSessionOptions2) { - auto session = base::MakeUnique<protocol::FakeSession>(); - auto configuration = base::MakeUnique<buzz::XmlElement>( + auto session = std::make_unique<protocol::FakeSession>(); + auto configuration = std::make_unique<buzz::XmlElement>( buzz::QName(kChromotingXmlNamespace, "host-configuration")); configuration->SetBodyText("DirectX-Capturer:false"); session->SetAttachment(0, std::move(configuration));
diff --git a/remoting/host/continue_window_chromeos.cc b/remoting/host/continue_window_chromeos.cc index 9317943..be8a17f 100644 --- a/remoting/host/continue_window_chromeos.cc +++ b/remoting/host/continue_window_chromeos.cc
@@ -2,10 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <memory> + #include "remoting/host/continue_window.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "remoting/base/string_resources.h" #include "remoting/host/chromeos/message_box.h" #include "ui/base/l10n/l10n_util.h" @@ -44,7 +45,7 @@ } void ContinueWindowAura::ShowUi() { - message_box_ = base::MakeUnique<MessageBox>( + message_box_ = std::make_unique<MessageBox>( l10n_util::GetStringUTF16(IDS_MODE_IT2ME), // title l10n_util::GetStringUTF16(IDS_CONTINUE_PROMPT), // dialog label l10n_util::GetStringUTF16(IDS_CONTINUE_BUTTON), // ok label @@ -61,7 +62,7 @@ // static std::unique_ptr<HostWindow> HostWindow::CreateContinueWindow() { - return base::MakeUnique<ContinueWindowAura>(); + return std::make_unique<ContinueWindowAura>(); } } // namespace remoting
diff --git a/remoting/host/continue_window_linux.cc b/remoting/host/continue_window_linux.cc index 5092781e..856921b 100644 --- a/remoting/host/continue_window_linux.cc +++ b/remoting/host/continue_window_linux.cc
@@ -6,10 +6,11 @@ #include <gtk/gtk.h> +#include <memory> + #include "base/compiler_specific.h" #include "base/logging.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/strings/utf_string_conversions.h" #include "remoting/base/string_resources.h" #include "ui/base/glib/glib_signal.h" @@ -124,7 +125,7 @@ // static std::unique_ptr<HostWindow> HostWindow::CreateContinueWindow() { - return base::MakeUnique<ContinueWindowGtk>(); + return std::make_unique<ContinueWindowGtk>(); } } // namespace remoting
diff --git a/remoting/host/continue_window_mac.mm b/remoting/host/continue_window_mac.mm index d61b0fef..c0f8a76f 100644 --- a/remoting/host/continue_window_mac.mm +++ b/remoting/host/continue_window_mac.mm
@@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <memory> + #include "remoting/host/continue_window.h" #import <Cocoa/Cocoa.h> @@ -11,7 +13,6 @@ #include "base/mac/scoped_nsautorelease_pool.h" #include "base/mac/scoped_nsobject.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/strings/sys_string_conversions.h" #include "remoting/base/string_resources.h" #include "ui/base/l10n/l10n_util_mac.h" @@ -76,7 +77,7 @@ // static std::unique_ptr<HostWindow> HostWindow::CreateContinueWindow() { - return base::MakeUnique<ContinueWindowMac>(); + return std::make_unique<ContinueWindowMac>(); } } // namespace remoting
diff --git a/remoting/host/continue_window_win.cc b/remoting/host/continue_window_win.cc index 39ba651..a7efed90 100644 --- a/remoting/host/continue_window_win.cc +++ b/remoting/host/continue_window_win.cc
@@ -6,13 +6,14 @@ #include <windows.h> +#include <memory> + #include "base/bind.h" #include "base/callback.h" #include "base/compiler_specific.h" #include "base/location.h" #include "base/logging.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/single_thread_task_runner.h" #include "base/strings/utf_string_conversions.h" #include "base/win/current_module.h" @@ -131,7 +132,7 @@ // static std::unique_ptr<HostWindow> HostWindow::CreateContinueWindow() { - return base::MakeUnique<ContinueWindowWin>(); + return std::make_unique<ContinueWindowWin>(); } } // namespace remoting
diff --git a/remoting/host/desktop_capturer_proxy.cc b/remoting/host/desktop_capturer_proxy.cc index 4753a59..5600b29e 100644 --- a/remoting/host/desktop_capturer_proxy.cc +++ b/remoting/host/desktop_capturer_proxy.cc
@@ -73,8 +73,8 @@ DCHECK(!capturer_); #if defined(OS_CHROMEOS) - capturer_ = base::MakeUnique<webrtc::DesktopCapturerDifferWrapper>( - base::MakeUnique<AuraDesktopCapturer>()); + capturer_ = std::make_unique<webrtc::DesktopCapturerDifferWrapper>( + std::make_unique<AuraDesktopCapturer>()); #else // !defined(OS_CHROMEOS) capturer_ = webrtc::DesktopCapturer::CreateScreenCapturer(options); #endif // !defined(OS_CHROMEOS)
diff --git a/remoting/host/desktop_session_agent.cc b/remoting/host/desktop_session_agent.cc index 5b281ec..64c95d5 100644 --- a/remoting/host/desktop_session_agent.cc +++ b/remoting/host/desktop_session_agent.cc
@@ -122,7 +122,7 @@ base::Closure release_buffer_callback = base::Bind( send_message_callback_, base::Passed( - base::MakeUnique<ChromotingDesktopNetworkMsg_ReleaseSharedBuffer>( + std::make_unique<ChromotingDesktopNetworkMsg_ReleaseSharedBuffer>( next_shared_buffer_id_))); std::unique_ptr<SharedMemoryImpl> buffer = SharedMemoryImpl::Create( size, next_shared_buffer_id_, release_buffer_callback); @@ -138,7 +138,7 @@ next_shared_buffer_id_ += 2; send_message_callback_.Run( - base::MakeUnique<ChromotingDesktopNetworkMsg_CreateSharedBuffer>( + std::make_unique<ChromotingDesktopNetworkMsg_CreateSharedBuffer>( buffer->id(), buffer->shared_memory()->handle(), buffer->size())); } @@ -240,7 +240,7 @@ void DesktopSessionAgent::DisconnectSession(protocol::ErrorCode error) { SendToNetwork( - base::MakeUnique<ChromotingDesktopNetworkMsg_DisconnectSession>(error)); + std::make_unique<ChromotingDesktopNetworkMsg_DisconnectSession>(error)); } void DesktopSessionAgent::OnLocalMouseMoved( @@ -260,7 +260,7 @@ void DesktopSessionAgent::OnProcessStats( const protocol::AggregatedProcessResourceUsage& usage) { SendToNetwork( - base::MakeUnique<ChromotingAnyToNetworkMsg_ReportProcessStats>(usage)); + std::make_unique<ChromotingAnyToNetworkMsg_ReportProcessStats>(usage)); } void DesktopSessionAgent::OnStartSessionAgent( @@ -343,7 +343,7 @@ last_frame_ = std::move(frame); - SendToNetwork(base::MakeUnique<ChromotingDesktopNetworkMsg_CaptureResult>( + SendToNetwork(std::make_unique<ChromotingDesktopNetworkMsg_CaptureResult>( result, serialized_frame)); } @@ -353,7 +353,7 @@ std::unique_ptr<webrtc::MouseCursor> owned_cursor(cursor); SendToNetwork( - base::MakeUnique<ChromotingDesktopNetworkMsg_MouseCursor>(*owned_cursor)); + std::make_unique<ChromotingDesktopNetworkMsg_MouseCursor>(*owned_cursor)); } void DesktopSessionAgent::OnMouseCursorPosition( @@ -374,7 +374,7 @@ } SendToNetwork( - base::MakeUnique<ChromotingDesktopNetworkMsg_InjectClipboardEvent>( + std::make_unique<ChromotingDesktopNetworkMsg_InjectClipboardEvent>( serialized_event)); } @@ -388,7 +388,7 @@ return; } - SendToNetwork(base::MakeUnique<ChromotingDesktopNetworkMsg_AudioPacket>( + SendToNetwork(std::make_unique<ChromotingDesktopNetworkMsg_AudioPacket>( serialized_packet)); }
diff --git a/remoting/host/desktop_session_proxy.cc b/remoting/host/desktop_session_proxy.cc index ffee867..826cf908 100644 --- a/remoting/host/desktop_session_proxy.cc +++ b/remoting/host/desktop_session_proxy.cc
@@ -108,31 +108,31 @@ std::unique_ptr<AudioCapturer> DesktopSessionProxy::CreateAudioCapturer() { DCHECK(caller_task_runner_->BelongsToCurrentThread()); - return base::MakeUnique<IpcAudioCapturer>(this); + return std::make_unique<IpcAudioCapturer>(this); } std::unique_ptr<InputInjector> DesktopSessionProxy::CreateInputInjector() { DCHECK(caller_task_runner_->BelongsToCurrentThread()); - return base::MakeUnique<IpcInputInjector>(this); + return std::make_unique<IpcInputInjector>(this); } std::unique_ptr<ScreenControls> DesktopSessionProxy::CreateScreenControls() { DCHECK(caller_task_runner_->BelongsToCurrentThread()); - return base::MakeUnique<IpcScreenControls>(this); + return std::make_unique<IpcScreenControls>(this); } std::unique_ptr<webrtc::DesktopCapturer> DesktopSessionProxy::CreateVideoCapturer() { DCHECK(caller_task_runner_->BelongsToCurrentThread()); - return base::MakeUnique<IpcVideoFrameCapturer>(this); + return std::make_unique<IpcVideoFrameCapturer>(this); } std::unique_ptr<webrtc::MouseCursorMonitor> DesktopSessionProxy::CreateMouseCursorMonitor() { - return base::MakeUnique<IpcMouseCursorMonitor>(this); + return std::make_unique<IpcMouseCursorMonitor>(this); } std::string DesktopSessionProxy::GetCapabilities() const {
diff --git a/remoting/host/desktop_session_win.cc b/remoting/host/desktop_session_win.cc index cd54176a..d658499 100644 --- a/remoting/host/desktop_session_win.cc +++ b/remoting/host/desktop_session_win.cc
@@ -17,7 +17,6 @@ #include "base/files/file_path.h" #include "base/guid.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #include "base/strings/stringprintf.h" @@ -482,7 +481,7 @@ DaemonProcess* daemon_process, int id, const ScreenResolution& resolution) { - return base::MakeUnique<ConsoleSession>(caller_task_runner, io_task_runner, + return std::make_unique<ConsoleSession>(caller_task_runner, io_task_runner, daemon_process, id, HostService::GetInstance()); }
diff --git a/remoting/host/disconnect_window_chromeos.cc b/remoting/host/disconnect_window_chromeos.cc index 9a1a559..cda0e23 100644 --- a/remoting/host/disconnect_window_chromeos.cc +++ b/remoting/host/disconnect_window_chromeos.cc
@@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <memory> #include <string> #include "ash/shell.h" #include "ash/system/tray/system_tray_notifier.h" #include "base/bind.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "remoting/host/client_session_control.h" #include "remoting/host/host_window.h" @@ -50,7 +50,7 @@ // static std::unique_ptr<HostWindow> HostWindow::CreateDisconnectWindow() { - return base::MakeUnique<DisconnectWindowAura>(); + return std::make_unique<DisconnectWindowAura>(); } } // namespace remoting
diff --git a/remoting/host/disconnect_window_linux.cc b/remoting/host/disconnect_window_linux.cc index 09e82cd..fcce34ac 100644 --- a/remoting/host/disconnect_window_linux.cc +++ b/remoting/host/disconnect_window_linux.cc
@@ -4,10 +4,11 @@ #include <gtk/gtk.h> +#include <memory> + #include "base/compiler_specific.h" #include "base/logging.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/numerics/math_constants.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" @@ -353,7 +354,7 @@ // static std::unique_ptr<HostWindow> HostWindow::CreateDisconnectWindow() { - return base::MakeUnique<DisconnectWindowGtk>(); + return std::make_unique<DisconnectWindowGtk>(); } } // namespace remoting
diff --git a/remoting/host/disconnect_window_mac.mm b/remoting/host/disconnect_window_mac.mm index d8d9c8de..66c8a45 100644 --- a/remoting/host/disconnect_window_mac.mm +++ b/remoting/host/disconnect_window_mac.mm
@@ -6,11 +6,12 @@ #import <Cocoa/Cocoa.h> +#include <memory> + #include "base/bind.h" #include "base/compiler_specific.h" #include "base/i18n/rtl.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/memory/weak_ptr.h" #include "base/strings/string_util.h" #include "base/strings/sys_string_conversions.h" @@ -76,7 +77,7 @@ // static std::unique_ptr<HostWindow> HostWindow::CreateDisconnectWindow() { - return base::MakeUnique<DisconnectWindowMac>(); + return std::make_unique<DisconnectWindowMac>(); } } // namespace remoting
diff --git a/remoting/host/disconnect_window_win.cc b/remoting/host/disconnect_window_win.cc index adde9223..27be130a 100644 --- a/remoting/host/disconnect_window_win.cc +++ b/remoting/host/disconnect_window_win.cc
@@ -5,10 +5,11 @@ #include <stddef.h> #include <windows.h> +#include <memory> + #include "base/compiler_specific.h" #include "base/logging.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "base/win/current_module.h" @@ -397,7 +398,7 @@ // static std::unique_ptr<HostWindow> HostWindow::CreateDisconnectWindow() { - return base::MakeUnique<DisconnectWindowWin>(); + return std::make_unique<DisconnectWindowWin>(); } } // namespace remoting
diff --git a/remoting/host/fake_desktop_environment.cc b/remoting/host/fake_desktop_environment.cc index 4db2476..758add4 100644 --- a/remoting/host/fake_desktop_environment.cc +++ b/remoting/host/fake_desktop_environment.cc
@@ -6,7 +6,6 @@ #include <utility> -#include "base/memory/ptr_util.h" #include "remoting/host/audio_capturer.h" #include "remoting/host/desktop_capturer_proxy.h" #include "remoting/host/file_proxy_wrapper.h" @@ -76,7 +75,7 @@ } std::unique_ptr<ScreenControls> FakeDesktopEnvironment::CreateScreenControls() { - return base::MakeUnique<FakeScreenControls>(); + return std::make_unique<FakeScreenControls>(); } std::unique_ptr<webrtc::DesktopCapturer> @@ -94,7 +93,7 @@ std::unique_ptr<webrtc::MouseCursorMonitor> FakeDesktopEnvironment::CreateMouseCursorMonitor() { - return base::MakeUnique<FakeMouseCursorMonitor>(); + return std::make_unique<FakeMouseCursorMonitor>(); } std::unique_ptr<FileProxyWrapper>
diff --git a/remoting/host/fake_host_extension.cc b/remoting/host/fake_host_extension.cc index 074cddf41..2a02f20b 100644 --- a/remoting/host/fake_host_extension.cc +++ b/remoting/host/fake_host_extension.cc
@@ -4,11 +4,11 @@ #include "remoting/host/fake_host_extension.h" +#include <memory> #include <string> #include "base/logging.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "remoting/host/client_session_details.h" #include "remoting/host/host_extension_session.h" #include "remoting/proto/control.pb.h" @@ -62,7 +62,7 @@ protocol::ClientStub* client_stub) { DCHECK(!was_instantiated()); was_instantiated_ = true; - return base::MakeUnique<Session>(this, message_type_); + return std::make_unique<Session>(this, message_type_); } } // namespace remoting
diff --git a/remoting/host/file_proxy_wrapper_linux.cc b/remoting/host/file_proxy_wrapper_linux.cc index a72233f..d512db4 100644 --- a/remoting/host/file_proxy_wrapper_linux.cc +++ b/remoting/host/file_proxy_wrapper_linux.cc
@@ -361,7 +361,7 @@ next_read_file_offset_ += bytes_read; std::unique_ptr<std::vector<char>> read_buffer = - base::MakeUnique<std::vector<char>>(); + std::make_unique<std::vector<char>>(); read_buffer->resize(bytes_read); memcpy(read_buffer->data(), data, read_buffer->size());
diff --git a/remoting/host/file_proxy_wrapper_linux_unittest.cc b/remoting/host/file_proxy_wrapper_linux_unittest.cc index a0c19f363..69efa45 100644 --- a/remoting/host/file_proxy_wrapper_linux_unittest.cc +++ b/remoting/host/file_proxy_wrapper_linux_unittest.cc
@@ -4,6 +4,7 @@ #include "remoting/host/file_proxy_wrapper.h" +#include <memory> #include <queue> #include "base/bind.h" @@ -11,7 +12,6 @@ #include "base/containers/queue.h" #include "base/files/file_util.h" #include "base/files/scoped_temp_dir.h" -#include "base/memory/ptr_util.h" #include "base/run_loop.h" #include "base/test/scoped_task_environment.h" #include "net/base/io_buffer.h" @@ -28,7 +28,7 @@ std::unique_ptr<remoting::CompoundBuffer> ToBuffer(const std::string& data) { std::unique_ptr<remoting::CompoundBuffer> buffer = - base::MakeUnique<remoting::CompoundBuffer>(); + std::make_unique<remoting::CompoundBuffer>(); buffer->Append(new net::WrappedIOBuffer(data.data()), data.size()); return buffer; }
diff --git a/remoting/host/file_transfer_message_handler.cc b/remoting/host/file_transfer_message_handler.cc index d0dba7c..f659a292 100644 --- a/remoting/host/file_transfer_message_handler.cc +++ b/remoting/host/file_transfer_message_handler.cc
@@ -5,7 +5,6 @@ #include "remoting/host/file_transfer_message_handler.h" #include "base/bind.h" -#include "base/memory/ptr_util.h" #include "base/path_service.h" #include "base/stl_util.h" #include "remoting/base/compound_buffer.h" @@ -97,7 +96,7 @@ message.resize(buffer->total_bytes()); buffer->CopyTo(base::string_as_array(&message), message.size()); - request_ = base::MakeUnique<protocol::FileTransferRequest>(); + request_ = std::make_unique<protocol::FileTransferRequest>(); if (!request_->ParseFromString(message)) { CancelAndSendError("Failed to parse request protobuf"); return;
diff --git a/remoting/host/file_transfer_message_handler_unittest.cc b/remoting/host/file_transfer_message_handler_unittest.cc index c7f87b1..608f1e9 100644 --- a/remoting/host/file_transfer_message_handler_unittest.cc +++ b/remoting/host/file_transfer_message_handler_unittest.cc
@@ -26,7 +26,7 @@ std::unique_ptr<remoting::CompoundBuffer> ToBuffer(const std::string& data) { std::unique_ptr<remoting::CompoundBuffer> buffer = - base::MakeUnique<remoting::CompoundBuffer>(); + std::make_unique<remoting::CompoundBuffer>(); buffer->Append(new net::WrappedIOBuffer(data.data()), data.size()); return buffer; } @@ -186,7 +186,7 @@ // FileProxyWrapper without errors when given valid input. TEST_F(FileTransferMessageHandlerTest, WriteTwoChunks) { std::unique_ptr<FakeFileProxyWrapper> file_proxy_wrapper = - base::MakeUnique<FakeFileProxyWrapper>(); + std::make_unique<FakeFileProxyWrapper>(); // |file_proxy_wrapper_ptr| is valid until fake_pipe_->ClosePipe() is called. FakeFileProxyWrapper* file_proxy_wrapper_ptr = file_proxy_wrapper.get(); @@ -232,7 +232,7 @@ // FileProxyWrapper returns an error. TEST_F(FileTransferMessageHandlerTest, FileProxyError) { std::unique_ptr<FakeFileProxyWrapper> file_proxy_wrapper = - base::MakeUnique<FakeFileProxyWrapper>(); + std::make_unique<FakeFileProxyWrapper>(); // |file_proxy_wrapper_ptr| is valid until fake_pipe_->ClosePipe() is called. FakeFileProxyWrapper* file_proxy_wrapper_ptr = file_proxy_wrapper.get();
diff --git a/remoting/host/heartbeat_sender.cc b/remoting/host/heartbeat_sender.cc index 6d288c0..90e6b93 100644 --- a/remoting/host/heartbeat_sender.cc +++ b/remoting/host/heartbeat_sender.cc
@@ -98,7 +98,7 @@ DCHECK(thread_checker_.CalledOnValidThread()); if (state == SignalStrategy::CONNECTED) { DCHECK(!iq_sender_); - iq_sender_ = base::MakeUnique<IqSender>(signal_strategy_); + iq_sender_ = std::make_unique<IqSender>(signal_strategy_); SendHeartbeat(); } else if (state == SignalStrategy::DISCONNECTED) { request_.reset();
diff --git a/remoting/host/heartbeat_sender_unittest.cc b/remoting/host/heartbeat_sender_unittest.cc index 62dfcee5..7c1b672 100644 --- a/remoting/host/heartbeat_sender_unittest.cc +++ b/remoting/host/heartbeat_sender_unittest.cc
@@ -6,7 +6,6 @@ #include <set> -#include "base/memory/ptr_util.h" #include "base/memory/ref_counted.h" #include "base/message_loop/message_loop.h" #include "base/run_loop.h" @@ -136,7 +135,7 @@ void HeartbeatSenderTest::SendResponse(int message_index, base::TimeDelta interval, int expected_sequence_id) { - auto response = base::MakeUnique<XmlElement>(buzz::QN_IQ); + auto response = std::make_unique<XmlElement>(buzz::QN_IQ); response->AddAttr(QName(std::string(), "type"), "result"); response->AddAttr(QName(std::string(), "to"), kTestJid);
diff --git a/remoting/host/host_event_logger_win.cc b/remoting/host/host_event_logger_win.cc index 77326758..3664a27f 100644 --- a/remoting/host/host_event_logger_win.cc +++ b/remoting/host/host_event_logger_win.cc
@@ -12,7 +12,6 @@ #include <vector> #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/memory/weak_ptr.h" #include "base/strings/string16.h" #include "base/strings/utf_string_conversions.h" @@ -145,7 +144,7 @@ std::unique_ptr<HostEventLogger> HostEventLogger::Create( scoped_refptr<HostStatusMonitor> monitor, const std::string& application_name) { - return base::MakeUnique<HostEventLoggerWin>(monitor, application_name); + return std::make_unique<HostEventLoggerWin>(monitor, application_name); } } // namespace remoting
diff --git a/remoting/host/input_injector_x11.cc b/remoting/host/input_injector_x11.cc index 3435ee5..25d30bb6 100644 --- a/remoting/host/input_injector_x11.cc +++ b/remoting/host/input_injector_x11.cc
@@ -6,6 +6,7 @@ #include <stddef.h> #include <stdint.h> +#include <memory> #include <set> #include <utility> @@ -13,7 +14,6 @@ #include "base/compiler_specific.h" #include "base/location.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/optional.h" #include "base/single_thread_task_runner.h" #include "base/strings/utf_string_conversion_utils.h" @@ -642,7 +642,7 @@ clipboard_->Start(std::move(client_clipboard)); character_injector_.reset( - new X11CharacterInjector(base::MakeUnique<X11KeyboardImpl>(display_))); + new X11CharacterInjector(std::make_unique<X11KeyboardImpl>(display_))); } void InputInjectorX11::Core::Stop() {
diff --git a/remoting/host/ipc_desktop_environment.cc b/remoting/host/ipc_desktop_environment.cc index 1d4a13c..f192e8ad 100644 --- a/remoting/host/ipc_desktop_environment.cc +++ b/remoting/host/ipc_desktop_environment.cc
@@ -8,7 +8,6 @@ #include "base/compiler_specific.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/process/process_handle.h" #include "base/single_thread_task_runner.h" #include "build/build_config.h" @@ -100,7 +99,7 @@ const DesktopEnvironmentOptions& options) { DCHECK(caller_task_runner_->BelongsToCurrentThread()); - return base::MakeUnique<IpcDesktopEnvironment>( + return std::make_unique<IpcDesktopEnvironment>( audio_task_runner_, caller_task_runner_, io_task_runner_, client_session_control, connector_factory_.GetWeakPtr(), options); }
diff --git a/remoting/host/it2me/it2me_confirmation_dialog_chromeos.cc b/remoting/host/it2me/it2me_confirmation_dialog_chromeos.cc index 39c6541..0c040b0 100644 --- a/remoting/host/it2me/it2me_confirmation_dialog_chromeos.cc +++ b/remoting/host/it2me/it2me_confirmation_dialog_chromeos.cc
@@ -10,7 +10,6 @@ #include "base/callback_helpers.h" #include "base/i18n/message_formatter.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/strings/utf_string_conversions.h" #include "remoting/base/string_resources.h" #include "remoting/host/chromeos/message_box.h" @@ -47,7 +46,7 @@ DCHECK(!remote_user_email.empty()); callback_ = callback; - message_box_ = base::MakeUnique<MessageBox>( + message_box_ = std::make_unique<MessageBox>( l10n_util::GetStringUTF16(IDS_MODE_IT2ME), base::i18n::MessageFormatter::FormatWithNumberedArgs( l10n_util::GetStringUTF16( @@ -67,7 +66,7 @@ std::unique_ptr<It2MeConfirmationDialog> It2MeConfirmationDialogFactory::Create() { - return base::MakeUnique<It2MeConfirmationDialogChromeOS>(); + return std::make_unique<It2MeConfirmationDialogChromeOS>(); } } // namespace remoting
diff --git a/remoting/host/it2me/it2me_confirmation_dialog_linux.cc b/remoting/host/it2me/it2me_confirmation_dialog_linux.cc index ffc822d..4d218c5 100644 --- a/remoting/host/it2me/it2me_confirmation_dialog_linux.cc +++ b/remoting/host/it2me/it2me_confirmation_dialog_linux.cc
@@ -14,7 +14,6 @@ #include "base/location.h" #include "base/logging.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/strings/utf_string_conversions.h" #include "base/time/time.h" #include "base/timer/timer.h" @@ -148,7 +147,7 @@ std::unique_ptr<It2MeConfirmationDialog> It2MeConfirmationDialogFactory::Create() { - return base::MakeUnique<It2MeConfirmationDialogLinux>(); + return std::make_unique<It2MeConfirmationDialogLinux>(); } } // namespace remoting
diff --git a/remoting/host/it2me/it2me_confirmation_dialog_mac.mm b/remoting/host/it2me/it2me_confirmation_dialog_mac.mm index 2aa5f6b..bdb66c8 100644 --- a/remoting/host/it2me/it2me_confirmation_dialog_mac.mm +++ b/remoting/host/it2me/it2me_confirmation_dialog_mac.mm
@@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <memory> + #include "remoting/host/it2me/it2me_confirmation_dialog.h" #import <Cocoa/Cocoa.h> @@ -13,7 +15,6 @@ #include "base/mac/scoped_nsautorelease_pool.h" #include "base/mac/scoped_nsobject.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/strings/sys_string_conversions.h" #include "base/strings/utf_string_conversions.h" #include "base/time/time.h" @@ -112,7 +113,7 @@ std::unique_ptr<It2MeConfirmationDialog> It2MeConfirmationDialogFactory::Create() { - return base::MakeUnique<It2MeConfirmationDialogMac>(); + return std::make_unique<It2MeConfirmationDialogMac>(); } } // namespace remoting
diff --git a/remoting/host/it2me/it2me_confirmation_dialog_proxy_unittest.cc b/remoting/host/it2me/it2me_confirmation_dialog_proxy_unittest.cc index 4a028348..d3e612dd 100644 --- a/remoting/host/it2me/it2me_confirmation_dialog_proxy_unittest.cc +++ b/remoting/host/it2me/it2me_confirmation_dialog_proxy_unittest.cc
@@ -7,7 +7,6 @@ #include <memory> #include "base/bind.h" -#include "base/memory/ptr_util.h" #include "base/memory/ref_counted.h" #include "base/message_loop/message_loop.h" #include "base/run_loop.h" @@ -126,7 +125,7 @@ dialog_thread_.Start(); auto dialog = - base::MakeUnique<StubIt2MeConfirmationDialog>(dialog_task_runner()); + std::make_unique<StubIt2MeConfirmationDialog>(dialog_task_runner()); dialog_ = dialog.get(); dialog_proxy_.reset(new It2MeConfirmationDialogProxy(dialog_task_runner(), std::move(dialog)));
diff --git a/remoting/host/it2me/it2me_confirmation_dialog_win.cc b/remoting/host/it2me/it2me_confirmation_dialog_win.cc index 554e128..5ec51ca9 100644 --- a/remoting/host/it2me/it2me_confirmation_dialog_win.cc +++ b/remoting/host/it2me/it2me_confirmation_dialog_win.cc
@@ -15,7 +15,6 @@ #include "base/i18n/message_formatter.h" #include "base/logging.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "base/time/time.h" @@ -225,7 +224,7 @@ std::unique_ptr<It2MeConfirmationDialog> It2MeConfirmationDialogFactory::Create() { - return base::MakeUnique<It2MeConfirmationDialogWin>(); + return std::make_unique<It2MeConfirmationDialogWin>(); } } // namespace remoting
diff --git a/remoting/host/it2me/it2me_host_unittest.cc b/remoting/host/it2me/it2me_host_unittest.cc index df11713..835ea3a6 100644 --- a/remoting/host/it2me/it2me_host_unittest.cc +++ b/remoting/host/it2me/it2me_host_unittest.cc
@@ -13,7 +13,6 @@ #include "base/callback_helpers.h" #include "base/location.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #include "base/message_loop/message_loop.h" @@ -126,7 +125,7 @@ std::unique_ptr<It2MeConfirmationDialog> FakeIt2MeDialogFactory::Create() { EXPECT_FALSE(remote_user_email_.empty()); - return base::MakeUnique<FakeIt2MeConfirmationDialog>(remote_user_email_, + return std::make_unique<FakeIt2MeConfirmationDialog>(remote_user_email_, dialog_result_); } @@ -236,7 +235,7 @@ void It2MeHostTest::SetPolicies( std::initializer_list<std::pair<base::StringPiece, const base::Value&>> policies) { - policies_ = base::MakeUnique<base::DictionaryValue>(); + policies_ = std::make_unique<base::DictionaryValue>(); for (const auto& policy : policies) { policies_->Set(policy.first, policy.second.CreateDeepCopy()); } @@ -274,7 +273,7 @@ base::Time::Now() + base::TimeDelta::FromHours(1); auto fake_signal_strategy = - base::MakeUnique<FakeSignalStrategy>(SignalingAddress("fake_local_jid")); + std::make_unique<FakeSignalStrategy>(SignalingAddress("fake_local_jid")); fake_bot_signal_strategy_->ConnectTo(fake_signal_strategy.get()); it2me_host_ = new It2MeHost();
diff --git a/remoting/host/it2me/it2me_native_messaging_host.cc b/remoting/host/it2me/it2me_native_messaging_host.cc index a3bc2720..127b1da2a 100644 --- a/remoting/host/it2me/it2me_native_messaging_host.cc +++ b/remoting/host/it2me/it2me_native_messaging_host.cc
@@ -13,7 +13,6 @@ #include "base/callback_helpers.h" #include "base/json/json_reader.h" #include "base/json/json_writer.h" -#include "base/memory/ptr_util.h" #include "base/single_thread_task_runner.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" @@ -191,7 +190,7 @@ response->SetString("version", STRINGIZE(VERSION)); // This list will be populated when new features are added. - response->Set("supportedFeatures", base::MakeUnique<base::ListValue>()); + response->Set("supportedFeatures", std::make_unique<base::ListValue>()); SendMessageToClient(std::move(response)); } @@ -307,7 +306,7 @@ } auto delegating_signal_strategy = - base::MakeUnique<DelegatingSignalStrategy>( + std::make_unique<DelegatingSignalStrategy>( SignalingAddress(local_jid), host_context_->network_task_runner(), base::Bind(&It2MeNativeMessagingHost::SendOutgoingIq, weak_factory_.GetWeakPtr())); @@ -346,7 +345,7 @@ // Create the It2Me host and start connecting. it2me_host_ = factory_->CreateIt2MeHost(); it2me_host_->Connect(host_context_->Copy(), std::move(policies), - base::MakeUnique<It2MeConfirmationDialogFactory>(), + std::make_unique<It2MeConfirmationDialogFactory>(), weak_ptr_, std::move(signal_strategy), username, directory_bot_jid, ice_config); @@ -429,7 +428,7 @@ void It2MeNativeMessagingHost::SendPolicyErrorAndExit() const { DCHECK(task_runner()->BelongsToCurrentThread()); - auto message = base::MakeUnique<base::DictionaryValue>(); + auto message = std::make_unique<base::DictionaryValue>(); message->SetString("type", "policyError"); SendMessageToClient(std::move(message)); client_->CloseChannel(std::string());
diff --git a/remoting/host/it2me/it2me_native_messaging_host_unittest.cc b/remoting/host/it2me/it2me_native_messaging_host_unittest.cc index f0234e83..b997a8d 100644 --- a/remoting/host/it2me/it2me_native_messaging_host_unittest.cc +++ b/remoting/host/it2me/it2me_native_messaging_host_unittest.cc
@@ -517,7 +517,7 @@ std::unique_ptr<ChromotingHostContext> context = ChromotingHostContext::Create(host_task_runner_); auto policy_loader = - base::MakeUnique<policy::FakeAsyncPolicyLoader>(host_task_runner_); + std::make_unique<policy::FakeAsyncPolicyLoader>(host_task_runner_); policy_loader_ = policy_loader.get(); std::unique_ptr<PolicyWatcher> policy_watcher = PolicyWatcher::CreateFromPolicyLoaderForTesting(std::move(policy_loader));
diff --git a/remoting/host/mouse_cursor_monitor_proxy_unittest.cc b/remoting/host/mouse_cursor_monitor_proxy_unittest.cc index 7de53be..559ab54b 100644 --- a/remoting/host/mouse_cursor_monitor_proxy_unittest.cc +++ b/remoting/host/mouse_cursor_monitor_proxy_unittest.cc
@@ -8,7 +8,6 @@ #include "base/bind.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "base/single_thread_task_runner.h" @@ -126,7 +125,7 @@ capture_thread_.task_runner(), webrtc::DesktopCaptureOptions::CreateDefault())); proxy_->SetMouseCursorMonitorForTests( - base::MakeUnique<ThreadCheckMouseCursorMonitor>( + std::make_unique<ThreadCheckMouseCursorMonitor>( capture_thread_.task_runner())); proxy_->Init(this, webrtc::MouseCursorMonitor::SHAPE_ONLY); proxy_->Capture();
diff --git a/remoting/host/pairing_registry_delegate_linux.cc b/remoting/host/pairing_registry_delegate_linux.cc index 20f543ec..6040c74 100644 --- a/remoting/host/pairing_registry_delegate_linux.cc +++ b/remoting/host/pairing_registry_delegate_linux.cc
@@ -4,6 +4,7 @@ #include "remoting/host/pairing_registry_delegate_linux.h" +#include <memory> #include <utility> #include "base/bind.h" @@ -13,7 +14,6 @@ #include "base/json/json_file_value_serializer.h" #include "base/json/json_string_value_serializer.h" #include "base/location.h" -#include "base/memory/ptr_util.h" #include "base/strings/stringprintf.h" #include "base/values.h" #include "remoting/host/branding.h" @@ -157,7 +157,7 @@ } std::unique_ptr<PairingRegistry::Delegate> CreatePairingRegistryDelegate() { - return base::MakeUnique<PairingRegistryDelegateLinux>(); + return std::make_unique<PairingRegistryDelegateLinux>(); } } // namespace remoting
diff --git a/remoting/host/pairing_registry_delegate_win.cc b/remoting/host/pairing_registry_delegate_win.cc index 4a947063..0f85af0 100644 --- a/remoting/host/pairing_registry_delegate_win.cc +++ b/remoting/host/pairing_registry_delegate_win.cc
@@ -8,7 +8,6 @@ #include "base/json/json_string_value_serializer.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/strings/utf_string_conversions.h" #include "base/values.h" #include "base/win/registry.h" @@ -268,7 +267,7 @@ } std::unique_ptr<PairingRegistry::Delegate> CreatePairingRegistryDelegate() { - return base::MakeUnique<PairingRegistryDelegateWin>(); + return std::make_unique<PairingRegistryDelegateWin>(); } } // namespace remoting
diff --git a/remoting/host/pam_authorization_factory_posix.cc b/remoting/host/pam_authorization_factory_posix.cc index 1e7c2c5..d7b6a253 100644 --- a/remoting/host/pam_authorization_factory_posix.cc +++ b/remoting/host/pam_authorization_factory_posix.cc
@@ -11,7 +11,6 @@ #include "base/bind.h" #include "base/callback.h" #include "base/environment.h" -#include "base/memory/ptr_util.h" #include "remoting/base/logging.h" #include "remoting/host/username.h" #include "remoting/protocol/channel_authenticator.h" @@ -173,7 +172,7 @@ const std::string& remote_jid) { std::unique_ptr<protocol::Authenticator> authenticator( underlying_->CreateAuthenticator(local_jid, remote_jid)); - return base::MakeUnique<PamAuthorizer>(std::move(authenticator)); + return std::make_unique<PamAuthorizer>(std::move(authenticator)); } } // namespace remoting
diff --git a/remoting/host/policy_watcher.cc b/remoting/host/policy_watcher.cc index 1cdeee7..297dcd7 100644 --- a/remoting/host/policy_watcher.cc +++ b/remoting/host/policy_watcher.cc
@@ -163,14 +163,14 @@ } std::unique_ptr<base::DictionaryValue> PolicyWatcher::GetDefaultPolicies() { - auto result = base::MakeUnique<base::DictionaryValue>(); + auto result = std::make_unique<base::DictionaryValue>(); result->SetBoolean(key::kRemoteAccessHostFirewallTraversal, true); result->SetBoolean(key::kRemoteAccessHostRequireCurtain, false); result->SetBoolean(key::kRemoteAccessHostMatchUsername, false); result->Set(key::kRemoteAccessHostClientDomainList, - base::MakeUnique<base::ListValue>()); + std::make_unique<base::ListValue>()); result->Set(key::kRemoteAccessHostDomainList, - base::MakeUnique<base::ListValue>()); + std::make_unique<base::ListValue>()); result->SetString(key::kRemoteAccessHostTalkGadgetPrefix, kDefaultHostTalkGadgetPrefix); result->SetString(key::kRemoteAccessHostTokenUrl, std::string()); @@ -255,7 +255,7 @@ std::string domain; dict->GetString(policy::key::kRemoteAccessHostDomain, &domain); if (!domain.empty()) { - auto list = base::MakeUnique<base::ListValue>(); + auto list = std::make_unique<base::ListValue>(); list->AppendString(domain); dict->Set(policy::key::kRemoteAccessHostDomainList, std::move(list)); } @@ -269,7 +269,7 @@ std::string domain; dict->GetString(policy::key::kRemoteAccessHostClientDomain, &domain); if (!domain.empty()) { - auto list = base::MakeUnique<base::ListValue>(); + auto list = std::make_unique<base::ListValue>(); list->AppendString(domain); dict->Set(policy::key::kRemoteAccessHostClientDomainList, std::move(list));
diff --git a/remoting/host/policy_watcher_unittest.cc b/remoting/host/policy_watcher_unittest.cc index 6c634c7..e4dd7a4 100644 --- a/remoting/host/policy_watcher_unittest.cc +++ b/remoting/host/policy_watcher_unittest.cc
@@ -95,7 +95,7 @@ nat_one_domain_full_.Set(key::kRemoteAccessHostDomainList, host_domain.CreateDeepCopy()); domain_empty_.Set(key::kRemoteAccessHostDomainList, - base::MakeUnique<base::ListValue>()); + std::make_unique<base::ListValue>()); domain_full_.Set(key::kRemoteAccessHostDomainList, host_domain.CreateDeepCopy()); SetDefaults(nat_true_others_default_); @@ -106,14 +106,14 @@ key::kRemoteAccessHostFirewallTraversal, false); SetDefaults(domain_empty_others_default_); domain_empty_others_default_.Set(key::kRemoteAccessHostDomainList, - base::MakeUnique<base::ListValue>()); + std::make_unique<base::ListValue>()); SetDefaults(domain_full_others_default_); domain_full_others_default_.Set(key::kRemoteAccessHostDomainList, host_domain.CreateDeepCopy()); nat_true_domain_empty_.SetBoolean(key::kRemoteAccessHostFirewallTraversal, true); nat_true_domain_empty_.Set(key::kRemoteAccessHostDomainList, - base::MakeUnique<base::ListValue>()); + std::make_unique<base::ListValue>()); nat_true_domain_full_.SetBoolean(key::kRemoteAccessHostFirewallTraversal, true); nat_true_domain_full_.Set(key::kRemoteAccessHostDomainList, @@ -121,7 +121,7 @@ nat_false_domain_empty_.SetBoolean(key::kRemoteAccessHostFirewallTraversal, false); nat_false_domain_empty_.Set(key::kRemoteAccessHostDomainList, - base::MakeUnique<base::ListValue>()); + std::make_unique<base::ListValue>()); nat_false_domain_full_.SetBoolean(key::kRemoteAccessHostFirewallTraversal, false); nat_false_domain_full_.Set(key::kRemoteAccessHostDomainList, @@ -130,7 +130,7 @@ nat_true_domain_empty_others_default_.SetBoolean( key::kRemoteAccessHostFirewallTraversal, true); nat_true_domain_empty_others_default_.Set( - key::kRemoteAccessHostDomainList, base::MakeUnique<base::ListValue>()); + key::kRemoteAccessHostDomainList, std::make_unique<base::ListValue>()); unknown_policies_.SetString("UnknownPolicyOne", std::string()); unknown_policies_.SetString("UnknownPolicyTwo", std::string()); unknown_policies_.SetBoolean("RemoteAccessHostUnknownPolicyThree", true); @@ -308,9 +308,9 @@ dict.SetBoolean(key::kRemoteAccessHostAllowRelayedConnection, true); dict.SetString(key::kRemoteAccessHostUdpPortRange, ""); dict.Set(key::kRemoteAccessHostClientDomainList, - base::MakeUnique<base::ListValue>()); + std::make_unique<base::ListValue>()); dict.Set(key::kRemoteAccessHostDomainList, - base::MakeUnique<base::ListValue>()); + std::make_unique<base::ListValue>()); dict.SetBoolean(key::kRemoteAccessHostMatchUsername, false); dict.SetString(key::kRemoteAccessHostTalkGadgetPrefix, kDefaultHostTalkGadgetPrefix);
diff --git a/remoting/host/register_support_host_request.cc b/remoting/host/register_support_host_request.cc index 33fb560..9016678 100644 --- a/remoting/host/register_support_host_request.cc +++ b/remoting/host/register_support_host_request.cc
@@ -106,10 +106,10 @@ std::unique_ptr<XmlElement> RegisterSupportHostRequest::CreateRegistrationRequest(const std::string& jid) { - auto query = base::MakeUnique<XmlElement>( + auto query = std::make_unique<XmlElement>( QName(kChromotingXmlNamespace, kRegisterQueryTag)); - auto public_key = base::MakeUnique<XmlElement>( + auto public_key = std::make_unique<XmlElement>( QName(kChromotingXmlNamespace, kPublicKeyTag)); public_key->AddText(key_pair_->GetPublicKey()); query->AddElement(public_key.release()); @@ -117,19 +117,19 @@ query->AddElement(CreateSignature(jid).release()); // Add host version. - auto host_version = base::MakeUnique<XmlElement>( + auto host_version = std::make_unique<XmlElement>( QName(kChromotingXmlNamespace, kHostVersionTag)); host_version->AddText(STRINGIZE(VERSION)); query->AddElement(host_version.release()); // Add host os name. - auto host_os_name = base::MakeUnique<XmlElement>( + auto host_os_name = std::make_unique<XmlElement>( QName(kChromotingXmlNamespace, kHostOsNameTag)); host_os_name->AddText(GetHostOperatingSystemName()); query->AddElement(host_os_name.release()); // Add host os version. - auto host_os_version = base::MakeUnique<XmlElement>( + auto host_os_version = std::make_unique<XmlElement>( QName(kChromotingXmlNamespace, kHostOsVersionTag)); host_os_version->AddText(GetHostOperatingSystemVersion()); query->AddElement(host_os_version.release());
diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc index 0f6d662..bb7e663 100644 --- a/remoting/host/remoting_me2me_host.cc +++ b/remoting/host/remoting_me2me_host.cc
@@ -19,7 +19,6 @@ #include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "base/single_thread_task_runner.h" @@ -493,7 +492,7 @@ // Mojo keeps the task runner passed to it alive forever, so an // AutoThreadTaskRunner should not be passed to it. Otherwise, the process may // never shut down cleanly. - ipc_support_ = base::MakeUnique<mojo::edk::ScopedIPCSupport>( + ipc_support_ = std::make_unique<mojo::edk::ScopedIPCSupport>( context_->network_task_runner()->task_runner(), mojo::edk::ScopedIPCSupport::ShutdownPolicy::FAST); @@ -1513,8 +1512,8 @@ scoped_refptr<protocol::TransportContext> transport_context = new protocol::TransportContext( signal_strategy_.get(), - base::MakeUnique<protocol::ChromiumPortAllocatorFactory>(), - base::MakeUnique<ChromiumUrlRequestFactory>( + std::make_unique<protocol::ChromiumPortAllocatorFactory>(), + std::make_unique<ChromiumUrlRequestFactory>( context_->url_request_context_getter()), network_settings, protocol::TransportRole::SERVER); transport_context->set_ice_config_url( @@ -1541,10 +1540,10 @@ if (security_key_auth_policy_enabled_ && security_key_extension_supported_) { host_->AddExtension( - base::MakeUnique<SecurityKeyExtension>(context_->file_task_runner())); + std::make_unique<SecurityKeyExtension>(context_->file_task_runner())); } - host_->AddExtension(base::MakeUnique<TestEchoExtension>()); + host_->AddExtension(std::make_unique<TestEchoExtension>()); // TODO(simonmorris): Get the maximum session duration from a policy. #if defined(OS_LINUX)
diff --git a/remoting/host/resizing_host_observer_unittest.cc b/remoting/host/resizing_host_observer_unittest.cc index b9a61616c..171251a 100644 --- a/remoting/host/resizing_host_observer_unittest.cc +++ b/remoting/host/resizing_host_observer_unittest.cc
@@ -10,7 +10,6 @@ #include "base/compiler_specific.h" #include "base/logging.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/memory/ref_counted.h" #include "base/message_loop/message_loop.h" #include "base/run_loop.h" @@ -115,12 +114,10 @@ bool restore_resolution) { current_resolution_ = initial_resolution; call_counts_ = FakeDesktopResizer::CallCounts(); - resizing_host_observer_ = base::MakeUnique<ResizingHostObserver>( - base::MakeUnique<FakeDesktopResizer>(exact_size_supported, - std::move(supported_resolutions), - ¤t_resolution_, - &call_counts_, - restore_resolution), + resizing_host_observer_ = std::make_unique<ResizingHostObserver>( + std::make_unique<FakeDesktopResizer>( + exact_size_supported, std::move(supported_resolutions), + ¤t_resolution_, &call_counts_, restore_resolution), restore_resolution); resizing_host_observer_->SetNowFunctionForTesting( base::Bind(&ResizingHostObserverTest::GetTimeAndIncrement,
diff --git a/remoting/host/security_key/fake_security_key_ipc_client.cc b/remoting/host/security_key/fake_security_key_ipc_client.cc index c09e727..a6871ebb 100644 --- a/remoting/host/security_key/fake_security_key_ipc_client.cc +++ b/remoting/host/security_key/fake_security_key_ipc_client.cc
@@ -72,7 +72,7 @@ if (!handle.is_valid()) { return false; } - peer_connection_ = base::MakeUnique<mojo::edk::PeerConnection>(); + peer_connection_ = std::make_unique<mojo::edk::PeerConnection>(); client_channel_ = IPC::Channel::CreateClient( peer_connection_ ->Connect(mojo::edk::ConnectionParams(
diff --git a/remoting/host/security_key/fake_security_key_ipc_server.cc b/remoting/host/security_key/fake_security_key_ipc_server.cc index 4d2ccbe..9fcc6e9a 100644 --- a/remoting/host/security_key/fake_security_key_ipc_server.cc +++ b/remoting/host/security_key/fake_security_key_ipc_server.cc
@@ -10,7 +10,6 @@ #include "base/callback.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "ipc/ipc_channel.h" #include "ipc/ipc_message.h" #include "ipc/ipc_message_macros.h" @@ -76,7 +75,7 @@ #if defined(OS_WIN) options.enforce_uniqueness = false; #endif - peer_connection_ = base::MakeUnique<mojo::edk::PeerConnection>(); + peer_connection_ = std::make_unique<mojo::edk::PeerConnection>(); ipc_channel_ = IPC::Channel::CreateServer( peer_connection_ ->Connect(mojo::edk::ConnectionParams( @@ -129,7 +128,7 @@ const SecurityKeyAuthHandler::SendMessageCallback& send_message_callback, const base::Closure& connect_callback, const base::Closure& done_callback) { - auto fake_ipc_server = base::MakeUnique<FakeSecurityKeyIpcServer>( + auto fake_ipc_server = std::make_unique<FakeSecurityKeyIpcServer>( connection_id, client_session_details, initial_connect_timeout, send_message_callback, connect_callback, done_callback);
diff --git a/remoting/host/security_key/security_key_extension_session.cc b/remoting/host/security_key/security_key_extension_session.cc index bdaa7b8..fd46d399 100644 --- a/remoting/host/security_key/security_key_extension_session.cc +++ b/remoting/host/security_key/security_key_extension_session.cc
@@ -11,7 +11,6 @@ #include "base/json/json_writer.h" #include "base/logging.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/single_thread_task_runner.h" #include "base/values.h" #include "remoting/base/logging.h" @@ -190,7 +189,7 @@ request.SetString(kMessageType, kDataMessage); request.SetInteger(kConnectionId, connection_id); - auto bytes = base::MakeUnique<base::ListValue>(); + auto bytes = std::make_unique<base::ListValue>(); for (std::string::const_iterator i = data.begin(); i != data.end(); ++i) { bytes->AppendInteger(static_cast<unsigned char>(*i)); }
diff --git a/remoting/host/security_key/security_key_ipc_server_impl.cc b/remoting/host/security_key/security_key_ipc_server_impl.cc index b1745dac..69d79c9 100644 --- a/remoting/host/security_key/security_key_ipc_server_impl.cc +++ b/remoting/host/security_key/security_key_ipc_server_impl.cc
@@ -91,7 +91,7 @@ "O:%sG:%sD:(A;;GA;;;AU)", user_sid_utf8.c_str(), user_sid_utf8.c_str())); #endif // defined(OS_WIN) - peer_connection_ = base::MakeUnique<mojo::edk::PeerConnection>(); + peer_connection_ = std::make_unique<mojo::edk::PeerConnection>(); ipc_channel_ = IPC::Channel::CreateServer( peer_connection_ ->Connect(mojo::edk::ConnectionParams(
diff --git a/remoting/host/setup/host_starter.cc b/remoting/host/setup/host_starter.cc index 7b76356..2b33db7 100644 --- a/remoting/host/setup/host_starter.cc +++ b/remoting/host/setup/host_starter.cc
@@ -4,6 +4,7 @@ #include "remoting/host/setup/host_starter.h" +#include <memory> #include <utility> #include "base/bind.h" @@ -43,8 +44,8 @@ const std::string& chromoting_hosts_url, net::URLRequestContextGetter* url_request_context_getter) { return base::WrapUnique(new HostStarter( - base::MakeUnique<gaia::GaiaOAuthClient>(url_request_context_getter), - base::MakeUnique<remoting::ServiceClient>(chromoting_hosts_url, + std::make_unique<gaia::GaiaOAuthClient>(url_request_context_getter), + std::make_unique<remoting::ServiceClient>(chromoting_hosts_url, url_request_context_getter), remoting::DaemonController::Create())); }
diff --git a/remoting/host/setup/me2me_native_messaging_host.cc b/remoting/host/setup/me2me_native_messaging_host.cc index 664b8f1..2438f37 100644 --- a/remoting/host/setup/me2me_native_messaging_host.cc +++ b/remoting/host/setup/me2me_native_messaging_host.cc
@@ -16,7 +16,6 @@ #include "base/json/json_writer.h" #include "base/logging.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/single_thread_task_runner.h" #include "base/strings/stringize_macros.h" #include "base/time/time.h" @@ -96,7 +95,7 @@ void Me2MeNativeMessagingHost::OnMessage(const std::string& message) { DCHECK(task_runner()->BelongsToCurrentThread()); - auto response = base::MakeUnique<base::DictionaryValue>(); + auto response = std::make_unique<base::DictionaryValue>(); std::unique_ptr<base::Value> message_value = base::JSONReader::Read(message); if (!message_value->is_dict()) { OnError("Received a message that's not a dictionary."); @@ -458,7 +457,7 @@ if (config) { response->Set("config", std::move(config)); } else { - response->Set("config", base::MakeUnique<base::Value>()); + response->Set("config", std::make_unique<base::Value>()); } SendMessageToClient(std::move(response)); }
diff --git a/remoting/host/setup/me2me_native_messaging_host_unittest.cc b/remoting/host/setup/me2me_native_messaging_host_unittest.cc index 69b33c4..5c2007a 100644 --- a/remoting/host/setup/me2me_native_messaging_host_unittest.cc +++ b/remoting/host/setup/me2me_native_messaging_host_unittest.cc
@@ -198,7 +198,7 @@ std::unique_ptr<base::DictionaryValue> MockDaemonControllerDelegate::GetConfig() { - return base::MakeUnique<base::DictionaryValue>(); + return std::make_unique<base::DictionaryValue>(); } void MockDaemonControllerDelegate::SetConfigAndStart(
diff --git a/remoting/host/test_echo_extension.cc b/remoting/host/test_echo_extension.cc index 1fd2e23..2fff7c01 100644 --- a/remoting/host/test_echo_extension.cc +++ b/remoting/host/test_echo_extension.cc
@@ -4,7 +4,8 @@ #include "remoting/host/test_echo_extension.h" -#include "base/memory/ptr_util.h" +#include <memory> + #include "remoting/host/test_echo_extension_session.h" namespace { @@ -24,7 +25,7 @@ std::unique_ptr<HostExtensionSession> TestEchoExtension::CreateExtensionSession( ClientSessionDetails* details, protocol::ClientStub* client_stub) { - return base::MakeUnique<TestEchoExtensionSession>(); + return std::make_unique<TestEchoExtensionSession>(); } } // namespace remoting
diff --git a/remoting/host/token_validator_base_unittest.cc b/remoting/host/token_validator_base_unittest.cc index 0b719709..cb2f23b7 100644 --- a/remoting/host/token_validator_base_unittest.cc +++ b/remoting/host/token_validator_base_unittest.cc
@@ -7,7 +7,6 @@ #include <vector> #include "base/atomic_sequence_num.h" -#include "base/memory/ptr_util.h" #include "crypto/rsa_private_key.h" #include "net/cert/x509_util.h" #include "net/ssl/client_cert_identity_test_util.h" @@ -41,7 +40,7 @@ if (!ssl_private_key) return nullptr; - return base::MakeUnique<net::FakeClientCertIdentity>(cert, ssl_private_key); + return std::make_unique<net::FakeClientCertIdentity>(cert, ssl_private_key); } } // namespace
diff --git a/remoting/host/token_validator_factory_impl.cc b/remoting/host/token_validator_factory_impl.cc index 6e322504..6d2a066d 100644 --- a/remoting/host/token_validator_factory_impl.cc +++ b/remoting/host/token_validator_factory_impl.cc
@@ -6,6 +6,7 @@ #include <stddef.h> +#include <memory> #include <utility> #include "base/base64.h" @@ -14,7 +15,6 @@ #include "base/json/json_reader.h" #include "base/logging.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/single_thread_task_runner.h" #include "base/strings/string_util.h" #include "base/strings/stringize_macros.h" @@ -140,7 +140,7 @@ std::unique_ptr<protocol::TokenValidator> TokenValidatorFactoryImpl::CreateTokenValidator(const std::string& local_jid, const std::string& remote_jid) { - return base::MakeUnique<TokenValidatorImpl>(third_party_auth_config_, + return std::make_unique<TokenValidatorImpl>(third_party_auth_config_, key_pair_, local_jid, remote_jid, request_context_getter_); }
diff --git a/remoting/host/token_validator_factory_impl_unittest.cc b/remoting/host/token_validator_factory_impl_unittest.cc index e88631e..d61697ad 100644 --- a/remoting/host/token_validator_factory_impl_unittest.cc +++ b/remoting/host/token_validator_factory_impl_unittest.cc
@@ -10,7 +10,6 @@ #include <string> #include "base/json/json_writer.h" -#include "base/memory/ptr_util.h" #include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "base/values.h" @@ -89,19 +88,19 @@ public: void SetResponse(const std::string& headers, const std::string& response) { std::unique_ptr<net::URLRequestJobFactoryImpl> factory = - base::MakeUnique<net::URLRequestJobFactoryImpl>(); + std::make_unique<net::URLRequestJobFactoryImpl>(); factory->SetProtocolHandler( - "https", base::MakeUnique<FakeProtocolHandler>(headers, response)); + "https", std::make_unique<FakeProtocolHandler>(headers, response)); context_storage_.set_job_factory(std::move(factory)); } void SetErrorResponse(net::URLRequestFailedJob::FailurePhase failure_phase, net::Error net_error) { std::unique_ptr<net::URLRequestJobFactoryImpl> factory = - base::MakeUnique<net::URLRequestJobFactoryImpl>(); + std::make_unique<net::URLRequestJobFactoryImpl>(); factory->SetProtocolHandler( "https", - base::MakeUnique<FakeFailingProtocolHandler>(failure_phase, net_error)); + std::make_unique<FakeFailingProtocolHandler>(failure_phase, net_error)); context_storage_.set_job_factory(std::move(factory)); } }; @@ -135,7 +134,7 @@ key_pair_ = RsaKeyPair::FromString(kTestRsaKeyPair); request_context_getter_ = new net::TestURLRequestContextGetter( message_loop_.task_runner(), - base::MakeUnique<SetResponseURLRequestContext>()); + std::make_unique<SetResponseURLRequestContext>()); ThirdPartyAuthConfig config; config.token_url = GURL(kTokenUrl); config.token_validation_url = GURL(kTokenValidationUrl);
diff --git a/remoting/host/win/session_desktop_environment.cc b/remoting/host/win/session_desktop_environment.cc index 631b995..fbbad7de 100644 --- a/remoting/host/win/session_desktop_environment.cc +++ b/remoting/host/win/session_desktop_environment.cc
@@ -4,10 +4,10 @@ #include "remoting/host/win/session_desktop_environment.h" +#include <memory> #include <utility> #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/single_thread_task_runner.h" #include "remoting/host/audio_capturer.h" #include "remoting/host/input_injector.h" @@ -23,7 +23,7 @@ SessionDesktopEnvironment::CreateInputInjector() { DCHECK(caller_task_runner()->BelongsToCurrentThread()); - return base::MakeUnique<SessionInputInjectorWin>( + return std::make_unique<SessionInputInjectorWin>( input_task_runner(), InputInjector::Create(input_task_runner(), ui_task_runner(), system_input_injector_factory()),
diff --git a/remoting/host/win/wts_session_process_delegate.cc b/remoting/host/win/wts_session_process_delegate.cc index 86ed55c..c168497b 100644 --- a/remoting/host/win/wts_session_process_delegate.cc +++ b/remoting/host/win/wts_session_process_delegate.cc
@@ -15,7 +15,6 @@ #include "base/files/file_path.h" #include "base/logging.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/message_loop/message_loop.h" #include "base/process/process_handle.h" #include "base/single_thread_task_runner.h" @@ -393,7 +392,7 @@ std::string mojo_pipe_token = mojo::edk::GenerateRandomToken(); broker_client_invitation_ = - base::MakeUnique<mojo::edk::OutgoingBrokerClientInvitation>(); + std::make_unique<mojo::edk::OutgoingBrokerClientInvitation>(); std::unique_ptr<IPC::ChannelProxy> channel = IPC::ChannelProxy::Create( broker_client_invitation_->AttachMessagePipe(mojo_pipe_token).release(), IPC::Channel::MODE_SERVER, this, io_task_runner_, @@ -408,11 +407,11 @@ mojo::edk::NamedPlatformChannelPair::Options options; options.security_descriptor = base::UTF8ToUTF16(channel_security_); elevated_mojo_channel = - base::MakeUnique<mojo::edk::NamedPlatformChannelPair>(options); + std::make_unique<mojo::edk::NamedPlatformChannelPair>(options); elevated_mojo_channel->PrepareToPassClientHandleToChildProcess( &command_line); } else { - normal_mojo_channel = base::MakeUnique<mojo::edk::PlatformChannelPair>(); + normal_mojo_channel = std::make_unique<mojo::edk::PlatformChannelPair>(); normal_mojo_channel->PrepareToPassClientHandleToChildProcess( &command_line, &handles_to_inherit); }
diff --git a/remoting/ios/audio/audio_player_ios.mm b/remoting/ios/audio/audio_player_ios.mm index 48ec425..db437f7 100644 --- a/remoting/ios/audio/audio_player_ios.mm +++ b/remoting/ios/audio/audio_player_ios.mm
@@ -29,7 +29,7 @@ AudioStreamConsumerProxy::Create(audio_thread_runner, buffer->AudioStreamConsumerAsWeakPtr()); - return base::MakeUnique<AudioPlayerIos>( + return std::make_unique<AudioPlayerIos>( std::move(consumer_proxy), std::move(supplier), audio_thread_runner); }
diff --git a/remoting/ios/display/gl_display_handler.mm b/remoting/ios/display/gl_display_handler.mm index 851bbf50..16ba05e3 100644 --- a/remoting/ios/display/gl_display_handler.mm +++ b/remoting/ios/display/gl_display_handler.mm
@@ -7,6 +7,7 @@ #endif #include <array> +#include <memory> #import "remoting/ios/display/gl_display_handler.h" @@ -17,7 +18,6 @@ #include "base/bind.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/memory/weak_ptr.h" #include "remoting/client/chromoting_client_runtime.h" #include "remoting/client/cursor_shape_stub_proxy.h" @@ -206,7 +206,7 @@ })); renderer_->OnSurfaceCreated( - base::MakeUnique<GlCanvas>(static_cast<int>([eagl_context_ API]))); + std::make_unique<GlCanvas>(static_cast<int>([eagl_context_ API]))); renderer_->RequestCanvasSize(); @@ -261,12 +261,12 @@ } - (std::unique_ptr<remoting::protocol::VideoRenderer>)CreateVideoRenderer { - return base::MakeUnique<remoting::SoftwareVideoRenderer>( + return std::make_unique<remoting::SoftwareVideoRenderer>( _core->GrabFrameConsumer()); } - (std::unique_ptr<remoting::protocol::CursorShapeStub>)CreateCursorShapeStub { - return base::MakeUnique<remoting::CursorShapeStubProxy>( + return std::make_unique<remoting::CursorShapeStubProxy>( _core->GetWeakPtr(), _runtime->display_task_runner()); }
diff --git a/remoting/protocol/audio_pump.cc b/remoting/protocol/audio_pump.cc index 525ea24..eaaabc6 100644 --- a/remoting/protocol/audio_pump.cc +++ b/remoting/protocol/audio_pump.cc
@@ -11,7 +11,6 @@ #include "base/location.h" #include "base/logging.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/single_thread_task_runner.h" #include "base/threading/thread_task_runner_handle.h" #include "media/base/audio_bus.h" @@ -43,7 +42,7 @@ std::unique_ptr<remoting::AudioPacket> AudioBusToAudioPacket( const media::AudioBus& packet) { std::unique_ptr<remoting::AudioPacket> result = - base::MakeUnique<remoting::AudioPacket>(); + std::make_unique<remoting::AudioPacket>(); result->add_data()->resize( packet.channels() * packet.frames() * sizeof(int16_t)); packet.ToInterleaved<media::SignedInt16SampleTypeTraits>( @@ -208,7 +207,7 @@ if (!mixer_ || mixer_input_layout_ != input_layout) { mixer_input_layout_ = input_layout; - mixer_ = base::MakeUnique<media::ChannelMixer>( + mixer_ = std::make_unique<media::ChannelMixer>( input_layout, media::CHANNEL_LAYOUT_STEREO); }
diff --git a/remoting/protocol/authenticator.cc b/remoting/protocol/authenticator.cc index f8c1285..d181a964 100644 --- a/remoting/protocol/authenticator.cc +++ b/remoting/protocol/authenticator.cc
@@ -4,7 +4,6 @@ #include "remoting/protocol/authenticator.h" -#include "base/memory/ptr_util.h" #include "remoting/base/constants.h" #include "third_party/libjingle_xmpp/xmllite/xmlelement.h" @@ -24,7 +23,7 @@ // static std::unique_ptr<buzz::XmlElement> Authenticator::CreateEmptyAuthenticatorMessage() { - return base::MakeUnique<buzz::XmlElement>(kAuthenticationQName); + return std::make_unique<buzz::XmlElement>(kAuthenticationQName); } // static
diff --git a/remoting/protocol/channel_multiplexer.cc b/remoting/protocol/channel_multiplexer.cc index f766da5..87c805d 100644 --- a/remoting/protocol/channel_multiplexer.cc +++ b/remoting/protocol/channel_multiplexer.cc
@@ -14,7 +14,6 @@ #include "base/callback_helpers.h" #include "base/location.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/sequence_checker.h" #include "base/single_thread_task_runner.h" #include "base/threading/thread_task_runner_handle.h" @@ -164,7 +163,7 @@ DCHECK_EQ(packet->channel_id(), receive_id_); if (packet->data().size() > 0) { pending_packets_.push_back( - base::MakeUnique<PendingPacket>(std::move(packet))); + std::make_unique<PendingPacket>(std::move(packet))); if (socket_) { // Notify the socket that we have more data. socket_->OnPacketReceived(); @@ -403,7 +402,7 @@ std::unique_ptr<MuxChannel>& channel = channels_[name]; if (!channel) { // Create a new channel if we haven't found existing one. - channel = base::MakeUnique<MuxChannel>(this, name, next_channel_id_); + channel = std::make_unique<MuxChannel>(this, name, next_channel_id_); ++next_channel_id_; }
diff --git a/remoting/protocol/chromium_port_allocator_factory.cc b/remoting/protocol/chromium_port_allocator_factory.cc index 8ac1a09..337e67f 100644 --- a/remoting/protocol/chromium_port_allocator_factory.cc +++ b/remoting/protocol/chromium_port_allocator_factory.cc
@@ -18,7 +18,7 @@ std::unique_ptr<cricket::PortAllocator> ChromiumPortAllocatorFactory::CreatePortAllocator( scoped_refptr<TransportContext> transport_context) { - return base::MakeUnique<PortAllocator>( + return std::make_unique<PortAllocator>( base::WrapUnique(new rtc::BasicNetworkManager()), base::WrapUnique(new ChromiumPacketSocketFactory()), transport_context); }
diff --git a/remoting/protocol/connection_unittest.cc b/remoting/protocol/connection_unittest.cc index 0795b2f..718394a 100644 --- a/remoting/protocol/connection_unittest.cc +++ b/remoting/protocol/connection_unittest.cc
@@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <memory> #include <utility> #include "base/bind.h" @@ -531,7 +532,7 @@ std::unique_ptr<VideoStream> video_stream = host_connection_->StartVideoStream( - base::MakeUnique<TestScreenCapturer>()); + std::make_unique<TestScreenCapturer>()); // Receive 5 frames. for (int i = 0; i < 5; ++i) { @@ -593,7 +594,7 @@ std::unique_ptr<VideoStream> video_stream = host_connection_->StartVideoStream( - base::MakeUnique<TestScreenCapturer>()); + std::make_unique<TestScreenCapturer>()); video_stream->SetEventTimestampsSource(input_event_timestamps_source); WaitNextVideoFrame(); @@ -632,7 +633,7 @@ Connect(); std::unique_ptr<AudioStream> audio_stream = - host_connection_->StartAudioStream(base::MakeUnique<TestAudioSource>()); + host_connection_->StartAudioStream(std::make_unique<TestAudioSource>()); // Wait for 1 second worth of audio samples. client_audio_player_.WaitForSamples(kAudioSampleRate * 2); @@ -642,7 +643,7 @@ TEST_P(ConnectionTest, FirstCaptureFailed) { Connect(); - auto capturer = base::MakeUnique<TestScreenCapturer>(); + auto capturer = std::make_unique<TestScreenCapturer>(); capturer->FailNthFrame(0); auto video_stream = host_connection_->StartVideoStream(std::move(capturer)); @@ -652,7 +653,7 @@ TEST_P(ConnectionTest, SecondCaptureFailed) { Connect(); - auto capturer = base::MakeUnique<TestScreenCapturer>(); + auto capturer = std::make_unique<TestScreenCapturer>(); capturer->FailNthFrame(1); auto video_stream = host_connection_->StartVideoStream(std::move(capturer));
diff --git a/remoting/protocol/data_channel_manager_unittest.cc b/remoting/protocol/data_channel_manager_unittest.cc index 70e594c2..2e73b8dc 100644 --- a/remoting/protocol/data_channel_manager_unittest.cc +++ b/remoting/protocol/data_channel_manager_unittest.cc
@@ -8,7 +8,6 @@ #include <utility> #include "base/bind.h" -#include "base/memory/ptr_util.h" #include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "remoting/base/compound_buffer.h" @@ -169,12 +168,12 @@ { std::string content; - auto message = base::MakeUnique<CompoundBuffer>(); + auto message = std::make_unique<CompoundBuffer>(); content = "FullMatchContent"; message->AppendCopyOf(&(content[0]), content.size()); pipe1.Receive(std::move(message)); - message = base::MakeUnique<CompoundBuffer>(); + message = std::make_unique<CompoundBuffer>(); content = "AnotherFullMatchContent"; message->AppendCopyOf(&(content[0]), content.size()); pipe2.Receive(std::move(message));
diff --git a/remoting/protocol/fake_authenticator.cc b/remoting/protocol/fake_authenticator.cc index 663cd50..ccf7f11 100644 --- a/remoting/protocol/fake_authenticator.cc +++ b/remoting/protocol/fake_authenticator.cc
@@ -4,11 +4,11 @@ #include "remoting/protocol/fake_authenticator.h" +#include <memory> #include <utility> #include "base/base64.h" #include "base/callback_helpers.h" -#include "base/memory/ptr_util.h" #include "base/message_loop/message_loop.h" #include "base/rand_util.h" #include "base/strings/string_number_conversions.h" @@ -228,7 +228,7 @@ std::unique_ptr<ChannelAuthenticator> FakeAuthenticator::CreateChannelAuthenticator() const { EXPECT_EQ(ACCEPTED, state()); - return base::MakeUnique<FakeChannelAuthenticator>( + return std::make_unique<FakeChannelAuthenticator>( config_.action != REJECT_CHANNEL, config_.async); }
diff --git a/remoting/protocol/fake_message_pipe.cc b/remoting/protocol/fake_message_pipe.cc index 421b7f5..3537235 100644 --- a/remoting/protocol/fake_message_pipe.cc +++ b/remoting/protocol/fake_message_pipe.cc
@@ -6,7 +6,6 @@ #include "base/bind.h" #include "base/location.h" -#include "base/memory/ptr_util.h" #include "base/threading/thread_task_runner_handle.h" #include "remoting/base/compound_buffer.h" #include "remoting/protocol/fake_message_pipe_wrapper.h" @@ -22,7 +21,7 @@ FakeMessagePipe::~FakeMessagePipe() = default; std::unique_ptr<FakeMessagePipeWrapper> FakeMessagePipe::Wrap() { - return base::MakeUnique<FakeMessagePipeWrapper>(this); + return std::make_unique<FakeMessagePipeWrapper>(this); } void FakeMessagePipe::Start(EventHandler* event_handler) {
diff --git a/remoting/protocol/fake_session.cc b/remoting/protocol/fake_session.cc index ed4d537..db28598a 100644 --- a/remoting/protocol/fake_session.cc +++ b/remoting/protocol/fake_session.cc
@@ -6,7 +6,6 @@ #include "base/location.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/threading/thread_task_runner_handle.h" #include "remoting/protocol/fake_authenticator.h" #include "remoting/protocol/session_plugin.h" @@ -116,7 +115,7 @@ if (message) { JingleMessage jingle_message; jingle_message.AddAttachment( - base::MakeUnique<buzz::XmlElement>(*message)); + std::make_unique<buzz::XmlElement>(*message)); plugin->OnIncomingMessage(*(jingle_message.attachments)); } }
diff --git a/remoting/protocol/fake_video_renderer.cc b/remoting/protocol/fake_video_renderer.cc index de144735..2b47559d 100644 --- a/remoting/protocol/fake_video_renderer.cc +++ b/remoting/protocol/fake_video_renderer.cc
@@ -8,7 +8,6 @@ #include "base/callback.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "remoting/proto/video.pb.h" #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" @@ -45,7 +44,7 @@ std::unique_ptr<webrtc::DesktopFrame> FakeFrameConsumer::AllocateFrame( const webrtc::DesktopSize& size) { CHECK(thread_checker_.CalledOnValidThread()); - return base::MakeUnique<webrtc::BasicDesktopFrame>(size); + return std::make_unique<webrtc::BasicDesktopFrame>(size); } void FakeFrameConsumer::DrawFrame(std::unique_ptr<webrtc::DesktopFrame> frame,
diff --git a/remoting/protocol/http_ice_config_request_unittest.cc b/remoting/protocol/http_ice_config_request_unittest.cc index 598e646..165a3c3 100644 --- a/remoting/protocol/http_ice_config_request_unittest.cc +++ b/remoting/protocol/http_ice_config_request_unittest.cc
@@ -6,7 +6,6 @@ #include "base/bind.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "net/traffic_annotation/network_traffic_annotation_test_helper.h" @@ -89,7 +88,7 @@ const net::NetworkTrafficAnnotationTag& traffic_annotation) override { EXPECT_EQ(UrlRequest::Type::GET, type); EXPECT_TRUE(results_.count(url)); - return base::MakeUnique<FakeUrlRequest>(results_[url], expect_oauth_token_); + return std::make_unique<FakeUrlRequest>(results_[url], expect_oauth_token_); } private: @@ -105,7 +104,7 @@ class HttpIceConfigRequestTest : public testing::Test { public: void OnResult(const IceConfig& config) { - received_config_ = base::MakeUnique<IceConfig>(config); + received_config_ = std::make_unique<IceConfig>(config); } protected: @@ -156,7 +155,7 @@ FakeOAuthTokenGetter token_getter(OAuthTokenGetter::SUCCESS, "user@example.com", kTestOAuthToken); - request_ = base::MakeUnique<HttpIceConfigRequest>(&url_request_factory_, + request_ = std::make_unique<HttpIceConfigRequest>(&url_request_factory_, kTestUrl, &token_getter); request_->Send( base::Bind(&HttpIceConfigRequestTest::OnResult, base::Unretained(this)));
diff --git a/remoting/protocol/ice_transport_unittest.cc b/remoting/protocol/ice_transport_unittest.cc index ed36466..341af96 100644 --- a/remoting/protocol/ice_transport_unittest.cc +++ b/remoting/protocol/ice_transport_unittest.cc
@@ -4,12 +4,12 @@ #include "remoting/protocol/ice_transport.h" +#include <memory> #include <utility> #include "base/bind.h" #include "base/location.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "base/single_thread_task_runner.h" @@ -115,7 +115,7 @@ host_transport_.reset(new IceTransport( new TransportContext(nullptr, - base::MakeUnique<ChromiumPortAllocatorFactory>(), + std::make_unique<ChromiumPortAllocatorFactory>(), nullptr, network_settings_, TransportRole::SERVER), &host_event_handler_)); if (!host_authenticator_) { @@ -125,7 +125,7 @@ client_transport_.reset(new IceTransport( new TransportContext(nullptr, - base::MakeUnique<ChromiumPortAllocatorFactory>(), + std::make_unique<ChromiumPortAllocatorFactory>(), nullptr, network_settings_, TransportRole::CLIENT), &client_event_handler_)); if (!client_authenticator_) {
diff --git a/remoting/protocol/it2me_host_authenticator_factory.cc b/remoting/protocol/it2me_host_authenticator_factory.cc index 7d6bf92..e99e908 100644 --- a/remoting/protocol/it2me_host_authenticator_factory.cc +++ b/remoting/protocol/it2me_host_authenticator_factory.cc
@@ -9,7 +9,6 @@ #include <utility> #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "remoting/base/rsa_key_pair.h" #include "remoting/protocol/negotiating_host_authenticator.h" #include "remoting/protocol/validating_authenticator.h" @@ -38,7 +37,7 @@ local_jid, remote_jid, local_cert_, key_pair_, access_code_hash_, nullptr)); - return base::MakeUnique<ValidatingAuthenticator>( + return std::make_unique<ValidatingAuthenticator>( remote_jid, validation_callback_, std::move(authenticator)); }
diff --git a/remoting/protocol/jingle_session_unittest.cc b/remoting/protocol/jingle_session_unittest.cc index d08c046..59659c3 100644 --- a/remoting/protocol/jingle_session_unittest.cc +++ b/remoting/protocol/jingle_session_unittest.cc
@@ -4,6 +4,7 @@ #include "remoting/protocol/jingle_session.h" +#include <memory> #include <utility> #include <vector> @@ -94,7 +95,7 @@ bool ProcessTransportInfo(buzz::XmlElement* transport_info) override { received_messages_.push_back( - base::MakeUnique<buzz::XmlElement>(*transport_info)); + std::make_unique<buzz::XmlElement>(*transport_info)); if (!on_message_callback_.is_null()) on_message_callback_.Run(); return true; @@ -188,9 +189,9 @@ void CreateSessionManagers(FakeAuthenticator::Config auth_config, int messages_till_start) { host_signal_strategy_ = - base::MakeUnique<FakeSignalStrategy>(SignalingAddress(kHostJid)); + std::make_unique<FakeSignalStrategy>(SignalingAddress(kHostJid)); client_signal_strategy_ = - base::MakeUnique<FakeSignalStrategy>(SignalingAddress(kClientJid)); + std::make_unique<FakeSignalStrategy>(SignalingAddress(kClientJid)); FakeSignalStrategy::Connect(host_signal_strategy_.get(), client_signal_strategy_.get()); @@ -284,7 +285,7 @@ } void ConnectClient(FakeAuthenticator::Config auth_config) { - ConnectClient(base::MakeUnique<FakeAuthenticator>( + ConnectClient(std::make_unique<FakeAuthenticator>( FakeAuthenticator::CLIENT, auth_config, client_signal_strategy_->GetLocalAddress().id(), kNormalizedHostJid)); } @@ -623,7 +624,7 @@ CreateSessionManagers(auth_config); client_session_ = client_server_->Connect( SignalingAddress(kNormalizedHostJid), - base::MakeUnique<FakeAuthenticator>( + std::make_unique<FakeAuthenticator>( FakeAuthenticator::CLIENT, auth_config, client_signal_strategy_->GetLocalAddress().id(), kNormalizedHostJid));
diff --git a/remoting/protocol/me2me_host_authenticator_factory.cc b/remoting/protocol/me2me_host_authenticator_factory.cc index f82e8e7..4e140f3d 100644 --- a/remoting/protocol/me2me_host_authenticator_factory.cc +++ b/remoting/protocol/me2me_host_authenticator_factory.cc
@@ -118,7 +118,7 @@ if (!matched) { LOG(ERROR) << "Rejecting incoming connection from " << remote_jid << ": Domain not allowed."; - return base::MakeUnique<RejectingAuthenticator>( + return std::make_unique<RejectingAuthenticator>( Authenticator::INVALID_ACCOUNT); } }
diff --git a/remoting/protocol/message_decoder_unittest.cc b/remoting/protocol/message_decoder_unittest.cc index 603d8d6..d4671f5 100644 --- a/remoting/protocol/message_decoder_unittest.cc +++ b/remoting/protocol/message_decoder_unittest.cc
@@ -11,7 +11,6 @@ #include <string> #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/strings/string_number_conversions.h" #include "remoting/proto/event.pb.h" #include "remoting/proto/internal.pb.h" @@ -81,7 +80,7 @@ if (!message.get()) break; - std::unique_ptr<EventMessage> event = base::MakeUnique<EventMessage>(); + std::unique_ptr<EventMessage> event = std::make_unique<EventMessage>(); CompoundBufferInputStream stream(message.get()); ASSERT_TRUE(event->ParseFromZeroCopyStream(&stream)); message_list.push_back(std::move(event));
diff --git a/remoting/protocol/negotiating_authenticator_unittest.cc b/remoting/protocol/negotiating_authenticator_unittest.cc index 45bb06c..efc1cd4 100644 --- a/remoting/protocol/negotiating_authenticator_unittest.cc +++ b/remoting/protocol/negotiating_authenticator_unittest.cc
@@ -2,9 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <memory> + #include "base/bind.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/run_loop.h" #include "net/base/net_errors.h" #include "remoting/base/rsa_key_pair.h" @@ -97,7 +98,7 @@ void CreatePairingRegistry(bool with_paired_client) { pairing_registry_ = new SynchronousPairingRegistry( - base::MakeUnique<MockPairingRegistryDelegate>()); + std::make_unique<MockPairingRegistryDelegate>()); if (with_paired_client) { PairingRegistry::Pairing pairing( base::Time(), kTestClientName, kTestClientId, kTestPairedSecret);
diff --git a/remoting/protocol/pairing_registry_unittest.cc b/remoting/protocol/pairing_registry_unittest.cc index 3fe8123e..2952868 100644 --- a/remoting/protocol/pairing_registry_unittest.cc +++ b/remoting/protocol/pairing_registry_unittest.cc
@@ -13,7 +13,6 @@ #include "base/bind.h" #include "base/compiler_specific.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "base/threading/thread_task_runner_handle.h" @@ -92,7 +91,7 @@ TEST_F(PairingRegistryTest, CreateAndGetPairings) { scoped_refptr<PairingRegistry> registry = new SynchronousPairingRegistry( - base::MakeUnique<MockPairingRegistryDelegate>()); + std::make_unique<MockPairingRegistryDelegate>()); PairingRegistry::Pairing pairing_1 = registry->CreatePairing("my_client"); PairingRegistry::Pairing pairing_2 = registry->CreatePairing("my_client"); @@ -114,7 +113,7 @@ TEST_F(PairingRegistryTest, GetAllPairings) { scoped_refptr<PairingRegistry> registry = new SynchronousPairingRegistry( - base::MakeUnique<MockPairingRegistryDelegate>()); + std::make_unique<MockPairingRegistryDelegate>()); PairingRegistry::Pairing pairing_1 = registry->CreatePairing("client1"); PairingRegistry::Pairing pairing_2 = registry->CreatePairing("client2"); @@ -142,7 +141,7 @@ TEST_F(PairingRegistryTest, DeletePairing) { scoped_refptr<PairingRegistry> registry = new SynchronousPairingRegistry( - base::MakeUnique<MockPairingRegistryDelegate>()); + std::make_unique<MockPairingRegistryDelegate>()); PairingRegistry::Pairing pairing_1 = registry->CreatePairing("client1"); PairingRegistry::Pairing pairing_2 = registry->CreatePairing("client2"); @@ -167,7 +166,7 @@ TEST_F(PairingRegistryTest, ClearAllPairings) { scoped_refptr<PairingRegistry> registry = new SynchronousPairingRegistry( - base::MakeUnique<MockPairingRegistryDelegate>()); + std::make_unique<MockPairingRegistryDelegate>()); PairingRegistry::Pairing pairing_1 = registry->CreatePairing("client1"); PairingRegistry::Pairing pairing_2 = registry->CreatePairing("client2"); @@ -218,7 +217,7 @@ scoped_refptr<PairingRegistry> registry = new PairingRegistry(base::ThreadTaskRunnerHandle::Get(), - base::MakeUnique<MockPairingRegistryDelegate>()); + std::make_unique<MockPairingRegistryDelegate>()); PairingRegistry::Pairing pairing_1 = registry->CreatePairing("client1"); PairingRegistry::Pairing pairing_2 = registry->CreatePairing("client2"); registry->GetPairing(
diff --git a/remoting/protocol/ssl_hmac_channel_authenticator.cc b/remoting/protocol/ssl_hmac_channel_authenticator.cc index 0e2b20a..80cf935 100644 --- a/remoting/protocol/ssl_hmac_channel_authenticator.cc +++ b/remoting/protocol/ssl_hmac_channel_authenticator.cc
@@ -12,7 +12,6 @@ #include "base/bind_helpers.h" #include "base/callback_helpers.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "build/build_config.h" #include "crypto/secure_util.h" #include "net/base/host_port_pair.h" @@ -258,7 +257,7 @@ std::unique_ptr<net::SSLServerSocket> server_socket = server_context_->CreateSSLServerSocket( - base::MakeUnique<NetStreamSocketAdapter>(std::move(socket))); + std::make_unique<NetStreamSocketAdapter>(std::move(socket))); net::SSLServerSocket* raw_server_socket = server_socket.get(); socket_ = std::move(server_socket); result = raw_server_socket->Handshake( @@ -301,7 +300,7 @@ std::unique_ptr<net::ClientSocketHandle> socket_handle( new net::ClientSocketHandle); socket_handle->SetSocket( - base::MakeUnique<NetStreamSocketAdapter>(std::move(socket))); + std::make_unique<NetStreamSocketAdapter>(std::move(socket))); #if defined(OS_NACL) // net_nacl doesn't include ClientSocketFactory. @@ -470,7 +469,7 @@ *callback_called = true; base::ResetAndReturn(&done_callback_) - .Run(net::OK, base::MakeUnique<P2PStreamSocketAdapter>( + .Run(net::OK, std::make_unique<P2PStreamSocketAdapter>( std::move(socket_), std::move(server_context_))); } }
diff --git a/remoting/protocol/stream_message_pipe_adapter.cc b/remoting/protocol/stream_message_pipe_adapter.cc index 92879af..4038825 100644 --- a/remoting/protocol/stream_message_pipe_adapter.cc +++ b/remoting/protocol/stream_message_pipe_adapter.cc
@@ -4,11 +4,11 @@ #include "remoting/protocol/stream_message_pipe_adapter.h" +#include <memory> #include <utility> #include "base/bind.h" #include "base/callback_helpers.h" -#include "base/memory/ptr_util.h" #include "net/base/net_errors.h" #include "net/traffic_annotation/network_traffic_annotation.h" #include "remoting/base/buffered_socket_writer.h" @@ -34,13 +34,13 @@ DCHECK(event_handler); event_handler_ = event_handler; - writer_ = base::MakeUnique<BufferedSocketWriter>(); + writer_ = std::make_unique<BufferedSocketWriter>(); writer_->Start( base::Bind(&P2PStreamSocket::Write, base::Unretained(socket_.get())), base::Bind(&StreamMessagePipeAdapter::CloseOnError, base::Unretained(this))); - reader_ = base::MakeUnique<MessageReader>(); + reader_ = std::make_unique<MessageReader>(); reader_->StartReading(socket_.get(), base::Bind(&EventHandler::OnMessageReceived, base::Unretained(event_handler_)), @@ -99,7 +99,7 @@ error_callback_.Run(net::ERR_FAILED); return; } - callback.Run(base::MakeUnique<StreamMessagePipeAdapter>(std::move(socket), + callback.Run(std::make_unique<StreamMessagePipeAdapter>(std::move(socket), error_callback_)); }
diff --git a/remoting/protocol/transport_context.cc b/remoting/protocol/transport_context.cc index da0c7e3ce..4ae8a88 100644 --- a/remoting/protocol/transport_context.cc +++ b/remoting/protocol/transport_context.cc
@@ -8,7 +8,6 @@ #include "base/bind.h" #include "base/location.h" -#include "base/memory/ptr_util.h" #include "base/single_thread_task_runner.h" #include "base/threading/thread_task_runner_handle.h" #include "remoting/base/url_request.h" @@ -39,9 +38,10 @@ scoped_refptr<TransportContext> TransportContext::ForTests(TransportRole role) { jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop(); return new protocol::TransportContext( - nullptr, base::MakeUnique<protocol::ChromiumPortAllocatorFactory>(), - nullptr, protocol::NetworkSettings( - protocol::NetworkSettings::NAT_TRAVERSAL_OUTGOING), + nullptr, std::make_unique<protocol::ChromiumPortAllocatorFactory>(), + nullptr, + protocol::NetworkSettings( + protocol::NetworkSettings::NAT_TRAVERSAL_OUTGOING), role); } #endif // !defined(OS_NACL)
diff --git a/remoting/protocol/video_frame_pump.cc b/remoting/protocol/video_frame_pump.cc index 312fd70..6ef9b34 100644 --- a/remoting/protocol/video_frame_pump.cc +++ b/remoting/protocol/video_frame_pump.cc
@@ -11,7 +11,6 @@ #include "base/bind.h" #include "base/callback.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/single_thread_task_runner.h" #include "base/task_runner_util.h" #include "base/time/time.h" @@ -175,7 +174,7 @@ (timestamps->encode_ended_time - timestamps->encode_started_time) .InMilliseconds()); - return base::MakeUnique<PacketWithTimestamps>(std::move(packet), + return std::make_unique<PacketWithTimestamps>(std::move(packet), std::move(timestamps)); } @@ -250,7 +249,7 @@ DCHECK(thread_checker_.CalledOnValidThread()); video_stub_->ProcessVideoPacket( - base::MakeUnique<VideoPacket>(), + std::make_unique<VideoPacket>(), base::Bind(&VideoFramePump::OnKeepAlivePacketSent, weak_factory_.GetWeakPtr())); }
diff --git a/remoting/protocol/video_frame_pump_unittest.cc b/remoting/protocol/video_frame_pump_unittest.cc index 55b269f..c538312 100644 --- a/remoting/protocol/video_frame_pump_unittest.cc +++ b/remoting/protocol/video_frame_pump_unittest.cc
@@ -49,7 +49,7 @@ webrtc::SharedMemoryFactory* shared_memory_factory) { const webrtc::DesktopSize kSize(800, 640); // updated_region() is already empty by default in new BasicDesktopFrames. - return base::MakeUnique<webrtc::BasicDesktopFrame>(kSize); + return std::make_unique<webrtc::BasicDesktopFrame>(kSize); } class MockVideoEncoder : public VideoEncoder { @@ -83,7 +83,7 @@ std::unique_ptr<VideoPacket> Encode( const webrtc::DesktopFrame& frame) override { - return base::MakeUnique<VideoPacket>(); + return std::make_unique<VideoPacket>(); } private:
diff --git a/remoting/protocol/webrtc_audio_module.cc b/remoting/protocol/webrtc_audio_module.cc index b500f448..279b302 100644 --- a/remoting/protocol/webrtc_audio_module.cc +++ b/remoting/protocol/webrtc_audio_module.cc
@@ -4,8 +4,9 @@ #include "remoting/protocol/webrtc_audio_module.h" +#include <memory> + #include "base/bind.h" -#include "base/memory/ptr_util.h" #include "base/single_thread_task_runner.h" #include "base/stl_util.h" #include "base/threading/thread_task_runner_handle.h" @@ -351,7 +352,7 @@ void WebrtcAudioModule::StartPlayoutOnAudioThread() { DCHECK(audio_task_runner_->BelongsToCurrentThread()); - poll_timer_ = base::MakeUnique<base::RepeatingTimer>(); + poll_timer_ = std::make_unique<base::RepeatingTimer>(); poll_timer_->Start( FROM_HERE, kPollInterval, base::Bind(&WebrtcAudioModule::PollFromSource, base::Unretained(this)));
diff --git a/remoting/protocol/webrtc_transport.cc b/remoting/protocol/webrtc_transport.cc index 8ff08698..1415a9e 100644 --- a/remoting/protocol/webrtc_transport.cc +++ b/remoting/protocol/webrtc_transport.cc
@@ -339,7 +339,7 @@ const std::string& name) { webrtc::DataChannelInit config; config.reliable = true; - return base::MakeUnique<WebrtcDataStreamAdapter>( + return std::make_unique<WebrtcDataStreamAdapter>( peer_connection()->CreateDataChannel(name, &config)); } @@ -603,7 +603,7 @@ DCHECK(thread_checker_.CalledOnValidThread()); event_handler_->OnWebrtcTransportIncomingDataChannel( data_channel->label(), - base::MakeUnique<WebrtcDataStreamAdapter>(data_channel)); + std::make_unique<WebrtcDataStreamAdapter>(data_channel)); } void WebrtcTransport::OnRenegotiationNeeded() {
diff --git a/remoting/signaling/server_log_entry.cc b/remoting/signaling/server_log_entry.cc index 1e678a9..716db3b7 100644 --- a/remoting/signaling/server_log_entry.cc +++ b/remoting/signaling/server_log_entry.cc
@@ -5,7 +5,6 @@ #include "remoting/signaling/server_log_entry.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/sys_info.h" #include "remoting/base/constants.h" #include "third_party/libjingle_xmpp/xmllite/xmlelement.h" @@ -72,7 +71,7 @@ // static std::unique_ptr<XmlElement> ServerLogEntry::MakeStanza() { - return base::MakeUnique<XmlElement>( + return std::make_unique<XmlElement>( QName(kChromotingXmlNamespace, kLogCommand)); }
diff --git a/remoting/signaling/xmpp_signal_strategy_unittest.cc b/remoting/signaling/xmpp_signal_strategy_unittest.cc index 99d8f84d5..cabdb790 100644 --- a/remoting/signaling/xmpp_signal_strategy_unittest.cc +++ b/remoting/signaling/xmpp_signal_strategy_unittest.cc
@@ -9,7 +9,6 @@ #include <vector> #include "base/base64.h" -#include "base/memory/ptr_util.h" #include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "net/socket/socket_test_util.h" @@ -122,7 +121,7 @@ void SetUp() override { request_context_getter_ = new net::TestURLRequestContextGetter( message_loop_.task_runner(), - base::MakeUnique<net::TestURLRequestContext>()); + std::make_unique<net::TestURLRequestContext>()); } void CreateSignalStrategy(int port) { @@ -147,7 +146,7 @@ } bool OnSignalStrategyIncomingStanza(const buzz::XmlElement* stanza) override { - received_messages_.push_back(base::MakeUnique<buzz::XmlElement>(*stanza)); + received_messages_.push_back(std::make_unique<buzz::XmlElement>(*stanza)); return true; } @@ -275,7 +274,7 @@ Connect(true); EXPECT_TRUE(signal_strategy_->SendStanza( - base::MakeUnique<buzz::XmlElement>(buzz::QName(std::string(), "hello")))); + std::make_unique<buzz::XmlElement>(buzz::QName(std::string(), "hello")))); EXPECT_EQ("<hello/>", socket_data_provider_->GetAndClearWrittenData()); socket_data_provider_->ReceiveData("<hi xmlns=\"hello\"/>"); @@ -301,7 +300,7 @@ // Can't send messages anymore. EXPECT_FALSE(signal_strategy_->SendStanza( - base::MakeUnique<buzz::XmlElement>(buzz::QName(std::string(), "hello")))); + std::make_unique<buzz::XmlElement>(buzz::QName(std::string(), "hello")))); // Try connecting again. Connect(true); @@ -319,7 +318,7 @@ // Can't send messages anymore. EXPECT_FALSE(signal_strategy_->SendStanza( - base::MakeUnique<buzz::XmlElement>(buzz::QName(std::string(), "hello")))); + std::make_unique<buzz::XmlElement>(buzz::QName(std::string(), "hello")))); // Try connecting again. Connect(true); @@ -333,7 +332,7 @@ // Next SendMessage() will call Write() which will fail. EXPECT_FALSE(signal_strategy_->SendStanza( - base::MakeUnique<buzz::XmlElement>(buzz::QName(std::string(), "hello")))); + std::make_unique<buzz::XmlElement>(buzz::QName(std::string(), "hello")))); EXPECT_EQ(3U, state_history_.size()); EXPECT_EQ(SignalStrategy::DISCONNECTED, state_history_[2]);
diff --git a/remoting/test/fake_port_allocator.cc b/remoting/test/fake_port_allocator.cc index 7af6d58a..90f08b0 100644 --- a/remoting/test/fake_port_allocator.cc +++ b/remoting/test/fake_port_allocator.cc
@@ -5,7 +5,6 @@ #include "remoting/test/fake_port_allocator.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "remoting/protocol/transport_context.h" #include "remoting/test/fake_network_dispatcher.h" #include "remoting/test/fake_network_manager.h" @@ -81,7 +80,7 @@ std::unique_ptr<cricket::PortAllocator> FakePortAllocatorFactory::CreatePortAllocator( scoped_refptr<protocol::TransportContext> transport_context) { - return base::MakeUnique<FakePortAllocator>( + return std::make_unique<FakePortAllocator>( network_manager_.get(), socket_factory_.get(), transport_context); }
diff --git a/remoting/test/protocol_perftest.cc b/remoting/test/protocol_perftest.cc index f7ab165..38070fe 100644 --- a/remoting/test/protocol_perftest.cc +++ b/remoting/test/protocol_perftest.cc
@@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <memory> #include <numeric> #include <utility> #include "base/base64.h" #include "base/files/file_util.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/message_loop/message_loop.h" #include "base/rand_util.h" #include "base/run_loop.h" @@ -154,7 +154,7 @@ // protocol::FrameConsumer interface. std::unique_ptr<webrtc::DesktopFrame> AllocateFrame( const webrtc::DesktopSize& size) override { - return base::MakeUnique<webrtc::BasicDesktopFrame>(size); + return std::make_unique<webrtc::BasicDesktopFrame>(size); } void DrawFrame(std::unique_ptr<webrtc::DesktopFrame> frame,
diff --git a/remoting/test/test_chromoting_client.cc b/remoting/test/test_chromoting_client.cc index 93623ee..2331a26 100644 --- a/remoting/test/test_chromoting_client.cc +++ b/remoting/test/test_chromoting_client.cc
@@ -9,7 +9,6 @@ #include "base/bind.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/threading/thread_task_runner_handle.h" #include "jingle/glue/thread_wrapper.h" #include "net/base/request_priority.h" @@ -125,8 +124,8 @@ scoped_refptr<protocol::TransportContext> transport_context( new protocol::TransportContext( signal_strategy_.get(), - base::MakeUnique<protocol::ChromiumPortAllocatorFactory>(), - base::MakeUnique<ChromiumUrlRequestFactory>(request_context_getter), + std::make_unique<protocol::ChromiumPortAllocatorFactory>(), + std::make_unique<ChromiumUrlRequestFactory>(request_context_getter), network_settings, protocol::TransportRole::CLIENT)); protocol::ClientAuthenticationConfig client_auth_config;
diff --git a/remoting/test/test_chromoting_client_unittest.cc b/remoting/test/test_chromoting_client_unittest.cc index a7f6cc60..c10635d 100644 --- a/remoting/test/test_chromoting_client_unittest.cc +++ b/remoting/test/test_chromoting_client_unittest.cc
@@ -70,7 +70,7 @@ // remain valid until |test_chromoting_client_| is destroyed. fake_connection_to_host_ = new FakeConnectionToHost(); test_chromoting_client_->SetSignalStrategyForTests( - base::MakeUnique<FakeSignalStrategy>( + std::make_unique<FakeSignalStrategy>( SignalingAddress("test_user@faux_address.com/123"))); test_chromoting_client_->SetConnectionToHostForTests( base::WrapUnique(fake_connection_to_host_));
diff --git a/services/network/public/cpp/BUILD.gn b/services/network/public/cpp/BUILD.gn index 616855be..3399f7f6 100644 --- a/services/network/public/cpp/BUILD.gn +++ b/services/network/public/cpp/BUILD.gn
@@ -8,10 +8,14 @@ sources = [ "cors/cors.cc", "cors/cors.h", + "loader_util.cc", + "loader_util.h", "mutable_network_traffic_annotation_tag_struct_traits.h", "mutable_partial_network_traffic_annotation_tag_struct_traits.h", "net_adapters.cc", "net_adapters.h", + "network_switches.cc", + "network_switches.h", "proxy_resolving_client_socket.cc", "proxy_resolving_client_socket.h", ]
diff --git a/services/network/public/cpp/cors/cors.cc b/services/network/public/cpp/cors/cors.cc index 77d0dc00..e79503d 100644 --- a/services/network/public/cpp/cors/cors.cc +++ b/services/network/public/cpp/cors/cors.cc
@@ -8,6 +8,13 @@ #include "url/origin.h" #include "url/url_util.h" +namespace { + +const char kAsterisk[] = "*"; +const char kLowerCaseTrue[] = "true"; + +} // namespace + namespace network { namespace cors { @@ -35,9 +42,9 @@ // Check Suborigins, unless the Access-Control-Allow-Origin is '*', which // implies that all Suborigins are okay as well. - bool allow_all_origins = allow_origin_header == "*"; + bool allow_all_origins = allow_origin_header == kAsterisk; if (!origin.suborigin().empty() && !allow_all_origins) { - if (allow_suborigin_header != "*" && + if (allow_suborigin_header != kAsterisk && allow_suborigin_header != origin.suborigin()) { return mojom::CORSError::kSubOriginMismatch; } @@ -96,7 +103,7 @@ // https://fetch.spec.whatwg.org/#http-access-control-allow-credentials. // This check should be case sensitive. // See also https://fetch.spec.whatwg.org/#http-new-header-syntax. - if (allow_credentials_header != "true") + if (allow_credentials_header != kLowerCaseTrue) return mojom::CORSError::kDisallowCredentialsNotSetToTrue; } return base::nullopt; @@ -126,6 +133,26 @@ return base::nullopt; } +base::Optional<mojom::CORSError> CheckPreflight(const int status_code) { + // CORS preflight with 3XX is considered network error in + // Fetch API Spec: https://fetch.spec.whatwg.org/#cors-preflight-fetch + // CORS Spec: http://www.w3.org/TR/cors/#cross-origin-request-with-preflight-0 + // https://crbug.com/452394 + if (200 <= status_code && status_code < 300) + return base::nullopt; + return mojom::CORSError::kPreflightInvalidStatus; +} + +// https://wicg.github.io/cors-rfc1918/#http-headerdef-access-control-allow-external +base::Optional<mojom::CORSError> CheckExternalPreflight( + const base::Optional<std::string>& allow_external) { + if (!allow_external) + return mojom::CORSError::kPreflightMissingAllowExternal; + if (*allow_external == kLowerCaseTrue) + return base::nullopt; + return mojom::CORSError::kPreflightInvalidAllowExternal; +} + bool IsCORSEnabledRequestMode(mojom::FetchRequestMode mode) { return mode == mojom::FetchRequestMode::kCORS || mode == mojom::FetchRequestMode::kCORSWithForcedPreflight;
diff --git a/services/network/public/cpp/cors/cors.h b/services/network/public/cpp/cors/cors.h index eccf4110..4ce03e6 100644 --- a/services/network/public/cpp/cors/cors.h +++ b/services/network/public/cpp/cors/cors.h
@@ -38,7 +38,7 @@ network::mojom::FetchCredentialsMode credentials_mode, const url::Origin& origin); -// Given a redirected-to URL, check if the location is allowed +// Given a redirected-to URL, checks if the location is allowed // according to CORS. That is: // - the URL has a CORS supported scheme and // - the URL does not contain the userinfo production. @@ -48,6 +48,16 @@ base::Optional<mojom::CORSError> CheckRedirectLocation(const GURL& redirect_url, bool skip_scheme_check); +// Performs the required CORS checks on the response to a preflight request. +// Returns |kPreflightSuccess| if preflight response was successful. +base::Optional<mojom::CORSError> CheckPreflight(const int status_code); + +// Checks errors for the currently experimental "Access-Control-Allow-External:" +// header. Shares error conditions with standard preflight checking. +// See https://crbug.com/590714. +base::Optional<mojom::CORSError> CheckExternalPreflight( + const base::Optional<std::string>& allow_external); + bool IsCORSEnabledRequestMode(mojom::FetchRequestMode mode); } // namespace cors
diff --git a/services/network/public/cpp/cors/cors_unittest.cc b/services/network/public/cpp/cors/cors_unittest.cc index c124f58..6d7a5ab7 100644 --- a/services/network/public/cpp/cors/cors_unittest.cc +++ b/services/network/public/cpp/cors/cors_unittest.cc
@@ -276,6 +276,27 @@ EXPECT_EQ(mojom::CORSError::kRedirectContainsCredentials, *error5); } +TEST_F(CORSTest, CheckPreflightDetectsErrors) { + EXPECT_FALSE(cors::CheckPreflight(200)); + EXPECT_FALSE(cors::CheckPreflight(299)); + + base::Optional<mojom::CORSError> error1 = cors::CheckPreflight(300); + ASSERT_TRUE(error1); + EXPECT_EQ(mojom::CORSError::kPreflightInvalidStatus, *error1); + + EXPECT_FALSE(cors::CheckExternalPreflight(std::string("true"))); + + base::Optional<mojom::CORSError> error2 = + cors::CheckExternalPreflight(base::nullopt); + ASSERT_TRUE(error2); + EXPECT_EQ(mojom::CORSError::kPreflightMissingAllowExternal, *error2); + + base::Optional<mojom::CORSError> error3 = + cors::CheckExternalPreflight(std::string("TRUE")); + ASSERT_TRUE(error3); + EXPECT_EQ(mojom::CORSError::kPreflightInvalidAllowExternal, *error3); +} + } // namespace } // namespace network
diff --git a/content/common/loader_util.cc b/services/network/public/cpp/loader_util.cc similarity index 78% rename from content/common/loader_util.cc rename to services/network/public/cpp/loader_util.cc index 684ded0..fa818d99d 100644 --- a/content/common/loader_util.cc +++ b/services/network/public/cpp/loader_util.cc
@@ -2,24 +2,23 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "content/common/loader_util.h" +#include "services/network/public/cpp/loader_util.h" #include <string> #include "base/command_line.h" #include "base/strings/stringprintf.h" -#include "content/public/common/content_switches.h" #include "net/base/load_flags.h" #include "net/base/mime_sniffer.h" #include "net/http/http_raw_request_headers.h" #include "net/http/http_util.h" #include "net/url_request/url_request.h" #include "services/network/public/cpp/http_raw_request_response_info.h" -#include "services/network/public/cpp/resource_request.h" +#include "services/network/public/cpp/network_switches.h" #include "services/network/public/cpp/resource_response.h" #include "url/gurl.h" -namespace content { +namespace network { const char kAcceptHeader[] = "Accept"; const char kFrameAcceptHeader[] = @@ -54,8 +53,8 @@ const net::URLRequest& request, const net::HttpRawRequestHeaders& raw_request_headers, const net::HttpResponseHeaders* raw_response_headers) { - scoped_refptr<network::HttpRawRequestResponseInfo> info = - new network::HttpRawRequestResponseInfo(); + scoped_refptr<HttpRawRequestResponseInfo> info = + new HttpRawRequestResponseInfo(); const net::HttpResponseInfo& response_info = request.response_info(); // Unparsed headers only make sense if they were sent as text, i.e. HTTP 1.x. @@ -99,23 +98,6 @@ return info; } -int BuildLoadFlagsForRequest(const network::ResourceRequest& request) { - int load_flags = request.load_flags; - - // Although EV status is irrelevant to sub-frames and sub-resources, we have - // to perform EV certificate verification on all resources because an HTTP - // keep-alive connection created to load a sub-frame or a sub-resource could - // be reused to load a main frame. - load_flags |= net::LOAD_VERIFY_EV_CERT; - if (request.resource_type == RESOURCE_TYPE_MAIN_FRAME) { - load_flags |= net::LOAD_MAIN_FRAME_DEPRECATED; - } else if (request.resource_type == RESOURCE_TYPE_PREFETCH) { - load_flags |= net::LOAD_PREFETCH; - } - - return load_flags; -} - std::string ComputeReferrer(const GURL& referrer) { if (!referrer.is_valid() || base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kNoReferrers)) { @@ -125,4 +107,4 @@ return referrer.spec(); } -} // namespace content +} // namespace network
diff --git a/content/common/loader_util.h b/services/network/public/cpp/loader_util.h similarity index 69% rename from content/common/loader_util.h rename to services/network/public/cpp/loader_util.h index 9c4bc05..30bcb3d0 100644 --- a/content/common/loader_util.h +++ b/services/network/public/cpp/loader_util.h
@@ -2,11 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CONTENT_COMMON_LOADER_UTIL_H_ -#define CONTENT_COMMON_LOADER_UTIL_H_ +#ifndef SERVICES_NETWORK_PUBLIC_CPP_LOADER_UTIL_H_ +#define SERVICES_NETWORK_PUBLIC_CPP_LOADER_UTIL_H_ #include "base/memory/ref_counted.h" -#include "content/public/common/resource_type.h" class GURL; @@ -14,15 +13,14 @@ class HttpRawRequestHeaders; class HttpResponseHeaders; class URLRequest; -} +} // namespace net +// This header contains utility functions and constants shared between network +// service and the old loading path in content/. Once Network Service is the +// only path this should move out of the public directory. namespace network { struct HttpRawRequestResponseInfo; -struct ResourceRequest; struct ResourceResponse; -} - -namespace content { // The name of the "Accept" header. extern const char kAcceptHeader[]; @@ -39,19 +37,17 @@ // Whether the response body should be sniffed in order to determine the MIME // type of the response. bool ShouldSniffContent(net::URLRequest* url_request, - network::ResourceResponse* response); + ResourceResponse* response); // Fill HttpRawRequestResponseInfo based on raw headers. -scoped_refptr<network::HttpRawRequestResponseInfo> BuildRawRequestResponseInfo( +scoped_refptr<HttpRawRequestResponseInfo> BuildRawRequestResponseInfo( const net::URLRequest& request, const net::HttpRawRequestHeaders& raw_request_headers, const net::HttpResponseHeaders* raw_response_headers); -int BuildLoadFlagsForRequest(const network::ResourceRequest& request_data); - // Returns the referrer based on the validity of the URL and command line flags. std::string ComputeReferrer(const GURL& referrer); -} // namespace content +} // namespace network -#endif // CONTENT_COMMON_LOADER_UTIL_H_ +#endif // SERVICES_NETWORK_PUBLIC_CPP_LOADER_UTIL_H_
diff --git a/services/network/public/cpp/network_switches.cc b/services/network/public/cpp/network_switches.cc new file mode 100644 index 0000000..acb3964 --- /dev/null +++ b/services/network/public/cpp/network_switches.cc
@@ -0,0 +1,16 @@ +// Copyright 2018 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 "services/network/public/cpp/network_switches.h" + +namespace network { + +namespace switches { + +// Don't send HTTP-Referer headers. +const char kNoReferrers[] = "no-referrers"; + +} // namespace switches + +} // namespace network
diff --git a/services/network/public/cpp/network_switches.h b/services/network/public/cpp/network_switches.h new file mode 100644 index 0000000..f43d851 --- /dev/null +++ b/services/network/public/cpp/network_switches.h
@@ -0,0 +1,17 @@ +// Copyright 2018 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 SERVICES_NETWORK_PUBLIC_CPP_NETWORK_SWITCHES_ +#define SERVICES_NETWORK_PUBLIC_CPP_NETWORK_SWITCHES_ + +namespace network { + +namespace switches { + +extern const char kNoReferrers[]; +} + +} // namespace network + +#endif // SERVICES_NETWORK_PUBLIC_CPP_NETWORK_SWITCHES_
diff --git a/services/network/public/interfaces/BUILD.gn b/services/network/public/interfaces/BUILD.gn index 494d45a..19ac407 100644 --- a/services/network/public/interfaces/BUILD.gn +++ b/services/network/public/interfaces/BUILD.gn
@@ -41,6 +41,8 @@ "mutable_network_traffic_annotation_tag.mojom", "mutable_partial_network_traffic_annotation_tag.mojom", "network_change_manager.mojom", + "network_service.mojom", + "network_service_test.mojom", "network_types.mojom", "proxy_config.mojom", "request_context_frame_type.mojom", @@ -52,6 +54,7 @@ public_deps = [ ":data_pipe_interface", "//mojo/common:common_custom_types", + "//services/proxy_resolver/public/interfaces", "//url/mojo:url_mojom_gurl", ]
diff --git a/content/public/common/network_service.mojom b/services/network/public/interfaces/network_service.mojom similarity index 87% rename from content/public/common/network_service.mojom rename to services/network/public/interfaces/network_service.mojom index f6cf351..e9f0fa7 100644 --- a/content/public/common/network_service.mojom +++ b/services/network/public/interfaces/network_service.mojom
@@ -2,17 +2,17 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -module content.mojom; +module network.mojom; +import "cookie_manager.mojom"; +import "network_change_manager.mojom"; +import "proxy_config.mojom"; +import "url_loader.mojom"; +import "url_loader_factory.mojom"; +import "restricted_cookie_manager.mojom"; import "mojo/common/file_path.mojom"; import "mojo/common/time.mojom"; import "url/mojo/url.mojom"; -import "services/network/public/interfaces/cookie_manager.mojom"; -import "services/network/public/interfaces/network_change_manager.mojom"; -import "services/network/public/interfaces/proxy_config.mojom"; -import "services/network/public/interfaces/url_loader.mojom"; -import "services/network/public/interfaces/url_loader_factory.mojom"; -import "services/network/public/interfaces/restricted_cookie_manager.mojom"; import "services/proxy_resolver/public/interfaces/proxy_resolver.mojom"; // Parameters for constructing a network context. @@ -82,8 +82,8 @@ // |proxy_config_client_request|. // // If both are null, the NetworkContext will not use a proxy. - network.mojom.ProxyConfig? initial_proxy_config; - network.mojom.ProxyConfigClient&? proxy_config_client_request; + ProxyConfig? initial_proxy_config; + ProxyConfigClient&? proxy_config_client_request; // If |proxy_config_client_request| is non-null, this is called during // periods of network activity, and can be used as a signal for polling-based @@ -92,7 +92,7 @@ // TODO(mmenke): Can the consumer piggy back on other network events through // other channels (navigation, issuing requests, etc)? Or can // ProxyConfigServices be modified not to need this notification? - network.mojom.ProxyConfigPollerClient? proxy_config_poller_client; + ProxyConfigPollerClient? proxy_config_poller_client; }; struct NetworkConditions { @@ -115,21 +115,21 @@ interface NetworkContext { // |process_id| is 0 for requests initiated in the browser process, otherwise // it's the child process ID. - CreateURLLoaderFactory(network.mojom.URLLoaderFactory& url_loader_factory, + CreateURLLoaderFactory(URLLoaderFactory& url_loader_factory, uint32 process_id); // Handles a request to display cache data to the user. |url| is parsed to // display different parts of the cache. HandleViewCacheRequest(url.mojom.Url url, - network.mojom.URLLoaderClient client); + URLLoaderClient client); // Gets the CookieManager associated with this network context. - GetCookieManager(network.mojom.CookieManager& cookie_manager); + GetCookieManager(CookieManager& cookie_manager); // TODO(crbug.com/729800): Switch from {process,frame}_id to the network // service's representation of security principals. GetRestrictedCookieManager( - network.mojom.RestrictedCookieManager& restricted_cookie_manager, + RestrictedCookieManager& restricted_cookie_manager, int32 render_process_id, int32 render_frame_id); // Clears network objects with implicit URL history information. Data related @@ -166,7 +166,7 @@ url.mojom.Url url, uint32 process_id, uint32 routing_id, - network.mojom.SSLInfo ssl_info, + SSLInfo ssl_info, bool fatal) => (int32 net_error); }; @@ -190,5 +190,5 @@ // Gets the NetworkChangeManager. GetNetworkChangeManager( - network.mojom.NetworkChangeManager& network_change_manager); + NetworkChangeManager& network_change_manager); };
diff --git a/content/public/common/network_service_test.mojom b/services/network/public/interfaces/network_service_test.mojom similarity index 77% rename from content/public/common/network_service_test.mojom rename to services/network/public/interfaces/network_service_test.mojom index 812827c..a78397b 100644 --- a/content/public/common/network_service_test.mojom +++ b/services/network/public/interfaces/network_service_test.mojom
@@ -2,10 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -module content.mojom; +module network.mojom; -import "services/network/public/interfaces/network_change_manager.mojom"; -import "services/network/public/interfaces/url_loader.mojom"; +import "network_change_manager.mojom"; + +[Native] +struct CertVerifyResult; + +[Native] +struct X509Certificate; struct Rule { string host_pattern; @@ -24,7 +29,7 @@ // Simulates a network connection type change. The new connection type will be // updated to |type| and broadcasts will be sent to // NetworkConnectionManagerClient implementations. - SimulateNetworkChange(network.mojom.ConnectionType type) => (); + SimulateNetworkChange(ConnectionType type) => (); // Crash the process where network service is running. SimulateCrash(); @@ -35,8 +40,8 @@ [Sync] MockCertVerifierAddResultForCertAndHost( - network.mojom.X509Certificate cert, + X509Certificate cert, string host_pattern, - network.mojom.CertVerifyResult verify_result, + CertVerifyResult verify_result, int32 rv) => (); };
diff --git a/services/network/public/interfaces/url_loader.mojom b/services/network/public/interfaces/url_loader.mojom index fa79646..d953ba62 100644 --- a/services/network/public/interfaces/url_loader.mojom +++ b/services/network/public/interfaces/url_loader.mojom
@@ -22,14 +22,6 @@ [Native] struct URLLoaderCompletionStatus; -// TODO(jam): move these two Native blocks to network_service_test.mojom once it -// moves to services/network. -[Native] -struct CertVerifyResult; - -[Native] -struct X509Certificate; - // This enum corresponds to net::RequestPriority. See its comments for details. enum RequestPriority { kThrottled = 0,
diff --git a/services/proxy_resolver/public/interfaces/BUILD.gn b/services/proxy_resolver/public/interfaces/BUILD.gn index e1e610e..610b842 100644 --- a/services/proxy_resolver/public/interfaces/BUILD.gn +++ b/services/proxy_resolver/public/interfaces/BUILD.gn
@@ -13,4 +13,10 @@ "//net/interfaces", "//url/mojo:url_mojom_gurl", ] + + if (!is_ios) { + export_class_attribute_blink = "BLINK_PLATFORM_EXPORT" + export_define_blink = "BLINK_PLATFORM_IMPLEMENTATION=1" + export_header_blink = "third_party/WebKit/public/platform/WebCommon.h" + } }
diff --git a/services/service_manager/sandbox/mac/gpu_v2.sb b/services/service_manager/sandbox/mac/gpu_v2.sb index 593b49d..7b66e6c 100644 --- a/services/service_manager/sandbox/mac/gpu_v2.sb +++ b/services/service_manager/sandbox/mac/gpu_v2.sb
@@ -7,6 +7,7 @@ ; Allow communication between the GPU process and the UI server. (allow mach-lookup (global-name "com.apple.cvmsServ") + (global-name "com.apple.system.notification_center") (global-name "com.apple.tsm.uiserver") (global-name "com.apple.windowserver.active")) @@ -23,6 +24,9 @@ (iokit-user-client-class "IOSurfaceSendRight")) (iokit-user-client-class "RootDomainUserClient") +(allow ipc-posix-shm-read-data + (ipc-posix-name "apple.shm.notification_center")) + ; https://crbug.com/515280 (if (>= os-version 1011) (allow file-read* (subpath "/System/Library/Extensions")))
diff --git a/storage/browser/blob/blob_data_builder.cc b/storage/browser/blob/blob_data_builder.cc index 23c429b4..668166a 100644 --- a/storage/browser/blob/blob_data_builder.cc +++ b/storage/browser/blob/blob_data_builder.cc
@@ -25,10 +25,80 @@ namespace { const static int kInvalidDiskCacheSideStreamIndex = -1; +const FilePath::CharType kFutureFileName[] = FILE_PATH_LITERAL("_future_name_"); } // namespace -const FilePath::CharType kFutureFileName[] = FILE_PATH_LITERAL("_future_name_"); +BlobDataBuilder::FutureData::FutureData(FutureData&&) = default; +BlobDataBuilder::FutureData& BlobDataBuilder::FutureData::operator=( + FutureData&&) = default; +BlobDataBuilder::FutureData::~FutureData() = default; + +bool BlobDataBuilder::FutureData::Populate(base::span<const char> data, + size_t offset) const { + DCHECK(data.data()); + base::span<char> target = GetDataToPopulate(offset, data.length()); + if (!target.data()) + return false; + DCHECK_EQ(target.length(), data.length()); + std::memcpy(target.data(), data.data(), data.length()); + return true; +} + +base::span<char> BlobDataBuilder::FutureData::GetDataToPopulate( + size_t offset, + size_t length) const { + network::DataElement* element = item_->data_element_ptr(); + + // We lazily allocate our data buffer by waiting until the first + // PopulateFutureData call. + // Why? The reason we have the AppendFutureData method is to create our Blob + // record when the Renderer tells us about the blob without actually + // allocating the memory yet, as we might not have the quota yet. So we don't + // want to allocate the memory until we're actually receiving the data (which + // the browser process only does when it has quota). + if (element->type() == network::DataElement::TYPE_BYTES_DESCRIPTION) { + element->SetToAllocatedBytes(element->length()); + // The type of the element is now TYPE_BYTES. + } + DCHECK_EQ(element->type(), network::DataElement::TYPE_BYTES); + base::CheckedNumeric<size_t> checked_end = offset; + checked_end += length; + if (!checked_end.IsValid() || checked_end.ValueOrDie() > element->length()) { + DVLOG(1) << "Invalid offset or length."; + return nullptr; + } + return base::make_span(element->mutable_bytes() + offset, length); +} + +BlobDataBuilder::FutureData::FutureData(scoped_refptr<BlobDataItem> item) + : item_(item) {} + +BlobDataBuilder::FutureFile::FutureFile(FutureFile&&) = default; +BlobDataBuilder::FutureFile& BlobDataBuilder::FutureFile::operator=( + FutureFile&&) = default; +BlobDataBuilder::FutureFile::~FutureFile() = default; + +bool BlobDataBuilder::FutureFile::Populate( + scoped_refptr<ShareableFileReference> file_reference, + const base::Time& expected_modification_time) { + if (!item_) { + DVLOG(1) << "File item already populated"; + return false; + } + network::DataElement* element = item_->data_element_ptr(); + DCHECK_EQ(element->type(), network::DataElement::TYPE_FILE); + uint64_t length = element->length(); + uint64_t offset = element->offset(); + element->SetToFilePathRange(file_reference->path(), offset, length, + expected_modification_time); + item_->data_handle_ = std::move(file_reference); + item_ = nullptr; + return true; +} + +BlobDataBuilder::FutureFile::FutureFile(scoped_refptr<BlobDataItem> item) + : item_(item) {} /* static */ base::FilePath BlobDataBuilder::GetFutureFileItemPath(uint64_t file_id) { @@ -106,88 +176,24 @@ items_.push_back(new BlobDataItem(std::move(element))); } -size_t BlobDataBuilder::AppendFutureData(size_t length) { +BlobDataBuilder::FutureData BlobDataBuilder::AppendFutureData(size_t length) { CHECK_NE(length, 0u); std::unique_ptr<network::DataElement> element(new network::DataElement()); element->SetToBytesDescription(length); items_.push_back(new BlobDataItem(std::move(element))); - return items_.size() - 1; + return FutureData(items_.back()); } -bool BlobDataBuilder::PopulateFutureData(size_t index, - const char* data, - size_t offset, - size_t length) { - DCHECK(data); - - char* target = GetFutureDataPointerToPopulate(index, offset, length); - if (!target) - return false; - std::memcpy(target, data, length); - return true; -} - -char* BlobDataBuilder::GetFutureDataPointerToPopulate(size_t index, - size_t offset, - size_t length) { - DCHECK_LT(index, items_.size()); - network::DataElement* element = items_[index]->data_element_ptr(); - - // We lazily allocate our data buffer by waiting until the first - // PopulateFutureData call. - // Why? The reason we have the AppendFutureData method is to create our Blob - // record when the Renderer tells us about the blob without actually - // allocating the memory yet, as we might not have the quota yet. So we don't - // want to allocate the memory until we're actually receiving the data (which - // the browser process only does when it has quota). - if (element->type() == network::DataElement::TYPE_BYTES_DESCRIPTION) { - element->SetToAllocatedBytes(element->length()); - // The type of the element is now TYPE_BYTES. - } - if (element->type() != network::DataElement::TYPE_BYTES) { - DVLOG(1) << "Invalid item type."; - return nullptr; - } - base::CheckedNumeric<size_t> checked_end = offset; - checked_end += length; - if (!checked_end.IsValid() || checked_end.ValueOrDie() > element->length()) { - DVLOG(1) << "Invalid offset or length."; - return nullptr; - } - return element->mutable_bytes() + offset; -} - -size_t BlobDataBuilder::AppendFutureFile(uint64_t offset, - uint64_t length, - uint64_t file_id) { +BlobDataBuilder::FutureFile BlobDataBuilder::AppendFutureFile( + uint64_t offset, + uint64_t length, + uint64_t file_id) { CHECK_NE(length, 0ull); std::unique_ptr<network::DataElement> element(new network::DataElement()); element->SetToFilePathRange(GetFutureFileItemPath(file_id), offset, length, base::Time()); items_.push_back(new BlobDataItem(std::move(element))); - return items_.size() - 1; -} - -bool BlobDataBuilder::PopulateFutureFile( - size_t index, - const scoped_refptr<ShareableFileReference>& file_reference, - const base::Time& expected_modification_time) { - DCHECK_LT(index, items_.size()); - network::DataElement* element = items_[index]->data_element_ptr(); - - if (element->type() != network::DataElement::TYPE_FILE) { - DVLOG(1) << "Invalid item type."; - return false; - } else if (!IsFutureFileItem(*element)) { - DVLOG(1) << "Item not created by AppendFutureFile"; - return false; - } - uint64_t length = element->length(); - uint64_t offset = element->offset(); - items_[index]->data_handle_ = std::move(file_reference); - element->SetToFilePathRange(file_reference->path(), offset, length, - expected_modification_time); - return true; + return FutureFile(items_.back()); } void BlobDataBuilder::AppendFile(const FilePath& file_path,
diff --git a/storage/browser/blob/blob_data_builder.h b/storage/browser/blob/blob_data_builder.h index 6e0a09f..60e2bf1 100644 --- a/storage/browser/blob/blob_data_builder.h +++ b/storage/browser/blob/blob_data_builder.h
@@ -69,32 +69,61 @@ // Copies the given data into the blob. void AppendData(const char* data, size_t length); + // Represents a piece of unpopulated data. + class STORAGE_EXPORT FutureData { + public: + FutureData(FutureData&&); + FutureData& operator=(FutureData&&); + ~FutureData(); + + // Populates a part of an item previously allocated with AppendFutureData. + // The first call to PopulateFutureData lazily allocates the memory for the + // data element. + // Returns true if: + // * The offset and length are valid, and + // * data is a valid pointer. + bool Populate(base::span<const char> data, size_t offset) const; + + // Same as Populate, but rather than passing in the data to be + // copied, this method returns a pointer where the caller can copy |length| + // bytes of data to. + // Returns nullptr if: + // * The offset and length are not valid. + base::span<char> GetDataToPopulate(size_t offset, size_t length) const; + + private: + friend class BlobDataBuilder; + FutureData(scoped_refptr<BlobDataItem>); + + scoped_refptr<BlobDataItem> item_; + DISALLOW_COPY_AND_ASSIGN(FutureData); + }; + // Adds an item that is flagged for future data population. The memory is not // allocated until the first call to PopulateFutureData. Returns the index of // the item (to be used in PopulateFutureData). |length| cannot be 0. - size_t AppendFutureData(size_t length); + FutureData AppendFutureData(size_t length); - // Populates a part of an item previously allocated with AppendFutureData. - // The first call to PopulateFutureData lazily allocates the memory for the - // data element. - // Returns true if: - // * The item was created by using AppendFutureData, - // * The offset and length are valid, and - // * data is a valid pointer. - bool PopulateFutureData(size_t index, - const char* data, - size_t offset, - size_t length); + // Represents an unpopulated file. + class STORAGE_EXPORT FutureFile { + public: + FutureFile(FutureFile&&); + FutureFile& operator=(FutureFile&&); + ~FutureFile(); - // Same as PopulateFutureData, but rather than passing in the data to be - // copied, this method returns a pointer where the caller can copy |length| - // bytes of data to. - // Returns nullptr if: - // * The item was not created by using AppendFutureData, or - // * The offset and length are not valid. - char* GetFutureDataPointerToPopulate(size_t index, - size_t offset, - size_t length); + // Populates a part of an item previously allocated with AppendFutureFile. + // Returns false if: + // * The item has already been populated. + bool Populate(scoped_refptr<ShareableFileReference> file_reference, + const base::Time& expected_modification_time); + + private: + friend class BlobDataBuilder; + FutureFile(scoped_refptr<BlobDataItem>); + + scoped_refptr<BlobDataItem> item_; + DISALLOW_COPY_AND_ASSIGN(FutureFile); + }; // Adds an item that is flagged for future data population. Use // 'PopulateFutureFile' to set the file path and expected modification time @@ -104,16 +133,9 @@ // different offsets and lengths. The |file_id| is used to differentiate // between different 'future' files that will be used to store data for these // items. - size_t AppendFutureFile(uint64_t offset, uint64_t length, uint64_t file_id); - - // Populates a part of an item previously allocated with AppendFutureFile. - // Returns true if: - // * The item was created by using AppendFutureFile and - // * The filepath is valid. - bool PopulateFutureFile( - size_t index, - const scoped_refptr<ShareableFileReference>& file_reference, - const base::Time& expected_modification_time); + FutureFile AppendFutureFile(uint64_t offset, + uint64_t length, + uint64_t file_id); // You must know the length of the file, you cannot use kuint64max to specify // the whole file. This method creates a ShareableFileReference to the given
diff --git a/storage/browser/blob/blob_memory_controller_unittest.cc b/storage/browser/blob/blob_memory_controller_unittest.cc index 8c8c6fd..0c3e047 100644 --- a/storage/browser/blob/blob_memory_controller_unittest.cc +++ b/storage/browser/blob/blob_memory_controller_unittest.cc
@@ -433,7 +433,8 @@ // Add item that is the file quota. BlobDataBuilder builder(kId); - builder.AppendFutureFile(0, kBlobSize, 0); + BlobDataBuilder::FutureFile future_file = + builder.AppendFutureFile(0, kBlobSize, 0); std::vector<scoped_refptr<ShareableBlobDataItem>> items = CreateSharedDataItems(builder); @@ -458,9 +459,8 @@ // Do the work to populate the file. EXPECT_EQ(1u, files_created_.size()); - EXPECT_TRUE( - builder.PopulateFutureFile(0, std::move(files_created_[0].file_reference), - files_created_[0].last_modified)); + EXPECT_TRUE(future_file.Populate(std::move(files_created_[0].file_reference), + files_created_[0].last_modified)); base::ThreadRestrictions::SetIOAllowed(true); files_created_.clear(); base::ThreadRestrictions::SetIOAllowed(false);
diff --git a/storage/browser/blob/blob_reader_unittest.cc b/storage/browser/blob/blob_reader_unittest.cc index 1b454e5..e3e5cd00 100644 --- a/storage/browser/blob/blob_reader_unittest.cc +++ b/storage/browser/blob/blob_reader_unittest.cc
@@ -1210,7 +1210,7 @@ std::vector<FileCreationInfo> files; BlobDataBuilder b(kUuid); - b.AppendFutureData(kDataSize); + BlobDataBuilder::FutureData future_data = b.AppendFutureData(kDataSize); BlobStatus can_populate_status = BlobStatus::ERR_INVALID_CONSTRUCTION_ARGUMENTS; blob_handle_ = context_.BuildBlob( @@ -1223,7 +1223,7 @@ EXPECT_EQ(BlobReader::Status::IO_PENDING, reader_->CalculateSize(base::Bind(&SetValue<int>, &size_result))); EXPECT_FALSE(reader_->IsInMemory()); - b.PopulateFutureData(0, kData.data(), 0, kDataSize); + future_data.Populate(base::make_span(kData.data(), kDataSize), 0); context_.NotifyTransportComplete(kUuid); base::RunLoop().RunUntilIdle(); CheckSizeCalculatedAsynchronously(kDataSize, size_result);
diff --git a/storage/browser/blob/blob_storage_context_unittest.cc b/storage/browser/blob/blob_storage_context_unittest.cc index 8870820..839c962d 100644 --- a/storage/browser/blob/blob_storage_context_unittest.cc +++ b/storage/browser/blob/blob_storage_context_unittest.cc
@@ -162,7 +162,7 @@ BlobStatus status = BlobStatus::ERR_INVALID_CONSTRUCTION_ARGUMENTS; BlobDataBuilder builder(kId); - builder.AppendFutureData(kSize); + BlobDataBuilder::FutureData future_data = builder.AppendFutureData(kSize); builder.set_content_type("text/plain"); EXPECT_EQ(0lu, context_->memory_controller().memory_usage()); std::unique_ptr<BlobDataHandle> handle = context_->BuildBlob( @@ -178,7 +178,7 @@ EXPECT_EQ(10u, context_->memory_controller().memory_usage()); - builder.PopulateFutureData(0, "abcdefghij", 0, 10u); + future_data.Populate(base::make_span("abcdefghij", 10), 0); context_->NotifyTransportComplete(kId); // Check we're done. @@ -530,7 +530,7 @@ BlobDataBuilder builder(kId1); builder.set_content_type("text/plain"); - builder.AppendFutureFile(0, 10, 0); + BlobDataBuilder::FutureFile future_file = builder.AppendFutureFile(0, 10, 0); BlobStatus status = BlobStatus::ERR_INVALID_CONSTRUCTION_ARGUMENTS; std::unique_ptr<BlobDataHandle> handle = context_->BuildBlob( @@ -556,7 +556,7 @@ ASSERT_EQ(1u, files_.size()); - builder.PopulateFutureFile(0, files_[0].file_reference, base::Time::Max()); + future_file.Populate(files_[0].file_reference, base::Time::Max()); context_->NotifyTransportComplete(kId1); EXPECT_EQ(BlobStatus::DONE, handle->GetBlobStatus()); @@ -728,24 +728,27 @@ // Appends data and data types that depend on the index. This is designed to // exercise all types of combinations of data, future data, files, future files, // and disk cache entries. -size_t AppendDataInBuilder(BlobDataBuilder* builder, - size_t index, - disk_cache::Entry* cache_entry) { +size_t AppendDataInBuilder( + BlobDataBuilder* builder, + std::vector<BlobDataBuilder::FutureData>* future_datas, + std::vector<BlobDataBuilder::FutureFile>* future_files, + size_t index, + disk_cache::Entry* cache_entry) { size_t size = 0; // We can't have both future data and future files, so split those up. if (index % 2 != 0) { - builder->AppendFutureData(5u); + future_datas->emplace_back(builder->AppendFutureData(5u)); size += 5u; if (index % 3 == 1) { builder->AppendData("abcdefghij", 4u); size += 4u; } if (index % 3 == 0) { - builder->AppendFutureData(1u); + future_datas->emplace_back(builder->AppendFutureData(1u)); size += 1u; } } else if (index % 3 == 0) { - builder->AppendFutureFile(0lu, 3lu, 0); + future_files->emplace_back(builder->AppendFutureFile(0lu, 3lu, 0)); size += 3u; } if (index % 5 != 0) { @@ -768,13 +771,16 @@ return index < kTotalRawBlobs && (index % 2 != 0 || index % 3 == 0); } -void PopulateDataInBuilder(BlobDataBuilder* builder, - size_t index, - base::TaskRunner* file_runner) { +void PopulateDataInBuilder( + BlobDataBuilder* builder, + std::vector<BlobDataBuilder::FutureData>* future_datas, + std::vector<BlobDataBuilder::FutureFile>* future_files, + size_t index, + base::TaskRunner* file_runner) { if (index % 2 != 0) { - builder->PopulateFutureData(0, "abcde", 0, 5); + (*future_datas)[0].Populate(base::make_span("abcde", 5), 0); if (index % 3 == 0) { - builder->PopulateFutureData(1, "z", 0, 1); + (*future_datas)[1].Populate(base::make_span("1", 1), 0); } } else if (index % 3 == 0) { scoped_refptr<ShareableFileReference> file_ref = @@ -782,7 +788,7 @@ base::FilePath::FromUTF8Unsafe( base::NumberToString(index + kTotalRawBlobs)), ShareableFileReference::DONT_DELETE_ON_FINAL_RELEASE, file_runner); - builder->PopulateFutureFile(0, file_ref, base::Time::Max()); + (*future_files)[0].Populate(file_ref, base::Time::Max()); } } } // namespace @@ -802,11 +808,16 @@ // This tests mixed blob content with both synchronous and asynchronous // construction. Blobs should also be paged to disk during execution. std::vector<std::unique_ptr<BlobDataBuilder>> builders; + std::vector<std::vector<BlobDataBuilder::FutureData>> future_datas; + std::vector<std::vector<BlobDataBuilder::FutureFile>> future_files; std::vector<size_t> sizes; for (size_t i = 0; i < kTotalRawBlobs; i++) { builders.emplace_back(new BlobDataBuilder(base::NumberToString(i))); + future_datas.emplace_back(); + future_files.emplace_back(); auto& builder = *builders.back(); - size_t size = AppendDataInBuilder(&builder, i, entry.get()); + size_t size = AppendDataInBuilder(&builder, &future_datas.back(), + &future_files.back(), i, entry.get()); EXPECT_NE(0u, size); sizes.push_back(size); } @@ -852,7 +863,8 @@ BlobDataBuilder* builder = builders[i].get(); if (DoesBuilderHaveFutureData(i) && !populated[i] && statuses[i] == BlobStatus::PENDING_TRANSPORT) { - PopulateDataInBuilder(builder, i, file_runner_.get()); + PopulateDataInBuilder(builder, &future_datas[i], &future_files[i], i, + file_runner_.get()); context_->NotifyTransportComplete(base::NumberToString(i)); populated[i] = true; } @@ -860,7 +872,7 @@ base::RunLoop().RunUntilIdle(); } while (file_runner_->HasPendingTask()); - // Check all builders with future items were signalled and populated. + // Check all builders with future items were signaled and populated. for (size_t i = 0; i < populated.size(); i++) { if (DoesBuilderHaveFutureData(i)) { EXPECT_EQ(BlobStatus::PENDING_TRANSPORT, statuses[i]) << i;
diff --git a/storage/browser/blob/blob_transport_strategy.cc b/storage/browser/blob/blob_transport_strategy.cc index 8ab4565..cb61b16 100644 --- a/storage/browser/blob/blob_transport_strategy.cc +++ b/storage/browser/blob/blob_transport_strategy.cc
@@ -48,7 +48,8 @@ void AddBytesElement(blink::mojom::DataElementBytes* bytes, const blink::mojom::BytesProviderPtr& data) override { - size_t builder_element_index = builder_->AppendFutureData(bytes->length); + BlobDataBuilder::FutureData future_data = + builder_->AppendFutureData(bytes->length); // base::Unretained is safe because |this| is guaranteed (by the contract // that code using BlobTransportStrategy should adhere to) to outlive the // BytesProvider. @@ -56,7 +57,7 @@ &blink::mojom::BytesProvider::RequestAsReply, base::Unretained(data.get()), base::BindOnce(&ReplyTransportStrategy::OnReply, base::Unretained(this), - builder_element_index, bytes->length))); + std::move(future_data), bytes->length))); } void BeginTransport( @@ -70,7 +71,7 @@ } private: - void OnReply(size_t builder_element_index, + void OnReply(BlobDataBuilder::FutureData future_data, size_t expected_size, const std::vector<uint8_t>& data) { if (data.size() != expected_size) { @@ -80,9 +81,10 @@ .Run(BlobStatus::ERR_INVALID_CONSTRUCTION_ARGUMENTS); return; } - bool populate_result = builder_->PopulateFutureData( - builder_element_index, reinterpret_cast<const char*>(data.data()), 0, - data.size()); + bool populate_result = future_data.Populate( + base::make_span(reinterpret_cast<const char*>(data.data()), + data.size()), + 0); DCHECK(populate_result); if (++num_resolved_requests_ == requests_.size()) @@ -106,17 +108,15 @@ void AddBytesElement(blink::mojom::DataElementBytes* bytes, const blink::mojom::BytesProviderPtr& data) override { // Split up the data in |max_bytes_data_item_size| sized chunks. + std::vector<BlobDataBuilder::FutureData> future_data; for (uint64_t source_offset = 0; source_offset < bytes->length; source_offset += limits_.max_bytes_data_item_size) { - size_t builder_element_index = - builder_->AppendFutureData(std::min<uint64_t>( - bytes->length - source_offset, limits_.max_bytes_data_item_size)); - if (source_offset == 0) { - requests_.push_back(base::BindOnce( - &DataPipeTransportStrategy::RequestDataPipe, base::Unretained(this), - data.get(), bytes->length, builder_element_index)); - } + future_data.push_back(builder_->AppendFutureData(std::min<uint64_t>( + bytes->length - source_offset, limits_.max_bytes_data_item_size))); } + requests_.push_back(base::BindOnce( + &DataPipeTransportStrategy::RequestDataPipe, base::Unretained(this), + data.get(), bytes->length, std::move(future_data))); } void BeginTransport( @@ -137,7 +137,7 @@ void RequestDataPipe(blink::mojom::BytesProvider* provider, size_t expected_source_size, - size_t first_builder_element_index) { + std::vector<BlobDataBuilder::FutureData> future_data) { // TODO(mek): Determine if the overhead of creating a new SharedMemory // segment for each BytesProvider is too much. If it is possible solutions // would include somehow teaching DataPipe to reuse the SharedMemory from a @@ -164,16 +164,18 @@ watcher_.Watch(consumer_handle_.get(), MOJO_HANDLE_SIGNAL_READABLE, base::Bind(&DataPipeTransportStrategy::OnDataPipeReadable, base::Unretained(this), expected_source_size, - first_builder_element_index)); + std::move(future_data))); } - void OnDataPipeReadable(size_t expected_full_source_size, - size_t first_builder_element_index, - MojoResult result) { + void OnDataPipeReadable( + size_t expected_full_source_size, + const std::vector<BlobDataBuilder::FutureData>& future_data, + MojoResult result) { // The index of the element data should currently be written to, relative to - // the first element of this stream (first_builder_element_index). + // the first element of this stream (the first item in future_data). size_t relative_element_index = current_source_offset_ / limits_.max_bytes_data_item_size; + DCHECK_LT(relative_element_index, future_data.size()); // The offset into the current element where data should be written next. size_t offset_in_builder_element = current_source_offset_ - @@ -204,12 +206,12 @@ num_bytes = std::min<uint32_t>(num_bytes, limits_.max_bytes_data_item_size - offset_in_builder_element); - char* output_buffer = builder_->GetFutureDataPointerToPopulate( - first_builder_element_index + relative_element_index, - offset_in_builder_element, num_bytes); - DCHECK(output_buffer); + base::span<char> output_buffer = + future_data[relative_element_index].GetDataToPopulate( + offset_in_builder_element, num_bytes); + DCHECK(output_buffer.data()); - std::memcpy(output_buffer, source_buffer, num_bytes); + std::memcpy(output_buffer.data(), source_buffer, num_bytes); read_result = consumer_handle_->EndReadData(num_bytes); DCHECK_EQ(read_result, MOJO_RESULT_OK); @@ -267,12 +269,12 @@ uint64_t element_size = std::min(bytes->length - source_offset, limits_.max_file_size - current_file_size_); - size_t builder_element_index = builder_->AppendFutureFile( + BlobDataBuilder::FutureFile future_file = builder_->AppendFutureFile( current_file_size_, element_size, file_requests_.size() - 1); num_unresolved_requests_++; file_requests_.back().push_back(Request{ - data.get(), source_offset, element_size, builder_element_index}); + data.get(), source_offset, element_size, std::move(future_file)}); source_offset += element_size; current_file_size_ += element_size; @@ -288,10 +290,10 @@ DCHECK_EQ(file_infos.size(), file_requests_.size()); for (size_t file_index = 0; file_index < file_requests_.size(); ++file_index) { - const auto& requests = file_requests_[file_index]; + auto& requests = file_requests_[file_index]; uint64_t file_offset = 0; for (size_t i = 0; i < requests.size(); ++i) { - const auto& request = requests[i]; + auto& request = requests[i]; base::File file = i == requests.size() - 1 ? std::move(file_infos[file_index].file) : file_infos[file_index].file.Duplicate(); @@ -303,7 +305,7 @@ file_offset, base::BindOnce(&FileTransportStrategy::OnReply, base::Unretained(this), - request.builder_element_index, + std::move(request.future_file), file_infos[file_index].file_reference)); file_offset += request.source_size; } @@ -311,7 +313,7 @@ } private: - void OnReply(size_t builder_element_index, + void OnReply(BlobDataBuilder::FutureFile future_file, const scoped_refptr<ShareableFileReference>& file_reference, base::Optional<base::Time> time_file_modified) { if (!time_file_modified) { @@ -320,8 +322,8 @@ return; } - bool populate_result = builder_->PopulateFutureFile( - builder_element_index, file_reference, *time_file_modified); + bool populate_result = + future_file.Populate(file_reference, *time_file_modified); DCHECK(populate_result); if (--num_unresolved_requests_ == 0) @@ -343,9 +345,8 @@ uint64_t source_offset; // Size of the bytes to request. uint64_t source_size; - // Index of the element in the BlobDataBuilder the data should be populated - // into. - size_t builder_element_index; + // Future file the data should be populated into. + BlobDataBuilder::FutureFile future_file; }; // For each file, a list of requests involving that file. std::vector<std::vector<Request>> file_requests_;
diff --git a/styleguide/c++/c++11.html b/styleguide/c++/c++11.html index 834ca0e46..6f8ed951 100644 --- a/styleguide/c++/c++11.html +++ b/styleguide/c++/c++11.html
@@ -385,6 +385,14 @@ </tr> <tr> +<td>Aggregate member initialization</td> +<td><code>struct Point { int x, y, z = 0; };<br>Point p = {2, 3};</code></td> +<td>Allows classes with default member initializers to be initialized with aggregate initialization, optionally omitting data members with such initializers.</td> +<td><a href="http://en.cppreference.com/w/cpp/language/aggregate_initialization">aggregate initialization</a></td> +<td><a href="https://groups.google.com/a/chromium.org/d/topic/cxx/WMBs3K9OQ_E/discussion">Discussion thread</a></td> +</tr> + +<tr> <td>Relaxed constant expressions</td> <td><code>constexpr int Factorial(int n) {<br> int result = 1;<br> while (n > 0)<br> result *= n--;<br> return result;<br>}</code></td> <td>Allows use of more declarations, conditional statements and loops inside <code>constexpr</code> functions.</td> @@ -969,14 +977,6 @@ </tr> <tr> -<td>Aggregate member initialization</td> -<td><code>struct Point { int x, y, z = 0; };<br>Point p = {2, 3};</code></td> -<td>Allows classes with default member initializers to be initialized with aggregate initialization, optionally omitting data members with such initializers.</td> -<td><a href="http://en.cppreference.com/w/cpp/language/aggregate_initialization">aggregate initialization</a></td> -<td></td> -</tr> - -<tr> <td>Binary literals</td> <td><code>int i = 0b1001;</code></td> <td>Allows defining literals in base two.</td>
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations index 9c99421..137eb5d 100644 --- a/third_party/WebKit/LayoutTests/TestExpectations +++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -1207,7 +1207,6 @@ crbug.com/637255 [ Win10 ] media/video-transformed.html [ Pass Failure ] crbug.com/760367 http/tests/devtools/console/console-tainted-globals.js [ NeedsManualRebaseline Timeout ] -crbug.com/760367 http/tests/devtools/runtime/runtime-callFunctionOn.js [ NeedsManualRebaseline Timeout ] # These tests pass but images do not match because tests are stricter than the spec. crbug.com/492664 external/wpt/css/css-writing-modes/text-combine-upright-value-all-001.html [ Failure ] @@ -1816,6 +1815,16 @@ crbug.com/800898 virtual/mojo-blobs/external/wpt/FileAPI/url/url-with-fetch.any.worker.html [ Pass Failure ] crbug.com/800898 virtual/mojo-blobs/external/wpt/FileAPI/url/url-with-xhr.any.worker.html [ Pass Failure ] +# Websockets +crbug.com/803558 external/wpt/websockets/Create-Secure-extensions-empty.htm [ Timeout ] +crbug.com/803558 external/wpt/websockets/constructor/014.html?wss [ Timeout ] +crbug.com/803558 external/wpt/websockets/keeping-connection-open/001.html?wss [ Timeout ] +crbug.com/803558 external/wpt/websockets/opening-handshake/003-sets-origin.worker.html [ Timeout ] +# Cannot be rebaselined because the output contains a timestamp and a random number. +crbug.com/803200 external/wpt/websockets/cookies/006.html?wss [ Failure ] +crbug.com/803200 external/wpt/websockets/opening-handshake/005.html?wss [ Pass Failure ] + + # ====== New tests from wpt-importer added here ====== crbug.com/626703 external/wpt/svg/path/closepath/segment-completing.svg [ Failure ] crbug.com/626703 external/wpt/svg/path/distance/pathLength-positive.svg [ Failure ] @@ -1998,7 +2007,6 @@ crbug.com/626703 external/wpt/webrtc/RTCPeerConnection-setLocalDescription-rollback.html [ Timeout ] crbug.com/626703 external/wpt/webrtc/RTCPeerConnection-setRemoteDescription.html [ Timeout ] crbug.com/626703 external/wpt/webrtc/RTCPeerConnection-setRemoteDescription-rollback.html [ Timeout ] -crbug.com/626703 external/wpt/websockets/Create-Secure-extensions-empty.htm [ Timeout ] crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/2_cues_overlapping_completely_move_up.html [ Failure ] crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/2_cues_overlapping_partially_move_down.html [ Failure ] crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/2_cues_overlapping_partially_move_up.html [ Failure ] @@ -2547,33 +2555,6 @@ crbug.com/709227 external/wpt/console/console-timeline-timelineEnd-historical.any.html [ Failure ] crbug.com/709227 external/wpt/console/console-timeline-timelineEnd-historical.any.worker.html [ Failure ] crbug.com/709227 external/wpt/html/browsers/history/the-location-interface/per-global.window.html [ Failure ] -crbug.com/709227 external/wpt/html/syntax/parsing/html5lib_isindex.html?run_type=uri [ Failure ] -crbug.com/709227 external/wpt/html/syntax/parsing/html5lib_isindex.html?run_type=write [ Failure ] -crbug.com/709227 external/wpt/html/syntax/parsing/html5lib_isindex.html?run_type=write_single [ Failure ] -crbug.com/709227 external/wpt/html/syntax/parsing/html5lib_menuitem-element.html?run_type=uri [ Failure ] -crbug.com/709227 external/wpt/html/syntax/parsing/html5lib_menuitem-element.html?run_type=write [ Failure ] -crbug.com/709227 external/wpt/html/syntax/parsing/html5lib_menuitem-element.html?run_type=write_single [ Failure ] -crbug.com/709227 external/wpt/html/syntax/parsing/html5lib_template.html?run_type=uri [ Failure ] -crbug.com/709227 external/wpt/html/syntax/parsing/html5lib_template.html?run_type=write [ Failure ] -crbug.com/709227 external/wpt/html/syntax/parsing/html5lib_template.html?run_type=write_single [ Failure ] -crbug.com/709227 external/wpt/html/syntax/parsing/html5lib_tests11.html?run_type=uri [ Failure ] -crbug.com/709227 external/wpt/html/syntax/parsing/html5lib_tests11.html?run_type=write [ Failure ] -crbug.com/709227 external/wpt/html/syntax/parsing/html5lib_tests11.html?run_type=write_single [ Failure ] -crbug.com/709227 external/wpt/html/syntax/parsing/html5lib_tests16.html?run_type=uri [ Failure Pass Timeout ] -crbug.com/709227 external/wpt/html/syntax/parsing/html5lib_tests16.html?run_type=write [ Failure Pass Timeout ] -crbug.com/709227 external/wpt/html/syntax/parsing/html5lib_tests16.html?run_type=write_single [ Failure Pass Timeout ] -crbug.com/709227 external/wpt/html/syntax/parsing/html5lib_tests19.html?run_type=uri [ Failure ] -crbug.com/709227 external/wpt/html/syntax/parsing/html5lib_tests19.html?run_type=write [ Failure ] -crbug.com/709227 external/wpt/html/syntax/parsing/html5lib_tests19.html?run_type=write_single [ Failure ] -crbug.com/709227 external/wpt/html/syntax/parsing/html5lib_tests2.html?run_type=uri [ Failure ] -crbug.com/709227 external/wpt/html/syntax/parsing/html5lib_tests2.html?run_type=write [ Failure ] -crbug.com/709227 external/wpt/html/syntax/parsing/html5lib_tests2.html?run_type=write_single [ Failure ] -crbug.com/709227 external/wpt/html/syntax/parsing/html5lib_tests25.html?run_type=uri [ Failure ] -crbug.com/709227 external/wpt/html/syntax/parsing/html5lib_tests25.html?run_type=write [ Failure ] -crbug.com/709227 external/wpt/html/syntax/parsing/html5lib_tests25.html?run_type=write_single [ Failure ] -crbug.com/709227 external/wpt/html/syntax/parsing/html5lib_webkit02.html?run_type=uri [ Failure ] -crbug.com/709227 external/wpt/html/syntax/parsing/html5lib_webkit02.html?run_type=write [ Failure ] -crbug.com/709227 external/wpt/html/syntax/parsing/html5lib_webkit02.html?run_type=write_single [ Failure ] crbug.com/709227 external/wpt/html/webappapis/scripting/events/event-handler-processing-algorithm-error/synthetic-errorevent-click.worker.html [ Failure ] crbug.com/709227 external/wpt/html/webappapis/scripting/events/event-handler-processing-algorithm-error/workerglobalscope-synthetic-errorevent.worker.html [ Failure ] crbug.com/709227 external/wpt/offscreen-canvas/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-1.worker.html [ Failure ] @@ -2598,70 +2579,9 @@ crbug.com/709227 external/wpt/offscreen-canvas/the-offscreen-canvas/size.attributes.parse.percent.worker.html [ Failure ] crbug.com/709227 external/wpt/offscreen-canvas/the-offscreen-canvas/size.attributes.parse.trailingjunk.worker.html [ Failure ] crbug.com/709227 external/wpt/user-timing/invoke_with_timing_attributes.worker.html [ Failure ] -crbug.com/709227 external/wpt/websockets/closing-handshake/002.html?wss [ Failure ] -crbug.com/709227 external/wpt/websockets/closing-handshake/003.html?wss [ Failure ] -crbug.com/709227 external/wpt/websockets/closing-handshake/004.html?wss [ Failure ] -crbug.com/709227 external/wpt/websockets/constructor/002.html [ Failure ] -crbug.com/709227 external/wpt/websockets/constructor/002.html?wss [ Failure ] -crbug.com/709227 external/wpt/websockets/constructor/006.html?wss [ Failure ] -crbug.com/709227 external/wpt/websockets/constructor/009.html?wss [ Failure ] -crbug.com/709227 external/wpt/websockets/constructor/013.html?wss [ Failure ] -crbug.com/709227 external/wpt/websockets/constructor/016.html?wss [ Failure ] -crbug.com/709227 external/wpt/websockets/constructor/018.html?wss [ Failure ] -crbug.com/709227 external/wpt/websockets/constructor/019.html?wss [ Failure ] -crbug.com/709227 external/wpt/websockets/constructor/020.html?wss [ Failure ] -crbug.com/709227 external/wpt/websockets/constructor/022.html?wss [ Failure ] -crbug.com/709227 external/wpt/websockets/cookies/001.html?wss [ Failure ] -crbug.com/709227 external/wpt/websockets/cookies/002.html?wss [ Failure ] -crbug.com/709227 external/wpt/websockets/cookies/003.html?wss [ Failure ] -crbug.com/709227 external/wpt/websockets/cookies/004.html?wss [ Failure ] -crbug.com/709227 external/wpt/websockets/cookies/005.html [ Failure ] -crbug.com/709227 external/wpt/websockets/cookies/005.html?wss [ Failure ] -crbug.com/709227 external/wpt/websockets/cookies/006.html?wss [ Failure ] -crbug.com/709227 external/wpt/websockets/cookies/007.html [ Failure ] -crbug.com/709227 external/wpt/websockets/cookies/007.html?wss [ Failure ] -crbug.com/709227 external/wpt/websockets/interfaces/CloseEvent/clean-close.html?wss [ Failure ] -crbug.com/709227 external/wpt/websockets/interfaces/WebSocket/bufferedAmount/bufferedAmount-getting.html?wss [ Failure ] -crbug.com/709227 external/wpt/websockets/interfaces/WebSocket/close/close-connecting.html [ Failure ] -crbug.com/709227 external/wpt/websockets/interfaces/WebSocket/close/close-connecting.html?wss [ Failure ] -crbug.com/709227 external/wpt/websockets/interfaces/WebSocket/close/close-nested.html [ Failure ] -crbug.com/709227 external/wpt/websockets/interfaces/WebSocket/close/close-nested.html?wss [ Failure ] -crbug.com/709227 external/wpt/websockets/interfaces/WebSocket/events/016.html?wss [ Failure ] -crbug.com/709227 external/wpt/websockets/interfaces/WebSocket/readyState/003.html [ Failure ] -crbug.com/709227 external/wpt/websockets/interfaces/WebSocket/readyState/003.html?wss [ Failure ] -crbug.com/709227 external/wpt/websockets/interfaces/WebSocket/readyState/006.html?wss [ Failure ] -crbug.com/709227 external/wpt/websockets/interfaces/WebSocket/readyState/007.html?wss [ Failure ] -crbug.com/709227 external/wpt/websockets/interfaces/WebSocket/readyState/008.html?wss [ Failure ] -crbug.com/709227 external/wpt/websockets/interfaces/WebSocket/send/007.html?wss [ Failure ] -crbug.com/709227 external/wpt/websockets/interfaces/WebSocket/send/008.html?wss [ Failure ] -crbug.com/709227 external/wpt/websockets/interfaces/WebSocket/send/009.html?wss [ Failure ] -crbug.com/709227 external/wpt/websockets/interfaces/WebSocket/send/011.html?wss [ Failure ] -crbug.com/709227 external/wpt/websockets/interfaces/WebSocket/send/012.html?wss [ Failure ] -crbug.com/709227 external/wpt/websockets/opening-handshake/002.html?wss [ Failure ] -crbug.com/709227 external/wpt/websockets/opening-handshake/005.html [ Failure ] -crbug.com/709227 external/wpt/websockets/unload-a-document/002.html [ Failure ] -crbug.com/709227 external/wpt/websockets/unload-a-document/002.html?wss [ Failure ] # Timeouts crbug.com/709227 external/wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/serialization-via-idb.any.worker.html [ Timeout ] -crbug.com/709227 external/wpt/websockets/binary/001.html?wss [ Timeout ] -crbug.com/709227 external/wpt/websockets/binary/002.html?wss [ Failure Timeout ] -crbug.com/709227 external/wpt/websockets/binary/004.html?wss [ Failure Timeout ] -crbug.com/709227 external/wpt/websockets/binary/005.html?wss [ Timeout ] -crbug.com/709227 external/wpt/websockets/constructor/014.html?wss [ Failure Timeout ] -crbug.com/709227 external/wpt/websockets/extended-payload-length.html?wss [ Failure Timeout ] -crbug.com/709227 external/wpt/websockets/interfaces/WebSocket/bufferedAmount/bufferedAmount-arraybuffer.html?wss [ Timeout ] -crbug.com/709227 external/wpt/websockets/interfaces/WebSocket/bufferedAmount/bufferedAmount-blob.html?wss [ Timeout ] -crbug.com/709227 external/wpt/websockets/interfaces/WebSocket/bufferedAmount/bufferedAmount-large.html?wss [ Failure Timeout ] -crbug.com/709227 external/wpt/websockets/interfaces/WebSocket/bufferedAmount/bufferedAmount-unicode.html?wss [ Timeout ] -crbug.com/709227 external/wpt/websockets/interfaces/WebSocket/events/018.html?wss [ Timeout ] -crbug.com/709227 external/wpt/websockets/interfaces/WebSocket/send/005.html?wss [ Timeout ] -crbug.com/709227 external/wpt/websockets/interfaces/WebSocket/send/006.html?wss [ Timeout ] -crbug.com/709227 external/wpt/websockets/interfaces/WebSocket/send/010.html?wss [ Timeout ] -crbug.com/709227 external/wpt/websockets/keeping-connection-open/001.html?wss [ Failure Timeout ] -crbug.com/709227 external/wpt/websockets/opening-handshake/003-sets-origin.worker.html [ Timeout ] -crbug.com/709227 external/wpt/websockets/opening-handshake/003.html?wss [ Failure Timeout ] -crbug.com/709227 external/wpt/websockets/opening-handshake/005.html?wss [ Failure Timeout ] crbug.com/709227 external/wpt/workers/nested_worker.worker.html [ Timeout ] # Crashes @@ -3002,15 +2922,9 @@ crbug.com/746128 [ Win7 Debug ] media/controls/video-enter-exit-fullscreen-without-hovering-doesnt-show-controls.html [ Failure ] crbug.com/746128 [ Win7 Debug ] virtual/new-remote-playback-pipeline/media/controls/video-enter-exit-fullscreen-without-hovering-doesnt-show-controls.html [ Failure ] -crbug.com/v8/4958 inspector-protocol/debugger/domdebugger-getEventListeners.js [ NeedsManualRebaseline ] crbug.com/v8/4958 http/tests/devtools/console/console-eval-scoped.js [ NeedsManualRebaseline ] crbug.com/v8/4958 http/tests/devtools/console/console-functions.js [ NeedsManualRebaseline ] crbug.com/v8/4958 http/tests/devtools/console/console-log-object-with-getter.js [ NeedsManualRebaseline ] -crbug.com/v8/4958 http/tests/devtools/runtime/runtime-getProperties.js [ NeedsManualRebaseline ] -crbug.com/v8/4958 http/tests/devtools/sources/debugger-pause/debugger-pause-in-internal.js [ NeedsManualRebaseline ] -crbug.com/v8/4958 http/tests/devtools/sources/debugger-ui/function-generator-details.js [ NeedsManualRebaseline ] -crbug.com/v8/4958 http/tests/devtools/sources/debugger-ui/watch-expressions-preserve-expansion.js [ NeedsManualRebaseline ] -crbug.com/v8/4958 http/tests/devtools/sources/debugger/properties-special.js [ NeedsManualRebaseline ] crbug.com/v8/4958 http/tests/devtools/console/console-format-es6.js [ NeedsManualRebaseline Timeout ] @@ -3511,9 +3425,8 @@ crbug.com/800359 [ Win7 ] external/wpt/mimesniff/mime-types/parsing.any.worker.html [ Pass Timeout ] # Sheriff failures 2018-01-18 -# This test is failing regularly on Win 7 (dgb), WebKit Mac10.11 (dgb), -# WebKit Linux Trusty (dbg). -crbug.com/803449 http/tests/devtools/sources/debugger-breakpoints/breakpoints-ui-restored-breakpoint.js [ Pass Failure ] - # This test has been flaky for some time on Win 7 (dgb) crbug.com/800078 [ Win7 ] http/tests/devtools/console/console-link-to-snippet.js [ Pass Failure ] + +# This test is flaking on mac_chromium_rel_ng. +crbug.com/800840 [ Mac ] virtual/wheelscrolllatching/fast/compositor-wheel-scroll-latching/touchpad-scroll-impl-to-main.html [ Pass Failure ]
diff --git a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssMatrixComponent.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssMatrixComponent.tentative.html similarity index 93% rename from third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssMatrixComponent.html rename to third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssMatrixComponent.tentative.html index 28e7308..2f1fcc1 100644 --- a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssMatrixComponent.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssMatrixComponent.tentative.html
@@ -2,8 +2,8 @@ <meta charset="utf-8"> <title>CSSMatrixComponent tests</title> <link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-cssmatrixcomponent-cssmatrixcomponent"> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> <script src="../resources/testhelper.js"></script> <script src="../resources/comparisons.js"></script> <script>
diff --git a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssPerspective.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssPerspective.tentative.html similarity index 93% rename from third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssPerspective.html rename to third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssPerspective.tentative.html index 892618ea..4fbd7ca 100644 --- a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssPerspective.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssPerspective.tentative.html
@@ -2,8 +2,8 @@ <meta charset="utf-8"> <title>CSSPerspective tests</title> <link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#cssperspective"> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> <script src="../resources/testhelper.js"></script> <script> 'use strict';
diff --git a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssPositionValue.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssPositionValue.tentative.html similarity index 94% rename from third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssPositionValue.html rename to third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssPositionValue.tentative.html index 32c7a72..db07c91 100644 --- a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssPositionValue.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssPositionValue.tentative.html
@@ -2,8 +2,8 @@ <meta charset="utf-8"> <title>CSSPositionValue tests</title> <link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#positionvalue-objects"> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> <script src="../resources/testhelper.js"></script> <script> 'use strict';
diff --git a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssRotation.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssRotation.tentative.html similarity index 96% rename from third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssRotation.html rename to third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssRotation.tentative.html index fe9d6ef..955d940 100644 --- a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssRotation.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssRotation.tentative.html
@@ -2,8 +2,8 @@ <meta charset="utf-8"> <title>CSSRotation tests</title> <link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#cssrotation"> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> <script src="../resources/testhelper.js"></script> <script> 'use strict';
diff --git a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssScale.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssScale.tentative.html similarity index 95% rename from third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssScale.html rename to third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssScale.tentative.html index af7a8f0..d52a8f1 100644 --- a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssScale.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssScale.tentative.html
@@ -2,8 +2,8 @@ <meta charset="utf-8"> <title>CSSScale tests</title> <link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#cssscale"> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> <script src="../resources/testhelper.js"></script> <script> 'use strict';
diff --git a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssSkew.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssSkew.tentative.html similarity index 94% rename from third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssSkew.html rename to third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssSkew.tentative.html index 7bb351a..2b22d9b 100644 --- a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssSkew.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssSkew.tentative.html
@@ -2,8 +2,8 @@ <meta charset="utf-8"> <title>CSSSkew tests</title> <link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#cssskew"> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> <script src="../resources/testhelper.js"></script> <script> 'use strict';
diff --git a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssTransformValue.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssTransformValue.tentative.html similarity index 97% rename from third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssTransformValue.html rename to third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssTransformValue.tentative.html index f84b5ee..16b46c1 100644 --- a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssTransformValue.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssTransformValue.tentative.html
@@ -2,8 +2,8 @@ <meta charset="utf-8"> <title>CSSTransformValue tests</title> <link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#transformvalue-objects"> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> <script src="../resources/testhelper.js"></script> <script src="../resources/comparisons.js"></script> <script>
diff --git a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssTranslation.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssTranslation.tentative.html similarity index 96% rename from third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssTranslation.html rename to third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssTranslation.tentative.html index 53651d47..808b0a1b 100644 --- a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssTranslation.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssTranslation.tentative.html
@@ -2,8 +2,8 @@ <meta charset="utf-8"> <title>CSSTranslation tests</title> <link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#csstranslation"> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> <script src="../resources/testhelper.js"></script> <script> 'use strict';
diff --git a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssUnparsedValue.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssUnparsedValue.tentative.html similarity index 87% rename from third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssUnparsedValue.html rename to third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssUnparsedValue.tentative.html index e663db4..ea65a9b3 100644 --- a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssUnparsedValue.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssUnparsedValue.tentative.html
@@ -2,8 +2,8 @@ <meta charset="utf-8"> <title>CSSUnparsedValue tests</title> <link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#unparsedvalue-objects"> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> <script src="../resources/testhelper.js"></script> <script> 'use strict';
diff --git a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssUrlImageValue.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssUrlImageValue.tentative.html similarity index 95% rename from third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssUrlImageValue.html rename to third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssUrlImageValue.tentative.html index 904b7d1..0f0625b4 100644 --- a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssUrlImageValue.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssUrlImageValue.tentative.html
@@ -2,8 +2,8 @@ <meta charset="utf-8"> <title>CSSURLImageValue tests</title> <link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#imagevalue-objects"> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> <script src="../resources/testhelper.js"></script> <body> <script>
diff --git a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssVariableReferenceValue-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssVariableReferenceValue.tentative-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssVariableReferenceValue-expected.txt rename to third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssVariableReferenceValue.tentative-expected.txt
diff --git a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssVariableReferenceValue.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssVariableReferenceValue.tentative.html similarity index 94% rename from third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssVariableReferenceValue.html rename to third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssVariableReferenceValue.tentative.html index 5b6e990..6ee711b 100644 --- a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssVariableReferenceValue.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssVariableReferenceValue.tentative.html
@@ -2,8 +2,8 @@ <meta charset="utf-8"> <title>CSSVariableReferenceValue tests</title> <link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#cssvariablereferencevalue"> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> <script src="../resources/testhelper.js"></script> <script> 'use strict';
diff --git a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/arithmetic.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/numeric-objects/arithmetic.tentative.html similarity index 97% rename from third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/arithmetic.html rename to third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/numeric-objects/arithmetic.tentative.html index 985cf59..4ba2751 100644 --- a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/arithmetic.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/numeric-objects/arithmetic.tentative.html
@@ -7,8 +7,8 @@ <link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-cssnumericvalue-div"> <link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-cssnumericvalue-min"> <link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-cssnumericvalue-max"> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> <script src="../../resources/testhelper.js"></script> <script> 'use strict';
diff --git a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/cssMathValue.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/numeric-objects/cssMathValue.tentative.html similarity index 94% rename from third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/cssMathValue.html rename to third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/numeric-objects/cssMathValue.tentative.html index 49debfb3..1be4edf 100644 --- a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/cssMathValue.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/numeric-objects/cssMathValue.tentative.html
@@ -2,8 +2,8 @@ <meta charset="utf-8"> <title>CSSMathValue subclass tests</title> <link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#complex-numeric"> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> <script src="../../resources/testhelper.js"></script> <script> 'use strict';
diff --git a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/cssUnitValue-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/numeric-objects/cssUnitValue.tentative-expected.txt similarity index 98% rename from third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/cssUnitValue-expected.txt rename to third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/numeric-objects/cssUnitValue.tentative-expected.txt index 86cd6a0f..cc34aaa 100644 --- a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/cssUnitValue-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/numeric-objects/cssUnitValue.tentative-expected.txt
@@ -1,4 +1,5 @@ This is a testharness.js-based test. +Found 72 tests; 62 PASS, 10 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS Constructing CSSUnitValue with an empty string as the unit throws a TypeError PASS Constructing CSSUnitValue with an invalid unit as the unit throws a TypeError PASS Updating CSSUnitValue.unit with an empty string throws a TypeError
diff --git a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/cssUnitValue.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/numeric-objects/cssUnitValue.tentative.html similarity index 90% rename from third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/cssUnitValue.html rename to third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/numeric-objects/cssUnitValue.tentative.html index bce8c21..9e74012 100644 --- a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/cssUnitValue.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/numeric-objects/cssUnitValue.tentative.html
@@ -2,8 +2,8 @@ <meta charset="utf-8"> <title>CSSUnitValue tests</title> <link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#simple-numeric"> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> <script src="../../resources/testhelper.js"></script> <script> 'use strict';
diff --git a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/equals.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/numeric-objects/equals.tentative.html similarity index 93% rename from third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/equals.html rename to third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/numeric-objects/equals.tentative.html index c6f186d..180d3de 100644 --- a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/equals.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/numeric-objects/equals.tentative.html
@@ -1,8 +1,8 @@ <meta charset="utf-8"> <title>CSSNumericValue.equals tests</title> <link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-cssnumericvalue-equals"> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> <script src="../../resources/testhelper.js"></script> <script> 'use strict';
diff --git a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/numeric-factory-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/numeric-objects/numeric-factory.tentative-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/numeric-factory-expected.txt rename to third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/numeric-objects/numeric-factory.tentative-expected.txt
diff --git a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/numeric-factory.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/numeric-objects/numeric-factory.tentative.html similarity index 83% rename from third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/numeric-factory.html rename to third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/numeric-objects/numeric-factory.tentative.html index 1529adb15..51b282b6 100644 --- a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/numeric-factory.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/numeric-objects/numeric-factory.tentative.html
@@ -2,8 +2,8 @@ <meta charset="utf-8"> <title>CSS numeric factory function tests</title> <link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#numeric-factory"> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> <script src="../../resources/testhelper.js"></script> <script> 'use strict';
diff --git a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/numeric-typing.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/numeric-objects/numeric-typing.tentative.html similarity index 93% rename from third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/numeric-typing.html rename to third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/numeric-objects/numeric-typing.tentative.html index 24ffadc6..d0a7bf1 100644 --- a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/numeric-typing.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/numeric-objects/numeric-typing.tentative.html
@@ -2,8 +2,8 @@ <meta charset="utf-8"> <title>Numeric value typing tests</title> <link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#numeric-typing"> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> <script> 'use strict';
diff --git a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/parse.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/numeric-objects/parse.tentative.html similarity index 87% rename from third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/parse.html rename to third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/numeric-objects/parse.tentative.html index 0aff038..6b623c2 100644 --- a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/parse.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/numeric-objects/parse.tentative.html
@@ -1,8 +1,8 @@ <meta charset="utf-8"> <title>CSSNumericValue.parse tests</title> <link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-cssnumericvalue-parse"> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> <script src="../../resources/testhelper.js"></script> <script> 'use strict';
diff --git a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/to.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/numeric-objects/to.tentative.html similarity index 96% rename from third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/to.html rename to third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/numeric-objects/to.tentative.html index 209b4b86..57ac631 100644 --- a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/to.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/numeric-objects/to.tentative.html
@@ -1,8 +1,8 @@ <meta charset="utf-8"> <title>CSSNumericValue.to tests</title> <link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-cssnumericvalue-to"> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> <script src="../../resources/testhelper.js"></script> <script> 'use strict';
diff --git a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/toSum.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/numeric-objects/toSum.tentative.html similarity index 95% rename from third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/toSum.html rename to third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/numeric-objects/toSum.tentative.html index af0e93b..3d67f7d 100644 --- a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/toSum.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/numeric-objects/toSum.tentative.html
@@ -1,8 +1,8 @@ <meta charset="utf-8"> <title>CSSNumericValue.toSum tests</title> <link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-cssnumericvalue-tosum"> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> <script src="../../resources/testhelper.js"></script> <script> 'use strict';
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_menuitem-element_run_type=uri-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_menuitem-element_run_type=uri-expected.txt new file mode 100644 index 0000000..7b7a96b --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_menuitem-element_run_type=uri-expected.txt
@@ -0,0 +1,23 @@ +This is a testharness.js-based test. +PASS html5lib_menuitem-element.html e61b5db0435eb768ec21c1aa7355c649e7969c17 +PASS html5lib_menuitem-element.html 9c975c544402eed521499270b0e97cfa78f155b0 +PASS html5lib_menuitem-element.html d46fa11c0107d59c84778beae84f388f55bffc31 +FAIL html5lib_menuitem-element.html afcd3b1e3317ac609ddab924d836ba1e3873b80f assert_equals: expected "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <menuitem>\n| \"A\"\n| <menuitem>\n| \"B\"" but got "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <menuitem>\n| \"A\"\n| <menuitem>\n| \"B\"" +FAIL html5lib_menuitem-element.html 95c0c6923fe609297c1592f2cb82bb9f2d0f5aed assert_equals: expected "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <menuitem>\n| \"A\"\n| <menu>\n| \"B\"" but got "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <menuitem>\n| \"A\"\n| <menu>\n| \"B\"" +FAIL html5lib_menuitem-element.html e2772fe779cbcefb4458f169a0cd495cf7115845 assert_equals: expected "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <menuitem>\n| \"A\"\n| <hr>\n| \"B\"" but got "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <menuitem>\n| \"A\"\n| <hr>\n| \"B\"" +PASS html5lib_menuitem-element.html 7a9fa28f6207f045ebb0aa49938debd0c1e7123e +PASS html5lib_menuitem-element.html 798bb352d9f256153340661e1277e44674f1026d +PASS html5lib_menuitem-element.html f2b5a63d94f108207a7a998216222dc24bea4850 +PASS html5lib_menuitem-element.html 778c027d06495eb361dd83baa561feb3a21ec3ea +PASS html5lib_menuitem-element.html e4670bee2ce790e82c26a33319b7fe082fbbdaea +PASS html5lib_menuitem-element.html 79307be24287ca5d0533dfa81b91dd826f5f5e0e +PASS html5lib_menuitem-element.html 9b995cb730b12529e8e755e4a0b0a2e73d1dfcfa +PASS html5lib_menuitem-element.html d4586cd7706bbb3a5b127c52c1f2861d1a3fb781 +PASS html5lib_menuitem-element.html e2adbd7bf4c7480343cfb8f69289c824be613853 +PASS html5lib_menuitem-element.html b56d35c73f38f04ad6fdf51aa88f4b70a93ddc48 +PASS html5lib_menuitem-element.html 0f95585196dae2b1b5164e8c27897699c464c35f +PASS html5lib_menuitem-element.html 03664aa93a55daceccc26d99c0aef841d8862af5 +PASS html5lib_menuitem-element.html 6d596b9e342db2306365fbdfb7615377c5b26347 +PASS html5lib_menuitem-element.html 4b712b488be9ee047c139c1b0cd955bae990b8e5 +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_menuitem-element_run_type=write-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_menuitem-element_run_type=write-expected.txt new file mode 100644 index 0000000..7b7a96b --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_menuitem-element_run_type=write-expected.txt
@@ -0,0 +1,23 @@ +This is a testharness.js-based test. +PASS html5lib_menuitem-element.html e61b5db0435eb768ec21c1aa7355c649e7969c17 +PASS html5lib_menuitem-element.html 9c975c544402eed521499270b0e97cfa78f155b0 +PASS html5lib_menuitem-element.html d46fa11c0107d59c84778beae84f388f55bffc31 +FAIL html5lib_menuitem-element.html afcd3b1e3317ac609ddab924d836ba1e3873b80f assert_equals: expected "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <menuitem>\n| \"A\"\n| <menuitem>\n| \"B\"" but got "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <menuitem>\n| \"A\"\n| <menuitem>\n| \"B\"" +FAIL html5lib_menuitem-element.html 95c0c6923fe609297c1592f2cb82bb9f2d0f5aed assert_equals: expected "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <menuitem>\n| \"A\"\n| <menu>\n| \"B\"" but got "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <menuitem>\n| \"A\"\n| <menu>\n| \"B\"" +FAIL html5lib_menuitem-element.html e2772fe779cbcefb4458f169a0cd495cf7115845 assert_equals: expected "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <menuitem>\n| \"A\"\n| <hr>\n| \"B\"" but got "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <menuitem>\n| \"A\"\n| <hr>\n| \"B\"" +PASS html5lib_menuitem-element.html 7a9fa28f6207f045ebb0aa49938debd0c1e7123e +PASS html5lib_menuitem-element.html 798bb352d9f256153340661e1277e44674f1026d +PASS html5lib_menuitem-element.html f2b5a63d94f108207a7a998216222dc24bea4850 +PASS html5lib_menuitem-element.html 778c027d06495eb361dd83baa561feb3a21ec3ea +PASS html5lib_menuitem-element.html e4670bee2ce790e82c26a33319b7fe082fbbdaea +PASS html5lib_menuitem-element.html 79307be24287ca5d0533dfa81b91dd826f5f5e0e +PASS html5lib_menuitem-element.html 9b995cb730b12529e8e755e4a0b0a2e73d1dfcfa +PASS html5lib_menuitem-element.html d4586cd7706bbb3a5b127c52c1f2861d1a3fb781 +PASS html5lib_menuitem-element.html e2adbd7bf4c7480343cfb8f69289c824be613853 +PASS html5lib_menuitem-element.html b56d35c73f38f04ad6fdf51aa88f4b70a93ddc48 +PASS html5lib_menuitem-element.html 0f95585196dae2b1b5164e8c27897699c464c35f +PASS html5lib_menuitem-element.html 03664aa93a55daceccc26d99c0aef841d8862af5 +PASS html5lib_menuitem-element.html 6d596b9e342db2306365fbdfb7615377c5b26347 +PASS html5lib_menuitem-element.html 4b712b488be9ee047c139c1b0cd955bae990b8e5 +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_menuitem-element_run_type=write_single-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_menuitem-element_run_type=write_single-expected.txt new file mode 100644 index 0000000..7b7a96b --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_menuitem-element_run_type=write_single-expected.txt
@@ -0,0 +1,23 @@ +This is a testharness.js-based test. +PASS html5lib_menuitem-element.html e61b5db0435eb768ec21c1aa7355c649e7969c17 +PASS html5lib_menuitem-element.html 9c975c544402eed521499270b0e97cfa78f155b0 +PASS html5lib_menuitem-element.html d46fa11c0107d59c84778beae84f388f55bffc31 +FAIL html5lib_menuitem-element.html afcd3b1e3317ac609ddab924d836ba1e3873b80f assert_equals: expected "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <menuitem>\n| \"A\"\n| <menuitem>\n| \"B\"" but got "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <menuitem>\n| \"A\"\n| <menuitem>\n| \"B\"" +FAIL html5lib_menuitem-element.html 95c0c6923fe609297c1592f2cb82bb9f2d0f5aed assert_equals: expected "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <menuitem>\n| \"A\"\n| <menu>\n| \"B\"" but got "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <menuitem>\n| \"A\"\n| <menu>\n| \"B\"" +FAIL html5lib_menuitem-element.html e2772fe779cbcefb4458f169a0cd495cf7115845 assert_equals: expected "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <menuitem>\n| \"A\"\n| <hr>\n| \"B\"" but got "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <menuitem>\n| \"A\"\n| <hr>\n| \"B\"" +PASS html5lib_menuitem-element.html 7a9fa28f6207f045ebb0aa49938debd0c1e7123e +PASS html5lib_menuitem-element.html 798bb352d9f256153340661e1277e44674f1026d +PASS html5lib_menuitem-element.html f2b5a63d94f108207a7a998216222dc24bea4850 +PASS html5lib_menuitem-element.html 778c027d06495eb361dd83baa561feb3a21ec3ea +PASS html5lib_menuitem-element.html e4670bee2ce790e82c26a33319b7fe082fbbdaea +PASS html5lib_menuitem-element.html 79307be24287ca5d0533dfa81b91dd826f5f5e0e +PASS html5lib_menuitem-element.html 9b995cb730b12529e8e755e4a0b0a2e73d1dfcfa +PASS html5lib_menuitem-element.html d4586cd7706bbb3a5b127c52c1f2861d1a3fb781 +PASS html5lib_menuitem-element.html e2adbd7bf4c7480343cfb8f69289c824be613853 +PASS html5lib_menuitem-element.html b56d35c73f38f04ad6fdf51aa88f4b70a93ddc48 +PASS html5lib_menuitem-element.html 0f95585196dae2b1b5164e8c27897699c464c35f +PASS html5lib_menuitem-element.html 03664aa93a55daceccc26d99c0aef841d8862af5 +PASS html5lib_menuitem-element.html 6d596b9e342db2306365fbdfb7615377c5b26347 +PASS html5lib_menuitem-element.html 4b712b488be9ee047c139c1b0cd955bae990b8e5 +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_template_run_type=uri-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_template_run_type=uri-expected.txt new file mode 100644 index 0000000..cbb6f286 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_template_run_type=uri-expected.txt
@@ -0,0 +1,111 @@ +This is a testharness.js-based test. +Found 107 tests; 103 PASS, 4 FAIL, 0 TIMEOUT, 0 NOTRUN. +PASS html5lib_template.html 010950d55f4eccf16e9c4af1d263bb747294c646 +PASS html5lib_template.html a838bd54410cef059a42eea9606356488e16535b +PASS html5lib_template.html 27fb9111f6675a7e033b867480c0afddcda161a6 +PASS html5lib_template.html aee883a65775489399a003b2371d58248a6aff6f +PASS html5lib_template.html 89b17b54ab343191bf74ef5434f4d2cfac40ea97 +PASS html5lib_template.html c4433556c7414cfd71f27b420f1ffc4348774f5e +PASS html5lib_template.html 3dcce7d97108b3e9ea7fa96f240ac62bf280e74b +PASS html5lib_template.html a1f587f7ea85ccfe294bd45bfb501e850cb979e0 +PASS html5lib_template.html cd26a7832f13bdc135697321ca6c2fecdca6ef5d +PASS html5lib_template.html e30571d90b0e56864499961eb7be955994cf72e2 +PASS html5lib_template.html 01cbe9f6a25f286b08d8dc4f7b65421e8eb3500c +PASS html5lib_template.html 96cbbcdffe02c86a8b929604c2fd5f3571a18dbe +PASS html5lib_template.html d51676f55550e960dd0f5fa7fd0bdfa20bdde046 +PASS html5lib_template.html f9dfd9acfd494489c899604649a01d864741f50f +PASS html5lib_template.html ea00361c265d3ffb47ce636d919c94ca10d58911 +PASS html5lib_template.html d8ebfcf7694c9d04457e796ac73049210313602e +PASS html5lib_template.html b4d5e6fe9b92e2c8f54199d7cab3da383c42add0 +PASS html5lib_template.html 07724ef8f7a4fa61c77ffcd5180d3101c4781502 +PASS html5lib_template.html e90f8aae8fc690540b42b3ffa3e741e7c1dfbf43 +PASS html5lib_template.html 687bdf4adda88a316ec69fe20e84720acc5d1fe6 +PASS html5lib_template.html 5b232642f472c2b4c0c7511fed464eebe686b427 +PASS html5lib_template.html dc1ac1830a881d1532a1e6fd6d0cfa56d6571da2 +PASS html5lib_template.html c58747a85e8b4f44d7ae63c04cdad783a903c25e +PASS html5lib_template.html ca59bfdaec7451f704973176fab46e582bd691b2 +PASS html5lib_template.html cf807d6391a58c172b6c15c3b01d2a99ec0e6cf8 +PASS html5lib_template.html 350b7ac850e46de79615308fc923649264406104 +PASS html5lib_template.html a31ff44edf7f377543dabdda8141cda9bb6de134 +PASS html5lib_template.html 533c5c1b5f0d0cbb1ede2cc5ae927095c5b21f0b +PASS html5lib_template.html 61f79e083005007853c4f8e431559ac8d3845cfd +PASS html5lib_template.html e802e85f36792b176b73c102c0e8761d9478621d +PASS html5lib_template.html 51d0797ff7653cd7be34458d689146e08a666c7f +PASS html5lib_template.html d60e4079a18bd6266740cc61d1ca736e9d5098ce +PASS html5lib_template.html 308709292677b4d74c108a811ad7b7acd0bdfc9c +PASS html5lib_template.html 8965cdf9c4e9936262e25c90c7a7f8673840a445 +PASS html5lib_template.html 7dccda789764beb489e09be10188af9347335d05 +PASS html5lib_template.html e15be51c77e1a6de35568a099ed339440ce9426d +PASS html5lib_template.html 503d3782e45940c19f096f360a092282b46ab1ea +PASS html5lib_template.html b4ab56fd9e9cebf479d14adfa523c06d16483a5e +PASS html5lib_template.html cd8bc9521f9683086a9e8529dd97314a6869daeb +FAIL html5lib_template.html f915e7b3407c24b28c3aad318e5693cc774020f4 assert_equals: expected "#document\n| <html>\n| <head>\n| <frameset>\n| <frame>" but got "#document\n| <html>\n| <head>\n| <frameset>\n| <template>\n| content\n| <frame>" +FAIL html5lib_template.html 3c5eb261787b3d15aff86fa61de773fd7e439b0e assert_equals: expected "#document\n| <html>\n| <head>\n| <template>\n| content\n| <body>" but got "#document\n| <html>\n| <head>\n| <template>\n| content\n| <frame>\n| <frame>\n| <body>" +PASS html5lib_template.html 2b57775750c198d4b98b23aed74ff80a866a01f5 +PASS html5lib_template.html dc3d016610f3ab532525a6c2871f03d6b62b0168 +PASS html5lib_template.html 6a184d71d00580a26a8b6bd97aafe5503339f3f6 +PASS html5lib_template.html ce570a6c4bcee8b72a03e25508c6dd72e3cc6c35 +PASS html5lib_template.html e0c3d922f7b1f1654f02f716c3d9b31198ce3385 +PASS html5lib_template.html 87e67242bf6debcf3b7dca852d10aa0f7b625b28 +PASS html5lib_template.html 35ac4d4c972a01d368ed0cacb41370efef0a644d +PASS html5lib_template.html 5226c39dfc2d624ad4191b4eacb7e40c7ae528eb +PASS html5lib_template.html aa90cd4db6b12e0a47341914a90cc536eec32d64 +PASS html5lib_template.html 48af1faf5fcf48a0854af5a5c33656d9ccf6736b +PASS html5lib_template.html ed3a029ba5e7f59969d65a4fc490a8f13b098cb9 +PASS html5lib_template.html 6c8880d54475ad9574e203dcf2e55820b123cc64 +PASS html5lib_template.html 275060925a844cb51b29bae660301de9780d68c8 +PASS html5lib_template.html 9f82f6ec4c0a48c1d4dfbe6803b94abd553aea88 +PASS html5lib_template.html f094bf7e94a88b86c80a0643e70c8e5ff3354698 +PASS html5lib_template.html 35a07ec3b4bf26ea407dc1ddf52f14195a714059 +PASS html5lib_template.html 24faa53b271f994a4ff31d5796c8ff47d6f2c3e6 +PASS html5lib_template.html 0f1c491b58c2dd3c402a62e37f833bc1f1db8d21 +PASS html5lib_template.html 868d918a7b5d8b5c065c15229492bc2022bfbcba +PASS html5lib_template.html 0538efa44e857596c556033a3821d424378aea3f +PASS html5lib_template.html e7d7bf3973c70d3cf9b0adad2ebed9f25be48d66 +PASS html5lib_template.html c69d0ac542d477b7312bb24981127b8aa8fdb1df +PASS html5lib_template.html b496a8c13a7bd75b778bb0de489726aee952ae0c +PASS html5lib_template.html 5d6ee61de40274c9626ca78ee208d51276d5662d +PASS html5lib_template.html 9bd9687a65f258adc24450fc5cbd781fff6c038a +FAIL html5lib_template.html db1baeb846d718c773324746524fbd68f2e9436e assert_equals: expected "#document\n| <html>\n| a=\"b\"\n| <head>\n| <template>\n| content\n| <body>" but got "#document\n| <html>\n| a=\"b\"\n| <head>\n| <template>\n| content\n| <frame>\n| <frame>\n| <body>" +PASS html5lib_template.html 4b0ce46c611dbcc016db272ef007f302bee0c897 +PASS html5lib_template.html 1a735e1c7f28f8701f3c7fd5e9404b8911916086 +PASS html5lib_template.html 0686eedec06b2db1dc283fac92c1ef1a33114c71 +PASS html5lib_template.html d4dfb87ce626f12923056a6cd77448eaf4660ac2 +PASS html5lib_template.html 1f295920f2937b2c8023b3761c43a0d4d9e5353c +PASS html5lib_template.html 3b91fa08fad923d387d924cff37fbf6b4c3a5712 +PASS html5lib_template.html 45a1c1ad5d99ad67c573096a79253996a664e01b +PASS html5lib_template.html 0fe3a66773c6048c8f6f2c92f2611f65be972ec1 +PASS html5lib_template.html be40897ca411e1507197c31ab2a9f9752a05f769 +PASS html5lib_template.html dcfb1048ed5c40e406b4fbf0cde24c826713907f +PASS html5lib_template.html 78263aeea68ac97903598682013bae9c0c21d547 +PASS html5lib_template.html 5aa177ef1a35bf4502dcb867d8e666288982ba99 +PASS html5lib_template.html 5d303375907dc4d4380b477e0317c17b660613e9 +PASS html5lib_template.html d822f726927c34b92fe102b13e63920850878f6a +PASS html5lib_template.html 07acdcaeb4fa639296d46673cf28823ddf2a6ca7 +PASS html5lib_template.html 58bd846ce1be0caf7560fba2ef19e2c2070ab123 +PASS html5lib_template.html 8eeee377e5ab324731cc592f1fa8abe1045ad610 +PASS html5lib_template.html b30690019090149132fc228a7261c5cf2fd149fc +PASS html5lib_template.html 67a209d928804f90fdb66d070201b23f3d0c8a42 +PASS html5lib_template.html 12104886b8f87daa937eac30b5ff0e1e074eaa6f +PASS html5lib_template.html 483cc9957a7225fe435112642be59abb4c459a1e +PASS html5lib_template.html 72d8ac431a154c40ab75d53a258d9d80d47689eb +PASS html5lib_template.html 1125967cbbcd404f4cb14d48270b8ec778970d77 +PASS html5lib_template.html 32c963e164b9ec82c60e490bb141c1ccc70b992f +PASS html5lib_template.html 574a95fc9c9f2de3aeaa0c9ee1e6967fc3d4770d +FAIL html5lib_template.html 332863a7f9e61bff32bd3427ede7a088b790d453 assert_equals: expected "#document\n| <html>\n| <head>\n| <template>\n| content\n| <template>\n| content\n| <body>" but got "#document\n| <html>\n| <head>\n| <template>\n| content\n| <template>\n| content\n| <frame>\n| <body>" +PASS html5lib_template.html 2121db07146781773df9e53b94fa921a805175ce +PASS html5lib_template.html 8675de267cd7e34f2febdee3feb665614d1562fe +PASS html5lib_template.html c5d26ad923a2b1e988ddd378ca4fb26eb48353e1 +PASS html5lib_template.html eec1542e2fa0e9eafb7f8d4a51eae56b5a31b3c8 +PASS html5lib_template.html b79387a54c3b136db0f28ed96555ff683b3947fe +PASS html5lib_template.html c477a29a4deb32d072a415fa809a84a4f2beee0c +PASS html5lib_template.html 26e4480c08e1f5f7b6ac8b8c1832ab0312e3b7c5 +PASS html5lib_template.html 24b3b50fdd0bf8d5cf2ebaa6bf502d7bcfde1da4 +PASS html5lib_template.html d3704c68528357189eb5826ab66eea071d6137a5 +PASS html5lib_template.html d958f7d44faf772d1fb60f1a8f186f837ca735d9 +PASS html5lib_template.html 3fc4d97fa68fc2658356bdbd4e051c867de8de53 +PASS html5lib_template.html 94820107bbf3fab3f82de1f717e8413aead7d3a6 +PASS html5lib_template.html 657c00ebdda37ae060cc69633ed98482ccc29e18 +PASS html5lib_template.html 649fc955a4b60ab2a5b881d94c9493eb4a545002 +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_template_run_type=write-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_template_run_type=write-expected.txt new file mode 100644 index 0000000..cbb6f286 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_template_run_type=write-expected.txt
@@ -0,0 +1,111 @@ +This is a testharness.js-based test. +Found 107 tests; 103 PASS, 4 FAIL, 0 TIMEOUT, 0 NOTRUN. +PASS html5lib_template.html 010950d55f4eccf16e9c4af1d263bb747294c646 +PASS html5lib_template.html a838bd54410cef059a42eea9606356488e16535b +PASS html5lib_template.html 27fb9111f6675a7e033b867480c0afddcda161a6 +PASS html5lib_template.html aee883a65775489399a003b2371d58248a6aff6f +PASS html5lib_template.html 89b17b54ab343191bf74ef5434f4d2cfac40ea97 +PASS html5lib_template.html c4433556c7414cfd71f27b420f1ffc4348774f5e +PASS html5lib_template.html 3dcce7d97108b3e9ea7fa96f240ac62bf280e74b +PASS html5lib_template.html a1f587f7ea85ccfe294bd45bfb501e850cb979e0 +PASS html5lib_template.html cd26a7832f13bdc135697321ca6c2fecdca6ef5d +PASS html5lib_template.html e30571d90b0e56864499961eb7be955994cf72e2 +PASS html5lib_template.html 01cbe9f6a25f286b08d8dc4f7b65421e8eb3500c +PASS html5lib_template.html 96cbbcdffe02c86a8b929604c2fd5f3571a18dbe +PASS html5lib_template.html d51676f55550e960dd0f5fa7fd0bdfa20bdde046 +PASS html5lib_template.html f9dfd9acfd494489c899604649a01d864741f50f +PASS html5lib_template.html ea00361c265d3ffb47ce636d919c94ca10d58911 +PASS html5lib_template.html d8ebfcf7694c9d04457e796ac73049210313602e +PASS html5lib_template.html b4d5e6fe9b92e2c8f54199d7cab3da383c42add0 +PASS html5lib_template.html 07724ef8f7a4fa61c77ffcd5180d3101c4781502 +PASS html5lib_template.html e90f8aae8fc690540b42b3ffa3e741e7c1dfbf43 +PASS html5lib_template.html 687bdf4adda88a316ec69fe20e84720acc5d1fe6 +PASS html5lib_template.html 5b232642f472c2b4c0c7511fed464eebe686b427 +PASS html5lib_template.html dc1ac1830a881d1532a1e6fd6d0cfa56d6571da2 +PASS html5lib_template.html c58747a85e8b4f44d7ae63c04cdad783a903c25e +PASS html5lib_template.html ca59bfdaec7451f704973176fab46e582bd691b2 +PASS html5lib_template.html cf807d6391a58c172b6c15c3b01d2a99ec0e6cf8 +PASS html5lib_template.html 350b7ac850e46de79615308fc923649264406104 +PASS html5lib_template.html a31ff44edf7f377543dabdda8141cda9bb6de134 +PASS html5lib_template.html 533c5c1b5f0d0cbb1ede2cc5ae927095c5b21f0b +PASS html5lib_template.html 61f79e083005007853c4f8e431559ac8d3845cfd +PASS html5lib_template.html e802e85f36792b176b73c102c0e8761d9478621d +PASS html5lib_template.html 51d0797ff7653cd7be34458d689146e08a666c7f +PASS html5lib_template.html d60e4079a18bd6266740cc61d1ca736e9d5098ce +PASS html5lib_template.html 308709292677b4d74c108a811ad7b7acd0bdfc9c +PASS html5lib_template.html 8965cdf9c4e9936262e25c90c7a7f8673840a445 +PASS html5lib_template.html 7dccda789764beb489e09be10188af9347335d05 +PASS html5lib_template.html e15be51c77e1a6de35568a099ed339440ce9426d +PASS html5lib_template.html 503d3782e45940c19f096f360a092282b46ab1ea +PASS html5lib_template.html b4ab56fd9e9cebf479d14adfa523c06d16483a5e +PASS html5lib_template.html cd8bc9521f9683086a9e8529dd97314a6869daeb +FAIL html5lib_template.html f915e7b3407c24b28c3aad318e5693cc774020f4 assert_equals: expected "#document\n| <html>\n| <head>\n| <frameset>\n| <frame>" but got "#document\n| <html>\n| <head>\n| <frameset>\n| <template>\n| content\n| <frame>" +FAIL html5lib_template.html 3c5eb261787b3d15aff86fa61de773fd7e439b0e assert_equals: expected "#document\n| <html>\n| <head>\n| <template>\n| content\n| <body>" but got "#document\n| <html>\n| <head>\n| <template>\n| content\n| <frame>\n| <frame>\n| <body>" +PASS html5lib_template.html 2b57775750c198d4b98b23aed74ff80a866a01f5 +PASS html5lib_template.html dc3d016610f3ab532525a6c2871f03d6b62b0168 +PASS html5lib_template.html 6a184d71d00580a26a8b6bd97aafe5503339f3f6 +PASS html5lib_template.html ce570a6c4bcee8b72a03e25508c6dd72e3cc6c35 +PASS html5lib_template.html e0c3d922f7b1f1654f02f716c3d9b31198ce3385 +PASS html5lib_template.html 87e67242bf6debcf3b7dca852d10aa0f7b625b28 +PASS html5lib_template.html 35ac4d4c972a01d368ed0cacb41370efef0a644d +PASS html5lib_template.html 5226c39dfc2d624ad4191b4eacb7e40c7ae528eb +PASS html5lib_template.html aa90cd4db6b12e0a47341914a90cc536eec32d64 +PASS html5lib_template.html 48af1faf5fcf48a0854af5a5c33656d9ccf6736b +PASS html5lib_template.html ed3a029ba5e7f59969d65a4fc490a8f13b098cb9 +PASS html5lib_template.html 6c8880d54475ad9574e203dcf2e55820b123cc64 +PASS html5lib_template.html 275060925a844cb51b29bae660301de9780d68c8 +PASS html5lib_template.html 9f82f6ec4c0a48c1d4dfbe6803b94abd553aea88 +PASS html5lib_template.html f094bf7e94a88b86c80a0643e70c8e5ff3354698 +PASS html5lib_template.html 35a07ec3b4bf26ea407dc1ddf52f14195a714059 +PASS html5lib_template.html 24faa53b271f994a4ff31d5796c8ff47d6f2c3e6 +PASS html5lib_template.html 0f1c491b58c2dd3c402a62e37f833bc1f1db8d21 +PASS html5lib_template.html 868d918a7b5d8b5c065c15229492bc2022bfbcba +PASS html5lib_template.html 0538efa44e857596c556033a3821d424378aea3f +PASS html5lib_template.html e7d7bf3973c70d3cf9b0adad2ebed9f25be48d66 +PASS html5lib_template.html c69d0ac542d477b7312bb24981127b8aa8fdb1df +PASS html5lib_template.html b496a8c13a7bd75b778bb0de489726aee952ae0c +PASS html5lib_template.html 5d6ee61de40274c9626ca78ee208d51276d5662d +PASS html5lib_template.html 9bd9687a65f258adc24450fc5cbd781fff6c038a +FAIL html5lib_template.html db1baeb846d718c773324746524fbd68f2e9436e assert_equals: expected "#document\n| <html>\n| a=\"b\"\n| <head>\n| <template>\n| content\n| <body>" but got "#document\n| <html>\n| a=\"b\"\n| <head>\n| <template>\n| content\n| <frame>\n| <frame>\n| <body>" +PASS html5lib_template.html 4b0ce46c611dbcc016db272ef007f302bee0c897 +PASS html5lib_template.html 1a735e1c7f28f8701f3c7fd5e9404b8911916086 +PASS html5lib_template.html 0686eedec06b2db1dc283fac92c1ef1a33114c71 +PASS html5lib_template.html d4dfb87ce626f12923056a6cd77448eaf4660ac2 +PASS html5lib_template.html 1f295920f2937b2c8023b3761c43a0d4d9e5353c +PASS html5lib_template.html 3b91fa08fad923d387d924cff37fbf6b4c3a5712 +PASS html5lib_template.html 45a1c1ad5d99ad67c573096a79253996a664e01b +PASS html5lib_template.html 0fe3a66773c6048c8f6f2c92f2611f65be972ec1 +PASS html5lib_template.html be40897ca411e1507197c31ab2a9f9752a05f769 +PASS html5lib_template.html dcfb1048ed5c40e406b4fbf0cde24c826713907f +PASS html5lib_template.html 78263aeea68ac97903598682013bae9c0c21d547 +PASS html5lib_template.html 5aa177ef1a35bf4502dcb867d8e666288982ba99 +PASS html5lib_template.html 5d303375907dc4d4380b477e0317c17b660613e9 +PASS html5lib_template.html d822f726927c34b92fe102b13e63920850878f6a +PASS html5lib_template.html 07acdcaeb4fa639296d46673cf28823ddf2a6ca7 +PASS html5lib_template.html 58bd846ce1be0caf7560fba2ef19e2c2070ab123 +PASS html5lib_template.html 8eeee377e5ab324731cc592f1fa8abe1045ad610 +PASS html5lib_template.html b30690019090149132fc228a7261c5cf2fd149fc +PASS html5lib_template.html 67a209d928804f90fdb66d070201b23f3d0c8a42 +PASS html5lib_template.html 12104886b8f87daa937eac30b5ff0e1e074eaa6f +PASS html5lib_template.html 483cc9957a7225fe435112642be59abb4c459a1e +PASS html5lib_template.html 72d8ac431a154c40ab75d53a258d9d80d47689eb +PASS html5lib_template.html 1125967cbbcd404f4cb14d48270b8ec778970d77 +PASS html5lib_template.html 32c963e164b9ec82c60e490bb141c1ccc70b992f +PASS html5lib_template.html 574a95fc9c9f2de3aeaa0c9ee1e6967fc3d4770d +FAIL html5lib_template.html 332863a7f9e61bff32bd3427ede7a088b790d453 assert_equals: expected "#document\n| <html>\n| <head>\n| <template>\n| content\n| <template>\n| content\n| <body>" but got "#document\n| <html>\n| <head>\n| <template>\n| content\n| <template>\n| content\n| <frame>\n| <body>" +PASS html5lib_template.html 2121db07146781773df9e53b94fa921a805175ce +PASS html5lib_template.html 8675de267cd7e34f2febdee3feb665614d1562fe +PASS html5lib_template.html c5d26ad923a2b1e988ddd378ca4fb26eb48353e1 +PASS html5lib_template.html eec1542e2fa0e9eafb7f8d4a51eae56b5a31b3c8 +PASS html5lib_template.html b79387a54c3b136db0f28ed96555ff683b3947fe +PASS html5lib_template.html c477a29a4deb32d072a415fa809a84a4f2beee0c +PASS html5lib_template.html 26e4480c08e1f5f7b6ac8b8c1832ab0312e3b7c5 +PASS html5lib_template.html 24b3b50fdd0bf8d5cf2ebaa6bf502d7bcfde1da4 +PASS html5lib_template.html d3704c68528357189eb5826ab66eea071d6137a5 +PASS html5lib_template.html d958f7d44faf772d1fb60f1a8f186f837ca735d9 +PASS html5lib_template.html 3fc4d97fa68fc2658356bdbd4e051c867de8de53 +PASS html5lib_template.html 94820107bbf3fab3f82de1f717e8413aead7d3a6 +PASS html5lib_template.html 657c00ebdda37ae060cc69633ed98482ccc29e18 +PASS html5lib_template.html 649fc955a4b60ab2a5b881d94c9493eb4a545002 +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_template_run_type=write_single-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_template_run_type=write_single-expected.txt new file mode 100644 index 0000000..cbb6f286 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_template_run_type=write_single-expected.txt
@@ -0,0 +1,111 @@ +This is a testharness.js-based test. +Found 107 tests; 103 PASS, 4 FAIL, 0 TIMEOUT, 0 NOTRUN. +PASS html5lib_template.html 010950d55f4eccf16e9c4af1d263bb747294c646 +PASS html5lib_template.html a838bd54410cef059a42eea9606356488e16535b +PASS html5lib_template.html 27fb9111f6675a7e033b867480c0afddcda161a6 +PASS html5lib_template.html aee883a65775489399a003b2371d58248a6aff6f +PASS html5lib_template.html 89b17b54ab343191bf74ef5434f4d2cfac40ea97 +PASS html5lib_template.html c4433556c7414cfd71f27b420f1ffc4348774f5e +PASS html5lib_template.html 3dcce7d97108b3e9ea7fa96f240ac62bf280e74b +PASS html5lib_template.html a1f587f7ea85ccfe294bd45bfb501e850cb979e0 +PASS html5lib_template.html cd26a7832f13bdc135697321ca6c2fecdca6ef5d +PASS html5lib_template.html e30571d90b0e56864499961eb7be955994cf72e2 +PASS html5lib_template.html 01cbe9f6a25f286b08d8dc4f7b65421e8eb3500c +PASS html5lib_template.html 96cbbcdffe02c86a8b929604c2fd5f3571a18dbe +PASS html5lib_template.html d51676f55550e960dd0f5fa7fd0bdfa20bdde046 +PASS html5lib_template.html f9dfd9acfd494489c899604649a01d864741f50f +PASS html5lib_template.html ea00361c265d3ffb47ce636d919c94ca10d58911 +PASS html5lib_template.html d8ebfcf7694c9d04457e796ac73049210313602e +PASS html5lib_template.html b4d5e6fe9b92e2c8f54199d7cab3da383c42add0 +PASS html5lib_template.html 07724ef8f7a4fa61c77ffcd5180d3101c4781502 +PASS html5lib_template.html e90f8aae8fc690540b42b3ffa3e741e7c1dfbf43 +PASS html5lib_template.html 687bdf4adda88a316ec69fe20e84720acc5d1fe6 +PASS html5lib_template.html 5b232642f472c2b4c0c7511fed464eebe686b427 +PASS html5lib_template.html dc1ac1830a881d1532a1e6fd6d0cfa56d6571da2 +PASS html5lib_template.html c58747a85e8b4f44d7ae63c04cdad783a903c25e +PASS html5lib_template.html ca59bfdaec7451f704973176fab46e582bd691b2 +PASS html5lib_template.html cf807d6391a58c172b6c15c3b01d2a99ec0e6cf8 +PASS html5lib_template.html 350b7ac850e46de79615308fc923649264406104 +PASS html5lib_template.html a31ff44edf7f377543dabdda8141cda9bb6de134 +PASS html5lib_template.html 533c5c1b5f0d0cbb1ede2cc5ae927095c5b21f0b +PASS html5lib_template.html 61f79e083005007853c4f8e431559ac8d3845cfd +PASS html5lib_template.html e802e85f36792b176b73c102c0e8761d9478621d +PASS html5lib_template.html 51d0797ff7653cd7be34458d689146e08a666c7f +PASS html5lib_template.html d60e4079a18bd6266740cc61d1ca736e9d5098ce +PASS html5lib_template.html 308709292677b4d74c108a811ad7b7acd0bdfc9c +PASS html5lib_template.html 8965cdf9c4e9936262e25c90c7a7f8673840a445 +PASS html5lib_template.html 7dccda789764beb489e09be10188af9347335d05 +PASS html5lib_template.html e15be51c77e1a6de35568a099ed339440ce9426d +PASS html5lib_template.html 503d3782e45940c19f096f360a092282b46ab1ea +PASS html5lib_template.html b4ab56fd9e9cebf479d14adfa523c06d16483a5e +PASS html5lib_template.html cd8bc9521f9683086a9e8529dd97314a6869daeb +FAIL html5lib_template.html f915e7b3407c24b28c3aad318e5693cc774020f4 assert_equals: expected "#document\n| <html>\n| <head>\n| <frameset>\n| <frame>" but got "#document\n| <html>\n| <head>\n| <frameset>\n| <template>\n| content\n| <frame>" +FAIL html5lib_template.html 3c5eb261787b3d15aff86fa61de773fd7e439b0e assert_equals: expected "#document\n| <html>\n| <head>\n| <template>\n| content\n| <body>" but got "#document\n| <html>\n| <head>\n| <template>\n| content\n| <frame>\n| <frame>\n| <body>" +PASS html5lib_template.html 2b57775750c198d4b98b23aed74ff80a866a01f5 +PASS html5lib_template.html dc3d016610f3ab532525a6c2871f03d6b62b0168 +PASS html5lib_template.html 6a184d71d00580a26a8b6bd97aafe5503339f3f6 +PASS html5lib_template.html ce570a6c4bcee8b72a03e25508c6dd72e3cc6c35 +PASS html5lib_template.html e0c3d922f7b1f1654f02f716c3d9b31198ce3385 +PASS html5lib_template.html 87e67242bf6debcf3b7dca852d10aa0f7b625b28 +PASS html5lib_template.html 35ac4d4c972a01d368ed0cacb41370efef0a644d +PASS html5lib_template.html 5226c39dfc2d624ad4191b4eacb7e40c7ae528eb +PASS html5lib_template.html aa90cd4db6b12e0a47341914a90cc536eec32d64 +PASS html5lib_template.html 48af1faf5fcf48a0854af5a5c33656d9ccf6736b +PASS html5lib_template.html ed3a029ba5e7f59969d65a4fc490a8f13b098cb9 +PASS html5lib_template.html 6c8880d54475ad9574e203dcf2e55820b123cc64 +PASS html5lib_template.html 275060925a844cb51b29bae660301de9780d68c8 +PASS html5lib_template.html 9f82f6ec4c0a48c1d4dfbe6803b94abd553aea88 +PASS html5lib_template.html f094bf7e94a88b86c80a0643e70c8e5ff3354698 +PASS html5lib_template.html 35a07ec3b4bf26ea407dc1ddf52f14195a714059 +PASS html5lib_template.html 24faa53b271f994a4ff31d5796c8ff47d6f2c3e6 +PASS html5lib_template.html 0f1c491b58c2dd3c402a62e37f833bc1f1db8d21 +PASS html5lib_template.html 868d918a7b5d8b5c065c15229492bc2022bfbcba +PASS html5lib_template.html 0538efa44e857596c556033a3821d424378aea3f +PASS html5lib_template.html e7d7bf3973c70d3cf9b0adad2ebed9f25be48d66 +PASS html5lib_template.html c69d0ac542d477b7312bb24981127b8aa8fdb1df +PASS html5lib_template.html b496a8c13a7bd75b778bb0de489726aee952ae0c +PASS html5lib_template.html 5d6ee61de40274c9626ca78ee208d51276d5662d +PASS html5lib_template.html 9bd9687a65f258adc24450fc5cbd781fff6c038a +FAIL html5lib_template.html db1baeb846d718c773324746524fbd68f2e9436e assert_equals: expected "#document\n| <html>\n| a=\"b\"\n| <head>\n| <template>\n| content\n| <body>" but got "#document\n| <html>\n| a=\"b\"\n| <head>\n| <template>\n| content\n| <frame>\n| <frame>\n| <body>" +PASS html5lib_template.html 4b0ce46c611dbcc016db272ef007f302bee0c897 +PASS html5lib_template.html 1a735e1c7f28f8701f3c7fd5e9404b8911916086 +PASS html5lib_template.html 0686eedec06b2db1dc283fac92c1ef1a33114c71 +PASS html5lib_template.html d4dfb87ce626f12923056a6cd77448eaf4660ac2 +PASS html5lib_template.html 1f295920f2937b2c8023b3761c43a0d4d9e5353c +PASS html5lib_template.html 3b91fa08fad923d387d924cff37fbf6b4c3a5712 +PASS html5lib_template.html 45a1c1ad5d99ad67c573096a79253996a664e01b +PASS html5lib_template.html 0fe3a66773c6048c8f6f2c92f2611f65be972ec1 +PASS html5lib_template.html be40897ca411e1507197c31ab2a9f9752a05f769 +PASS html5lib_template.html dcfb1048ed5c40e406b4fbf0cde24c826713907f +PASS html5lib_template.html 78263aeea68ac97903598682013bae9c0c21d547 +PASS html5lib_template.html 5aa177ef1a35bf4502dcb867d8e666288982ba99 +PASS html5lib_template.html 5d303375907dc4d4380b477e0317c17b660613e9 +PASS html5lib_template.html d822f726927c34b92fe102b13e63920850878f6a +PASS html5lib_template.html 07acdcaeb4fa639296d46673cf28823ddf2a6ca7 +PASS html5lib_template.html 58bd846ce1be0caf7560fba2ef19e2c2070ab123 +PASS html5lib_template.html 8eeee377e5ab324731cc592f1fa8abe1045ad610 +PASS html5lib_template.html b30690019090149132fc228a7261c5cf2fd149fc +PASS html5lib_template.html 67a209d928804f90fdb66d070201b23f3d0c8a42 +PASS html5lib_template.html 12104886b8f87daa937eac30b5ff0e1e074eaa6f +PASS html5lib_template.html 483cc9957a7225fe435112642be59abb4c459a1e +PASS html5lib_template.html 72d8ac431a154c40ab75d53a258d9d80d47689eb +PASS html5lib_template.html 1125967cbbcd404f4cb14d48270b8ec778970d77 +PASS html5lib_template.html 32c963e164b9ec82c60e490bb141c1ccc70b992f +PASS html5lib_template.html 574a95fc9c9f2de3aeaa0c9ee1e6967fc3d4770d +FAIL html5lib_template.html 332863a7f9e61bff32bd3427ede7a088b790d453 assert_equals: expected "#document\n| <html>\n| <head>\n| <template>\n| content\n| <template>\n| content\n| <body>" but got "#document\n| <html>\n| <head>\n| <template>\n| content\n| <template>\n| content\n| <frame>\n| <body>" +PASS html5lib_template.html 2121db07146781773df9e53b94fa921a805175ce +PASS html5lib_template.html 8675de267cd7e34f2febdee3feb665614d1562fe +PASS html5lib_template.html c5d26ad923a2b1e988ddd378ca4fb26eb48353e1 +PASS html5lib_template.html eec1542e2fa0e9eafb7f8d4a51eae56b5a31b3c8 +PASS html5lib_template.html b79387a54c3b136db0f28ed96555ff683b3947fe +PASS html5lib_template.html c477a29a4deb32d072a415fa809a84a4f2beee0c +PASS html5lib_template.html 26e4480c08e1f5f7b6ac8b8c1832ab0312e3b7c5 +PASS html5lib_template.html 24b3b50fdd0bf8d5cf2ebaa6bf502d7bcfde1da4 +PASS html5lib_template.html d3704c68528357189eb5826ab66eea071d6137a5 +PASS html5lib_template.html d958f7d44faf772d1fb60f1a8f186f837ca735d9 +PASS html5lib_template.html 3fc4d97fa68fc2658356bdbd4e051c867de8de53 +PASS html5lib_template.html 94820107bbf3fab3f82de1f717e8413aead7d3a6 +PASS html5lib_template.html 657c00ebdda37ae060cc69633ed98482ccc29e18 +PASS html5lib_template.html 649fc955a4b60ab2a5b881d94c9493eb4a545002 +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_tests11_run_type=uri-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_tests11_run_type=uri-expected.txt new file mode 100644 index 0000000..447004f --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_tests11_run_type=uri-expected.txt
@@ -0,0 +1,16 @@ +This is a testharness.js-based test. +FAIL html5lib_tests11.html ba7a66dfcf59885c08e8638d15b01df3878531e7 assert_equals: expected "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <svg svg>\n| attributeName=\"\"\n| attributeType=\"\"\n| baseFrequency=\"\"\n| baseProfile=\"\"\n| calcMode=\"\"\n| clipPathUnits=\"\"\n| diffuseConstant=\"\"\n| edgeMode=\"\"\n| filterUnits=\"\"\n| glyphRef=\"\"\n| gradientTransform=\"\"\n| gradientUnits=\"\"\n| kernelMatrix=\"\"\n| kernelUnitLength=\"\"\n| keyPoints=\"\"\n| keySplines=\"\"\n| keyTimes=\"\"\n| lengthAdjust=\"\"\n| limitingConeAngle=\"\"\n| markerHeight=\"\"\n| markerUnits=\"\"\n| markerWidth=\"\"\n| maskContentUnits=\"\"\n| maskUnits=\"\"\n| numOctaves=\"\"\n| pathLength=\"\"\n| patternContentUnits=\"\"\n| patternTransform=\"\"\n| patternUnits=\"\"\n| pointsAtX=\"\"\n| pointsAtY=\"\"\n| pointsAtZ=\"\"\n| preserveAlpha=\"\"\n| preserveAspectRatio=\"\"\n| primitiveUnits=\"\"\n| refX=\"\"\n| refY=\"\"\n| repeatCount=\"\"\n| repeatDur=\"\"\n| requiredExtensions=\"\"\n| requiredFeatures=\"\"\n| specularConstant=\"\"\n| specularExponent=\"\"\n| spreadMethod=\"\"\n| startOffset=\"\"\n| stdDeviation=\"\"\n| stitchTiles=\"\"\n| surfaceScale=\"\"\n| systemLanguage=\"\"\n| tableValues=\"\"\n| targetX=\"\"\n| targetY=\"\"\n| textLength=\"\"\n| viewBox=\"\"\n| viewTarget=\"\"\n| xChannelSelector=\"\"\n| yChannelSelector=\"\"\n| zoomAndPan=\"\"" but got "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <svg svg>\n| attributeName=\"\"\n| attributeType=\"\"\n| baseFrequency=\"\"\n| baseProfile=\"\"\n| calcMode=\"\"\n| clipPathUnits=\"\"\n| diffuseConstant=\"\"\n| edgeMode=\"\"\n| filterUnits=\"\"\n| glyphRef=\"\"\n| gradientTransform=\"\"\n| gradientUnits=\"\"\n| kernelMatrix=\"\"\n| kernelUnitLength=\"\"\n| keyPoints=\"\"\n| keySplines=\"\"\n| keyTimes=\"\"\n| lengthAdjust=\"\"\n| limitingConeAngle=\"\"\n| markerHeight=\"\"\n| markerUnits=\"\"\n| markerWidth=\"\"\n| maskContentUnits=\"\"\n| maskUnits=\"\"\n| numOctaves=\"\"\n| pathLength=\"\"\n| patternContentUnits=\"\"\n| patternTransform=\"\"\n| patternUnits=\"\"\n| pointsAtX=\"\"\n| pointsAtY=\"\"\n| pointsAtZ=\"\"\n| preserveAlpha=\"\"\n| preserveAspectRatio=\"\"\n| primitiveUnits=\"\"\n| refX=\"\"\n| refY=\"\"\n| repeatCount=\"\"\n| repeatDur=\"\"\n| requiredExtensions=\"\"\n| requiredFeatures=\"\"\n| specularConstant=\"\"\n| specularExponent=\"\"\n| spreadMethod=\"\"\n| startOffset=\"\"\n| stdDeviation=\"\"\n| stitchTiles=\"\"\n| surfaceScale=\"\"\n| systemLanguage=\"\"\n| tableValues=\"\"\n| targetX=\"\"\n| targetY=\"\"\n| textLength=\"\"\n| viewBox=\"\"\n| viewtarget=\"\"\n| xChannelSelector=\"\"\n| yChannelSelector=\"\"\n| zoomAndPan=\"\"" +FAIL html5lib_tests11.html e69c7c08a54ca868ab33b2825d998fa6c3cac90e assert_equals: expected "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <svg svg>\n| attributeName=\"\"\n| attributeType=\"\"\n| baseFrequency=\"\"\n| baseProfile=\"\"\n| calcMode=\"\"\n| clipPathUnits=\"\"\n| diffuseConstant=\"\"\n| edgeMode=\"\"\n| filterUnits=\"\"\n| glyphRef=\"\"\n| gradientTransform=\"\"\n| gradientUnits=\"\"\n| kernelMatrix=\"\"\n| kernelUnitLength=\"\"\n| keyPoints=\"\"\n| keySplines=\"\"\n| keyTimes=\"\"\n| lengthAdjust=\"\"\n| limitingConeAngle=\"\"\n| markerHeight=\"\"\n| markerUnits=\"\"\n| markerWidth=\"\"\n| maskContentUnits=\"\"\n| maskUnits=\"\"\n| numOctaves=\"\"\n| pathLength=\"\"\n| patternContentUnits=\"\"\n| patternTransform=\"\"\n| patternUnits=\"\"\n| pointsAtX=\"\"\n| pointsAtY=\"\"\n| pointsAtZ=\"\"\n| preserveAlpha=\"\"\n| preserveAspectRatio=\"\"\n| primitiveUnits=\"\"\n| refX=\"\"\n| refY=\"\"\n| repeatCount=\"\"\n| repeatDur=\"\"\n| requiredExtensions=\"\"\n| requiredFeatures=\"\"\n| specularConstant=\"\"\n| specularExponent=\"\"\n| spreadMethod=\"\"\n| startOffset=\"\"\n| stdDeviation=\"\"\n| stitchTiles=\"\"\n| surfaceScale=\"\"\n| systemLanguage=\"\"\n| tableValues=\"\"\n| targetX=\"\"\n| targetY=\"\"\n| textLength=\"\"\n| viewBox=\"\"\n| viewTarget=\"\"\n| xChannelSelector=\"\"\n| yChannelSelector=\"\"\n| zoomAndPan=\"\"" but got "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <svg svg>\n| attributeName=\"\"\n| attributeType=\"\"\n| baseFrequency=\"\"\n| baseProfile=\"\"\n| calcMode=\"\"\n| clipPathUnits=\"\"\n| diffuseConstant=\"\"\n| edgeMode=\"\"\n| filterUnits=\"\"\n| glyphRef=\"\"\n| gradientTransform=\"\"\n| gradientUnits=\"\"\n| kernelMatrix=\"\"\n| kernelUnitLength=\"\"\n| keyPoints=\"\"\n| keySplines=\"\"\n| keyTimes=\"\"\n| lengthAdjust=\"\"\n| limitingConeAngle=\"\"\n| markerHeight=\"\"\n| markerUnits=\"\"\n| markerWidth=\"\"\n| maskContentUnits=\"\"\n| maskUnits=\"\"\n| numOctaves=\"\"\n| pathLength=\"\"\n| patternContentUnits=\"\"\n| patternTransform=\"\"\n| patternUnits=\"\"\n| pointsAtX=\"\"\n| pointsAtY=\"\"\n| pointsAtZ=\"\"\n| preserveAlpha=\"\"\n| preserveAspectRatio=\"\"\n| primitiveUnits=\"\"\n| refX=\"\"\n| refY=\"\"\n| repeatCount=\"\"\n| repeatDur=\"\"\n| requiredExtensions=\"\"\n| requiredFeatures=\"\"\n| specularConstant=\"\"\n| specularExponent=\"\"\n| spreadMethod=\"\"\n| startOffset=\"\"\n| stdDeviation=\"\"\n| stitchTiles=\"\"\n| surfaceScale=\"\"\n| systemLanguage=\"\"\n| tableValues=\"\"\n| targetX=\"\"\n| targetY=\"\"\n| textLength=\"\"\n| viewBox=\"\"\n| viewtarget=\"\"\n| xChannelSelector=\"\"\n| yChannelSelector=\"\"\n| zoomAndPan=\"\"" +FAIL html5lib_tests11.html 0e5897aafe87e460f84576c2d1d983504d12a7db assert_equals: expected "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <svg svg>\n| attributeName=\"\"\n| attributeType=\"\"\n| baseFrequency=\"\"\n| baseProfile=\"\"\n| calcMode=\"\"\n| clipPathUnits=\"\"\n| diffuseConstant=\"\"\n| edgeMode=\"\"\n| filterUnits=\"\"\n| filterres=\"\"\n| glyphRef=\"\"\n| gradientTransform=\"\"\n| gradientUnits=\"\"\n| kernelMatrix=\"\"\n| kernelUnitLength=\"\"\n| keyPoints=\"\"\n| keySplines=\"\"\n| keyTimes=\"\"\n| lengthAdjust=\"\"\n| limitingConeAngle=\"\"\n| markerHeight=\"\"\n| markerUnits=\"\"\n| markerWidth=\"\"\n| maskContentUnits=\"\"\n| maskUnits=\"\"\n| numOctaves=\"\"\n| pathLength=\"\"\n| patternContentUnits=\"\"\n| patternTransform=\"\"\n| patternUnits=\"\"\n| pointsAtX=\"\"\n| pointsAtY=\"\"\n| pointsAtZ=\"\"\n| preserveAlpha=\"\"\n| preserveAspectRatio=\"\"\n| primitiveUnits=\"\"\n| refX=\"\"\n| refY=\"\"\n| repeatCount=\"\"\n| repeatDur=\"\"\n| requiredExtensions=\"\"\n| requiredFeatures=\"\"\n| specularConstant=\"\"\n| specularExponent=\"\"\n| spreadMethod=\"\"\n| startOffset=\"\"\n| stdDeviation=\"\"\n| stitchTiles=\"\"\n| surfaceScale=\"\"\n| systemLanguage=\"\"\n| tableValues=\"\"\n| targetX=\"\"\n| targetY=\"\"\n| textLength=\"\"\n| viewBox=\"\"\n| viewTarget=\"\"\n| xChannelSelector=\"\"\n| yChannelSelector=\"\"\n| zoomAndPan=\"\"" but got "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <svg svg>\n| attributeName=\"\"\n| attributeType=\"\"\n| baseFrequency=\"\"\n| baseProfile=\"\"\n| calcMode=\"\"\n| clipPathUnits=\"\"\n| diffuseConstant=\"\"\n| edgeMode=\"\"\n| filterUnits=\"\"\n| filterres=\"\"\n| glyphRef=\"\"\n| gradientTransform=\"\"\n| gradientUnits=\"\"\n| kernelMatrix=\"\"\n| kernelUnitLength=\"\"\n| keyPoints=\"\"\n| keySplines=\"\"\n| keyTimes=\"\"\n| lengthAdjust=\"\"\n| limitingConeAngle=\"\"\n| markerHeight=\"\"\n| markerUnits=\"\"\n| markerWidth=\"\"\n| maskContentUnits=\"\"\n| maskUnits=\"\"\n| numOctaves=\"\"\n| pathLength=\"\"\n| patternContentUnits=\"\"\n| patternTransform=\"\"\n| patternUnits=\"\"\n| pointsAtX=\"\"\n| pointsAtY=\"\"\n| pointsAtZ=\"\"\n| preserveAlpha=\"\"\n| preserveAspectRatio=\"\"\n| primitiveUnits=\"\"\n| refX=\"\"\n| refY=\"\"\n| repeatCount=\"\"\n| repeatDur=\"\"\n| requiredExtensions=\"\"\n| requiredFeatures=\"\"\n| specularConstant=\"\"\n| specularExponent=\"\"\n| spreadMethod=\"\"\n| startOffset=\"\"\n| stdDeviation=\"\"\n| stitchTiles=\"\"\n| surfaceScale=\"\"\n| systemLanguage=\"\"\n| tableValues=\"\"\n| targetX=\"\"\n| targetY=\"\"\n| textLength=\"\"\n| viewBox=\"\"\n| viewtarget=\"\"\n| xChannelSelector=\"\"\n| yChannelSelector=\"\"\n| zoomAndPan=\"\"" +PASS html5lib_tests11.html f71dd198831309fc9ccd66ef91cde63fda9b9bda +PASS html5lib_tests11.html a8f7a23601363454b4a13f66aed99ec9708ae87b +PASS html5lib_tests11.html f8f7f6c576acc9eb874acb0dce6988f0f7b6fc5f +PASS html5lib_tests11.html fb4dc9f70129a8a045fca3a1e3acee052d0990b3 +PASS html5lib_tests11.html 8f77b846acce75edf1988ea655c79f1de4321de9 +FAIL html5lib_tests11.html 39c50f080b2b9ae9e7a1070679ab97d7b814f9ec assert_equals: expected "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <svg svg>\n| <svg altGlyph>\n| <svg altGlyphDef>\n| <svg altGlyphItem>\n| <svg animateColor>\n| <svg animateMotion>\n| <svg animateTransform>\n| <svg clipPath>\n| <svg feBlend>\n| <svg feColorMatrix>\n| <svg feComponentTransfer>\n| <svg feComposite>\n| <svg feConvolveMatrix>\n| <svg feDiffuseLighting>\n| <svg feDisplacementMap>\n| <svg feDistantLight>\n| <svg feFlood>\n| <svg feFuncA>\n| <svg feFuncB>\n| <svg feFuncG>\n| <svg feFuncR>\n| <svg feGaussianBlur>\n| <svg feImage>\n| <svg feMerge>\n| <svg feMergeNode>\n| <svg feMorphology>\n| <svg feOffset>\n| <svg fePointLight>\n| <svg feSpecularLighting>\n| <svg feSpotLight>\n| <svg feTile>\n| <svg feTurbulence>\n| <svg foreignObject>\n| <svg glyphRef>\n| <svg linearGradient>\n| <svg radialGradient>\n| <svg textPath>" but got "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <svg svg>\n| <svg altglyph>\n| <svg altglyphdef>\n| <svg altglyphitem>\n| <svg animateColor>\n| <svg animateMotion>\n| <svg animateTransform>\n| <svg clipPath>\n| <svg feBlend>\n| <svg feColorMatrix>\n| <svg feComponentTransfer>\n| <svg feComposite>\n| <svg feConvolveMatrix>\n| <svg feDiffuseLighting>\n| <svg feDisplacementMap>\n| <svg feDistantLight>\n| <svg feFlood>\n| <svg feFuncA>\n| <svg feFuncB>\n| <svg feFuncG>\n| <svg feFuncR>\n| <svg feGaussianBlur>\n| <svg feImage>\n| <svg feMerge>\n| <svg feMergeNode>\n| <svg feMorphology>\n| <svg feOffset>\n| <svg fePointLight>\n| <svg feSpecularLighting>\n| <svg feSpotLight>\n| <svg feTile>\n| <svg feTurbulence>\n| <svg foreignObject>\n| <svg glyphref>\n| <svg linearGradient>\n| <svg radialGradient>\n| <svg textPath>" +FAIL html5lib_tests11.html 6d1fa1599f75625fe4d019abb04a064cf6ed39e8 assert_equals: expected "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <svg svg>\n| <svg altGlyph>\n| <svg altGlyphDef>\n| <svg altGlyphItem>\n| <svg animateColor>\n| <svg animateMotion>\n| <svg animateTransform>\n| <svg clipPath>\n| <svg feBlend>\n| <svg feColorMatrix>\n| <svg feComponentTransfer>\n| <svg feComposite>\n| <svg feConvolveMatrix>\n| <svg feDiffuseLighting>\n| <svg feDisplacementMap>\n| <svg feDistantLight>\n| <svg feFlood>\n| <svg feFuncA>\n| <svg feFuncB>\n| <svg feFuncG>\n| <svg feFuncR>\n| <svg feGaussianBlur>\n| <svg feImage>\n| <svg feMerge>\n| <svg feMergeNode>\n| <svg feMorphology>\n| <svg feOffset>\n| <svg fePointLight>\n| <svg feSpecularLighting>\n| <svg feSpotLight>\n| <svg feTile>\n| <svg feTurbulence>\n| <svg foreignObject>\n| <svg glyphRef>\n| <svg linearGradient>\n| <svg radialGradient>\n| <svg textPath>" but got "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <svg svg>\n| <svg altglyph>\n| <svg altglyphdef>\n| <svg altglyphitem>\n| <svg animateColor>\n| <svg animateMotion>\n| <svg animateTransform>\n| <svg clipPath>\n| <svg feBlend>\n| <svg feColorMatrix>\n| <svg feComponentTransfer>\n| <svg feComposite>\n| <svg feConvolveMatrix>\n| <svg feDiffuseLighting>\n| <svg feDisplacementMap>\n| <svg feDistantLight>\n| <svg feFlood>\n| <svg feFuncA>\n| <svg feFuncB>\n| <svg feFuncG>\n| <svg feFuncR>\n| <svg feGaussianBlur>\n| <svg feImage>\n| <svg feMerge>\n| <svg feMergeNode>\n| <svg feMorphology>\n| <svg feOffset>\n| <svg fePointLight>\n| <svg feSpecularLighting>\n| <svg feSpotLight>\n| <svg feTile>\n| <svg feTurbulence>\n| <svg foreignObject>\n| <svg glyphref>\n| <svg linearGradient>\n| <svg radialGradient>\n| <svg textPath>" +FAIL html5lib_tests11.html 791437ece7ba684e00162d1dd79dfe540e3621a7 assert_equals: expected "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <svg svg>\n| <svg altGlyph>\n| <svg altGlyphDef>\n| <svg altGlyphItem>\n| <svg animateColor>\n| <svg animateMotion>\n| <svg animateTransform>\n| <svg clipPath>\n| <svg feBlend>\n| <svg feColorMatrix>\n| <svg feComponentTransfer>\n| <svg feComposite>\n| <svg feConvolveMatrix>\n| <svg feDiffuseLighting>\n| <svg feDisplacementMap>\n| <svg feDistantLight>\n| <svg feFlood>\n| <svg feFuncA>\n| <svg feFuncB>\n| <svg feFuncG>\n| <svg feFuncR>\n| <svg feGaussianBlur>\n| <svg feImage>\n| <svg feMerge>\n| <svg feMergeNode>\n| <svg feMorphology>\n| <svg feOffset>\n| <svg fePointLight>\n| <svg feSpecularLighting>\n| <svg feSpotLight>\n| <svg feTile>\n| <svg feTurbulence>\n| <svg foreignObject>\n| <svg glyphRef>\n| <svg linearGradient>\n| <svg radialGradient>\n| <svg textPath>" but got "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <svg svg>\n| <svg altglyph>\n| <svg altglyphdef>\n| <svg altglyphitem>\n| <svg animateColor>\n| <svg animateMotion>\n| <svg animateTransform>\n| <svg clipPath>\n| <svg feBlend>\n| <svg feColorMatrix>\n| <svg feComponentTransfer>\n| <svg feComposite>\n| <svg feConvolveMatrix>\n| <svg feDiffuseLighting>\n| <svg feDisplacementMap>\n| <svg feDistantLight>\n| <svg feFlood>\n| <svg feFuncA>\n| <svg feFuncB>\n| <svg feFuncG>\n| <svg feFuncR>\n| <svg feGaussianBlur>\n| <svg feImage>\n| <svg feMerge>\n| <svg feMergeNode>\n| <svg feMorphology>\n| <svg feOffset>\n| <svg fePointLight>\n| <svg feSpecularLighting>\n| <svg feSpotLight>\n| <svg feTile>\n| <svg feTurbulence>\n| <svg foreignObject>\n| <svg glyphref>\n| <svg linearGradient>\n| <svg radialGradient>\n| <svg textPath>" +PASS html5lib_tests11.html af40d26164229c29b9be77ed6dd7dda780cba55c +PASS html5lib_tests11.html 16e68d18f8f0fb81013fe77a30b7d396c5081e5e +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_tests11_run_type=write-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_tests11_run_type=write-expected.txt new file mode 100644 index 0000000..447004f --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_tests11_run_type=write-expected.txt
@@ -0,0 +1,16 @@ +This is a testharness.js-based test. +FAIL html5lib_tests11.html ba7a66dfcf59885c08e8638d15b01df3878531e7 assert_equals: expected "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <svg svg>\n| attributeName=\"\"\n| attributeType=\"\"\n| baseFrequency=\"\"\n| baseProfile=\"\"\n| calcMode=\"\"\n| clipPathUnits=\"\"\n| diffuseConstant=\"\"\n| edgeMode=\"\"\n| filterUnits=\"\"\n| glyphRef=\"\"\n| gradientTransform=\"\"\n| gradientUnits=\"\"\n| kernelMatrix=\"\"\n| kernelUnitLength=\"\"\n| keyPoints=\"\"\n| keySplines=\"\"\n| keyTimes=\"\"\n| lengthAdjust=\"\"\n| limitingConeAngle=\"\"\n| markerHeight=\"\"\n| markerUnits=\"\"\n| markerWidth=\"\"\n| maskContentUnits=\"\"\n| maskUnits=\"\"\n| numOctaves=\"\"\n| pathLength=\"\"\n| patternContentUnits=\"\"\n| patternTransform=\"\"\n| patternUnits=\"\"\n| pointsAtX=\"\"\n| pointsAtY=\"\"\n| pointsAtZ=\"\"\n| preserveAlpha=\"\"\n| preserveAspectRatio=\"\"\n| primitiveUnits=\"\"\n| refX=\"\"\n| refY=\"\"\n| repeatCount=\"\"\n| repeatDur=\"\"\n| requiredExtensions=\"\"\n| requiredFeatures=\"\"\n| specularConstant=\"\"\n| specularExponent=\"\"\n| spreadMethod=\"\"\n| startOffset=\"\"\n| stdDeviation=\"\"\n| stitchTiles=\"\"\n| surfaceScale=\"\"\n| systemLanguage=\"\"\n| tableValues=\"\"\n| targetX=\"\"\n| targetY=\"\"\n| textLength=\"\"\n| viewBox=\"\"\n| viewTarget=\"\"\n| xChannelSelector=\"\"\n| yChannelSelector=\"\"\n| zoomAndPan=\"\"" but got "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <svg svg>\n| attributeName=\"\"\n| attributeType=\"\"\n| baseFrequency=\"\"\n| baseProfile=\"\"\n| calcMode=\"\"\n| clipPathUnits=\"\"\n| diffuseConstant=\"\"\n| edgeMode=\"\"\n| filterUnits=\"\"\n| glyphRef=\"\"\n| gradientTransform=\"\"\n| gradientUnits=\"\"\n| kernelMatrix=\"\"\n| kernelUnitLength=\"\"\n| keyPoints=\"\"\n| keySplines=\"\"\n| keyTimes=\"\"\n| lengthAdjust=\"\"\n| limitingConeAngle=\"\"\n| markerHeight=\"\"\n| markerUnits=\"\"\n| markerWidth=\"\"\n| maskContentUnits=\"\"\n| maskUnits=\"\"\n| numOctaves=\"\"\n| pathLength=\"\"\n| patternContentUnits=\"\"\n| patternTransform=\"\"\n| patternUnits=\"\"\n| pointsAtX=\"\"\n| pointsAtY=\"\"\n| pointsAtZ=\"\"\n| preserveAlpha=\"\"\n| preserveAspectRatio=\"\"\n| primitiveUnits=\"\"\n| refX=\"\"\n| refY=\"\"\n| repeatCount=\"\"\n| repeatDur=\"\"\n| requiredExtensions=\"\"\n| requiredFeatures=\"\"\n| specularConstant=\"\"\n| specularExponent=\"\"\n| spreadMethod=\"\"\n| startOffset=\"\"\n| stdDeviation=\"\"\n| stitchTiles=\"\"\n| surfaceScale=\"\"\n| systemLanguage=\"\"\n| tableValues=\"\"\n| targetX=\"\"\n| targetY=\"\"\n| textLength=\"\"\n| viewBox=\"\"\n| viewtarget=\"\"\n| xChannelSelector=\"\"\n| yChannelSelector=\"\"\n| zoomAndPan=\"\"" +FAIL html5lib_tests11.html e69c7c08a54ca868ab33b2825d998fa6c3cac90e assert_equals: expected "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <svg svg>\n| attributeName=\"\"\n| attributeType=\"\"\n| baseFrequency=\"\"\n| baseProfile=\"\"\n| calcMode=\"\"\n| clipPathUnits=\"\"\n| diffuseConstant=\"\"\n| edgeMode=\"\"\n| filterUnits=\"\"\n| glyphRef=\"\"\n| gradientTransform=\"\"\n| gradientUnits=\"\"\n| kernelMatrix=\"\"\n| kernelUnitLength=\"\"\n| keyPoints=\"\"\n| keySplines=\"\"\n| keyTimes=\"\"\n| lengthAdjust=\"\"\n| limitingConeAngle=\"\"\n| markerHeight=\"\"\n| markerUnits=\"\"\n| markerWidth=\"\"\n| maskContentUnits=\"\"\n| maskUnits=\"\"\n| numOctaves=\"\"\n| pathLength=\"\"\n| patternContentUnits=\"\"\n| patternTransform=\"\"\n| patternUnits=\"\"\n| pointsAtX=\"\"\n| pointsAtY=\"\"\n| pointsAtZ=\"\"\n| preserveAlpha=\"\"\n| preserveAspectRatio=\"\"\n| primitiveUnits=\"\"\n| refX=\"\"\n| refY=\"\"\n| repeatCount=\"\"\n| repeatDur=\"\"\n| requiredExtensions=\"\"\n| requiredFeatures=\"\"\n| specularConstant=\"\"\n| specularExponent=\"\"\n| spreadMethod=\"\"\n| startOffset=\"\"\n| stdDeviation=\"\"\n| stitchTiles=\"\"\n| surfaceScale=\"\"\n| systemLanguage=\"\"\n| tableValues=\"\"\n| targetX=\"\"\n| targetY=\"\"\n| textLength=\"\"\n| viewBox=\"\"\n| viewTarget=\"\"\n| xChannelSelector=\"\"\n| yChannelSelector=\"\"\n| zoomAndPan=\"\"" but got "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <svg svg>\n| attributeName=\"\"\n| attributeType=\"\"\n| baseFrequency=\"\"\n| baseProfile=\"\"\n| calcMode=\"\"\n| clipPathUnits=\"\"\n| diffuseConstant=\"\"\n| edgeMode=\"\"\n| filterUnits=\"\"\n| glyphRef=\"\"\n| gradientTransform=\"\"\n| gradientUnits=\"\"\n| kernelMatrix=\"\"\n| kernelUnitLength=\"\"\n| keyPoints=\"\"\n| keySplines=\"\"\n| keyTimes=\"\"\n| lengthAdjust=\"\"\n| limitingConeAngle=\"\"\n| markerHeight=\"\"\n| markerUnits=\"\"\n| markerWidth=\"\"\n| maskContentUnits=\"\"\n| maskUnits=\"\"\n| numOctaves=\"\"\n| pathLength=\"\"\n| patternContentUnits=\"\"\n| patternTransform=\"\"\n| patternUnits=\"\"\n| pointsAtX=\"\"\n| pointsAtY=\"\"\n| pointsAtZ=\"\"\n| preserveAlpha=\"\"\n| preserveAspectRatio=\"\"\n| primitiveUnits=\"\"\n| refX=\"\"\n| refY=\"\"\n| repeatCount=\"\"\n| repeatDur=\"\"\n| requiredExtensions=\"\"\n| requiredFeatures=\"\"\n| specularConstant=\"\"\n| specularExponent=\"\"\n| spreadMethod=\"\"\n| startOffset=\"\"\n| stdDeviation=\"\"\n| stitchTiles=\"\"\n| surfaceScale=\"\"\n| systemLanguage=\"\"\n| tableValues=\"\"\n| targetX=\"\"\n| targetY=\"\"\n| textLength=\"\"\n| viewBox=\"\"\n| viewtarget=\"\"\n| xChannelSelector=\"\"\n| yChannelSelector=\"\"\n| zoomAndPan=\"\"" +FAIL html5lib_tests11.html 0e5897aafe87e460f84576c2d1d983504d12a7db assert_equals: expected "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <svg svg>\n| attributeName=\"\"\n| attributeType=\"\"\n| baseFrequency=\"\"\n| baseProfile=\"\"\n| calcMode=\"\"\n| clipPathUnits=\"\"\n| diffuseConstant=\"\"\n| edgeMode=\"\"\n| filterUnits=\"\"\n| filterres=\"\"\n| glyphRef=\"\"\n| gradientTransform=\"\"\n| gradientUnits=\"\"\n| kernelMatrix=\"\"\n| kernelUnitLength=\"\"\n| keyPoints=\"\"\n| keySplines=\"\"\n| keyTimes=\"\"\n| lengthAdjust=\"\"\n| limitingConeAngle=\"\"\n| markerHeight=\"\"\n| markerUnits=\"\"\n| markerWidth=\"\"\n| maskContentUnits=\"\"\n| maskUnits=\"\"\n| numOctaves=\"\"\n| pathLength=\"\"\n| patternContentUnits=\"\"\n| patternTransform=\"\"\n| patternUnits=\"\"\n| pointsAtX=\"\"\n| pointsAtY=\"\"\n| pointsAtZ=\"\"\n| preserveAlpha=\"\"\n| preserveAspectRatio=\"\"\n| primitiveUnits=\"\"\n| refX=\"\"\n| refY=\"\"\n| repeatCount=\"\"\n| repeatDur=\"\"\n| requiredExtensions=\"\"\n| requiredFeatures=\"\"\n| specularConstant=\"\"\n| specularExponent=\"\"\n| spreadMethod=\"\"\n| startOffset=\"\"\n| stdDeviation=\"\"\n| stitchTiles=\"\"\n| surfaceScale=\"\"\n| systemLanguage=\"\"\n| tableValues=\"\"\n| targetX=\"\"\n| targetY=\"\"\n| textLength=\"\"\n| viewBox=\"\"\n| viewTarget=\"\"\n| xChannelSelector=\"\"\n| yChannelSelector=\"\"\n| zoomAndPan=\"\"" but got "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <svg svg>\n| attributeName=\"\"\n| attributeType=\"\"\n| baseFrequency=\"\"\n| baseProfile=\"\"\n| calcMode=\"\"\n| clipPathUnits=\"\"\n| diffuseConstant=\"\"\n| edgeMode=\"\"\n| filterUnits=\"\"\n| filterres=\"\"\n| glyphRef=\"\"\n| gradientTransform=\"\"\n| gradientUnits=\"\"\n| kernelMatrix=\"\"\n| kernelUnitLength=\"\"\n| keyPoints=\"\"\n| keySplines=\"\"\n| keyTimes=\"\"\n| lengthAdjust=\"\"\n| limitingConeAngle=\"\"\n| markerHeight=\"\"\n| markerUnits=\"\"\n| markerWidth=\"\"\n| maskContentUnits=\"\"\n| maskUnits=\"\"\n| numOctaves=\"\"\n| pathLength=\"\"\n| patternContentUnits=\"\"\n| patternTransform=\"\"\n| patternUnits=\"\"\n| pointsAtX=\"\"\n| pointsAtY=\"\"\n| pointsAtZ=\"\"\n| preserveAlpha=\"\"\n| preserveAspectRatio=\"\"\n| primitiveUnits=\"\"\n| refX=\"\"\n| refY=\"\"\n| repeatCount=\"\"\n| repeatDur=\"\"\n| requiredExtensions=\"\"\n| requiredFeatures=\"\"\n| specularConstant=\"\"\n| specularExponent=\"\"\n| spreadMethod=\"\"\n| startOffset=\"\"\n| stdDeviation=\"\"\n| stitchTiles=\"\"\n| surfaceScale=\"\"\n| systemLanguage=\"\"\n| tableValues=\"\"\n| targetX=\"\"\n| targetY=\"\"\n| textLength=\"\"\n| viewBox=\"\"\n| viewtarget=\"\"\n| xChannelSelector=\"\"\n| yChannelSelector=\"\"\n| zoomAndPan=\"\"" +PASS html5lib_tests11.html f71dd198831309fc9ccd66ef91cde63fda9b9bda +PASS html5lib_tests11.html a8f7a23601363454b4a13f66aed99ec9708ae87b +PASS html5lib_tests11.html f8f7f6c576acc9eb874acb0dce6988f0f7b6fc5f +PASS html5lib_tests11.html fb4dc9f70129a8a045fca3a1e3acee052d0990b3 +PASS html5lib_tests11.html 8f77b846acce75edf1988ea655c79f1de4321de9 +FAIL html5lib_tests11.html 39c50f080b2b9ae9e7a1070679ab97d7b814f9ec assert_equals: expected "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <svg svg>\n| <svg altGlyph>\n| <svg altGlyphDef>\n| <svg altGlyphItem>\n| <svg animateColor>\n| <svg animateMotion>\n| <svg animateTransform>\n| <svg clipPath>\n| <svg feBlend>\n| <svg feColorMatrix>\n| <svg feComponentTransfer>\n| <svg feComposite>\n| <svg feConvolveMatrix>\n| <svg feDiffuseLighting>\n| <svg feDisplacementMap>\n| <svg feDistantLight>\n| <svg feFlood>\n| <svg feFuncA>\n| <svg feFuncB>\n| <svg feFuncG>\n| <svg feFuncR>\n| <svg feGaussianBlur>\n| <svg feImage>\n| <svg feMerge>\n| <svg feMergeNode>\n| <svg feMorphology>\n| <svg feOffset>\n| <svg fePointLight>\n| <svg feSpecularLighting>\n| <svg feSpotLight>\n| <svg feTile>\n| <svg feTurbulence>\n| <svg foreignObject>\n| <svg glyphRef>\n| <svg linearGradient>\n| <svg radialGradient>\n| <svg textPath>" but got "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <svg svg>\n| <svg altglyph>\n| <svg altglyphdef>\n| <svg altglyphitem>\n| <svg animateColor>\n| <svg animateMotion>\n| <svg animateTransform>\n| <svg clipPath>\n| <svg feBlend>\n| <svg feColorMatrix>\n| <svg feComponentTransfer>\n| <svg feComposite>\n| <svg feConvolveMatrix>\n| <svg feDiffuseLighting>\n| <svg feDisplacementMap>\n| <svg feDistantLight>\n| <svg feFlood>\n| <svg feFuncA>\n| <svg feFuncB>\n| <svg feFuncG>\n| <svg feFuncR>\n| <svg feGaussianBlur>\n| <svg feImage>\n| <svg feMerge>\n| <svg feMergeNode>\n| <svg feMorphology>\n| <svg feOffset>\n| <svg fePointLight>\n| <svg feSpecularLighting>\n| <svg feSpotLight>\n| <svg feTile>\n| <svg feTurbulence>\n| <svg foreignObject>\n| <svg glyphref>\n| <svg linearGradient>\n| <svg radialGradient>\n| <svg textPath>" +FAIL html5lib_tests11.html 6d1fa1599f75625fe4d019abb04a064cf6ed39e8 assert_equals: expected "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <svg svg>\n| <svg altGlyph>\n| <svg altGlyphDef>\n| <svg altGlyphItem>\n| <svg animateColor>\n| <svg animateMotion>\n| <svg animateTransform>\n| <svg clipPath>\n| <svg feBlend>\n| <svg feColorMatrix>\n| <svg feComponentTransfer>\n| <svg feComposite>\n| <svg feConvolveMatrix>\n| <svg feDiffuseLighting>\n| <svg feDisplacementMap>\n| <svg feDistantLight>\n| <svg feFlood>\n| <svg feFuncA>\n| <svg feFuncB>\n| <svg feFuncG>\n| <svg feFuncR>\n| <svg feGaussianBlur>\n| <svg feImage>\n| <svg feMerge>\n| <svg feMergeNode>\n| <svg feMorphology>\n| <svg feOffset>\n| <svg fePointLight>\n| <svg feSpecularLighting>\n| <svg feSpotLight>\n| <svg feTile>\n| <svg feTurbulence>\n| <svg foreignObject>\n| <svg glyphRef>\n| <svg linearGradient>\n| <svg radialGradient>\n| <svg textPath>" but got "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <svg svg>\n| <svg altglyph>\n| <svg altglyphdef>\n| <svg altglyphitem>\n| <svg animateColor>\n| <svg animateMotion>\n| <svg animateTransform>\n| <svg clipPath>\n| <svg feBlend>\n| <svg feColorMatrix>\n| <svg feComponentTransfer>\n| <svg feComposite>\n| <svg feConvolveMatrix>\n| <svg feDiffuseLighting>\n| <svg feDisplacementMap>\n| <svg feDistantLight>\n| <svg feFlood>\n| <svg feFuncA>\n| <svg feFuncB>\n| <svg feFuncG>\n| <svg feFuncR>\n| <svg feGaussianBlur>\n| <svg feImage>\n| <svg feMerge>\n| <svg feMergeNode>\n| <svg feMorphology>\n| <svg feOffset>\n| <svg fePointLight>\n| <svg feSpecularLighting>\n| <svg feSpotLight>\n| <svg feTile>\n| <svg feTurbulence>\n| <svg foreignObject>\n| <svg glyphref>\n| <svg linearGradient>\n| <svg radialGradient>\n| <svg textPath>" +FAIL html5lib_tests11.html 791437ece7ba684e00162d1dd79dfe540e3621a7 assert_equals: expected "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <svg svg>\n| <svg altGlyph>\n| <svg altGlyphDef>\n| <svg altGlyphItem>\n| <svg animateColor>\n| <svg animateMotion>\n| <svg animateTransform>\n| <svg clipPath>\n| <svg feBlend>\n| <svg feColorMatrix>\n| <svg feComponentTransfer>\n| <svg feComposite>\n| <svg feConvolveMatrix>\n| <svg feDiffuseLighting>\n| <svg feDisplacementMap>\n| <svg feDistantLight>\n| <svg feFlood>\n| <svg feFuncA>\n| <svg feFuncB>\n| <svg feFuncG>\n| <svg feFuncR>\n| <svg feGaussianBlur>\n| <svg feImage>\n| <svg feMerge>\n| <svg feMergeNode>\n| <svg feMorphology>\n| <svg feOffset>\n| <svg fePointLight>\n| <svg feSpecularLighting>\n| <svg feSpotLight>\n| <svg feTile>\n| <svg feTurbulence>\n| <svg foreignObject>\n| <svg glyphRef>\n| <svg linearGradient>\n| <svg radialGradient>\n| <svg textPath>" but got "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <svg svg>\n| <svg altglyph>\n| <svg altglyphdef>\n| <svg altglyphitem>\n| <svg animateColor>\n| <svg animateMotion>\n| <svg animateTransform>\n| <svg clipPath>\n| <svg feBlend>\n| <svg feColorMatrix>\n| <svg feComponentTransfer>\n| <svg feComposite>\n| <svg feConvolveMatrix>\n| <svg feDiffuseLighting>\n| <svg feDisplacementMap>\n| <svg feDistantLight>\n| <svg feFlood>\n| <svg feFuncA>\n| <svg feFuncB>\n| <svg feFuncG>\n| <svg feFuncR>\n| <svg feGaussianBlur>\n| <svg feImage>\n| <svg feMerge>\n| <svg feMergeNode>\n| <svg feMorphology>\n| <svg feOffset>\n| <svg fePointLight>\n| <svg feSpecularLighting>\n| <svg feSpotLight>\n| <svg feTile>\n| <svg feTurbulence>\n| <svg foreignObject>\n| <svg glyphref>\n| <svg linearGradient>\n| <svg radialGradient>\n| <svg textPath>" +PASS html5lib_tests11.html af40d26164229c29b9be77ed6dd7dda780cba55c +PASS html5lib_tests11.html 16e68d18f8f0fb81013fe77a30b7d396c5081e5e +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_tests11_run_type=write_single-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_tests11_run_type=write_single-expected.txt new file mode 100644 index 0000000..447004f --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_tests11_run_type=write_single-expected.txt
@@ -0,0 +1,16 @@ +This is a testharness.js-based test. +FAIL html5lib_tests11.html ba7a66dfcf59885c08e8638d15b01df3878531e7 assert_equals: expected "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <svg svg>\n| attributeName=\"\"\n| attributeType=\"\"\n| baseFrequency=\"\"\n| baseProfile=\"\"\n| calcMode=\"\"\n| clipPathUnits=\"\"\n| diffuseConstant=\"\"\n| edgeMode=\"\"\n| filterUnits=\"\"\n| glyphRef=\"\"\n| gradientTransform=\"\"\n| gradientUnits=\"\"\n| kernelMatrix=\"\"\n| kernelUnitLength=\"\"\n| keyPoints=\"\"\n| keySplines=\"\"\n| keyTimes=\"\"\n| lengthAdjust=\"\"\n| limitingConeAngle=\"\"\n| markerHeight=\"\"\n| markerUnits=\"\"\n| markerWidth=\"\"\n| maskContentUnits=\"\"\n| maskUnits=\"\"\n| numOctaves=\"\"\n| pathLength=\"\"\n| patternContentUnits=\"\"\n| patternTransform=\"\"\n| patternUnits=\"\"\n| pointsAtX=\"\"\n| pointsAtY=\"\"\n| pointsAtZ=\"\"\n| preserveAlpha=\"\"\n| preserveAspectRatio=\"\"\n| primitiveUnits=\"\"\n| refX=\"\"\n| refY=\"\"\n| repeatCount=\"\"\n| repeatDur=\"\"\n| requiredExtensions=\"\"\n| requiredFeatures=\"\"\n| specularConstant=\"\"\n| specularExponent=\"\"\n| spreadMethod=\"\"\n| startOffset=\"\"\n| stdDeviation=\"\"\n| stitchTiles=\"\"\n| surfaceScale=\"\"\n| systemLanguage=\"\"\n| tableValues=\"\"\n| targetX=\"\"\n| targetY=\"\"\n| textLength=\"\"\n| viewBox=\"\"\n| viewTarget=\"\"\n| xChannelSelector=\"\"\n| yChannelSelector=\"\"\n| zoomAndPan=\"\"" but got "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <svg svg>\n| attributeName=\"\"\n| attributeType=\"\"\n| baseFrequency=\"\"\n| baseProfile=\"\"\n| calcMode=\"\"\n| clipPathUnits=\"\"\n| diffuseConstant=\"\"\n| edgeMode=\"\"\n| filterUnits=\"\"\n| glyphRef=\"\"\n| gradientTransform=\"\"\n| gradientUnits=\"\"\n| kernelMatrix=\"\"\n| kernelUnitLength=\"\"\n| keyPoints=\"\"\n| keySplines=\"\"\n| keyTimes=\"\"\n| lengthAdjust=\"\"\n| limitingConeAngle=\"\"\n| markerHeight=\"\"\n| markerUnits=\"\"\n| markerWidth=\"\"\n| maskContentUnits=\"\"\n| maskUnits=\"\"\n| numOctaves=\"\"\n| pathLength=\"\"\n| patternContentUnits=\"\"\n| patternTransform=\"\"\n| patternUnits=\"\"\n| pointsAtX=\"\"\n| pointsAtY=\"\"\n| pointsAtZ=\"\"\n| preserveAlpha=\"\"\n| preserveAspectRatio=\"\"\n| primitiveUnits=\"\"\n| refX=\"\"\n| refY=\"\"\n| repeatCount=\"\"\n| repeatDur=\"\"\n| requiredExtensions=\"\"\n| requiredFeatures=\"\"\n| specularConstant=\"\"\n| specularExponent=\"\"\n| spreadMethod=\"\"\n| startOffset=\"\"\n| stdDeviation=\"\"\n| stitchTiles=\"\"\n| surfaceScale=\"\"\n| systemLanguage=\"\"\n| tableValues=\"\"\n| targetX=\"\"\n| targetY=\"\"\n| textLength=\"\"\n| viewBox=\"\"\n| viewtarget=\"\"\n| xChannelSelector=\"\"\n| yChannelSelector=\"\"\n| zoomAndPan=\"\"" +FAIL html5lib_tests11.html e69c7c08a54ca868ab33b2825d998fa6c3cac90e assert_equals: expected "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <svg svg>\n| attributeName=\"\"\n| attributeType=\"\"\n| baseFrequency=\"\"\n| baseProfile=\"\"\n| calcMode=\"\"\n| clipPathUnits=\"\"\n| diffuseConstant=\"\"\n| edgeMode=\"\"\n| filterUnits=\"\"\n| glyphRef=\"\"\n| gradientTransform=\"\"\n| gradientUnits=\"\"\n| kernelMatrix=\"\"\n| kernelUnitLength=\"\"\n| keyPoints=\"\"\n| keySplines=\"\"\n| keyTimes=\"\"\n| lengthAdjust=\"\"\n| limitingConeAngle=\"\"\n| markerHeight=\"\"\n| markerUnits=\"\"\n| markerWidth=\"\"\n| maskContentUnits=\"\"\n| maskUnits=\"\"\n| numOctaves=\"\"\n| pathLength=\"\"\n| patternContentUnits=\"\"\n| patternTransform=\"\"\n| patternUnits=\"\"\n| pointsAtX=\"\"\n| pointsAtY=\"\"\n| pointsAtZ=\"\"\n| preserveAlpha=\"\"\n| preserveAspectRatio=\"\"\n| primitiveUnits=\"\"\n| refX=\"\"\n| refY=\"\"\n| repeatCount=\"\"\n| repeatDur=\"\"\n| requiredExtensions=\"\"\n| requiredFeatures=\"\"\n| specularConstant=\"\"\n| specularExponent=\"\"\n| spreadMethod=\"\"\n| startOffset=\"\"\n| stdDeviation=\"\"\n| stitchTiles=\"\"\n| surfaceScale=\"\"\n| systemLanguage=\"\"\n| tableValues=\"\"\n| targetX=\"\"\n| targetY=\"\"\n| textLength=\"\"\n| viewBox=\"\"\n| viewTarget=\"\"\n| xChannelSelector=\"\"\n| yChannelSelector=\"\"\n| zoomAndPan=\"\"" but got "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <svg svg>\n| attributeName=\"\"\n| attributeType=\"\"\n| baseFrequency=\"\"\n| baseProfile=\"\"\n| calcMode=\"\"\n| clipPathUnits=\"\"\n| diffuseConstant=\"\"\n| edgeMode=\"\"\n| filterUnits=\"\"\n| glyphRef=\"\"\n| gradientTransform=\"\"\n| gradientUnits=\"\"\n| kernelMatrix=\"\"\n| kernelUnitLength=\"\"\n| keyPoints=\"\"\n| keySplines=\"\"\n| keyTimes=\"\"\n| lengthAdjust=\"\"\n| limitingConeAngle=\"\"\n| markerHeight=\"\"\n| markerUnits=\"\"\n| markerWidth=\"\"\n| maskContentUnits=\"\"\n| maskUnits=\"\"\n| numOctaves=\"\"\n| pathLength=\"\"\n| patternContentUnits=\"\"\n| patternTransform=\"\"\n| patternUnits=\"\"\n| pointsAtX=\"\"\n| pointsAtY=\"\"\n| pointsAtZ=\"\"\n| preserveAlpha=\"\"\n| preserveAspectRatio=\"\"\n| primitiveUnits=\"\"\n| refX=\"\"\n| refY=\"\"\n| repeatCount=\"\"\n| repeatDur=\"\"\n| requiredExtensions=\"\"\n| requiredFeatures=\"\"\n| specularConstant=\"\"\n| specularExponent=\"\"\n| spreadMethod=\"\"\n| startOffset=\"\"\n| stdDeviation=\"\"\n| stitchTiles=\"\"\n| surfaceScale=\"\"\n| systemLanguage=\"\"\n| tableValues=\"\"\n| targetX=\"\"\n| targetY=\"\"\n| textLength=\"\"\n| viewBox=\"\"\n| viewtarget=\"\"\n| xChannelSelector=\"\"\n| yChannelSelector=\"\"\n| zoomAndPan=\"\"" +FAIL html5lib_tests11.html 0e5897aafe87e460f84576c2d1d983504d12a7db assert_equals: expected "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <svg svg>\n| attributeName=\"\"\n| attributeType=\"\"\n| baseFrequency=\"\"\n| baseProfile=\"\"\n| calcMode=\"\"\n| clipPathUnits=\"\"\n| diffuseConstant=\"\"\n| edgeMode=\"\"\n| filterUnits=\"\"\n| filterres=\"\"\n| glyphRef=\"\"\n| gradientTransform=\"\"\n| gradientUnits=\"\"\n| kernelMatrix=\"\"\n| kernelUnitLength=\"\"\n| keyPoints=\"\"\n| keySplines=\"\"\n| keyTimes=\"\"\n| lengthAdjust=\"\"\n| limitingConeAngle=\"\"\n| markerHeight=\"\"\n| markerUnits=\"\"\n| markerWidth=\"\"\n| maskContentUnits=\"\"\n| maskUnits=\"\"\n| numOctaves=\"\"\n| pathLength=\"\"\n| patternContentUnits=\"\"\n| patternTransform=\"\"\n| patternUnits=\"\"\n| pointsAtX=\"\"\n| pointsAtY=\"\"\n| pointsAtZ=\"\"\n| preserveAlpha=\"\"\n| preserveAspectRatio=\"\"\n| primitiveUnits=\"\"\n| refX=\"\"\n| refY=\"\"\n| repeatCount=\"\"\n| repeatDur=\"\"\n| requiredExtensions=\"\"\n| requiredFeatures=\"\"\n| specularConstant=\"\"\n| specularExponent=\"\"\n| spreadMethod=\"\"\n| startOffset=\"\"\n| stdDeviation=\"\"\n| stitchTiles=\"\"\n| surfaceScale=\"\"\n| systemLanguage=\"\"\n| tableValues=\"\"\n| targetX=\"\"\n| targetY=\"\"\n| textLength=\"\"\n| viewBox=\"\"\n| viewTarget=\"\"\n| xChannelSelector=\"\"\n| yChannelSelector=\"\"\n| zoomAndPan=\"\"" but got "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <svg svg>\n| attributeName=\"\"\n| attributeType=\"\"\n| baseFrequency=\"\"\n| baseProfile=\"\"\n| calcMode=\"\"\n| clipPathUnits=\"\"\n| diffuseConstant=\"\"\n| edgeMode=\"\"\n| filterUnits=\"\"\n| filterres=\"\"\n| glyphRef=\"\"\n| gradientTransform=\"\"\n| gradientUnits=\"\"\n| kernelMatrix=\"\"\n| kernelUnitLength=\"\"\n| keyPoints=\"\"\n| keySplines=\"\"\n| keyTimes=\"\"\n| lengthAdjust=\"\"\n| limitingConeAngle=\"\"\n| markerHeight=\"\"\n| markerUnits=\"\"\n| markerWidth=\"\"\n| maskContentUnits=\"\"\n| maskUnits=\"\"\n| numOctaves=\"\"\n| pathLength=\"\"\n| patternContentUnits=\"\"\n| patternTransform=\"\"\n| patternUnits=\"\"\n| pointsAtX=\"\"\n| pointsAtY=\"\"\n| pointsAtZ=\"\"\n| preserveAlpha=\"\"\n| preserveAspectRatio=\"\"\n| primitiveUnits=\"\"\n| refX=\"\"\n| refY=\"\"\n| repeatCount=\"\"\n| repeatDur=\"\"\n| requiredExtensions=\"\"\n| requiredFeatures=\"\"\n| specularConstant=\"\"\n| specularExponent=\"\"\n| spreadMethod=\"\"\n| startOffset=\"\"\n| stdDeviation=\"\"\n| stitchTiles=\"\"\n| surfaceScale=\"\"\n| systemLanguage=\"\"\n| tableValues=\"\"\n| targetX=\"\"\n| targetY=\"\"\n| textLength=\"\"\n| viewBox=\"\"\n| viewtarget=\"\"\n| xChannelSelector=\"\"\n| yChannelSelector=\"\"\n| zoomAndPan=\"\"" +PASS html5lib_tests11.html f71dd198831309fc9ccd66ef91cde63fda9b9bda +PASS html5lib_tests11.html a8f7a23601363454b4a13f66aed99ec9708ae87b +PASS html5lib_tests11.html f8f7f6c576acc9eb874acb0dce6988f0f7b6fc5f +PASS html5lib_tests11.html fb4dc9f70129a8a045fca3a1e3acee052d0990b3 +PASS html5lib_tests11.html 8f77b846acce75edf1988ea655c79f1de4321de9 +FAIL html5lib_tests11.html 39c50f080b2b9ae9e7a1070679ab97d7b814f9ec assert_equals: expected "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <svg svg>\n| <svg altGlyph>\n| <svg altGlyphDef>\n| <svg altGlyphItem>\n| <svg animateColor>\n| <svg animateMotion>\n| <svg animateTransform>\n| <svg clipPath>\n| <svg feBlend>\n| <svg feColorMatrix>\n| <svg feComponentTransfer>\n| <svg feComposite>\n| <svg feConvolveMatrix>\n| <svg feDiffuseLighting>\n| <svg feDisplacementMap>\n| <svg feDistantLight>\n| <svg feFlood>\n| <svg feFuncA>\n| <svg feFuncB>\n| <svg feFuncG>\n| <svg feFuncR>\n| <svg feGaussianBlur>\n| <svg feImage>\n| <svg feMerge>\n| <svg feMergeNode>\n| <svg feMorphology>\n| <svg feOffset>\n| <svg fePointLight>\n| <svg feSpecularLighting>\n| <svg feSpotLight>\n| <svg feTile>\n| <svg feTurbulence>\n| <svg foreignObject>\n| <svg glyphRef>\n| <svg linearGradient>\n| <svg radialGradient>\n| <svg textPath>" but got "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <svg svg>\n| <svg altglyph>\n| <svg altglyphdef>\n| <svg altglyphitem>\n| <svg animateColor>\n| <svg animateMotion>\n| <svg animateTransform>\n| <svg clipPath>\n| <svg feBlend>\n| <svg feColorMatrix>\n| <svg feComponentTransfer>\n| <svg feComposite>\n| <svg feConvolveMatrix>\n| <svg feDiffuseLighting>\n| <svg feDisplacementMap>\n| <svg feDistantLight>\n| <svg feFlood>\n| <svg feFuncA>\n| <svg feFuncB>\n| <svg feFuncG>\n| <svg feFuncR>\n| <svg feGaussianBlur>\n| <svg feImage>\n| <svg feMerge>\n| <svg feMergeNode>\n| <svg feMorphology>\n| <svg feOffset>\n| <svg fePointLight>\n| <svg feSpecularLighting>\n| <svg feSpotLight>\n| <svg feTile>\n| <svg feTurbulence>\n| <svg foreignObject>\n| <svg glyphref>\n| <svg linearGradient>\n| <svg radialGradient>\n| <svg textPath>" +FAIL html5lib_tests11.html 6d1fa1599f75625fe4d019abb04a064cf6ed39e8 assert_equals: expected "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <svg svg>\n| <svg altGlyph>\n| <svg altGlyphDef>\n| <svg altGlyphItem>\n| <svg animateColor>\n| <svg animateMotion>\n| <svg animateTransform>\n| <svg clipPath>\n| <svg feBlend>\n| <svg feColorMatrix>\n| <svg feComponentTransfer>\n| <svg feComposite>\n| <svg feConvolveMatrix>\n| <svg feDiffuseLighting>\n| <svg feDisplacementMap>\n| <svg feDistantLight>\n| <svg feFlood>\n| <svg feFuncA>\n| <svg feFuncB>\n| <svg feFuncG>\n| <svg feFuncR>\n| <svg feGaussianBlur>\n| <svg feImage>\n| <svg feMerge>\n| <svg feMergeNode>\n| <svg feMorphology>\n| <svg feOffset>\n| <svg fePointLight>\n| <svg feSpecularLighting>\n| <svg feSpotLight>\n| <svg feTile>\n| <svg feTurbulence>\n| <svg foreignObject>\n| <svg glyphRef>\n| <svg linearGradient>\n| <svg radialGradient>\n| <svg textPath>" but got "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <svg svg>\n| <svg altglyph>\n| <svg altglyphdef>\n| <svg altglyphitem>\n| <svg animateColor>\n| <svg animateMotion>\n| <svg animateTransform>\n| <svg clipPath>\n| <svg feBlend>\n| <svg feColorMatrix>\n| <svg feComponentTransfer>\n| <svg feComposite>\n| <svg feConvolveMatrix>\n| <svg feDiffuseLighting>\n| <svg feDisplacementMap>\n| <svg feDistantLight>\n| <svg feFlood>\n| <svg feFuncA>\n| <svg feFuncB>\n| <svg feFuncG>\n| <svg feFuncR>\n| <svg feGaussianBlur>\n| <svg feImage>\n| <svg feMerge>\n| <svg feMergeNode>\n| <svg feMorphology>\n| <svg feOffset>\n| <svg fePointLight>\n| <svg feSpecularLighting>\n| <svg feSpotLight>\n| <svg feTile>\n| <svg feTurbulence>\n| <svg foreignObject>\n| <svg glyphref>\n| <svg linearGradient>\n| <svg radialGradient>\n| <svg textPath>" +FAIL html5lib_tests11.html 791437ece7ba684e00162d1dd79dfe540e3621a7 assert_equals: expected "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <svg svg>\n| <svg altGlyph>\n| <svg altGlyphDef>\n| <svg altGlyphItem>\n| <svg animateColor>\n| <svg animateMotion>\n| <svg animateTransform>\n| <svg clipPath>\n| <svg feBlend>\n| <svg feColorMatrix>\n| <svg feComponentTransfer>\n| <svg feComposite>\n| <svg feConvolveMatrix>\n| <svg feDiffuseLighting>\n| <svg feDisplacementMap>\n| <svg feDistantLight>\n| <svg feFlood>\n| <svg feFuncA>\n| <svg feFuncB>\n| <svg feFuncG>\n| <svg feFuncR>\n| <svg feGaussianBlur>\n| <svg feImage>\n| <svg feMerge>\n| <svg feMergeNode>\n| <svg feMorphology>\n| <svg feOffset>\n| <svg fePointLight>\n| <svg feSpecularLighting>\n| <svg feSpotLight>\n| <svg feTile>\n| <svg feTurbulence>\n| <svg foreignObject>\n| <svg glyphRef>\n| <svg linearGradient>\n| <svg radialGradient>\n| <svg textPath>" but got "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <svg svg>\n| <svg altglyph>\n| <svg altglyphdef>\n| <svg altglyphitem>\n| <svg animateColor>\n| <svg animateMotion>\n| <svg animateTransform>\n| <svg clipPath>\n| <svg feBlend>\n| <svg feColorMatrix>\n| <svg feComponentTransfer>\n| <svg feComposite>\n| <svg feConvolveMatrix>\n| <svg feDiffuseLighting>\n| <svg feDisplacementMap>\n| <svg feDistantLight>\n| <svg feFlood>\n| <svg feFuncA>\n| <svg feFuncB>\n| <svg feFuncG>\n| <svg feFuncR>\n| <svg feGaussianBlur>\n| <svg feImage>\n| <svg feMerge>\n| <svg feMergeNode>\n| <svg feMorphology>\n| <svg feOffset>\n| <svg fePointLight>\n| <svg feSpecularLighting>\n| <svg feSpotLight>\n| <svg feTile>\n| <svg feTurbulence>\n| <svg foreignObject>\n| <svg glyphref>\n| <svg linearGradient>\n| <svg radialGradient>\n| <svg textPath>" +PASS html5lib_tests11.html af40d26164229c29b9be77ed6dd7dda780cba55c +PASS html5lib_tests11.html 16e68d18f8f0fb81013fe77a30b7d396c5081e5e +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_tests25_run_type=uri-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_tests25_run_type=uri-expected.txt new file mode 100644 index 0000000..6287f75 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_tests25_run_type=uri-expected.txt
@@ -0,0 +1,23 @@ +This is a testharness.js-based test. +PASS html5lib_tests25.html 025adbb619bdef9ad228a6b378b9dd6bef9f93dc +PASS html5lib_tests25.html 7e561454888535bc5c68e7396de2f4206c81e97d +PASS html5lib_tests25.html a14bdd90f5a745296e74c23951245cb7c5046ed1 +PASS html5lib_tests25.html 421ad19f7854b9c8e28a0595a8dd20d6bfcd5376 +PASS html5lib_tests25.html 7e8234523fbf67d37ab60f593e1fc3ac67706651 +PASS html5lib_tests25.html c705ceb6fb37865e6965641ea80137baf44176b6 +PASS html5lib_tests25.html 277da0c4c937f3852d8a7cacf4e4b426a30b3dda +FAIL html5lib_tests25.html de4aa726e09215ba9c50b97d257e6c6b880107f1 assert_equals: expected "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <command>\n| \"A\"" but got "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <command>\n| \"A\"" +PASS html5lib_tests25.html 578e08f11628dc9841f3eb21c016e1e28cec0304 +PASS html5lib_tests25.html a6e5387b48c4d0399a802215f7fa206bd0d3b492 +PASS html5lib_tests25.html d56d47bc9d9c7472fb1706bdecda1bbd165dcf91 +PASS html5lib_tests25.html 2779456edd8407b403561e0cf339c8c2308c88b8 +PASS html5lib_tests25.html 17d197ab2416adec6eb92e398c2db6f7efc98b58 +PASS html5lib_tests25.html 1ccc6e280f6dc773e2e00f2cb70cd96e97078296 +PASS html5lib_tests25.html 48ddaacf5355643f27ef704ece88b227f51fc7cb +PASS html5lib_tests25.html bf29bfbd56c9863d19e4d66cd67a0dc1813b2e86 +PASS html5lib_tests25.html 73fc7c062b68d4f89579683dbb7f1eaef4ec27f1 +PASS html5lib_tests25.html 057bc2d868d2f365cb2c0b4d07c231d2fa2b23b7 +PASS html5lib_tests25.html 7f684d19be362ec9aa4fe7ecbba4ff3fc9730a43 +PASS html5lib_tests25.html d79f9119d02447226cc2d151044e6cffc5409e81 +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_tests25_run_type=write-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_tests25_run_type=write-expected.txt new file mode 100644 index 0000000..6287f75 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_tests25_run_type=write-expected.txt
@@ -0,0 +1,23 @@ +This is a testharness.js-based test. +PASS html5lib_tests25.html 025adbb619bdef9ad228a6b378b9dd6bef9f93dc +PASS html5lib_tests25.html 7e561454888535bc5c68e7396de2f4206c81e97d +PASS html5lib_tests25.html a14bdd90f5a745296e74c23951245cb7c5046ed1 +PASS html5lib_tests25.html 421ad19f7854b9c8e28a0595a8dd20d6bfcd5376 +PASS html5lib_tests25.html 7e8234523fbf67d37ab60f593e1fc3ac67706651 +PASS html5lib_tests25.html c705ceb6fb37865e6965641ea80137baf44176b6 +PASS html5lib_tests25.html 277da0c4c937f3852d8a7cacf4e4b426a30b3dda +FAIL html5lib_tests25.html de4aa726e09215ba9c50b97d257e6c6b880107f1 assert_equals: expected "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <command>\n| \"A\"" but got "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <command>\n| \"A\"" +PASS html5lib_tests25.html 578e08f11628dc9841f3eb21c016e1e28cec0304 +PASS html5lib_tests25.html a6e5387b48c4d0399a802215f7fa206bd0d3b492 +PASS html5lib_tests25.html d56d47bc9d9c7472fb1706bdecda1bbd165dcf91 +PASS html5lib_tests25.html 2779456edd8407b403561e0cf339c8c2308c88b8 +PASS html5lib_tests25.html 17d197ab2416adec6eb92e398c2db6f7efc98b58 +PASS html5lib_tests25.html 1ccc6e280f6dc773e2e00f2cb70cd96e97078296 +PASS html5lib_tests25.html 48ddaacf5355643f27ef704ece88b227f51fc7cb +PASS html5lib_tests25.html bf29bfbd56c9863d19e4d66cd67a0dc1813b2e86 +PASS html5lib_tests25.html 73fc7c062b68d4f89579683dbb7f1eaef4ec27f1 +PASS html5lib_tests25.html 057bc2d868d2f365cb2c0b4d07c231d2fa2b23b7 +PASS html5lib_tests25.html 7f684d19be362ec9aa4fe7ecbba4ff3fc9730a43 +PASS html5lib_tests25.html d79f9119d02447226cc2d151044e6cffc5409e81 +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_tests25_run_type=write_single-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_tests25_run_type=write_single-expected.txt new file mode 100644 index 0000000..6287f75 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_tests25_run_type=write_single-expected.txt
@@ -0,0 +1,23 @@ +This is a testharness.js-based test. +PASS html5lib_tests25.html 025adbb619bdef9ad228a6b378b9dd6bef9f93dc +PASS html5lib_tests25.html 7e561454888535bc5c68e7396de2f4206c81e97d +PASS html5lib_tests25.html a14bdd90f5a745296e74c23951245cb7c5046ed1 +PASS html5lib_tests25.html 421ad19f7854b9c8e28a0595a8dd20d6bfcd5376 +PASS html5lib_tests25.html 7e8234523fbf67d37ab60f593e1fc3ac67706651 +PASS html5lib_tests25.html c705ceb6fb37865e6965641ea80137baf44176b6 +PASS html5lib_tests25.html 277da0c4c937f3852d8a7cacf4e4b426a30b3dda +FAIL html5lib_tests25.html de4aa726e09215ba9c50b97d257e6c6b880107f1 assert_equals: expected "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <command>\n| \"A\"" but got "#document\n| <!DOCTYPE html>\n| <html>\n| <head>\n| <body>\n| <command>\n| \"A\"" +PASS html5lib_tests25.html 578e08f11628dc9841f3eb21c016e1e28cec0304 +PASS html5lib_tests25.html a6e5387b48c4d0399a802215f7fa206bd0d3b492 +PASS html5lib_tests25.html d56d47bc9d9c7472fb1706bdecda1bbd165dcf91 +PASS html5lib_tests25.html 2779456edd8407b403561e0cf339c8c2308c88b8 +PASS html5lib_tests25.html 17d197ab2416adec6eb92e398c2db6f7efc98b58 +PASS html5lib_tests25.html 1ccc6e280f6dc773e2e00f2cb70cd96e97078296 +PASS html5lib_tests25.html 48ddaacf5355643f27ef704ece88b227f51fc7cb +PASS html5lib_tests25.html bf29bfbd56c9863d19e4d66cd67a0dc1813b2e86 +PASS html5lib_tests25.html 73fc7c062b68d4f89579683dbb7f1eaef4ec27f1 +PASS html5lib_tests25.html 057bc2d868d2f365cb2c0b4d07c231d2fa2b23b7 +PASS html5lib_tests25.html 7f684d19be362ec9aa4fe7ecbba4ff3fc9730a43 +PASS html5lib_tests25.html d79f9119d02447226cc2d151044e6cffc5409e81 +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_webkit02_run_type=uri-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_webkit02_run_type=uri-expected.txt new file mode 100644 index 0000000..90886a9 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_webkit02_run_type=uri-expected.txt
@@ -0,0 +1,20 @@ +This is a testharness.js-based test. +PASS html5lib_webkit02.html f50b8c15847159a6d2c6ecc2bd1e4a944ba5aae6 +PASS html5lib_webkit02.html 326328ea805a2ebdde707e08567713f88a4cf8ab +PASS html5lib_webkit02.html 05138397908cfdad69a3bfe5da5a06098320b504 +PASS html5lib_webkit02.html 2aaa2ac0d7cec6144633d8f82f3bcaafa7498cd9 +PASS html5lib_webkit02.html 4a256d7ef602c7c917c758e15981b9710f9b4130 +PASS html5lib_webkit02.html 98cea04429ddbe4ffaaa0b91fe77b8c0b1f7c1f4 +PASS html5lib_webkit02.html 209ad7d6f6c9c53cb856c7d78b2bc4a7f38abd5f +PASS html5lib_webkit02.html cb9a86fbac96b08a6e708a2dbcd9f78539dfe9c6 +PASS html5lib_webkit02.html c46a4badc6b1ebc524e6f90ea56183310e93ab25 +PASS html5lib_webkit02.html 464eeaecc49646ff810cadad537880c9b473a262 +PASS html5lib_webkit02.html 7b4eb6981451ede406f2f4112e83a8584e7adbf5 +PASS html5lib_webkit02.html 73aed96d7cd3116e4a3e701104616c07d1ec5e0c +PASS html5lib_webkit02.html 139a546c72bfcedf638d031f33da43f24995f688 +FAIL html5lib_webkit02.html 6e33515b4dc011dd390d433a6358bf68b786b1fd assert_equals: expected "#document\n| <html>\n| <head>\n| <body>\n| <b>\n| <em>\n| <foo>\n| <foo>\n| <foo>\n| <aside>\n| <b>" but got "#document\n| <html>\n| <head>\n| <body>\n| <b>\n| <em>\n| <foo>\n| <foo>\n| <foo>\n| <aside>\n| <em>\n| <b>" +PASS html5lib_webkit02.html b6d2377b0dd710ca812c97b2b65cb5d2e93b0e5b +PASS html5lib_webkit02.html 21a5b2b413c4db8ed588334b9a50dea9872bbcfa +PASS html5lib_webkit02.html 90d3f6f2dff994f63293ca46f7cd50a75cde96a6 +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_webkit02_run_type=write-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_webkit02_run_type=write-expected.txt new file mode 100644 index 0000000..90886a9 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_webkit02_run_type=write-expected.txt
@@ -0,0 +1,20 @@ +This is a testharness.js-based test. +PASS html5lib_webkit02.html f50b8c15847159a6d2c6ecc2bd1e4a944ba5aae6 +PASS html5lib_webkit02.html 326328ea805a2ebdde707e08567713f88a4cf8ab +PASS html5lib_webkit02.html 05138397908cfdad69a3bfe5da5a06098320b504 +PASS html5lib_webkit02.html 2aaa2ac0d7cec6144633d8f82f3bcaafa7498cd9 +PASS html5lib_webkit02.html 4a256d7ef602c7c917c758e15981b9710f9b4130 +PASS html5lib_webkit02.html 98cea04429ddbe4ffaaa0b91fe77b8c0b1f7c1f4 +PASS html5lib_webkit02.html 209ad7d6f6c9c53cb856c7d78b2bc4a7f38abd5f +PASS html5lib_webkit02.html cb9a86fbac96b08a6e708a2dbcd9f78539dfe9c6 +PASS html5lib_webkit02.html c46a4badc6b1ebc524e6f90ea56183310e93ab25 +PASS html5lib_webkit02.html 464eeaecc49646ff810cadad537880c9b473a262 +PASS html5lib_webkit02.html 7b4eb6981451ede406f2f4112e83a8584e7adbf5 +PASS html5lib_webkit02.html 73aed96d7cd3116e4a3e701104616c07d1ec5e0c +PASS html5lib_webkit02.html 139a546c72bfcedf638d031f33da43f24995f688 +FAIL html5lib_webkit02.html 6e33515b4dc011dd390d433a6358bf68b786b1fd assert_equals: expected "#document\n| <html>\n| <head>\n| <body>\n| <b>\n| <em>\n| <foo>\n| <foo>\n| <foo>\n| <aside>\n| <b>" but got "#document\n| <html>\n| <head>\n| <body>\n| <b>\n| <em>\n| <foo>\n| <foo>\n| <foo>\n| <aside>\n| <em>\n| <b>" +PASS html5lib_webkit02.html b6d2377b0dd710ca812c97b2b65cb5d2e93b0e5b +PASS html5lib_webkit02.html 21a5b2b413c4db8ed588334b9a50dea9872bbcfa +PASS html5lib_webkit02.html 90d3f6f2dff994f63293ca46f7cd50a75cde96a6 +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_webkit02_run_type=write_single-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_webkit02_run_type=write_single-expected.txt new file mode 100644 index 0000000..90886a9 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/syntax/parsing/html5lib_webkit02_run_type=write_single-expected.txt
@@ -0,0 +1,20 @@ +This is a testharness.js-based test. +PASS html5lib_webkit02.html f50b8c15847159a6d2c6ecc2bd1e4a944ba5aae6 +PASS html5lib_webkit02.html 326328ea805a2ebdde707e08567713f88a4cf8ab +PASS html5lib_webkit02.html 05138397908cfdad69a3bfe5da5a06098320b504 +PASS html5lib_webkit02.html 2aaa2ac0d7cec6144633d8f82f3bcaafa7498cd9 +PASS html5lib_webkit02.html 4a256d7ef602c7c917c758e15981b9710f9b4130 +PASS html5lib_webkit02.html 98cea04429ddbe4ffaaa0b91fe77b8c0b1f7c1f4 +PASS html5lib_webkit02.html 209ad7d6f6c9c53cb856c7d78b2bc4a7f38abd5f +PASS html5lib_webkit02.html cb9a86fbac96b08a6e708a2dbcd9f78539dfe9c6 +PASS html5lib_webkit02.html c46a4badc6b1ebc524e6f90ea56183310e93ab25 +PASS html5lib_webkit02.html 464eeaecc49646ff810cadad537880c9b473a262 +PASS html5lib_webkit02.html 7b4eb6981451ede406f2f4112e83a8584e7adbf5 +PASS html5lib_webkit02.html 73aed96d7cd3116e4a3e701104616c07d1ec5e0c +PASS html5lib_webkit02.html 139a546c72bfcedf638d031f33da43f24995f688 +FAIL html5lib_webkit02.html 6e33515b4dc011dd390d433a6358bf68b786b1fd assert_equals: expected "#document\n| <html>\n| <head>\n| <body>\n| <b>\n| <em>\n| <foo>\n| <foo>\n| <foo>\n| <aside>\n| <b>" but got "#document\n| <html>\n| <head>\n| <body>\n| <b>\n| <em>\n| <foo>\n| <foo>\n| <foo>\n| <aside>\n| <em>\n| <b>" +PASS html5lib_webkit02.html b6d2377b0dd710ca812c97b2b65cb5d2e93b0e5b +PASS html5lib_webkit02.html 21a5b2b413c4db8ed588334b9a50dea9872bbcfa +PASS html5lib_webkit02.html 90d3f6f2dff994f63293ca46f7cd50a75cde96a6 +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/websockets/constructor/002-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/websockets/constructor/002-expected.txt new file mode 100644 index 0000000..8bbca83 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/websockets/constructor/002-expected.txt
@@ -0,0 +1,13 @@ +This is a testharness.js-based test. +PASS WebSockets: new WebSocket(invalid url) +FAIL WebSockets: new WebSocket(invalid url) 1 assert_throws: function "function(){new WebSocket("ws://foo bar.com/")}" did not throw +FAIL WebSockets: new WebSocket(invalid url) 2 assert_throws: function "function(){new WebSocket("wss://foo bar.com/")}" did not throw +PASS WebSockets: new WebSocket(invalid url) 3 +PASS WebSockets: new WebSocket(invalid url) 4 +PASS WebSockets: new WebSocket(invalid url) 5 +PASS WebSockets: new WebSocket(invalid url) 6 +PASS WebSockets: new WebSocket(invalid url) 7 +PASS WebSockets: new WebSocket(invalid url) 8 +PASS WebSockets: new WebSocket(invalid url) 9 +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/websockets/constructor/002_wss-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/websockets/constructor/002_wss-expected.txt new file mode 100644 index 0000000..8bbca83 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/websockets/constructor/002_wss-expected.txt
@@ -0,0 +1,13 @@ +This is a testharness.js-based test. +PASS WebSockets: new WebSocket(invalid url) +FAIL WebSockets: new WebSocket(invalid url) 1 assert_throws: function "function(){new WebSocket("ws://foo bar.com/")}" did not throw +FAIL WebSockets: new WebSocket(invalid url) 2 assert_throws: function "function(){new WebSocket("wss://foo bar.com/")}" did not throw +PASS WebSockets: new WebSocket(invalid url) 3 +PASS WebSockets: new WebSocket(invalid url) 4 +PASS WebSockets: new WebSocket(invalid url) 5 +PASS WebSockets: new WebSocket(invalid url) 6 +PASS WebSockets: new WebSocket(invalid url) 7 +PASS WebSockets: new WebSocket(invalid url) 8 +PASS WebSockets: new WebSocket(invalid url) 9 +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/websockets/cookies/007-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/websockets/cookies/007-expected.txt new file mode 100644 index 0000000..31f81ab --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/websockets/cookies/007-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL WebSockets: when to process set-cookie fields in ws response assert_unreached: cookie was set during script execution Reached unreachable code +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/websockets/cookies/007_wss-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/websockets/cookies/007_wss-expected.txt new file mode 100644 index 0000000..31f81ab --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/websockets/cookies/007_wss-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL WebSockets: when to process set-cookie fields in ws response assert_unreached: cookie was set during script execution Reached unreachable code +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/websockets/interfaces/WebSocket/close/close-connecting-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/websockets/interfaces/WebSocket/close/close-connecting-expected.txt new file mode 100644 index 0000000..c0aab55 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/websockets/interfaces/WebSocket/close/close-connecting-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL WebSockets: close() when connecting assert_unreached: Reached unreachable code +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/websockets/interfaces/WebSocket/close/close-connecting_wss-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/websockets/interfaces/WebSocket/close/close-connecting_wss-expected.txt new file mode 100644 index 0000000..c0aab55 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/websockets/interfaces/WebSocket/close/close-connecting_wss-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL WebSockets: close() when connecting assert_unreached: Reached unreachable code +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/websockets/interfaces/WebSocket/close/close-nested-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/websockets/interfaces/WebSocket/close/close-nested-expected.txt new file mode 100644 index 0000000..83939e3 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/websockets/interfaces/WebSocket/close/close-nested-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL WebSockets: close() in close event handler assert_equals: expected 2 but got 3 +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/websockets/interfaces/WebSocket/close/close-nested_wss-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/websockets/interfaces/WebSocket/close/close-nested_wss-expected.txt new file mode 100644 index 0000000..83939e3 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/websockets/interfaces/WebSocket/close/close-nested_wss-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL WebSockets: close() in close event handler assert_equals: expected 2 but got 3 +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/websockets/interfaces/WebSocket/readyState/003-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/websockets/interfaces/WebSocket/readyState/003-expected.txt new file mode 100644 index 0000000..4af29be --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/websockets/interfaces/WebSocket/readyState/003-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL WebSockets: delete readyState assert_equals: delete ws.readyState expected 2 but got 3 +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/websockets/interfaces/WebSocket/readyState/003_wss-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/websockets/interfaces/WebSocket/readyState/003_wss-expected.txt new file mode 100644 index 0000000..4af29be --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/websockets/interfaces/WebSocket/readyState/003_wss-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL WebSockets: delete readyState assert_equals: delete ws.readyState expected 2 but got 3 +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/websockets/unload-a-document/002-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/websockets/unload-a-document/002-expected.txt new file mode 100644 index 0000000..1da3d918 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/websockets/unload-a-document/002-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL WebSockets: navigating top-level browsing context with closed websocket assert_unreached: document was discarded Reached unreachable code +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/websockets/unload-a-document/002_wss-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/websockets/unload-a-document/002_wss-expected.txt new file mode 100644 index 0000000..1da3d918 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/websockets/unload-a-document/002_wss-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL WebSockets: navigating top-level browsing context with closed websocket assert_unreached: document was discarded Reached unreachable code +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-ime.html b/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-ime.html index 2bc95b4..17a9744 100644 --- a/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-ime.html +++ b/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-ime.html
@@ -7,7 +7,8 @@ document.addEventListener('beforeinput', event => { const logString = - `beforeinput: isComposing=${event.isComposing}, data="${event.data}"`; + `beforeinput: isComposing=${event.isComposing}, data="${event.data}", ` + + `inputType=${event.inputType}`; eventLog.push(logString); }); @@ -75,7 +76,8 @@ resetEventLog(); textInputController.setComposition(''); assert_array_equals(eventLog, [ - 'beforeinput: isComposing=false, data="null"', + 'beforeinput: isComposing=false, data="null", ' + + 'inputType=deleteContentBackward', 'input: isComposing=false, data="null", inputType=deleteContentBackward', ]); }, 'setComposition with no composition open, empty text replacing selection'); @@ -105,7 +107,8 @@ textInputController.setComposition('hello'); assert_array_equals(eventLog, [ 'compositionstart', - 'beforeinput: isComposing=true, data="hello"', + 'beforeinput: isComposing=true, data="hello", ' + + 'inputType=insertCompositionText', 'compositionupdate: data="hello"', 'input: isComposing=true, data="hello", inputType=insertCompositionText', ]); @@ -123,7 +126,7 @@ textInputController.setComposition(''); assert_array_equals(eventLog, [ - 'beforeinput: isComposing=true, data=""', + 'beforeinput: isComposing=true, data="", inputType=insertCompositionText', 'compositionupdate: data=""', 'textInput: data=""', 'input: isComposing=true, data="null", inputType=insertCompositionText', @@ -143,7 +146,8 @@ textInputController.setComposition('hello world'); assert_array_equals(eventLog, [ - 'beforeinput: isComposing=true, data="hello world"', + 'beforeinput: isComposing=true, data="hello world", ' + + 'inputType=insertCompositionText', 'compositionupdate: data="hello world"', 'input: isComposing=true, data="hello world", ' + 'inputType=insertCompositionText', @@ -162,7 +166,8 @@ textInputController.insertText('hello world'); assert_array_equals(eventLog, [ - 'beforeinput: isComposing=true, data="hello world"', + 'beforeinput: isComposing=true, data="hello world", ' + + 'inputType=insertCompositionText', 'compositionupdate: data="hello world"', 'textInput: data="hello world"', 'input: isComposing=true, data="hello world", ' @@ -183,7 +188,7 @@ textInputController.insertText(''); assert_array_equals(eventLog, [ - 'beforeinput: isComposing=true, data=""', + 'beforeinput: isComposing=true, data="", inputType=insertCompositionText', 'compositionupdate: data=""', 'textInput: data=""', 'input: isComposing=true, data="null", inputType=insertCompositionText', @@ -202,7 +207,7 @@ textInputController.insertText('hello'); assert_array_equals(eventLog, [ - 'beforeinput: isComposing=false, data="hello"', + 'beforeinput: isComposing=false, data="hello", inputType=insertText', 'textInput: data="hello"', 'input: isComposing=false, data="hello", inputType=insertText', ]); @@ -250,7 +255,8 @@ textInputController.unmarkText(); assert_array_equals(eventLog, [ - 'beforeinput: isComposing=true, data="hello"', + 'beforeinput: isComposing=true, data="hello", ' + + 'inputType=insertCompositionText', 'compositionupdate: data="hello"', 'textInput: data="h"', 'input: isComposing=true, data="h", inputType=insertCompositionText', @@ -287,7 +293,8 @@ textInputController.unmarkAndUnselectText(); assert_array_equals(eventLog, [ - 'beforeinput: isComposing=true, data="hello"', + 'beforeinput: isComposing=true, data="hello", ' + + 'inputType=insertCompositionText', 'compositionupdate: data="hello"', 'textInput: data="h"', 'input: isComposing=true, data="h", inputType=insertCompositionText', @@ -308,7 +315,8 @@ textInputController.extendSelectionAndDelete(1, 1); assert_array_equals(eventLog, [ - 'beforeinput: isComposing=false, data="null"', + 'beforeinput: isComposing=false, data="null", ' + + 'inputType=deleteContentBackward', 'input: isComposing=false, data="null", inputType=deleteContentBackward', ]); }, 'extendSelectionAndDelete, no composition open'); @@ -327,7 +335,8 @@ textInputController.extendSelectionAndDelete(1, 1); assert_array_equals(eventLog, [ - 'beforeinput: isComposing=false, data="null"', + 'beforeinput: isComposing=false, data="null", ' + + 'inputType=deleteContentBackward', 'input: isComposing=false, data="null", inputType=deleteContentBackward', ]); }, 'extendSelectionAndDelete, composition open'); @@ -345,9 +354,11 @@ textInputController.deleteSurroundingText(1, 1); assert_array_equals(eventLog, [ - 'beforeinput: isComposing=false, data="null"', + 'beforeinput: isComposing=false, data="null", ' + + 'inputType=deleteContentBackward', 'input: isComposing=false, data="null", inputType=deleteContentBackward', - 'beforeinput: isComposing=false, data="null"', + 'beforeinput: isComposing=false, data="null", ' + + 'inputType=deleteContentBackward', 'input: isComposing=false, data="null", inputType=deleteContentBackward', ]); }, 'deleteSurroundingText, no composition open'); @@ -366,9 +377,11 @@ textInputController.deleteSurroundingText(1, 1); assert_array_equals(eventLog, [ - 'beforeinput: isComposing=false, data="null"', + 'beforeinput: isComposing=false, data="null", ' + + 'inputType=deleteContentBackward', 'input: isComposing=false, data="null", inputType=deleteContentBackward', - 'beforeinput: isComposing=false, data="null"', + 'beforeinput: isComposing=false, data="null", ' + + 'inputType=deleteContentBackward', 'input: isComposing=false, data="null", inputType=deleteContentBackward', ]); }, 'deleteSurroundingText, composition open');
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/runtime/runtime-callFunctionOn.js b/third_party/WebKit/LayoutTests/http/tests/devtools/runtime/runtime-callFunctionOn.js index 28101d35..2c73524e 100644 --- a/third_party/WebKit/LayoutTests/http/tests/devtools/runtime/runtime-callFunctionOn.js +++ b/third_party/WebKit/LayoutTests/http/tests/devtools/runtime/runtime-callFunctionOn.js
@@ -17,7 +17,7 @@ } var result = await TestRunner.RuntimeAgent.callFunctionOn(sum.toString(), obj1.objectId); - TestRunner.addResult(result); + TestRunner.addResult(result.value); next(); }, @@ -31,7 +31,7 @@ var result = await TestRunner.RuntimeAgent.callFunctionOn(format.toString(), obj1.objectId, [obj1, obj2, {value: 4}, {}]); - TestRunner.addResult(result); + TestRunner.addResult(result.value); next(); } ]);
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-breakpoints/breakpoint-manager-expected.txt b/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-breakpoints/breakpoint-manager-expected.txt deleted file mode 100644 index 974cd54..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-breakpoints/breakpoint-manager-expected.txt +++ /dev/null
@@ -1,45 +0,0 @@ -Tests BreakpointManager class. - - -Running: testBreakpointInCollectedReload - Created breakpoints manager - Dumping Storage - - Adding file without script: - Adding UISourceCode: a.js - - Setting breakpoint: - Setting breakpoint at a.js:10:0 enabled:true condition: - breakpointAdded(a.js, 10, 0, , true) - debuggerModel.setBreakpoint(a.js:10:) - Dumping Breakpoint Locations - UISourceCode (url='a.js', uri='a.js') - Location: (10, 0) - - Reloading: - Resetting debugger. - Resetting workspace. - breakpointRemoved(a.js, 10, 0) - - Adding file with script: - Adding script: a.js - Adding UISourceCode: a.js - breakpointAdded(a.js, 10, 0, , true) - - Emulating breakpoint resolved event: - breakpointRemoved(a.js, 10, 0) - breakpointAdded(a.js, 10, 0, , true) - Location created: a.js:10 - - Make sure we don't do any unnecessary breakpoint actions: - Dumping Breakpoint Locations - UISourceCode (url='a.js', uri='a.js') - Location: (10, 0) - Dumping Storage - a.js:10 enabled:true condition: - Resetting breakpoint manager - breakpointRemoved(a.js, 10, 0) - Location disposed: a.js:10 - debuggerModel.removeBreakpoint(a.js:10) - Dumping Breakpoint Locations -
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-breakpoints/breakpoint-manager.js b/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-breakpoints/breakpoint-manager.js deleted file mode 100644 index 748428e3..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-breakpoints/breakpoint-manager.js +++ /dev/null
@@ -1,74 +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. - -(async function() { - TestRunner.addResult(`Tests BreakpointManager class.\n`); - await TestRunner.loadModule('sources_test_runner'); - await TestRunner.showPanel('sources'); - - var mockTarget; - var lastTargetId = 0; - - function resetWorkspace(breakpointManager) { - mockTarget.debuggerModel.reset(); - TestRunner.addResult(' Resetting workspace.'); - breakpointManager._debuggerWorkspaceBinding._reset(mockTarget.debuggerModel); - SourcesTestRunner.testNetworkProject._resetForTest(); - SourcesTestRunner.testResourceMappingModelInfo._resetForTest(); - } - - function createBreakpoint(url, lineNumber, condition, enabled) { - return {url: url, lineNumber: lineNumber, condition: condition, enabled: enabled}; - } - - var serializedBreakpoints = []; - serializedBreakpoints.push(createBreakpoint('a.js', 10, 'foo == bar', true)); - serializedBreakpoints.push(createBreakpoint('a.js', 20, '', false)); - serializedBreakpoints.push(createBreakpoint('b.js', 3, '', true)); - - SourcesTestRunner.setupLiveLocationSniffers(); - - function addUISourceCode() { - var args = [mockTarget].concat(Array.prototype.slice.call(arguments)); - return SourcesTestRunner.addUISourceCode.apply(null, args); - } - - function createBreakpointManager(serializedBreakpoints) { - SourcesTestRunner.createWorkspace(); - mockTarget = SourcesTestRunner.createMockTarget(++lastTargetId); - return SourcesTestRunner.createBreakpointManager( - SourcesTestRunner.testTargetManager, SourcesTestRunner.testDebuggerWorkspaceBinding, serializedBreakpoints); - } - - TestRunner.runTestSuite([ - function testBreakpointInCollectedReload(next) { - var breakpointManager = createBreakpointManager(); - TestRunner.addResult('\n Adding file without script:'); - var uiSourceCode = addUISourceCode(breakpointManager, 'a.js', true, true); - - TestRunner.addResult('\n Setting breakpoint:'); - SourcesTestRunner.BreakpointManager.setBreakpoint(breakpointManager, uiSourceCode, 10, 0, '', true, step2); - - function step2() { - SourcesTestRunner.dumpBreakpointLocations(breakpointManager); - TestRunner.addResult('\n Reloading:'); - resetWorkspace(breakpointManager); - - TestRunner.addResult('\n Adding file with script:'); - var uiSourceCode = addUISourceCode(breakpointManager, 'a.js'); - - TestRunner.addResult('\n Emulating breakpoint resolved event:'); - mockTarget.debuggerModel._breakpointResolved( - 'a.js:10', new SDK.DebuggerModel.Location(mockTarget.debuggerModel, 'a.js', 10, 0)); - - TestRunner.addResult('\n Make sure we don\'t do any unnecessary breakpoint actions:'); - SourcesTestRunner.runAfterPendingBreakpointUpdates(breakpointManager, breakpointActionsPerformed.bind(this)); - - function breakpointActionsPerformed() { - SourcesTestRunner.finishBreakpointTest(breakpointManager, next); - } - } - }, - ]); -})();
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-breakpoints/breakpoints-ui-restored-breakpoint.js b/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-breakpoints/breakpoints-ui-restored-breakpoint.js index adbe184..e03f53d 100644 --- a/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-breakpoints/breakpoints-ui-restored-breakpoint.js +++ b/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-breakpoints/breakpoints-ui-restored-breakpoint.js
@@ -18,7 +18,7 @@ SourcesTestRunner.dumpJavaScriptSourceFrameBreakpoints(originalSourceFrame); TestRunner.addResult('Reload page and add script again and dump breakpoints'); - await new Promise(resolve => TestRunner.reloadPage(resolve)); + await TestRunner.reloadPagePromise(); await TestRunner.addScriptTag(TestRunner.url('resources/a.js')); let sourceFrameAfterReload = await SourcesTestRunner.showScriptSourcePromise('a.js'); await SourcesTestRunner.waitJavaScriptSourceFrameBreakpoints(sourceFrameAfterReload); @@ -37,7 +37,7 @@ } TestRunner.addResult('Reload page and add script again and dump breakpoints'); - await new Promise(resolve => TestRunner.reloadPage(resolve)); + await TestRunner.reloadPagePromise(); await TestRunner.addScriptTag(TestRunner.url('resources/a.js')); sourceFrameAfterReload = await SourcesTestRunner.showScriptSourcePromise('a.js'); SourcesTestRunner.dumpJavaScriptSourceFrameBreakpoints(sourceFrameAfterReload);
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-pause/debugger-pause-in-internal-expected.txt b/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-pause/debugger-pause-in-internal-expected.txt index 36985c9..e6617047 100644 --- a/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-pause/debugger-pause-in-internal-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-pause/debugger-pause-in-internal-expected.txt
@@ -3,7 +3,7 @@ Script source was shown. Script execution paused. Call stack: - 0) throwException (debugger-pause-in-internal.js:12) - 1) handleClick (debugger-pause-in-internal.js:17) + 0) throwException (debugger-pause-in-internal.js:13) + 1) handleClick (debugger-pause-in-internal.js:18) Script execution resumed.
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-pause/pause-in-inline-script-expected.txt b/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-pause/pause-in-inline-script-expected.txt index 1239ff10..c4423d4 100644 --- a/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-pause/pause-in-inline-script-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-pause/pause-in-inline-script-expected.txt
@@ -12,5 +12,6 @@ Frame 3) line 15, content: f3(); (must be part of function '') Script execution resumed. didResume +Page reloaded. didReload
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-ui/function-generator-details-expected.txt b/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-ui/function-generator-details-expected.txt index 37594e0..fdb789a0 100644 --- a/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-ui/function-generator-details-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-ui/function-generator-details-expected.txt
@@ -11,7 +11,7 @@ yield 3; } [[GeneratorReceiver]] = Window -lineNumber = 16 +lineNumber = 17 columnNumber = 19 script is valid: yes [[Scopes]] = Scopes[2] @@ -26,7 +26,7 @@ yield 3; } [[GeneratorReceiver]] = Window -lineNumber = 18 +lineNumber = 19 columnNumber = 10 script is valid: yes [[Scopes]] = Scopes[2] @@ -41,21 +41,21 @@ yield 3; } [[GeneratorReceiver]] = Window -lineNumber = 16 +lineNumber = 17 columnNumber = 19 script is valid: yes Running: testIterObjGenerator iterObjGenerator: type = object, subtype = generator [[GeneratorStatus]] = suspended -[[GeneratorFunction]] = function* () +[[GeneratorFunction]] = function*() { yield 11; yield 12; yield 13; } [[GeneratorReceiver]] = Object -lineNumber = 27 +lineNumber = 28 columnNumber = 14 script is valid: yes [[Scopes]] = Scopes[2] @@ -63,13 +63,13 @@ Running: testAnonymousGenIter anonymousGenIter: type = object, subtype = generator [[GeneratorStatus]] = suspended -[[GeneratorFunction]] = function* () { +[[GeneratorFunction]] = function*() { yield 21; yield 22; yield 23; } [[GeneratorReceiver]] = Window -lineNumber = 41 +lineNumber = 42 columnNumber = 10 script is valid: yes [[Scopes]] = Scopes[2]
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-ui/function-generator-details.js b/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-ui/function-generator-details.js index 3cc342e..2239765 100644 --- a/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-ui/function-generator-details.js +++ b/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-ui/function-generator-details.js
@@ -46,13 +46,15 @@ `); function performStandardTestCase(pageExpression, next) { - TestRunner.evaluateInPage(pageExpression, didEvaluate); + UI.context.flavor(SDK.ExecutionContext) + .evaluate({expression: pageExpression}) + .then(didEvaluate); - function didEvaluate(remote) { + function didEvaluate({object}) { TestRunner.addResult( - pageExpression + ': type = ' + remote.type + - ', subtype = ' + remote.subtype); - remote.getOwnPropertiesPromise().then(dumpInternalProperties); + pageExpression + ': type = ' + object.type + + ', subtype = ' + object.subtype); + object.getOwnPropertiesPromise().then(dumpInternalProperties); } function dumpInternalProperties(properties) {
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-ui/watch-expressions-preserve-expansion-expected.txt b/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-ui/watch-expressions-preserve-expansion-expected.txt index aaae3c8..8fe7ba7 100644 --- a/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-ui/watch-expressions-preserve-expansion-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-ui/watch-expressions-preserve-expansion-expected.txt
@@ -121,7 +121,7 @@ 299: 299 length: 300 __proto__: Array(0) -func: function () {return a + b;} +func: function() {return a + b;} arguments: null caller: null length: 0 @@ -248,7 +248,7 @@ 299: 299 length: 300 __proto__: Array(0) -func: function () {return a + b;} +func: function() {return a + b;} arguments: null caller: null length: 0
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger/properties-special-expected.txt b/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger/properties-special-expected.txt index ddf3185e..8aaa146 100644 --- a/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger/properties-special-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger/properties-special-expected.txt
@@ -1,22 +1,17 @@ -CONSOLE MESSAGE: line 16: true -CONSOLE MESSAGE: line 17: function (a,b) { return a + b; } -CONSOLE MESSAGE: line 18: function () { [native code] } -CONSOLE MESSAGE: line 19: function* () { yield [1,2,3] } Tests how debugger presents special properties of closures, bound functions and object wrappers. - -properties-special.html:16 Boolean +properties-special.js:11 Boolean __proto__: Boolean [[PrimitiveValue]]: true -properties-special.html:17 ƒ anonymous(a,b) +properties-special.js:12 ƒ anonymous(a,b) arguments: null caller: null length: 2 name: "" prototype: {constructor: ƒ} __proto__: ƒ () - [[FunctionLocation]]: properties-special.html:17 + [[FunctionLocation]]: properties-special.js:12 [[Scopes]]: Scopes[1] -properties-special.html:18 ƒ bound () +properties-special.js:13 ƒ bound () arguments: (...) caller: (...) length: 1 @@ -25,14 +20,14 @@ [[TargetFunction]]: ƒ (a,b) [[BoundThis]]: Object [[BoundArgs]]: Array(1) -properties-special.html:19 ƒ* anonymous() +properties-special.js:14 ƒ* anonymous() arguments: (...) caller: (...) length: 0 name: "" prototype: Generator {} __proto__: GeneratorFunction - [[FunctionLocation]]: properties-special.html:19 + [[FunctionLocation]]: properties-special.js:14 [[IsGenerator]]: true [[Scopes]]: Scopes[1]
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/debugger/domdebugger-getEventListeners-expected.txt b/third_party/WebKit/LayoutTests/inspector-protocol/debugger/domdebugger-getEventListeners-expected.txt index bfed1ce4..704201a2 100644 --- a/third_party/WebKit/LayoutTests/inspector-protocol/debugger/domdebugger-getEventListeners-expected.txt +++ b/third_party/WebKit/LayoutTests/inspector-protocol/debugger/domdebugger-getEventListeners-expected.txt
@@ -53,10 +53,10 @@ type:load useCapture:false lineNumber:0 - columnNumber:38 + columnNumber:46 handler.type:function handler.className:Function - handler.description:function onload(event) { return 42;} + handler.description:function onload(event) {return 42;} Event listeners of div#listeners2
diff --git a/third_party/WebKit/Source/build/scripts/core/css/properties/templates/CSSProperty.h.tmpl b/third_party/WebKit/Source/build/scripts/core/css/properties/templates/CSSProperty.h.tmpl index 772021e..699a7b3 100644 --- a/third_party/WebKit/Source/build/scripts/core/css/properties/templates/CSSProperty.h.tmpl +++ b/third_party/WebKit/Source/build/scripts/core/css/properties/templates/CSSProperty.h.tmpl
@@ -93,6 +93,8 @@ const LayoutObject*, Node*, bool allow_visited_style) const { return nullptr; } + // FIXME: Resolve computed auto alignment in applyProperty/ComputedStyle and + // remove this non-const Node parameter. const CSSValue* CSSValueFromComputedStyle(const ComputedStyle&, const LayoutObject*, Node*,
diff --git a/third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.cpp b/third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.cpp index 9529fe9..54e48645 100644 --- a/third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.cpp +++ b/third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.cpp
@@ -357,8 +357,8 @@ if (!style) return nullptr; - const CSSValue* value = ComputedStyleCSSValueMapping::Get( - property_class, *style, layout_object, styled_node, allow_visited_style_); + const CSSValue* value = property_class.CSSValueFromComputedStyle( + *style, layout_object, styled_node, allow_visited_style_); if (value) return value;
diff --git a/third_party/WebKit/Source/core/css/CSSImageGeneratorValue.cpp b/third_party/WebKit/Source/core/css/CSSImageGeneratorValue.cpp index 7a5c8baf..7765fd61 100644 --- a/third_party/WebKit/Source/core/css/CSSImageGeneratorValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSImageGeneratorValue.cpp
@@ -37,6 +37,30 @@ using cssvalue::ToCSSLinearGradientValue; using cssvalue::ToCSSRadialGradientValue; +Image* GeneratedImageCache::GetImage(const LayoutSize& size) const { + if (size.IsEmpty()) + return nullptr; + return images_.at(size); +} + +void GeneratedImageCache::PutImage(const LayoutSize& size, + scoped_refptr<Image> image) { + images_.insert(size, std::move(image)); +} + +void GeneratedImageCache::AddSize(const LayoutSize& size) { + if (size.IsEmpty()) + return; + sizes_.insert(size); +} + +void GeneratedImageCache::RemoveSize(const LayoutSize& size) { + if (size.IsEmpty()) + return; + if (sizes_.erase(size)) + images_.erase(size); +} + CSSImageGeneratorValue::CSSImageGeneratorValue(ClassType class_type) : CSSValue(class_type) {} @@ -50,8 +74,7 @@ keep_alive_ = this; } - if (!size.IsEmpty()) - sizes_.insert(size); + cached_images_.AddSize(size); ClientSizeCountMap::iterator it = clients_.find(client); if (it == clients_.end()) { @@ -73,14 +96,8 @@ ClientSizeCountMap::iterator it = clients_.find(client); SECURITY_DCHECK(it != clients_.end()); - LayoutSize removed_image_size; SizeAndCount& size_count = it->value; - LayoutSize size = size_count.size; - if (!size.IsEmpty()) { - sizes_.erase(size); - if (!sizes_.Contains(size)) - images_.erase(size); - } + cached_images_.RemoveSize(size_count.size); if (!--size_count.count) clients_.erase(client); @@ -95,25 +112,23 @@ const LayoutSize& size) { ClientSizeCountMap::iterator it = clients_.find(client); if (it != clients_.end()) { + DCHECK(keep_alive_); SizeAndCount& size_count = it->value; - LayoutSize old_size = size_count.size; - if (old_size != size) { - RemoveClient(client); - AddClient(client, size); + if (size_count.size != size) { + cached_images_.RemoveSize(size_count.size); + cached_images_.AddSize(size); + + // If there's only one use for this client, then update the size. + if (size_count.count == 1) + size_count.size = size; } } - - // Don't generate an image for empty sizes. - if (size.IsEmpty()) - return nullptr; - - // Look up the image in our cache. - return images_.at(size); + return cached_images_.GetImage(size); } void CSSImageGeneratorValue::PutImage(const LayoutSize& size, scoped_refptr<Image> image) { - images_.insert(size, std::move(image)); + cached_images_.PutImage(size, std::move(image)); } scoped_refptr<Image> CSSImageGeneratorValue::GetImage(
diff --git a/third_party/WebKit/Source/core/css/CSSImageGeneratorValue.h b/third_party/WebKit/Source/core/css/CSSImageGeneratorValue.h index d99403c..d82da84 100644 --- a/third_party/WebKit/Source/core/css/CSSImageGeneratorValue.h +++ b/third_party/WebKit/Source/core/css/CSSImageGeneratorValue.h
@@ -41,6 +41,22 @@ class ComputedStyle; class ImageResourceObserver; +class GeneratedImageCache { + public: + void AddSize(const LayoutSize&); + void RemoveSize(const LayoutSize&); + + Image* GetImage(const LayoutSize&) const; + void PutImage(const LayoutSize&, scoped_refptr<Image>); + + private: + // A count of how many times a given image size is in use. + HashCountedSet<LayoutSize> sizes_; + + // A cache of Image objects by image size. + HashMap<LayoutSize, scoped_refptr<Image>> images_; +}; + struct SizeAndCount { DISALLOW_NEW(); SizeAndCount(LayoutSize new_size = LayoutSize(), int new_count = 0) @@ -85,12 +101,11 @@ void PutImage(const LayoutSize&, scoped_refptr<Image>); const ClientSizeCountMap& Clients() const { return clients_; } - HashCountedSet<LayoutSize> - sizes_; // A count of how many times a given image size is in use. - ClientSizeCountMap - clients_; // A map from LayoutObjects (with entry count) to image sizes. - HashMap<LayoutSize, scoped_refptr<Image>> - images_; // A cache of Image objects by image size. + // A map from LayoutObjects (with entry count) to image sizes. + ClientSizeCountMap clients_; + + // Cached image instances. + GeneratedImageCache cached_images_; // TODO(Oilpan): when/if we can make the layoutObject point directly to the // CSSImageGenerator value using a member we don't need to have this hack
diff --git a/third_party/WebKit/Source/core/css/CSSProperties.json5 b/third_party/WebKit/Source/core/css/CSSProperties.json5 index 70c05620..e1277c9d4e 100644 --- a/third_party/WebKit/Source/core/css/CSSProperties.json5 +++ b/third_party/WebKit/Source/core/css/CSSProperties.json5
@@ -3833,14 +3833,14 @@ "border-image-source", "border-image-slice", "border-image-width", "border-image-outset", "border-image-repeat" ], - property_methods: ["ParseShorthand"], + property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"], }, { name: "border-bottom", longhands: [ "border-bottom-width", "border-bottom-style", "border-bottom-color" ], - property_methods: ["ParseShorthand"], + property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"], }, { name: "border-color", @@ -3848,7 +3848,7 @@ "border-top-color", "border-right-color", "border-bottom-color", "border-left-color" ], - property_methods: ["ParseShorthand"], + property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"], }, { name: "border-image", @@ -3863,7 +3863,7 @@ longhands: [ "border-left-width", "border-left-style", "border-left-color" ], - property_methods: ["ParseShorthand"], + property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"], }, { name: "border-radius", @@ -3878,7 +3878,7 @@ longhands: [ "border-right-width", "border-right-style", "border-right-color" ], - property_methods: ["ParseShorthand"], + property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"], }, { name: "border-spacing", @@ -3893,14 +3893,14 @@ "border-top-style", "border-right-style", "border-bottom-style", "border-left-style" ], - property_methods: ["ParseShorthand"], + property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"], keywords: ["none"], typedom_types: ["Image"], }, { name: "border-top", longhands: ["border-top-width", "border-top-style", "border-top-color"], - property_methods: ["ParseShorthand"], + property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"], }, { name: "border-width", @@ -3908,17 +3908,17 @@ "border-top-width", "border-right-width", "border-bottom-width", "border-left-width" ], - property_methods: ["ParseShorthand"], + property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"], }, { name: "flex", longhands: ["flex-grow", "flex-shrink", "flex-basis"], - property_methods: ["ParseShorthand"], + property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"], }, { name: "flex-flow", longhands: ["flex-direction", "flex-wrap"], - property_methods: ["ParseShorthand"], + property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"], }, { name: "font", @@ -3935,7 +3935,7 @@ "font-variant-ligatures", "font-variant-caps", "font-variant-numeric", "font-variant-east-asian" ], - property_methods: ["ParseShorthand"], + property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"], is_descriptor: true, }, { @@ -3944,22 +3944,22 @@ "grid-template-rows", "grid-template-columns", "grid-template-areas", "grid-auto-flow", "grid-auto-rows", "grid-auto-columns" ], - property_methods: ["ParseShorthand", "IsLayoutDependent"], + property_methods: ["ParseShorthand", "IsLayoutDependent", "CSSValueFromComputedStyleInternal"], }, { name: "place-content", longhands: ["align-content", "justify-content"], - property_methods: ["ParseShorthand"], + property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"], }, { name: "place-items", longhands: ["align-items", "justify-items"], - property_methods: ["ParseShorthand"], + property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"], }, { name: "place-self", longhands: ["align-self", "justify-self"], - property_methods: ["ParseShorthand"], + property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"], }, { name: "grid-area", @@ -3967,39 +3967,39 @@ "grid-row-start", "grid-column-start", "grid-row-end", "grid-column-end" ], - property_methods: ["ParseShorthand"], + property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"], }, { name: "grid-column", longhands: ["grid-column-start", "grid-column-end"], - property_methods: ["ParseShorthand"], + property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"], }, { name: "grid-gap", longhands: ["grid-row-gap", "grid-column-gap"], - property_methods: ["ParseShorthand"], + property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"], }, { name: "grid-row", longhands: ["grid-row-start", "grid-row-end"], - property_methods: ["ParseShorthand"], + property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"], }, { name: "grid-template", longhands: [ "grid-template-rows", "grid-template-columns", "grid-template-areas" ], - property_methods: ["ParseShorthand", "IsLayoutDependent"], + property_methods: ["ParseShorthand", "IsLayoutDependent", "CSSValueFromComputedStyleInternal"], }, { name: "list-style", longhands: ["list-style-type", "list-style-position", "list-style-image"], - property_methods: ["ParseShorthand"], + property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"], }, { name: "margin", longhands: ["margin-top", "margin-right", "margin-bottom", "margin-left"], - property_methods: ["ParseShorthand", "IsLayoutDependent"], + property_methods: ["ParseShorthand", "IsLayoutDependent", "CSSValueFromComputedStyleInternal"], }, { name: "marker", @@ -4017,7 +4017,7 @@ { name: "outline", longhands: ["outline-color", "outline-style", "outline-width"], - property_methods: ["ParseShorthand"], + property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"], }, { name: "overflow", @@ -4035,7 +4035,7 @@ longhands: [ "padding-top", "padding-right", "padding-bottom", "padding-left" ], - property_methods: ["ParseShorthand", "IsLayoutDependent"], + property_methods: ["ParseShorthand", "IsLayoutDependent", "CSSValueFromComputedStyleInternal"], }, { name: "page-break-after", @@ -4055,19 +4055,19 @@ { name: "scroll-margin", longhands: ["scroll-margin-top", "scroll-margin-right", "scroll-margin-bottom", "scroll-margin-left"], - property_methods: ["ParseShorthand"], + property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"], runtime_flag: "CSSScrollSnapPoints", }, { name: "scroll-margin-block", longhands: ["scroll-margin-block-start", "scroll-margin-block-end"], - property_methods: ["ParseShorthand"], + property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"], runtime_flag: "CSSScrollSnapPoints", }, { name: "scroll-margin-inline", longhands: ["scroll-margin-inline-start", "scroll-margin-inline-end"], - property_methods: ["ParseShorthand"], + property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"], runtime_flag: "CSSScrollSnapPoints", }, { @@ -4076,25 +4076,25 @@ "scroll-padding-top", "scroll-padding-right", "scroll-padding-bottom", "scroll-padding-left" ], - property_methods: ["ParseShorthand"], + property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"], runtime_flag: "CSSScrollSnapPoints", }, { name: "scroll-padding-block", longhands: ["scroll-padding-block-start", "scroll-padding-block-end"], - property_methods: ["ParseShorthand"], + property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"], runtime_flag: "CSSScrollSnapPoints", }, { name: "scroll-padding-inline", longhands: ["scroll-padding-inline-start", "scroll-padding-inline-end"], - property_methods: ["ParseShorthand"], + property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"], runtime_flag: "CSSScrollSnapPoints", }, { name: "text-decoration", longhands: ["text-decoration-line", "text-decoration-style", "text-decoration-color"], - property_methods: ["ParseShorthand"], + property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"], }, { name: "transition", @@ -4172,12 +4172,12 @@ longhands: [ "column-rule-width", "column-rule-style", "column-rule-color" ], - property_methods: ["ParseShorthand"], + property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"], }, { name: "columns", longhands: ["column-width", "column-count"], - property_methods: ["ParseShorthand"], + property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"], }, { name: "-webkit-margin-collapse",
diff --git a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp index 4db7738c..9568ff39 100644 --- a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp +++ b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
@@ -25,216 +25,13 @@ #include "core/css/ComputedStyleCSSValueMapping.h" -#include "base/macros.h" -#include "core/StylePropertyShorthand.h" -#include "core/animation/css/CSSAnimationData.h" -#include "core/animation/css/CSSTransitionData.h" -#include "core/css/BasicShapeFunctions.h" -#include "core/css/CSSBasicShapeValues.h" -#include "core/css/CSSColorValue.h" -#include "core/css/CSSCounterValue.h" -#include "core/css/CSSCursorImageValue.h" -#include "core/css/CSSCustomIdentValue.h" #include "core/css/CSSCustomPropertyDeclaration.h" -#include "core/css/CSSFontFamilyValue.h" -#include "core/css/CSSFontFeatureValue.h" -#include "core/css/CSSFontStyleRangeValue.h" -#include "core/css/CSSFontVariationValue.h" -#include "core/css/CSSFunctionValue.h" -#include "core/css/CSSGridLineNamesValue.h" -#include "core/css/CSSGridTemplateAreasValue.h" -#include "core/css/CSSIdentifierValue.h" -#include "core/css/CSSInitialValue.h" -#include "core/css/CSSPathValue.h" -#include "core/css/CSSPrimitiveValue.h" -#include "core/css/CSSPrimitiveValueMappings.h" -#include "core/css/CSSQuadValue.h" -#include "core/css/CSSShadowValue.h" -#include "core/css/CSSStringValue.h" -#include "core/css/CSSTimingFunctionValue.h" -#include "core/css/CSSURIValue.h" -#include "core/css/CSSValueList.h" -#include "core/css/CSSValuePair.h" +#include "core/css/CSSValue.h" #include "core/css/PropertyRegistry.h" -#include "core/css/ZoomAdjustedPixelValue.h" -#include "core/css/properties/ComputedStyleUtils.h" -#include "core/layout/LayoutBlock.h" -#include "core/layout/LayoutBox.h" -#include "core/layout/LayoutGrid.h" -#include "core/layout/LayoutObject.h" #include "core/style/ComputedStyle.h" -#include "core/style/ContentData.h" -#include "core/style/CursorData.h" -#include "core/style/QuotesData.h" -#include "core/style/ShadowList.h" -#include "core/style/StyleInheritedVariables.h" -#include "core/style/StyleNonInheritedVariables.h" -#include "platform/LengthFunctions.h" namespace blink { -using namespace cssvalue; - -static CSSValueList* ValuesForGridShorthand( - const StylePropertyShorthand& shorthand, - const ComputedStyle& style, - const LayoutObject* layout_object, - Node* styled_node, - bool allow_visited_style) { - CSSValueList* list = CSSValueList::CreateSlashSeparated(); - for (size_t i = 0; i < shorthand.length(); ++i) { - const CSSValue* value = ComputedStyleCSSValueMapping::Get( - *shorthand.properties()[i], style, layout_object, styled_node, - allow_visited_style); - DCHECK(value); - list->Append(*value); - } - return list; -} - -static CSSValueList* ValuesForShorthandProperty( - const StylePropertyShorthand& shorthand, - const ComputedStyle& style, - const LayoutObject* layout_object, - Node* styled_node, - bool allow_visited_style) { - CSSValueList* list = CSSValueList::CreateSpaceSeparated(); - for (size_t i = 0; i < shorthand.length(); ++i) { - const CSSValue* value = ComputedStyleCSSValueMapping::Get( - *shorthand.properties()[i], style, layout_object, styled_node, - allow_visited_style); - DCHECK(value); - list->Append(*value); - } - return list; -} - -static CSSValue* ExpandNoneLigaturesValue() { - CSSValueList* list = CSSValueList::CreateSpaceSeparated(); - list->Append(*CSSIdentifierValue::Create(CSSValueNoCommonLigatures)); - list->Append(*CSSIdentifierValue::Create(CSSValueNoDiscretionaryLigatures)); - list->Append(*CSSIdentifierValue::Create(CSSValueNoHistoricalLigatures)); - list->Append(*CSSIdentifierValue::Create(CSSValueNoContextual)); - return list; -} - -static CSSValue* ValuesForFontVariantProperty(const ComputedStyle& style, - const LayoutObject* layout_object, - Node* styled_node, - bool allow_visited_style) { - enum VariantShorthandCases { - kAllNormal, - kNoneLigatures, - kConcatenateNonNormal - }; - StylePropertyShorthand shorthand = fontVariantShorthand(); - VariantShorthandCases shorthand_case = kAllNormal; - for (size_t i = 0; i < shorthand.length(); ++i) { - const CSSValue* value = ComputedStyleCSSValueMapping::Get( - *shorthand.properties()[i], style, layout_object, styled_node, - allow_visited_style); - - if (shorthand_case == kAllNormal && value->IsIdentifierValue() && - ToCSSIdentifierValue(value)->GetValueID() == CSSValueNone && - shorthand.properties()[i]->IDEquals(CSSPropertyFontVariantLigatures)) { - shorthand_case = kNoneLigatures; - } else if (!(value->IsIdentifierValue() && - ToCSSIdentifierValue(value)->GetValueID() == CSSValueNormal)) { - shorthand_case = kConcatenateNonNormal; - break; - } - } - - switch (shorthand_case) { - case kAllNormal: - return CSSIdentifierValue::Create(CSSValueNormal); - case kNoneLigatures: - return CSSIdentifierValue::Create(CSSValueNone); - case kConcatenateNonNormal: { - CSSValueList* list = CSSValueList::CreateSpaceSeparated(); - for (size_t i = 0; i < shorthand.length(); ++i) { - const CSSValue* value = ComputedStyleCSSValueMapping::Get( - *shorthand.properties()[i], style, layout_object, styled_node, - allow_visited_style); - DCHECK(value); - if (value->IsIdentifierValue() && - ToCSSIdentifierValue(value)->GetValueID() == CSSValueNone) { - list->Append(*ExpandNoneLigaturesValue()); - } else if (!(value->IsIdentifierValue() && - ToCSSIdentifierValue(value)->GetValueID() == - CSSValueNormal)) { - list->Append(*value); - } - } - return list; - } - default: - NOTREACHED(); - return nullptr; - } -} - -static CSSValueList* ValuesForSidesShorthand( - const StylePropertyShorthand& shorthand, - const ComputedStyle& style, - const LayoutObject* layout_object, - Node* styled_node, - bool allow_visited_style) { - CSSValueList* list = CSSValueList::CreateSpaceSeparated(); - // Assume the properties are in the usual order top, right, bottom, left. - const CSSValue* top_value = ComputedStyleCSSValueMapping::Get( - *shorthand.properties()[0], style, layout_object, styled_node, - allow_visited_style); - const CSSValue* right_value = ComputedStyleCSSValueMapping::Get( - *shorthand.properties()[1], style, layout_object, styled_node, - allow_visited_style); - const CSSValue* bottom_value = ComputedStyleCSSValueMapping::Get( - *shorthand.properties()[2], style, layout_object, styled_node, - allow_visited_style); - const CSSValue* left_value = ComputedStyleCSSValueMapping::Get( - *shorthand.properties()[3], style, layout_object, styled_node, - allow_visited_style); - - // All 4 properties must be specified. - if (!top_value || !right_value || !bottom_value || !left_value) - return nullptr; - - bool show_left = !DataEquivalent(right_value, left_value); - bool show_bottom = !DataEquivalent(top_value, bottom_value) || show_left; - bool show_right = !DataEquivalent(top_value, right_value) || show_bottom; - - list->Append(*top_value); - if (show_right) - list->Append(*right_value); - if (show_bottom) - list->Append(*bottom_value); - if (show_left) - list->Append(*left_value); - - return list; -} - -static CSSValuePair* ValuesForInlineBlockShorthand( - const StylePropertyShorthand& shorthand, - const ComputedStyle& style, - const LayoutObject* layout_object, - Node* styled_node, - bool allow_visited_style) { - const CSSValue* start_value = ComputedStyleCSSValueMapping::Get( - *shorthand.properties()[0], style, layout_object, styled_node, - allow_visited_style); - const CSSValue* end_value = ComputedStyleCSSValueMapping::Get( - *shorthand.properties()[1], style, layout_object, styled_node, - allow_visited_style); - // Both properties must be specified. - if (!start_value || !end_value) - return nullptr; - - CSSValuePair* pair = CSSValuePair::Create(start_value, end_value, - CSSValuePair::kDropIdenticalValues); - return pair; -} - const CSSValue* ComputedStyleCSSValueMapping::Get( const AtomicString custom_property_name, const ComputedStyle& style, @@ -269,163 +66,4 @@ return nullptr; } -const CSSValue* ComputedStyleCSSValueMapping::Get( - const CSSProperty& property, - const ComputedStyle& style, - const LayoutObject* layout_object, - Node* styled_node, - bool allow_visited_style) { - const CSSProperty& resolved_property = property.ResolveDirectionAwareProperty( - style.Direction(), style.GetWritingMode()); - - switch (resolved_property.PropertyID()) { - case CSSPropertyGridColumn: - return ValuesForGridShorthand(gridColumnShorthand(), style, layout_object, - styled_node, allow_visited_style); - case CSSPropertyGridRow: - return ValuesForGridShorthand(gridRowShorthand(), style, layout_object, - styled_node, allow_visited_style); - case CSSPropertyGridArea: - return ValuesForGridShorthand(gridAreaShorthand(), style, layout_object, - styled_node, allow_visited_style); - case CSSPropertyGridTemplate: - return ValuesForGridShorthand(gridTemplateShorthand(), style, - layout_object, styled_node, - allow_visited_style); - case CSSPropertyGrid: - return ValuesForGridShorthand(gridShorthand(), style, layout_object, - styled_node, allow_visited_style); - case CSSPropertyPlaceContent: { - // TODO (jfernandez): The spec states that we should return the specified - // value. - return ValuesForShorthandProperty(placeContentShorthand(), style, - layout_object, styled_node, - allow_visited_style); - } - case CSSPropertyPlaceItems: { - // TODO (jfernandez): The spec states that we should return the specified - // value. - return ValuesForShorthandProperty(placeItemsShorthand(), style, - layout_object, styled_node, - allow_visited_style); - } - case CSSPropertyPlaceSelf: { - // TODO (jfernandez): The spec states that we should return the specified - // value. - return ValuesForShorthandProperty(placeSelfShorthand(), style, - layout_object, styled_node, - allow_visited_style); - } - case CSSPropertyFlex: - return ValuesForShorthandProperty(flexShorthand(), style, layout_object, - styled_node, allow_visited_style); - case CSSPropertyFlexFlow: - return ValuesForShorthandProperty(flexFlowShorthand(), style, - layout_object, styled_node, - allow_visited_style); - case CSSPropertyGridGap: - return ValuesForShorthandProperty(gridGapShorthand(), style, - layout_object, styled_node, - allow_visited_style); - case CSSPropertyTextDecoration: - return ValuesForShorthandProperty(textDecorationShorthand(), style, - layout_object, styled_node, - allow_visited_style); - case CSSPropertyBorder: { - const CSSValue* value = - Get(GetCSSPropertyBorderTop(), style, layout_object, styled_node, - allow_visited_style); - static const CSSProperty* kProperties[3] = {&GetCSSPropertyBorderRight(), - &GetCSSPropertyBorderBottom(), - &GetCSSPropertyBorderLeft()}; - for (size_t i = 0; i < WTF_ARRAY_LENGTH(kProperties); ++i) { - if (!DataEquivalent(value, Get(*kProperties[i], style, layout_object, - styled_node, allow_visited_style))) - return nullptr; - } - return value; - } - case CSSPropertyBorderBottom: - return ValuesForShorthandProperty(borderBottomShorthand(), style, - layout_object, styled_node, - allow_visited_style); - case CSSPropertyBorderColor: - return ValuesForSidesShorthand(borderColorShorthand(), style, - layout_object, styled_node, - allow_visited_style); - case CSSPropertyBorderLeft: - return ValuesForShorthandProperty(borderLeftShorthand(), style, - layout_object, styled_node, - allow_visited_style); - case CSSPropertyBorderRight: - return ValuesForShorthandProperty(borderRightShorthand(), style, - layout_object, styled_node, - allow_visited_style); - case CSSPropertyBorderStyle: - return ValuesForSidesShorthand(borderStyleShorthand(), style, - layout_object, styled_node, - allow_visited_style); - case CSSPropertyBorderTop: - return ValuesForShorthandProperty(borderTopShorthand(), style, - layout_object, styled_node, - allow_visited_style); - case CSSPropertyBorderWidth: - return ValuesForSidesShorthand(borderWidthShorthand(), style, - layout_object, styled_node, - allow_visited_style); - case CSSPropertyColumnRule: - return ValuesForShorthandProperty(columnRuleShorthand(), style, - layout_object, styled_node, - allow_visited_style); - case CSSPropertyColumns: - return ValuesForShorthandProperty(columnsShorthand(), style, - layout_object, styled_node, - allow_visited_style); - case CSSPropertyListStyle: - return ValuesForShorthandProperty(listStyleShorthand(), style, - layout_object, styled_node, - allow_visited_style); - case CSSPropertyMargin: - return ValuesForSidesShorthand(marginShorthand(), style, layout_object, - styled_node, allow_visited_style); - case CSSPropertyOutline: - return ValuesForShorthandProperty(outlineShorthand(), style, - layout_object, styled_node, - allow_visited_style); - case CSSPropertyFontVariant: - return ValuesForFontVariantProperty(style, layout_object, styled_node, - allow_visited_style); - case CSSPropertyPadding: - return ValuesForSidesShorthand(paddingShorthand(), style, layout_object, - styled_node, allow_visited_style); - case CSSPropertyScrollPadding: - return ValuesForSidesShorthand(scrollPaddingShorthand(), style, - layout_object, styled_node, - allow_visited_style); - case CSSPropertyScrollPaddingBlock: - return ValuesForInlineBlockShorthand(scrollPaddingBlockShorthand(), style, - layout_object, styled_node, - allow_visited_style); - case CSSPropertyScrollPaddingInline: - return ValuesForInlineBlockShorthand(scrollPaddingInlineShorthand(), - style, layout_object, styled_node, - allow_visited_style); - case CSSPropertyScrollMargin: - return ValuesForSidesShorthand(scrollMarginShorthand(), style, - layout_object, styled_node, - allow_visited_style); - case CSSPropertyScrollMarginBlock: - return ValuesForInlineBlockShorthand(scrollMarginBlockShorthand(), style, - layout_object, styled_node, - allow_visited_style); - case CSSPropertyScrollMarginInline: - return ValuesForInlineBlockShorthand(scrollMarginInlineShorthand(), style, - layout_object, styled_node, - allow_visited_style); - default: - return resolved_property.CSSValueFromComputedStyle( - style, layout_object, styled_node, allow_visited_style); - } -} - } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.h b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.h index 26b7451..ff88e6e 100644 --- a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.h +++ b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.h
@@ -5,32 +5,19 @@ #ifndef ComputedStyleCSSValueMapping_h #define ComputedStyleCSSValueMapping_h -#include "core/CSSPropertyNames.h" #include "core/css/CSSValue.h" -#include "core/css/properties/CSSProperty.h" -#include "platform/wtf/Allocator.h" -#include "platform/wtf/HashMap.h" #include "platform/wtf/text/AtomicString.h" namespace blink { class CSSVariableData; class ComputedStyle; -class LayoutObject; -class Node; class PropertyRegistry; class ComputedStyleCSSValueMapping { STATIC_ONLY(ComputedStyleCSSValueMapping); public: - // FIXME: Resolve computed auto alignment in applyProperty/ComputedStyle and - // remove this non-const styledNode parameter. - static const CSSValue* Get(const CSSProperty&, - const ComputedStyle&, - const LayoutObject* = nullptr, - Node* styled_node = nullptr, - bool allow_visited_style = false); static const CSSValue* Get(const AtomicString custom_property_name, const ComputedStyle&, const PropertyRegistry*);
diff --git a/third_party/WebKit/Source/core/css/cssom/ComputedStylePropertyMap.cpp b/third_party/WebKit/Source/core/css/cssom/ComputedStylePropertyMap.cpp index 967e918..58c46630 100644 --- a/third_party/WebKit/Source/core/css/cssom/ComputedStylePropertyMap.cpp +++ b/third_party/WebKit/Source/core/css/cssom/ComputedStylePropertyMap.cpp
@@ -53,9 +53,9 @@ const ComputedStyle* style = UpdateStyle(); if (!style) return nullptr; - return ComputedStyleCSSValueMapping::Get(CSSProperty::Get(property_id), - *style, nullptr /* layout_object */, - StyledNode()); + return CSSProperty::Get(property_id) + .CSSValueFromComputedStyle(*style, nullptr /* layout_object */, + StyledNode(), false); } const CSSValue* ComputedStylePropertyMap::GetCustomProperty( @@ -77,8 +77,8 @@ CSSComputedStyleDeclaration::ComputableProperties()) { DCHECK(property); DCHECK(!property->IDEquals(CSSPropertyVariable)); - const CSSValue* value = ComputedStyleCSSValueMapping::Get( - *property, *style, nullptr /* layout_object */, StyledNode()); + const CSSValue* value = property->CSSValueFromComputedStyle( + *style, nullptr /* layout_object */, StyledNode(), false); if (value) callback(property->GetPropertyName(), *value); }
diff --git a/third_party/WebKit/Source/core/css/properties/ComputedStyleUtils.cpp b/third_party/WebKit/Source/core/css/properties/ComputedStyleUtils.cpp index 3cb9ffce..bc85a76 100644 --- a/third_party/WebKit/Source/core/css/properties/ComputedStyleUtils.cpp +++ b/third_party/WebKit/Source/core/css/properties/ComputedStyleUtils.cpp
@@ -4,6 +4,7 @@ #include "core/css/properties/ComputedStyleUtils.h" +#include "core/StylePropertyShorthand.h" #include "core/css/BasicShapeFunctions.h" #include "core/css/CSSBorderImage.h" #include "core/css/CSSBorderImageSliceValue.h" @@ -2114,4 +2115,165 @@ return !object->IsSVGChild(); } +CSSValueList* ComputedStyleUtils::ValuesForShorthandProperty( + const StylePropertyShorthand& shorthand, + const ComputedStyle& style, + const LayoutObject* layout_object, + Node* styled_node, + bool allow_visited_style) { + CSSValueList* list = CSSValueList::CreateSpaceSeparated(); + for (size_t i = 0; i < shorthand.length(); ++i) { + const CSSValue* value = + shorthand.properties()[i]->CSSValueFromComputedStyle( + style, layout_object, styled_node, allow_visited_style); + DCHECK(value); + list->Append(*value); + } + return list; +} + +CSSValueList* ComputedStyleUtils::ValuesForGridShorthand( + const StylePropertyShorthand& shorthand, + const ComputedStyle& style, + const LayoutObject* layout_object, + Node* styled_node, + bool allow_visited_style) { + CSSValueList* list = CSSValueList::CreateSlashSeparated(); + for (size_t i = 0; i < shorthand.length(); ++i) { + const CSSValue* value = + shorthand.properties()[i]->CSSValueFromComputedStyle( + style, layout_object, styled_node, allow_visited_style); + DCHECK(value); + list->Append(*value); + } + return list; +} + +CSSValueList* ComputedStyleUtils::ValuesForSidesShorthand( + const StylePropertyShorthand& shorthand, + const ComputedStyle& style, + const LayoutObject* layout_object, + Node* styled_node, + bool allow_visited_style) { + CSSValueList* list = CSSValueList::CreateSpaceSeparated(); + // Assume the properties are in the usual order top, right, bottom, left. + const CSSValue* top_value = + shorthand.properties()[0]->CSSValueFromComputedStyle( + style, layout_object, styled_node, allow_visited_style); + const CSSValue* right_value = + shorthand.properties()[1]->CSSValueFromComputedStyle( + style, layout_object, styled_node, allow_visited_style); + const CSSValue* bottom_value = + shorthand.properties()[2]->CSSValueFromComputedStyle( + style, layout_object, styled_node, allow_visited_style); + const CSSValue* left_value = + shorthand.properties()[3]->CSSValueFromComputedStyle( + style, layout_object, styled_node, allow_visited_style); + + // All 4 properties must be specified. + if (!top_value || !right_value || !bottom_value || !left_value) + return nullptr; + + bool show_left = !DataEquivalent(right_value, left_value); + bool show_bottom = !DataEquivalent(top_value, bottom_value) || show_left; + bool show_right = !DataEquivalent(top_value, right_value) || show_bottom; + + list->Append(*top_value); + if (show_right) + list->Append(*right_value); + if (show_bottom) + list->Append(*bottom_value); + if (show_left) + list->Append(*left_value); + + return list; +} + +CSSValuePair* ComputedStyleUtils::ValuesForInlineBlockShorthand( + const StylePropertyShorthand& shorthand, + const ComputedStyle& style, + const LayoutObject* layout_object, + Node* styled_node, + bool allow_visited_style) { + const CSSValue* start_value = + shorthand.properties()[0]->CSSValueFromComputedStyle( + style, layout_object, styled_node, allow_visited_style); + const CSSValue* end_value = + shorthand.properties()[1]->CSSValueFromComputedStyle( + style, layout_object, styled_node, allow_visited_style); + // Both properties must be specified. + if (!start_value || !end_value) + return nullptr; + + CSSValuePair* pair = CSSValuePair::Create(start_value, end_value, + CSSValuePair::kDropIdenticalValues); + return pair; +} + +static CSSValue* ExpandNoneLigaturesValue() { + CSSValueList* list = CSSValueList::CreateSpaceSeparated(); + list->Append(*CSSIdentifierValue::Create(CSSValueNoCommonLigatures)); + list->Append(*CSSIdentifierValue::Create(CSSValueNoDiscretionaryLigatures)); + list->Append(*CSSIdentifierValue::Create(CSSValueNoHistoricalLigatures)); + list->Append(*CSSIdentifierValue::Create(CSSValueNoContextual)); + return list; +} + +CSSValue* ComputedStyleUtils::ValuesForFontVariantProperty( + const ComputedStyle& style, + const LayoutObject* layout_object, + Node* styled_node, + bool allow_visited_style) { + enum VariantShorthandCases { + kAllNormal, + kNoneLigatures, + kConcatenateNonNormal + }; + StylePropertyShorthand shorthand = fontVariantShorthand(); + VariantShorthandCases shorthand_case = kAllNormal; + for (size_t i = 0; i < shorthand.length(); ++i) { + const CSSValue* value = + shorthand.properties()[i]->CSSValueFromComputedStyle( + style, layout_object, styled_node, allow_visited_style); + + if (shorthand_case == kAllNormal && value->IsIdentifierValue() && + ToCSSIdentifierValue(value)->GetValueID() == CSSValueNone && + shorthand.properties()[i]->IDEquals(CSSPropertyFontVariantLigatures)) { + shorthand_case = kNoneLigatures; + } else if (!(value->IsIdentifierValue() && + ToCSSIdentifierValue(value)->GetValueID() == CSSValueNormal)) { + shorthand_case = kConcatenateNonNormal; + break; + } + } + + switch (shorthand_case) { + case kAllNormal: + return CSSIdentifierValue::Create(CSSValueNormal); + case kNoneLigatures: + return CSSIdentifierValue::Create(CSSValueNone); + case kConcatenateNonNormal: { + CSSValueList* list = CSSValueList::CreateSpaceSeparated(); + for (size_t i = 0; i < shorthand.length(); ++i) { + const CSSValue* value = + shorthand.properties()[i]->CSSValueFromComputedStyle( + style, layout_object, styled_node, allow_visited_style); + DCHECK(value); + if (value->IsIdentifierValue() && + ToCSSIdentifierValue(value)->GetValueID() == CSSValueNone) { + list->Append(*ExpandNoneLigaturesValue()); + } else if (!(value->IsIdentifierValue() && + ToCSSIdentifierValue(value)->GetValueID() == + CSSValueNormal)) { + list->Append(*value); + } + } + return list; + } + default: + NOTREACHED(); + return nullptr; + } +} + } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/ComputedStyleUtils.h b/third_party/WebKit/Source/core/css/properties/ComputedStyleUtils.h index 251c27f..4b9b7383 100644 --- a/third_party/WebKit/Source/core/css/properties/ComputedStyleUtils.h +++ b/third_party/WebKit/Source/core/css/properties/ComputedStyleUtils.h
@@ -8,6 +8,7 @@ #include "core/css/CSSBorderImageSliceValue.h" #include "core/css/CSSIdentifierValue.h" #include "core/css/CSSValueList.h" +#include "core/css/CSSValuePair.h" #include "core/css/ZoomAdjustedPixelValue.h" #include "core/style/ComputedStyle.h" #include "core/style/ComputedStyleConstants.h" @@ -169,6 +170,31 @@ static CSSValue* ValueForPageBreakInside(EBreakInside); static CSSValue* ValueForWebkitColumnBreakInside(EBreakInside); static bool WidthOrHeightShouldReturnUsedValue(const LayoutObject*); + static CSSValueList* ValuesForShorthandProperty(const StylePropertyShorthand&, + const ComputedStyle&, + const LayoutObject*, + Node*, + bool allow_visited_style); + static CSSValueList* ValuesForGridShorthand(const StylePropertyShorthand&, + const ComputedStyle&, + const LayoutObject*, + Node*, + bool allow_visited_style); + static CSSValueList* ValuesForSidesShorthand(const StylePropertyShorthand&, + const ComputedStyle&, + const LayoutObject*, + Node*, + bool allow_visited_style); + static CSSValuePair* ValuesForInlineBlockShorthand( + const StylePropertyShorthand&, + const ComputedStyle&, + const LayoutObject*, + Node*, + bool allow_visited_style); + static CSSValue* ValuesForFontVariantProperty(const ComputedStyle&, + const LayoutObject*, + Node*, + bool allow_visited_style); }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/TextDecorationStyleCustom.cpp b/third_party/WebKit/Source/core/css/properties/longhands/TextDecorationStyleCustom.cpp index c60d9ebf..f76d746 100644 --- a/third_party/WebKit/Source/core/css/properties/longhands/TextDecorationStyleCustom.cpp +++ b/third_party/WebKit/Source/core/css/properties/longhands/TextDecorationStyleCustom.cpp
@@ -13,7 +13,7 @@ const CSSValue* TextDecorationStyle::CSSValueFromComputedStyleInternal( const ComputedStyle& style, const SVGComputedStyle&, - const LayoutObject*, + const LayoutObject* layout_object, Node* styled_node, bool allow_visited_style) const { return ComputedStyleUtils::ValueForTextDecorationStyle(
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/BorderBottomCustom.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/BorderBottomCustom.cpp index 3bb0eba5..962f4426 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/BorderBottomCustom.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/BorderBottomCustom.cpp
@@ -6,6 +6,8 @@ #include "core/StylePropertyShorthand.h" #include "core/css/parser/CSSPropertyParserHelpers.h" +#include "core/css/properties/ComputedStyleUtils.h" +#include "core/style/ComputedStyle.h" namespace blink { namespace CSSShorthand { @@ -20,5 +22,16 @@ borderBottomShorthand(), important, context, range, properties); } +const CSSValue* BorderBottom::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const SVGComputedStyle&, + const LayoutObject* layout_object, + Node* styled_node, + bool allow_visited_style) const { + return ComputedStyleUtils::ValuesForShorthandProperty( + borderBottomShorthand(), style, layout_object, styled_node, + allow_visited_style); +} + } // namespace CSSShorthand } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/BorderColorCustom.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/BorderColorCustom.cpp index 7d911af..d4fe008 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/BorderColorCustom.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/BorderColorCustom.cpp
@@ -6,6 +6,8 @@ #include "core/StylePropertyShorthand.h" #include "core/css/parser/CSSPropertyParserHelpers.h" +#include "core/css/properties/ComputedStyleUtils.h" +#include "core/style/ComputedStyle.h" namespace blink { namespace CSSShorthand { @@ -20,5 +22,16 @@ borderColorShorthand(), important, context, range, properties); } +const CSSValue* BorderColor::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const SVGComputedStyle&, + const LayoutObject* layout_object, + Node* styled_node, + bool allow_visited_style) const { + return ComputedStyleUtils::ValuesForSidesShorthand( + borderColorShorthand(), style, layout_object, styled_node, + allow_visited_style); +} + } // namespace CSSShorthand } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/BorderCustom.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/BorderCustom.cpp index 68d151e..97425ad 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/BorderCustom.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/BorderCustom.cpp
@@ -7,6 +7,7 @@ #include "core/css/CSSInitialValue.h" #include "core/css/parser/CSSParserContext.h" #include "core/css/parser/CSSPropertyParserHelpers.h" +#include "core/css/properties/ComputedStyleUtils.h" #include "core/style/ComputedStyle.h" namespace blink { @@ -69,5 +70,26 @@ return range.AtEnd(); } +const CSSValue* Border::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const SVGComputedStyle&, + const LayoutObject* layout_object, + Node* styled_node, + bool allow_visited_style) const { + const CSSValue* value = GetCSSPropertyBorderTop().CSSValueFromComputedStyle( + style, layout_object, styled_node, allow_visited_style); + static const CSSProperty* kProperties[3] = {&GetCSSPropertyBorderRight(), + &GetCSSPropertyBorderBottom(), + &GetCSSPropertyBorderLeft()}; + for (size_t i = 0; i < WTF_ARRAY_LENGTH(kProperties); ++i) { + const CSSValue* value_for_side = kProperties[i]->CSSValueFromComputedStyle( + style, layout_object, styled_node, allow_visited_style); + if (!DataEquivalent(value, value_for_side)) { + return nullptr; + } + } + return value; +} + } // namespace CSSShorthand } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/BorderLeftCustom.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/BorderLeftCustom.cpp index 805da108..a1af8056 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/BorderLeftCustom.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/BorderLeftCustom.cpp
@@ -6,6 +6,8 @@ #include "core/StylePropertyShorthand.h" #include "core/css/parser/CSSPropertyParserHelpers.h" +#include "core/css/properties/ComputedStyleUtils.h" +#include "core/style/ComputedStyle.h" namespace blink { namespace CSSShorthand { @@ -20,5 +22,16 @@ borderLeftShorthand(), important, context, range, properties); } +const CSSValue* BorderLeft::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const SVGComputedStyle&, + const LayoutObject* layout_object, + Node* styled_node, + bool allow_visited_style) const { + return ComputedStyleUtils::ValuesForShorthandProperty( + borderLeftShorthand(), style, layout_object, styled_node, + allow_visited_style); +} + } // namespace CSSShorthand } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/BorderRightCustom.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/BorderRightCustom.cpp index f76b667c..a14dcd1 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/BorderRightCustom.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/BorderRightCustom.cpp
@@ -6,6 +6,8 @@ #include "core/StylePropertyShorthand.h" #include "core/css/parser/CSSPropertyParserHelpers.h" +#include "core/css/properties/ComputedStyleUtils.h" +#include "core/style/ComputedStyle.h" namespace blink { namespace CSSShorthand { @@ -20,5 +22,16 @@ borderRightShorthand(), important, context, range, properties); } +const CSSValue* BorderRight::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const SVGComputedStyle&, + const LayoutObject* layout_object, + Node* styled_node, + bool allow_visited_style) const { + return ComputedStyleUtils::ValuesForShorthandProperty( + borderRightShorthand(), style, layout_object, styled_node, + allow_visited_style); +} + } // namespace CSSShorthand } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/BorderStyleCustom.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/BorderStyleCustom.cpp index 001435d6..2326b5d 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/BorderStyleCustom.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/BorderStyleCustom.cpp
@@ -6,6 +6,8 @@ #include "core/StylePropertyShorthand.h" #include "core/css/parser/CSSPropertyParserHelpers.h" +#include "core/css/properties/ComputedStyleUtils.h" +#include "core/style/ComputedStyle.h" namespace blink { namespace CSSShorthand { @@ -20,5 +22,16 @@ borderStyleShorthand(), important, context, range, properties); } +const CSSValue* BorderStyle::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const SVGComputedStyle&, + const LayoutObject* layout_object, + Node* styled_node, + bool allow_visited_style) const { + return ComputedStyleUtils::ValuesForSidesShorthand( + borderStyleShorthand(), style, layout_object, styled_node, + allow_visited_style); +} + } // namespace CSSShorthand } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/BorderTopCustom.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/BorderTopCustom.cpp index d342fe6..a263fb64 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/BorderTopCustom.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/BorderTopCustom.cpp
@@ -6,6 +6,8 @@ #include "core/StylePropertyShorthand.h" #include "core/css/parser/CSSPropertyParserHelpers.h" +#include "core/css/properties/ComputedStyleUtils.h" +#include "core/style/ComputedStyle.h" namespace blink { namespace CSSShorthand { @@ -20,5 +22,16 @@ borderTopShorthand(), important, context, range, properties); } +const CSSValue* BorderTop::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const SVGComputedStyle&, + const LayoutObject* layout_object, + Node* styled_node, + bool allow_visited_style) const { + return ComputedStyleUtils::ValuesForShorthandProperty( + borderTopShorthand(), style, layout_object, styled_node, + allow_visited_style); +} + } // namespace CSSShorthand } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/BorderWidthCustom.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/BorderWidthCustom.cpp index 10a11fa..5f0a09e 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/BorderWidthCustom.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/BorderWidthCustom.cpp
@@ -6,6 +6,8 @@ #include "core/StylePropertyShorthand.h" #include "core/css/parser/CSSPropertyParserHelpers.h" +#include "core/css/properties/ComputedStyleUtils.h" +#include "core/style/ComputedStyle.h" namespace blink { namespace CSSShorthand { @@ -20,5 +22,16 @@ borderWidthShorthand(), important, context, range, properties); } +const CSSValue* BorderWidth::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const SVGComputedStyle&, + const LayoutObject* layout_object, + Node* styled_node, + bool allow_visited_style) const { + return ComputedStyleUtils::ValuesForSidesShorthand( + borderWidthShorthand(), style, layout_object, styled_node, + allow_visited_style); +} + } // namespace CSSShorthand } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/ColumnRuleCustom.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/ColumnRuleCustom.cpp index 25cc470..3ff0977 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/ColumnRuleCustom.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/ColumnRuleCustom.cpp
@@ -6,6 +6,8 @@ #include "core/StylePropertyShorthand.h" #include "core/css/parser/CSSPropertyParserHelpers.h" +#include "core/css/properties/ComputedStyleUtils.h" +#include "core/style/ComputedStyle.h" namespace blink { namespace CSSShorthand { @@ -20,5 +22,16 @@ columnRuleShorthand(), important, context, range, properties); } +const CSSValue* ColumnRule::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const SVGComputedStyle&, + const LayoutObject* layout_object, + Node* styled_node, + bool allow_visited_style) const { + return ComputedStyleUtils::ValuesForShorthandProperty( + columnRuleShorthand(), style, layout_object, styled_node, + allow_visited_style); +} + } // namespace CSSShorthand } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/ColumnsCustom.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/ColumnsCustom.cpp index 3de4507..a4870b5 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/ColumnsCustom.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/ColumnsCustom.cpp
@@ -4,10 +4,13 @@ #include "core/css/properties/shorthands/Columns.h" +#include "core/StylePropertyShorthand.h" #include "core/css/CSSIdentifierValue.h" #include "core/css/parser/CSSParserContext.h" #include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/properties/CSSParsingUtils.h" +#include "core/css/properties/ComputedStyleUtils.h" +#include "core/style/ComputedStyle.h" namespace blink { namespace CSSShorthand { @@ -39,5 +42,16 @@ return true; } +const CSSValue* Columns::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const SVGComputedStyle&, + const LayoutObject* layout_object, + Node* styled_node, + bool allow_visited_style) const { + return ComputedStyleUtils::ValuesForShorthandProperty( + columnsShorthand(), style, layout_object, styled_node, + allow_visited_style); +} + } // namespace CSSShorthand } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/FlexCustom.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/FlexCustom.cpp index 2203625e..6214500 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/FlexCustom.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/FlexCustom.cpp
@@ -4,10 +4,13 @@ #include "core/css/properties/shorthands/Flex.h" +#include "core/StylePropertyShorthand.h" #include "core/css/CSSIdentifierValue.h" #include "core/css/parser/CSSParserContext.h" #include "core/css/parser/CSSParserLocalContext.h" #include "core/css/parser/CSSPropertyParserHelpers.h" +#include "core/css/properties/ComputedStyleUtils.h" +#include "core/style/ComputedStyle.h" namespace blink { namespace CSSShorthand { @@ -92,5 +95,15 @@ return true; } +const CSSValue* Flex::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const SVGComputedStyle&, + const LayoutObject* layout_object, + Node* styled_node, + bool allow_visited_style) const { + return ComputedStyleUtils::ValuesForShorthandProperty( + flexShorthand(), style, layout_object, styled_node, allow_visited_style); +} + } // namespace CSSShorthand } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/FlexFlowCustom.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/FlexFlowCustom.cpp index 917504e..187d14b 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/FlexFlowCustom.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/FlexFlowCustom.cpp
@@ -6,6 +6,8 @@ #include "core/StylePropertyShorthand.h" #include "core/css/parser/CSSPropertyParserHelpers.h" +#include "core/css/properties/ComputedStyleUtils.h" +#include "core/style/ComputedStyle.h" namespace blink { namespace CSSShorthand { @@ -20,5 +22,16 @@ flexFlowShorthand(), important, context, range, properties); } +const CSSValue* FlexFlow::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const SVGComputedStyle&, + const LayoutObject* layout_object, + Node* styled_node, + bool allow_visited_style) const { + return ComputedStyleUtils::ValuesForShorthandProperty( + flexFlowShorthand(), style, layout_object, styled_node, + allow_visited_style); +} + } // namespace CSSShorthand } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/FontVariantCustom.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/FontVariantCustom.cpp index dee80c3..e38cd23 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/FontVariantCustom.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/FontVariantCustom.cpp
@@ -9,6 +9,8 @@ #include "core/css/parser/FontVariantEastAsianParser.h" #include "core/css/parser/FontVariantLigaturesParser.h" #include "core/css/parser/FontVariantNumericParser.h" +#include "core/css/properties/ComputedStyleUtils.h" +#include "core/style/ComputedStyle.h" namespace blink { namespace CSSShorthand { @@ -105,5 +107,15 @@ return true; } +const CSSValue* FontVariant::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const SVGComputedStyle&, + const LayoutObject* layout_object, + Node* styled_node, + bool allow_visited_style) const { + return ComputedStyleUtils::ValuesForFontVariantProperty( + style, layout_object, styled_node, allow_visited_style); +} + } // namespace CSSShorthand } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/GridAreaCustom.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/GridAreaCustom.cpp index bb5e28da..4c9fbbb3 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/GridAreaCustom.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/GridAreaCustom.cpp
@@ -7,6 +7,8 @@ #include "core/StylePropertyShorthand.h" #include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/properties/CSSParsingUtils.h" +#include "core/css/properties/ComputedStyleUtils.h" +#include "core/style/ComputedStyle.h" namespace blink { namespace CSSShorthand { @@ -75,5 +77,16 @@ return true; } +const CSSValue* GridArea::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const SVGComputedStyle&, + const LayoutObject* layout_object, + Node* styled_node, + bool allow_visited_style) const { + return ComputedStyleUtils::ValuesForGridShorthand(gridAreaShorthand(), style, + layout_object, styled_node, + allow_visited_style); +} + } // namespace CSSShorthand } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/GridColumnCustom.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/GridColumnCustom.cpp index 2939f17..0565f85 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/GridColumnCustom.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/GridColumnCustom.cpp
@@ -8,6 +8,8 @@ #include "core/css/parser/CSSParserContext.h" #include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/properties/CSSParsingUtils.h" +#include "core/css/properties/ComputedStyleUtils.h" +#include "core/style/ComputedStyle.h" namespace blink { namespace CSSShorthand { @@ -41,5 +43,16 @@ return true; } +const CSSValue* GridColumn::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const SVGComputedStyle&, + const LayoutObject* layout_object, + Node* styled_node, + bool allow_visited_style) const { + return ComputedStyleUtils::ValuesForGridShorthand( + gridColumnShorthand(), style, layout_object, styled_node, + allow_visited_style); +} + } // namespace CSSShorthand } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/GridCustom.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/GridCustom.cpp index da2f83f1..39a3c4b1 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/GridCustom.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/GridCustom.cpp
@@ -9,7 +9,9 @@ #include "core/css/parser/CSSParserContext.h" #include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/properties/CSSParsingUtils.h" +#include "core/css/properties/ComputedStyleUtils.h" #include "core/layout/LayoutObject.h" +#include "core/style/ComputedStyle.h" namespace blink { namespace { @@ -178,5 +180,15 @@ return layout_object && layout_object->IsLayoutGrid(); } +const CSSValue* Grid::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const SVGComputedStyle&, + const LayoutObject* layout_object, + Node* styled_node, + bool allow_visited_style) const { + return ComputedStyleUtils::ValuesForGridShorthand( + gridShorthand(), style, layout_object, styled_node, allow_visited_style); +} + } // namespace CSSShorthand } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/GridGapCustom.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/GridGapCustom.cpp index 9ab56ee..5ec1dfa 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/GridGapCustom.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/GridGapCustom.cpp
@@ -7,6 +7,8 @@ #include "core/StylePropertyShorthand.h" #include "core/css/parser/CSSParserContext.h" #include "core/css/parser/CSSPropertyParserHelpers.h" +#include "core/css/properties/ComputedStyleUtils.h" +#include "core/style/ComputedStyle.h" namespace blink { namespace CSSShorthand { @@ -35,5 +37,16 @@ return true; } +const CSSValue* GridGap::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const SVGComputedStyle&, + const LayoutObject* layout_object, + Node* styled_node, + bool allow_visited_style) const { + return ComputedStyleUtils::ValuesForShorthandProperty( + gridGapShorthand(), style, layout_object, styled_node, + allow_visited_style); +} + } // namespace CSSShorthand } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/GridRowCustom.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/GridRowCustom.cpp index fcd355b..d461b01 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/GridRowCustom.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/GridRowCustom.cpp
@@ -8,6 +8,8 @@ #include "core/css/parser/CSSParserContext.h" #include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/properties/CSSParsingUtils.h" +#include "core/css/properties/ComputedStyleUtils.h" +#include "core/style/ComputedStyle.h" namespace blink { namespace CSSShorthand { @@ -41,5 +43,16 @@ return true; } +const CSSValue* GridRow::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const SVGComputedStyle&, + const LayoutObject* layout_object, + Node* styled_node, + bool allow_visited_style) const { + return ComputedStyleUtils::ValuesForGridShorthand(gridRowShorthand(), style, + layout_object, styled_node, + allow_visited_style); +} + } // namespace CSSShorthand } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/GridTemplateCustom.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/GridTemplateCustom.cpp index bd456f9..b5cb6d2 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/GridTemplateCustom.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/GridTemplateCustom.cpp
@@ -4,10 +4,13 @@ #include "core/css/properties/shorthands/GridTemplate.h" +#include "core/StylePropertyShorthand.h" #include "core/css/parser/CSSParserContext.h" #include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/properties/CSSParsingUtils.h" +#include "core/css/properties/ComputedStyleUtils.h" #include "core/layout/LayoutObject.h" +#include "core/style/ComputedStyle.h" namespace blink { namespace CSSShorthand { @@ -51,5 +54,16 @@ return layout_object && layout_object->IsLayoutGrid(); } +const CSSValue* GridTemplate::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const SVGComputedStyle&, + const LayoutObject* layout_object, + Node* styled_node, + bool allow_visited_style) const { + return ComputedStyleUtils::ValuesForGridShorthand( + gridTemplateShorthand(), style, layout_object, styled_node, + allow_visited_style); +} + } // namespace CSSShorthand } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/ListStyleCustom.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/ListStyleCustom.cpp index 4f4e942..5546413 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/ListStyleCustom.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/ListStyleCustom.cpp
@@ -6,6 +6,8 @@ #include "core/StylePropertyShorthand.h" #include "core/css/parser/CSSPropertyParserHelpers.h" +#include "core/css/properties/ComputedStyleUtils.h" +#include "core/style/ComputedStyle.h" namespace blink { namespace CSSShorthand { @@ -20,5 +22,16 @@ listStyleShorthand(), important, context, range, properties); } +const CSSValue* ListStyle::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const SVGComputedStyle&, + const LayoutObject* layout_object, + Node* styled_node, + bool allow_visited_style) const { + return ComputedStyleUtils::ValuesForShorthandProperty( + listStyleShorthand(), style, layout_object, styled_node, + allow_visited_style); +} + } // namespace CSSShorthand } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/MarginCustom.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/MarginCustom.cpp index 99ab3224..ec6d380 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/MarginCustom.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/MarginCustom.cpp
@@ -6,6 +6,7 @@ #include "core/StylePropertyShorthand.h" #include "core/css/parser/CSSPropertyParserHelpers.h" +#include "core/css/properties/ComputedStyleUtils.h" #include "core/layout/LayoutObject.h" #include "core/style/ComputedStyle.h" @@ -30,5 +31,16 @@ !style->MarginRight().IsFixed()); } +const CSSValue* Margin::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const SVGComputedStyle&, + const LayoutObject* layout_object, + Node* styled_node, + bool allow_visited_style) const { + return ComputedStyleUtils::ValuesForSidesShorthand(marginShorthand(), style, + layout_object, styled_node, + allow_visited_style); +} + } // namespace CSSShorthand } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/OutlineCustom.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/OutlineCustom.cpp index 8b67cd1..e7aa10e 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/OutlineCustom.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/OutlineCustom.cpp
@@ -6,6 +6,8 @@ #include "core/StylePropertyShorthand.h" #include "core/css/parser/CSSPropertyParserHelpers.h" +#include "core/css/properties/ComputedStyleUtils.h" +#include "core/style/ComputedStyle.h" namespace blink { namespace CSSShorthand { @@ -20,5 +22,16 @@ outlineShorthand(), important, context, range, properties); } +const CSSValue* Outline::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const SVGComputedStyle&, + const LayoutObject* layout_object, + Node* styled_node, + bool allow_visited_style) const { + return ComputedStyleUtils::ValuesForShorthandProperty( + outlineShorthand(), style, layout_object, styled_node, + allow_visited_style); +} + } // namespace CSSShorthand } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/PaddingCustom.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/PaddingCustom.cpp index 5907f62..32b5e9b 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/PaddingCustom.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/PaddingCustom.cpp
@@ -6,6 +6,7 @@ #include "core/StylePropertyShorthand.h" #include "core/css/parser/CSSPropertyParserHelpers.h" +#include "core/css/properties/ComputedStyleUtils.h" #include "core/layout/LayoutObject.h" #include "core/style/ComputedStyle.h" @@ -30,5 +31,16 @@ !style->PaddingRight().IsFixed()); } +const CSSValue* Padding::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const SVGComputedStyle&, + const LayoutObject* layout_object, + Node* styled_node, + bool allow_visited_style) const { + return ComputedStyleUtils::ValuesForSidesShorthand(paddingShorthand(), style, + layout_object, styled_node, + allow_visited_style); +} + } // namespace CSSShorthand } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/PlaceContentCustom.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/PlaceContentCustom.cpp index f603677..0c12f0d8 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/PlaceContentCustom.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/PlaceContentCustom.cpp
@@ -7,6 +7,8 @@ #include "core/StylePropertyShorthand.h" #include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/properties/CSSParsingUtils.h" +#include "core/css/properties/ComputedStyleUtils.h" +#include "core/style/ComputedStyle.h" namespace blink { namespace CSSShorthand { @@ -42,5 +44,18 @@ return true; } +const CSSValue* PlaceContent::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const SVGComputedStyle&, + const LayoutObject* layout_object, + Node* styled_node, + bool allow_visited_style) const { + // TODO (jfernandez): The spec states that we should return the specified + // value. + return ComputedStyleUtils::ValuesForShorthandProperty( + placeContentShorthand(), style, layout_object, styled_node, + allow_visited_style); +} + } // namespace CSSShorthand } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/PlaceItemsCustom.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/PlaceItemsCustom.cpp index 1513a6a..d661c76c 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/PlaceItemsCustom.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/PlaceItemsCustom.cpp
@@ -7,6 +7,8 @@ #include "core/StylePropertyShorthand.h" #include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/properties/CSSParsingUtils.h" +#include "core/css/properties/ComputedStyleUtils.h" +#include "core/style/ComputedStyle.h" namespace blink { namespace CSSShorthand { @@ -45,5 +47,18 @@ return true; } +const CSSValue* PlaceItems::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const SVGComputedStyle&, + const LayoutObject* layout_object, + Node* styled_node, + bool allow_visited_style) const { + // TODO (jfernandez): The spec states that we should return the specified + // value. + return ComputedStyleUtils::ValuesForShorthandProperty( + placeItemsShorthand(), style, layout_object, styled_node, + allow_visited_style); +} + } // namespace CSSShorthand } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/PlaceSelfCustom.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/PlaceSelfCustom.cpp index 70c2dd8..534d75b 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/PlaceSelfCustom.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/PlaceSelfCustom.cpp
@@ -7,6 +7,8 @@ #include "core/StylePropertyShorthand.h" #include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/properties/CSSParsingUtils.h" +#include "core/css/properties/ComputedStyleUtils.h" +#include "core/style/ComputedStyle.h" namespace blink { namespace CSSShorthand { @@ -41,5 +43,18 @@ return true; } +const CSSValue* PlaceSelf::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const SVGComputedStyle&, + const LayoutObject* layout_object, + Node* styled_node, + bool allow_visited_style) const { + // TODO (jfernandez): The spec states that we should return the specified + // value. + return ComputedStyleUtils::ValuesForShorthandProperty( + placeSelfShorthand(), style, layout_object, styled_node, + allow_visited_style); +} + } // namespace CSSShorthand } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/ScrollMarginBlockCustom.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/ScrollMarginBlockCustom.cpp index 60bf935..650a807 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/ScrollMarginBlockCustom.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/ScrollMarginBlockCustom.cpp
@@ -6,6 +6,8 @@ #include "core/StylePropertyShorthand.h" #include "core/css/parser/CSSPropertyParserHelpers.h" +#include "core/css/properties/ComputedStyleUtils.h" +#include "core/style/ComputedStyle.h" namespace blink { namespace CSSShorthand { @@ -20,5 +22,16 @@ scrollMarginBlockShorthand(), important, context, range, properties); } +const CSSValue* ScrollMarginBlock::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const SVGComputedStyle&, + const LayoutObject* layout_object, + Node* styled_node, + bool allow_visited_style) const { + return ComputedStyleUtils::ValuesForInlineBlockShorthand( + scrollMarginBlockShorthand(), style, layout_object, styled_node, + allow_visited_style); +} + } // namespace CSSShorthand } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/ScrollMarginCustom.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/ScrollMarginCustom.cpp index c600788..1726f583 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/ScrollMarginCustom.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/ScrollMarginCustom.cpp
@@ -6,6 +6,8 @@ #include "core/StylePropertyShorthand.h" #include "core/css/parser/CSSPropertyParserHelpers.h" +#include "core/css/properties/ComputedStyleUtils.h" +#include "core/style/ComputedStyle.h" namespace blink { namespace CSSShorthand { @@ -20,5 +22,16 @@ scrollMarginShorthand(), important, context, range, properties); } +const CSSValue* ScrollMargin::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const SVGComputedStyle&, + const LayoutObject* layout_object, + Node* styled_node, + bool allow_visited_style) const { + return ComputedStyleUtils::ValuesForSidesShorthand( + scrollMarginShorthand(), style, layout_object, styled_node, + allow_visited_style); +} + } // namespace CSSShorthand } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/ScrollMarginInlineCustom.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/ScrollMarginInlineCustom.cpp index dc06c6a0..96b7839 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/ScrollMarginInlineCustom.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/ScrollMarginInlineCustom.cpp
@@ -6,6 +6,8 @@ #include "core/StylePropertyShorthand.h" #include "core/css/parser/CSSPropertyParserHelpers.h" +#include "core/css/properties/ComputedStyleUtils.h" +#include "core/style/ComputedStyle.h" namespace blink { namespace CSSShorthand { @@ -20,5 +22,16 @@ scrollMarginInlineShorthand(), important, context, range, properties); } +const CSSValue* ScrollMarginInline::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const SVGComputedStyle&, + const LayoutObject* layout_object, + Node* styled_node, + bool allow_visited_style) const { + return ComputedStyleUtils::ValuesForInlineBlockShorthand( + scrollMarginInlineShorthand(), style, layout_object, styled_node, + allow_visited_style); +} + } // namespace CSSShorthand } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/ScrollPaddingBlockCustom.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/ScrollPaddingBlockCustom.cpp index 521e8301..5698bf4 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/ScrollPaddingBlockCustom.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/ScrollPaddingBlockCustom.cpp
@@ -6,6 +6,8 @@ #include "core/StylePropertyShorthand.h" #include "core/css/parser/CSSPropertyParserHelpers.h" +#include "core/css/properties/ComputedStyleUtils.h" +#include "core/style/ComputedStyle.h" namespace blink { namespace CSSShorthand { @@ -20,5 +22,16 @@ scrollPaddingBlockShorthand(), important, context, range, properties); } +const CSSValue* ScrollPaddingBlock::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const SVGComputedStyle&, + const LayoutObject* layout_object, + Node* styled_node, + bool allow_visited_style) const { + return ComputedStyleUtils::ValuesForInlineBlockShorthand( + scrollPaddingBlockShorthand(), style, layout_object, styled_node, + allow_visited_style); +} + } // namespace CSSShorthand } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/ScrollPaddingCustom.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/ScrollPaddingCustom.cpp index e799b63..898bb33b 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/ScrollPaddingCustom.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/ScrollPaddingCustom.cpp
@@ -6,6 +6,8 @@ #include "core/StylePropertyShorthand.h" #include "core/css/parser/CSSPropertyParserHelpers.h" +#include "core/css/properties/ComputedStyleUtils.h" +#include "core/style/ComputedStyle.h" namespace blink { namespace CSSShorthand { @@ -20,5 +22,16 @@ scrollPaddingShorthand(), important, context, range, properties); } +const CSSValue* ScrollPadding::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const SVGComputedStyle&, + const LayoutObject* layout_object, + Node* styled_node, + bool allow_visited_style) const { + return ComputedStyleUtils::ValuesForSidesShorthand( + scrollPaddingShorthand(), style, layout_object, styled_node, + allow_visited_style); +} + } // namespace CSSShorthand } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/ScrollPaddingInlineCustom.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/ScrollPaddingInlineCustom.cpp index d05c630d..4ae75d6 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/ScrollPaddingInlineCustom.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/ScrollPaddingInlineCustom.cpp
@@ -6,6 +6,8 @@ #include "core/StylePropertyShorthand.h" #include "core/css/parser/CSSPropertyParserHelpers.h" +#include "core/css/properties/ComputedStyleUtils.h" +#include "core/style/ComputedStyle.h" namespace blink { namespace CSSShorthand { @@ -20,5 +22,16 @@ scrollPaddingInlineShorthand(), important, context, range, properties); } +const CSSValue* ScrollPaddingInline::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const SVGComputedStyle&, + const LayoutObject* layout_object, + Node* styled_node, + bool allow_visited_style) const { + return ComputedStyleUtils::ValuesForInlineBlockShorthand( + scrollPaddingInlineShorthand(), style, layout_object, styled_node, + allow_visited_style); +} + } // namespace CSSShorthand } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/TextDecorationCustom.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/TextDecorationCustom.cpp index 91b1311f..ca2f993f 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/TextDecorationCustom.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/TextDecorationCustom.cpp
@@ -6,6 +6,8 @@ #include "core/StylePropertyShorthand.h" #include "core/css/parser/CSSPropertyParserHelpers.h" +#include "core/css/properties/ComputedStyleUtils.h" +#include "core/style/ComputedStyle.h" namespace blink { namespace CSSShorthand { @@ -20,5 +22,16 @@ textDecorationShorthand(), important, context, range, properties); } +const CSSValue* TextDecoration::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const SVGComputedStyle&, + const LayoutObject* layout_object, + Node* styled_node, + bool allow_visited_style) const { + return ComputedStyleUtils::ValuesForShorthandProperty( + textDecorationShorthand(), style, layout_object, styled_node, + allow_visited_style); +} + } // namespace CSSShorthand } // namespace blink
diff --git a/third_party/WebKit/Source/core/exported/WebDocumentLoaderImpl.cpp b/third_party/WebKit/Source/core/exported/WebDocumentLoaderImpl.cpp index d17c9a1..e442d55 100644 --- a/third_party/WebKit/Source/core/exported/WebDocumentLoaderImpl.cpp +++ b/third_party/WebKit/Source/core/exported/WebDocumentLoaderImpl.cpp
@@ -34,6 +34,7 @@ #include "core/dom/Document.h" #include "core/frame/LocalFrame.h" #include "core/loader/SubresourceFilter.h" +#include "platform/network/NetworkUtils.h" #include "platform/wtf/PtrUtil.h" #include "public/platform/WebDocumentSubresourceFilter.h" #include "public/platform/WebURL.h" @@ -43,6 +44,35 @@ namespace blink { +namespace { + +bool IsHttpOrHttpsOrigin(const WebSecurityOrigin& origin) { + return origin.Protocol() == "http" || origin.Protocol() == "https"; +} + +} // anonymous namespace + +// static +bool WebDocumentLoader::ShouldPersistUserActivation( + const WebSecurityOrigin& previous_origin, + const WebSecurityOrigin& new_origin) { + if (previous_origin.IsNull() || new_origin.IsNull()) + return false; + + if (!IsHttpOrHttpsOrigin(previous_origin) || !IsHttpOrHttpsOrigin(new_origin)) + return false; + + if (previous_origin.Host() == new_origin.Host()) + return true; + + String previous_domain = NetworkUtils::GetDomainAndRegistry( + previous_origin.Host(), NetworkUtils::kIncludePrivateRegistries); + String new_domain = NetworkUtils::GetDomainAndRegistry( + new_origin.Host(), NetworkUtils::kIncludePrivateRegistries); + + return !previous_domain.IsEmpty() && previous_domain == new_domain; +} + WebDocumentLoaderImpl* WebDocumentLoaderImpl::Create( LocalFrame* frame, const ResourceRequest& request, @@ -194,6 +224,10 @@ DocumentLoader::SetSourceLocation(nullptr); } +void WebDocumentLoaderImpl::SetUserActivated() { + DocumentLoader::SetUserActivated(); +} + void WebDocumentLoaderImpl::Trace(blink::Visitor* visitor) { DocumentLoader::Trace(visitor); }
diff --git a/third_party/WebKit/Source/core/exported/WebDocumentLoaderImpl.h b/third_party/WebKit/Source/core/exported/WebDocumentLoaderImpl.h index c0df491..663e5f80 100644 --- a/third_party/WebKit/Source/core/exported/WebDocumentLoaderImpl.h +++ b/third_party/WebKit/Source/core/exported/WebDocumentLoaderImpl.h
@@ -84,6 +84,7 @@ WebServiceWorkerNetworkProvider* GetServiceWorkerNetworkProvider() override; void SetSourceLocation(const WebSourceLocation&) override; void ResetSourceLocation() override; + void SetUserActivated() override; static WebNavigationType ToWebNavigationType(NavigationType);
diff --git a/third_party/WebKit/Source/core/exported/WebFrameTest.cpp b/third_party/WebKit/Source/core/exported/WebFrameTest.cpp index ccbb3d2..5236bf46 100644 --- a/third_party/WebKit/Source/core/exported/WebFrameTest.cpp +++ b/third_party/WebKit/Source/core/exported/WebFrameTest.cpp
@@ -162,6 +162,7 @@ #include "public/web/WebViewClient.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +#include "third_party/WebKit/common/page/launching_process_state.h" #include "v8/include/v8.h" using blink::URLTestHelpers::ToKURL; @@ -196,6 +197,18 @@ ->UnregisterAllURLsAndClearMemoryCache(); } + void DisableRendererSchedulerThrottling() { + // Make sure that the RendererScheduler is foregrounded to avoid getting + // throttled. + if (kLaunchingProcessIsBackgrounded) { + Platform::Current() + ->CurrentThread() + ->Scheduler() + ->GetRendererSchedulerForTest() + ->SetRendererBackgrounded(false); + } + } + void RegisterMockedHttpURLLoad(const std::string& file_name) { RegisterMockedURLLoadFromBase(base_url_, file_name); } @@ -496,6 +509,7 @@ } TEST_P(ParameterizedWebFrameTest, RequestExecuteV8FunctionWhileSuspended) { + DisableRendererSchedulerThrottling(); RegisterMockedHttpURLLoad("foo.html"); FrameTestHelpers::WebViewHelper web_view_helper; @@ -530,6 +544,7 @@ TEST_P(ParameterizedWebFrameTest, RequestExecuteV8FunctionWhileSuspendedWithUserGesture) { + DisableRendererSchedulerThrottling(); RegisterMockedHttpURLLoad("foo.html"); FrameTestHelpers::WebViewHelper web_view_helper;
diff --git a/third_party/WebKit/Source/core/exported/WebViewImpl.cpp b/third_party/WebKit/Source/core/exported/WebViewImpl.cpp index f666731..d0c5134a 100644 --- a/third_party/WebKit/Source/core/exported/WebViewImpl.cpp +++ b/third_party/WebKit/Source/core/exported/WebViewImpl.cpp
@@ -3029,13 +3029,6 @@ int width_scaled = document->GetLayoutView() ->MinPreferredLogicalWidth() .Round(); // Already accounts for zoom. - if (Scrollbar* scrollbar = - MainFrameImpl()->GetFrameView()->VerticalScrollbar()) { - DCHECK(!RuntimeEnabledFeatures::RootLayerScrollingEnabled()); - // For RLS, this occurs in LayoutBlock::ComputeIntrinsicLogicalWidths. - if (!scrollbar->IsOverlayScrollbar()) - width_scaled += scrollbar->ScrollbarThickness(); - } int height_scaled = document->documentElement()->GetLayoutBox()->ScrollHeight().Round(); return IntSize(width_scaled, height_scaled);
diff --git a/third_party/WebKit/Source/core/fileapi/File.cpp b/third_party/WebKit/Source/core/fileapi/File.cpp index dcae344..739f7bb3 100644 --- a/third_party/WebKit/Source/core/fileapi/File.cpp +++ b/third_party/WebKit/Source/core/fileapi/File.cpp
@@ -86,7 +86,7 @@ const String& file_system_name, const FileMetadata& metadata) { std::unique_ptr<BlobData> blob_data; - if (metadata.length == BlobDataItem::kToEndOfFile) { + if (metadata.length == BlobData::kToEndOfFile) { blob_data = BlobData::CreateForFileWithUnknownSize( metadata.platform_path, metadata.modification_time / kMsPerSecond); } else { @@ -103,7 +103,7 @@ const KURL& file_system_url, const FileMetadata& metadata) { std::unique_ptr<BlobData> blob_data; - if (metadata.length == BlobDataItem::kToEndOfFile) { + if (metadata.length == BlobData::kToEndOfFile) { blob_data = BlobData::CreateForFileSystemURLWithUnknownSize( file_system_url, metadata.modification_time / kMsPerSecond); } else {
diff --git a/third_party/WebKit/Source/core/html/HTMLViewSourceDocument.cpp b/third_party/WebKit/Source/core/html/HTMLViewSourceDocument.cpp index cf4dc66f..e14cfff 100644 --- a/third_party/WebKit/Source/core/html/HTMLViewSourceDocument.cpp +++ b/third_party/WebKit/Source/core/html/HTMLViewSourceDocument.cpp
@@ -25,7 +25,6 @@ #include "core/html/HTMLViewSourceDocument.h" #include "core/dom/Text.h" -#include "core/frame/UseCounter.h" #include "core/html/HTMLAnchorElement.h" #include "core/html/HTMLBRElement.h" #include "core/html/HTMLBaseElement.h"
diff --git a/third_party/WebKit/Source/core/loader/DocumentLoader.cpp b/third_party/WebKit/Source/core/loader/DocumentLoader.cpp index 71c783a..101aae1 100644 --- a/third_party/WebKit/Source/core/loader/DocumentLoader.cpp +++ b/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
@@ -81,7 +81,6 @@ #include "platform/mhtml/MHTMLArchive.h" #include "platform/network/ContentSecurityPolicyResponseHeaders.h" #include "platform/network/HTTPParsers.h" -#include "platform/network/NetworkUtils.h" #include "platform/network/http_names.h" #include "platform/network/mime/MIMETypeRegistry.h" #include "platform/plugins/PluginData.h" @@ -92,6 +91,7 @@ #include "platform/wtf/text/WTFString.h" #include "public/platform/Platform.h" #include "public/platform/modules/serviceworker/WebServiceWorkerNetworkProvider.h" +#include "public/web/WebDocumentLoader.h" #include "public/web/WebHistoryCommitType.h" namespace blink { @@ -126,7 +126,8 @@ state_(kNotStarted), in_data_received_(false), data_buffer_(SharedBuffer::Create()), - devtools_navigation_token_(devtools_navigation_token) { + devtools_navigation_token_(devtools_navigation_token), + user_activated_(false) { DCHECK(frame_); // The document URL needs to be added to the head of the list as that is @@ -439,6 +440,10 @@ DCHECK_EQ(kSentDidFinishLoad, state_); } +void DocumentLoader::SetUserActivated() { + user_activated_ = true; +} + void DocumentLoader::FinishedLoading(double finish_time) { DCHECK(frame_->Loader().StateMachine()->CreatingInitialEmptyDocument() || !frame_->GetPage()->Paused() || @@ -1018,32 +1023,6 @@ previous_security_origin); } -// static -bool DocumentLoader::CheckOriginIsHttpOrHttps(const SecurityOrigin* origin) { - return origin && - (origin->Protocol() == "http" || origin->Protocol() == "https"); -} - -// static -bool DocumentLoader::ShouldPersistUserGestureValue( - const SecurityOrigin* previous_security_origin, - const SecurityOrigin* new_security_origin) { - if (!CheckOriginIsHttpOrHttps(previous_security_origin) || - !CheckOriginIsHttpOrHttps(new_security_origin)) - return false; - - if (previous_security_origin->Host() == new_security_origin->Host()) - return true; - - String previous_domain = NetworkUtils::GetDomainAndRegistry( - previous_security_origin->Host(), - NetworkUtils::kIncludePrivateRegistries); - String new_domain = NetworkUtils::GetDomainAndRegistry( - new_security_origin->Host(), NetworkUtils::kIncludePrivateRegistries); - - return !previous_domain.IsEmpty() && previous_domain == new_domain; -} - void DocumentLoader::InstallNewDocument( const KURL& url, Document* owner_document, @@ -1093,8 +1072,9 @@ // Persist the user gesture state between frames. bool user_gesture_before_value = false; if (user_gesture_bit_set) { - user_gesture_before_value = ShouldPersistUserGestureValue( - previous_security_origin, document->GetSecurityOrigin()); + user_gesture_before_value = WebDocumentLoader::ShouldPersistUserActivation( + WebSecurityOrigin(previous_security_origin), + WebSecurityOrigin(document->GetSecurityOrigin())); // Clear the user gesture bit that is not persisted. // TODO(crbug.com/736415): Clear this bit unconditionally for all frames. @@ -1102,6 +1082,11 @@ frame_->ClearActivation(); } + // If the load request was user activated, pretend that there was a gesture + // to carry over. + if (user_activated_) + user_gesture_before_value = true; + // If the user gesture before navigation bit has changed then update it on the // frame. if (frame_->HasReceivedUserGestureBeforeNavigation() !=
diff --git a/third_party/WebKit/Source/core/loader/DocumentLoader.h b/third_party/WebKit/Source/core/loader/DocumentLoader.h index b65156c..e35807ba 100644 --- a/third_party/WebKit/Source/core/loader/DocumentLoader.h +++ b/third_party/WebKit/Source/core/loader/DocumentLoader.h
@@ -222,6 +222,8 @@ void LoadFailed(const ResourceError&); + void SetUserActivated(); + void Trace(blink::Visitor*) override; // For automation driver-initiated navigations over the devtools protocol, @@ -364,11 +366,6 @@ bool was_blocked_after_csp_; - static bool ShouldPersistUserGestureValue( - const SecurityOrigin* previous_security_origin, - const SecurityOrigin* new_security_origin); - static bool CheckOriginIsHttpOrHttps(const SecurityOrigin*); - // PlzNavigate: set when committing a navigation. The data has originally been // captured when the navigation was sent to the browser process, and it is // sent back at commit time. @@ -381,6 +378,9 @@ bool in_data_received_; scoped_refptr<SharedBuffer> data_buffer_; base::UnguessableToken devtools_navigation_token_; + + // Whether this load request comes from a user activation. + bool user_activated_; }; DECLARE_WEAK_IDENTIFIER_MAP(DocumentLoader);
diff --git a/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp b/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp index 933895a..8ec7eff 100644 --- a/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp +++ b/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp
@@ -856,7 +856,7 @@ } WTF::Optional<network::mojom::CORSError> preflight_error = - WebCORS::CheckPreflight(response.HttpStatusCode()); + CORS::CheckPreflight(response.HttpStatusCode()); if (preflight_error) { HandlePreflightFailure( response.Url(), @@ -869,7 +869,7 @@ if (actual_request_.IsExternalRequest()) { WTF::Optional<network::mojom::CORSError> external_preflight_status = - WebCORS::CheckExternalPreflight(response.HttpHeaderFields()); + CORS::CheckExternalPreflight(response.HttpHeaderFields()); if (external_preflight_status) { HandlePreflightFailure( response.Url(),
diff --git a/third_party/WebKit/Source/devtools/BUILD.gn b/third_party/WebKit/Source/devtools/BUILD.gn index af22e1e..14dc62d 100644 --- a/third_party/WebKit/Source/devtools/BUILD.gn +++ b/third_party/WebKit/Source/devtools/BUILD.gn
@@ -655,7 +655,6 @@ "front_end/sources/xhrBreakpointsSidebarPane.css", "front_end/sources/XHRBreakpointsSidebarPane.js", "front_end/sources_test_runner/AutocompleteTestRunner.js", - "front_end/sources_test_runner/BreakpointManagerTestRunner.js", "front_end/sources_test_runner/DebuggerTestRunner.js", "front_end/sources_test_runner/EditorTestRunner.js", "front_end/sources_test_runner/LiveEditTestRunner.js",
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/BreakpointManager.js b/third_party/WebKit/Source/devtools/front_end/bindings/BreakpointManager.js index 77bfc03..596d9e9e 100644 --- a/third_party/WebKit/Source/devtools/front_end/bindings/BreakpointManager.js +++ b/third_party/WebKit/Source/devtools/front_end/bindings/BreakpointManager.js
@@ -116,13 +116,6 @@ } } - removeProvisionalBreakpointsForTest() { - var breakpoints = this._provisionalBreakpoints.valuesArray(); - for (var i = 0; i < breakpoints.length; ++i) - breakpoints[i].remove(); - this._provisionalBreakpoints.clear(); - } - /** * @param {!Workspace.UISourceCode} uiSourceCode */
diff --git a/third_party/WebKit/Source/devtools/front_end/persistence/PersistenceActions.js b/third_party/WebKit/Source/devtools/front_end/persistence/PersistenceActions.js index 00bd1b4..37406d0b 100644 --- a/third_party/WebKit/Source/devtools/front_end/persistence/PersistenceActions.js +++ b/third_party/WebKit/Source/devtools/front_end/persistence/PersistenceActions.js
@@ -29,10 +29,6 @@ if (contentProvider.contentType().isDocumentOrScriptOrStyleSheet()) contextMenu.saveSection().appendItem(Common.UIString('Save as...'), saveAs); - var path = Common.ParsedURL.urlToPlatformPath(contentProvider.contentURL(), Host.isWin()); - contextMenu.saveSection().appendItem( - Common.UIString('Open in containing folder'), () => InspectorFrontendHost.showItemInFolder(path)); - // Retrieve uiSourceCode by URL to pick network resources everywhere. var uiSourceCode = Workspace.workspace.uiSourceCodeForURL(contentProvider.contentURL()); if (uiSourceCode && Persistence.networkPersistenceManager.canSaveUISourceCodeForOverrides(uiSourceCode)) { @@ -43,5 +39,13 @@ Common.Revealer.reveal(uiSourceCode); }); } + + var binding = uiSourceCode && Persistence.persistence.binding(uiSourceCode); + var fileURL = binding ? binding.fileSystem.contentURL() : contentProvider.contentURL(); + if (fileURL.startsWith('file://')) { + var path = Common.ParsedURL.urlToPlatformPath(fileURL, Host.isWin()); + contextMenu.revealSection().appendItem( + Common.UIString('Open in containing folder'), () => InspectorFrontendHost.showItemInFolder(path)); + } } };
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/NavigatorView.js b/third_party/WebKit/Source/devtools/front_end/sources/NavigatorView.js index 60bf977..e423419d 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/NavigatorView.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/NavigatorView.js
@@ -755,7 +755,7 @@ var folderPath = Common.ParsedURL.urlToPlatformPath( Persistence.FileSystemWorkspaceBinding.completeURL(project, path), Host.isWin()); - contextMenu.saveSection().appendItem( + contextMenu.revealSection().appendItem( Common.UIString('Open folder'), () => InspectorFrontendHost.showItemInFolder(folderPath)); if (project.canCreateFile()) { contextMenu.defaultSection().appendItem(
diff --git a/third_party/WebKit/Source/devtools/front_end/sources_test_runner/BreakpointManagerTestRunner.js b/third_party/WebKit/Source/devtools/front_end/sources_test_runner/BreakpointManagerTestRunner.js deleted file mode 100644 index 3baa087..0000000 --- a/third_party/WebKit/Source/devtools/front_end/sources_test_runner/BreakpointManagerTestRunner.js +++ /dev/null
@@ -1,430 +0,0 @@ -// Copyright 2017 The Chromium Authors. All -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -/** - * @fileoverview using private properties isn't a Closure violation in tests. - * @suppress {accessControls} - */ - -SourcesTestRunner.BreakpointManager = {}; - -SourcesTestRunner.createWorkspace = function() { - SourcesTestRunner.testTargetManager = new SDK.TargetManager(); - SourcesTestRunner.testWorkspace = new Workspace.Workspace(); - SourcesTestRunner.testNetworkProjectManager = - new Bindings.NetworkProjectManager(SourcesTestRunner.testTargetManager, SourcesTestRunner.testWorkspace); - SourcesTestRunner.testResourceMapping = - new Bindings.ResourceMapping(SourcesTestRunner.testTargetManager, SourcesTestRunner.testWorkspace); - SourcesTestRunner.testDebuggerWorkspaceBinding = - new Bindings.DebuggerWorkspaceBinding(SourcesTestRunner.testTargetManager, SourcesTestRunner.testWorkspace); - Bindings.resourceMapping = SourcesTestRunner.testResourceMapping; -}; - -function resourceMappingModelInfoForTarget(target) { - var resourceTreeModel = target.model(SDK.ResourceTreeModel); - var binding = (resourceTreeModel ? SourcesTestRunner.testResourceMapping._modelToInfo.get(resourceTreeModel) : null); - return binding; -} - -SourcesTestRunner.createMockTarget = function(id) { - var capabilities = SDK.Target.Capability.AllForTests; - - var target = SourcesTestRunner.testTargetManager.createTarget( - 'mock-target-id-' + id, 'mock-target-' + id, capabilities & ~SDK.Target.Capability.JS, - params => new SDK.StubConnection(params), null); - - SourcesTestRunner.testNetworkProject = Bindings.NetworkProject.forTarget(target); - SourcesTestRunner.testResourceMappingModelInfo = resourceMappingModelInfoForTarget(target); - target._capabilitiesMask = capabilities; - target._inspectedURL = TestRunner.mainTarget.inspectedURL(); - target.resourceTreeModel = target.model(SDK.ResourceTreeModel); - target.resourceTreeModel._cachedResourcesProcessed = true; - target.resourceTreeModel._frameAttached('42', 0); - target.runtimeModel = target.model(SDK.RuntimeModel); - target.debuggerModel = new SourcesTestRunner.DebuggerModelMock(target); - target._modelByConstructor.set(SDK.DebuggerModel, target.debuggerModel); - SourcesTestRunner.testTargetManager.modelAdded(target, SDK.DebuggerModel, target.debuggerModel); - return target; -}; - -SourcesTestRunner.uiSourceCodes = {}; - -SourcesTestRunner.initializeDefaultMappingOnTarget = function(target) { - var defaultMapping = { - rawLocationToUILocation: function(rawLocation) { - return null; - }, - - uiLocationToRawLocation: function(uiSourceCode, lineNumber) { - if (!SourcesTestRunner.uiSourceCodes[uiSourceCode.url()]) - return null; - - return new SDK.DebuggerModel.Location(target.debuggerModel, uiSourceCode.url(), lineNumber, 0); - }, - - isIdentity: function() { - return true; - } - }; - - target.defaultMapping = defaultMapping; -}; - -SourcesTestRunner.DebuggerModelMock = class extends SDK.SDKModel { - sourceMapManager() { - return this._sourceMapManager; - } - - constructor(target) { - super(target); - this._sourceMapManager = new SDK.SourceMapManager(); - this._target = target; - this._breakpointResolvedEventTarget = new Common.Object(); - this._scripts = {}; - this._breakpoints = {}; - this._debuggerWorkspaceBinding = SourcesTestRunner.testDebuggerWorkspaceBinding; - } - - target() { - return this._target; - } - - runtimeModel() { - return this._target.runtimeModel; - } - - setBeforePausedCallback(callback) { - } - - debuggerEnabled() { - return true; - } - - scriptsForSourceURL(url) { - var script = this._scriptForURL(url); - return (script ? [script] : []); - } - - _addScript(scriptId, url) { - var script = new SDK.Script(this, scriptId, url); - this._scripts[scriptId] = script; - var modelData = this._debuggerWorkspaceBinding._debuggerModelToData.get(this); - - modelData._defaultMapping._parsedScriptSource({data: script}); - - modelData._resourceMapping._parsedScriptSource({data: script}); - } - - _scriptForURL(url) { - for (var scriptId in this._scripts) { - var script = this._scripts[scriptId]; - - if (script.sourceURL === url) - return script; - } - } - - _scheduleSetBeakpointCallback(breakpointId, locations) { - setTimeout(innerCallback.bind(this), 0); - - function innerCallback() { - if (window.setBreakpointCallback) { - var savedCallback = window.setBreakpointCallback; - delete window.setBreakpointCallback; - savedCallback(); - } - } - } - - createRawLocation(script, line, column) { - return new SDK.DebuggerModel.Location(this, script.scriptId, line, column); - } - - createRawLocationByURL(url, line, column) { - var script = this._scriptForURL(url); - - if (!script) - return null; - - return new SDK.DebuggerModel.Location(this, script.scriptId, line, column); - } - - setBreakpointByURL(url, lineNumber, columnNumber, condition) { - TestRunner.addResult(' debuggerModel.setBreakpoint(' + [url, lineNumber, condition].join(':') + ')'); - var breakpointId = url + ':' + lineNumber; - - if (this._breakpoints[breakpointId]) { - this._scheduleSetBeakpointCallback(null); - return {breakpointId: null, locations: []}; - } - - this._breakpoints[breakpointId] = true; - - if (lineNumber >= 2000) { - this._scheduleSetBeakpointCallback(breakpointId, []); - return {breakpointId: breakpointId, locations: []}; - } - - if (lineNumber >= 1000) { - var shiftedLocation = new SDK.DebuggerModel.Location(this, url, lineNumber + 10, columnNumber); - this._scheduleSetBeakpointCallback(breakpointId, [shiftedLocation]); - return {breakpointId: breakpointId, locations: [shiftedLocation]}; - } - - var locations = []; - var script = this._scriptForURL(url); - - if (script) { - var location = new SDK.DebuggerModel.Location(this, script.scriptId, lineNumber, 0); - locations.push(location); - } - - this._scheduleSetBeakpointCallback(breakpointId, locations); - return {breakpointId: breakpointId, locations: locations}; - } - - async removeBreakpoint(breakpointId) { - TestRunner.addResult(' debuggerModel.removeBreakpoint(' + breakpointId + ')'); - delete this._breakpoints[breakpointId]; - } - - setBreakpointsActive() { - } - - scriptForId(scriptId) { - return this._scripts[scriptId]; - } - - reset() { - TestRunner.addResult(' Resetting debugger.'); - this._scripts = {}; - this._debuggerWorkspaceBinding._reset(this); - } - - addBreakpointListener(breakpointId, listener, thisObject) { - this._breakpointResolvedEventTarget.addEventListener(breakpointId, listener, thisObject); - } - - removeBreakpointListener(breakpointId, listener, thisObject) { - this._breakpointResolvedEventTarget.removeEventListener(breakpointId, listener, thisObject); - } - - _breakpointResolved(breakpointId, location) { - this._breakpointResolvedEventTarget.dispatchEventToListeners(breakpointId, location); - } -}; - -SourcesTestRunner.setupLiveLocationSniffers = function() { - TestRunner.addSniffer(Bindings.DebuggerWorkspaceBinding.prototype, 'createLiveLocation', function(rawLocation) { - TestRunner.addResult(' Location created: ' + rawLocation.scriptId + ':' + rawLocation.lineNumber); - }, true); - - TestRunner.addSniffer(Bindings.DebuggerWorkspaceBinding.Location.prototype, 'dispose', function() { - TestRunner.addResult(' Location disposed: ' + this._rawLocation.scriptId + ':' + this._rawLocation.lineNumber); - }, true); -}; - -SourcesTestRunner.addScript = function(target, breakpointManager, url) { - target.debuggerModel._addScript(url, url); - TestRunner.addResult(' Adding script: ' + url); -}; - -SourcesTestRunner.addUISourceCode = function(target, breakpointManager, url, doNotSetSourceMapping, doNotAddScript) { - if (!doNotAddScript) - SourcesTestRunner.addScript(target, breakpointManager, url); - - TestRunner.addResult(' Adding UISourceCode: ' + url); - var resourceMappingModelInfo = resourceMappingModelInfoForTarget(target); - - if (resourceMappingModelInfo._bindings.has(url)) { - resourceMappingModelInfo._bindings.get(url).dispose(); - resourceMappingModelInfo._bindings.delete(url); - } - - var resource = - new SDK.Resource(target, null, url, url, '', '', Common.resourceTypes.Document, 'text/html', null, null); - - resourceMappingModelInfo._resourceAdded({data: resource}); - - uiSourceCode = SourcesTestRunner.testWorkspace.uiSourceCodeForURL(url); - SourcesTestRunner.uiSourceCodes[url] = uiSourceCode; - - if (!doNotSetSourceMapping) - breakpointManager._debuggerWorkspaceBinding.updateLocations(target.debuggerModel.scriptForId(url)); - - - return uiSourceCode; -}; - -SourcesTestRunner.createBreakpointManager = function(targetManager, debuggerWorkspaceBinding, persistentBreakpoints) { - SourcesTestRunner._pendingBreakpointUpdates = 0; - TestRunner.addSniffer( - Bindings.BreakpointManager.ModelBreakpoint.prototype, '_updateInDebugger', updateInDebugger, true); - TestRunner.addSniffer( - Bindings.BreakpointManager.ModelBreakpoint.prototype, '_didUpdateInDebugger', didUpdateInDebugger, true); - - function updateInDebugger() { - SourcesTestRunner._pendingBreakpointUpdates++; - } - - function didUpdateInDebugger() { - SourcesTestRunner._pendingBreakpointUpdates--; - SourcesTestRunner._notifyAfterBreakpointUpdate(); - } - - persistentBreakpoints = persistentBreakpoints || []; - - var setting = { - get: function() { - return persistentBreakpoints; - }, - - set: function(breakpoints) { - persistentBreakpoints = breakpoints; - } - }; - - function breakpointAdded(event) { - var breakpoint = event.data.breakpoint; - var uiLocation = event.data.uiLocation; - - TestRunner.addResult(' breakpointAdded(' + [ - uiLocation.uiSourceCode.url(), uiLocation.lineNumber, uiLocation.columnNumber, breakpoint.condition(), - breakpoint.enabled() - ].join(', ') + ')'); - } - - function breakpointRemoved(event) { - var uiLocation = event.data.uiLocation; - - TestRunner.addResult(' breakpointRemoved(' + [ - uiLocation.uiSourceCode.url(), uiLocation.lineNumber, uiLocation.columnNumber - ].join(', ') + ')'); - } - - var targets = targetManager.targets(); - var mappingForManager; - - for (var i = 0; i < targets.length; ++i) { - SourcesTestRunner.initializeDefaultMappingOnTarget(targets[i]); - - if (!mappingForManager) - mappingForManager = targets[i].defaultMapping; - } - - var breakpointManager = new Bindings.BreakpointManager( - setting, debuggerWorkspaceBinding._workspace, targetManager, debuggerWorkspaceBinding); - breakpointManager.defaultMapping = mappingForManager; - breakpointManager.addEventListener(Bindings.BreakpointManager.Events.BreakpointAdded, breakpointAdded); - breakpointManager.addEventListener(Bindings.BreakpointManager.Events.BreakpointRemoved, breakpointRemoved); - TestRunner.addResult(' Created breakpoints manager'); - SourcesTestRunner.dumpBreakpointStorage(breakpointManager); - return breakpointManager; -}; - -SourcesTestRunner.BreakpointManager.setBreakpoint = function( - breakpointManager, uiSourceCode, lineNumber, columnNumber, condition, enabled, setBreakpointCallback) { - TestRunner.addResult( - ' Setting breakpoint at ' + uiSourceCode.url() + ':' + lineNumber + ':' + columnNumber + ' enabled:' + enabled + - ' condition:' + condition); - - if (setBreakpointCallback) - window.setBreakpointCallback = setBreakpointCallback; - return breakpointManager.setBreakpoint(uiSourceCode, lineNumber, columnNumber, condition, enabled); -}; - -SourcesTestRunner.BreakpointManager.removeBreakpoint = function( - breakpointManager, uiSourceCode, lineNumber, columnNumber) { - TestRunner.addResult(' Removing breakpoint at ' + uiSourceCode.url() + ':' + lineNumber + ':' + columnNumber); - breakpointManager.findBreakpoint(uiSourceCode, lineNumber, columnNumber).remove(); -}; - -SourcesTestRunner.dumpBreakpointStorage = function(breakpointManager) { - var breakpoints = breakpointManager._storage._setting.get(); - TestRunner.addResult(' Dumping Storage'); - - for (var i = 0; i < breakpoints.length; ++i) { - TestRunner.addResult( - ' ' + breakpoints[i].url + ':' + breakpoints[i].lineNumber + ' enabled:' + breakpoints[i].enabled + - ' condition:' + breakpoints[i].condition); - } -}; - -SourcesTestRunner.dumpBreakpointLocations = function(breakpointManager) { - var allBreakpointLocations = breakpointManager.allBreakpointLocations(); - TestRunner.addResult(' Dumping Breakpoint Locations'); - var lastUISourceCode = null; - var locations = []; - - function dumpLocations(uiSourceCode, locations) { - locations.sort(function(a, b) { - return a.lineNumber - b.lineNumber; - }); - - TestRunner.addResult(' UISourceCode (url=\'' + uiSourceCode.url() + '\', uri=\'' + uiSourceCode.url() + '\')'); - - for (var i = 0; i < locations.length; ++i) - TestRunner.addResult(' Location: (' + locations[i].lineNumber + ', ' + locations[i].columnNumber + ')'); - } - - for (var i = 0; i < allBreakpointLocations.length; ++i) { - var uiLocation = allBreakpointLocations[i].uiLocation; - var uiSourceCode = uiLocation.uiSourceCode; - - if (lastUISourceCode && lastUISourceCode !== uiSourceCode) { - dumpLocations(uiSourceCode, locations); - locations = []; - } - - lastUISourceCode = uiSourceCode; - locations.push(uiLocation); - } - - if (lastUISourceCode) - dumpLocations(lastUISourceCode, locations); -}; - -SourcesTestRunner.resetBreakpointManager = function(breakpointManager, next) { - TestRunner.addResult(' Resetting breakpoint manager'); - breakpointManager.removeAllBreakpoints(); - breakpointManager.removeProvisionalBreakpointsForTest(); - SourcesTestRunner.uiSourceCodes = {}; - next(); -}; - -SourcesTestRunner.runAfterPendingBreakpointUpdates = function(breakpointManager, callback) { - SourcesTestRunner._pendingBreakpointUpdatesCallback = callback; - SourcesTestRunner._notifyAfterBreakpointUpdate(); -}; - -SourcesTestRunner._notifyAfterBreakpointUpdate = function() { - if (!SourcesTestRunner._pendingBreakpointUpdates && SourcesTestRunner._pendingBreakpointUpdatesCallback) { - var callback = SourcesTestRunner._pendingBreakpointUpdatesCallback; - delete SourcesTestRunner._pendingBreakpointUpdatesCallback; - callback(); - } -}; - -SourcesTestRunner.finishBreakpointTest = function(breakpointManager, next) { - SourcesTestRunner.runAfterPendingBreakpointUpdates(breakpointManager, dump); - - function dump() { - SourcesTestRunner.dumpBreakpointLocations(breakpointManager); - SourcesTestRunner.dumpBreakpointStorage(breakpointManager); - SourcesTestRunner.runAfterPendingBreakpointUpdates(breakpointManager, reset); - } - - function reset() { - SourcesTestRunner.resetBreakpointManager(breakpointManager, didReset); - } - - function didReset() { - SourcesTestRunner.runAfterPendingBreakpointUpdates(breakpointManager, finish); - } - - function finish() { - SourcesTestRunner.dumpBreakpointLocations(breakpointManager); - next(); - } -};
diff --git a/third_party/WebKit/Source/devtools/front_end/sources_test_runner/module.json b/third_party/WebKit/Source/devtools/front_end/sources_test_runner/module.json index 2002a95..76049ac 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources_test_runner/module.json +++ b/third_party/WebKit/Source/devtools/front_end/sources_test_runner/module.json
@@ -12,8 +12,7 @@ "LiveEditTestRunner.js", "SearchTestRunner.js", "EditorTestRunner.js", - "AutocompleteTestRunner.js", - "BreakpointManagerTestRunner.js" + "AutocompleteTestRunner.js" ], "skip_compilation": [ "DebuggerTestRunner.js", @@ -21,7 +20,6 @@ "SearchTestRunner.js", "SourcesTestRunner.js", "EditorTestRunner.js", - "AutocompleteTestRunner.js", - "BreakpointManagerTestRunner.js" + "AutocompleteTestRunner.js" ] }
diff --git a/third_party/WebKit/Source/devtools/front_end/test_runner/TestRunner.js b/third_party/WebKit/Source/devtools/front_end/test_runner/TestRunner.js index 822057c..ba9fbb2 100644 --- a/third_party/WebKit/Source/devtools/front_end/test_runner/TestRunner.js +++ b/third_party/WebKit/Source/devtools/front_end/test_runner/TestRunner.js
@@ -998,7 +998,8 @@ TestRunner._handlePageLoaded(); }; -TestRunner._handlePageLoaded = function() { +TestRunner._handlePageLoaded = async function() { + await TestRunner.waitForExecutionContext(/** @type {!SDK.RuntimeModel} */ (TestRunner.runtimeModel)); if (TestRunner._pageLoadedCallback) { var callback = TestRunner._pageLoadedCallback; delete TestRunner._pageLoadedCallback;
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBFactory.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBFactory.cpp index 3eadd5d..29c2165b 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBFactory.cpp +++ b/third_party/WebKit/Source/modules/indexeddb/IDBFactory.cpp
@@ -44,6 +44,7 @@ #include "platform/Histogram.h" #include "platform/weborigin/SecurityOrigin.h" #include "public/platform/Platform.h" +#include "public/platform/TaskType.h" #include "public/platform/WebSecurityOrigin.h" #include "public/platform/modules/indexeddb/WebIDBDatabaseCallbacks.h" #include "public/platform/modules/indexeddb/WebIDBFactory.h" @@ -97,7 +98,9 @@ Platform::Current()->IdbFactory()->GetDatabaseNames( request->CreateWebCallbacks().release(), WebSecurityOrigin( - ExecutionContext::From(script_state)->GetSecurityOrigin())); + ExecutionContext::From(script_state)->GetSecurityOrigin()), + ExecutionContext::From(script_state) + ->GetTaskRunner(TaskType::kInternalIndexedDB)); return request; } @@ -152,7 +155,9 @@ name, version, transaction_id, request->CreateWebCallbacks().release(), database_callbacks->CreateWebCallbacks().release(), WebSecurityOrigin( - ExecutionContext::From(script_state)->GetSecurityOrigin())); + ExecutionContext::From(script_state)->GetSecurityOrigin()), + ExecutionContext::From(script_state) + ->GetTaskRunner(TaskType::kInternalIndexedDB)); return request; } @@ -217,7 +222,9 @@ name, request->CreateWebCallbacks().release(), WebSecurityOrigin( ExecutionContext::From(script_state)->GetSecurityOrigin()), - force_close); + force_close, + ExecutionContext::From(script_state) + ->GetTaskRunner(TaskType::kInternalIndexedDB)); return request; }
diff --git a/third_party/WebKit/Source/platform/blob/BlobBytesProvider.cpp b/third_party/WebKit/Source/platform/blob/BlobBytesProvider.cpp index 71ab705..b0b288d 100644 --- a/third_party/WebKit/Source/platform/blob/BlobBytesProvider.cpp +++ b/third_party/WebKit/Source/platform/blob/BlobBytesProvider.cpp
@@ -106,9 +106,15 @@ } // namespace -BlobBytesProvider::BlobBytesProvider(scoped_refptr<RawData> data) { +constexpr size_t BlobBytesProvider::kMaxConsolidatedItemSizeInBytes; + +BlobBytesProvider::BlobBytesProvider() { IncreaseChildProcessRefCount(); - data_.push_back(std::move(data)); +} + +BlobBytesProvider::BlobBytesProvider(scoped_refptr<RawData> data) + : BlobBytesProvider() { + AppendData(std::move(data)); } BlobBytesProvider::~BlobBytesProvider() { @@ -119,6 +125,14 @@ data_.push_back(std::move(data)); } +void BlobBytesProvider::AppendData(base::span<const char> data) { + if (data_.IsEmpty() || data_.back()->length() + data.length() > + kMaxConsolidatedItemSizeInBytes) { + data_.push_back(RawData::Create()); + } + data_.back()->MutableData()->Append(data.data(), data.length()); +} + void BlobBytesProvider::RequestAsReply(RequestAsReplyCallback callback) { // TODO(mek): Once better metrics are created we could experiment with ways // to reduce the number of copies of data that are made here.
diff --git a/third_party/WebKit/Source/platform/blob/BlobBytesProvider.h b/third_party/WebKit/Source/platform/blob/BlobBytesProvider.h index e150eee..c1d74b8 100644 --- a/third_party/WebKit/Source/platform/blob/BlobBytesProvider.h +++ b/third_party/WebKit/Source/platform/blob/BlobBytesProvider.h
@@ -19,10 +19,16 @@ // thread that is allowed to do File IO. class PLATFORM_EXPORT BlobBytesProvider : public mojom::blink::BytesProvider { public: + // All consecutive items that are accumulate to < this number will have the + // data appended to the same item. + static constexpr size_t kMaxConsolidatedItemSizeInBytes = 15 * 1024; + + BlobBytesProvider(); explicit BlobBytesProvider(scoped_refptr<RawData>); ~BlobBytesProvider() override; void AppendData(scoped_refptr<RawData>); + void AppendData(base::span<const char>); // BytesProvider implementation: void RequestAsReply(RequestAsReplyCallback) override; @@ -34,6 +40,8 @@ RequestAsFileCallback) override; private: + FRIEND_TEST_ALL_PREFIXES(BlobBytesProviderTest, Consolidation); + Vector<scoped_refptr<RawData>> data_; };
diff --git a/third_party/WebKit/Source/platform/blob/BlobBytesProviderTest.cpp b/third_party/WebKit/Source/platform/blob/BlobBytesProviderTest.cpp index 8044064..e369c77 100644 --- a/third_party/WebKit/Source/platform/blob/BlobBytesProviderTest.cpp +++ b/third_party/WebKit/Source/platform/blob/BlobBytesProviderTest.cpp
@@ -15,7 +15,6 @@ #include "testing/gtest/include/gtest/gtest.h" namespace blink { -namespace { class BlobBytesProviderTest : public ::testing::Test { public: @@ -53,6 +52,28 @@ Vector<uint8_t> combined_bytes_; }; +TEST_F(BlobBytesProviderTest, Consolidation) { + BlobBytesProvider data; + data.AppendData(base::make_span("abc", 3)); + data.AppendData(base::make_span("def", 3)); + data.AppendData(base::make_span("ps1", 3)); + data.AppendData(base::make_span("ps2", 3)); + + EXPECT_EQ(1u, data.data_.size()); + EXPECT_EQ(12u, data.data_[0]->length()); + EXPECT_EQ(0, memcmp(data.data_[0]->data(), "abcdefps1ps2", 12)); + + auto large_data = std::make_unique<char[]>( + BlobBytesProvider::kMaxConsolidatedItemSizeInBytes); + data.AppendData(base::make_span( + large_data.get(), BlobBytesProvider::kMaxConsolidatedItemSizeInBytes)); + + EXPECT_EQ(2u, data.data_.size()); + EXPECT_EQ(12u, data.data_[0]->length()); + EXPECT_EQ(BlobBytesProvider::kMaxConsolidatedItemSizeInBytes, + data.data_[1]->length()); +} + TEST_F(BlobBytesProviderTest, RequestAsReply) { auto provider = std::make_unique<BlobBytesProvider>(test_data1_); Vector<uint8_t> received_bytes; @@ -73,6 +94,8 @@ EXPECT_EQ(combined_bytes_, received_bytes); } +namespace { + struct FileTestData { uint64_t offset; uint64_t size;
diff --git a/third_party/WebKit/Source/platform/blob/BlobData.cpp b/third_party/WebKit/Source/platform/blob/BlobData.cpp index db699f57..b39b669 100644 --- a/third_party/WebKit/Source/platform/blob/BlobData.cpp +++ b/third_party/WebKit/Source/platform/blob/BlobData.cpp
@@ -69,10 +69,6 @@ namespace { -// All consecutive items that are accumulate to < this number will have the -// data appended to the same item. -static const size_t kMaxConsolidatedItemSizeInBytes = 15 * 1024; - // http://dev.w3.org/2006/webapi/FileAPI/#constructorBlob bool IsValidBlobType(const String& type) { for (unsigned i = 0; i < type.length(); ++i) { @@ -108,15 +104,10 @@ } // namespace -const long long BlobDataItem::kToEndOfFile = -1; +constexpr long long BlobData::kToEndOfFile; RawData::RawData() = default; -void BlobDataItem::DetachFromCurrentThread() { - path = path.IsolatedCopy(); - file_system_url = file_system_url.Copy(); -} - std::unique_ptr<BlobData> BlobData::Create() { return WTF::WrapUnique( new BlobData(FileCompositionStatus::NO_UNKNOWN_SIZE_FILES)); @@ -126,7 +117,8 @@ const String& path) { std::unique_ptr<BlobData> data = WTF::WrapUnique( new BlobData(FileCompositionStatus::SINGLE_UNKNOWN_SIZE_FILE)); - data->items_.push_back(BlobDataItem(path)); + data->elements_.push_back(DataElement::NewFile(DataElementFile::New( + WebStringToFilePath(path), 0, BlobData::kToEndOfFile, WTF::Time()))); return data; } @@ -135,8 +127,9 @@ double expected_modification_time) { std::unique_ptr<BlobData> data = WTF::WrapUnique( new BlobData(FileCompositionStatus::SINGLE_UNKNOWN_SIZE_FILE)); - data->items_.push_back(BlobDataItem(path, 0, BlobDataItem::kToEndOfFile, - expected_modification_time)); + data->elements_.push_back(DataElement::NewFile(DataElementFile::New( + WebStringToFilePath(path), 0, BlobData::kToEndOfFile, + WTF::Time::FromDoubleT(expected_modification_time)))); return data; } @@ -145,16 +138,21 @@ double expected_modification_time) { std::unique_ptr<BlobData> data = WTF::WrapUnique( new BlobData(FileCompositionStatus::SINGLE_UNKNOWN_SIZE_FILE)); - data->items_.push_back(BlobDataItem(file_system_url, 0, - BlobDataItem::kToEndOfFile, - expected_modification_time)); + data->elements_.push_back( + DataElement::NewFileFilesystem(DataElementFilesystemURL::New( + file_system_url, 0, BlobData::kToEndOfFile, + WTF::Time::FromDoubleT(expected_modification_time)))); return data; } void BlobData::DetachFromCurrentThread() { content_type_ = content_type_.IsolatedCopy(); - for (size_t i = 0; i < items_.size(); ++i) - items_.at(i).DetachFromCurrentThread(); + for (auto& element : elements_) { + if (element->is_file_filesystem()) { + auto& file_element = element->get_file_filesystem(); + file_element->url = file_element->url.Copy(); + } + } } void BlobData::SetContentType(const String& content_type) { @@ -165,9 +163,7 @@ } void BlobData::AppendData(scoped_refptr<RawData> data) { - DCHECK_EQ(file_composition_, FileCompositionStatus::NO_UNKNOWN_SIZE_FILES) - << "Blobs with a unknown-size file cannot have other items."; - items_.push_back(BlobDataItem(std::move(data))); + AppendDataInternal(base::make_span(data->data(), data->length()), data); } void BlobData::AppendFile(const String& path, @@ -176,13 +172,17 @@ double expected_modification_time) { DCHECK_EQ(file_composition_, FileCompositionStatus::NO_UNKNOWN_SIZE_FILES) << "Blobs with a unknown-size file cannot have other items."; - DCHECK_NE(length, BlobDataItem::kToEndOfFile) + DCHECK_NE(length, BlobData::kToEndOfFile) << "It is illegal to append file items that have an unknown size. To " "create a blob with a single file with unknown size, use " "BlobData::createForFileWithUnknownSize. Otherwise please provide the " "file size."; - items_.push_back( - BlobDataItem(path, offset, length, expected_modification_time)); + // Skip zero-byte items, as they don't matter for the contents of the blob. + if (length == 0) + return; + elements_.push_back(DataElement::NewFile(DataElementFile::New( + WebStringToFilePath(path), offset, length, + WTF::Time::FromDoubleT(expected_modification_time)))); } void BlobData::AppendBlob(scoped_refptr<BlobDataHandle> data_handle, @@ -192,7 +192,11 @@ << "Blobs with a unknown-size file cannot have other items."; DCHECK(!data_handle->IsSingleUnknownSizeFile()) << "It is illegal to append an unknown size file blob."; - items_.push_back(BlobDataItem(std::move(data_handle), offset, length)); + // Skip zero-byte items, as they don't matter for the contents of the blob. + if (length == 0) + return; + elements_.push_back(DataElement::NewBlob(DataElementBlob::New( + data_handle->CloneBlobPtr().PassInterface(), offset, length))); } void BlobData::AppendFileSystemURL(const KURL& url, @@ -201,8 +205,13 @@ double expected_modification_time) { DCHECK_EQ(file_composition_, FileCompositionStatus::NO_UNKNOWN_SIZE_FILES) << "Blobs with a unknown-size file cannot have other items."; - items_.push_back( - BlobDataItem(url, offset, length, expected_modification_time)); + // Skip zero-byte items, as they don't matter for the contents of the blob. + if (length == 0) + return; + elements_.push_back( + DataElement::NewFileFilesystem(DataElementFilesystemURL::New( + url, offset, length, + WTF::Time::FromDoubleT(expected_modification_time)))); } void BlobData::AppendText(const String& text, @@ -211,73 +220,102 @@ << "Blobs with a unknown-size file cannot have other items."; CString utf8_text = UTF8Encoding().Encode(text, WTF::kEntitiesForUnencodables); - scoped_refptr<RawData> data = nullptr; - Vector<char>* buffer; - if (CanConsolidateData(text.length())) { - buffer = items_.back().data->MutableData(); - } else { - data = RawData::Create(); - buffer = data->MutableData(); - } if (do_normalize_line_endings_to_native) { - NormalizeLineEndingsToNative(utf8_text, *buffer); + if (utf8_text.length() > + BlobBytesProvider::kMaxConsolidatedItemSizeInBytes) { + auto raw_data = RawData::Create(); + NormalizeLineEndingsToNative(utf8_text, *raw_data->MutableData()); + AppendDataInternal(base::make_span(raw_data->data(), raw_data->length()), + raw_data); + } else { + Vector<char> buffer; + NormalizeLineEndingsToNative(utf8_text, buffer); + AppendDataInternal(base::make_span(buffer)); + } } else { - buffer->Append(utf8_text.data(), utf8_text.length()); + AppendDataInternal(base::make_span(utf8_text.data(), utf8_text.length())); } - - if (data) - items_.push_back(BlobDataItem(std::move(data))); } void BlobData::AppendBytes(const void* bytes, size_t length) { - DCHECK_EQ(file_composition_, FileCompositionStatus::NO_UNKNOWN_SIZE_FILES) - << "Blobs with a unknown-size file cannot have other items."; - if (CanConsolidateData(length)) { - items_.back().data->MutableData()->Append(static_cast<const char*>(bytes), - length); - return; - } - scoped_refptr<RawData> data = RawData::Create(); - Vector<char>* buffer = data->MutableData(); - buffer->Append(static_cast<const char*>(bytes), length); - items_.push_back(BlobDataItem(std::move(data))); + AppendDataInternal( + base::make_span(reinterpret_cast<const char*>(bytes), length)); } -long long BlobData::length() const { - long long length = 0; +uint64_t BlobData::length() const { + uint64_t length = 0; - for (Vector<BlobDataItem>::const_iterator it = items_.begin(); - it != items_.end(); ++it) { - const BlobDataItem& item = *it; - if (item.length != BlobDataItem::kToEndOfFile) { - DCHECK_GE(item.length, 0); - length += item.length; - continue; - } - - switch (item.type) { - case BlobDataItem::kData: - length += item.data->length(); + for (const auto& element : elements_) { + switch (element->which()) { + case DataElement::Tag::BYTES: + length += element->get_bytes()->length; break; - case BlobDataItem::kFile: - case BlobDataItem::kBlob: - case BlobDataItem::kFileSystemURL: - return BlobDataItem::kToEndOfFile; + case DataElement::Tag::FILE: + length += element->get_file()->length; + break; + case DataElement::Tag::FILE_FILESYSTEM: + length += element->get_file_filesystem()->length; + break; + case DataElement::Tag::BLOB: + length += element->get_blob()->length; + break; } } return length; } -bool BlobData::CanConsolidateData(size_t length) { - if (items_.IsEmpty()) - return false; - BlobDataItem& last_item = items_.back(); - if (last_item.type != BlobDataItem::kData) - return false; - if (last_item.data->length() + length > kMaxConsolidatedItemSizeInBytes) - return false; - return true; +void BlobData::AppendDataInternal(base::span<const char> data, + scoped_refptr<RawData> raw_data) { + DCHECK_EQ(file_composition_, FileCompositionStatus::NO_UNKNOWN_SIZE_FILES) + << "Blobs with a unknown-size file cannot have other items."; + // Skip zero-byte items, as they don't matter for the contents of the blob. + if (data.length() == 0) + return; + bool should_embed_bytes = current_memory_population_ + data.length() <= + DataElementBytes::kMaximumEmbeddedDataSize; + if (!elements_.IsEmpty() && elements_.back()->is_bytes()) { + // Append bytes to previous element. + DCHECK(last_bytes_provider_); + const auto& bytes_element = elements_.back()->get_bytes(); + bytes_element->length += data.length(); + if (should_embed_bytes && bytes_element->embedded_data) { + bytes_element->embedded_data->Append(data.data(), data.length()); + current_memory_population_ += data.length(); + } else if (bytes_element->embedded_data) { + current_memory_population_ -= bytes_element->embedded_data->size(); + bytes_element->embedded_data = WTF::nullopt; + } + } else { + BytesProviderPtrInfo bytes_provider_info; + auto provider = std::make_unique<BlobBytesProvider>(); + last_bytes_provider_ = provider.get(); + + scoped_refptr<WebTaskRunner> file_runner = + Platform::Current()->FileTaskRunner(); + if (file_runner) { + // TODO(mek): Considering binding BytesProvider on the IO thread + // instead, only using the File thread for actual file operations. + PostCrossThreadTask( + *file_runner, FROM_HERE, + CrossThreadBind(&BindBytesProvider, WTF::Passed(std::move(provider)), + WTF::Passed(MakeRequest(&bytes_provider_info)))); + } else { + BindBytesProvider(std::move(provider), MakeRequest(&bytes_provider_info)); + } + auto bytes_element = DataElementBytes::New(data.length(), WTF::nullopt, + std::move(bytes_provider_info)); + if (should_embed_bytes) { + bytes_element->embedded_data = Vector<uint8_t>(); + bytes_element->embedded_data->Append(data.data(), data.length()); + current_memory_population_ += data.length(); + } + elements_.push_back(DataElement::NewBytes(std::move(bytes_element))); + } + if (raw_data) + last_bytes_provider_->AppendData(std::move(raw_data)); + else + last_bytes_provider_->AppendData(std::move(data)); } BlobDataHandle::BlobDataHandle() @@ -294,105 +332,10 @@ size_(size), is_single_unknown_size_file_(data->IsSingleUnknownSizeFile()) { TRACE_EVENT0("Blob", "Registry::RegisterBlob"); - - size_t current_memory_population = 0; - Vector<DataElementPtr> elements; - const DataElementPtr null_element = nullptr; - BlobBytesProvider* last_bytes_provider = nullptr; - scoped_refptr<WebTaskRunner> file_runner = - Platform::Current()->FileTaskRunner(); - - // TODO(mek): When the mojo code path is the default BlobData should - // directly create mojom::DataElements rather than BlobDataItems, - // eliminating the need for this loop. - for (const auto& item : data->Items()) { - // Skip zero-byte elements, as they don't matter for the contents of - // the blob. - if (item.length == 0) - continue; - switch (item.type) { - case BlobDataItem::kData: { - // kData elements don't set item.length, so separately check for zero - // byte kData elements. - if (item.data->length() == 0) - continue; - // Since blobs are often constructed with arrays with single bytes, - // consolidate all adjacent memory blob items into one. This should - // massively reduce the overhead of describing all these byte - // elements. - const DataElementPtr& last_element = - elements.IsEmpty() ? null_element : elements.back(); - bool should_embed_bytes = - current_memory_population + item.data->length() <= - DataElementBytes::kMaximumEmbeddedDataSize; - bool last_element_is_bytes = last_element && last_element->is_bytes(); - if (last_element_is_bytes) { - // Append bytes to previous element. - DCHECK(last_bytes_provider); - const auto& bytes_element = last_element->get_bytes(); - bytes_element->length += item.data->length(); - if (should_embed_bytes && bytes_element->embedded_data) { - bytes_element->embedded_data->Append(item.data->data(), - item.data->length()); - current_memory_population += item.data->length(); - } else if (bytes_element->embedded_data) { - current_memory_population -= bytes_element->embedded_data->size(); - bytes_element->embedded_data = WTF::nullopt; - } - last_bytes_provider->AppendData(item.data); - } else { - BytesProviderPtrInfo bytes_provider_info; - auto provider = std::make_unique<BlobBytesProvider>(item.data); - last_bytes_provider = provider.get(); - if (file_runner) { - // TODO(mek): Considering binding BytesProvider on the IO thread - // instead, only using the File thread for actual file operations. - PostCrossThreadTask( - *file_runner, FROM_HERE, - CrossThreadBind( - &BindBytesProvider, WTF::Passed(std::move(provider)), - WTF::Passed(MakeRequest(&bytes_provider_info)))); - } else { - BindBytesProvider(std::move(provider), - MakeRequest(&bytes_provider_info)); - } - DataElementBytesPtr bytes_element = - DataElementBytes::New(item.data->length(), WTF::nullopt, - std::move(bytes_provider_info)); - if (should_embed_bytes) { - bytes_element->embedded_data = Vector<uint8_t>(); - bytes_element->embedded_data->Append(item.data->data(), - item.data->length()); - current_memory_population += item.data->length(); - } - elements.push_back(DataElement::NewBytes(std::move(bytes_element))); - } - break; - } - case BlobDataItem::kFile: - elements.push_back(DataElement::NewFile(DataElementFile::New( - WebStringToFilePath(item.path), item.offset, item.length, - WTF::Time::FromDoubleT(item.expected_modification_time)))); - break; - case BlobDataItem::kFileSystemURL: - elements.push_back( - DataElement::NewFileFilesystem(DataElementFilesystemURL::New( - item.file_system_url, item.offset, item.length, - WTF::Time::FromDoubleT(item.expected_modification_time)))); - break; - case BlobDataItem::kBlob: { - elements.push_back(DataElement::NewBlob(DataElementBlob::New( - item.blob_data_handle->CloneBlobPtr().PassInterface(), item.offset, - item.length))); - break; - } - } - } - SCOPED_BLINK_UMA_HISTOGRAM_TIMER_THREAD_SAFE("Storage.Blob.RegisterBlobTime"); GetThreadSpecificRegistry()->Register(MakeRequest(&blob_info_), uuid_, type_.IsNull() ? "" : type_, "", - std::move(elements)); + data->ReleaseElements()); } BlobDataHandle::BlobDataHandle(const String& uuid,
diff --git a/third_party/WebKit/Source/platform/blob/BlobData.h b/third_party/WebKit/Source/platform/blob/BlobData.h index 0b13c67..be5a2e0 100644 --- a/third_party/WebKit/Source/platform/blob/BlobData.h +++ b/third_party/WebKit/Source/platform/blob/BlobData.h
@@ -44,6 +44,7 @@ namespace blink { +class BlobBytesProvider; class BlobDataHandle; class PLATFORM_EXPORT RawData : public ThreadSafeRefCounted<RawData> { @@ -62,86 +63,12 @@ Vector<char> data_; }; -struct PLATFORM_EXPORT BlobDataItem { - DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); - static const long long kToEndOfFile; - - // Default constructor. - BlobDataItem() - : type(kData), - offset(0), - length(kToEndOfFile), - expected_modification_time(InvalidFileTime()) {} - - // Constructor for String type (complete string). - explicit BlobDataItem(scoped_refptr<RawData> data) - : type(kData), - data(std::move(data)), - offset(0), - length(kToEndOfFile), - expected_modification_time(InvalidFileTime()) {} - - // Constructor for File type (complete file). - explicit BlobDataItem(const String& path) - : type(kFile), - path(path), - offset(0), - length(kToEndOfFile), - expected_modification_time(InvalidFileTime()) {} - - // Constructor for File type (partial file). - BlobDataItem(const String& path, - long long offset, - long long length, - double expected_modification_time) - : type(kFile), - path(path), - offset(offset), - length(length), - expected_modification_time(expected_modification_time) {} - - // Constructor for Blob type. - BlobDataItem(scoped_refptr<BlobDataHandle> blob_data_handle, - long long offset, - long long length) - : type(kBlob), - blob_data_handle(std::move(blob_data_handle)), - offset(offset), - length(length), - expected_modification_time(InvalidFileTime()) {} - - // Constructor for FileSystem file type. - BlobDataItem(const KURL& file_system_url, - long long offset, - long long length, - double expected_modification_time) - : type(kFileSystemURL), - file_system_url(file_system_url), - offset(offset), - length(length), - expected_modification_time(expected_modification_time) {} - - // Detaches from current thread so that it can be passed to another thread. - void DetachFromCurrentThread(); - - const enum { kData, kFile, kBlob, kFileSystemURL } type; - - scoped_refptr<RawData> data; // For Data type. - String path; // For File type. - KURL file_system_url; // For FileSystemURL type. - scoped_refptr<BlobDataHandle> blob_data_handle; // For Blob type. - - long long offset; - long long length; - double expected_modification_time; -}; - -typedef Vector<BlobDataItem> BlobDataItemList; - class PLATFORM_EXPORT BlobData { USING_FAST_MALLOC(BlobData); public: + static constexpr long long kToEndOfFile = -1; + static std::unique_ptr<BlobData> Create(); // Calling append* on objects returned by createFor___WithUnknownSize will @@ -162,7 +89,12 @@ const String& ContentType() const { return content_type_; } void SetContentType(const String&); - const BlobDataItemList& Items() const { return items_; } + const Vector<mojom::blink::DataElementPtr>& Elements() const { + return elements_; + } + Vector<mojom::blink::DataElementPtr> ReleaseElements() { + return std::move(elements_); + } void AppendBytes(const void*, size_t length); void AppendData(scoped_refptr<RawData>); @@ -185,15 +117,13 @@ // The value of the size property for a Blob who has this data. // BlobDataItem::toEndOfFile if the Blob has a file whose size was not yet // determined. - long long length() const; + uint64_t length() const; bool IsSingleUnknownSizeFile() const { return file_composition_ == FileCompositionStatus::SINGLE_UNKNOWN_SIZE_FILE; } private: - FRIEND_TEST_ALL_PREFIXES(BlobDataTest, Consolidation); - enum class FileCompositionStatus { SINGLE_UNKNOWN_SIZE_FILE, NO_UNKNOWN_SIZE_FILES @@ -202,11 +132,15 @@ explicit BlobData(FileCompositionStatus composition) : file_composition_(composition) {} - bool CanConsolidateData(size_t length); + void AppendDataInternal(base::span<const char> data, + scoped_refptr<RawData> = nullptr); String content_type_; FileCompositionStatus file_composition_; - BlobDataItemList items_; + + Vector<mojom::blink::DataElementPtr> elements_; + size_t current_memory_population_ = 0; + BlobBytesProvider* last_bytes_provider_ = nullptr; DISALLOW_COPY_AND_ASSIGN(BlobData); };
diff --git a/third_party/WebKit/Source/platform/blob/BlobDataTest.cpp b/third_party/WebKit/Source/platform/blob/BlobDataTest.cpp index 3e500f7..ed65e73 100644 --- a/third_party/WebKit/Source/platform/blob/BlobDataTest.cpp +++ b/third_party/WebKit/Source/platform/blob/BlobDataTest.cpp
@@ -11,6 +11,7 @@ #include "mojo/public/cpp/bindings/binding_set.h" #include "mojo/public/cpp/bindings/strong_binding.h" #include "platform/UUID.h" +#include "platform/blob/BlobBytesProvider.h" #include "platform/testing/TestingPlatformSupport.h" #include "platform/wtf/PtrUtil.h" #include "public/platform/FilePathConversion.h" @@ -35,31 +36,6 @@ using mojom::blink::DataElementPtr; namespace { -const size_t kMaxConsolidatedItemSizeInBytes = 15 * 1024; -} - -TEST(BlobDataTest, Consolidation) { - BlobData data(BlobData::FileCompositionStatus::NO_UNKNOWN_SIZE_FILES); - const char* text1 = "abc"; - const char* text2 = "def"; - data.AppendBytes(text1, 3u); - data.AppendBytes(text2, 3u); - data.AppendText("ps1", false); - data.AppendText("ps2", false); - - EXPECT_EQ(1u, data.items_.size()); - EXPECT_EQ(12u, data.items_[0].data->length()); - EXPECT_EQ(0, memcmp(data.items_[0].data->data(), "abcdefps1ps2", 12)); - - auto large_data = std::make_unique<char[]>(kMaxConsolidatedItemSizeInBytes); - data.AppendBytes(large_data.get(), kMaxConsolidatedItemSizeInBytes); - - EXPECT_EQ(2u, data.items_.size()); - EXPECT_EQ(12u, data.items_[0].data->length()); - EXPECT_EQ(kMaxConsolidatedItemSizeInBytes, data.items_[1].data->length()); -} - -namespace { class MockBlob : public Blob { public: @@ -197,10 +173,12 @@ for (size_t i = 0; i < large_test_data_.size(); ++i) large_test_data_[i] = i % 251; - ASSERT_LT(small_test_data_.size(), kMaxConsolidatedItemSizeInBytes); + ASSERT_LT(small_test_data_.size(), + BlobBytesProvider::kMaxConsolidatedItemSizeInBytes); ASSERT_LT(medium_test_data_.size(), DataElementBytes::kMaximumEmbeddedDataSize); - ASSERT_GT(medium_test_data_.size(), kMaxConsolidatedItemSizeInBytes); + ASSERT_GT(medium_test_data_.size(), + BlobBytesProvider::kMaxConsolidatedItemSizeInBytes); ASSERT_GT(large_test_data_.size(), DataElementBytes::kMaximumEmbeddedDataSize); @@ -398,7 +376,7 @@ std::unique_ptr<BlobData> data = BlobData::Create(); data->AppendBytes(medium_test_data_.data(), medium_test_data_.size()); data->AppendBytes(small_test_data_.data(), small_test_data_.size()); - EXPECT_EQ(2u, data->Items().size()); + EXPECT_EQ(1u, data->Elements().size()); Vector<uint8_t> expected_data = medium_test_data_; expected_data.AppendVector(small_test_data_); @@ -414,7 +392,7 @@ std::unique_ptr<BlobData> data = BlobData::Create(); data->AppendBytes(large_test_data_.data(), large_test_data_.size()); data->AppendBytes(small_test_data_.data(), small_test_data_.size()); - EXPECT_EQ(2u, data->Items().size()); + EXPECT_EQ(1u, data->Elements().size()); Vector<uint8_t> expected_data = large_test_data_; expected_data.AppendVector(small_test_data_); @@ -430,7 +408,7 @@ std::unique_ptr<BlobData> data = BlobData::Create(); data->AppendBytes(small_test_data_.data(), small_test_data_.size()); data->AppendBytes(large_test_data_.data(), large_test_data_.size()); - EXPECT_EQ(2u, data->Items().size()); + EXPECT_EQ(1u, data->Elements().size()); Vector<uint8_t> expected_data = small_test_data_; expected_data.AppendVector(large_test_data_);
diff --git a/third_party/WebKit/Source/platform/exported/WebCORS.cpp b/third_party/WebKit/Source/platform/exported/WebCORS.cpp index 33813fea..451001e 100644 --- a/third_party/WebKit/Source/platform/exported/WebCORS.cpp +++ b/third_party/WebKit/Source/platform/exported/WebCORS.cpp
@@ -216,28 +216,6 @@ return base::nullopt; } -base::Optional<CORSError> CheckPreflight( - const int preflight_response_status_code) { - // CORS preflight with 3XX is considered network error in - // Fetch API Spec: https://fetch.spec.whatwg.org/#cors-preflight-fetch - // CORS Spec: http://www.w3.org/TR/cors/#cross-origin-request-with-preflight-0 - // https://crbug.com/452394 - if (!FetchUtils::IsOkStatus(preflight_response_status_code)) - return CORSError::kPreflightInvalidStatus; - return base::nullopt; -} - -base::Optional<CORSError> CheckExternalPreflight( - const WebHTTPHeaderMap& response_header) { - WebString result = - response_header.Get(HTTPNames::Access_Control_Allow_External); - if (result.IsNull()) - return CORSError::kPreflightMissingAllowExternal; - if (!EqualIgnoringASCIICase(result, "true")) - return CORSError::kPreflightInvalidAllowExternal; - return base::nullopt; -} - WebURLRequest CreateAccessControlPreflightRequest( const WebURLRequest& request) { const KURL& request_url = request.Url();
diff --git a/third_party/WebKit/Source/platform/loader/cors/CORS.cpp b/third_party/WebKit/Source/platform/loader/cors/CORS.cpp index b492b34..1d79860 100644 --- a/third_party/WebKit/Source/platform/loader/cors/CORS.cpp +++ b/third_party/WebKit/Source/platform/loader/cors/CORS.cpp
@@ -222,6 +222,17 @@ return network::cors::CheckRedirectLocation(url, run_blink_side_scheme_check); } +WTF::Optional<network::mojom::CORSError> CheckPreflight( + const int preflight_response_status_code) { + return network::cors::CheckPreflight(preflight_response_status_code); +} + +WTF::Optional<network::mojom::CORSError> CheckExternalPreflight( + const HTTPHeaderMap& response_header) { + return network::cors::CheckExternalPreflight(GetHeaderValue( + response_header, HTTPNames::Access_Control_Allow_External)); +} + bool IsCORSEnabledRequestMode(network::mojom::FetchRequestMode request_mode) { return network::cors::IsCORSEnabledRequestMode(request_mode); }
diff --git a/third_party/WebKit/Source/platform/loader/cors/CORS.h b/third_party/WebKit/Source/platform/loader/cors/CORS.h index 176d1af..fb326de 100644 --- a/third_party/WebKit/Source/platform/loader/cors/CORS.h +++ b/third_party/WebKit/Source/platform/loader/cors/CORS.h
@@ -48,6 +48,12 @@ PLATFORM_EXPORT WTF::Optional<network::mojom::CORSError> CheckRedirectLocation( const KURL&); +PLATFORM_EXPORT WTF::Optional<network::mojom::CORSError> CheckPreflight( + const int preflight_response_status_code); + +PLATFORM_EXPORT WTF::Optional<network::mojom::CORSError> CheckExternalPreflight( + const HTTPHeaderMap&); + PLATFORM_EXPORT bool IsCORSEnabledRequestMode(network::mojom::FetchRequestMode); } // namespace CORS
diff --git a/third_party/WebKit/Source/platform/network/EncodedFormData.cpp b/third_party/WebKit/Source/platform/network/EncodedFormData.cpp index 663d3360..9d900ee 100644 --- a/third_party/WebKit/Source/platform/network/EncodedFormData.cpp +++ b/third_party/WebKit/Source/platform/network/EncodedFormData.cpp
@@ -120,8 +120,8 @@ } void EncodedFormData::AppendFile(const String& filename) { - elements_.push_back(FormDataElement(filename, 0, BlobDataItem::kToEndOfFile, - InvalidFileTime())); + elements_.push_back( + FormDataElement(filename, 0, BlobData::kToEndOfFile, InvalidFileTime())); } void EncodedFormData::AppendFileRange(const String& filename,
diff --git a/third_party/WebKit/Source/platform/scheduler/child/worker_global_scope_scheduler.cc b/third_party/WebKit/Source/platform/scheduler/child/worker_global_scope_scheduler.cc index e32fe7c..efa543f8 100644 --- a/third_party/WebKit/Source/platform/scheduler/child/worker_global_scope_scheduler.cc +++ b/third_party/WebKit/Source/platform/scheduler/child/worker_global_scope_scheduler.cc
@@ -58,6 +58,7 @@ case TaskType::kUnthrottled: case TaskType::kInternalTest: case TaskType::kInternalWebCrypto: + case TaskType::kInternalIndexedDB: // UnthrottledTaskRunner is generally discouraged in future. // TODO(nhiroki): Identify which tasks can be throttled / suspendable and // move them into other task runners. See also comments in
diff --git a/third_party/WebKit/Source/platform/scheduler/renderer/queueing_time_estimator.h b/third_party/WebKit/Source/platform/scheduler/renderer/queueing_time_estimator.h index dfb2cca..2ea4aca 100644 --- a/third_party/WebKit/Source/platform/scheduler/renderer/queueing_time_estimator.h +++ b/third_party/WebKit/Source/platform/scheduler/renderer/queueing_time_estimator.h
@@ -10,6 +10,7 @@ #include "platform/PlatformExport.h" #include "platform/scheduler/renderer/main_thread_task_queue.h" #include "platform/scheduler/renderer/renderer_metrics_helper.h" +#include "third_party/WebKit/common/page/launching_process_state.h" #include <array> #include <vector> @@ -125,7 +126,7 @@ base::TimeTicks step_start_time; base::TimeTicks current_task_start_time; // |renderer_backgrounded| is the renderer's current status. - bool renderer_backgrounded = false; + bool renderer_backgrounded = kLaunchingProcessIsBackgrounded; bool processing_task = false; Calculator calculator_;
diff --git a/third_party/WebKit/Source/platform/scheduler/renderer/queueing_time_estimator_unittest.cc b/third_party/WebKit/Source/platform/scheduler/renderer/queueing_time_estimator_unittest.cc index dd9b0b1..0f2eec3 100644 --- a/third_party/WebKit/Source/platform/scheduler/renderer/queueing_time_estimator_unittest.cc +++ b/third_party/WebKit/Source/platform/scheduler/renderer/queueing_time_estimator_unittest.cc
@@ -10,6 +10,7 @@ #include "platform/testing/HistogramTester.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +#include "third_party/WebKit/common/page/launching_process_state.h" #include <map> #include <string> @@ -76,8 +77,14 @@ public: QueueingTimeEstimatorForTest(TestQueueingTimeEstimatorClient* client, base::TimeDelta window_duration, - int steps_per_window) - : QueueingTimeEstimator(client, window_duration, steps_per_window) {} + int steps_per_window, + base::TimeTicks time) + : QueueingTimeEstimator(client, window_duration, steps_per_window) { + // If initial state is not foregrounded, foreground. + if (kLaunchingProcessIsBackgrounded) { + this->OnRendererStateChanged(false, time); + } + } }; struct BucketExpectation { @@ -136,8 +143,8 @@ // multiplied by the expected queueing time within a task (0.5 seconds). Thus we // expect a queueing time of 0.3 seconds. TEST_F(QueueingTimeEstimatorTest, AllTasksWithinWindow) { - QueueingTimeEstimatorForTest estimator(&client, - base::TimeDelta::FromSeconds(5), 1); + QueueingTimeEstimatorForTest estimator( + &client, base::TimeDelta::FromSeconds(5), 1, time); for (int i = 0; i < 3; ++i) { estimator.OnTopLevelTaskStarted(time, nullptr); time += base::TimeDelta::FromMilliseconds(1000); @@ -167,8 +174,8 @@ // Window 5: Probability of being within task = 3/5. Expected delay within task: // avg(3, 0). Total expected queueing time = 0.9s. TEST_F(QueueingTimeEstimatorTest, MultiWindowTask) { - QueueingTimeEstimatorForTest estimator(&client, - base::TimeDelta::FromSeconds(5), 1); + QueueingTimeEstimatorForTest estimator( + &client, base::TimeDelta::FromSeconds(5), 1, time); time += base::TimeDelta::FromMilliseconds(5000); estimator.OnTopLevelTaskStarted(time, nullptr); estimator.OnTopLevelTaskCompleted(time); @@ -208,8 +215,8 @@ // In this example, the queueing time comes from the current, incomplete window. TEST_F(QueueingTimeEstimatorTest, EstimateQueueingTimeDuringSingleLongTaskIncompleteWindow) { - QueueingTimeEstimatorForTest estimator(&client, - base::TimeDelta::FromSeconds(5), 1); + QueueingTimeEstimatorForTest estimator( + &client, base::TimeDelta::FromSeconds(5), 1, time); time += base::TimeDelta::FromMilliseconds(5000); estimator.OnTopLevelTaskStarted(time, nullptr); estimator.OnTopLevelTaskCompleted(time); @@ -235,8 +242,8 @@ // fills the whole window. Expected delay within this task = avg(8, 3) = 5.5. TEST_F(QueueingTimeEstimatorTest, EstimateQueueingTimeDuringSingleLongTaskExceedingWindow) { - QueueingTimeEstimatorForTest estimator(&client, - base::TimeDelta::FromSeconds(5), 1); + QueueingTimeEstimatorForTest estimator( + &client, base::TimeDelta::FromSeconds(5), 1, time); time += base::TimeDelta::FromMilliseconds(5000); estimator.OnTopLevelTaskStarted(time, nullptr); estimator.OnTopLevelTaskCompleted(time); @@ -271,8 +278,8 @@ // So EQT = max(EQT(win1), EQT(win2)) = 3 TEST_F(QueueingTimeEstimatorTest, SlidingWindowEstimateQueueingTimeFullWindowLargerThanPartial) { - QueueingTimeEstimatorForTest estimator(&client, - base::TimeDelta::FromSeconds(5), 5); + QueueingTimeEstimatorForTest estimator( + &client, base::TimeDelta::FromSeconds(5), 5, time); time += base::TimeDelta::FromMilliseconds(5000); estimator.OnTopLevelTaskStarted(time, nullptr); estimator.OnTopLevelTaskCompleted(time); @@ -313,8 +320,8 @@ // So EQT = max(EQT(win1), EQT(win2)) = 0.025 TEST_F(QueueingTimeEstimatorTest, SlidingWindowEstimateQueueingTimePartialWindowLargerThanFull) { - QueueingTimeEstimatorForTest estimator(&client, - base::TimeDelta::FromSeconds(5), 5); + QueueingTimeEstimatorForTest estimator( + &client, base::TimeDelta::FromSeconds(5), 5, time); time += base::TimeDelta::FromMilliseconds(5000); estimator.OnTopLevelTaskStarted(time, nullptr); estimator.OnTopLevelTaskCompleted(time); @@ -336,8 +343,8 @@ // Tasks containing nested run loops may be extremely long without // negatively impacting user experience. Ignore such tasks. TEST_F(QueueingTimeEstimatorTest, IgnoresTasksWithNestedMessageLoops) { - QueueingTimeEstimatorForTest estimator(&client, - base::TimeDelta::FromSeconds(5), 1); + QueueingTimeEstimatorForTest estimator( + &client, base::TimeDelta::FromSeconds(5), 1, time); time += base::TimeDelta::FromMilliseconds(5000); estimator.OnTopLevelTaskStarted(time, nullptr); estimator.OnTopLevelTaskCompleted(time); @@ -375,8 +382,8 @@ // went to sleep during a task, resulting in an extremely long task. Ignore // these long tasks completely. TEST_F(QueueingTimeEstimatorTest, IgnoreExtremelyLongTasks) { - QueueingTimeEstimatorForTest estimator(&client, - base::TimeDelta::FromSeconds(5), 1); + QueueingTimeEstimatorForTest estimator( + &client, base::TimeDelta::FromSeconds(5), 1, time); time += base::TimeDelta::FromMilliseconds(5000); // Start with a 1 second task. estimator.OnTopLevelTaskStarted(time, nullptr); @@ -425,8 +432,8 @@ // If we idle for too long, ignore idling time, even if the renderer is on the // foreground. Perhaps the user's machine went to sleep while we were idling. TEST_F(QueueingTimeEstimatorTest, IgnoreExtremelyLongIdlePeriods) { - QueueingTimeEstimatorForTest estimator(&client, - base::TimeDelta::FromSeconds(5), 1); + QueueingTimeEstimatorForTest estimator( + &client, base::TimeDelta::FromSeconds(5), 1, time); time += base::TimeDelta::FromMilliseconds(5000); // Start with a 1 second task. estimator.OnTopLevelTaskStarted(time, nullptr); @@ -485,8 +492,8 @@ // |---win---| // |---win---| TEST_F(QueueingTimeEstimatorTest, SlidingWindowOverOneTask) { - QueueingTimeEstimatorForTest estimator(&client, - base::TimeDelta::FromSeconds(5), 5); + QueueingTimeEstimatorForTest estimator( + &client, base::TimeDelta::FromSeconds(5), 5, time); time += base::TimeDelta::FromMilliseconds(1000); estimator.OnTopLevelTaskStarted(time, nullptr); @@ -531,8 +538,8 @@ // |---win---| // |---win---| TEST_F(QueueingTimeEstimatorTest, SlidingWindowOverTwoTasksWithinFirstWindow) { - QueueingTimeEstimatorForTest estimator(&client, - base::TimeDelta::FromSeconds(5), 5); + QueueingTimeEstimatorForTest estimator( + &client, base::TimeDelta::FromSeconds(5), 5, time); time += base::TimeDelta::FromMilliseconds(1000); estimator.OnTopLevelTaskStarted(time, nullptr); @@ -585,8 +592,8 @@ // |---win---| TEST_F(QueueingTimeEstimatorTest, SlidingWindowOverTwoTasksSpanningSeveralWindows) { - QueueingTimeEstimatorForTest estimator(&client, - base::TimeDelta::FromSeconds(5), 5); + QueueingTimeEstimatorForTest estimator( + &client, base::TimeDelta::FromSeconds(5), 5, time); time += base::TimeDelta::FromMilliseconds(1000); estimator.OnTopLevelTaskStarted(time, nullptr); estimator.OnTopLevelTaskCompleted(time); @@ -634,8 +641,8 @@ // backgrounded renderer. EQT(win1) = 0. EQT(win3) = (1500+500)/2 = 1000. // EQT(win4) = 1/2*500/2 = 250. EQT(win7) = 1/5*200/2 = 20. TEST_F(QueueingTimeEstimatorTest, BackgroundedEQTsWithSingleStepPerWindow) { - QueueingTimeEstimatorForTest estimator(&client, - base::TimeDelta::FromSeconds(1), 1); + QueueingTimeEstimatorForTest estimator( + &client, base::TimeDelta::FromSeconds(1), 1, time); time += base::TimeDelta::FromMilliseconds(1000); estimator.OnTopLevelTaskStarted(time, nullptr); estimator.OnTopLevelTaskCompleted(time); @@ -707,8 +714,8 @@ // Win8: [12000-17000]. EQT of [16000-17000]: (1700+700)/2 = 1200. EQT(win8) = // (145+900+80+1680+1200)/5 = 801. TEST_F(QueueingTimeEstimatorTest, BackgroundedEQTsWithMutipleStepsPerWindow) { - QueueingTimeEstimatorForTest estimator(&client, - base::TimeDelta::FromSeconds(5), 5); + QueueingTimeEstimatorForTest estimator( + &client, base::TimeDelta::FromSeconds(5), 5, time); time += base::TimeDelta::FromMilliseconds(5000); estimator.OnTopLevelTaskStarted(time, nullptr); estimator.OnTopLevelTaskCompleted(time); @@ -781,8 +788,8 @@ // other. Two 300 ms (each contributing 9) and one 200 ms tasks (contributes 4) // for the other bucket. TEST_F(QueueingTimeEstimatorTest, SplitEQTByTaskQueueType) { - QueueingTimeEstimatorForTest estimator(&client, - base::TimeDelta::FromSeconds(5), 5); + QueueingTimeEstimatorForTest estimator( + &client, base::TimeDelta::FromSeconds(5), 5, time); time += base::TimeDelta::FromMilliseconds(5000); // Dummy task to initialize the estimator. estimator.OnTopLevelTaskStarted(time, nullptr); @@ -992,8 +999,8 @@ // other. Two 300 ms (each contributing 9) and one 800 ms tasks (contributes // 64) for the other bucket. TEST_F(QueueingTimeEstimatorTest, SplitEQTByFrameStatus) { - QueueingTimeEstimatorForTest estimator(&client, - base::TimeDelta::FromSeconds(5), 5); + QueueingTimeEstimatorForTest estimator( + &client, base::TimeDelta::FromSeconds(5), 5, time); time += base::TimeDelta::FromMilliseconds(5000); // Dummy task to initialize the estimator. estimator.OnTopLevelTaskStarted(time, nullptr);
diff --git a/third_party/WebKit/Source/platform/scheduler/renderer/renderer_metrics_helper_unittest.cc b/third_party/WebKit/Source/platform/scheduler/renderer/renderer_metrics_helper_unittest.cc index daff6cc5..f8c2c7a 100644 --- a/third_party/WebKit/Source/platform/scheduler/renderer/renderer_metrics_helper_unittest.cc +++ b/third_party/WebKit/Source/platform/scheduler/renderer/renderer_metrics_helper_unittest.cc
@@ -16,6 +16,7 @@ #include "platform/scheduler/test/fake_web_view_scheduler.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +#include "third_party/WebKit/common/page/launching_process_state.h" namespace blink { namespace scheduler { @@ -205,6 +206,11 @@ // QueueType::kDefault is checking sub-millisecond task aggregation, // FRAME_* tasks are checking normal task aggregation and other // queue types have a single task. + + // Make sure that it starts in a foregrounded state. + if (kLaunchingProcessIsBackgrounded) + scheduler_->SetRendererBackgrounded(false); + RunTask(QueueType::kDefault, Milliseconds(1), base::TimeDelta::FromMicroseconds(700)); RunTask(QueueType::kDefault, Milliseconds(2), @@ -318,27 +324,46 @@ TEST_F(RendererMetricsHelperTest, BackgroundedRendererTransition) { scheduler_->SetStoppingWhenBackgroundedEnabled(true); - scheduler_->SetRendererBackgrounded(true); typedef BackgroundedRendererTransition Transition; - EXPECT_THAT(histogram_tester_->GetAllSamples( - "RendererScheduler.BackgroundedRendererTransition"), - UnorderedElementsAre( - Bucket(static_cast<int>(Transition::kBackgrounded), 1))); - - scheduler_->SetRendererBackgrounded(false); - EXPECT_THAT(histogram_tester_->GetAllSamples( - "RendererScheduler.BackgroundedRendererTransition"), - UnorderedElementsAre( - Bucket(static_cast<int>(Transition::kBackgrounded), 1), - Bucket(static_cast<int>(Transition::kForegrounded), 1))); + int backgrounding_transitions = 0; + int foregrounding_transitions = 0; + if (!kLaunchingProcessIsBackgrounded) { + scheduler_->SetRendererBackgrounded(true); + backgrounding_transitions++; + EXPECT_THAT( + histogram_tester_->GetAllSamples( + "RendererScheduler.BackgroundedRendererTransition"), + UnorderedElementsAre(Bucket(static_cast<int>(Transition::kBackgrounded), + backgrounding_transitions))); + scheduler_->SetRendererBackgrounded(false); + foregrounding_transitions++; + EXPECT_THAT( + histogram_tester_->GetAllSamples( + "RendererScheduler.BackgroundedRendererTransition"), + UnorderedElementsAre(Bucket(static_cast<int>(Transition::kBackgrounded), + backgrounding_transitions), + Bucket(static_cast<int>(Transition::kForegrounded), + foregrounding_transitions))); + } else { + scheduler_->SetRendererBackgrounded(false); + foregrounding_transitions++; + EXPECT_THAT( + histogram_tester_->GetAllSamples( + "RendererScheduler.BackgroundedRendererTransition"), + UnorderedElementsAre(Bucket(static_cast<int>(Transition::kForegrounded), + foregrounding_transitions))); + } scheduler_->SetRendererBackgrounded(true); - EXPECT_THAT(histogram_tester_->GetAllSamples( - "RendererScheduler.BackgroundedRendererTransition"), - UnorderedElementsAre( - Bucket(static_cast<int>(Transition::kBackgrounded), 2), - Bucket(static_cast<int>(Transition::kForegrounded), 1))); + backgrounding_transitions++; + EXPECT_THAT( + histogram_tester_->GetAllSamples( + "RendererScheduler.BackgroundedRendererTransition"), + UnorderedElementsAre(Bucket(static_cast<int>(Transition::kBackgrounded), + backgrounding_transitions), + Bucket(static_cast<int>(Transition::kForegrounded), + foregrounding_transitions))); // Waste 5+ minutes so that the delayed stop is triggered RunTask(QueueType::kDefault, Milliseconds(1), @@ -351,18 +376,23 @@ EXPECT_THAT(histogram_tester_->GetAllSamples( "RendererScheduler.BackgroundedRendererTransition"), UnorderedElementsAre( - Bucket(static_cast<int>(Transition::kBackgrounded), 2), - Bucket(static_cast<int>(Transition::kForegrounded), 1), + Bucket(static_cast<int>(Transition::kBackgrounded), + backgrounding_transitions), + Bucket(static_cast<int>(Transition::kForegrounded), + foregrounding_transitions), Bucket(static_cast<int>(Transition::kStoppedAfterDelay), 1))); scheduler_->SetRendererBackgrounded(false); + foregrounding_transitions++; ForceUpdatePolicy(); ForceUpdatePolicy(); EXPECT_THAT(histogram_tester_->GetAllSamples( "RendererScheduler.BackgroundedRendererTransition"), UnorderedElementsAre( - Bucket(static_cast<int>(Transition::kBackgrounded), 2), - Bucket(static_cast<int>(Transition::kForegrounded), 2), + Bucket(static_cast<int>(Transition::kBackgrounded), + backgrounding_transitions), + Bucket(static_cast<int>(Transition::kForegrounded), + foregrounding_transitions), Bucket(static_cast<int>(Transition::kStoppedAfterDelay), 1), Bucket(static_cast<int>(Transition::kResumed), 1))); }
diff --git a/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc b/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc index 4f76de05..97c6844 100644 --- a/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc +++ b/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc
@@ -31,6 +31,7 @@ #include "platform/scheduler/renderer/webthread_impl_for_renderer_scheduler.h" #include "public/platform/Platform.h" #include "public/platform/scheduler/renderer_process_type.h" +#include "third_party/WebKit/common/page/launching_process_state.h" namespace blink { namespace scheduler { @@ -172,6 +173,8 @@ return "InternalTest"; case TaskType::kInternalWebCrypto: return "InternalWebCrypto"; + case TaskType::kInternalIndexedDB: + return "InternalIndexedDB"; case TaskType::kCount: return "Count"; } @@ -356,7 +359,7 @@ renderer_scheduler_impl, &renderer_scheduler_impl->tracing_controller_, HiddenStateToString), - renderer_backgrounded(false, + renderer_backgrounded(kLaunchingProcessIsBackgrounded, "RendererScheduler.Backgrounded", renderer_scheduler_impl, &renderer_scheduler_impl->tracing_controller_, @@ -367,12 +370,11 @@ renderer_scheduler_impl, &renderer_scheduler_impl->tracing_controller_, YesNoStateToString), - stopped_when_backgrounded( - false, - "RendererScheduler.StoppedWhenBackgrounded", - renderer_scheduler_impl, - &renderer_scheduler_impl->tracing_controller_, - YesNoStateToString), + stopped_when_backgrounded(false, + "RendererScheduler.StoppedWhenBackgrounded", + renderer_scheduler_impl, + &renderer_scheduler_impl->tracing_controller_, + YesNoStateToString), was_shutdown(false, "RendererScheduler.WasShutdown", renderer_scheduler_impl, @@ -384,12 +386,11 @@ renderer_scheduler_impl, &renderer_scheduler_impl->tracing_controller_, TimeDeltaToMilliseconds), - timer_task_estimated_cost( - base::TimeDelta(), - "RendererScheduler.TimerTaskEstimatedCostMs", - renderer_scheduler_impl, - &renderer_scheduler_impl->tracing_controller_, - TimeDeltaToMilliseconds), + timer_task_estimated_cost(base::TimeDelta(), + "RendererScheduler.TimerTaskEstimatedCostMs", + renderer_scheduler_impl, + &renderer_scheduler_impl->tracing_controller_, + TimeDeltaToMilliseconds), loading_tasks_seem_expensive( false, "RendererScheduler.LoadingTasksSeemExpensive",
diff --git a/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl_unittest.cc b/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl_unittest.cc index f4b1546..ed76627 100644 --- a/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl_unittest.cc +++ b/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl_unittest.cc
@@ -26,6 +26,7 @@ #include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +#include "third_party/WebKit/common/page/launching_process_state.h" namespace blink { namespace scheduler { @@ -288,6 +289,12 @@ void Initialize(std::unique_ptr<RendererSchedulerImplForTest> scheduler) { scheduler_ = std::move(scheduler); + if (kLaunchingProcessIsBackgrounded) { + scheduler_->SetRendererBackgrounded(false); + // Reset the policy count as foregrounding would force an initial update. + scheduler_->update_policy_count_ = 0; + scheduler_->use_cases_.clear(); + } default_task_runner_ = scheduler_->DefaultTaskQueue(); compositor_task_runner_ = scheduler_->CompositorTaskQueue(); loading_task_runner_ = scheduler_->LoadingTaskQueue();
diff --git a/third_party/WebKit/Source/platform/scheduler/renderer/web_frame_scheduler_impl.cc b/third_party/WebKit/Source/platform/scheduler/renderer/web_frame_scheduler_impl.cc index 916a3a1d..b6bcf08 100644 --- a/third_party/WebKit/Source/platform/scheduler/renderer/web_frame_scheduler_impl.cc +++ b/third_party/WebKit/Source/platform/scheduler/renderer/web_frame_scheduler_impl.cc
@@ -267,6 +267,7 @@ // Media events should not be deferred to ensure that media playback is // smooth. case TaskType::kMediaElementEvent: + case TaskType::kInternalIndexedDB: return WebTaskRunnerImpl::Create(PausableTaskQueue(), type); case TaskType::kUnthrottled: case TaskType::kInternalTest:
diff --git a/third_party/WebKit/common/BUILD.gn b/third_party/WebKit/common/BUILD.gn index ac54566..6f1afde 100644 --- a/third_party/WebKit/common/BUILD.gn +++ b/third_party/WebKit/common/BUILD.gn
@@ -53,6 +53,7 @@ "origin_trials/trial_token.h", "origin_trials/trial_token_validator.cc", "origin_trials/trial_token_validator.h", + "page/launching_process_state.h", "sandbox_flags.h", ]
diff --git a/third_party/WebKit/common/page/launching_process_state.h b/third_party/WebKit/common/page/launching_process_state.h new file mode 100644 index 0000000..4aaaa5a --- /dev/null +++ b/third_party/WebKit/common/page/launching_process_state.h
@@ -0,0 +1,26 @@ +// 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 THIRD_PARTY_WEBKIT_COMMON_PAGE_LAUNCHING_PROCESS_STATE_H_ +#define THIRD_PARTY_WEBKIT_COMMON_PAGE_LAUNCHING_PROCESS_STATE_H_ + +#include "build/build_config.h" +#include "third_party/WebKit/common/common_export.h" + +namespace blink { + +// This file is used to maintain a consistent initial set of state between the +// RendererProcessHostImpl and the RendererSchedulerImpl. +#if defined(OS_ANDROID) +// This matches Android's ChildProcessConnection state before OnProcessLaunched. +constexpr bool kLaunchingProcessIsBackgrounded = true; +constexpr bool kLaunchingProcessIsBoostedForPendingView = true; +#else +constexpr bool kLaunchingProcessIsBackgrounded = false; +constexpr bool kLaunchingProcessIsBoostedForPendingView = false; +#endif + +} // namespace blink + +#endif // THIRD_PARTY_WEBKIT_COMMON_PAGE_LAUNCHING_PROCESS_STATE_H_
diff --git a/third_party/WebKit/public/platform/TaskType.h b/third_party/WebKit/public/platform/TaskType.h index 99ee6fb5..79e594fd 100644 --- a/third_party/WebKit/public/platform/TaskType.h +++ b/third_party/WebKit/public/platform/TaskType.h
@@ -142,7 +142,11 @@ // * //components/webcrypto kInternalWebCrypto = 27, - kCount = 28, + // Tasks to execute IndexedDB's callbacks. Tasks with this type are posted by: + // * //content/renderer/indexed_db + kInternalIndexedDB = 28, + + kCount = 29, }; } // namespace blink
diff --git a/third_party/WebKit/public/platform/WebCORS.h b/third_party/WebKit/public/platform/WebCORS.h index bcb3b1f..142c5c7 100644 --- a/third_party/WebKit/public/platform/WebCORS.h +++ b/third_party/WebKit/public/platform/WebCORS.h
@@ -44,17 +44,6 @@ namespace WebCORS { -// Perform the required CORS checks on the response to a preflight request. -// Returns |kPreflightSuccess| if preflight response was successful. -BLINK_PLATFORM_EXPORT base::Optional<network::mojom::CORSError> CheckPreflight( - const int preflight_response_status_code); - -// Error checking for the currently experimental -// "Access-Control-Allow-External:" header. Shares error conditions with -// standard preflight checking. -BLINK_PLATFORM_EXPORT base::Optional<network::mojom::CORSError> -CheckExternalPreflight(const WebHTTPHeaderMap&); - BLINK_PLATFORM_EXPORT WebURLRequest CreateAccessControlPreflightRequest(const WebURLRequest&);
diff --git a/third_party/WebKit/public/platform/modules/indexeddb/WebIDBFactory.h b/third_party/WebKit/public/platform/modules/indexeddb/WebIDBFactory.h index c47273e9..1fc0d709 100644 --- a/third_party/WebKit/public/platform/modules/indexeddb/WebIDBFactory.h +++ b/third_party/WebKit/public/platform/modules/indexeddb/WebIDBFactory.h
@@ -31,6 +31,10 @@ #include "public/platform/WebCommon.h" +namespace base { +class SingleThreadTaskRunner; +} + namespace blink { class WebIDBCallbacks; @@ -42,17 +46,22 @@ public: virtual ~WebIDBFactory() = default; - virtual void GetDatabaseNames(WebIDBCallbacks*, const WebSecurityOrigin&) = 0; + virtual void GetDatabaseNames( + WebIDBCallbacks*, + const WebSecurityOrigin&, + scoped_refptr<base::SingleThreadTaskRunner>) = 0; virtual void Open(const WebString& name, long long version, long long transaction_id, WebIDBCallbacks*, WebIDBDatabaseCallbacks*, - const WebSecurityOrigin&) = 0; + const WebSecurityOrigin&, + scoped_refptr<base::SingleThreadTaskRunner>) = 0; virtual void DeleteDatabase(const WebString& name, WebIDBCallbacks*, const WebSecurityOrigin&, - bool force_close) = 0; + bool force_close, + scoped_refptr<base::SingleThreadTaskRunner>) = 0; }; } // namespace blink
diff --git a/third_party/WebKit/public/platform/modules/webauth/authenticator.mojom b/third_party/WebKit/public/platform/modules/webauth/authenticator.mojom index 901da9b2..ebd73c3 100644 --- a/third_party/WebKit/public/platform/modules/webauth/authenticator.mojom +++ b/third_party/WebKit/public/platform/modules/webauth/authenticator.mojom
@@ -108,7 +108,7 @@ mojo.common.mojom.TimeDelta adjusted_timeout; // An ASCII serialization of the origin claimed by the relying party. - string? relying_party_id; + string relying_party_id; // A list of credentials the relying party knows about and would // accept as the signing credential.
diff --git a/third_party/WebKit/public/web/WebDocumentLoader.h b/third_party/WebKit/public/web/WebDocumentLoader.h index 15d41c6..f3f4727 100644 --- a/third_party/WebKit/public/web/WebDocumentLoader.h +++ b/third_party/WebKit/public/web/WebDocumentLoader.h
@@ -41,6 +41,7 @@ namespace blink { class WebDocumentSubresourceFilter; +class WebSecurityOrigin; class WebServiceWorkerNetworkProvider; class WebURL; class WebURLRequest; @@ -58,6 +59,12 @@ virtual ~ExtraData() = default; }; + // Returns whether a user activation state should be persisted across + // navigation. + static bool ShouldPersistUserActivation( + const WebSecurityOrigin& previous_origin, + const WebSecurityOrigin& new_origin); + // Returns the original request that resulted in this datasource. virtual const WebURLRequest& OriginalRequest() const = 0; @@ -140,6 +147,10 @@ virtual void SetSourceLocation(const WebSourceLocation&) = 0; virtual void ResetSourceLocation() = 0; + // Mark that the load was user activated. This is meant to be used for browser + // initiated loads that may have had a user activation from the browser UI. + virtual void SetUserActivated() = 0; + protected: ~WebDocumentLoader() = default; };
diff --git a/third_party/blink/tools/move_blink_source.py b/third_party/blink/tools/move_blink_source.py index e49e1fbc..ac5122e 100755 --- a/third_party/blink/tools/move_blink_source.py +++ b/third_party/blink/tools/move_blink_source.py
@@ -195,6 +195,7 @@ Update file contents without moving files. +NOAUTOREVERT=true Bug: 768828 """) @@ -235,6 +236,7 @@ Move and rename files. +NOAUTOREVERT=true Bug: 768828 """)
diff --git a/third_party/crc32c/OWNERS b/third_party/crc32c/OWNERS index 80cd612..c3a7b7a 100644 --- a/third_party/crc32c/OWNERS +++ b/third_party/crc32c/OWNERS
@@ -6,4 +6,4 @@ jsbell@chromium.org # TEAM: storage-dev@chromium.org -# COMPONENT: Blink>Storage +# COMPONENT: Internals>Storage
diff --git a/third_party/leveldatabase/OWNERS b/third_party/leveldatabase/OWNERS index 80cd612..c3a7b7a 100644 --- a/third_party/leveldatabase/OWNERS +++ b/third_party/leveldatabase/OWNERS
@@ -6,4 +6,4 @@ jsbell@chromium.org # TEAM: storage-dev@chromium.org -# COMPONENT: Blink>Storage +# COMPONENT: Internals>Storage
diff --git a/third_party/libvpx/README.chromium b/third_party/libvpx/README.chromium index a8e8b1a..854e6db 100644 --- a/third_party/libvpx/README.chromium +++ b/third_party/libvpx/README.chromium
@@ -5,9 +5,9 @@ License File: source/libvpx/LICENSE Security Critical: yes -Date: Friday January 05 2018 +Date: Tuesday January 16 2018 Branch: master -Commit: bed28a55f593efd3a71a3a9d05cf8bb25d15fa44 +Commit: 373e08f921e5bfd5a96963fabbbbe16ec793d44e Description: Contains the sources used to compile libvpx binaries used by Google Chrome and
diff --git a/third_party/libvpx/libvpx_srcs.gni b/third_party/libvpx/libvpx_srcs.gni index cc0da46..bcd8439 100644 --- a/third_party/libvpx/libvpx_srcs.gni +++ b/third_party/libvpx/libvpx_srcs.gni
@@ -450,6 +450,7 @@ ] libvpx_srcs_x86_sse4_1 = [ "//third_party/libvpx/source/libvpx/vp8/encoder/x86/quantize_sse4.c", + "//third_party/libvpx/source/libvpx/vp9/common/x86/vp9_highbd_iht4x4_add_sse4.c", "//third_party/libvpx/source/libvpx/vpx_dsp/x86/highbd_idct16x16_add_sse4.c", "//third_party/libvpx/source/libvpx/vpx_dsp/x86/highbd_idct32x32_add_sse4.c", "//third_party/libvpx/source/libvpx/vpx_dsp/x86/highbd_idct4x4_add_sse4.c", @@ -923,6 +924,7 @@ ] libvpx_srcs_x86_64_sse4_1 = [ "//third_party/libvpx/source/libvpx/vp8/encoder/x86/quantize_sse4.c", + "//third_party/libvpx/source/libvpx/vp9/common/x86/vp9_highbd_iht4x4_add_sse4.c", "//third_party/libvpx/source/libvpx/vpx_dsp/x86/highbd_idct16x16_add_sse4.c", "//third_party/libvpx/source/libvpx/vpx_dsp/x86/highbd_idct32x32_add_sse4.c", "//third_party/libvpx/source/libvpx/vpx_dsp/x86/highbd_idct4x4_add_sse4.c",
diff --git a/third_party/libvpx/source/config/linux/ia32/vp9_rtcd.h b/third_party/libvpx/source/config/linux/ia32/vp9_rtcd.h index 2ffeeb0..c5f23c47 100644 --- a/third_party/libvpx/source/config/linux/ia32/vp9_rtcd.h +++ b/third_party/libvpx/source/config/linux/ia32/vp9_rtcd.h
@@ -284,7 +284,16 @@ int stride, int tx_type, int bd); -#define vp9_highbd_iht4x4_16_add vp9_highbd_iht4x4_16_add_c +void vp9_highbd_iht4x4_16_add_sse4_1(const tran_low_t* input, + uint16_t* dest, + int stride, + int tx_type, + int bd); +RTCD_EXTERN void (*vp9_highbd_iht4x4_16_add)(const tran_low_t* input, + uint16_t* dest, + int stride, + int tx_type, + int bd); void vp9_highbd_iht8x8_64_add_c(const tran_low_t* input, uint16_t* dest, @@ -503,6 +512,9 @@ vp9_highbd_block_error = vp9_highbd_block_error_c; if (flags & HAS_SSE2) vp9_highbd_block_error = vp9_highbd_block_error_sse2; + vp9_highbd_iht4x4_16_add = vp9_highbd_iht4x4_16_add_c; + if (flags & HAS_SSE4_1) + vp9_highbd_iht4x4_16_add = vp9_highbd_iht4x4_16_add_sse4_1; vp9_iht16x16_256_add = vp9_iht16x16_256_add_c; if (flags & HAS_SSE2) vp9_iht16x16_256_add = vp9_iht16x16_256_add_sse2;
diff --git a/third_party/libvpx/source/config/linux/x64/vp9_rtcd.h b/third_party/libvpx/source/config/linux/x64/vp9_rtcd.h index 4b2b1013..4773ba6 100644 --- a/third_party/libvpx/source/config/linux/x64/vp9_rtcd.h +++ b/third_party/libvpx/source/config/linux/x64/vp9_rtcd.h
@@ -253,7 +253,16 @@ int stride, int tx_type, int bd); -#define vp9_highbd_iht4x4_16_add vp9_highbd_iht4x4_16_add_c +void vp9_highbd_iht4x4_16_add_sse4_1(const tran_low_t* input, + uint16_t* dest, + int stride, + int tx_type, + int bd); +RTCD_EXTERN void (*vp9_highbd_iht4x4_16_add)(const tran_low_t* input, + uint16_t* dest, + int stride, + int tx_type, + int bd); void vp9_highbd_iht8x8_64_add_c(const tran_low_t* input, uint16_t* dest, @@ -467,6 +476,9 @@ vp9_fdct8x8_quant = vp9_fdct8x8_quant_c; if (flags & HAS_SSSE3) vp9_fdct8x8_quant = vp9_fdct8x8_quant_ssse3; + vp9_highbd_iht4x4_16_add = vp9_highbd_iht4x4_16_add_c; + if (flags & HAS_SSE4_1) + vp9_highbd_iht4x4_16_add = vp9_highbd_iht4x4_16_add_sse4_1; vp9_quantize_fp = vp9_quantize_fp_sse2; if (flags & HAS_SSSE3) vp9_quantize_fp = vp9_quantize_fp_ssse3;
diff --git a/third_party/libvpx/source/config/mac/ia32/vp9_rtcd.h b/third_party/libvpx/source/config/mac/ia32/vp9_rtcd.h index 2ffeeb0..c5f23c47 100644 --- a/third_party/libvpx/source/config/mac/ia32/vp9_rtcd.h +++ b/third_party/libvpx/source/config/mac/ia32/vp9_rtcd.h
@@ -284,7 +284,16 @@ int stride, int tx_type, int bd); -#define vp9_highbd_iht4x4_16_add vp9_highbd_iht4x4_16_add_c +void vp9_highbd_iht4x4_16_add_sse4_1(const tran_low_t* input, + uint16_t* dest, + int stride, + int tx_type, + int bd); +RTCD_EXTERN void (*vp9_highbd_iht4x4_16_add)(const tran_low_t* input, + uint16_t* dest, + int stride, + int tx_type, + int bd); void vp9_highbd_iht8x8_64_add_c(const tran_low_t* input, uint16_t* dest, @@ -503,6 +512,9 @@ vp9_highbd_block_error = vp9_highbd_block_error_c; if (flags & HAS_SSE2) vp9_highbd_block_error = vp9_highbd_block_error_sse2; + vp9_highbd_iht4x4_16_add = vp9_highbd_iht4x4_16_add_c; + if (flags & HAS_SSE4_1) + vp9_highbd_iht4x4_16_add = vp9_highbd_iht4x4_16_add_sse4_1; vp9_iht16x16_256_add = vp9_iht16x16_256_add_c; if (flags & HAS_SSE2) vp9_iht16x16_256_add = vp9_iht16x16_256_add_sse2;
diff --git a/third_party/libvpx/source/config/mac/x64/vp9_rtcd.h b/third_party/libvpx/source/config/mac/x64/vp9_rtcd.h index 4b2b1013..4773ba6 100644 --- a/third_party/libvpx/source/config/mac/x64/vp9_rtcd.h +++ b/third_party/libvpx/source/config/mac/x64/vp9_rtcd.h
@@ -253,7 +253,16 @@ int stride, int tx_type, int bd); -#define vp9_highbd_iht4x4_16_add vp9_highbd_iht4x4_16_add_c +void vp9_highbd_iht4x4_16_add_sse4_1(const tran_low_t* input, + uint16_t* dest, + int stride, + int tx_type, + int bd); +RTCD_EXTERN void (*vp9_highbd_iht4x4_16_add)(const tran_low_t* input, + uint16_t* dest, + int stride, + int tx_type, + int bd); void vp9_highbd_iht8x8_64_add_c(const tran_low_t* input, uint16_t* dest, @@ -467,6 +476,9 @@ vp9_fdct8x8_quant = vp9_fdct8x8_quant_c; if (flags & HAS_SSSE3) vp9_fdct8x8_quant = vp9_fdct8x8_quant_ssse3; + vp9_highbd_iht4x4_16_add = vp9_highbd_iht4x4_16_add_c; + if (flags & HAS_SSE4_1) + vp9_highbd_iht4x4_16_add = vp9_highbd_iht4x4_16_add_sse4_1; vp9_quantize_fp = vp9_quantize_fp_sse2; if (flags & HAS_SSSE3) vp9_quantize_fp = vp9_quantize_fp_ssse3;
diff --git a/third_party/libvpx/source/config/vpx_version.h b/third_party/libvpx/source/config/vpx_version.h index ede1b94..978e051 100644 --- a/third_party/libvpx/source/config/vpx_version.h +++ b/third_party/libvpx/source/config/vpx_version.h
@@ -2,7 +2,7 @@ #define VERSION_MAJOR 1 #define VERSION_MINOR 6 #define VERSION_PATCH 1 -#define VERSION_EXTRA "1477-gbed28a55f" +#define VERSION_EXTRA "1494-g373e08f92" #define VERSION_PACKED ((VERSION_MAJOR<<16)|(VERSION_MINOR<<8)|(VERSION_PATCH)) -#define VERSION_STRING_NOSP "v1.6.1-1477-gbed28a55f" -#define VERSION_STRING " v1.6.1-1477-gbed28a55f" +#define VERSION_STRING_NOSP "v1.6.1-1494-g373e08f92" +#define VERSION_STRING " v1.6.1-1494-g373e08f92"
diff --git a/third_party/libvpx/source/config/win/ia32/vp9_rtcd.h b/third_party/libvpx/source/config/win/ia32/vp9_rtcd.h index 2ffeeb0..c5f23c47 100644 --- a/third_party/libvpx/source/config/win/ia32/vp9_rtcd.h +++ b/third_party/libvpx/source/config/win/ia32/vp9_rtcd.h
@@ -284,7 +284,16 @@ int stride, int tx_type, int bd); -#define vp9_highbd_iht4x4_16_add vp9_highbd_iht4x4_16_add_c +void vp9_highbd_iht4x4_16_add_sse4_1(const tran_low_t* input, + uint16_t* dest, + int stride, + int tx_type, + int bd); +RTCD_EXTERN void (*vp9_highbd_iht4x4_16_add)(const tran_low_t* input, + uint16_t* dest, + int stride, + int tx_type, + int bd); void vp9_highbd_iht8x8_64_add_c(const tran_low_t* input, uint16_t* dest, @@ -503,6 +512,9 @@ vp9_highbd_block_error = vp9_highbd_block_error_c; if (flags & HAS_SSE2) vp9_highbd_block_error = vp9_highbd_block_error_sse2; + vp9_highbd_iht4x4_16_add = vp9_highbd_iht4x4_16_add_c; + if (flags & HAS_SSE4_1) + vp9_highbd_iht4x4_16_add = vp9_highbd_iht4x4_16_add_sse4_1; vp9_iht16x16_256_add = vp9_iht16x16_256_add_c; if (flags & HAS_SSE2) vp9_iht16x16_256_add = vp9_iht16x16_256_add_sse2;
diff --git a/third_party/libvpx/source/config/win/x64/vp9_rtcd.h b/third_party/libvpx/source/config/win/x64/vp9_rtcd.h index 4b2b1013..4773ba6 100644 --- a/third_party/libvpx/source/config/win/x64/vp9_rtcd.h +++ b/third_party/libvpx/source/config/win/x64/vp9_rtcd.h
@@ -253,7 +253,16 @@ int stride, int tx_type, int bd); -#define vp9_highbd_iht4x4_16_add vp9_highbd_iht4x4_16_add_c +void vp9_highbd_iht4x4_16_add_sse4_1(const tran_low_t* input, + uint16_t* dest, + int stride, + int tx_type, + int bd); +RTCD_EXTERN void (*vp9_highbd_iht4x4_16_add)(const tran_low_t* input, + uint16_t* dest, + int stride, + int tx_type, + int bd); void vp9_highbd_iht8x8_64_add_c(const tran_low_t* input, uint16_t* dest, @@ -467,6 +476,9 @@ vp9_fdct8x8_quant = vp9_fdct8x8_quant_c; if (flags & HAS_SSSE3) vp9_fdct8x8_quant = vp9_fdct8x8_quant_ssse3; + vp9_highbd_iht4x4_16_add = vp9_highbd_iht4x4_16_add_c; + if (flags & HAS_SSE4_1) + vp9_highbd_iht4x4_16_add = vp9_highbd_iht4x4_16_add_sse4_1; vp9_quantize_fp = vp9_quantize_fp_sse2; if (flags & HAS_SSSE3) vp9_quantize_fp = vp9_quantize_fp_ssse3;
diff --git a/third_party/libxml/OWNERS b/third_party/libxml/OWNERS index eedc7e45..b4a51977 100644 --- a/third_party/libxml/OWNERS +++ b/third_party/libxml/OWNERS
@@ -1,6 +1,5 @@ # There's no real owners here. If you're familiar with the code please send # a CL to add yourself here. -joelhockey@chromium.org dcheng@chromium.org scottmg@chromium.org
diff --git a/third_party/snappy/OWNERS b/third_party/snappy/OWNERS index c6b9aa9f..59814dec 100644 --- a/third_party/snappy/OWNERS +++ b/third_party/snappy/OWNERS
@@ -6,4 +6,4 @@ michaeln@chromium.org # TEAM: storage-dev@chromium.org -# COMPONENT: Blink>Storage +# COMPONENT: Internals>Storage
diff --git a/third_party/sqlite/OWNERS b/third_party/sqlite/OWNERS index b714e8a..03c959e 100644 --- a/third_party/sqlite/OWNERS +++ b/third_party/sqlite/OWNERS
@@ -5,4 +5,4 @@ michaeln@chromium.org # TEAM: storage-dev@chromium.org -# COMPONENT: Blink>Storage +# COMPONENT: Internals>Storage
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index dc4dd5e..b9c9b94 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -1811,6 +1811,13 @@ <int value="12" label="384 kHz"/> </enum> +<enum name="AudioStreamFormatRelatedInitError"> + <int value="0" label="Unsupported format"/> + <int value="1" label="Unsupported format when conversion was used"/> + <int value="2" label="Invalid argument"/> + <int value="3" label="Invalid argument when conversion was used"/> +</enum> + <enum name="AudioStreamOpenResult"> <int value="0" label="OK"/> <int value="1" label="CREATE_INSTANCE"/> @@ -9057,6 +9064,15 @@ <int value="2" label="7.2 or later"/> </enum> +<enum name="DisplayMirrorModeTypes"> + <summary> + Defines the types of mirror mode in which displays connected to the device + are in. + </summary> + <int value="0" label="Normal mirror mode"/> + <int value="1" label="Mixed mirror mode"/> +</enum> + <enum name="DistillableType"> <int value="0" label="Not distillable"/> <int value="1" label="Non-mobile-friendly distillable"/> @@ -25450,6 +25466,7 @@ <int value="-1461261930" label="OutOfBlinkCORS:disabled"/> <int value="-1460462432" label="disable-media-source"/> <int value="-1456004000" label="VrShell:disabled"/> + <int value="-1455852875" label="WebAuthentication:disabled"/> <int value="-1454397907" label="OptimizationHints:disabled"/> <int value="-1450576851" label="OmniboxUIExperimentVerticalLayout:enabled"/> <int value="-1446425986" label="ProtectSyncCredentialOnReauth:disabled"/> @@ -26706,6 +26723,7 @@ <int value="1861251313" label="enable-message-center-always-scroll-up-upon-notification-removal"/> <int value="1862207743" label="enable-android-spellchecker"/> + <int value="1863622457" label="WebAuthentication:enabled"/> <int value="1865068568" label="disable-audio-support-for-desktop-share"/> <int value="1865799183" label="javascript-harmony"/> <int value="1865963858" label="tls13-variant"/> @@ -28881,6 +28899,18 @@ <int value="2" label="SUCCESS">All operations succeeded.</int> </enum> +<enum name="MultiDisplayModeDisplayCountRanges"> + <summary> + Defines the ranges in which the number of displays connected in multi + display mode may reside. + </summary> + <int value="0" label="2 displays"/> + <int value="1" label="(2 to 4] displays"/> + <int value="2" label="(4 to 6] displays"/> + <int value="3" label="(6 to 8] displays"/> + <int value="4" label="More than 8 displays"/> +</enum> + <enum name="MultiDisplayModes"> <summary> Defines the modes in which displays connected to the device are in. @@ -36982,6 +37012,7 @@ <int value="25" label="Unthrottled"/> <int value="26" label="InternalTest"/> <int value="27" label="InternalWebCrypto"/> + <int value="28" label="InternalIndexedDB"/> </enum> <enum name="RendererSchedulerThreadType"> @@ -43032,18 +43063,6 @@ <int value="7" label="kNoStore"/> </enum> -<enum name="UnifiedDesktopDisplayCountRanges"> - <summary> - Defines the ranges in which the number of displays connected in Unified Mode - may reside - </summary> - <int value="0" label="2 displays"/> - <int value="1" label="(2 to 4] displays"/> - <int value="2" label="(4 to 6] displays"/> - <int value="3" label="(6 to 8] displays"/> - <int value="4" label="More than 8 displays"/> -</enum> - <enum name="UniformityTrialGroupNotActive"> <int value="0" label="Invalid"/> <int value="1" label="Group not reported"/>
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index 3645f4f..166bf4f7 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml
@@ -10429,6 +10429,14 @@ </summary> </histogram> +<histogram name="Compositing.Browser.CompositorFrame.Quads" units="quads"> + <owner>ccameron@chromium.org</owner> + <summary> + The total number of quads in all render passes in a CompositorFrame. This is + logged as the CompositorFrame is submitted to its surface. + </summary> +</histogram> + <histogram name="Compositing.Browser.DisplayListRecordingSource.UpdateInvalidatedAreaPerMs" units="pixels/ms"> @@ -10653,6 +10661,15 @@ </summary> </histogram> +<histogram name="Compositing.Display.Draw.Quads" units="quads"> + <owner>ccameron@chromium.org</owner> + <summary> + The total number of quads in all render passes in the CompositorFrame that + is produced by surface aggregation. This is logged once per frame, when the + frame is drawn. + </summary> +</histogram> + <histogram name="Compositing.DisplayListRecordingSource.UpdateInvalidatedAreaPerMs" units="pixels/ms"> @@ -10797,6 +10814,14 @@ </summary> </histogram> +<histogram name="Compositing.Renderer.CompositorFrame.Quads" units="quads"> + <owner>ccameron@chromium.org</owner> + <summary> + The total number of quads in all render passes in a CompositorFrame. This is + logged as the CompositorFrame is submitted to its surface. + </summary> +</histogram> + <histogram name="Compositing.Renderer.DisplayListRecordingSource.UpdateInvalidatedAreaPerMs" units="pixels/ms"> @@ -15503,22 +15528,43 @@ </summary> </histogram> +<histogram name="DisplayManager.MirroringDisplayCountRanges" + enum="MultiDisplayModeDisplayCountRanges"> + <owner>weidongg@chromium.org</owner> + <summary> + The number of displays connected to the device that are in software or + hardware mirror mode. This is emitted once when the normal or mixed mirror + mode is enabled through API call, or the display configuration changes (e.g. + adding or removing a display) when mirror mode is on. + </summary> +</histogram> + +<histogram name="DisplayManager.MirrorModeTypes" enum="DisplayMirrorModeTypes"> + <owner>weidongg@chromium.org</owner> + <summary> + The types of mirror mode in which the displays connected to the device are + in. This is emitted once when the normal or mixed mirror mode is enabled + through API call, or the display configuration changes ( e.g. adding or + removing a display) when mirror mode is on. + </summary> +</histogram> + <histogram name="DisplayManager.MultiDisplayMode" enum="MultiDisplayModes"> <owner>afakhry@chromium.org</owner> <summary> - The mode in which the connected displays to the device is in. This is + The mode in which the connected displays to the device are in. This is emitted once when displays are added or removed, or when the user changes the mode by e.g. enabling mirror or unified modes. </summary> </histogram> <histogram name="DisplayManager.UnifiedDesktopDisplayCountRange" - enum="UnifiedDesktopDisplayCountRanges"> + enum="MultiDisplayModeDisplayCountRanges"> <owner>afakhry@chromium.org</owner> <summary> - The the number of displays connected to the device when Unified Desktop mode - is on. This is emitted when Unified Desktop mode is turned on, or the - displays are added or removed while in Unified Mode. + The number of displays connected to the device when Unified Desktop mode is + on. This is emitted when Unified Desktop mode is turned on, or the displays + are added or removed while in Unified Mode. </summary> </histogram> @@ -33153,6 +33199,17 @@ </summary> </histogram> +<histogram name="Media.Audio.Capture.Win.InitError.FormatRelated" + enum="AudioStreamFormatRelatedInitError"> + <owner>grunell@chromium.org</owner> + <summary> + Errors from IAudioClient::Initialize() in + WASAPIAudioInputStream::InitializeAudioEngine on Windows that are related to + the audio format. Each error is split by whether format conversion was used + or not. + </summary> +</histogram> + <histogram name="Media.Audio.Capture.Win.Open" enum="AudioStreamOpenResult"> <owner>tommi@chromium.org</owner> <summary> @@ -95073,8 +95130,8 @@ <histogram name="Variations.SeedFreshness" units="minutes"> <owner>asvitkine@chromium.org</owner> <summary> - The time interval between when the variations seed was last downloaded and - when it was used. + The time interval between when the variations seed was downloaded and when + it was used. Not recorded for expired seeds. </summary> </histogram>
diff --git a/tools/metrics/ukm/ukm.xml b/tools/metrics/ukm/ukm.xml index 30493da..8ed2946 100644 --- a/tools/metrics/ukm/ukm.xml +++ b/tools/metrics/ukm/ukm.xml
@@ -2541,4 +2541,25 @@ </metric> </event> +<event name="XR.PageSession" singular="True"> + <owner>offenwanger@chromium.org</owner> + <summary> + Records properties of page use in XR, including VR browsing and WebXR + presentation. + </summary> + <metric name="EnteredFullscreen"> + <summary> + A boolean that is set to 1 if the user requested fullscreen while in XR on + some element on the page. + </summary> + </metric> + <metric name="TimeOnPage"> + <summary> + The aproximate amount of time the user spends on a page in XR in seconds. + Times are reported accurately when low, for example, under a minute, and + get rounded to minutes and then hours as they get larger. + </summary> + </metric> +</event> + </ukm-configuration>
diff --git a/tools/perf/benchmarks/speedometer2.py b/tools/perf/benchmarks/speedometer2.py index a6145a1..e9301de9 100644 --- a/tools/perf/benchmarks/speedometer2.py +++ b/tools/perf/benchmarks/speedometer2.py
@@ -6,6 +6,7 @@ """ import os +import re from core import path_util from core import perf_benchmark @@ -19,11 +20,32 @@ _SPEEDOMETER_DIR = os.path.join(path_util.GetChromiumSrcDir(), 'third_party', 'WebKit', 'PerformanceTests', 'Speedometer') +_SPEEDOMETER_SUITE_NAME_BASE = '{0}-TodoMVC' +_SPEEDOMETER_SUITES = [ + 'VanillaJS', + 'Vanilla-ES2015', + 'Vanilla-ES2015-Babel-Webpack', + 'React', + 'React-Redux', + 'EmberJS', + 'EmberJS-Debug', + 'BackboneJS', + 'AngularJS', + 'Angular2-TypeScript', + 'VueJS', + 'jQuery', + 'Preact', + 'Inferno', + 'Elm', + 'Flight' +] class Speedometer2Measurement(legacy_page_test.LegacyPageTest): - def __init__(self): + def __init__(self, should_filter_suites, filtered_suite_names=None): super(Speedometer2Measurement, self).__init__() + self.should_filter_suites_ = should_filter_suites + self.filtered_suites_ = filtered_suite_names def ValidateAndMeasurePage(self, page, tab, results): tab.WaitForDocumentReadyStateToBeComplete() @@ -33,6 +55,13 @@ if tab.browser.platform.GetOSName() == 'android': iterationCount = 3 + if self.should_filter_suites_: + tab.ExecuteJavaScript(""" + Suites.forEach(function(suite) { + suite.disabled = {{ filtered_suites }}.indexOf(suite.name) < 0; + }); + """, filtered_suites=self.filtered_suites_) + enabled_suites = tab.EvaluateJavaScript(""" (function() { var suitesNames = []; @@ -60,14 +89,16 @@ """, count=iterationCount) tab.WaitForJavaScriptCondition('testDone', timeout=600) - results.AddValue(list_of_scalar_values.ListOfScalarValues( - page, 'Total', 'ms', - tab.EvaluateJavaScript('suiteValues.map(each => each.total)'), - important=True)) - results.AddValue(list_of_scalar_values.ListOfScalarValues( - page, 'RunsPerMinute', 'score', - tab.EvaluateJavaScript('suiteValues.map(each => each.score)'), - important=True)) + + if not self.should_filter_suites_: + results.AddValue(list_of_scalar_values.ListOfScalarValues( + page, 'Total', 'ms', + tab.EvaluateJavaScript('suiteValues.map(each => each.total)'), + important=True)) + results.AddValue(list_of_scalar_values.ListOfScalarValues( + page, 'RunsPerMinute', 'score', + tab.EvaluateJavaScript('suiteValues.map(each => each.score)'), + important=True)) # Extract the timings for each suite for suite_name in enabled_suites: @@ -86,12 +117,34 @@ @benchmark.Owner(emails=['hablich@chromium.org']) class Speedometer2(perf_benchmark.PerfBenchmark): - test = Speedometer2Measurement + """Speedometer2 Benchmark. + Runs all the speedometer 2 suites by default. Add --suite=<regex> to filter + out suites, and only run suites whose names are matched by the regular + expression provided. + """ @classmethod def Name(cls): return 'speedometer2' + @staticmethod + def GetFullSuiteName(name): + return _SPEEDOMETER_SUITE_NAME_BASE.format(name) + + @staticmethod + def GetSuites(suite_regex): + if not suite_regex: + return [] + exp = re.compile(suite_regex) + return [name for name in _SPEEDOMETER_SUITES + if exp.search(Speedometer2.GetFullSuiteName(name))] + + def CreatePageTest(self, options): + should_filter_suites = bool(options.suite) + filtered_suite_names = map(Speedometer2.GetFullSuiteName, + Speedometer2.GetSuites(options.suite)) + return Speedometer2Measurement(should_filter_suites, filtered_suite_names) + def CreateStorySet(self, options): ps = story.StorySet(base_dir=_SPEEDOMETER_DIR, serving_dirs=[_SPEEDOMETER_DIR]) @@ -99,6 +152,20 @@ 'file://InteractiveRunner.html', ps, ps.base_dir, name='Speedometer2')) return ps + @classmethod + def AddBenchmarkCommandLineArgs(cls, parser): + parser.add_option('--suite', type="string", + help="Only runs suites that match regex provided") + + @classmethod + def ProcessCommandLineArgs(cls, parser, args): + if args.suite: + try: + if not Speedometer2.GetSuites(args.suite): + raise parser.error('--suite: No matches.') + except re.error: + raise parser.error('--suite: Invalid regex.') + @benchmark.Owner(emails=['hablich@chromium.org']) class V8Speedometer2Future(Speedometer2):
diff --git a/ui/accelerated_widget_mac/ca_renderer_layer_tree.mm b/ui/accelerated_widget_mac/ca_renderer_layer_tree.mm index 386a1f7..bedf875 100644 --- a/ui/accelerated_widget_mac/ca_renderer_layer_tree.mm +++ b/ui/accelerated_widget_mac/ca_renderer_layer_tree.mm
@@ -535,7 +535,14 @@ gl::GLImageIOSurface::FromGLImage(params.image); DCHECK(io_surface_image); io_surface = io_surface_image->io_surface(); - cv_pixel_buffer = io_surface_image->cv_pixel_buffer(); + // Temporary investagtive fix for https://crbug.com/702369. It appears upon + // investigation that not using the original CVPixelBufferRef which came + // from the VTDecompressionSession prevents or minimizes flashing of + // incorrect content. Disable the CVPixelBufferRef path for the moment to + // determine if this fixes the bug for users. + // TODO(ccameron): If this indeed causes the bug to disappear, then + // extirpate the CVPixelBufferRef path. + // cv_pixel_buffer = io_surface_image->cv_pixel_buffer(); } content_layers.push_back(
diff --git a/ui/app_list/app_list_features.cc b/ui/app_list/app_list_features.cc index 9c6e80b..c2e76217 100644 --- a/ui/app_list/app_list_features.cc +++ b/ui/app_list/app_list_features.cc
@@ -6,6 +6,7 @@ #include "base/feature_list.h" #include "base/metrics/field_trial_params.h" +#include "ui/app_list/app_list_switches.h" namespace app_list { namespace features { @@ -16,6 +17,8 @@ base::FEATURE_DISABLED_BY_DEFAULT}; const base::Feature kEnablePlayStoreAppSearch{"EnablePlayStoreAppSearch", base::FEATURE_ENABLED_BY_DEFAULT}; +const base::Feature kEnableTouchableAppContextMenu{ + "EnableTouchableAppContextMenu", base::FEATURE_DISABLED_BY_DEFAULT}; bool IsAnswerCardEnabled() { // Not using local static variable to allow tests to change this value. @@ -37,6 +40,11 @@ return base::FeatureList::IsEnabled(kEnablePlayStoreAppSearch); } +bool IsTouchableAppContextMenuEnabled() { + return switches::IsTouchableAppContextMenuEnabled() || + base::FeatureList::IsEnabled(kEnableTouchableAppContextMenu); +} + std::string AnswerServerUrl() { const std::string experiment_url = base::GetFieldTrialParamValueByFeature(kEnableAnswerCard, "ServerUrl");
diff --git a/ui/app_list/app_list_features.h b/ui/app_list/app_list_features.h index 5ab2da9..0cfdc64 100644 --- a/ui/app_list/app_list_features.h +++ b/ui/app_list/app_list_features.h
@@ -29,10 +29,14 @@ // Enables the Play Store app search. APP_LIST_EXPORT extern const base::Feature kEnablePlayStoreAppSearch; +// Enables touchable context menus for app items in the shelf and app list. +APP_LIST_EXPORT extern const base::Feature kEnableTouchableAppContextMenu; + bool APP_LIST_EXPORT IsAnswerCardEnabled(); bool APP_LIST_EXPORT IsBackgroundBlurEnabled(); bool APP_LIST_EXPORT IsFullscreenAppListEnabled(); bool APP_LIST_EXPORT IsPlayStoreAppSearchEnabled(); +bool APP_LIST_EXPORT IsTouchableAppContextMenuEnabled(); std::string APP_LIST_EXPORT AnswerServerUrl(); std::string APP_LIST_EXPORT AnswerServerQuerySuffix();
diff --git a/ui/app_list/app_list_switches.cc b/ui/app_list/app_list_switches.cc index 62cb125..da1477b 100644 --- a/ui/app_list/app_list_switches.cc +++ b/ui/app_list/app_list_switches.cc
@@ -27,6 +27,9 @@ const char kDisableDriveSearchInChromeLauncher[] = "disable-drive-search-in-app-launcher"; +const char kEnableTouchableAppContextMenu[] = + "enable-touchable-app-context-menus"; + // If set, the app list will forget it has been installed on startup. Note this // doesn't prevent the app list from running, it just makes Chrome think the app // list hasn't been enabled (as in kEnableAppList) yet. @@ -37,6 +40,11 @@ return true; } +bool IsTouchableAppContextMenuEnabled() { + return base::CommandLine::ForCurrentProcess()->HasSwitch( + kEnableTouchableAppContextMenu); +} + bool ShouldNotDismissOnBlur() { return base::CommandLine::ForCurrentProcess()->HasSwitch( kDisableAppListDismissOnBlur);
diff --git a/ui/app_list/app_list_switches.h b/ui/app_list/app_list_switches.h index b507407..8f92d4f6 100644 --- a/ui/app_list/app_list_switches.h +++ b/ui/app_list/app_list_switches.h
@@ -17,6 +17,7 @@ APP_LIST_EXPORT extern const char kEnableAppList[]; APP_LIST_EXPORT extern const char kEnableDriveSearchInChromeLauncher[]; APP_LIST_EXPORT extern const char kDisableDriveSearchInChromeLauncher[]; +APP_LIST_EXPORT extern const char kEnableTouchableAppContextMenu[]; APP_LIST_EXPORT extern const char kResetAppListInstallState[]; bool APP_LIST_EXPORT IsAppListSyncEnabled(); @@ -25,6 +26,8 @@ bool APP_LIST_EXPORT IsVoiceSearchEnabled(); +bool APP_LIST_EXPORT IsTouchableAppContextMenuEnabled(); + // Determines whether the app list should not be dismissed on focus loss. bool APP_LIST_EXPORT ShouldNotDismissOnBlur();
diff --git a/ui/display/manager/display_manager.cc b/ui/display/manager/display_manager.cc index dc0bf7dd..cf3c645 100644 --- a/ui/display/manager/display_manager.cc +++ b/ui/display/manager/display_manager.cc
@@ -56,6 +56,14 @@ // in case that the offset value is too large. const int kMinimumOverlapForInvalidOffset = 100; +// The UMA histogram that logs the types of mirror mode. +const char kMirrorModeTypesHistogram[] = "DisplayManager.MirrorModeTypes"; + +// The UMA histogram that logs the range in which the number of connected +// displays in mirror mode can reside. +const char kMirroringDisplayCountRangesHistogram[] = + "DisplayManager.MirroringDisplayCountRanges"; + struct DisplaySortFunctor { bool operator()(const Display& a, const Display& b) { return CompareDisplayIds(a.id(), b.id()); @@ -241,7 +249,7 @@ } // Defines the ranges in which the number of displays can reside as reported by -// UMA in the case of Unified Desktop mode. +// UMA in the case of Unified Desktop mode or mirror mode. // // WARNING: These values are persisted to logs. Entries should not be // renumbered and numeric values should never be reused. @@ -262,8 +270,9 @@ }; // Returns the display count range bucket in which |display_count| resides. -DisplayCountRange GetUnifiedDisplayCountRange(int display_count) { - // Note that Unified Mode cannot be enabled with a single display. +DisplayCountRange GetDisplayCountRange(int display_count) { + // Note that Unified Mode and mirror mode cannot be enabled with a single + // display. DCHECK_GE(display_count, 2); if (display_count <= 2) @@ -281,6 +290,21 @@ return DisplayCountRange::kGreaterThan8Displays; } +// Defines the types of mirror mode in which the displays connected to the +// device are in as reported by UMA. +// +// WARNING: These values are persisted to logs. Entries should not be renumbered +// and numeric values should never be reused. +enum class MirrorModeTypes { + // Normal mirror mode. + kNormal = 0, + // Mixed mirror mode. + kMixed = 1, + + // Always keep this the last item. + kCount, +}; + } // namespace DisplayManager::BeginEndNotifier::BeginEndNotifier( @@ -1091,6 +1115,18 @@ if (delegate_) delegate_->PostDisplayConfigurationChange(); + if (mirror_mode) { + UMA_HISTOGRAM_ENUMERATION( + kMirroringDisplayCountRangesHistogram, + GetDisplayCountRange(GetMirroringDestinationDisplayIdList().size() + 1), + DisplayCountRange::kCount); + UMA_HISTOGRAM_ENUMERATION(kMirrorModeTypesHistogram, + mixed_mirror_mode_params_ + ? MirrorModeTypes::kMixed + : MirrorModeTypes::kNormal, + MirrorModeTypes::kCount); + } + // Create the mirroring window asynchronously after all displays // are added so that it can mirror the display newly added. This can // happen when switching from dock mode to software mirror mode. @@ -1880,7 +1916,7 @@ UMA_HISTOGRAM_ENUMERATION( "DisplayManager.UnifiedDesktopDisplayCountRange", - GetUnifiedDisplayCountRange(software_mirroring_display_list_.size()), + GetDisplayCountRange(software_mirroring_display_list_.size()), DisplayCountRange::kCount); }
diff --git a/ui/gfx/mojo/buffer_types_struct_traits.cc b/ui/gfx/mojo/buffer_types_struct_traits.cc index 9663837..3489eda 100644 --- a/ui/gfx/mojo/buffer_types_struct_traits.cc +++ b/ui/gfx/mojo/buffer_types_struct_traits.cc
@@ -58,8 +58,9 @@ handle.type != gfx::DXGI_SHARED_HANDLE && handle.type != gfx::ANDROID_HARDWARE_BUFFER) return mojo::ScopedSharedBufferHandle(); - return mojo::WrapSharedMemoryHandle(handle.handle, handle.handle.GetSize(), - false); + return mojo::WrapSharedMemoryHandle( + handle.handle, handle.handle.GetSize(), + mojo::UnwrappedSharedMemoryHandleProtection::kReadWrite); } const gfx::NativePixmapHandle&
diff --git a/ui/gl/gl_image_io_surface_unittest.cc b/ui/gl/gl_image_io_surface_unittest.cc index 4e3da04..1b7c837 100644 --- a/ui/gl/gl_image_io_surface_unittest.cc +++ b/ui/gl/gl_image_io_surface_unittest.cc
@@ -82,8 +82,8 @@ GLImageRGBTestTypes); using GLImageBindTestTypes = testing::Types< - GLImageIOSurfaceTestDelegate<gfx::BufferFormat::BGRA_8888>, - GLImageIOSurfaceTestDelegate<gfx::BufferFormat::BGRX_1010102>>; + // TODO(mcasas): enable BGRX_1010102 entry, https://crbug.com/803473. + GLImageIOSurfaceTestDelegate<gfx::BufferFormat::BGRA_8888>>; INSTANTIATE_TYPED_TEST_CASE_P(GLImageIOSurface, GLImageBindTest,
diff --git a/ui/ozone/platform/cast/gl_surface_cast.cc b/ui/ozone/platform/cast/gl_surface_cast.cc index d71bc9f3..dd50b11c 100644 --- a/ui/ozone/platform/cast/gl_surface_cast.cc +++ b/ui/ozone/platform/cast/gl_surface_cast.cc
@@ -6,7 +6,9 @@ #include "base/feature_list.h" #include "base/memory/ptr_util.h" +#include "base/strings/string_number_conversions.h" #include "chromecast/base/cast_features.h" +#include "chromecast/base/chromecast_switches.h" #include "ui/gfx/vsync_provider.h" #include "ui/ozone/common/egl_util.h" #include "ui/ozone/platform/cast/gl_ozone_egl_cast.h" @@ -17,10 +19,20 @@ // or make it dynamic that throttles framerate if device is overheating. base::TimeDelta GetVSyncInterval() { if (base::FeatureList::IsEnabled(chromecast::kTripleBuffer720)) { - return base::TimeDelta::FromSeconds(1) / 59.9; - } else { - return base::TimeDelta::FromSeconds(2) / 59.9; + return base::TimeDelta::FromSeconds(1) / 59.94; } + + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); + if (command_line->HasSwitch(switches::kVSyncInterval)) { + const std::string interval_str = + command_line->GetSwitchValueASCII(switches::kVSyncInterval); + double interval = 0; + if (base::StringToDouble(interval_str, &interval) && interval > 0) { + return base::TimeDelta::FromSeconds(1) / interval; + } + } + + return base::TimeDelta::FromSeconds(2) / 59.94; } } // namespace
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc index 19dc052..deaf9cb 100644 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
@@ -999,6 +999,7 @@ if (is_fullscreen_ == fullscreen) return; is_fullscreen_ = fullscreen; + OnFullscreenStateChanged(); if (is_fullscreen_) delayed_resize_task_.Cancel(); @@ -1327,6 +1328,8 @@ void DesktopWindowTreeHostX11::OnMaximizedStateChanged() {} +void DesktopWindowTreeHostX11::OnFullscreenStateChanged() {} + //////////////////////////////////////////////////////////////////////////////// // DesktopWindowTreeHostX11, private:
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h index c7aead0e..674951e 100644 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h
@@ -175,6 +175,9 @@ // Called after the window is maximized or restored. virtual void OnMaximizedStateChanged(); + // Called after the window is fullscreened or unfullscreened. + virtual void OnFullscreenStateChanged(); + private: friend class DesktopWindowTreeHostX11HighDPITest; // Initializes our X11 surface to draw on. This method performs all
diff --git a/url/origin_unittest.cc b/url/origin_unittest.cc index 7cd797f..e0445736 100644 --- a/url/origin_unittest.cc +++ b/url/origin_unittest.cc
@@ -379,23 +379,23 @@ struct TestCases { const char* scheme; const char* host; - uint16_t port; + uint16_t port = 80; } cases[] = {{"", "", 0}, {"data", "", 0}, {"blob", "", 0}, {"filesystem", "", 0}, - {"data", "example.com", 80}, - {"http", "☃.net", 80}, - {"http\nmore", "example.com", 80}, - {"http\rmore", "example.com", 80}, - {"http\n", "example.com", 80}, - {"http\r", "example.com", 80}, - {"http", "example.com\nnot-example.com", 80}, - {"http", "example.com\rnot-example.com", 80}, - {"http", "example.com\n", 80}, - {"http", "example.com\r", 80}, + {"data", "example.com"}, + {"http", "☃.net"}, + {"http\nmore", "example.com"}, + {"http\rmore", "example.com"}, + {"http\n", "example.com"}, + {"http\r", "example.com"}, + {"http", "example.com\nnot-example.com"}, + {"http", "example.com\rnot-example.com"}, + {"http", "example.com\n"}, + {"http", "example.com\r"}, {"http", "example.com", 0}, - {"file", "", 80}}; + {"file", ""}}; for (const auto& test : cases) { SCOPED_TRACE(testing::Message() << test.scheme << "://" << test.host << ":" @@ -418,13 +418,13 @@ size_t scheme_length; const char* host; size_t host_length; - uint16_t port; - } cases[] = {{"http\0more", 9, "example.com", 11, 80}, - {"http\0", 5, "example.com", 11, 80}, - {"\0http", 5, "example.com", 11, 80}, - {"http", 4, "example.com\0not-example.com", 27, 80}, - {"http", 4, "example.com\0", 12, 80}, - {"http", 4, "\0example.com", 12, 80}}; + uint16_t port = 80; + } cases[] = {{"http\0more", 9, "example.com", 11}, + {"http\0", 5, "example.com", 11}, + {"\0http", 5, "example.com", 11}, + {"http", 4, "example.com\0not-example.com", 27}, + {"http", 4, "example.com\0", 12}, + {"http", 4, "\0example.com", 12}}; for (const auto& test : cases) { SCOPED_TRACE(testing::Message() << test.scheme << "://" << test.host << ":"