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

Side by Side Diff: chrome/browser/push_messaging/push_messaging_service_impl.cc

Issue 2828663002: Rewrite base::Bind to base::BindOnce with base_bind_rewriters in //chrome/browser/{i,l,m,n,p,r}* (Closed)
Patch Set: Created 3 years, 8 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
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 "chrome/browser/push_messaging/push_messaging_service_impl.h" 5 #include "chrome/browser/push_messaging/push_messaging_service_impl.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/barrier_closure.h" 9 #include "base/barrier_closure.h"
10 #include "base/base64url.h" 10 #include "base/base64url.h"
(...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 void PushMessagingServiceImpl::DidDeleteID(const std::string& app_id, 807 void PushMessagingServiceImpl::DidDeleteID(const std::string& app_id,
808 bool was_subscribed, 808 bool was_subscribed,
809 InstanceID::Result result) { 809 InstanceID::Result result) {
810 RecordUnsubscribeIIDResult(result); 810 RecordUnsubscribeIIDResult(result);
811 // DidUnsubscribe must be run asynchronously when passing a non-empty 811 // DidUnsubscribe must be run asynchronously when passing a non-empty
812 // |app_id_when_instance_id|, since it calls 812 // |app_id_when_instance_id|, since it calls
813 // InstanceIDDriver::RemoveInstanceID which deletes the InstanceID itself. 813 // InstanceIDDriver::RemoveInstanceID which deletes the InstanceID itself.
814 // Calling that immediately would cause a use-after-free in our caller. 814 // Calling that immediately would cause a use-after-free in our caller.
815 base::ThreadTaskRunnerHandle::Get()->PostTask( 815 base::ThreadTaskRunnerHandle::Get()->PostTask(
816 FROM_HERE, 816 FROM_HERE,
817 base::Bind(&PushMessagingServiceImpl::DidUnsubscribe, 817 base::BindOnce(&PushMessagingServiceImpl::DidUnsubscribe,
818 weak_factory_.GetWeakPtr(), app_id, was_subscribed)); 818 weak_factory_.GetWeakPtr(), app_id, was_subscribed));
819 } 819 }
820 820
821 void PushMessagingServiceImpl::DidUnsubscribe( 821 void PushMessagingServiceImpl::DidUnsubscribe(
822 const std::string& app_id_when_instance_id, 822 const std::string& app_id_when_instance_id,
823 bool was_subscribed) { 823 bool was_subscribed) {
824 if (!app_id_when_instance_id.empty()) 824 if (!app_id_when_instance_id.empty())
825 GetInstanceIDDriver()->RemoveInstanceID(app_id_when_instance_id); 825 GetInstanceIDDriver()->RemoveInstanceID(app_id_when_instance_id);
826 826
827 if (was_subscribed) 827 if (was_subscribed)
828 DecreasePushSubscriptionCount(1, false /* was_pending */); 828 DecreasePushSubscriptionCount(1, false /* was_pending */);
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
1019 } 1019 }
1020 1020
1021 instance_id::InstanceIDDriver* PushMessagingServiceImpl::GetInstanceIDDriver() 1021 instance_id::InstanceIDDriver* PushMessagingServiceImpl::GetInstanceIDDriver()
1022 const { 1022 const {
1023 instance_id::InstanceIDProfileService* instance_id_profile_service = 1023 instance_id::InstanceIDProfileService* instance_id_profile_service =
1024 instance_id::InstanceIDProfileServiceFactory::GetForProfile(profile_); 1024 instance_id::InstanceIDProfileServiceFactory::GetForProfile(profile_);
1025 CHECK(instance_id_profile_service); 1025 CHECK(instance_id_profile_service);
1026 CHECK(instance_id_profile_service->driver()); 1026 CHECK(instance_id_profile_service->driver());
1027 return instance_id_profile_service->driver(); 1027 return instance_id_profile_service->driver();
1028 } 1028 }
OLDNEW
« no previous file with comments | « chrome/browser/push_messaging/push_messaging_notification_manager.cc ('k') | chrome/browser/referrer_policy_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698