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

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

Issue 10749015: gdrive: Get JSON feeds parsing off the UI thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/gdata_operations.h
diff --git a/chrome/browser/chromeos/gdata/gdata_operations.h b/chrome/browser/chromeos/gdata/gdata_operations.h
index 1466ae8d9af8fd94f59f2f725b68e48d985e5a1b..662f0db858e582b8d3520702cfaf5149b1facf64 100644
--- a/chrome/browser/chromeos/gdata/gdata_operations.h
+++ b/chrome/browser/chromeos/gdata/gdata_operations.h
@@ -184,7 +184,8 @@ class EntryActionOperation : public UrlFetchOperationBase {
//============================== GetDataOperation ==============================
// This class performs the operation for fetching and parsing JSON data content.
-class GetDataOperation : public UrlFetchOperationBase {
+class GetDataOperation : public UrlFetchOperationBase,
+ public base::SupportsWeakPtr<GetDataOperation> {
hashimoto 2012/07/10 03:48:39 SupportsWeakPtr exposes AsWeakPtr() for public. In
yoshiki 2012/07/11 00:47:14 Done.
public:
GetDataOperation(GDataOperationRegistry* registry,
Profile* profile,
@@ -192,7 +193,7 @@ class GetDataOperation : public UrlFetchOperationBase {
virtual ~GetDataOperation();
// Parse GData JSON response.
- virtual base::Value* ParseResponse(const std::string& data);
+ virtual bool ParseResponse(GDataErrorCode code, const std::string& data);
hashimoto 2012/07/10 03:48:39 |code| is too ambiguous, please rename this to mor
yoshiki 2012/07/11 00:47:14 Done.
protected:
// Overridden from UrlFetchOperationBase.
@@ -200,7 +201,11 @@ class GetDataOperation : public UrlFetchOperationBase {
OVERRIDE;
virtual void RunCallbackOnPrematureFailure(GDataErrorCode code) OVERRIDE;
+ void RunCallback(GDataErrorCode code, scoped_ptr<base::Value> value);
hashimoto 2012/07/10 03:48:39 ditto as ParseResponse().
yoshiki 2012/07/11 00:47:14 Done.
+
private:
+ void OnDataParsed(GDataErrorCode code, scoped_ptr<base::Value>* value);
hashimoto 2012/07/10 03:48:39 ditto as ParseResponse().
yoshiki 2012/07/11 00:47:14 Done.
+
GetDataCallback callback_;
DISALLOW_COPY_AND_ASSIGN(GetDataOperation);
};
@@ -443,7 +448,8 @@ class AuthorizeAppsOperation : public GetDataOperation {
// Must override GetDataOperation's ParseResponse because the response is XML
// not JSON.
- virtual base::Value* ParseResponse(const std::string& data) OVERRIDE;
+ virtual bool ParseResponse(GDataErrorCode code,
+ const std::string& data) OVERRIDE;
private:
std::string app_id_;
GURL document_url_;

Powered by Google App Engine
This is Rietveld 408576698