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

Unified Diff: base/supports_user_data.cc

Issue 9348109: Add extra data to BrowserContext so that content layer and other embedders can stash data with it t… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 10 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: base/supports_user_data.cc
===================================================================
--- base/supports_user_data.cc (revision 0)
+++ base/supports_user_data.cc (revision 0)
@@ -0,0 +1,26 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/supports_user_data.h"
+
+namespace base {
+
+SupportsUserData::SupportsUserData() {
+}
+
+SupportsUserData::~SupportsUserData() {
+}
+
+SupportsUserData::Data* SupportsUserData::GetUserData(const void* key) const {
+ DataMap::const_iterator found = user_data_.find(key);
+ if (found != user_data_.end())
+ return found->second.get();
+ return NULL;
+}
+
+void SupportsUserData::SetUserData(const void* key, Data* data) {
+ user_data_[key] = linked_ptr<Data>(data);
+}
+
+} // namespace base
Property changes on: base\supports_user_data.cc
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698