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

Side by Side Diff: content/child/push_messaging/push_provider.cc

Issue 1217633003: (WONT COMMIT) Pass a bool object allocated on heap to CallbackPromiseAdapter::onSuccess (1) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 | « no previous file | content/child/service_worker/service_worker_dispatcher.cc » ('j') | 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/child/push_messaging/push_provider.h" 5 #include "content/child/push_messaging/push_provider.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/threading/thread_local.h" 10 #include "base/threading/thread_local.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 175
176 subscription_callbacks_.Remove(request_id); 176 subscription_callbacks_.Remove(request_id);
177 } 177 }
178 178
179 void PushProvider::OnUnsubscribeSuccess(int request_id, bool did_unsubscribe) { 179 void PushProvider::OnUnsubscribeSuccess(int request_id, bool did_unsubscribe) {
180 blink::WebPushUnsubscribeCallbacks* callbacks = 180 blink::WebPushUnsubscribeCallbacks* callbacks =
181 unsubscribe_callbacks_.Lookup(request_id); 181 unsubscribe_callbacks_.Lookup(request_id);
182 if (!callbacks) 182 if (!callbacks)
183 return; 183 return;
184 184
185 #ifdef CRBUG_493531
186 callbacks->onSuccess(new bool(did_unsubscribe));
187 #else
185 callbacks->onSuccess(&did_unsubscribe); 188 callbacks->onSuccess(&did_unsubscribe);
189 #endif
186 190
187 unsubscribe_callbacks_.Remove(request_id); 191 unsubscribe_callbacks_.Remove(request_id);
188 } 192 }
189 193
190 void PushProvider::OnUnsubscribeError( 194 void PushProvider::OnUnsubscribeError(
191 int request_id, 195 int request_id,
192 blink::WebPushError::ErrorType error_type, 196 blink::WebPushError::ErrorType error_type,
193 const std::string& error_message) { 197 const std::string& error_message) {
194 blink::WebPushUnsubscribeCallbacks* callbacks = 198 blink::WebPushUnsubscribeCallbacks* callbacks =
195 unsubscribe_callbacks_.Lookup(request_id); 199 unsubscribe_callbacks_.Lookup(request_id);
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 266
263 scoped_ptr<blink::WebPushError> web_error(new blink::WebPushError( 267 scoped_ptr<blink::WebPushError> web_error(new blink::WebPushError(
264 error, blink::WebString::fromUTF8(error_message))); 268 error, blink::WebString::fromUTF8(error_message)));
265 269
266 callbacks->onError(web_error.release()); 270 callbacks->onError(web_error.release());
267 271
268 permission_status_callbacks_.Remove(request_id); 272 permission_status_callbacks_.Remove(request_id);
269 } 273 }
270 274
271 } // namespace content 275 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/child/service_worker/service_worker_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698