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

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

Issue 406483004: Initial implementation of API WakeLock. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
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 22 matching lines...) Expand all
33 33
34 class BlobHandle; 34 class BlobHandle;
35 class BrowserPluginGuestManager; 35 class BrowserPluginGuestManager;
36 class DownloadManager; 36 class DownloadManager;
37 class DownloadManagerDelegate; 37 class DownloadManagerDelegate;
38 class IndexedDBContext; 38 class IndexedDBContext;
39 class PushMessagingService; 39 class PushMessagingService;
40 class ResourceContext; 40 class ResourceContext;
41 class SiteInstance; 41 class SiteInstance;
42 class StoragePartition; 42 class StoragePartition;
43 class WakeLockPermissionContext;
43 44
44 // This class holds the context needed for a browsing session. 45 // This class holds the context needed for a browsing session.
45 // It lives on the UI thread. All these methods must only be called on the UI 46 // It lives on the UI thread. All these methods must only be called on the UI
46 // thread. 47 // thread.
47 class CONTENT_EXPORT BrowserContext : public base::SupportsUserData { 48 class CONTENT_EXPORT BrowserContext : public base::SupportsUserData {
48 public: 49 public:
49 static DownloadManager* GetDownloadManager(BrowserContext* browser_context); 50 static DownloadManager* GetDownloadManager(BrowserContext* browser_context);
50 51
51 // Returns BrowserContext specific external mount points. It may return NULL 52 // Returns BrowserContext specific external mount points. It may return NULL
52 // if the context doesn't have any BrowserContext specific external mount 53 // if the context doesn't have any BrowserContext specific external mount
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 // Returns the DownloadManagerDelegate for this context. This will be called 138 // Returns the DownloadManagerDelegate for this context. This will be called
138 // once per context. The embedder owns the delegate and is responsible for 139 // once per context. The embedder owns the delegate and is responsible for
139 // ensuring that it outlives DownloadManager. It's valid to return NULL. 140 // ensuring that it outlives DownloadManager. It's valid to return NULL.
140 virtual DownloadManagerDelegate* GetDownloadManagerDelegate() = 0; 141 virtual DownloadManagerDelegate* GetDownloadManagerDelegate() = 0;
141 142
142 // Returns the guest manager for this context. 143 // Returns the guest manager for this context.
143 virtual BrowserPluginGuestManager* GetGuestManager() = 0; 144 virtual BrowserPluginGuestManager* GetGuestManager() = 0;
144 145
145 // Returns a special storage policy implementation, or NULL. 146 // Returns a special storage policy implementation, or NULL.
146 virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() = 0; 147 virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() = 0;
148 virtual WakeLockPermissionContext* GetWakeLockPermissionContext() = 0;
147 149
148 // Returns a push messaging service. The embedder owns the service, and is 150 // Returns a push messaging service. The embedder owns the service, and is
149 // responsible for ensuring that it outlives RenderProcessHost. It's valid to 151 // responsible for ensuring that it outlives RenderProcessHost. It's valid to
150 // return NULL. 152 // return NULL.
151 virtual PushMessagingService* GetPushMessagingService() = 0; 153 virtual PushMessagingService* GetPushMessagingService() = 0;
152 }; 154 };
153 155
154 } // namespace content 156 } // namespace content
155 157
156 #if defined(COMPILER_GCC) 158 #if defined(COMPILER_GCC)
157 namespace BASE_HASH_NAMESPACE { 159 namespace BASE_HASH_NAMESPACE {
158 160
159 template<> 161 template<>
160 struct hash<content::BrowserContext*> { 162 struct hash<content::BrowserContext*> {
161 std::size_t operator()(content::BrowserContext* const& p) const { 163 std::size_t operator()(content::BrowserContext* const& p) const {
162 return reinterpret_cast<std::size_t>(p); 164 return reinterpret_cast<std::size_t>(p);
163 } 165 }
164 }; 166 };
165 167
166 } // namespace BASE_HASH_NAMESPACE 168 } // namespace BASE_HASH_NAMESPACE
167 #endif 169 #endif
168 170
169 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ 171 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698