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

Unified Diff: chrome/browser/background/background_contents_service.cc

Issue 2777063003: Stop passing raw pointers to base::Value API in c/b/chromeos and c/b/extensions (Closed)
Patch Set: Just rebased Created 3 years, 8 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: chrome/browser/background/background_contents_service.cc
diff --git a/chrome/browser/background/background_contents_service.cc b/chrome/browser/background/background_contents_service.cc
index ae384a895717fb16c3ce55ef883fb18400d4c149..1be0bc75dd43da998dccc0a4859b75cc2d1dd92b 100644
--- a/chrome/browser/background/background_contents_service.cc
+++ b/chrome/browser/background/background_contents_service.cc
@@ -11,6 +11,7 @@
#include "base/compiler_specific.h"
#include "base/location.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h"
#include "base/single_thread_task_runner.h"
#include "base/strings/string_util.h"
@@ -763,10 +764,10 @@ void BackgroundContentsService::RegisterBackgroundContents(
}
// No entry for this application yet, so add one.
- base::DictionaryValue* dict = new base::DictionaryValue();
+ auto dict = base::MakeUnique<base::DictionaryValue>();
dict->SetString(kUrlKey, background_contents->GetURL().spec());
dict->SetString(kFrameNameKey, contents_map_[appid].frame_name);
- pref->SetWithoutPathExpansion(base::UTF16ToUTF8(appid), dict);
+ pref->SetWithoutPathExpansion(base::UTF16ToUTF8(appid), std::move(dict));
}
bool BackgroundContentsService::HasRegisteredBackgroundContents(

Powered by Google App Engine
This is Rietveld 408576698