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

Side by Side Diff: content/public/browser/browser_context.h

Issue 18647002: Web MIDI: add RequestMIDISysExPermission to BrowserContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: for commit Created 7 years, 5 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) 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 26 matching lines...) Expand all
37 class IndexedDBContext; 37 class IndexedDBContext;
38 class ResourceContext; 38 class ResourceContext;
39 class SiteInstance; 39 class SiteInstance;
40 class StoragePartition; 40 class StoragePartition;
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.
48 // The second argument is the StoragePartition object for that partition id.
49 typedef base::Callback<void(StoragePartition*)> StoragePartitionCallback;
50
51 static DownloadManager* GetDownloadManager(BrowserContext* browser_context); 47 static DownloadManager* GetDownloadManager(BrowserContext* browser_context);
52 48
53 // Returns BrowserContext specific external mount points. It may return NULL 49 // Returns BrowserContext specific external mount points. It may return NULL
54 // if the context doesn't have any BrowserContext specific external mount 50 // if the context doesn't have any BrowserContext specific external mount
55 // points. Currenty, non-NULL value is returned only on ChromeOS. 51 // points. Currenty, non-NULL value is returned only on ChromeOS.
56 static fileapi::ExternalMountPoints* GetMountPoints(BrowserContext* context); 52 static fileapi::ExternalMountPoints* GetMountPoints(BrowserContext* context);
57 53
58 static content::StoragePartition* GetStoragePartition( 54 static content::StoragePartition* GetStoragePartition(
59 BrowserContext* browser_context, SiteInstance* site_instance); 55 BrowserContext* browser_context, SiteInstance* site_instance);
60 static content::StoragePartition* GetStoragePartitionForSite( 56 static content::StoragePartition* GetStoragePartitionForSite(
61 BrowserContext* browser_context, const GURL& site); 57 BrowserContext* browser_context, const GURL& site);
58 typedef base::Callback<void(StoragePartition*)> StoragePartitionCallback;
62 static void ForEachStoragePartition( 59 static void ForEachStoragePartition(
63 BrowserContext* browser_context, 60 BrowserContext* browser_context,
64 const StoragePartitionCallback& callback); 61 const StoragePartitionCallback& callback);
65 static void AsyncObliterateStoragePartition( 62 static void AsyncObliterateStoragePartition(
66 BrowserContext* browser_context, 63 BrowserContext* browser_context,
67 const GURL& site, 64 const GURL& site,
68 const base::Closure& on_gc_required); 65 const base::Closure& on_gc_required);
69 66
70 // This function clears the contents of |active_paths| but does not take 67 // This function clears the contents of |active_paths| but does not take
71 // ownership of the pointer. 68 // ownership of the pointer.
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 118
122 // Returns the request context for media resources associated with this 119 // Returns the request context for media resources associated with this
123 // context and renderer process. 120 // context and renderer process.
124 virtual net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess( 121 virtual net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess(
125 int renderer_child_id) = 0; 122 int renderer_child_id) = 0;
126 virtual net::URLRequestContextGetter* 123 virtual net::URLRequestContextGetter*
127 GetMediaRequestContextForStoragePartition( 124 GetMediaRequestContextForStoragePartition(
128 const base::FilePath& partition_path, 125 const base::FilePath& partition_path,
129 bool in_memory) = 0; 126 bool in_memory) = 0;
130 127
128 typedef base::Callback<void(bool)> MIDISysExPermissionCallback;
129
130 // Requests a permission to use system exclusive messages in MIDI events.
131 // |callback| will be invoked when the request is resolved.
132 virtual void RequestMIDISysExPermission(
133 int render_process_id,
134 int render_view_id,
135 const GURL& requesting_frame,
136 const MIDISysExPermissionCallback& callback) = 0;
137
131 // Returns the resource context. 138 // Returns the resource context.
132 virtual ResourceContext* GetResourceContext() = 0; 139 virtual ResourceContext* GetResourceContext() = 0;
133 140
134 // Returns the DownloadManagerDelegate for this context. This will be called 141 // Returns the DownloadManagerDelegate for this context. This will be called
135 // once per context. The embedder owns the delegate and is responsible for 142 // once per context. The embedder owns the delegate and is responsible for
136 // ensuring that it outlives DownloadManager. It's valid to return NULL. 143 // ensuring that it outlives DownloadManager. It's valid to return NULL.
137 virtual DownloadManagerDelegate* GetDownloadManagerDelegate() = 0; 144 virtual DownloadManagerDelegate* GetDownloadManagerDelegate() = 0;
138 145
139 // Returns the geolocation permission context for this context. It's valid to 146 // Returns the geolocation permission context for this context. It's valid to
140 // return NULL, in which case geolocation requests will always be allowed. 147 // return NULL, in which case geolocation requests will always be allowed.
(...skipping 12 matching lines...) Expand all
153 struct hash<content::BrowserContext*> { 160 struct hash<content::BrowserContext*> {
154 std::size_t operator()(content::BrowserContext* const& p) const { 161 std::size_t operator()(content::BrowserContext* const& p) const {
155 return reinterpret_cast<std::size_t>(p); 162 return reinterpret_cast<std::size_t>(p);
156 } 163 }
157 }; 164 };
158 165
159 } // namespace BASE_HASH_NAMESPACE 166 } // namespace BASE_HASH_NAMESPACE
160 #endif 167 #endif
161 168
162 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ 169 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_
OLDNEW
« no previous file with comments | « content/browser/download/download_manager_impl_unittest.cc ('k') | content/public/test/test_browser_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698