Commit 21c00906 authored by Avi Drissman's avatar Avi Drissman Committed by Commit Bot

Stop sending frame URLs to the browser process.

It knows them already, and the case where it doesn’t doesn’t matter
for this and we already plan on fixing it.

BUG=718570

Change-Id: Ic9cc32a265cff867459ce031699c453fcbe7baf0
Reviewed-on: https://chromium-review.googlesource.com/956283Reviewed-by: default avatarKen Buchanan <kenrb@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#542167}
parent 1e75ab31
......@@ -2044,7 +2044,6 @@ void RenderFrameHostImpl::OnVisualStateResponse(uint64_t id) {
void RenderFrameHostImpl::OnRunJavaScriptDialog(
const base::string16& message,
const base::string16& default_prompt,
const GURL& frame_url,
JavaScriptDialogType dialog_type,
IPC::Message* reply_msg) {
if (dialog_type == JavaScriptDialogType::JAVASCRIPT_DIALOG_TYPE_ALERT)
......@@ -2071,7 +2070,6 @@ void RenderFrameHostImpl::OnRunJavaScriptDialog(
}
void RenderFrameHostImpl::OnRunBeforeUnloadConfirm(
const GURL& frame_url,
bool is_reload,
IPC::Message* reply_msg) {
TRACE_EVENT1("navigation", "RenderFrameHostImpl::OnRunBeforeUnloadConfirm",
......
......@@ -790,12 +790,9 @@ class CONTENT_EXPORT RenderFrameHostImpl
void OnVisualStateResponse(uint64_t id);
void OnRunJavaScriptDialog(const base::string16& message,
const base::string16& default_prompt,
const GURL& frame_url,
JavaScriptDialogType dialog_type,
IPC::Message* reply_msg);
void OnRunBeforeUnloadConfirm(const GURL& frame_url,
bool is_reload,
IPC::Message* reply_msg);
void OnRunBeforeUnloadConfirm(bool is_reload, IPC::Message* reply_msg);
void OnRunFileChooser(const FileChooserParams& params);
void OnTextSurroundingSelectionResponse(const base::string16& content,
uint32_t start_offset,
......
......@@ -1532,22 +1532,21 @@ IPC_MESSAGE_ROUTED2(FrameHostMsg_JavaScriptExecuteResponse,
base::ListValue /* result */)
// A request to run a JavaScript dialog.
IPC_SYNC_MESSAGE_ROUTED4_2(FrameHostMsg_RunJavaScriptDialog,
IPC_SYNC_MESSAGE_ROUTED3_2(FrameHostMsg_RunJavaScriptDialog,
base::string16 /* in - alert message */,
base::string16 /* in - default prompt */,
GURL /* in - originating page URL */,
content::JavaScriptDialogType /* in - type */,
bool /* out - success */,
base::string16 /* out - user_input field */)
// Displays a dialog to confirm that the user wants to navigate away from the
// page. Replies true if yes, and false otherwise. The reply string is ignored,
// but is included so that we can use OnJavaScriptMessageBoxClosed.
IPC_SYNC_MESSAGE_ROUTED2_2(FrameHostMsg_RunBeforeUnloadConfirm,
GURL, /* in - originating frame URL */
bool /* in - is a reload */,
bool /* out - success */,
base::string16 /* out - This is ignored.*/)
// but is included so that we can use
// RenderFrameHostImpl::SendJavaScriptDialogReply.
IPC_SYNC_MESSAGE_ROUTED1_2(FrameHostMsg_RunBeforeUnloadConfirm,
bool /* in - is a reload */,
bool /* out - success */,
base::string16 /* out - This is ignored.*/)
// Notify browser the theme color has been changed.
IPC_MESSAGE_ROUTED1(FrameHostMsg_DidChangeThemeColor,
......
......@@ -2581,7 +2581,6 @@ void RenderFrameImpl::OnTextSurroundingSelectionRequest(uint32_t max_length) {
bool RenderFrameImpl::RunJavaScriptDialog(JavaScriptDialogType type,
const base::string16& message,
const base::string16& default_value,
const GURL& frame_url,
base::string16* result) {
// Don't allow further dialogs if we are waiting to swap out, since the
// ScopedPageLoadDeferrer in our stack prevents it.
......@@ -2603,7 +2602,7 @@ bool RenderFrameImpl::RunJavaScriptDialog(JavaScriptDialogType type,
result = &result_temp;
Send(new FrameHostMsg_RunJavaScriptDialog(routing_id_, message, default_value,
frame_url, type, &success, result));
type, &success, result));
return success;
}
......@@ -4676,13 +4675,12 @@ bool RenderFrameImpl::HandleCurrentKeyboardEvent() {
void RenderFrameImpl::RunModalAlertDialog(const blink::WebString& message) {
RunJavaScriptDialog(JAVASCRIPT_DIALOG_TYPE_ALERT, message.Utf16(),
base::string16(), frame_->GetDocument().Url(), nullptr);
base::string16(), nullptr);
}
bool RenderFrameImpl::RunModalConfirmDialog(const blink::WebString& message) {
return RunJavaScriptDialog(JAVASCRIPT_DIALOG_TYPE_CONFIRM, message.Utf16(),
base::string16(), frame_->GetDocument().Url(),
nullptr);
base::string16(), nullptr);
}
bool RenderFrameImpl::RunModalPromptDialog(
......@@ -4691,8 +4689,7 @@ bool RenderFrameImpl::RunModalPromptDialog(
blink::WebString* actual_value) {
base::string16 result;
bool ok = RunJavaScriptDialog(JAVASCRIPT_DIALOG_TYPE_PROMPT, message.Utf16(),
default_value.Utf16(),
frame_->GetDocument().Url(), &result);
default_value.Utf16(), &result);
if (ok)
*actual_value = WebString::FromUTF16(result);
return ok;
......@@ -4708,9 +4705,8 @@ bool RenderFrameImpl::RunModalBeforeUnloadDialog(bool is_reload) {
// This is an ignored return value, but is included so we can accept the same
// response as RunJavaScriptDialog.
base::string16 ignored_result;
Send(new FrameHostMsg_RunBeforeUnloadConfirm(
routing_id_, frame_->GetDocument().Url(), is_reload, &success,
&ignored_result));
Send(new FrameHostMsg_RunBeforeUnloadConfirm(routing_id_, is_reload, &success,
&ignored_result));
return success;
}
......
......@@ -1145,7 +1145,6 @@ class CONTENT_EXPORT RenderFrameImpl
bool RunJavaScriptDialog(JavaScriptDialogType type,
const base::string16& message,
const base::string16& default_value,
const GURL& frame_url,
base::string16* result);
// Loads the appropriate error page for the specified failure into the frame.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment