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

Side by Side Diff: chrome/browser/chromeos/gdata/operations_base.h

Issue 10797027: Revert 147413 - 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_OPERATIONS_BASE_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_OPERATIONS_BASE_H_
6 #define CHROME_BROWSER_CHROMEOS_GDATA_OPERATIONS_BASE_H_ 6 #define CHROME_BROWSER_CHROMEOS_GDATA_OPERATIONS_BASE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 179
180 // This class performs the operation for fetching and parsing JSON data content. 180 // This class performs the operation for fetching and parsing JSON data content.
181 class GetDataOperation : public UrlFetchOperationBase { 181 class GetDataOperation : public UrlFetchOperationBase {
182 public: 182 public:
183 GetDataOperation(GDataOperationRegistry* registry, 183 GetDataOperation(GDataOperationRegistry* registry,
184 Profile* profile, 184 Profile* profile,
185 const GetDataCallback& callback); 185 const GetDataCallback& callback);
186 virtual ~GetDataOperation(); 186 virtual ~GetDataOperation();
187 187
188 // Parse GData JSON response. 188 // Parse GData JSON response.
189 virtual bool ParseResponse(GDataErrorCode fetch_error_code, 189 virtual base::Value* ParseResponse(const std::string& data);
190 const std::string& data);
191 190
192 protected: 191 protected:
193 // Overridden from UrlFetchOperationBase. 192 // Overridden from UrlFetchOperationBase.
194 virtual bool ProcessURLFetchResults(const net::URLFetcher* source) OVERRIDE; 193 virtual bool ProcessURLFetchResults(const net::URLFetcher* source) OVERRIDE;
195 virtual void RunCallbackOnPrematureFailure( 194 virtual void RunCallbackOnPrematureFailure(GDataErrorCode code) OVERRIDE;
196 GDataErrorCode fetch_error_code) OVERRIDE;
197 void RunCallback(GDataErrorCode fetch_error_code,
198 scoped_ptr<base::Value> value);
199 195
200 private: 196 private:
201 void OnDataParsed(GDataErrorCode fetch_error_code,
202 scoped_ptr<base::Value>* value);
203
204 GetDataCallback callback_; 197 GetDataCallback callback_;
205 base::WeakPtrFactory<GetDataOperation> weak_ptr_factory_;
206
207 DISALLOW_COPY_AND_ASSIGN(GetDataOperation); 198 DISALLOW_COPY_AND_ASSIGN(GetDataOperation);
208 }; 199 };
209 200
210 } // namespace gdata 201 } // namespace gdata
211 202
212 #endif // CHROME_BROWSER_CHROMEOS_GDATA_OPERATIONS_BASE_H_ 203 #endif // CHROME_BROWSER_CHROMEOS_GDATA_OPERATIONS_BASE_H_
OLDNEW
« 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