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

Side by Side Diff: content/browser/notifications/notification_event_dispatcher_impl.cc

Issue 2183783002: Revert of Stop passing const-reference of SWRegistration in all GetRegistrationsCallbacks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/browser/notifications/notification_event_dispatcher_impl.h" 5 #include "content/browser/notifications/notification_event_dispatcher_impl.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "content/browser/notifications/platform_notification_context_impl.h" 9 #include "content/browser/notifications/platform_notification_context_impl.h"
10 #include "content/browser/service_worker/service_worker_context_wrapper.h" 10 #include "content/browser/service_worker/service_worker_context_wrapper.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 87
88 // Dispatches the given notification action event on 88 // Dispatches the given notification action event on
89 // |service_worker_registration| if the registration was available. Must be 89 // |service_worker_registration| if the registration was available. Must be
90 // called on the IO thread. 90 // called on the IO thread.
91 void DispatchNotificationEventOnRegistration( 91 void DispatchNotificationEventOnRegistration(
92 const NotificationDatabaseData& notification_database_data, 92 const NotificationDatabaseData& notification_database_data,
93 const scoped_refptr<PlatformNotificationContext>& notification_context, 93 const scoped_refptr<PlatformNotificationContext>& notification_context,
94 const NotificationOperationCallback& dispatch_event_action, 94 const NotificationOperationCallback& dispatch_event_action,
95 const NotificationDispatchCompleteCallback& dispatch_error_callback, 95 const NotificationDispatchCompleteCallback& dispatch_error_callback,
96 ServiceWorkerStatusCode service_worker_status, 96 ServiceWorkerStatusCode service_worker_status,
97 scoped_refptr<ServiceWorkerRegistration> service_worker_registration) { 97 const scoped_refptr<ServiceWorkerRegistration>&
98 service_worker_registration) {
98 DCHECK_CURRENTLY_ON(BrowserThread::IO); 99 DCHECK_CURRENTLY_ON(BrowserThread::IO);
99 #if defined(OS_ANDROID) 100 #if defined(OS_ANDROID)
100 // This LOG(INFO) deliberately exists to help track down the cause of 101 // This LOG(INFO) deliberately exists to help track down the cause of
101 // https://crbug.com/534537, where notifications sometimes do not react to 102 // https://crbug.com/534537, where notifications sometimes do not react to
102 // the user clicking on them. It should be removed once that's fixed. 103 // the user clicking on them. It should be removed once that's fixed.
103 LOG(INFO) << "Trying to dispatch notification for SW with status: " 104 LOG(INFO) << "Trying to dispatch notification for SW with status: "
104 << service_worker_status; 105 << service_worker_status;
105 #endif 106 #endif
106 if (service_worker_status == SERVICE_WORKER_OK) { 107 if (service_worker_status == SERVICE_WORKER_OK) {
107 DCHECK(service_worker_registration->active_version()); 108 DCHECK(service_worker_registration->active_version());
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 const GURL& origin, 375 const GURL& origin,
375 bool by_user, 376 bool by_user,
376 const NotificationDispatchCompleteCallback& dispatch_complete_callback) { 377 const NotificationDispatchCompleteCallback& dispatch_complete_callback) {
377 DispatchNotificationEvent(browser_context, persistent_notification_id, origin, 378 DispatchNotificationEvent(browser_context, persistent_notification_id, origin,
378 base::Bind(&DoDispatchNotificationCloseEvent, 379 base::Bind(&DoDispatchNotificationCloseEvent,
379 by_user, dispatch_complete_callback), 380 by_user, dispatch_complete_callback),
380 dispatch_complete_callback); 381 dispatch_complete_callback);
381 } 382 }
382 383
383 } // namespace content 384 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/navigation_url_loader_impl_core.cc ('k') | content/browser/notifications/notification_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698