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

Unified Diff: extensions/browser/app_window/app_window_geometry_cache.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
Index: extensions/browser/app_window/app_window_geometry_cache.cc
diff --git a/extensions/browser/app_window/app_window_geometry_cache.cc b/extensions/browser/app_window/app_window_geometry_cache.cc
index b2e13ab6617833242aa2b77c9857694faf3b83c0..87f055595670ee807b21be6b56ebec664b6f4b62 100644
--- a/extensions/browser/app_window/app_window_geometry_cache.cc
+++ b/extensions/browser/app_window/app_window_geometry_cache.cc
@@ -9,6 +9,7 @@
#include <utility>
#include "base/bind.h"
+#include "base/memory/ptr_util.h"
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
@@ -111,7 +112,8 @@ void AppWindowGeometryCache::SyncToStorage() {
eit = extension_data.end();
it != eit;
++it) {
- base::DictionaryValue* value = new base::DictionaryValue;
+ std::unique_ptr<base::DictionaryValue> value =
+ base::MakeUnique<base::DictionaryValue>();
const gfx::Rect& bounds = it->second.bounds;
const gfx::Rect& screen_bounds = it->second.screen_bounds;
DCHECK(!bounds.IsEmpty());
@@ -128,7 +130,7 @@ void AppWindowGeometryCache::SyncToStorage() {
value->SetInteger("state", it->second.window_state);
value->SetString(
"ts", base::Int64ToString(it->second.last_change.ToInternalValue()));
- dict->SetWithoutPathExpansion(it->first, value);
+ dict->SetWithoutPathExpansion(it->first, std::move(value));
FOR_EACH_OBSERVER(
Observer,

Powered by Google App Engine
This is Rietveld 408576698