From e59eca16010c109a5e3e4922189c8b264d34caa9 Mon Sep 17 00:00:00 2001 From: dcheng Date: Fri, 18 Dec 2015 09:48:00 -0800 Subject: =?UTF-8?q?Convert=20Pass()=E2=86=92std::move()=20in=20//extension?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BUG=557422 Review URL: https://codereview.chromium.org/1537893002 Cr-Commit-Position: refs/heads/master@{#366120} --- extensions/browser/app_window/app_window.cc | 3 ++- extensions/browser/app_window/app_window.h | 3 ++- extensions/browser/app_window/app_window_geometry_cache.cc | 4 +++- extensions/browser/app_window/app_window_geometry_cache_unittest.cc | 6 ++++-- 4 files changed, 11 insertions(+), 5 deletions(-) (limited to 'extensions/browser/app_window') diff --git a/extensions/browser/app_window/app_window.cc b/extensions/browser/app_window/app_window.cc index 4a508fc..98c21f3 100644 --- a/extensions/browser/app_window/app_window.cc +++ b/extensions/browser/app_window/app_window.cc @@ -6,6 +6,7 @@ #include #include +#include #include #include "base/callback_helpers.h" @@ -574,7 +575,7 @@ void AppWindow::SetAppIconUrl(const GURL& url) { } void AppWindow::UpdateShape(scoped_ptr region) { - native_app_window_->UpdateShape(region.Pass()); + native_app_window_->UpdateShape(std::move(region)); } void AppWindow::UpdateDraggableRegions( diff --git a/extensions/browser/app_window/app_window.h b/extensions/browser/app_window/app_window.h index b0a0c8e..0654073 100644 --- a/extensions/browser/app_window/app_window.h +++ b/extensions/browser/app_window/app_window.h @@ -6,6 +6,7 @@ #define EXTENSIONS_BROWSER_APP_WINDOW_APP_WINDOW_H_ #include +#include #include #include "base/memory/scoped_ptr.h" @@ -361,7 +362,7 @@ class AppWindow : public content::WebContentsDelegate, bool is_ime_window() const { return is_ime_window_; } void SetAppWindowContentsForTesting(scoped_ptr contents) { - app_window_contents_ = contents.Pass(); + app_window_contents_ = std::move(contents); } protected: diff --git a/extensions/browser/app_window/app_window_geometry_cache.cc b/extensions/browser/app_window/app_window_geometry_cache.cc index 4b3bb48..1413ce7 100644 --- a/extensions/browser/app_window/app_window_geometry_cache.cc +++ b/extensions/browser/app_window/app_window_geometry_cache.cc @@ -4,6 +4,8 @@ #include "extensions/browser/app_window/app_window_geometry_cache.h" +#include + #include "base/bind.h" #include "base/stl_util.h" #include "base/strings/string_number_conversions.h" @@ -132,7 +134,7 @@ void AppWindowGeometryCache::SyncToStorage() { OnGeometryCacheChanged(extension_id, it->first, bounds)); } - prefs_->SetGeometryCache(extension_id, dict.Pass()); + prefs_->SetGeometryCache(extension_id, std::move(dict)); } } diff --git a/extensions/browser/app_window/app_window_geometry_cache_unittest.cc b/extensions/browser/app_window/app_window_geometry_cache_unittest.cc index 1b42ec1..426d4af 100644 --- a/extensions/browser/app_window/app_window_geometry_cache_unittest.cc +++ b/extensions/browser/app_window/app_window_geometry_cache_unittest.cc @@ -4,6 +4,8 @@ #include "extensions/browser/app_window/app_window_geometry_cache.h" +#include + #include "base/files/file_path.h" #include "base/memory/scoped_ptr.h" #include "base/prefs/mock_pref_change_callback.h" @@ -88,7 +90,7 @@ void AppWindowGeometryCacheTest::SetUp() { new user_prefs::PrefRegistrySyncable; // Prefs should be registered before the PrefService is created. ExtensionPrefs::RegisterProfilePrefs(pref_registry); - pref_service_ = factory.Create(pref_registry).Pass(); + pref_service_ = factory.Create(pref_registry); extension_prefs_.reset(ExtensionPrefs::Create( browser_context(), pref_service_.get(), @@ -128,7 +130,7 @@ void AppWindowGeometryCacheTest::AddGeometryAndLoadExtension( value->SetInteger("screen_bounds_h", screen_bounds.height()); value->SetInteger("state", state); dict->SetWithoutPathExpansion(window_id, value); - extension_prefs_->SetGeometryCache(extension_id, dict.Pass()); + extension_prefs_->SetGeometryCache(extension_id, std::move(dict)); LoadExtension(extension_id); } -- cgit v1.1