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

Unified Diff: chrome/browser/google_apis/drive_api_service.cc

Issue 12387021: Move the responsibility to convert from JSON to FileResource into drive_api_operations. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Minor fix to address review comments. Created 7 years, 10 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
« no previous file with comments | « chrome/browser/google_apis/drive_api_operations_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/google_apis/drive_api_service.cc
diff --git a/chrome/browser/google_apis/drive_api_service.cc b/chrome/browser/google_apis/drive_api_service.cc
index 546e3a176f06f5daf434ee02ee6baf8a79b733a6..1ca519882cd581d9309f245ea9c46f4890ada8a7 100644
--- a/chrome/browser/google_apis/drive_api_service.cc
+++ b/chrome/browser/google_apis/drive_api_service.cc
@@ -88,11 +88,11 @@ void ParseResourceListOnBlockingPoolAndRun(
callback, base::Owned(error)));
}
-// Parses the JSON value to ResourceEntry runs |callback|.
+// Parses the FileResource value to ResourceEntry and runs |callback|.
void ParseResourceEntryAndRun(
const GetResourceEntryCallback& callback,
GDataErrorCode error,
- scoped_ptr<base::Value> value) {
+ scoped_ptr<FileResource> value) {
DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::UI));
if (!value) {
@@ -100,16 +100,9 @@ void ParseResourceEntryAndRun(
return;
}
- // Parsing FileResource is cheap enough to do on UI thread.
- scoped_ptr<FileResource> file_resource = FileResource::CreateFrom(*value);
- if (!file_resource) {
- callback.Run(GDATA_PARSE_ERROR, scoped_ptr<ResourceEntry>());
- return;
- }
-
// Converting to ResourceEntry is cheap enough to do on UI thread.
scoped_ptr<ResourceEntry> entry =
- ResourceEntry::CreateFromFileResource(*file_resource);
+ ResourceEntry::CreateFromFileResource(*value);
if (!entry) {
callback.Run(GDATA_PARSE_ERROR, scoped_ptr<ResourceEntry>());
return;
« no previous file with comments | « chrome/browser/google_apis/drive_api_operations_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698