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

Unified Diff: trunk/src/chrome/browser/drive/drive_api_util.cc

Issue 449323002: Revert 288017 "Parse Drive API responses all at once in the bloc..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 4 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 | « trunk/src/chrome/browser/drive/drive_api_util.h ('k') | trunk/src/google_apis/drive/base_requests.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/chrome/browser/drive/drive_api_util.cc
===================================================================
--- trunk/src/chrome/browser/drive/drive_api_util.cc (revision 288215)
+++ trunk/src/chrome/browser/drive/drive_api_util.cc (working copy)
@@ -136,6 +136,29 @@
return resource_id;
}
+void ParseShareUrlAndRun(const google_apis::GetShareUrlCallback& callback,
+ google_apis::GDataErrorCode error,
+ scoped_ptr<base::Value> value) {
+ DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+
+ if (!value) {
+ callback.Run(error, GURL());
+ return;
+ }
+
+ // Parsing ResourceEntry is cheap enough to do on UI thread.
+ scoped_ptr<google_apis::ResourceEntry> entry =
+ google_apis::ResourceEntry::ExtractAndParse(*value);
+ if (!entry) {
+ callback.Run(google_apis::GDATA_PARSE_ERROR, GURL());
+ return;
+ }
+
+ const google_apis::Link* share_link =
+ entry->GetLinkByType(google_apis::Link::LINK_SHARE);
+ callback.Run(error, share_link ? share_link->href() : GURL());
+}
+
scoped_ptr<google_apis::ResourceEntry>
ConvertFileResourceToResourceEntry(
const google_apis::FileResource& file_resource) {
« no previous file with comments | « trunk/src/chrome/browser/drive/drive_api_util.h ('k') | trunk/src/google_apis/drive/base_requests.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698