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

Side by Side Diff: chrome/browser/google_apis/request_sender.cc

Issue 17385023: Get rid of RequestRegistry (part 2): remove cancellation methods. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove unused methods in RequestRegisty Created 7 years, 6 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/google_apis/request_sender.h" 5 #include "chrome/browser/google_apis/request_sender.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "chrome/browser/google_apis/auth_service.h" 8 #include "chrome/browser/google_apis/auth_service.h"
9 #include "chrome/browser/google_apis/base_requests.h" 9 #include "chrome/browser/google_apis/base_requests.h"
10 #include "content/public/browser/browser_thread.h" 10 #include "content/public/browser/browser_thread.h"
(...skipping 17 matching lines...) Expand all
28 28
29 RequestSender::~RequestSender() { 29 RequestSender::~RequestSender() {
30 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 30 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
31 } 31 }
32 32
33 void RequestSender::Initialize() { 33 void RequestSender::Initialize() {
34 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 34 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
35 auth_service_->Initialize(profile_); 35 auth_service_->Initialize(profile_);
36 } 36 }
37 37
38 void RequestSender::CancelAll() {
39 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
40 request_registry_->CancelAll();
41 }
42
43 base::Closure RequestSender::StartRequestWithRetry( 38 base::Closure RequestSender::StartRequestWithRetry(
44 AuthenticatedRequestInterface* request) { 39 AuthenticatedRequestInterface* request) {
45 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 40 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
46 41
47 // TODO(kinaba): Stop relying on weak pointers. Move lifetime management 42 // TODO(kinaba): Stop relying on weak pointers. Move lifetime management
48 // of the requests to request sender. 43 // of the requests to request sender.
49 base::Closure cancel_closure = 44 base::Closure cancel_closure =
50 base::Bind(&RequestSender::CancelRequest, 45 base::Bind(&RequestSender::CancelRequest,
51 weak_ptr_factory_.GetWeakPtr(), 46 weak_ptr_factory_.GetWeakPtr(),
52 request->GetWeakPtr()); 47 request->GetWeakPtr());
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 const base::WeakPtr<AuthenticatedRequestInterface>& request) { 93 const base::WeakPtr<AuthenticatedRequestInterface>& request) {
99 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 94 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
100 95
101 // Do nothing if the request is already finished. 96 // Do nothing if the request is already finished.
102 if (!request.get()) 97 if (!request.get())
103 return; 98 return;
104 request_registry_->CancelRequest(request->AsRequestRegistryRequest()); 99 request_registry_->CancelRequest(request->AsRequestRegistryRequest());
105 } 100 }
106 101
107 } // namespace google_apis 102 } // namespace google_apis
OLDNEW
« no previous file with comments | « chrome/browser/google_apis/request_sender.h ('k') | chrome/browser/sync_file_system/drive/api_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698