OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #ifndef CHROME_BROWSER_CHROME_PLUGIN_BROWSING_CONTEXT_H_ | 5 #ifndef CHROME_BROWSER_CHROME_PLUGIN_BROWSING_CONTEXT_H_ |
6 #define CHROME_BROWSER_CHROME_PLUGIN_BROWSING_CONTEXT_H_ | 6 #define CHROME_BROWSER_CHROME_PLUGIN_BROWSING_CONTEXT_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/id_map.h" | |
11 #include "chrome/common/chrome_plugin_api.h" | 10 #include "chrome/common/chrome_plugin_api.h" |
| 11 #include "chrome/common/id_map.h" |
12 #include "chrome/common/notification_registrar.h" | 12 #include "chrome/common/notification_registrar.h" |
13 | 13 |
14 class URLRequestContext; | 14 class URLRequestContext; |
15 | 15 |
16 // This class manages the mapping between CPBrowsingContexts and | 16 // This class manages the mapping between CPBrowsingContexts and |
17 // URLRequestContexts. It observes when URLRequestContexts go away, and | 17 // URLRequestContexts. It observes when URLRequestContexts go away, and |
18 // invalidates the corresponding CPBrowsingContexts. CPBrowsingContexts can be | 18 // invalidates the corresponding CPBrowsingContexts. CPBrowsingContexts can be |
19 // associated with other data as well, so there can be multiple ones referring | 19 // associated with other data as well, so there can be multiple ones referring |
20 // to a given URLRequestContext. | 20 // to a given URLRequestContext. |
21 // Note: This class should be used on the IO thread only. | 21 // Note: This class should be used on the IO thread only. |
(...skipping 29 matching lines...) Expand all Loading... |
51 typedef IDMap<URLRequestContext> Map; | 51 typedef IDMap<URLRequestContext> Map; |
52 typedef std::map<URLRequestContext*, CPBrowsingContext> ReverseMap; | 52 typedef std::map<URLRequestContext*, CPBrowsingContext> ReverseMap; |
53 | 53 |
54 NotificationRegistrar registrar_; | 54 NotificationRegistrar registrar_; |
55 | 55 |
56 Map map_; // map of CPBrowsingContext -> URLRequestContext | 56 Map map_; // map of CPBrowsingContext -> URLRequestContext |
57 ReverseMap reverse_map_; // map of URLRequestContext -> CPBrowsingContext | 57 ReverseMap reverse_map_; // map of URLRequestContext -> CPBrowsingContext |
58 }; | 58 }; |
59 | 59 |
60 #endif // CHROME_BROWSER_CHROME_PLUGIN_BROWSING_CONTEXT_H_ | 60 #endif // CHROME_BROWSER_CHROME_PLUGIN_BROWSING_CONTEXT_H_ |
OLD | NEW |