Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(212)

Side by Side Diff: content/browser/resource_context.h

Issue 9369009: Make content::ResourceContext be a real interface like the rest of the Content API (i.e. don't ha... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
(...skipping 21 matching lines...) Expand all
32 namespace webkit_database { 32 namespace webkit_database {
33 class DatabaseTracker; 33 class DatabaseTracker;
34 } // namespace webkit_database 34 } // namespace webkit_database
35 35
36 namespace content { 36 namespace content {
37 37
38 class HostZoomMap; 38 class HostZoomMap;
39 39
40 // ResourceContext contains the relevant context information required for 40 // ResourceContext contains the relevant context information required for
41 // resource loading. It lives on the IO thread, although it is constructed on 41 // resource loading. It lives on the IO thread, although it is constructed on
42 // the UI thread. ResourceContext doesn't own anything it points to, it just 42 // the UI thread.
43 // holds pointers to relevant objects to resource loading.
44 class CONTENT_EXPORT ResourceContext { 43 class CONTENT_EXPORT ResourceContext {
45 public: 44 public:
46 virtual ~ResourceContext(); 45 virtual ~ResourceContext();
47 46
48 // The user data allows the clients to associate data with this request. 47 virtual net::HostResolver* GetHostResolver() = 0;
49 // Multiple user data values can be stored under different keys. 48 virtual net::URLRequestContext* GetRequestContext() = 0;
50 void* GetUserData(const void* key) const; 49 virtual ChromeAppCacheService* GetAppCacheService() = 0;
51 void SetUserData(const void* key, void* data); 50 virtual webkit_database::DatabaseTracker* GetDatabaseTracker() = 0;
52 51 virtual fileapi::FileSystemContext* GetFileSystemContext() = 0;
53 net::HostResolver* host_resolver() const; 52 virtual ChromeBlobStorageContext* GetBlobStorageContext() = 0;
54 void set_host_resolver(net::HostResolver* host_resolver); 53 virtual quota::QuotaManager* GetQuotaManager() = 0;
55 54 virtual HostZoomMap* GetHostZoomMap() = 0;
56 net::URLRequestContext* request_context() const; 55 virtual MediaObserver* GetMediaObserver() = 0;
57 void set_request_context(net::URLRequestContext* request_context); 56 virtual media_stream::MediaStreamManager* GetMediaStreamManager() = 0;
58 57 virtual AudioManager* GetAudioManager() = 0;
59 ChromeAppCacheService* appcache_service() const;
60 void set_appcache_service(ChromeAppCacheService* service);
61
62 webkit_database::DatabaseTracker* database_tracker() const;
63 void set_database_tracker(webkit_database::DatabaseTracker* tracker);
64
65 fileapi::FileSystemContext* file_system_context() const;
66 void set_file_system_context(fileapi::FileSystemContext* context);
67
68 ChromeBlobStorageContext* blob_storage_context() const;
69 void set_blob_storage_context(ChromeBlobStorageContext* context);
70
71 quota::QuotaManager* quota_manager() const;
72 void set_quota_manager(quota::QuotaManager* quota_manager);
73
74 HostZoomMap* host_zoom_map() const;
75 void set_host_zoom_map(HostZoomMap* host_zoom_map);
76
77 MediaObserver* media_observer() const;
78 void set_media_observer(MediaObserver* media_observer);
79
80 media_stream::MediaStreamManager* media_stream_manager() const;
81 void set_media_stream_manager(
82 media_stream::MediaStreamManager* media_stream_manager);
83
84 AudioManager* audio_manager() const;
85 void set_audio_manager(AudioManager* audio_manager);
86
87 protected:
88 ResourceContext();
89
90 private:
91 virtual void EnsureInitialized() const = 0;
92
93 net::HostResolver* host_resolver_;
94 net::URLRequestContext* request_context_;
95 ChromeAppCacheService* appcache_service_;
96 webkit_database::DatabaseTracker* database_tracker_;
97 fileapi::FileSystemContext* file_system_context_;
98 ChromeBlobStorageContext* blob_storage_context_;
99 quota::QuotaManager* quota_manager_;
100 HostZoomMap* host_zoom_map_;
101 MediaObserver* media_observer_;
102 media_stream::MediaStreamManager* media_stream_manager_;
103 AudioManager* audio_manager_;
104
105 // Externally-defined data accessible by key.
106 typedef std::map<const void*, void*> UserDataMap;
107 UserDataMap user_data_;
108
109 DISALLOW_COPY_AND_ASSIGN(ResourceContext);
110 }; 58 };
111 59
112 } // namespace content 60 } // namespace content
113 61
114 #endif // CONTENT_BROWSER_RESOURCE_CONTEXT_H_ 62 #endif // CONTENT_BROWSER_RESOURCE_CONTEXT_H_
OLDNEW
« no previous file with comments | « content/browser/renderer_host/socket_stream_dispatcher_host.cc ('k') | content/browser/resource_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698