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

Unified Diff: chrome/browser/google_apis/operation_runner.h

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/gdata_wapi_service.cc ('k') | chrome/browser/google_apis/operation_runner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/google_apis/operation_runner.h
diff --git a/chrome/browser/google_apis/operation_runner.h b/chrome/browser/google_apis/operation_runner.h
deleted file mode 100644
index 1d0adb9f98e04bf85bfabd174cc4aa6592c77fe3..0000000000000000000000000000000000000000
--- a/chrome/browser/google_apis/operation_runner.h
+++ /dev/null
@@ -1,87 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_GOOGLE_APIS_OPERATION_RUNNER_H_
-#define CHROME_BROWSER_GOOGLE_APIS_OPERATION_RUNNER_H_
-
-#include <string>
-#include <vector>
-
-#include "base/basictypes.h"
-#include "base/memory/scoped_ptr.h"
-#include "base/memory/weak_ptr.h"
-#include "chrome/browser/google_apis/gdata_errorcode.h"
-
-class Profile;
-
-namespace net {
-class URLRequestContextGetter;
-}
-
-namespace google_apis {
-
-class AuthenticatedRequestInterface;
-class AuthService;
-class OperationRegistry;
-
-// Helper class that runs AuthenticatedRequestInterface objects, handling
-// retries and authentication.
-class OperationRunner {
- public:
- // |url_request_context_getter| is used to perform authentication with
- // AuthService.
- //
- // |scopes| specifies OAuth2 scopes.
- //
- // |custom_user_agent| will be used for the User-Agent header in HTTP
- // requests issued through the operation runner if the value is not empty.
- OperationRunner(Profile* profile,
- net::URLRequestContextGetter* url_request_context_getter,
- const std::vector<std::string>& scopes,
- const std::string& custom_user_agent);
- virtual ~OperationRunner();
-
- AuthService* auth_service() { return auth_service_.get(); }
- OperationRegistry* operation_registry() {
- return operation_registry_.get();
- }
-
- // Prepares the object for use.
- virtual void Initialize();
-
- // Cancels all in-flight operations.
- void CancelAll();
-
- // Starts an operation implementing the AuthenticatedRequestInterface
- // interface, and makes the operation retry upon authentication failures by
- // calling back to RetryOperation.
- void StartOperationWithRetry(AuthenticatedRequestInterface* operation);
-
- private:
- // Called when the access token is fetched.
- void OnAccessTokenFetched(
- const base::WeakPtr<AuthenticatedRequestInterface>& operation,
- GDataErrorCode error,
- const std::string& access_token);
-
- // Clears any authentication token and retries the operation, which forces
- // an authentication token refresh.
- void RetryOperation(AuthenticatedRequestInterface* operation);
-
- Profile* profile_; // Not owned.
-
- scoped_ptr<AuthService> auth_service_;
- scoped_ptr<OperationRegistry> operation_registry_;
- const std::string custom_user_agent_;
-
- // Note: This should remain the last member so it'll be destroyed and
- // invalidate its weak pointers before any other members are destroyed.
- base::WeakPtrFactory<OperationRunner> weak_ptr_factory_;
-
- DISALLOW_COPY_AND_ASSIGN(OperationRunner);
-};
-
-} // namespace google_apis
-
-#endif // CHROME_BROWSER_GOOGLE_APIS_OPERATION_RUNNER_H_
« no previous file with comments | « chrome/browser/google_apis/gdata_wapi_service.cc ('k') | chrome/browser/google_apis/operation_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698