| OLD | NEW |
| 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 "content/public/browser/browser_context.h" | 5 #include "content/public/browser/browser_context.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | |
| 8 #include "content/public/browser/browser_thread.h" | |
| 9 #include "content/public/browser/notification_details.h" | |
| 10 #include "content/public/browser/notification_service.h" | |
| 11 #include "content/public/browser/notification_source.h" | |
| 12 #include "content/public/browser/notification_types.h" | |
| 13 | |
| 14 namespace content { | 7 namespace content { |
| 15 | 8 |
| 9 BrowserContext::UserData* BrowserContext::GetUserData(const void* key) const { |
| 10 UserDataMap::const_iterator found = user_data_.find(key); |
| 11 if (found != user_data_.end()) |
| 12 return found->second.get(); |
| 13 return NULL; |
| 14 } |
| 15 |
| 16 void BrowserContext::SetUserData(const void* key, UserData* data) { |
| 17 user_data_[key] = linked_ptr<UserData>(data); |
| 18 } |
| 19 |
| 16 BrowserContext::~BrowserContext() { | 20 BrowserContext::~BrowserContext() { |
| 17 NotificationService::current()->Notify( | |
| 18 content::NOTIFICATION_BROWSER_CONTEXT_DESTRUCTION, | |
| 19 content::Source<BrowserContext>(this), | |
| 20 content::NotificationService::NoDetails()); | |
| 21 } | 21 } |
| 22 | 22 |
| 23 } // namespace content | 23 } // namespace content |
| OLD | NEW |