Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Unified Diff: extensions/browser/app_window/app_window_geometry_cache_unittest.cc

Issue 2370633002: replace deprecated version of SetWithoutPathExpansion (Closed)
Patch Set: use MakeUnique Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/browser/app_window/app_window_geometry_cache.cc ('k') | extensions/browser/event_router.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/app_window/app_window_geometry_cache_unittest.cc
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 30f428dd08813d016e4699bb0b8c35e78cdb2ab7..39fc85d62c3dd16e1ae00d5ada0750c7470c743e 100644
--- a/extensions/browser/app_window/app_window_geometry_cache_unittest.cc
+++ b/extensions/browser/app_window/app_window_geometry_cache_unittest.cc
@@ -10,6 +10,7 @@
#include <utility>
#include "base/files/file_path.h"
+#include "base/memory/ptr_util.h"
#include "base/strings/string_number_conversions.h"
#include "components/pref_registry/pref_registry_syncable.h"
#include "components/prefs/mock_pref_change_callback.h"
@@ -120,8 +121,10 @@ void AppWindowGeometryCacheTest::AddGeometryAndLoadExtension(
const gfx::Rect& bounds,
const gfx::Rect& screen_bounds,
ui::WindowShowState state) {
- std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue);
- base::DictionaryValue* value = new base::DictionaryValue;
+ std::unique_ptr<base::DictionaryValue> dict =
+ base::MakeUnique<base::DictionaryValue>();
+ std::unique_ptr<base::DictionaryValue> value =
+ base::MakeUnique<base::DictionaryValue>();
value->SetInteger("x", bounds.x());
value->SetInteger("y", bounds.y());
value->SetInteger("w", bounds.width());
@@ -131,7 +134,7 @@ void AppWindowGeometryCacheTest::AddGeometryAndLoadExtension(
value->SetInteger("screen_bounds_w", screen_bounds.width());
value->SetInteger("screen_bounds_h", screen_bounds.height());
value->SetInteger("state", state);
- dict->SetWithoutPathExpansion(window_id, value);
+ dict->SetWithoutPathExpansion(window_id, std::move(value));
extension_prefs_->SetGeometryCache(extension_id, std::move(dict));
LoadExtension(extension_id);
}
« no previous file with comments | « extensions/browser/app_window/app_window_geometry_cache.cc ('k') | extensions/browser/event_router.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698