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

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

Issue 12388017: Move the responsibility to convert from JSON to AccountMetadata into gdata_wapi_operations. (Closed) Base URL: http://git.chromium.org/chromium/src.git@b148632_gdata_wapi_get_about_resource_impl
Patch Set: 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
Index: chrome/browser/google_apis/gdata_wapi_service.cc
diff --git a/chrome/browser/google_apis/gdata_wapi_service.cc b/chrome/browser/google_apis/gdata_wapi_service.cc
index 1951526b7a4bb3d5d7568ae972d08de5b1f5282a..cddafece499db32c1208a7fc83e98c049135a7da 100644
--- a/chrome/browser/google_apis/gdata_wapi_service.cc
+++ b/chrome/browser/google_apis/gdata_wapi_service.cc
@@ -94,30 +94,6 @@ void ParseResourceEntryAndRun(const GetResourceEntryCallback& callback,
callback.Run(error, entry.Pass());
}
-// Parses the JSON value to AccountMetadataFeed on the blocking pool and runs
-// |callback| on the UI thread once parsing is done.
-void ParseAccounetMetadataAndRun(const GetAccountMetadataCallback& callback,
- GDataErrorCode error,
- scoped_ptr<base::Value> value) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- DCHECK(!callback.is_null());
-
- if (!value) {
- callback.Run(error, scoped_ptr<AccountMetadataFeed>());
- return;
- }
-
- // Parsing AccountMetadataFeed is cheap enough to do on UI thread.
- scoped_ptr<AccountMetadataFeed> entry =
- google_apis::AccountMetadataFeed::CreateFrom(*value);
- if (!entry) {
- callback.Run(GDATA_PARSE_ERROR, scoped_ptr<AccountMetadataFeed>());
- return;
- }
-
- callback.Run(error, entry.Pass());
-}
-
// Extracts the open link url from the JSON Feed. Used by AuthorizeApp().
void ExtractOpenLinkAndRun(const std::string app_id,
const AuthorizeAppCallback& callback,
@@ -281,7 +257,7 @@ void GDataWapiService::GetAccountMetadata(
operation_registry(),
url_request_context_getter_,
url_generator_,
- base::Bind(&ParseAccounetMetadataAndRun, callback)));
+ callback));
}
void GDataWapiService::GetAboutResource(
« no previous file with comments | « chrome/browser/google_apis/gdata_wapi_operations_unittest.cc ('k') | chrome/browser/google_apis/test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698