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

Unified Diff: chrome/browser/chromeos/gdata/operations_base.h

Issue 10808027: gdrive: Get JSON feeds parsing off the UI thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase and Fix conflict and build error. Created 8 years, 5 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
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 6c0d2929823df1ae05af74c8d90905006cdea5b0..4724fcac4c73447ccf99ea1d734ae75cc12b08f7 100644
--- a/chrome/browser/chromeos/gdata/operations_base.h
+++ b/chrome/browser/chromeos/gdata/operations_base.h
@@ -112,7 +112,7 @@ 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) = 0;
// Invoked when it needs to notify the status. Chunked operations that
// constructs a logically single operation from multiple physical operations
@@ -133,6 +133,9 @@ class UrlFetchOperationBase : public GDataOperationInterface,
// Overridden from GDataOperationInterface.
virtual void OnAuthFailed(GDataErrorCode code) OVERRIDE;
+ // Invoked when ProcessURLFetchResults() is completed.
+ void OnProcessURLFetchResultsComplete(bool result);
+
// Returns an appropriate GDataErrorCode based on the HTTP response code and
// the status of the URLFetcher.
GDataErrorCode GetErrorCode(const net::URLFetcher* source) const;
@@ -163,7 +166,7 @@ class EntryActionOperation : public UrlFetchOperationBase {
protected:
// Overridden from UrlFetchOperationBase.
- virtual bool ProcessURLFetchResults(const net::URLFetcher* source) OVERRIDE;
+ virtual void ProcessURLFetchResults(const net::URLFetcher* source) OVERRIDE;
virtual void RunCallbackOnPrematureFailure(GDataErrorCode code) OVERRIDE;
const GURL& document_url() const { return document_url_; }
@@ -186,15 +189,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);
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) OVERRIDE;
+ virtual void RunCallbackOnPrematureFailure(
+ GDataErrorCode fetch_error_code) OVERRIDE;
+ void RunCallback(GDataErrorCode fetch_error_code,
+ scoped_ptr<base::Value> value);
private:
+ // Called when ParseJsonOnBlockingPool() is completed.
+ void OnDataParsed(gdata::GDataErrorCode fetch_error_code,
+ scoped_ptr<base::Value>* value);
+
GetDataCallback callback_;
+ base::WeakPtrFactory<GetDataOperation> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(GetDataOperation);
};
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_operations_unittest.cc ('k') | chrome/browser/chromeos/gdata/operations_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698