| 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/renderer/push_messaging/push_messaging_dispatcher.h" | 5 #include "content/renderer/push_messaging/push_messaging_dispatcher.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "content/child/service_worker/web_service_worker_registration_impl.h" | 9 #include "content/child/service_worker/web_service_worker_registration_impl.h" |
| 10 #include "content/common/push_messaging_messages.h" | 10 #include "content/common/push_messaging_messages.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 // service. | 60 // service. |
| 61 content_options.sender_info = options.applicationServerKey.latin1(); | 61 content_options.sender_info = options.applicationServerKey.latin1(); |
| 62 DoSubscribe(service_worker_registration, content_options, callbacks); | 62 DoSubscribe(service_worker_registration, content_options, callbacks); |
| 63 } | 63 } |
| 64 } | 64 } |
| 65 | 65 |
| 66 void PushMessagingDispatcher::DidGetManifest( | 66 void PushMessagingDispatcher::DidGetManifest( |
| 67 blink::WebServiceWorkerRegistration* service_worker_registration, | 67 blink::WebServiceWorkerRegistration* service_worker_registration, |
| 68 const blink::WebPushSubscriptionOptions& options, | 68 const blink::WebPushSubscriptionOptions& options, |
| 69 blink::WebPushSubscriptionCallbacks* callbacks, | 69 blink::WebPushSubscriptionCallbacks* callbacks, |
| 70 const Manifest& manifest) { | 70 const Manifest& manifest, |
| 71 const ManifestDebugInfo&) { |
| 71 // Get the sender_info from the manifest since it wasn't provided by | 72 // Get the sender_info from the manifest since it wasn't provided by |
| 72 // the caller. | 73 // the caller. |
| 73 if (manifest.IsEmpty()) { | 74 if (manifest.IsEmpty()) { |
| 74 int request_id = subscription_callbacks_.Add(callbacks); | 75 int request_id = subscription_callbacks_.Add(callbacks); |
| 75 OnSubscribeFromDocumentError( | 76 OnSubscribeFromDocumentError( |
| 76 request_id, PUSH_REGISTRATION_STATUS_MANIFEST_EMPTY_OR_MISSING); | 77 request_id, PUSH_REGISTRATION_STATUS_MANIFEST_EMPTY_OR_MISSING); |
| 77 return; | 78 return; |
| 78 } | 79 } |
| 79 | 80 |
| 80 PushSubscriptionOptions content_options; | 81 PushSubscriptionOptions content_options; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 : blink::WebPushError::ErrorTypeAbort; | 135 : blink::WebPushError::ErrorTypeAbort; |
| 135 | 136 |
| 136 callbacks->onError(blink::WebPushError( | 137 callbacks->onError(blink::WebPushError( |
| 137 error_type, | 138 error_type, |
| 138 blink::WebString::fromUTF8(PushRegistrationStatusToString(status)))); | 139 blink::WebString::fromUTF8(PushRegistrationStatusToString(status)))); |
| 139 | 140 |
| 140 subscription_callbacks_.Remove(request_id); | 141 subscription_callbacks_.Remove(request_id); |
| 141 } | 142 } |
| 142 | 143 |
| 143 } // namespace content | 144 } // namespace content |
| OLD | NEW |