OLD | NEW |
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 "content/browser/service_worker/service_worker_context_wrapper.h" | 8 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
9 #include "content/browser/service_worker/service_worker_registration.h" | 9 #include "content/browser/service_worker/service_worker_registration.h" |
10 #include "content/browser/service_worker/service_worker_storage.h" | 10 #include "content/browser/service_worker/service_worker_storage.h" |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 // Finds the ServiceWorkerRegistration associated with the |origin| and | 114 // Finds the ServiceWorkerRegistration associated with the |origin| and |
115 // |service_worker_registration_id|. Must be called on the IO thread. | 115 // |service_worker_registration_id|. Must be called on the IO thread. |
116 void FindServiceWorkerRegistration( | 116 void FindServiceWorkerRegistration( |
117 const GURL& origin, | 117 const GURL& origin, |
118 int64 service_worker_registration_id, | 118 int64 service_worker_registration_id, |
119 const std::string& notification_id, | 119 const std::string& notification_id, |
120 const PlatformNotificationData& notification_data, | 120 const PlatformNotificationData& notification_data, |
121 const NotificationClickDispatchCompleteCallback& dispatch_complete_callback, | 121 const NotificationClickDispatchCompleteCallback& dispatch_complete_callback, |
122 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context) { | 122 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context) { |
123 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 123 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
124 service_worker_context->context()->storage()->FindRegistrationForId( | 124 service_worker_context->FindRegistrationForId( |
125 service_worker_registration_id, | 125 service_worker_registration_id, |
126 origin, | 126 origin, |
127 base::Bind(&DispatchNotificationClickEventOnRegistration, | 127 base::Bind(&DispatchNotificationClickEventOnRegistration, |
128 notification_id, | 128 notification_id, |
129 notification_data, | 129 notification_data, |
130 dispatch_complete_callback)); | 130 dispatch_complete_callback)); |
131 } | 131 } |
132 | 132 |
133 } // namespace | 133 } // namespace |
134 | 134 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 base::Bind(&FindServiceWorkerRegistration, | 168 base::Bind(&FindServiceWorkerRegistration, |
169 origin, | 169 origin, |
170 service_worker_registration_id, | 170 service_worker_registration_id, |
171 notification_id, | 171 notification_id, |
172 notification_data, | 172 notification_data, |
173 dispatch_complete_callback, | 173 dispatch_complete_callback, |
174 service_worker_context)); | 174 service_worker_context)); |
175 } | 175 } |
176 | 176 |
177 } // namespace content | 177 } // namespace content |
OLD | NEW |