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

Unified Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 906283003: PlzNavigate: Support data urls (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 5 years, 10 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/browser/frame_host/render_frame_host_impl.cc
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index e6cc05197d3a25613468d2938787f3f54da90757..7ea59dca070fea4d6d803ba2abb87e26a326947b 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -21,6 +21,7 @@
#include "content/browser/frame_host/frame_accessibility.h"
#include "content/browser/frame_host/frame_tree.h"
#include "content/browser/frame_host/frame_tree_node.h"
+#include "content/browser/frame_host/navigation_request.h"
#include "content/browser/frame_host/navigator.h"
#include "content/browser/frame_host/navigator_impl.h"
#include "content/browser/frame_host/render_frame_host_delegate.h"
@@ -1471,11 +1472,11 @@ void RenderFrameHostImpl::Navigate(const FrameMsg_Navigate_Params& params) {
ChildProcessSecurityPolicyImpl::GetInstance()->GrantRequestURL(
GetProcess()->GetID(), params.common_params.url);
if (params.common_params.url.SchemeIs(url::kDataScheme) &&
- params.base_url_for_data_url.SchemeIs(url::kFileScheme)) {
+ params.common_params.base_url_for_data_url.SchemeIs(url::kFileScheme)) {
// If 'data:' is used, and we have a 'file:' base url, grant access to
// local files.
ChildProcessSecurityPolicyImpl::GetInstance()->GrantRequestURL(
- GetProcess()->GetID(), params.base_url_for_data_url);
+ GetProcess()->GetID(), params.common_params.base_url_for_data_url);
}
}
@@ -1642,6 +1643,8 @@ void RenderFrameHostImpl::CommitNavigation(
scoped_ptr<StreamHandle> body,
const CommonNavigationParams& common_params,
const CommitNavigationParams& commit_params) {
+ DCHECK((response && body.get()) ||
+ !NavigationRequest::ShouldMakeNetworkRequest(common_params.url));
// TODO(clamy): Check if we have to add security checks for the browser plugin
// guests.
@@ -1649,9 +1652,11 @@ void RenderFrameHostImpl::CommitNavigation(
// completing a RFH swap or unload handler.
SetState(RenderFrameHostImpl::STATE_DEFAULT);
+ const GURL body_url = body.get() ? body->GetURL() : GURL();
+ const ResourceResponseHead head = response ?
+ response->head : ResourceResponseHead();
Send(new FrameMsg_CommitNavigation(
- routing_id_, response->head, body->GetURL(),
- common_params, commit_params));
+ routing_id_, head, body_url, common_params, commit_params));
// TODO(clamy): Check if we should start the throbber for non javascript urls
// here.

Powered by Google App Engine
This is Rietveld 408576698