Commit 825be917 authored by Ryan Sturm's avatar Ryan Sturm Committed by Commit Bot

Remove Protocol handler from prerender

Since protocols can only be added via script, this behavior can't occur
during NoStatePrefetch. Using the inherited functionality is also safe,
since it is a no-op.

Bug: 1038068
Change-Id: Ie633f94580ae5618fe42b7b017592d3a284071e5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2158407
Commit-Queue: Ryan Sturm <ryansturm@chromium.org>
Reviewed-by: default avatarRobert Ogden <robertogden@chromium.org>
Cr-Commit-Position: refs/heads/master@{#761146}
parent 58631961
......@@ -1113,13 +1113,6 @@ IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderPopup) {
FINAL_STATUS_CREATE_NEW_WINDOW, 0);
}
// Checks that registering a protocol handler causes cancellation.
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderRegisterProtocolHandler) {
UseHttpsSrcServer();
PrerenderTestURL("/prerender/prerender_register_protocol_handler.html",
FINAL_STATUS_REGISTER_PROTOCOL_HANDLER, 0);
}
// Checks that renderers using excessive memory will be terminated.
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderExcessiveMemory) {
ASSERT_TRUE(GetPrerenderManager());
......
......@@ -131,15 +131,6 @@ class PrerenderContents::WebContentsDelegateImpl
return false;
}
void RegisterProtocolHandler(WebContents* web_contents,
const std::string& protocol,
const GURL& url,
bool user_gesture) override {
// TODO(mmenke): Consider supporting this if it is a common case during
// prerenders.
prerender_contents_->Destroy(FINAL_STATUS_REGISTER_PROTOCOL_HANDLER);
}
gfx::Size GetSizeForNewRenderView(WebContents* web_contents) override {
// Have to set the size of the RenderView on initialization to be sure it is
// set before the RenderView is hidden on all platforms (esp. Android).
......
......@@ -59,7 +59,7 @@ enum FinalStatus {
FINAL_STATUS_DUPLICATE = 39,
FINAL_STATUS_OPEN_URL = 40,
// Obsolete: FINAL_STATUS_WOULD_HAVE_BEEN_USED = 41,
FINAL_STATUS_REGISTER_PROTOCOL_HANDLER = 42,
// Obsolete: FINAL_STATUS_REGISTER_PROTOCOL_HANDLER = 42,
// Obsolete: FINAL_STATUS_CREATING_AUDIO_STREAM = 43,
// Obsolete: FINAL_STATUS_PAGE_BEING_CAPTURED = 44,
// Obsolete: FINAL_STATUS_BAD_DEFERRED_REDIRECT = 45,
......
<html>
<!--
This test checks that registering a protocol handler cancels prerendering.
-->
<head>
<title>Prerender register protocol handler cancellation</title>
<script language="javascript" type="text/javascript">
window.onload = function() {
navigator.registerProtocolHandler('mailto',
document.location.href + '%s',
'Mail to Santa');
};
</script>
</head>
<body></body>
</html>
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