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

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

Issue 442193002: Parse Drive API responses all at once in the blocking pool. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + really drop GetDataRequest 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 | « no previous file | chrome/browser/drive/drive_api_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/drive/drive_api_service.cc
diff --git a/chrome/browser/drive/drive_api_service.cc b/chrome/browser/drive/drive_api_service.cc
index 056486a9c9caaac81934ad31007e0c8fe26556ab..b86968c3ad3fd6d5fc9e0d92730829b36d33ad0a 100644
--- a/chrome/browser/drive/drive_api_service.cc
+++ b/chrome/browser/drive/drive_api_service.cc
@@ -8,10 +8,7 @@
#include <vector>
#include "base/bind.h"
-#include "base/sequenced_task_runner.h"
#include "base/strings/stringprintf.h"
-#include "base/task_runner_util.h"
-#include "base/values.h"
#include "chrome/browser/drive/drive_api_util.h"
#include "content/public/browser/browser_thread.h"
#include "google_apis/drive/auth_service.h"
@@ -147,6 +144,17 @@ void ExtractOpenUrlAndRun(const std::string& app_id,
callback.Run(GDATA_OTHER_ERROR, GURL());
}
+void ExtractShareUrlAndRun(const google_apis::GetShareUrlCallback& callback,
+ google_apis::GDataErrorCode error,
+ scoped_ptr<google_apis::ResourceEntry> entry) {
+ DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+
+ const google_apis::Link* share_link =
+ entry ? entry->GetLinkByType(google_apis::Link::LINK_SHARE) : NULL;
+ callback.Run(error, share_link ? share_link->href() : GURL());
+}
+
hashimoto 2014/08/07 02:55:09 nit: This blank line is redundant?
kinaba 2014/08/07 02:58:08 Done.
+
// Ignores the |entry|, and runs the |callback|.
void EntryActionCallbackAdapter(
const EntryActionCallback& callback,
@@ -372,7 +380,7 @@ CancelCallback DriveAPIService::GetShareUrl(
wapi_url_generator_,
resource_id,
embed_origin,
- base::Bind(&util::ParseShareUrlAndRun,
+ base::Bind(&ExtractShareUrlAndRun,
callback)));
}
« no previous file with comments | « no previous file | chrome/browser/drive/drive_api_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698