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

Side by Side Diff: components/invalidation/impl/gcm_invalidation_bridge.cc

Issue 1440593004: Make operators on scoped_ptr match the ones defined for std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptrequals: followupfix-after-rebase Created 5 years, 1 month 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/location.h" 6 #include "base/location.h"
7 #include "base/single_thread_task_runner.h" 7 #include "base/single_thread_task_runner.h"
8 #include "base/thread_task_runner_handle.h" 8 #include "base/thread_task_runner_handle.h"
9 #include "components/gcm_driver/gcm_driver.h" 9 #include "components/gcm_driver/gcm_driver.h"
10 #include "components/invalidation/impl/gcm_invalidation_bridge.h" 10 #include "components/invalidation/impl/gcm_invalidation_bridge.h"
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 scopes.insert(GaiaConstants::kChromeSyncOAuth2Scope); 207 scopes.insert(GaiaConstants::kChromeSyncOAuth2Scope);
208 access_token_request_ = identity_provider_->GetTokenService()->StartRequest( 208 access_token_request_ = identity_provider_->GetTokenService()->StartRequest(
209 identity_provider_->GetActiveAccountId(), scopes, this); 209 identity_provider_->GetActiveAccountId(), scopes, this);
210 } 210 }
211 211
212 void GCMInvalidationBridge::OnGetTokenSuccess( 212 void GCMInvalidationBridge::OnGetTokenSuccess(
213 const OAuth2TokenService::Request* request, 213 const OAuth2TokenService::Request* request,
214 const std::string& access_token, 214 const std::string& access_token,
215 const base::Time& expiration_time) { 215 const base::Time& expiration_time) {
216 DCHECK(CalledOnValidThread()); 216 DCHECK(CalledOnValidThread());
217 DCHECK_EQ(access_token_request_, request); 217 DCHECK_EQ(access_token_request_.get(), request);
218 core_thread_task_runner_->PostTask( 218 core_thread_task_runner_->PostTask(
219 FROM_HERE, 219 FROM_HERE,
220 base::Bind(&GCMInvalidationBridge::Core::RequestTokenFinished, 220 base::Bind(&GCMInvalidationBridge::Core::RequestTokenFinished,
221 core_, 221 core_,
222 request_token_callback_, 222 request_token_callback_,
223 GoogleServiceAuthError::AuthErrorNone(), 223 GoogleServiceAuthError::AuthErrorNone(),
224 access_token)); 224 access_token));
225 request_token_callback_.Reset(); 225 request_token_callback_.Reset();
226 access_token_request_.reset(); 226 access_token_request_.reset();
227 } 227 }
228 228
229 void GCMInvalidationBridge::OnGetTokenFailure( 229 void GCMInvalidationBridge::OnGetTokenFailure(
230 const OAuth2TokenService::Request* request, 230 const OAuth2TokenService::Request* request,
231 const GoogleServiceAuthError& error) { 231 const GoogleServiceAuthError& error) {
232 DCHECK(CalledOnValidThread()); 232 DCHECK(CalledOnValidThread());
233 DCHECK_EQ(access_token_request_, request); 233 DCHECK_EQ(access_token_request_.get(), request);
234 core_thread_task_runner_->PostTask( 234 core_thread_task_runner_->PostTask(
235 FROM_HERE, 235 FROM_HERE,
236 base::Bind(&GCMInvalidationBridge::Core::RequestTokenFinished, 236 base::Bind(&GCMInvalidationBridge::Core::RequestTokenFinished,
237 core_, 237 core_,
238 request_token_callback_, 238 request_token_callback_,
239 error, 239 error,
240 std::string())); 240 std::string()));
241 request_token_callback_.Reset(); 241 request_token_callback_.Reset();
242 access_token_request_.reset(); 242 access_token_request_.reset();
243 } 243 }
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 367
368 void GCMInvalidationBridge::OnDisconnected() { 368 void GCMInvalidationBridge::OnDisconnected() {
369 core_thread_task_runner_->PostTask( 369 core_thread_task_runner_->PostTask(
370 FROM_HERE, 370 FROM_HERE,
371 base::Bind(&GCMInvalidationBridge::Core::OnConnectionStateChanged, 371 base::Bind(&GCMInvalidationBridge::Core::OnConnectionStateChanged,
372 core_, 372 core_,
373 false)); 373 false));
374 } 374 }
375 375
376 } // namespace invalidation 376 } // namespace invalidation
OLDNEW
« no previous file with comments | « components/cronet/android/cronet_url_request_adapter.cc ('k') | components/invalidation/impl/gcm_network_channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698