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

Unified Diff: content/child/resource_dispatcher.cc

Issue 2390983003: Implement Mojo SyncLoad (Closed)
Patch Set: unneeded |result| 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
Index: content/child/resource_dispatcher.cc
diff --git a/content/child/resource_dispatcher.cc b/content/child/resource_dispatcher.cc
index 4398e238603db7c6cca5b11030d9fb750cddbf1e..a8b00ff67bdaf5f090bbd67df8f95343caead2a8 100644
--- a/content/child/resource_dispatcher.cc
+++ b/content/child/resource_dispatcher.cc
@@ -618,17 +618,24 @@ 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) ||
+ result.error_code == net::ERR_FAILED) {
kinuko 2016/10/13 11:39:01 It's a bit unclear if specifically handling ERR_FA
tzik 2016/10/14 08:02:31 OK, let me remove the special handling.
+ 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;

Powered by Google App Engine
This is Rietveld 408576698