| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 // service. | 64 // service. |
| 65 content_options.sender_info = options.applicationServerKey.latin1(); | 65 content_options.sender_info = options.applicationServerKey.latin1(); |
| 66 DoSubscribe(service_worker_registration, content_options, callbacks); | 66 DoSubscribe(service_worker_registration, content_options, callbacks); |
| 67 } | 67 } |
| 68 } | 68 } |
| 69 | 69 |
| 70 void PushMessagingDispatcher::DidGetManifest( | 70 void PushMessagingDispatcher::DidGetManifest( |
| 71 blink::WebServiceWorkerRegistration* service_worker_registration, | 71 blink::WebServiceWorkerRegistration* service_worker_registration, |
| 72 const blink::WebPushSubscriptionOptions& options, | 72 const blink::WebPushSubscriptionOptions& options, |
| 73 blink::WebPushSubscriptionCallbacks* callbacks, | 73 blink::WebPushSubscriptionCallbacks* callbacks, |
| 74 const GURL& manifest_url, |
| 74 const Manifest& manifest, | 75 const Manifest& manifest, |
| 75 const ManifestDebugInfo&) { | 76 const ManifestDebugInfo&) { |
| 76 // Get the sender_info from the manifest since it wasn't provided by | 77 // Get the sender_info from the manifest since it wasn't provided by |
| 77 // the caller. | 78 // the caller. |
| 78 if (manifest.IsEmpty()) { | 79 if (manifest.IsEmpty()) { |
| 79 int request_id = subscription_callbacks_.Add(callbacks); | 80 int request_id = subscription_callbacks_.Add(callbacks); |
| 80 OnSubscribeFromDocumentError( | 81 OnSubscribeFromDocumentError( |
| 81 request_id, PUSH_REGISTRATION_STATUS_MANIFEST_EMPTY_OR_MISSING); | 82 request_id, PUSH_REGISTRATION_STATUS_MANIFEST_EMPTY_OR_MISSING); |
| 82 return; | 83 return; |
| 83 } | 84 } |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 : blink::WebPushError::ErrorTypeAbort; | 140 : blink::WebPushError::ErrorTypeAbort; |
| 140 | 141 |
| 141 callbacks->onError(blink::WebPushError( | 142 callbacks->onError(blink::WebPushError( |
| 142 error_type, | 143 error_type, |
| 143 blink::WebString::fromUTF8(PushRegistrationStatusToString(status)))); | 144 blink::WebString::fromUTF8(PushRegistrationStatusToString(status)))); |
| 144 | 145 |
| 145 subscription_callbacks_.Remove(request_id); | 146 subscription_callbacks_.Remove(request_id); |
| 146 } | 147 } |
| 147 | 148 |
| 148 } // namespace content | 149 } // namespace content |
| OLD | NEW |