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

Unified Diff: chrome/browser/extensions/api/storage/setting_sync_data.h

Issue 1141963002: Remove a bunch of DeepCopy() calls in the chrome.storage API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes Created 5 years, 7 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/extensions/api/storage/setting_sync_data.h
diff --git a/chrome/browser/extensions/api/storage/setting_sync_data.h b/chrome/browser/extensions/api/storage/setting_sync_data.h
index 8fc0f91870307b233dd98c943eb1196e5ca5f21c..e4ce557f5223550c0069de957f7789444079ef6e 100644
--- a/chrome/browser/extensions/api/storage/setting_sync_data.h
+++ b/chrome/browser/extensions/api/storage/setting_sync_data.h
@@ -51,6 +51,16 @@ class SettingSyncData {
// Returns the value of the setting.
const base::Value& value() const;
+ // Releases ownership of the value to the caller.
+ //
+ // Be careful when calling this, as SettingSyncData is effectively a
Devlin 2015/05/15 21:59:07 Hmm... Generally, it's best to avoid saying "Be c
not at google - send to devlin 2015/05/15 23:28:30 The blocker is this diff blowing up even more, but
Devlin 2015/05/15 23:58:18 Win.
+ // refcounted wrapper around internal state, which can be shared between
+ // multiple SettingSyncData instances.
+ //
+ // Therefore, releasing the value may unexpectedly release the value from
+ // other SettingSyncData instances.
+ scoped_ptr<base::Value> PassValue();
+
private:
// Ref-counted container for the data.
// TODO(kalman): Use browser_sync::Immutable<Internal>.

Powered by Google App Engine
This is Rietveld 408576698