| 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 // 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 |
| 78 // ======================================================================= | 84 // ======================================================================= |
| 79 // TODO(willchan): These don't belong in content/. Remove them eventually. | 85 // TODO(willchan): These don't belong in content/. Remove them eventually. |
| 80 | 86 |
| 81 // TODO(cbentzel): Kill this one. | 87 // TODO(cbentzel): Kill this one. |
| 82 const base::Callback<prerender::PrerenderManager*(void)>& | 88 const base::Callback<prerender::PrerenderManager*(void)>& |
| 83 prerender_manager_getter() const; | 89 prerender_manager_getter() const; |
| 84 void set_prerender_manager_getter( | 90 void set_prerender_manager_getter( |
| 85 const base::Callback<prerender::PrerenderManager*(void)>& | 91 const base::Callback<prerender::PrerenderManager*(void)>& |
| 86 prerender_manager_getter); | 92 prerender_manager_getter); |
| 87 | 93 |
| 88 protected: | 94 protected: |
| 89 ResourceContext(); | 95 ResourceContext(); |
| 90 | 96 |
| 91 private: | 97 private: |
| 92 virtual void EnsureInitialized() const = 0; | 98 virtual void EnsureInitialized() const = 0; |
| 93 | 99 |
| 94 net::HostResolver* host_resolver_; | 100 net::HostResolver* host_resolver_; |
| 95 net::URLRequestContext* request_context_; | 101 net::URLRequestContext* request_context_; |
| 96 ChromeAppCacheService* appcache_service_; | 102 ChromeAppCacheService* appcache_service_; |
| 97 webkit_database::DatabaseTracker* database_tracker_; | 103 webkit_database::DatabaseTracker* database_tracker_; |
| 98 fileapi::FileSystemContext* file_system_context_; | 104 fileapi::FileSystemContext* file_system_context_; |
| 99 ChromeBlobStorageContext* blob_storage_context_; | 105 ChromeBlobStorageContext* blob_storage_context_; |
| 100 quota::QuotaManager* quota_manager_; | 106 quota::QuotaManager* quota_manager_; |
| 101 HostZoomMap* host_zoom_map_; | 107 HostZoomMap* host_zoom_map_; |
| 102 MediaObserver* media_observer_; | 108 MediaObserver* media_observer_; |
| 109 DownloadManager::GetNextIdThunkType next_download_id_thunk_; |
| 103 | 110 |
| 104 // Externally-defined data accessible by key. | 111 // Externally-defined data accessible by key. |
| 105 typedef std::map<const void*, void*> UserDataMap; | 112 typedef std::map<const void*, void*> UserDataMap; |
| 106 UserDataMap user_data_; | 113 UserDataMap user_data_; |
| 107 | 114 |
| 108 | 115 |
| 109 // ======================================================================= | 116 // ======================================================================= |
| 110 // TODO(willchan): These don't belong in content/. Remove them eventually. | 117 // TODO(willchan): These don't belong in content/. Remove them eventually. |
| 111 | 118 |
| 112 base::Callback<prerender::PrerenderManager*(void)> prerender_manager_getter_; | 119 base::Callback<prerender::PrerenderManager*(void)> prerender_manager_getter_; |
| 113 | 120 |
| 114 DISALLOW_COPY_AND_ASSIGN(ResourceContext); | 121 DISALLOW_COPY_AND_ASSIGN(ResourceContext); |
| 115 }; | 122 }; |
| 116 | 123 |
| 117 } // namespace content | 124 } // namespace content |
| 118 | 125 |
| 119 #endif // CONTENT_BROWSER_RESOURCE_CONTEXT_H_ | 126 #endif // CONTENT_BROWSER_RESOURCE_CONTEXT_H_ |
| OLD | NEW |