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

Side by Side Diff: google_apis/gaia/oauth2_access_token_fetcher_immediate_error.cc

Issue 2083383002: Remove calls to deprecated MessageLoop methods in google_apis. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: manual change Created 4 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 | google_apis/gaia/oauth2_token_service_request_unittest.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 "google_apis/gaia/oauth2_access_token_fetcher_immediate_error.h" 5 #include "google_apis/gaia/oauth2_access_token_fetcher_immediate_error.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/threading/thread_task_runner_handle.h"
9 #include "google_apis/gaia/google_service_auth_error.h" 9 #include "google_apis/gaia/google_service_auth_error.h"
10 10
11 11
12 OAuth2AccessTokenFetcherImmediateError::FailCaller::FailCaller( 12 OAuth2AccessTokenFetcherImmediateError::FailCaller::FailCaller(
13 OAuth2AccessTokenFetcherImmediateError* fetcher) 13 OAuth2AccessTokenFetcherImmediateError* fetcher)
14 : fetcher_(fetcher) { 14 : fetcher_(fetcher) {
15 base::MessageLoop* looper = base::MessageLoop::current(); 15 base::ThreadTaskRunnerHandle::Get()->PostTask(
16 DCHECK(looper);
17 looper->PostTask(
18 FROM_HERE, 16 FROM_HERE,
19 base::Bind(&OAuth2AccessTokenFetcherImmediateError::FailCaller::run, 17 base::Bind(&OAuth2AccessTokenFetcherImmediateError::FailCaller::run,
20 this)); 18 this));
21 } 19 }
22 20
23 OAuth2AccessTokenFetcherImmediateError::FailCaller::~FailCaller() { 21 OAuth2AccessTokenFetcherImmediateError::FailCaller::~FailCaller() {
24 } 22 }
25 23
26 void OAuth2AccessTokenFetcherImmediateError::FailCaller::run() { 24 void OAuth2AccessTokenFetcherImmediateError::FailCaller::run() {
27 if (fetcher_) { 25 if (fetcher_) {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 } 61 }
64 62
65 void OAuth2AccessTokenFetcherImmediateError::Fail() { 63 void OAuth2AccessTokenFetcherImmediateError::Fail() {
66 // The call below will likely destruct this object. We have to make a copy 64 // The call below will likely destruct this object. We have to make a copy
67 // of the error into a local variable because the class member thus will 65 // of the error into a local variable because the class member thus will
68 // be destroyed after which the copy-passed-by-reference will cause a 66 // be destroyed after which the copy-passed-by-reference will cause a
69 // memory violation when accessed. 67 // memory violation when accessed.
70 GoogleServiceAuthError error_copy = immediate_error_; 68 GoogleServiceAuthError error_copy = immediate_error_;
71 FireOnGetTokenFailure(error_copy); 69 FireOnGetTokenFailure(error_copy);
72 } 70 }
OLDNEW
« no previous file with comments | « no previous file | google_apis/gaia/oauth2_token_service_request_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698