summaryrefslogtreecommitdiffstats
path: root/chrome/browser/google_apis
diff options
context:
space:
mode:
authorkinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-31 04:06:36 +0000
committerkinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-31 04:06:36 +0000
commit09d4cc69b961ddf85f13161e3ff192561a87d488 (patch)
tree60edb6261d219d6ae5309a6cf8668a318fb20cb6 /chrome/browser/google_apis
parente3471c2613b878d7c3a61905d8a7e6e41c43b946 (diff)
downloadchromium_src-09d4cc69b961ddf85f13161e3ff192561a87d488.zip
chromium_src-09d4cc69b961ddf85f13161e3ff192561a87d488.tar.gz
chromium_src-09d4cc69b961ddf85f13161e3ff192561a87d488.tar.bz2
Misc clean up around Chrome OS Drive integration code.
Fixing typos, obsolete comments, and removing unused declarations. BUG=none R=hidehiko@chromium.org Review URL: https://codereview.chromium.org/21107006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@214553 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/google_apis')
-rw-r--r--chrome/browser/google_apis/auth_service.cc12
-rw-r--r--chrome/browser/google_apis/auth_service.h7
-rw-r--r--chrome/browser/google_apis/auth_service_interface.h5
-rw-r--r--chrome/browser/google_apis/auth_service_observer.h2
-rw-r--r--chrome/browser/google_apis/base_requests.h12
-rw-r--r--chrome/browser/google_apis/drive_common_callbacks.h2
-rw-r--r--chrome/browser/google_apis/gdata_wapi_requests.cc11
-rw-r--r--chrome/browser/google_apis/gdata_wapi_url_generator.h3
-rw-r--r--chrome/browser/google_apis/request_sender.h4
9 files changed, 16 insertions, 42 deletions
diff --git a/chrome/browser/google_apis/auth_service.cc b/chrome/browser/google_apis/auth_service.cc
index 584a709..d4468c6 100644
--- a/chrome/browser/google_apis/auth_service.cc
+++ b/chrome/browser/google_apis/auth_service.cc
@@ -13,8 +13,6 @@
#include "base/metrics/histogram.h"
#include "chrome/browser/google_apis/auth_service_observer.h"
#include "chrome/browser/profiles/profile.h"
-#include "google_apis/gaia/gaia_constants.h"
-#include "google_apis/gaia/gaia_urls.h"
#include "google_apis/gaia/google_service_auth_error.h"
#if defined(OS_CHROMEOS)
@@ -51,7 +49,6 @@ class AuthRequest : public OAuth2TokenService::Consumer {
const GoogleServiceAuthError& error) OVERRIDE;
AuthStatusCallback callback_;
- OAuth2TokenService::ScopeSet scopes_;
scoped_ptr<OAuth2TokenService::Request> request_;
base::ThreadChecker thread_checker_;
@@ -63,11 +60,13 @@ AuthRequest::AuthRequest(
net::URLRequestContextGetter* url_request_context_getter,
const AuthStatusCallback& callback,
const std::vector<std::string>& scopes)
- : callback_(callback),
- scopes_(scopes.begin(), scopes.end()) {
+ : callback_(callback) {
DCHECK(!callback_.is_null());
request_ = oauth2_token_service->
- StartRequestWithContext(url_request_context_getter, scopes_, this);
+ StartRequestWithContext(
+ url_request_context_getter,
+ OAuth2TokenService::ScopeSet(scopes.begin(), scopes.end()),
+ this);
}
AuthRequest::~AuthRequest() {}
@@ -129,7 +128,6 @@ AuthService::AuthService(
url_request_context_getter_(url_request_context_getter),
scopes_(scopes),
weak_ptr_factory_(this) {
- DCHECK(thread_checker_.CalledOnValidThread());
DCHECK(oauth2_token_service);
// Get OAuth2 refresh token (if we have any) and register for its updates.
diff --git a/chrome/browser/google_apis/auth_service.h b/chrome/browser/google_apis/auth_service.h
index 20ffe1e..b9b7b75 100644
--- a/chrome/browser/google_apis/auth_service.h
+++ b/chrome/browser/google_apis/auth_service.h
@@ -26,7 +26,7 @@ class AuthServiceObserver;
// This class provides authentication for Google services.
// It integrates specific service integration with OAuth2 stack
-// (TokenService) and provides OAuth2 token refresh infrastructure.
+// (OAuth2TokenService) and provides OAuth2 token refresh infrastructure.
// All public functions must be called on UI thread.
class AuthService : public AuthServiceInterface,
public OAuth2TokenService::Observer {
@@ -56,11 +56,6 @@ class AuthService : public AuthServiceInterface,
const std::string& account_id,
const GoogleServiceAuthError& error) OVERRIDE;
- // Sets the access_token as specified. This should be used only for testing.
- void set_access_token_for_testing(const std::string& token) {
- access_token_ = token;
- }
-
// Returns true if authentication can be done using the class for the given
// profile. For instance, this function returns false if the profile is
// used for the incognito mode.
diff --git a/chrome/browser/google_apis/auth_service_interface.h b/chrome/browser/google_apis/auth_service_interface.h
index faf9659..0f1d1041 100644
--- a/chrome/browser/google_apis/auth_service_interface.h
+++ b/chrome/browser/google_apis/auth_service_interface.h
@@ -10,8 +10,6 @@
#include "base/callback_forward.h"
#include "chrome/browser/google_apis/gdata_errorcode.h"
-class Profile;
-
namespace google_apis {
class AuthServiceObserver;
@@ -28,8 +26,7 @@ class AuthServiceInterface {
public:
virtual ~AuthServiceInterface() {}
- // Adds and removes the observer. AddObserver() should be called before
- // Initialize() as it can change the refresh token.
+ // Adds and removes the observer.
virtual void AddObserver(AuthServiceObserver* observer) = 0;
virtual void RemoveObserver(AuthServiceObserver* observer) = 0;
diff --git a/chrome/browser/google_apis/auth_service_observer.h b/chrome/browser/google_apis/auth_service_observer.h
index cba9e36..44c5d08 100644
--- a/chrome/browser/google_apis/auth_service_observer.h
+++ b/chrome/browser/google_apis/auth_service_observer.h
@@ -11,7 +11,7 @@ namespace google_apis {
// All events are notified on UI thread.
class AuthServiceObserver {
public:
- // Triggered when a new OAuth2 refresh token is received from TokenService.
+ // Triggered when a new OAuth2 refresh token is received from AuthService.
virtual void OnOAuth2RefreshTokenChanged() = 0;
protected:
diff --git a/chrome/browser/google_apis/base_requests.h b/chrome/browser/google_apis/base_requests.h
index 45cc358..d30f6a0 100644
--- a/chrome/browser/google_apis/base_requests.h
+++ b/chrome/browser/google_apis/base_requests.h
@@ -174,7 +174,7 @@ class UrlFetchRequestBase : public AuthenticatedRequestInterface,
//============================ EntryActionRequest ============================
-// Callback type for Delete/Move DocumentServiceInterface calls.
+// Callback type for requests that return only error status, like: Delete/Move.
typedef base::Callback<void(GDataErrorCode error)> EntryActionCallback;
// This class performs a simple action over a given entry (document/file).
@@ -200,9 +200,7 @@ class EntryActionRequest : public UrlFetchRequestBase {
//============================== GetDataRequest ==============================
-// Callback type for DocumentServiceInterface::GetResourceList.
-// Note: json_data argument should be passed using base::Passed(&json_data), not
-// json_data.Pass().
+// Callback type for requests that returns JSON data.
typedef base::Callback<void(GDataErrorCode error,
scoped_ptr<base::Value> json_data)> GetDataCallback;
@@ -246,7 +244,7 @@ class GetDataRequest : public UrlFetchRequestBase {
//=========================== InitiateUploadRequestBase=======================
-// Callback type for DocumentServiceInterface::InitiateUpload.
+// Callback type for DriveServiceInterface::InitiateUpload.
typedef base::Callback<void(GDataErrorCode error,
const GURL& upload_url)> InitiateUploadCallback;
@@ -257,7 +255,7 @@ typedef base::Callback<void(GDataErrorCode error,
//
// Here's the flow of uploading:
// 1) Get the upload URL with a class inheriting InitiateUploadRequestBase.
-// 2) Upload the first 512KB (see kUploadChunkSize in drive_uploader.cc)
+// 2) Upload the first 1GB (see kUploadChunkSize in drive_uploader.cc)
// of the target file to the upload URL
// 3) If there is more data to upload, go to 2).
//
@@ -312,7 +310,7 @@ struct UploadRangeResponse {
// "Range" header and invoke OnRangeRequestComplete.
class UploadRangeRequestBase : public UrlFetchRequestBase {
protected:
- // |upload_location| is the URL of where to upload the file to.
+ // |upload_url| is the URL of where to upload the file to.
UploadRangeRequestBase(RequestSender* sender, const GURL& upload_url);
virtual ~UploadRangeRequestBase();
diff --git a/chrome/browser/google_apis/drive_common_callbacks.h b/chrome/browser/google_apis/drive_common_callbacks.h
index fb6d760..24e125c 100644
--- a/chrome/browser/google_apis/drive_common_callbacks.h
+++ b/chrome/browser/google_apis/drive_common_callbacks.h
@@ -45,7 +45,7 @@ typedef base::Callback<void(
const UploadRangeResponse& response,
scoped_ptr<ResourceEntry> new_entry)> UploadRangeCallback;
-// Callback used for authrozing an app. |open_url| is used to open the target
+// Callback used for authorizing an app. |open_url| is used to open the target
// file with the authorized app.
typedef base::Callback<void(GDataErrorCode error,
const GURL& open_url)>
diff --git a/chrome/browser/google_apis/gdata_wapi_requests.cc b/chrome/browser/google_apis/gdata_wapi_requests.cc
index 1141db2..1f99108 100644
--- a/chrome/browser/google_apis/gdata_wapi_requests.cc
+++ b/chrome/browser/google_apis/gdata_wapi_requests.cc
@@ -24,13 +24,6 @@ namespace google_apis {
namespace {
-const char kUploadContentRange[] = "Content-Range: bytes ";
-
-const char kFeedField[] = "feed";
-
-// Templates for file uploading.
-const char kUploadResponseRange[] = "range";
-
// Parses the JSON value to ResourceList.
scoped_ptr<ResourceList> ParseResourceListOnBlockingPool(
scoped_ptr<base::Value> value) {
@@ -39,8 +32,8 @@ scoped_ptr<ResourceList> ParseResourceListOnBlockingPool(
return ResourceList::ExtractAndParse(*value);
}
-// Runs |callback| with |error| and |value|, but replace the error code with
-// GDATA_PARSE_ERROR, if there was a parsing error.
+// Runs |callback| with |error| and |resource_list|, but replace the error code
+// with GDATA_PARSE_ERROR, if there was a parsing error.
void DidParseResourceListOnBlockingPool(
const GetResourceListCallback& callback,
GDataErrorCode error,
diff --git a/chrome/browser/google_apis/gdata_wapi_url_generator.h b/chrome/browser/google_apis/gdata_wapi_url_generator.h
index 4e23c69..6781cf0 100644
--- a/chrome/browser/google_apis/gdata_wapi_url_generator.h
+++ b/chrome/browser/google_apis/gdata_wapi_url_generator.h
@@ -47,9 +47,6 @@ class GDataWapiUrlGenerator {
// |override_url| is empty, others are not used. Besides, |search_string|
// cannot be set together with |start_changestamp|.
//
- // TODO(kinaba,haruki): http://crbug.com/160932
- // This is really hard to follow. We should split to multiple functions.
- //
// override_url:
// By default, a hard-coded base URL of the WAPI server is used.
// The base URL can be overridden by |override_url|.
diff --git a/chrome/browser/google_apis/request_sender.h b/chrome/browser/google_apis/request_sender.h
index 2e1a94b..dc1514b 100644
--- a/chrome/browser/google_apis/request_sender.h
+++ b/chrome/browser/google_apis/request_sender.h
@@ -17,8 +17,6 @@
#include "base/threading/thread_checker.h"
#include "chrome/browser/google_apis/gdata_errorcode.h"
-class Profile;
-
namespace base {
class TaskRunner;
}
@@ -45,8 +43,6 @@ class RequestSender {
// |blocking_task_runner| is used for running blocking operation, e.g.,
// parsing JSON response from the server.
//
- // |scopes| specifies OAuth2 scopes.
- //
// |custom_user_agent| will be used for the User-Agent header in HTTP
// requests issued through the request sender if the value is not empty.
RequestSender(AuthServiceInterface* auth_service,