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

Side by Side Diff: content/browser/browser_context.cc

Issue 1636483002: Update the PushEvent to have a nullable PushMessageData (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review comments and include Created 4 years, 11 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 #include "content/public/browser/browser_context.h" 5 #include "content/public/browser/browser_context.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 make_scoped_refptr(blob_context), path, offset, size, 248 make_scoped_refptr(blob_context), path, offset, size,
249 expected_modification_time), 249 expected_modification_time),
250 callback); 250 callback);
251 } 251 }
252 252
253 // static 253 // static
254 void BrowserContext::DeliverPushMessage( 254 void BrowserContext::DeliverPushMessage(
255 BrowserContext* browser_context, 255 BrowserContext* browser_context,
256 const GURL& origin, 256 const GURL& origin,
257 int64_t service_worker_registration_id, 257 int64_t service_worker_registration_id,
258 const std::string& data, 258 const PushEventPayload& payload,
259 const base::Callback<void(PushDeliveryStatus)>& callback) { 259 const base::Callback<void(PushDeliveryStatus)>& callback) {
260 DCHECK_CURRENTLY_ON(BrowserThread::UI); 260 DCHECK_CURRENTLY_ON(BrowserThread::UI);
261 PushMessagingRouter::DeliverMessage( 261 PushMessagingRouter::DeliverMessage(browser_context, origin,
262 browser_context, origin, service_worker_registration_id, data, callback); 262 service_worker_registration_id, payload,
263 callback);
263 } 264 }
264 265
265 // static 266 // static
266 void BrowserContext::NotifyWillBeDestroyed(BrowserContext* browser_context) { 267 void BrowserContext::NotifyWillBeDestroyed(BrowserContext* browser_context) {
267 // Service Workers must shutdown before the browser context is destroyed, 268 // Service Workers must shutdown before the browser context is destroyed,
268 // since they keep render process hosts alive and the codebase assumes that 269 // since they keep render process hosts alive and the codebase assumes that
269 // render process hosts die before their profile (browser context) dies. 270 // render process hosts die before their profile (browser context) dies.
270 ForEachStoragePartition(browser_context, 271 ForEachStoragePartition(browser_context,
271 base::Bind(ShutdownServiceWorkerContext)); 272 base::Bind(ShutdownServiceWorkerContext));
272 } 273 }
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 #endif // !OS_IOS 326 #endif // !OS_IOS
326 327
327 BrowserContext::~BrowserContext() { 328 BrowserContext::~BrowserContext() {
328 #if !defined(OS_IOS) 329 #if !defined(OS_IOS)
329 if (GetUserData(kDownloadManagerKeyName)) 330 if (GetUserData(kDownloadManagerKeyName))
330 GetDownloadManager(this)->Shutdown(); 331 GetDownloadManager(this)->Shutdown();
331 #endif 332 #endif
332 } 333 }
333 334
334 } // namespace content 335 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698