diff options
author | yhirano <yhirano@chromium.org> | 2015-08-09 21:29:05 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-10 04:29:39 +0000 |
commit | 7f862b475953a0d6a1af42f27adf38062fe11b10 (patch) | |
tree | f049855b4c9bfeb3aaf584d692f7a851c56dc863 /content/child/push_messaging | |
parent | f331433b395b32cf23eca24a69df989cb196d344 (diff) | |
download | chromium_src-7f862b475953a0d6a1af42f27adf38062fe11b10.zip chromium_src-7f862b475953a0d6a1af42f27adf38062fe11b10.tar.gz chromium_src-7f862b475953a0d6a1af42f27adf38062fe11b10.tar.bz2 |
CallbackPromiseAdapter types should be more compatible with WebCallbacks (2/3).
This series of CLs makes CallbackPromiseAdapter (CPA) more compatible with
WebCallbacks (WC) in terms of type parameters.
Before this CL, CPA<S, T> corresponded to WC<S::WebType*, T::WebType*>. CPAs
took ownership of passed pointers but there was no place to represent that in
WebCallbacks.
This series of CLs changes that: CPA<S, T> correspond to WC<S::WebType,
T::WebType>. CPA users can specify if he/she wants the parameter ownership by
specifying the type parameter. For example, setting S::WebType to OwnPtr<X>
means it takes ownership. Setting S::WebType to |const X&| means it doesn't
take ownership.
WebCallbacks is exposed to chromium side, so we use WebPassOwnPtr as the
counterpart of PassOwnPtr.
[1] https://codereview.chromium.org/1234603003/
[2] This CL.
[3] https://codereview.chromium.org/1240763002/
BUG=493531
Review URL: https://codereview.chromium.org/1235083006
Cr-Commit-Position: refs/heads/master@{#342577}
Diffstat (limited to 'content/child/push_messaging')
-rw-r--r-- | content/child/push_messaging/push_provider.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/content/child/push_messaging/push_provider.cc b/content/child/push_messaging/push_provider.cc index 515c3fe..dd0c610 100644 --- a/content/child/push_messaging/push_provider.cc +++ b/content/child/push_messaging/push_provider.cc @@ -183,7 +183,7 @@ void PushProvider::OnUnsubscribeSuccess(int request_id, bool did_unsubscribe) { if (!callbacks) return; - callbacks->onSuccess(&did_unsubscribe); + callbacks->onSuccess(did_unsubscribe); unsubscribe_callbacks_.Remove(request_id); } @@ -197,9 +197,8 @@ void PushProvider::OnUnsubscribeError( if (!callbacks) return; - scoped_ptr<blink::WebPushError> error(new blink::WebPushError( + callbacks->onError(blink::WebPushError( error_type, blink::WebString::fromUTF8(error_message))); - callbacks->onError(error.release()); unsubscribe_callbacks_.Remove(request_id); } |