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

Side by Side Diff: base/supports_user_data.cc

Issue 10827207: Mountain Lion: use the system download progress. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase only Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/supports_user_data.h" 5 #include "base/supports_user_data.h"
6 6
7 namespace base { 7 namespace base {
8 8
9 SupportsUserData::SupportsUserData() {} 9 SupportsUserData::SupportsUserData() {}
10 10
11 SupportsUserData::Data* SupportsUserData::GetUserData(const void* key) const { 11 SupportsUserData::Data* SupportsUserData::GetUserData(const void* key) const {
12 DataMap::const_iterator found = user_data_.find(key); 12 DataMap::const_iterator found = user_data_.find(key);
13 if (found != user_data_.end()) 13 if (found != user_data_.end())
14 return found->second.get(); 14 return found->second.get();
15 return NULL; 15 return NULL;
16 } 16 }
17 17
18 void SupportsUserData::SetUserData(const void* key, Data* data) { 18 void SupportsUserData::SetUserData(const void* key, Data* data) {
19 user_data_[key] = linked_ptr<Data>(data); 19 user_data_[key] = linked_ptr<Data>(data);
20 } 20 }
21 21
22 void SupportsUserData::RemoveUserData(const void* key) {
23 user_data_.erase(key);
24 }
25
22 SupportsUserData::~SupportsUserData() {} 26 SupportsUserData::~SupportsUserData() {}
23 27
24 } // namespace base 28 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698