diff options
author | satorux <satorux@chromium.org> | 2015-01-28 23:50:53 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-01-29 07:53:07 +0000 |
commit | 1e04b42f4711bc16f194e3d45bde5b14d13afca8 (patch) | |
tree | 6e4e827bfb19a749fab8a4554ca3dcfaa8361311 /google_apis | |
parent | e86f141f9838096a7ace7f2353f4c28eeb72a67b (diff) | |
download | chromium_src-1e04b42f4711bc16f194e3d45bde5b14d13afca8.zip chromium_src-1e04b42f4711bc16f194e3d45bde5b14d13afca8.tar.gz chromium_src-1e04b42f4711bc16f194e3d45bde5b14d13afca8.tar.bz2 |
Rename gdata_errorcode.h to drive_api_error_codes.h
The term 'gdata' is no longer relevant, since we stiched from
WAPI (GDATA based API) to Drive API.
BUG=357038
TEST=everything builds as before
Review URL: https://codereview.chromium.org/881403003
Cr-Commit-Position: refs/heads/master@{#313676}
Diffstat (limited to 'google_apis')
20 files changed, 142 insertions, 142 deletions
diff --git a/google_apis/BUILD.gn b/google_apis/BUILD.gn index 265787a..3546c1d 100644 --- a/google_apis/BUILD.gn +++ b/google_apis/BUILD.gn @@ -144,6 +144,8 @@ source_set("google_apis") { "drive/auth_service_observer.h", "drive/base_requests.cc", "drive/base_requests.h", + "drive/drive_api_error_codes.cc", + "drive/drive_api_error_codes.h", "drive/drive_api_parser.cc", "drive/drive_api_parser.h", "drive/drive_api_requests.cc", @@ -151,8 +153,6 @@ source_set("google_apis") { "drive/drive_api_url_generator.cc", "drive/drive_api_url_generator.h", "drive/drive_common_callbacks.h", - "drive/gdata_errorcode.cc", - "drive/gdata_errorcode.h", "drive/request_sender.cc", "drive/request_sender.h", "drive/request_util.cc", diff --git a/google_apis/drive/auth_service.cc b/google_apis/drive/auth_service.cc index db49760..0fbc132 100644 --- a/google_apis/drive/auth_service.cc +++ b/google_apis/drive/auth_service.cc @@ -102,7 +102,7 @@ void AuthRequest::OnGetTokenFailure(const OAuth2TokenService::Request* request, // so that the file manager works while off-line. if (error.state() == GoogleServiceAuthError::CONNECTION_FAILED) { RecordAuthResultHistogram(kSuccessRatioHistogramNoConnection); - callback_.Run(GDATA_NO_CONNECTION, std::string()); + callback_.Run(DRIVE_NO_CONNECTION, std::string()); } else if (error.state() == GoogleServiceAuthError::SERVICE_UNAVAILABLE) { RecordAuthResultHistogram(kSuccessRatioHistogramTemporaryFailure); callback_.Run(HTTP_FORBIDDEN, std::string()); @@ -156,7 +156,7 @@ void AuthService::StartAuthentication(const AuthStatusCallback& callback) { scopes_); } else { base::MessageLoop::current()->PostTask( - FROM_HERE, base::Bind(callback, GDATA_NOT_READY, std::string())); + FROM_HERE, base::Bind(callback, DRIVE_NOT_READY, std::string())); } } @@ -181,7 +181,7 @@ void AuthService::ClearRefreshToken() { } void AuthService::OnAuthCompleted(const AuthStatusCallback& callback, - GDataErrorCode error, + DriveApiErrorCode error, const std::string& access_token) { DCHECK(thread_checker_.CalledOnValidThread()); DCHECK(!callback.is_null()); diff --git a/google_apis/drive/auth_service.h b/google_apis/drive/auth_service.h index 381abeb..50f3b9f 100644 --- a/google_apis/drive/auth_service.h +++ b/google_apis/drive/auth_service.h @@ -60,7 +60,7 @@ class AuthService : public AuthServiceInterface, // Called when authentication request from StartAuthentication() is // completed. void OnAuthCompleted(const AuthStatusCallback& callback, - GDataErrorCode error, + DriveApiErrorCode error, const std::string& access_token); OAuth2TokenService* oauth2_token_service_; diff --git a/google_apis/drive/auth_service_interface.h b/google_apis/drive/auth_service_interface.h index 40a1905..3616219 100644 --- a/google_apis/drive/auth_service_interface.h +++ b/google_apis/drive/auth_service_interface.h @@ -8,14 +8,14 @@ #include <string> #include "base/callback_forward.h" -#include "google_apis/drive/gdata_errorcode.h" +#include "google_apis/drive/drive_api_error_codes.h" namespace google_apis { class AuthServiceObserver; // Called when fetching of access token is complete. -typedef base::Callback<void(GDataErrorCode error, +typedef base::Callback<void(DriveApiErrorCode error, const std::string& access_token)> AuthStatusCallback; diff --git a/google_apis/drive/base_requests.cc b/google_apis/drive/base_requests.cc index 84e3d58..8e625cd 100644 --- a/google_apis/drive/base_requests.cc +++ b/google_apis/drive/base_requests.cc @@ -291,7 +291,7 @@ UrlFetchRequestBase::UrlFetchRequestBase(RequestSender* sender) : re_authenticate_count_(0), response_writer_(NULL), sender_(sender), - error_code_(GDATA_OTHER_ERROR), + error_code_(DRIVE_OTHER_ERROR), weak_ptr_factory_(this) { } @@ -312,7 +312,7 @@ void UrlFetchRequestBase::Start(const std::string& access_token, // Error is found on generating the url. Send the error message to the // callback, and then return immediately without trying to connect // to the server. - RunCallbackOnPrematureFailure(GDATA_OTHER_ERROR); + RunCallbackOnPrematureFailure(DRIVE_OTHER_ERROR); return; } DVLOG(1) << "URL: " << url.spec(); @@ -414,11 +414,11 @@ void UrlFetchRequestBase::GetOutputFilePath( void UrlFetchRequestBase::Cancel() { response_writer_ = NULL; url_fetcher_.reset(NULL); - RunCallbackOnPrematureFailure(GDATA_CANCELLED); + RunCallbackOnPrematureFailure(DRIVE_CANCELLED); sender_->RequestFinished(this); } -GDataErrorCode UrlFetchRequestBase::GetErrorCode() { +DriveApiErrorCode UrlFetchRequestBase::GetErrorCode() { return error_code_; } @@ -438,14 +438,14 @@ void UrlFetchRequestBase::OnURLFetchComplete(const URLFetcher* source) { DVLOG(1) << "Response headers:\n" << GetResponseHeadersAsString(source); // Determine error code. - error_code_ = static_cast<GDataErrorCode>(source->GetResponseCode()); + error_code_ = static_cast<DriveApiErrorCode>(source->GetResponseCode()); if (!source->GetStatus().is_success()) { switch (source->GetStatus().error()) { case net::ERR_NETWORK_CHANGED: - error_code_ = GDATA_NO_CONNECTION; + error_code_ = DRIVE_NO_CONNECTION; break; default: - error_code_ = GDATA_OTHER_ERROR; + error_code_ = DRIVE_OTHER_ERROR; } } @@ -484,7 +484,7 @@ void UrlFetchRequestBase::OnURLFetchComplete(const URLFetcher* source) { reason == kErrorReasonUserRateLimitExceeded) error_code_ = HTTP_SERVICE_UNAVAILABLE; if (reason == kErrorReasonQuotaExceeded) - error_code_ = GDATA_NO_SPACE; + error_code_ = DRIVE_NO_SPACE; } } } @@ -507,7 +507,7 @@ void UrlFetchRequestBase::OnURLFetchComplete(const URLFetcher* source) { ProcessURLFetchResults(source); } -void UrlFetchRequestBase::OnAuthFailed(GDataErrorCode code) { +void UrlFetchRequestBase::OnAuthFailed(DriveApiErrorCode code) { RunCallbackOnPrematureFailure(code); sender_->RequestFinished(this); } @@ -533,7 +533,7 @@ void EntryActionRequest::ProcessURLFetchResults(const URLFetcher* source) { OnProcessURLFetchResultsComplete(); } -void EntryActionRequest::RunCallbackOnPrematureFailure(GDataErrorCode code) { +void EntryActionRequest::RunCallbackOnPrematureFailure(DriveApiErrorCode code) { callback_.Run(code); } @@ -557,7 +557,7 @@ InitiateUploadRequestBase::~InitiateUploadRequestBase() {} void InitiateUploadRequestBase::ProcessURLFetchResults( const URLFetcher* source) { - GDataErrorCode code = GetErrorCode(); + DriveApiErrorCode code = GetErrorCode(); std::string upload_location; if (code == HTTP_SUCCESS) { @@ -572,7 +572,7 @@ void InitiateUploadRequestBase::ProcessURLFetchResults( } void InitiateUploadRequestBase::RunCallbackOnPrematureFailure( - GDataErrorCode code) { + DriveApiErrorCode code) { callback_.Run(code, GURL()); } @@ -593,7 +593,7 @@ UploadRangeResponse::UploadRangeResponse() end_position_received(0) { } -UploadRangeResponse::UploadRangeResponse(GDataErrorCode code, +UploadRangeResponse::UploadRangeResponse(DriveApiErrorCode code, int64 start_position_received, int64 end_position_received) : code(code), @@ -627,7 +627,7 @@ URLFetcher::RequestType UploadRangeRequestBase::GetRequestType() const { void UploadRangeRequestBase::ProcessURLFetchResults( const URLFetcher* source) { - GDataErrorCode code = GetErrorCode(); + DriveApiErrorCode code = GetErrorCode(); net::HttpResponseHeaders* hdrs = source->GetResponseHeaders(); if (code == HTTP_RESUME_INCOMPLETE) { @@ -678,7 +678,7 @@ void UploadRangeRequestBase::ProcessURLFetchResults( } } -void UploadRangeRequestBase::OnDataParsed(GDataErrorCode code, +void UploadRangeRequestBase::OnDataParsed(DriveApiErrorCode code, scoped_ptr<base::Value> value) { DCHECK(CalledOnValidThread()); DCHECK(code == HTTP_CREATED || code == HTTP_SUCCESS); @@ -688,7 +688,7 @@ void UploadRangeRequestBase::OnDataParsed(GDataErrorCode code, } void UploadRangeRequestBase::RunCallbackOnPrematureFailure( - GDataErrorCode code) { + DriveApiErrorCode code) { OnRangeRequestComplete( UploadRangeResponse(code, 0, 0), scoped_ptr<base::Value>()); } @@ -842,7 +842,7 @@ void MultipartUploadRequestBase::OnPrepareUploadContent( std::string* upload_content_data, bool result) { if (!result) { - RunCallbackOnPrematureFailure(GDATA_FILE_ERROR); + RunCallbackOnPrematureFailure(DRIVE_FILE_ERROR); return; } upload_content_type_.swap(*upload_content_type); @@ -868,7 +868,7 @@ void MultipartUploadRequestBase::ProcessURLFetchResults( const URLFetcher* source) { // The upload is successfully done. Parse the response which should be // the entry's metadata. - const GDataErrorCode code = GetErrorCode(); + const DriveApiErrorCode code = GetErrorCode(); if (code == HTTP_CREATED || code == HTTP_SUCCESS) { ParseJsonOnBlockingPool( blocking_task_runner(), response_writer()->data(), @@ -880,7 +880,7 @@ void MultipartUploadRequestBase::ProcessURLFetchResults( } void MultipartUploadRequestBase::RunCallbackOnPrematureFailure( - GDataErrorCode code) { + DriveApiErrorCode code) { callback_.Run(code, scoped_ptr<FileResource>()); } @@ -892,13 +892,13 @@ void MultipartUploadRequestBase::OnURLFetchUploadProgress( progress_callback_.Run(current, total); } -void MultipartUploadRequestBase::OnDataParsed(GDataErrorCode code, +void MultipartUploadRequestBase::OnDataParsed(DriveApiErrorCode code, scoped_ptr<base::Value> value) { DCHECK(CalledOnValidThread()); if (value) callback_.Run(code, google_apis::FileResource::CreateFrom(*value)); else - callback_.Run(GDATA_PARSE_ERROR, scoped_ptr<FileResource>()); + callback_.Run(DRIVE_PARSE_ERROR, scoped_ptr<FileResource>()); OnProcessURLFetchResultsComplete(); } @@ -946,7 +946,7 @@ void DownloadFileRequestBase::OnURLFetchDownloadProgress( } void DownloadFileRequestBase::ProcessURLFetchResults(const URLFetcher* source) { - GDataErrorCode code = GetErrorCode(); + DriveApiErrorCode code = GetErrorCode(); // Take over the ownership of the the downloaded temp file. base::FilePath temp_file; @@ -960,7 +960,7 @@ void DownloadFileRequestBase::ProcessURLFetchResults(const URLFetcher* source) { } void DownloadFileRequestBase::RunCallbackOnPrematureFailure( - GDataErrorCode code) { + DriveApiErrorCode code) { download_action_callback_.Run(code, base::FilePath()); } diff --git a/google_apis/drive/base_requests.h b/google_apis/drive/base_requests.h index 2c81798..59e50c8 100644 --- a/google_apis/drive/base_requests.h +++ b/google_apis/drive/base_requests.h @@ -15,7 +15,7 @@ #include "base/files/file_path.h" #include "base/memory/weak_ptr.h" #include "base/threading/thread_checker.h" -#include "google_apis/drive/gdata_errorcode.h" +#include "google_apis/drive/drive_api_error_codes.h" #include "net/url_request/url_fetcher.h" #include "net/url_request/url_fetcher_delegate.h" #include "net/url_request/url_fetcher_response_writer.h" @@ -32,7 +32,7 @@ class RequestSender; // Callback used for requests that the server returns FileResource data // formatted into JSON value. -typedef base::Callback<void(GDataErrorCode error, +typedef base::Callback<void(DriveApiErrorCode error, scoped_ptr<FileResource> entry)> FileResourceCallback; @@ -41,7 +41,7 @@ typedef base::Callback<void(int64 progress, int64 total)> ProgressCallback; // Callback used to get the content from DownloadFileRequest. typedef base::Callback<void( - GDataErrorCode error, + DriveApiErrorCode error, scoped_ptr<std::string> content)> GetContentCallback; // Parses JSON passed in |json|. Returns NULL on failure. @@ -72,7 +72,7 @@ class AuthenticatedRequestInterface { const ReAuthenticateCallback& callback) = 0; // Invoked when the authentication failed with an error code |code|. - virtual void OnAuthFailed(GDataErrorCode code) = 0; + virtual void OnAuthFailed(DriveApiErrorCode code) = 0; // Gets a weak pointer to this request object. Since requests may be // deleted when it is canceled by user action, for posting asynchronous tasks @@ -82,7 +82,7 @@ class AuthenticatedRequestInterface { virtual base::WeakPtr<AuthenticatedRequestInterface> GetWeakPtr() = 0; // Cancels the request. It will invoke the callback object passed in - // each request's constructor with error code GDATA_CANCELLED. + // each request's constructor with error code DRIVE_CANCELLED. virtual void Cancel() = 0; }; @@ -181,14 +181,14 @@ class UrlFetchRequestBase : public AuthenticatedRequestInterface, // Invoked by this base class upon an authentication error or cancel by // a user request. Must be implemented by a derived class. - virtual void RunCallbackOnPrematureFailure(GDataErrorCode code) = 0; + virtual void RunCallbackOnPrematureFailure(DriveApiErrorCode code) = 0; // Invoked from derived classes when ProcessURLFetchResults() is completed. void OnProcessURLFetchResultsComplete(); - // Returns an appropriate GDataErrorCode based on the HTTP response code and - // the status of the URLFetcher. - GDataErrorCode GetErrorCode(); + // Returns an appropriate DriveApiErrorCode based on the HTTP response code + // and the status of the URLFetcher. + DriveApiErrorCode GetErrorCode(); // Returns true if called on the thread where the constructor was called. bool CalledOnValidThread(); @@ -204,14 +204,14 @@ class UrlFetchRequestBase : public AuthenticatedRequestInterface, void OnURLFetchComplete(const net::URLFetcher* source) override; // AuthenticatedRequestInterface overrides. - void OnAuthFailed(GDataErrorCode code) override; + void OnAuthFailed(DriveApiErrorCode code) override; ReAuthenticateCallback re_authenticate_callback_; int re_authenticate_count_; scoped_ptr<net::URLFetcher> url_fetcher_; ResponseWriter* response_writer_; // Owned by |url_fetcher_|. RequestSender* sender_; - GDataErrorCode error_code_; + DriveApiErrorCode error_code_; base::ThreadChecker thread_checker_; @@ -225,7 +225,7 @@ class UrlFetchRequestBase : public AuthenticatedRequestInterface, //============================ EntryActionRequest ============================ // Callback type for requests that return only error status, like: Delete/Move. -typedef base::Callback<void(GDataErrorCode error)> EntryActionCallback; +typedef base::Callback<void(DriveApiErrorCode error)> EntryActionCallback; // This class performs a simple action over a given entry (document/file). // It is meant to be used for requests that return no JSON blobs. @@ -240,7 +240,7 @@ class EntryActionRequest : public UrlFetchRequestBase { protected: // Overridden from UrlFetchRequestBase. void ProcessURLFetchResults(const net::URLFetcher* source) override; - void RunCallbackOnPrematureFailure(GDataErrorCode code) override; + void RunCallbackOnPrematureFailure(DriveApiErrorCode code) override; private: const EntryActionCallback callback_; @@ -251,7 +251,7 @@ class EntryActionRequest : public UrlFetchRequestBase { //=========================== InitiateUploadRequestBase======================= // Callback type for DriveServiceInterface::InitiateUpload. -typedef base::Callback<void(GDataErrorCode error, +typedef base::Callback<void(DriveApiErrorCode error, const GURL& upload_url)> InitiateUploadCallback; // This class provides base implementation for performing the request for @@ -279,7 +279,7 @@ class InitiateUploadRequestBase : public UrlFetchRequestBase { // UrlFetchRequestBase overrides. void ProcessURLFetchResults(const net::URLFetcher* source) override; - void RunCallbackOnPrematureFailure(GDataErrorCode code) override; + void RunCallbackOnPrematureFailure(DriveApiErrorCode code) override; std::vector<std::string> GetExtraRequestHeaders() const override; private: @@ -295,12 +295,12 @@ class InitiateUploadRequestBase : public UrlFetchRequestBase { // Struct for response to ResumeUpload and GetUploadStatus. struct UploadRangeResponse { UploadRangeResponse(); - UploadRangeResponse(GDataErrorCode code, + UploadRangeResponse(DriveApiErrorCode code, int64 start_position_received, int64 end_position_received); ~UploadRangeResponse(); - GDataErrorCode code; + DriveApiErrorCode code; // The values of "Range" header returned from the server. The values are // used to continue uploading more data. These are set to -1 if an upload // is complete. @@ -324,7 +324,7 @@ class UploadRangeRequestBase : public UrlFetchRequestBase { GURL GetURL() const override; net::URLFetcher::RequestType GetRequestType() const override; void ProcessURLFetchResults(const net::URLFetcher* source) override; - void RunCallbackOnPrematureFailure(GDataErrorCode code) override; + void RunCallbackOnPrematureFailure(DriveApiErrorCode code) override; // This method will be called when the request is done, regardless of // whether it is succeeded or failed. @@ -347,7 +347,7 @@ class UploadRangeRequestBase : public UrlFetchRequestBase { private: // Called when ParseJson() is completed. - void OnDataParsed(GDataErrorCode code, scoped_ptr<base::Value> value); + void OnDataParsed(DriveApiErrorCode code, scoped_ptr<base::Value> value); const GURL upload_url_; @@ -471,7 +471,7 @@ class MultipartUploadRequestBase : public UrlFetchRequestBase { bool GetContentData(std::string* upload_content_type, std::string* upload_content) override; void ProcessURLFetchResults(const net::URLFetcher* source) override; - void RunCallbackOnPrematureFailure(GDataErrorCode code) override; + void RunCallbackOnPrematureFailure(DriveApiErrorCode code) override; // content::UrlFetcherDelegate overrides. void OnURLFetchUploadProgress(const net::URLFetcher* source, @@ -479,7 +479,7 @@ class MultipartUploadRequestBase : public UrlFetchRequestBase { int64 total) override; // Parses the response value and invokes |callback_| with |FileResource|. - void OnDataParsed(GDataErrorCode code, scoped_ptr<base::Value> value); + void OnDataParsed(DriveApiErrorCode code, scoped_ptr<base::Value> value); // Whether to the request has modified date information or not. bool has_modified_date() const { return has_modified_date_; } @@ -518,7 +518,7 @@ class MultipartUploadRequestBase : public UrlFetchRequestBase { //============================ DownloadFileRequest =========================== // Callback type for receiving the completion of DownloadFileRequest. -typedef base::Callback<void(GDataErrorCode error, +typedef base::Callback<void(DriveApiErrorCode error, const base::FilePath& temp_file)> DownloadActionCallback; @@ -557,7 +557,7 @@ class DownloadFileRequestBase : public UrlFetchRequestBase { void GetOutputFilePath(base::FilePath* local_file_path, GetContentCallback* get_content_callback) override; void ProcessURLFetchResults(const net::URLFetcher* source) override; - void RunCallbackOnPrematureFailure(GDataErrorCode code) override; + void RunCallbackOnPrematureFailure(DriveApiErrorCode code) override; // net::URLFetcherDelegate overrides. void OnURLFetchDownloadProgress(const net::URLFetcher* source, diff --git a/google_apis/drive/base_requests_server_unittest.cc b/google_apis/drive/base_requests_server_unittest.cc index b00acc1..1a8111b 100644 --- a/google_apis/drive/base_requests_server_unittest.cc +++ b/google_apis/drive/base_requests_server_unittest.cc @@ -70,7 +70,7 @@ class BaseRequestsServerTest : public testing::Test { }; TEST_F(BaseRequestsServerTest, DownloadFileRequest_ValidFile) { - GDataErrorCode result_code = GDATA_OTHER_ERROR; + DriveApiErrorCode result_code = DRIVE_OTHER_ERROR; base::FilePath temp_file; { base::RunLoop run_loop; @@ -104,7 +104,7 @@ TEST_F(BaseRequestsServerTest, DownloadFileRequest_ValidFile) { } TEST_F(BaseRequestsServerTest, DownloadFileRequest_NonExistentFile) { - GDataErrorCode result_code = GDATA_OTHER_ERROR; + DriveApiErrorCode result_code = DRIVE_OTHER_ERROR; base::FilePath temp_file; { base::RunLoop run_loop; diff --git a/google_apis/drive/base_requests_unittest.cc b/google_apis/drive/base_requests_unittest.cc index e2dab7d..92ae948 100644 --- a/google_apis/drive/base_requests_unittest.cc +++ b/google_apis/drive/base_requests_unittest.cc @@ -43,7 +43,7 @@ class FakeUrlFetchRequest : public UrlFetchRequestBase { void ProcessURLFetchResults(const net::URLFetcher* source) override { callback_.Run(GetErrorCode()); } - void RunCallbackOnPrematureFailure(GDataErrorCode code) override { + void RunCallbackOnPrematureFailure(DriveApiErrorCode code) override { callback_.Run(code); } @@ -178,7 +178,7 @@ TEST_F(BaseRequestsTest, UrlFetchRequestBaseResponseCodeOverride) { " }\n" "}\n"; - GDataErrorCode error = GDATA_OTHER_ERROR; + DriveApiErrorCode error = DRIVE_OTHER_ERROR; base::RunLoop run_loop; sender_->StartRequestWithRetry( new FakeUrlFetchRequest( @@ -196,7 +196,7 @@ TEST_F(MultipartUploadRequestBaseTest, Basic) { response_code_ = net::HTTP_OK; response_body_ = "{\"kind\": \"drive#file\", \"id\": \"file_id\"}"; scoped_ptr<google_apis::FileResource> file; - GDataErrorCode error = GDATA_OTHER_ERROR; + DriveApiErrorCode error = DRIVE_OTHER_ERROR; base::RunLoop run_loop; const base::FilePath source_path = google_apis::test_util::GetTestFilePath("chromeos/file_manager/text.txt"); diff --git a/google_apis/drive/gdata_errorcode.cc b/google_apis/drive/drive_api_error_codes.cc index 89fa3f3..a90a887 100644 --- a/google_apis/drive/gdata_errorcode.cc +++ b/google_apis/drive/drive_api_error_codes.cc @@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "google_apis/drive/gdata_errorcode.h" +#include "google_apis/drive/drive_api_error_codes.h" #include "base/logging.h" #include "base/strings/string_number_conversions.h" namespace google_apis { -std::string GDataErrorCodeToString(GDataErrorCode error) { +std::string DriveApiErrorCodeToString(DriveApiErrorCode error) { switch (error) { case HTTP_SUCCESS: return"HTTP_SUCCESS"; @@ -65,26 +65,26 @@ std::string GDataErrorCodeToString(GDataErrorCode error) { case HTTP_SERVICE_UNAVAILABLE: return"HTTP_SERVICE_UNAVAILABLE"; - case GDATA_PARSE_ERROR: - return"GDATA_PARSE_ERROR"; + case DRIVE_PARSE_ERROR: + return"DRIVE_PARSE_ERROR"; - case GDATA_FILE_ERROR: - return"GDATA_FILE_ERROR"; + case DRIVE_FILE_ERROR: + return"DRIVE_FILE_ERROR"; - case GDATA_CANCELLED: - return"GDATA_CANCELLED"; + case DRIVE_CANCELLED: + return"DRIVE_CANCELLED"; - case GDATA_OTHER_ERROR: - return"GDATA_OTHER_ERROR"; + case DRIVE_OTHER_ERROR: + return"DRIVE_OTHER_ERROR"; - case GDATA_NO_CONNECTION: - return"GDATA_NO_CONNECTION"; + case DRIVE_NO_CONNECTION: + return"DRIVE_NO_CONNECTION"; - case GDATA_NOT_READY: - return"GDATA_NOT_READY"; + case DRIVE_NOT_READY: + return"DRIVE_NOT_READY"; - case GDATA_NO_SPACE: - return"GDATA_NO_SPACE"; + case DRIVE_NO_SPACE: + return"DRIVE_NO_SPACE"; } return "UNKNOWN_ERROR_" + base::IntToString(error); diff --git a/google_apis/drive/gdata_errorcode.h b/google_apis/drive/drive_api_error_codes.h index a275cb3..af4f502 100644 --- a/google_apis/drive/gdata_errorcode.h +++ b/google_apis/drive/drive_api_error_codes.h @@ -2,15 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef GOOGLE_APIS_DRIVE_GDATA_ERRORCODE_H_ -#define GOOGLE_APIS_DRIVE_GDATA_ERRORCODE_H_ +#ifndef GOOGLE_APIS_DRIVE_DRIVE_API_ERROR_CODES_H_ +#define GOOGLE_APIS_DRIVE_DRIVE_API_ERROR_CODES_H_ #include <string> namespace google_apis { -// HTTP errors that can be returned by GData service. -enum GDataErrorCode { +// HTTP errors that can be returned by Drive API service. +enum DriveApiErrorCode { HTTP_SUCCESS = 200, HTTP_CREATED = 201, HTTP_NO_CONTENT = 204, @@ -29,18 +29,18 @@ enum GDataErrorCode { HTTP_NOT_IMPLEMENTED = 501, HTTP_BAD_GATEWAY = 502, HTTP_SERVICE_UNAVAILABLE = 503, - GDATA_PARSE_ERROR = -100, - GDATA_FILE_ERROR = -101, - GDATA_CANCELLED = -102, - GDATA_OTHER_ERROR = -103, - GDATA_NO_CONNECTION = -104, - GDATA_NOT_READY = -105, - GDATA_NO_SPACE = -106, + DRIVE_PARSE_ERROR = -100, + DRIVE_FILE_ERROR = -101, + DRIVE_CANCELLED = -102, + DRIVE_OTHER_ERROR = -103, + DRIVE_NO_CONNECTION = -104, + DRIVE_NOT_READY = -105, + DRIVE_NO_SPACE = -106, }; -// Returns a string representation of GDataErrorCode. -std::string GDataErrorCodeToString(GDataErrorCode error); +// Returns a string representation of DriveApiErrorCode. +std::string DriveApiErrorCodeToString(DriveApiErrorCode error); } // namespace google_apis -#endif // GOOGLE_APIS_DRIVE_GDATA_ERRORCODE_H_ +#endif // GOOGLE_APIS_DRIVE_DRIVE_API_ERROR_CODES_H_ diff --git a/google_apis/drive/drive_api_requests.cc b/google_apis/drive/drive_api_requests.cc index b884dbd..3691a9e 100644 --- a/google_apis/drive/drive_api_requests.cc +++ b/google_apis/drive/drive_api_requests.cc @@ -34,7 +34,7 @@ void ParseFileResourceWithUploadRangeAndRun( file_resource = FileResource::CreateFrom(*value); if (!file_resource) { callback.Run( - UploadRangeResponse(GDATA_PARSE_ERROR, + UploadRangeResponse(DRIVE_PARSE_ERROR, response.start_position_received, response.end_position_received), scoped_ptr<FileResource>()); diff --git a/google_apis/drive/drive_api_requests.h b/google_apis/drive/drive_api_requests.h index 92afc87..4fa6eaf 100644 --- a/google_apis/drive/drive_api_requests.h +++ b/google_apis/drive/drive_api_requests.h @@ -22,12 +22,12 @@ namespace google_apis { // Callback used for requests that the server returns FileList data // formatted into JSON value. -typedef base::Callback<void(GDataErrorCode error, +typedef base::Callback<void(DriveApiErrorCode error, scoped_ptr<FileList> entry)> FileListCallback; // Callback used for requests that the server returns ChangeList data // formatted into JSON value. -typedef base::Callback<void(GDataErrorCode error, +typedef base::Callback<void(DriveApiErrorCode error, scoped_ptr<ChangeList> entry)> ChangeListCallback; namespace drive { @@ -68,7 +68,7 @@ class DriveApiPartialFieldRequest : public UrlFetchRequestBase { template<class DataType> class DriveApiDataRequest : public DriveApiPartialFieldRequest { public: - typedef base::Callback<void(GDataErrorCode error, + typedef base::Callback<void(DriveApiErrorCode error, scoped_ptr<DataType> data)> Callback; // |callback| is called when the request finishes either by success or by @@ -84,7 +84,7 @@ class DriveApiDataRequest : public DriveApiPartialFieldRequest { protected: // UrlFetchRequestBase overrides. virtual void ProcessURLFetchResults(const net::URLFetcher* source) override { - GDataErrorCode error = GetErrorCode(); + DriveApiErrorCode error = GetErrorCode(); switch (error) { case HTTP_SUCCESS: case HTTP_CREATED: @@ -102,7 +102,7 @@ class DriveApiDataRequest : public DriveApiPartialFieldRequest { } } - virtual void RunCallbackOnPrematureFailure(GDataErrorCode error) override { + virtual void RunCallbackOnPrematureFailure(DriveApiErrorCode error) override { callback_.Run(error, scoped_ptr<DataType>()); } @@ -114,9 +114,9 @@ class DriveApiDataRequest : public DriveApiPartialFieldRequest { } // Receives the parsed result and invokes the callback. - void OnDataParsed(GDataErrorCode error, scoped_ptr<DataType> value) { + void OnDataParsed(DriveApiErrorCode error, scoped_ptr<DataType> value) { if (!value) - error = GDATA_PARSE_ERROR; + error = DRIVE_PARSE_ERROR; callback_.Run(error, value.Pass()); OnProcessURLFetchResultsComplete(); } diff --git a/google_apis/drive/drive_api_requests_unittest.cc b/google_apis/drive/drive_api_requests_unittest.cc index 247a569..c4cab5b 100644 --- a/google_apis/drive/drive_api_requests_unittest.cc +++ b/google_apis/drive/drive_api_requests_unittest.cc @@ -51,7 +51,7 @@ const char kTestDownloadPathPrefix[] = "/download/"; // Used as a GetContentCallback. void AppendContent(std::string* out, - GDataErrorCode error, + DriveApiErrorCode error, scoped_ptr<std::string> content) { EXPECT_EQ(HTTP_SUCCESS, error); out->append(*content); @@ -390,7 +390,7 @@ TEST_F(DriveApiRequestsTest, DriveApiDataRequest_Fields) { expected_data_file_path_ = test_util::GetTestFilePath( "drive/about.json"); - GDataErrorCode error = GDATA_OTHER_ERROR; + DriveApiErrorCode error = DRIVE_OTHER_ERROR; scoped_ptr<AboutResource> about_resource; { @@ -433,7 +433,7 @@ TEST_F(DriveApiRequestsTest, FilesInsertRequest) { expected_data_file_path_ = test_util::GetTestFilePath("drive/directory_entry.json"); - GDataErrorCode error = GDATA_OTHER_ERROR; + DriveApiErrorCode error = DRIVE_OTHER_ERROR; scoped_ptr<FileResource> file_resource; // Create "new directory" in the root directory. @@ -490,7 +490,7 @@ TEST_F(DriveApiRequestsTest, FilesPatchRequest) { expected_data_file_path_ = test_util::GetTestFilePath("drive/file_entry.json"); - GDataErrorCode error = GDATA_OTHER_ERROR; + DriveApiErrorCode error = DRIVE_OTHER_ERROR; scoped_ptr<FileResource> file_resource; { @@ -536,7 +536,7 @@ TEST_F(DriveApiRequestsTest, AboutGetRequest_ValidJson) { expected_data_file_path_ = test_util::GetTestFilePath( "drive/about.json"); - GDataErrorCode error = GDATA_OTHER_ERROR; + DriveApiErrorCode error = DRIVE_OTHER_ERROR; scoped_ptr<AboutResource> about_resource; { @@ -570,7 +570,7 @@ TEST_F(DriveApiRequestsTest, AboutGetRequest_InvalidJson) { expected_data_file_path_ = test_util::GetTestFilePath( "drive/testfile.txt"); - GDataErrorCode error = GDATA_OTHER_ERROR; + DriveApiErrorCode error = DRIVE_OTHER_ERROR; scoped_ptr<AboutResource> about_resource; { @@ -586,7 +586,7 @@ TEST_F(DriveApiRequestsTest, AboutGetRequest_InvalidJson) { } // "parse error" should be returned, and the about resource should be NULL. - EXPECT_EQ(GDATA_PARSE_ERROR, error); + EXPECT_EQ(DRIVE_PARSE_ERROR, error); EXPECT_EQ(net::test_server::METHOD_GET, http_request_.method); EXPECT_EQ("/drive/v2/about", http_request_.relative_url); EXPECT_FALSE(about_resource); @@ -597,7 +597,7 @@ TEST_F(DriveApiRequestsTest, AppsListRequest) { expected_data_file_path_ = test_util::GetTestFilePath( "drive/applist.json"); - GDataErrorCode error = GDATA_OTHER_ERROR; + DriveApiErrorCode error = DRIVE_OTHER_ERROR; scoped_ptr<AppList> app_list; { @@ -624,7 +624,7 @@ TEST_F(DriveApiRequestsTest, ChangesListRequest) { expected_data_file_path_ = test_util::GetTestFilePath( "drive/changelist.json"); - GDataErrorCode error = GDATA_OTHER_ERROR; + DriveApiErrorCode error = DRIVE_OTHER_ERROR; scoped_ptr<ChangeList> result; { @@ -653,7 +653,7 @@ TEST_F(DriveApiRequestsTest, ChangesListNextPageRequest) { expected_data_file_path_ = test_util::GetTestFilePath( "drive/changelist.json"); - GDataErrorCode error = GDATA_OTHER_ERROR; + DriveApiErrorCode error = DRIVE_OTHER_ERROR; scoped_ptr<ChangeList> result; { @@ -683,7 +683,7 @@ TEST_F(DriveApiRequestsTest, FilesCopyRequest) { expected_data_file_path_ = test_util::GetTestFilePath("drive/file_entry.json"); - GDataErrorCode error = GDATA_OTHER_ERROR; + DriveApiErrorCode error = DRIVE_OTHER_ERROR; scoped_ptr<FileResource> file_resource; // Copy the file to a new file named "new title". @@ -722,7 +722,7 @@ TEST_F(DriveApiRequestsTest, FilesCopyRequest_EmptyParentResourceId) { expected_data_file_path_ = test_util::GetTestFilePath("drive/file_entry.json"); - GDataErrorCode error = GDATA_OTHER_ERROR; + DriveApiErrorCode error = DRIVE_OTHER_ERROR; scoped_ptr<FileResource> file_resource; // Copy the file to a new file named "new title". @@ -755,7 +755,7 @@ TEST_F(DriveApiRequestsTest, FilesListRequest) { expected_data_file_path_ = test_util::GetTestFilePath( "drive/filelist.json"); - GDataErrorCode error = GDATA_OTHER_ERROR; + DriveApiErrorCode error = DRIVE_OTHER_ERROR; scoped_ptr<FileList> result; { @@ -783,7 +783,7 @@ TEST_F(DriveApiRequestsTest, FilesListNextPageRequest) { expected_data_file_path_ = test_util::GetTestFilePath( "drive/filelist.json"); - GDataErrorCode error = GDATA_OTHER_ERROR; + DriveApiErrorCode error = DRIVE_OTHER_ERROR; scoped_ptr<FileList> result; { @@ -806,7 +806,7 @@ TEST_F(DriveApiRequestsTest, FilesListNextPageRequest) { } TEST_F(DriveApiRequestsTest, FilesDeleteRequest) { - GDataErrorCode error = GDATA_OTHER_ERROR; + DriveApiErrorCode error = DRIVE_OTHER_ERROR; // Delete a resource with the given resource id. { @@ -835,7 +835,7 @@ TEST_F(DriveApiRequestsTest, FilesTrashRequest) { expected_data_file_path_ = test_util::GetTestFilePath("drive/directory_entry.json"); - GDataErrorCode error = GDATA_OTHER_ERROR; + DriveApiErrorCode error = DRIVE_OTHER_ERROR; scoped_ptr<FileResource> file_resource; // Trash a resource with the given resource id. @@ -864,7 +864,7 @@ TEST_F(DriveApiRequestsTest, ChildrenInsertRequest) { expected_content_type_ = "application/json"; expected_content_ = kTestChildrenResponse; - GDataErrorCode error = GDATA_OTHER_ERROR; + DriveApiErrorCode error = DRIVE_OTHER_ERROR; // Add a resource with "resource_id" to a directory with // "parent_resource_id". @@ -893,7 +893,7 @@ TEST_F(DriveApiRequestsTest, ChildrenInsertRequest) { } TEST_F(DriveApiRequestsTest, ChildrenDeleteRequest) { - GDataErrorCode error = GDATA_OTHER_ERROR; + DriveApiErrorCode error = DRIVE_OTHER_ERROR; // Remove a resource with "resource_id" from a directory with // "parent_resource_id". @@ -928,7 +928,7 @@ TEST_F(DriveApiRequestsTest, UploadNewFileRequest) { temp_dir_.path().AppendASCII("upload_file.txt"); ASSERT_TRUE(test_util::WriteStringToFile(kTestFilePath, kTestContent)); - GDataErrorCode error = GDATA_OTHER_ERROR; + DriveApiErrorCode error = DRIVE_OTHER_ERROR; GURL upload_url; // Initiate uploading a new file to the directory with @@ -1021,7 +1021,7 @@ TEST_F(DriveApiRequestsTest, UploadNewEmptyFileRequest) { temp_dir_.path().AppendASCII("empty_file.txt"); ASSERT_TRUE(test_util::WriteStringToFile(kTestFilePath, kTestContent)); - GDataErrorCode error = GDATA_OTHER_ERROR; + DriveApiErrorCode error = DRIVE_OTHER_ERROR; GURL upload_url; // Initiate uploading a new file to the directory with "parent_resource_id". @@ -1110,7 +1110,7 @@ TEST_F(DriveApiRequestsTest, UploadNewLargeFileRequest) { temp_dir_.path().AppendASCII("upload_file.txt"); ASSERT_TRUE(test_util::WriteStringToFile(kTestFilePath, kTestContent)); - GDataErrorCode error = GDATA_OTHER_ERROR; + DriveApiErrorCode error = DRIVE_OTHER_ERROR; GURL upload_url; // Initiate uploading a new file to the directory with "parent_resource_id". @@ -1289,7 +1289,7 @@ TEST_F(DriveApiRequestsTest, UploadNewFileWithMetadataRequest) { const char kTestContentType[] = "text/plain"; const std::string kTestContent(100, 'a'); - GDataErrorCode error = GDATA_OTHER_ERROR; + DriveApiErrorCode error = DRIVE_OTHER_ERROR; GURL upload_url; // Initiate uploading a new file to the directory with "parent_resource_id". @@ -1342,7 +1342,7 @@ TEST_F(DriveApiRequestsTest, UploadExistingFileRequest) { temp_dir_.path().AppendASCII("upload_file.txt"); ASSERT_TRUE(test_util::WriteStringToFile(kTestFilePath, kTestContent)); - GDataErrorCode error = GDATA_OTHER_ERROR; + DriveApiErrorCode error = DRIVE_OTHER_ERROR; GURL upload_url; // Initiate uploading a new file to the directory with "parent_resource_id". @@ -1429,7 +1429,7 @@ TEST_F(DriveApiRequestsTest, UploadExistingFileRequestWithETag) { temp_dir_.path().AppendASCII("upload_file.txt"); ASSERT_TRUE(test_util::WriteStringToFile(kTestFilePath, kTestContent)); - GDataErrorCode error = GDATA_OTHER_ERROR; + DriveApiErrorCode error = DRIVE_OTHER_ERROR; GURL upload_url; // Initiate uploading a new file to the directory with "parent_resource_id". @@ -1518,7 +1518,7 @@ TEST_F(DriveApiRequestsTest, UploadExistingFileRequestWithETagConflicting) { const char kTestContentType[] = "text/plain"; const std::string kTestContent(100, 'a'); - GDataErrorCode error = GDATA_OTHER_ERROR; + DriveApiErrorCode error = DRIVE_OTHER_ERROR; GURL upload_url; // Initiate uploading a new file to the directory with "parent_resource_id". @@ -1563,7 +1563,7 @@ TEST_F(DriveApiRequestsTest, temp_dir_.path().AppendASCII("upload_file.txt"); ASSERT_TRUE(test_util::WriteStringToFile(kTestFilePath, kTestContent)); - GDataErrorCode error = GDATA_OTHER_ERROR; + DriveApiErrorCode error = DRIVE_OTHER_ERROR; GURL upload_url; // Initiate uploading a new file to the directory with "parent_resource_id". @@ -1659,7 +1659,7 @@ TEST_F(DriveApiRequestsTest, UploadExistingFileWithMetadataRequest) { const char kTestContentType[] = "text/plain"; const std::string kTestContent(100, 'a'); - GDataErrorCode error = GDATA_OTHER_ERROR; + DriveApiErrorCode error = DRIVE_OTHER_ERROR; GURL upload_url; // Initiate uploading a new file to the directory with "parent_resource_id". @@ -1712,7 +1712,7 @@ TEST_F(DriveApiRequestsTest, DownloadFileRequest) { temp_dir_.path().AppendASCII("cache_file"); const std::string kTestId("dummyId"); - GDataErrorCode result_code = GDATA_OTHER_ERROR; + DriveApiErrorCode result_code = DRIVE_OTHER_ERROR; base::FilePath temp_file; { base::RunLoop run_loop; @@ -1748,7 +1748,7 @@ TEST_F(DriveApiRequestsTest, DownloadFileRequest_GetContentCallback) { temp_dir_.path().AppendASCII("cache_file"); const std::string kTestId("dummyId"); - GDataErrorCode result_code = GDATA_OTHER_ERROR; + DriveApiErrorCode result_code = DRIVE_OTHER_ERROR; base::FilePath temp_file; std::string contents; { @@ -1782,7 +1782,7 @@ TEST_F(DriveApiRequestsTest, PermissionsInsertRequest) { expected_content_type_ = "application/json"; expected_content_ = kTestPermissionResponse; - GDataErrorCode error = GDATA_OTHER_ERROR; + DriveApiErrorCode error = DRIVE_OTHER_ERROR; // Add comment permission to the user "user@example.com". { @@ -1818,7 +1818,7 @@ TEST_F(DriveApiRequestsTest, PermissionsInsertRequest) { EXPECT_TRUE(base::Value::Equals(expected.get(), result.get())); // Add "can edit" permission to users in "example.com". - error = GDATA_OTHER_ERROR; + error = DRIVE_OTHER_ERROR; { base::RunLoop run_loop; drive::PermissionsInsertRequest* request = diff --git a/google_apis/drive/drive_common_callbacks.h b/google_apis/drive/drive_common_callbacks.h index db2a7ae..0879033 100644 --- a/google_apis/drive/drive_common_callbacks.h +++ b/google_apis/drive/drive_common_callbacks.h @@ -16,27 +16,27 @@ class AboutResource; class AppList; // Callback used for getting AboutResource. -typedef base::Callback<void(GDataErrorCode error, +typedef base::Callback<void(DriveApiErrorCode error, scoped_ptr<AboutResource> about_resource)> AboutResourceCallback; // Callback used for getting ShareUrl. -typedef base::Callback<void(GDataErrorCode error, +typedef base::Callback<void(DriveApiErrorCode error, const GURL& share_url)> GetShareUrlCallback; // Callback used for getting AppList. -typedef base::Callback<void(GDataErrorCode error, +typedef base::Callback<void(DriveApiErrorCode error, scoped_ptr<AppList> app_list)> AppListCallback; // 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, +typedef base::Callback<void(DriveApiErrorCode error, const GURL& open_url)> AuthorizeAppCallback; // Closure for canceling a certain request. Each request-issuing method returns // this type of closure. If it is called during the request is in-flight, the -// callback passed with the request is invoked with GDATA_CANCELLED. If the +// callback passed with the request is invoked with DRIVE_CANCELLED. If the // request is already finished, nothing happens. typedef base::Closure CancelCallback; diff --git a/google_apis/drive/request_sender.cc b/google_apis/drive/request_sender.cc index 72c3821..e8a39c9 100644 --- a/google_apis/drive/request_sender.cc +++ b/google_apis/drive/request_sender.cc @@ -62,7 +62,7 @@ base::Closure RequestSender::StartRequestWithRetry( void RequestSender::OnAccessTokenFetched( const base::WeakPtr<AuthenticatedRequestInterface>& request, - GDataErrorCode code, + DriveApiErrorCode code, const std::string& /* access_token */) { DCHECK(thread_checker_.CalledOnValidThread()); diff --git a/google_apis/drive/request_sender.h b/google_apis/drive/request_sender.h index e610d97..ff5130d 100644 --- a/google_apis/drive/request_sender.h +++ b/google_apis/drive/request_sender.h @@ -14,7 +14,7 @@ #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/threading/thread_checker.h" -#include "google_apis/drive/gdata_errorcode.h" +#include "google_apis/drive/drive_api_error_codes.h" namespace base { class SequencedTaskRunner; @@ -79,7 +79,7 @@ class RequestSender { // Called when the access token is fetched. void OnAccessTokenFetched( const base::WeakPtr<AuthenticatedRequestInterface>& request, - GDataErrorCode error, + DriveApiErrorCode error, const std::string& access_token); // Clears any authentication token and retries the request, which forces diff --git a/google_apis/drive/request_sender_unittest.cc b/google_apis/drive/request_sender_unittest.cc index 5452578..63e8a8f 100644 --- a/google_apis/drive/request_sender_unittest.cc +++ b/google_apis/drive/request_sender_unittest.cc @@ -111,7 +111,7 @@ class TestRequest : public AuthenticatedRequestInterface { sender_->RequestFinished(this); } - void OnAuthFailed(GDataErrorCode code) override { + void OnAuthFailed(DriveApiErrorCode code) override { *finish_reason_ = AUTH_FAILURE; sender_->RequestFinished(this); } diff --git a/google_apis/drive/test_util.cc b/google_apis/drive/test_util.cc index 2e622e9..ea193c4 100644 --- a/google_apis/drive/test_util.cc +++ b/google_apis/drive/test_util.cc @@ -172,7 +172,7 @@ std::string TestGetContentCallback::GetConcatenatedData() const { return result; } -void TestGetContentCallback::OnGetContent(google_apis::GDataErrorCode error, +void TestGetContentCallback::OnGetContent(google_apis::DriveApiErrorCode error, scoped_ptr<std::string> data) { data_.push_back(data.release()); } diff --git a/google_apis/drive/test_util.h b/google_apis/drive/test_util.h index 2cd85b6..4672f53 100644 --- a/google_apis/drive/test_util.h +++ b/google_apis/drive/test_util.h @@ -15,7 +15,7 @@ #include "base/memory/scoped_vector.h" #include "base/template_util.h" #include "google_apis/drive/base_requests.h" -#include "google_apis/drive/gdata_errorcode.h" +#include "google_apis/drive/drive_api_error_codes.h" #include "google_apis/drive/task_util.h" class GURL; @@ -284,7 +284,7 @@ class TestGetContentCallback { std::string GetConcatenatedData() const; private: - void OnGetContent(google_apis::GDataErrorCode error, + void OnGetContent(google_apis::DriveApiErrorCode error, scoped_ptr<std::string> data); const GetContentCallback callback_; diff --git a/google_apis/google_apis.gyp b/google_apis/google_apis.gyp index 08db713..7383181 100644 --- a/google_apis/google_apis.gyp +++ b/google_apis/google_apis.gyp @@ -48,6 +48,8 @@ 'drive/auth_service_observer.h', 'drive/base_requests.cc', 'drive/base_requests.h', + 'drive/drive_api_error_codes.cc', + 'drive/drive_api_error_codes.h', 'drive/drive_api_parser.cc', 'drive/drive_api_parser.h', 'drive/drive_api_requests.cc', @@ -55,8 +57,6 @@ 'drive/drive_api_url_generator.cc', 'drive/drive_api_url_generator.h', 'drive/drive_common_callbacks.h', - 'drive/gdata_errorcode.cc', - 'drive/gdata_errorcode.h', 'drive/request_sender.cc', 'drive/request_sender.h', 'drive/request_util.cc', |