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

Unified Diff: chrome/browser/google_apis/request_sender.cc

Issue 16175003: google_apis: Rename OperationRunner to RequestSender (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/google_apis/request_sender.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/google_apis/request_sender.cc
diff --git a/chrome/browser/google_apis/operation_runner.cc b/chrome/browser/google_apis/request_sender.cc
similarity index 64%
rename from chrome/browser/google_apis/operation_runner.cc
rename to chrome/browser/google_apis/request_sender.cc
index 21be6fb3b7b5a7c161a7d0ef9e82aeb788ea0261..6d9810a5e4c3338e408a9b87a56480133804487c 100644
--- a/chrome/browser/google_apis/operation_runner.cc
+++ b/chrome/browser/google_apis/request_sender.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/google_apis/operation_runner.h"
+#include "chrome/browser/google_apis/request_sender.h"
#include "base/bind.h"
#include "chrome/browser/google_apis/auth_service.h"
@@ -13,7 +13,7 @@ using content::BrowserThread;
namespace google_apis {
-OperationRunner::OperationRunner(
+RequestSender::RequestSender(
Profile* profile,
net::URLRequestContextGetter* url_request_context_getter,
const std::vector<std::string>& scopes,
@@ -26,65 +26,65 @@ OperationRunner::OperationRunner(
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
}
-OperationRunner::~OperationRunner() {
+RequestSender::~RequestSender() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
}
-void OperationRunner::Initialize() {
+void RequestSender::Initialize() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
auth_service_->Initialize(profile_);
}
-void OperationRunner::CancelAll() {
+void RequestSender::CancelAll() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
operation_registry_->CancelAll();
}
-void OperationRunner::StartOperationWithRetry(
- AuthenticatedRequestInterface* operation) {
+void RequestSender::StartRequestWithRetry(
+ AuthenticatedRequestInterface* request) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (!auth_service_->HasAccessToken()) {
// Fetch OAuth2 access token from the refresh token first.
auth_service_->StartAuthentication(
- base::Bind(&OperationRunner::OnAccessTokenFetched,
+ base::Bind(&RequestSender::OnAccessTokenFetched,
weak_ptr_factory_.GetWeakPtr(),
- operation->GetWeakPtr()));
+ request->GetWeakPtr()));
return;
}
- operation->Start(auth_service_->access_token(),
- custom_user_agent_,
- base::Bind(&OperationRunner::RetryOperation,
- weak_ptr_factory_.GetWeakPtr()));
+ request->Start(auth_service_->access_token(),
+ custom_user_agent_,
+ base::Bind(&RequestSender::RetryRequest,
+ weak_ptr_factory_.GetWeakPtr()));
}
-void OperationRunner::OnAccessTokenFetched(
- const base::WeakPtr<AuthenticatedRequestInterface>& operation,
+void RequestSender::OnAccessTokenFetched(
+ const base::WeakPtr<AuthenticatedRequestInterface>& request,
GDataErrorCode code,
const std::string& /* access_token */) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- // Do nothing if the operation is canceled during authentication.
- if (!operation.get())
+ // Do nothing if the request is canceled during authentication.
+ if (!request.get())
return;
if (code == HTTP_SUCCESS) {
DCHECK(auth_service_->HasAccessToken());
- StartOperationWithRetry(operation.get());
+ StartRequestWithRetry(request.get());
} else {
- operation->OnAuthFailed(code);
+ request->OnAuthFailed(code);
}
}
-void OperationRunner::RetryOperation(
- AuthenticatedRequestInterface* operation) {
+void RequestSender::RetryRequest(
+ AuthenticatedRequestInterface* request) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
auth_service_->ClearAccessToken();
// User authentication might have expired - rerun the request to force
// auth token refresh.
- StartOperationWithRetry(operation);
+ StartRequestWithRetry(request);
}
} // namespace google_apis
« no previous file with comments | « chrome/browser/google_apis/request_sender.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698