| Index: chrome/browser/chromeos/gdata/operations_base.h
|
| diff --git a/chrome/browser/chromeos/gdata/operations_base.h b/chrome/browser/chromeos/gdata/operations_base.h
|
| index 2be8f65d1cc9b355d8d43fbc14abcf2cd004a599..774525a46351530c710e1039eb21be0fb5263088 100644
|
| --- a/chrome/browser/chromeos/gdata/operations_base.h
|
| +++ b/chrome/browser/chromeos/gdata/operations_base.h
|
| @@ -20,6 +20,9 @@ class OAuth2AccessTokenFetcher;
|
|
|
| namespace gdata {
|
|
|
| +// Callback type for ProcessURLFetchResults.
|
| +typedef base::Callback<void(bool result)> ProcessURLFetchResultsCallback;
|
| +
|
| //================================ AuthOperation ===============================
|
|
|
| // OAuth2 authorization token retrieval operation.
|
| @@ -112,7 +115,9 @@ class UrlFetchOperationBase : public GDataOperationInterface,
|
|
|
| // Invoked by OnURLFetchComplete when the operation completes without an
|
| // authentication error. Must be implemented by a derived class.
|
| - virtual bool ProcessURLFetchResults(const net::URLFetcher* source) = 0;
|
| + virtual void ProcessURLFetchResults(
|
| + const net::URLFetcher* source,
|
| + const ProcessURLFetchResultsCallback& callback) = 0;
|
|
|
| // Invoked when it needs to notify the status. Chunked operations that
|
| // constructs a logically single operation from multiple physical operations
|
| @@ -130,6 +135,9 @@ class UrlFetchOperationBase : public GDataOperationInterface,
|
| // Overridden from URLFetcherDelegate.
|
| virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE;
|
|
|
| + // Invoked when ProcessURLFetchResults() is completed.
|
| + void OnProcessURLFetchResultsComplete(bool result);
|
| +
|
| // Overridden from GDataOperationInterface.
|
| virtual void OnAuthFailed(GDataErrorCode code) OVERRIDE;
|
|
|
| @@ -147,6 +155,9 @@ class UrlFetchOperationBase : public GDataOperationInterface,
|
| FilePath output_file_path_;
|
| scoped_ptr<net::URLFetcher> url_fetcher_;
|
| bool started_;
|
| +
|
| + private:
|
| + base::WeakPtrFactory<UrlFetchOperationBase> weak_ptr_factory_;
|
| };
|
|
|
| //============================ EntryActionOperation ============================
|
| @@ -163,7 +174,9 @@ class EntryActionOperation : public UrlFetchOperationBase {
|
|
|
| protected:
|
| // Overridden from UrlFetchOperationBase.
|
| - virtual bool ProcessURLFetchResults(const net::URLFetcher* source) OVERRIDE;
|
| + virtual void ProcessURLFetchResults(
|
| + const net::URLFetcher* source,
|
| + const ProcessURLFetchResultsCallback& callback) OVERRIDE;
|
| virtual void RunCallbackOnPrematureFailure(GDataErrorCode code) OVERRIDE;
|
|
|
| const GURL& document_url() const { return document_url_; }
|
| @@ -186,15 +199,24 @@ class GetDataOperation : public UrlFetchOperationBase {
|
| virtual ~GetDataOperation();
|
|
|
| // Parse GData JSON response.
|
| - virtual base::Value* ParseResponse(const std::string& data);
|
| + virtual void ParseResponse(
|
| + GDataErrorCode fetch_error_code,
|
| + const std::string& data,
|
| + const ProcessURLFetchResultsCallback& result_callback);
|
|
|
| protected:
|
| // Overridden from UrlFetchOperationBase.
|
| - virtual bool ProcessURLFetchResults(const net::URLFetcher* source) OVERRIDE;
|
| - virtual void RunCallbackOnPrematureFailure(GDataErrorCode code) OVERRIDE;
|
| + virtual void ProcessURLFetchResults(
|
| + const net::URLFetcher* source,
|
| + const ProcessURLFetchResultsCallback& callback) OVERRIDE;
|
| + virtual void RunCallbackOnPrematureFailure(
|
| + GDataErrorCode fetch_error_code) OVERRIDE;
|
| + void RunCallback(GDataErrorCode fetch_error_code,
|
| + scoped_ptr<base::Value> value);
|
|
|
| private:
|
| GetDataCallback callback_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(GetDataOperation);
|
| };
|
|
|
|
|