OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ |
6 #define CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ | 6 #define CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ |
7 | 7 |
8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
9 #include "base/containers/hash_tables.h" | 9 #include "base/containers/hash_tables.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 30 matching lines...) Expand all Loading... | |
41 | 41 |
42 // This class holds the context needed for a browsing session. | 42 // This class holds the context needed for a browsing session. |
43 // It lives on the UI thread. All these methods must only be called on the UI | 43 // It lives on the UI thread. All these methods must only be called on the UI |
44 // thread. | 44 // thread. |
45 class CONTENT_EXPORT BrowserContext : public base::SupportsUserData { | 45 class CONTENT_EXPORT BrowserContext : public base::SupportsUserData { |
46 public: | 46 public: |
47 // Used in ForEachStoragePartition(). The first argument is the partition id. | 47 // Used in ForEachStoragePartition(). The first argument is the partition id. |
48 // The second argument is the StoragePartition object for that partition id. | 48 // The second argument is the StoragePartition object for that partition id. |
49 typedef base::Callback<void(StoragePartition*)> StoragePartitionCallback; | 49 typedef base::Callback<void(StoragePartition*)> StoragePartitionCallback; |
50 | 50 |
51 // Used in RequestMIDISysExPermission(). The first argument is the render | |
52 // process id, the second one is the render view id, the third one is the | |
53 // client id, and the last one represents if the request is permitted. | |
54 typedef base::Callback<void(int, int, int, bool)> MIDISysExPermissionCallback; | |
jam
2013/07/12 00:16:31
it looks like you're sending the embedder a bunch
Takashi Toyoshima
2013/07/12 12:45:49
Done.
| |
55 | |
51 static DownloadManager* GetDownloadManager(BrowserContext* browser_context); | 56 static DownloadManager* GetDownloadManager(BrowserContext* browser_context); |
52 | 57 |
53 // Returns BrowserContext specific external mount points. It may return NULL | 58 // Returns BrowserContext specific external mount points. It may return NULL |
54 // if the context doesn't have any BrowserContext specific external mount | 59 // if the context doesn't have any BrowserContext specific external mount |
55 // points. Currenty, non-NULL value is returned only on ChromeOS. | 60 // points. Currenty, non-NULL value is returned only on ChromeOS. |
56 static fileapi::ExternalMountPoints* GetMountPoints(BrowserContext* context); | 61 static fileapi::ExternalMountPoints* GetMountPoints(BrowserContext* context); |
57 | 62 |
58 static content::StoragePartition* GetStoragePartition( | 63 static content::StoragePartition* GetStoragePartition( |
59 BrowserContext* browser_context, SiteInstance* site_instance); | 64 BrowserContext* browser_context, SiteInstance* site_instance); |
60 static content::StoragePartition* GetStoragePartitionForSite( | 65 static content::StoragePartition* GetStoragePartitionForSite( |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
121 | 126 |
122 // Returns the request context for media resources associated with this | 127 // Returns the request context for media resources associated with this |
123 // context and renderer process. | 128 // context and renderer process. |
124 virtual net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess( | 129 virtual net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess( |
125 int renderer_child_id) = 0; | 130 int renderer_child_id) = 0; |
126 virtual net::URLRequestContextGetter* | 131 virtual net::URLRequestContextGetter* |
127 GetMediaRequestContextForStoragePartition( | 132 GetMediaRequestContextForStoragePartition( |
128 const base::FilePath& partition_path, | 133 const base::FilePath& partition_path, |
129 bool in_memory) = 0; | 134 bool in_memory) = 0; |
130 | 135 |
136 // Requests a permission to use system exclusive messages in MIDI events. | |
137 // |callback| will be invoked when the request is resolved. | |
138 virtual void RequestMIDISysExPermission( | |
jam
2013/07/12 00:16:31
what is "SysEx"? see style guide re abbreviations
Takashi Toyoshima
2013/07/12 12:45:49
SysEx is a abbreviation of system exclusive messag
jam
2013/07/12 16:06:35
ok
| |
139 int render_process_id, | |
140 int render_view_id, | |
141 int client_id, | |
142 const GURL& requesting_frame, | |
143 const MIDISysExPermissionCallback& callback) = 0; | |
144 | |
131 // Returns the resource context. | 145 // Returns the resource context. |
132 virtual ResourceContext* GetResourceContext() = 0; | 146 virtual ResourceContext* GetResourceContext() = 0; |
133 | 147 |
134 // Returns the DownloadManagerDelegate for this context. This will be called | 148 // Returns the DownloadManagerDelegate for this context. This will be called |
135 // once per context. The embedder owns the delegate and is responsible for | 149 // once per context. The embedder owns the delegate and is responsible for |
136 // ensuring that it outlives DownloadManager. It's valid to return NULL. | 150 // ensuring that it outlives DownloadManager. It's valid to return NULL. |
137 virtual DownloadManagerDelegate* GetDownloadManagerDelegate() = 0; | 151 virtual DownloadManagerDelegate* GetDownloadManagerDelegate() = 0; |
138 | 152 |
139 // Returns the geolocation permission context for this context. It's valid to | 153 // Returns the geolocation permission context for this context. It's valid to |
140 // return NULL, in which case geolocation requests will always be allowed. | 154 // return NULL, in which case geolocation requests will always be allowed. |
(...skipping 12 matching lines...) Expand all Loading... | |
153 struct hash<content::BrowserContext*> { | 167 struct hash<content::BrowserContext*> { |
154 std::size_t operator()(content::BrowserContext* const& p) const { | 168 std::size_t operator()(content::BrowserContext* const& p) const { |
155 return reinterpret_cast<std::size_t>(p); | 169 return reinterpret_cast<std::size_t>(p); |
156 } | 170 } |
157 }; | 171 }; |
158 | 172 |
159 } // namespace BASE_HASH_NAMESPACE | 173 } // namespace BASE_HASH_NAMESPACE |
160 #endif | 174 #endif |
161 | 175 |
162 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ | 176 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ |
OLD | NEW |