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

Side by Side Diff: content/renderer/push_messaging_dispatcher.cc

Issue 658783002: Split PushMessagingStatus enum according to use case (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update comment Created 6 years, 2 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
« no previous file with comments | « content/renderer/push_messaging_dispatcher.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/renderer/push_messaging_dispatcher.h" 5 #include "content/renderer/push_messaging_dispatcher.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "content/child/service_worker/web_service_worker_provider_impl.h" 8 #include "content/child/service_worker/web_service_worker_provider_impl.h"
9 #include "content/common/push_messaging_messages.h" 9 #include "content/common/push_messaging_messages.h"
10 #include "content/renderer/manifest/manifest_manager.h" 10 #include "content/renderer/manifest/manifest_manager.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 78
79 scoped_ptr<blink::WebPushRegistration> registration( 79 scoped_ptr<blink::WebPushRegistration> registration(
80 new blink::WebPushRegistration( 80 new blink::WebPushRegistration(
81 WebString::fromUTF8(endpoint.spec()), 81 WebString::fromUTF8(endpoint.spec()),
82 WebString::fromUTF8(registration_id))); 82 WebString::fromUTF8(registration_id)));
83 callbacks->onSuccess(registration.release()); 83 callbacks->onSuccess(registration.release());
84 registration_callbacks_.Remove(callbacks_id); 84 registration_callbacks_.Remove(callbacks_id);
85 } 85 }
86 86
87 void PushMessagingDispatcher::OnRegisterError(int32 callbacks_id, 87 void PushMessagingDispatcher::OnRegisterError(int32 callbacks_id,
88 PushMessagingStatus status) { 88 PushRegistrationStatus status) {
89 blink::WebPushRegistrationCallbacks* callbacks = 89 blink::WebPushRegistrationCallbacks* callbacks =
90 registration_callbacks_.Lookup(callbacks_id); 90 registration_callbacks_.Lookup(callbacks_id);
91 CHECK(callbacks); 91 CHECK(callbacks);
92 92
93 scoped_ptr<blink::WebPushError> error(new blink::WebPushError( 93 scoped_ptr<blink::WebPushError> error(new blink::WebPushError(
94 blink::WebPushError::ErrorTypeAbort, 94 blink::WebPushError::ErrorTypeAbort,
95 WebString::fromUTF8(PushMessagingStatusToString(status)))); 95 WebString::fromUTF8(PushRegistrationStatusToString(status))));
96 callbacks->onError(error.release()); 96 callbacks->onError(error.release());
97 registration_callbacks_.Remove(callbacks_id); 97 registration_callbacks_.Remove(callbacks_id);
98 } 98 }
99 99
100 } // namespace content 100 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/push_messaging_dispatcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698