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

Unified Diff: content/child/resource_dispatcher.cc

Issue 2390983003: Implement Mojo SyncLoad (Closed)
Patch Set: +tests Created 4 years, 2 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 | « content/browser/loader/url_loader_factory_impl.cc ('k') | content/common/typemaps.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/resource_dispatcher.cc
diff --git a/content/child/resource_dispatcher.cc b/content/child/resource_dispatcher.cc
index 4398e238603db7c6cca5b11030d9fb750cddbf1e..052e95d072f3e208a27f6d931c2e4c168f9c8faf 100644
--- a/content/child/resource_dispatcher.cc
+++ b/content/child/resource_dispatcher.cc
@@ -618,17 +618,23 @@ void ResourceDispatcher::StartSync(
mojom::URLLoaderFactory* url_loader_factory) {
CheckSchemeForReferrerPolicy(*request);
- // TODO(yhirano): Use url_loader_factory otherwise.
- DCHECK_EQ(blink::WebURLRequest::LoadingIPCType::ChromeIPC, ipc_type);
-
SyncLoadResult result;
- IPC::SyncMessage* msg = new ResourceHostMsg_SyncLoad(
- routing_id, MakeRequestID(), *request, &result);
- // NOTE: This may pump events (see RenderThread::Send).
- if (!message_sender_->Send(msg)) {
- response->error_code = net::ERR_FAILED;
- return;
+ if (ipc_type == blink::WebURLRequest::LoadingIPCType::Mojo) {
+ if (!url_loader_factory->SyncLoad(
+ routing_id, MakeRequestID(), *request, &result)) {
+ response->error_code = net::ERR_FAILED;
+ return;
+ }
+ } else {
+ IPC::SyncMessage* msg = new ResourceHostMsg_SyncLoad(
+ routing_id, MakeRequestID(), *request, &result);
+
+ // NOTE: This may pump events (see RenderThread::Send).
+ if (!message_sender_->Send(msg)) {
+ response->error_code = net::ERR_FAILED;
+ return;
+ }
}
response->error_code = result.error_code;
« no previous file with comments | « content/browser/loader/url_loader_factory_impl.cc ('k') | content/common/typemaps.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698