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

Unified Diff: android_webview/browser/net/aw_request_interceptor.cc

Issue 2737663004: Introduce a secondary map for enabling plznavigate (Closed)
Patch Set: address jam review Created 3 years, 9 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: android_webview/browser/net/aw_request_interceptor.cc
diff --git a/android_webview/browser/net/aw_request_interceptor.cc b/android_webview/browser/net/aw_request_interceptor.cc
index 3645f2fefe3321da95684c607d2c7f5868e6ed65..eb856432ae3a7cf4aecf63b8e3e080de7eb4fceb 100644
--- a/android_webview/browser/net/aw_request_interceptor.cc
+++ b/android_webview/browser/net/aw_request_interceptor.cc
@@ -18,6 +18,7 @@
#include "content/public/browser/resource_request_info.h"
#include "net/http/http_response_headers.h"
#include "net/url_request/url_request_job.h"
+#include "url/url_constants.h"
namespace android_webview {
@@ -119,13 +120,22 @@ std::unique_ptr<AwContentsIoThreadClient> GetCorrespondingIoThreadClient(
net::URLRequest* request) {
if (content::ResourceRequestInfo::OriginatedFromServiceWorker(request))
return AwContentsIoThreadClient::GetServiceWorkerIoThreadClient();
-
int render_process_id, render_frame_id;
if (!content::ResourceRequestInfo::GetRenderFrameForRequest(
request, &render_process_id, &render_frame_id)) {
return nullptr;
}
+ if (render_process_id == -1 || render_frame_id == -1) {
+ const content::ResourceRequestInfo* resourceRequestInfo =
+ content::ResourceRequestInfo::ForRequest(request);
+ if (resourceRequestInfo == nullptr) {
+ return nullptr;
+ }
+ return AwContentsIoThreadClient::FromID(
+ resourceRequestInfo->GetFrameTreeNodeId());
+ }
+
return AwContentsIoThreadClient::FromID(render_process_id, render_frame_id);
}
@@ -144,6 +154,13 @@ net::URLRequestJob* AwRequestInterceptor::MaybeInterceptRequest(
if (request->GetUserData(kRequestAlreadyHasJobDataKey))
return nullptr;
+ // With PlzNavigate, we now seem to receive blob URLs in interceptor.
+ // Ignore these URLs.
+ // TODO(sgurun) is this the best place to do that? Talk with jam@.
+ if (request->url().SchemeIs(url::kBlobScheme)) {
+ return nullptr;
+ }
+
std::unique_ptr<AwContentsIoThreadClient> io_thread_client =
GetCorrespondingIoThreadClient(request);

Powered by Google App Engine
This is Rietveld 408576698