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

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

Issue 340773006: Dispatch push event to worker from PushServiceImpl#OnMessage. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup. Created 6 years, 4 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
« no previous file with comments | « content/content_browser.gypi ('k') | content/public/common/push_messaging_status.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
11 #include "base/supports_user_data.h" 11 #include "base/supports_user_data.h"
12 #include "content/common/content_export.h" 12 #include "content/common/content_export.h"
13 #include "content/public/common/push_messaging_status.h"
13 14
14 class GURL; 15 class GURL;
15 16
16 namespace base { 17 namespace base {
17 class FilePath; 18 class FilePath;
18 } 19 }
19 20
20 namespace fileapi { 21 namespace fileapi {
21 class ExternalMountPoints; 22 class ExternalMountPoints;
22 } 23 }
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 static content::StoragePartition* GetDefaultStoragePartition( 80 static content::StoragePartition* GetDefaultStoragePartition(
80 BrowserContext* browser_context); 81 BrowserContext* browser_context);
81 82
82 typedef base::Callback<void(scoped_ptr<BlobHandle>)> BlobCallback; 83 typedef base::Callback<void(scoped_ptr<BlobHandle>)> BlobCallback;
83 84
84 // |callback| returns a NULL scoped_ptr on failure. 85 // |callback| returns a NULL scoped_ptr on failure.
85 static void CreateMemoryBackedBlob(BrowserContext* browser_context, 86 static void CreateMemoryBackedBlob(BrowserContext* browser_context,
86 const char* data, size_t length, 87 const char* data, size_t length,
87 const BlobCallback& callback); 88 const BlobCallback& callback);
88 89
90 // Delivers a push message with |data| to the Service Worker identified by
91 // |origin| and |service_worker_registration_id|.
92 static void DeliverPushMessage(
93 BrowserContext* browser_context,
94 const GURL& origin,
95 int64 service_worker_registration_id,
96 const std::string& data,
97 const base::Callback<void(PushMessagingStatus)>& callback);
98
89 // Ensures that the corresponding ResourceContext is initialized. Normally the 99 // Ensures that the corresponding ResourceContext is initialized. Normally the
90 // BrowserContext initializs the corresponding getters when its objects are 100 // BrowserContext initializs the corresponding getters when its objects are
91 // created, but if the embedder wants to pass the ResourceContext to another 101 // created, but if the embedder wants to pass the ResourceContext to another
92 // thread before they use BrowserContext, they should call this to make sure 102 // thread before they use BrowserContext, they should call this to make sure
93 // that the ResourceContext is ready. 103 // that the ResourceContext is ready.
94 static void EnsureResourceContextInitialized(BrowserContext* browser_context); 104 static void EnsureResourceContextInitialized(BrowserContext* browser_context);
95 105
96 // Tells the HTML5 objects on this context to persist their session state 106 // Tells the HTML5 objects on this context to persist their session state
97 // across the next restart. 107 // across the next restart.
98 static void SaveSessionState(BrowserContext* browser_context); 108 static void SaveSessionState(BrowserContext* browser_context);
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 struct hash<content::BrowserContext*> { 175 struct hash<content::BrowserContext*> {
166 std::size_t operator()(content::BrowserContext* const& p) const { 176 std::size_t operator()(content::BrowserContext* const& p) const {
167 return reinterpret_cast<std::size_t>(p); 177 return reinterpret_cast<std::size_t>(p);
168 } 178 }
169 }; 179 };
170 180
171 } // namespace BASE_HASH_NAMESPACE 181 } // namespace BASE_HASH_NAMESPACE
172 #endif 182 #endif
173 183
174 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ 184 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_
OLDNEW
« no previous file with comments | « content/content_browser.gypi ('k') | content/public/common/push_messaging_status.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698