| 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" | |
| 14 | 13 |
| 15 class ChromeAppCacheService; | 14 class ChromeAppCacheService; |
| 16 class ChromeBlobStorageContext; | 15 class ChromeBlobStorageContext; |
| 17 class ExtensionInfoMap; | 16 class ExtensionInfoMap; |
| 18 class HostZoomMap; | 17 class HostZoomMap; |
| 19 class MediaObserver; | 18 class MediaObserver; |
| 20 namespace fileapi { | 19 namespace fileapi { |
| 21 class FileSystemContext; | 20 class FileSystemContext; |
| 22 } // namespace fileapi | 21 } // namespace fileapi |
| 23 namespace net { | 22 namespace net { |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 | 68 |
| 70 quota::QuotaManager* quota_manager() const; | 69 quota::QuotaManager* quota_manager() const; |
| 71 void set_quota_manager(quota::QuotaManager* quota_manager); | 70 void set_quota_manager(quota::QuotaManager* quota_manager); |
| 72 | 71 |
| 73 HostZoomMap* host_zoom_map() const; | 72 HostZoomMap* host_zoom_map() const; |
| 74 void set_host_zoom_map(HostZoomMap* host_zoom_map); | 73 void set_host_zoom_map(HostZoomMap* host_zoom_map); |
| 75 | 74 |
| 76 MediaObserver* media_observer() const; | 75 MediaObserver* media_observer() const; |
| 77 void set_media_observer(MediaObserver* media_observer); | 76 void set_media_observer(MediaObserver* media_observer); |
| 78 | 77 |
| 79 // TODO(benjhayden): Promote GetNextIdThunkType to a separate object. | |
| 80 const DownloadManager::GetNextIdThunkType& next_download_id_thunk() const; | |
| 81 void set_next_download_id_thunk( | |
| 82 const DownloadManager::GetNextIdThunkType& thunk); | |
| 83 | |
| 84 // ======================================================================= | 78 // ======================================================================= |
| 85 // TODO(willchan): These don't belong in content/. Remove them eventually. | 79 // TODO(willchan): These don't belong in content/. Remove them eventually. |
| 86 | 80 |
| 87 // TODO(cbentzel): Kill this one. | 81 // TODO(cbentzel): Kill this one. |
| 88 const base::Callback<prerender::PrerenderManager*(void)>& | 82 const base::Callback<prerender::PrerenderManager*(void)>& |
| 89 prerender_manager_getter() const; | 83 prerender_manager_getter() const; |
| 90 void set_prerender_manager_getter( | 84 void set_prerender_manager_getter( |
| 91 const base::Callback<prerender::PrerenderManager*(void)>& | 85 const base::Callback<prerender::PrerenderManager*(void)>& |
| 92 prerender_manager_getter); | 86 prerender_manager_getter); |
| 93 | 87 |
| 94 protected: | 88 protected: |
| 95 ResourceContext(); | 89 ResourceContext(); |
| 96 | 90 |
| 97 private: | 91 private: |
| 98 virtual void EnsureInitialized() const = 0; | 92 virtual void EnsureInitialized() const = 0; |
| 99 | 93 |
| 100 net::HostResolver* host_resolver_; | 94 net::HostResolver* host_resolver_; |
| 101 net::URLRequestContext* request_context_; | 95 net::URLRequestContext* request_context_; |
| 102 ChromeAppCacheService* appcache_service_; | 96 ChromeAppCacheService* appcache_service_; |
| 103 webkit_database::DatabaseTracker* database_tracker_; | 97 webkit_database::DatabaseTracker* database_tracker_; |
| 104 fileapi::FileSystemContext* file_system_context_; | 98 fileapi::FileSystemContext* file_system_context_; |
| 105 ChromeBlobStorageContext* blob_storage_context_; | 99 ChromeBlobStorageContext* blob_storage_context_; |
| 106 quota::QuotaManager* quota_manager_; | 100 quota::QuotaManager* quota_manager_; |
| 107 HostZoomMap* host_zoom_map_; | 101 HostZoomMap* host_zoom_map_; |
| 108 MediaObserver* media_observer_; | 102 MediaObserver* media_observer_; |
| 109 DownloadManager::GetNextIdThunkType next_download_id_thunk_; | |
| 110 | 103 |
| 111 // Externally-defined data accessible by key. | 104 // Externally-defined data accessible by key. |
| 112 typedef std::map<const void*, void*> UserDataMap; | 105 typedef std::map<const void*, void*> UserDataMap; |
| 113 UserDataMap user_data_; | 106 UserDataMap user_data_; |
| 114 | 107 |
| 115 | 108 |
| 116 // ======================================================================= | 109 // ======================================================================= |
| 117 // TODO(willchan): These don't belong in content/. Remove them eventually. | 110 // TODO(willchan): These don't belong in content/. Remove them eventually. |
| 118 | 111 |
| 119 base::Callback<prerender::PrerenderManager*(void)> prerender_manager_getter_; | 112 base::Callback<prerender::PrerenderManager*(void)> prerender_manager_getter_; |
| 120 | 113 |
| 121 DISALLOW_COPY_AND_ASSIGN(ResourceContext); | 114 DISALLOW_COPY_AND_ASSIGN(ResourceContext); |
| 122 }; | 115 }; |
| 123 | 116 |
| 124 } // namespace content | 117 } // namespace content |
| 125 | 118 |
| 126 #endif // CONTENT_BROWSER_RESOURCE_CONTEXT_H_ | 119 #endif // CONTENT_BROWSER_RESOURCE_CONTEXT_H_ |
| OLD | NEW |