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

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

Issue 470133005: Improve comment in OAuth2TokenServiceRequest::Core. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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_token_service_request.h" 5 #include "google_apis/gaia/oauth2_token_service_request.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 OAuth2TokenServiceRequest* owner(); 70 OAuth2TokenServiceRequest* owner();
71 71
72 private: 72 private:
73 friend class base::RefCountedThreadSafe<OAuth2TokenServiceRequest::Core>; 73 friend class base::RefCountedThreadSafe<OAuth2TokenServiceRequest::Core>;
74 74
75 void DoNothing(); 75 void DoNothing();
76 76
77 scoped_refptr<base::SingleThreadTaskRunner> token_service_task_runner_; 77 scoped_refptr<base::SingleThreadTaskRunner> token_service_task_runner_;
78 OAuth2TokenServiceRequest* owner_; 78 OAuth2TokenServiceRequest* owner_;
79 79
80 // It is important that provider_ is destroyed on the owner thread, not the 80 // Clear on owner thread. OAuth2TokenServiceRequest promises to clear its
81 // token_service_task_runner_ thread. 81 // last reference to TokenServiceProvider on the owner thread so the caller
82 // can ensure it is destroyed on the owner thread if desired.
82 scoped_refptr<TokenServiceProvider> provider_; 83 scoped_refptr<TokenServiceProvider> provider_;
83 84
84 DISALLOW_COPY_AND_ASSIGN(Core); 85 DISALLOW_COPY_AND_ASSIGN(Core);
85 }; 86 };
86 87
87 OAuth2TokenServiceRequest::Core::Core( 88 OAuth2TokenServiceRequest::Core::Core(
88 OAuth2TokenServiceRequest* owner, 89 OAuth2TokenServiceRequest* owner,
89 const scoped_refptr<TokenServiceProvider>& provider) 90 const scoped_refptr<TokenServiceProvider>& provider)
90 : owner_(owner), provider_(provider) { 91 : owner_(owner), provider_(provider) {
91 DCHECK(owner_); 92 DCHECK(owner_);
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 const std::string& account_id) 362 const std::string& account_id)
362 : account_id_(account_id) { 363 : account_id_(account_id) {
363 DCHECK(!account_id_.empty()); 364 DCHECK(!account_id_.empty());
364 } 365 }
365 366
366 void OAuth2TokenServiceRequest::StartWithCore(const scoped_refptr<Core>& core) { 367 void OAuth2TokenServiceRequest::StartWithCore(const scoped_refptr<Core>& core) {
367 DCHECK(core); 368 DCHECK(core);
368 core_ = core; 369 core_ = core;
369 core_->Start(); 370 core_->Start();
370 } 371 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698