Skip to content

Commit

Permalink
Delete policyDocumentLoader
Browse files Browse the repository at this point in the history
The only reason this is needed is for a few callbacks in
content/ (decidePolicyForNavigation, loadURLExternally). Plumb
the needed bits, or read them off of RenderFrameImpl's state.
pending_navigation_params_ gets cleared when the DocumentLoader
is created, so doing policy checks before the DocumentLoader
means that any relevant information is still there.

BUG=545117

Review URL: https://codereview.chromium.org/1385123004

Cr-Commit-Position: refs/heads/master@{#354855}
  • Loading branch information
natechapin authored and Commit bot committed Oct 19, 2015
1 parent 303eccd commit b0bae9d
Show file tree
Hide file tree
Showing 31 changed files with 200 additions and 257 deletions.
5 changes: 2 additions & 3 deletions android_webview/renderer/aw_content_renderer_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void AwContentRendererClient::RenderThreadStarted() {

bool AwContentRendererClient::HandleNavigation(
content::RenderFrame* render_frame,
content::DocumentState* document_state,
bool is_content_initiated,
int opener_id,
blink::WebFrame* frame,
const blink::WebURLRequest& request,
Expand All @@ -101,8 +101,7 @@ bool AwContentRendererClient::HandleNavigation(
// works fine. This will stop working if android_webview starts swapping out
// renderers on navigation.
bool application_initiated =
!document_state->navigation_state()->IsContentInitiated() ||
type == blink::WebNavigationTypeBackForward;
!is_content_initiated || type == blink::WebNavigationTypeBackForward;

// Don't offer application-initiated navigations unless it's a redirect.
if (application_initiated && !is_redirect)
Expand Down
2 changes: 1 addition & 1 deletion android_webview/renderer/aw_content_renderer_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class AwContentRendererClient : public content::ContentRendererClient {
void AddKeySystems(std::vector<media::KeySystemInfo>* key_systems) override;

bool HandleNavigation(content::RenderFrame* render_frame,
content::DocumentState* document_state,
bool is_content_initiated,
int opener_id,
blink::WebFrame* frame,
const blink::WebURLRequest& request,
Expand Down
4 changes: 2 additions & 2 deletions components/plugins/renderer/mobile_youtube_plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ void MobileYouTubePlugin::OpenYoutubeUrlCallback() {
WebURLRequest request;
request.initialize();
request.setURL(url);
render_frame()->LoadURLExternally(
GetFrame(), request, blink::WebNavigationPolicyNewForegroundTab);
render_frame()->LoadURLExternally(request,
blink::WebNavigationPolicyNewForegroundTab);
}

v8::Local<v8::Value> MobileYouTubePlugin::GetV8Handle(v8::Isolate* isolate) {
Expand Down
12 changes: 7 additions & 5 deletions components/test_runner/web_frame_test_proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,14 @@ class WebFrameTestProxy : public Base {
return mime_type.utf8().find(suffix.utf8()) != std::string::npos;
}

virtual void loadURLExternally(blink::WebLocalFrame* frame,
const blink::WebURLRequest& request,
virtual void loadURLExternally(const blink::WebURLRequest& request,
blink::WebNavigationPolicy policy,
const blink::WebString& suggested_name) {
base_proxy_->LoadURLExternally(frame, request, policy, suggested_name);
Base::loadURLExternally(frame, request, policy, suggested_name);
const blink::WebString& suggested_name,
bool replaces_current_history_item) {
base_proxy_->LoadURLExternally(request, policy, suggested_name,
replaces_current_history_item);
Base::loadURLExternally(request, policy, suggested_name,
replaces_current_history_item);
}

virtual void didStartProvisionalLoad(blink::WebLocalFrame* frame,
Expand Down
9 changes: 4 additions & 5 deletions components/test_runner/web_test_proxy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1035,11 +1035,10 @@ bool WebTestProxyBase::IsChooserShown() {
return 0 < chooser_count_;
}

void WebTestProxyBase::LoadURLExternally(
blink::WebLocalFrame* frame,
const blink::WebURLRequest& request,
blink::WebNavigationPolicy policy,
const blink::WebString& suggested_name) {
void WebTestProxyBase::LoadURLExternally(const blink::WebURLRequest& request,
blink::WebNavigationPolicy policy,
const blink::WebString& suggested_name,
bool replaces_current_history_item) {
if (test_interfaces_->GetTestRunner()->shouldWaitUntilExternalURLLoad()) {
if (policy == blink::WebNavigationPolicyDownload) {
delegate_->PrintMessage(
Expand Down
6 changes: 3 additions & 3 deletions components/test_runner/web_test_proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,10 @@ class TEST_RUNNER_EXPORT WebTestProxyBase {
void DidAddMessageToConsole(const blink::WebConsoleMessage& text,
const blink::WebString& source_name,
unsigned source_line);
void LoadURLExternally(blink::WebLocalFrame* frame,
const blink::WebURLRequest& request,
void LoadURLExternally(const blink::WebURLRequest& request,
blink::WebNavigationPolicy policy,
const blink::WebString& suggested_name);
const blink::WebString& suggested_name,
bool replaces_current_history_item);
void DidStartProvisionalLoad(blink::WebLocalFrame*);
void DidReceiveServerRedirectForProvisionalLoad(blink::WebLocalFrame* frame);
bool DidFailProvisionalLoad(blink::WebLocalFrame* frame,
Expand Down
2 changes: 1 addition & 1 deletion content/public/renderer/content_renderer_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ bool ContentRendererClient::AllowPopup() {
#ifdef OS_ANDROID
bool ContentRendererClient::HandleNavigation(
RenderFrame* render_frame,
DocumentState* document_state,
bool is_content_initiated,
int opener_id,
blink::WebFrame* frame,
const blink::WebURLRequest& request,
Expand Down
2 changes: 1 addition & 1 deletion content/public/renderer/content_renderer_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ class CONTENT_EXPORT ContentRendererClient {
// Returns true if the navigation was handled by the embedder and should be
// ignored by WebKit. This method is used by CEF and android_webview.
virtual bool HandleNavigation(RenderFrame* render_frame,
DocumentState* document_state,
bool is_content_initiated,
int opener_id,
blink::WebFrame* frame,
const blink::WebURLRequest& request,
Expand Down
3 changes: 1 addition & 2 deletions content/public/renderer/render_frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ class CONTENT_EXPORT RenderFrame : public IPC::Listener,
scoped_ptr<PluginInstanceThrottler> throttler) = 0;

// The client should handle the navigation externally.
virtual void LoadURLExternally(blink::WebLocalFrame* frame,
const blink::WebURLRequest& request,
virtual void LoadURLExternally(const blink::WebURLRequest& request,
blink::WebNavigationPolicy policy) = 0;

// Execute a string of JavaScript in this frame's context.
Expand Down
Loading

0 comments on commit b0bae9d

Please sign in to comment.