OLD | NEW |
---|---|
1 // Copyright (c) 2011 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 #ifndef CONTENT_BROWSER_RESOURCE_CONTEXT_H_ | 5 #ifndef CONTENT_BROWSER_RESOURCE_CONTEXT_H_ |
6 #define CONTENT_BROWSER_RESOURCE_CONTEXT_H_ | 6 #define CONTENT_BROWSER_RESOURCE_CONTEXT_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "content/browser/download/download_manager.h" | |
13 | 14 |
14 class ChromeAppCacheService; | 15 class ChromeAppCacheService; |
15 class ChromeBlobStorageContext; | 16 class ChromeBlobStorageContext; |
16 class ExtensionInfoMap; | 17 class ExtensionInfoMap; |
17 class HostZoomMap; | 18 class HostZoomMap; |
18 class MediaObserver; | 19 class MediaObserver; |
19 namespace fileapi { | 20 namespace fileapi { |
20 class FileSystemContext; | 21 class FileSystemContext; |
21 } // namespace fileapi | 22 } // namespace fileapi |
22 namespace net { | 23 namespace net { |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
68 | 69 |
69 quota::QuotaManager* quota_manager() const; | 70 quota::QuotaManager* quota_manager() const; |
70 void set_quota_manager(quota::QuotaManager* quota_manager); | 71 void set_quota_manager(quota::QuotaManager* quota_manager); |
71 | 72 |
72 HostZoomMap* host_zoom_map() const; | 73 HostZoomMap* host_zoom_map() const; |
73 void set_host_zoom_map(HostZoomMap* host_zoom_map); | 74 void set_host_zoom_map(HostZoomMap* host_zoom_map); |
74 | 75 |
75 MediaObserver* media_observer() const; | 76 MediaObserver* media_observer() const; |
76 void set_media_observer(MediaObserver* media_observer); | 77 void set_media_observer(MediaObserver* media_observer); |
77 | 78 |
79 const DownloadManager::GetNextIdThunkType& next_download_id_thunk() const; | |
jam
2011/08/23 17:54:19
it seems odd to add a thunk to ResourceContext. it
benjhayden
2011/08/24 14:33:00
Yes, we are planning on promoting the thunk to a f
jam
2011/08/24 16:35:36
I'm curious, why check in the thunk code if you're
benjhayden
2011/08/24 17:22:36
Initializing the DownloadIdFactory will be a very
| |
80 void set_next_download_id_thunk( | |
81 const DownloadManager::GetNextIdThunkType& thunk); | |
82 | |
78 // ======================================================================= | 83 // ======================================================================= |
79 // TODO(willchan): These don't belong in content/. Remove them eventually. | 84 // TODO(willchan): These don't belong in content/. Remove them eventually. |
80 | 85 |
81 // TODO(cbentzel): Kill this one. | 86 // TODO(cbentzel): Kill this one. |
82 const base::Callback<prerender::PrerenderManager*(void)>& | 87 const base::Callback<prerender::PrerenderManager*(void)>& |
83 prerender_manager_getter() const; | 88 prerender_manager_getter() const; |
84 void set_prerender_manager_getter( | 89 void set_prerender_manager_getter( |
85 const base::Callback<prerender::PrerenderManager*(void)>& | 90 const base::Callback<prerender::PrerenderManager*(void)>& |
86 prerender_manager_getter); | 91 prerender_manager_getter); |
87 | 92 |
88 protected: | 93 protected: |
89 ResourceContext(); | 94 ResourceContext(); |
90 | 95 |
91 private: | 96 private: |
92 virtual void EnsureInitialized() const = 0; | 97 virtual void EnsureInitialized() const = 0; |
93 | 98 |
94 net::HostResolver* host_resolver_; | 99 net::HostResolver* host_resolver_; |
95 net::URLRequestContext* request_context_; | 100 net::URLRequestContext* request_context_; |
96 ChromeAppCacheService* appcache_service_; | 101 ChromeAppCacheService* appcache_service_; |
97 webkit_database::DatabaseTracker* database_tracker_; | 102 webkit_database::DatabaseTracker* database_tracker_; |
98 fileapi::FileSystemContext* file_system_context_; | 103 fileapi::FileSystemContext* file_system_context_; |
99 ChromeBlobStorageContext* blob_storage_context_; | 104 ChromeBlobStorageContext* blob_storage_context_; |
100 quota::QuotaManager* quota_manager_; | 105 quota::QuotaManager* quota_manager_; |
101 HostZoomMap* host_zoom_map_; | 106 HostZoomMap* host_zoom_map_; |
102 MediaObserver* media_observer_; | 107 MediaObserver* media_observer_; |
108 DownloadManager::GetNextIdThunkType next_download_id_thunk_; | |
103 | 109 |
104 // Externally-defined data accessible by key. | 110 // Externally-defined data accessible by key. |
105 typedef std::map<const void*, void*> UserDataMap; | 111 typedef std::map<const void*, void*> UserDataMap; |
106 UserDataMap user_data_; | 112 UserDataMap user_data_; |
107 | 113 |
108 | 114 |
109 // ======================================================================= | 115 // ======================================================================= |
110 // TODO(willchan): These don't belong in content/. Remove them eventually. | 116 // TODO(willchan): These don't belong in content/. Remove them eventually. |
111 | 117 |
112 base::Callback<prerender::PrerenderManager*(void)> prerender_manager_getter_; | 118 base::Callback<prerender::PrerenderManager*(void)> prerender_manager_getter_; |
113 | 119 |
114 DISALLOW_COPY_AND_ASSIGN(ResourceContext); | 120 DISALLOW_COPY_AND_ASSIGN(ResourceContext); |
115 }; | 121 }; |
116 | 122 |
117 } // namespace content | 123 } // namespace content |
118 | 124 |
119 #endif // CONTENT_BROWSER_RESOURCE_CONTEXT_H_ | 125 #endif // CONTENT_BROWSER_RESOURCE_CONTEXT_H_ |
OLD | NEW |