| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/chrome_plugin_browsing_context.h" | 5 #include "chrome/browser/chrome_plugin_browsing_context.h" |
| 6 | 6 |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/singleton.h" | 8 #include "base/singleton.h" |
| 9 #include "chrome/browser/browser_thread.h" | 9 #include "chrome/browser/browser_thread.h" |
| 10 #include "chrome/common/notification_service.h" | 10 #include "chrome/common/notification_service.h" |
| 11 | 11 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 } | 46 } |
| 47 | 47 |
| 48 void CPBrowsingContextManager::Observe(NotificationType type, | 48 void CPBrowsingContextManager::Observe(NotificationType type, |
| 49 const NotificationSource& source, | 49 const NotificationSource& source, |
| 50 const NotificationDetails& details) { | 50 const NotificationDetails& details) { |
| 51 DCHECK(type == NotificationType::URL_REQUEST_CONTEXT_RELEASED); | 51 DCHECK(type == NotificationType::URL_REQUEST_CONTEXT_RELEASED); |
| 52 | 52 |
| 53 net::URLRequestContext* context = | 53 net::URLRequestContext* context = |
| 54 Source<net::URLRequestContext>(source).ptr(); | 54 Source<net::URLRequestContext>(source).ptr(); |
| 55 | 55 |
| 56 // Multiple CPBrowsingContexts may refer to the same URLRequestContext. | 56 // Multiple CPBrowsingContexts may refer to the same net::URLRequestContext. |
| 57 for (Map::iterator it(&map_); !it.IsAtEnd(); it.Advance()) { | 57 for (Map::iterator it(&map_); !it.IsAtEnd(); it.Advance()) { |
| 58 if (it.GetCurrentValue() == context) | 58 if (it.GetCurrentValue() == context) |
| 59 map_.Remove(it.GetCurrentKey()); | 59 map_.Remove(it.GetCurrentKey()); |
| 60 } | 60 } |
| 61 | 61 |
| 62 reverse_map_.erase(context); | 62 reverse_map_.erase(context); |
| 63 } | 63 } |
| OLD | NEW |