Commit 9277111a authored by agl@chromium.org's avatar agl@chromium.org

Add another didRunInsecureContent method.

In order to better log mixed-scripting issues I want to get the URL into
Chrome land. This involves a WebKit change ([1]) but, by making this
change first, we can decouple of the two changes.

[1] https://bugs.webkit.org/show_bug.cgi?id=52384

BUG=none
TEST=compile

http://codereview.chromium.org/6272003/

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71881 0039d316-1c4b-4281-b951-d872f2087c98
parent be1a48bc
...@@ -1754,7 +1754,7 @@ void TabContents::OnDidDisplayInsecureContent() { ...@@ -1754,7 +1754,7 @@ void TabContents::OnDidDisplayInsecureContent() {
} }
void TabContents::OnDidRunInsecureContent( void TabContents::OnDidRunInsecureContent(
const std::string& security_origin) { const std::string& security_origin, const GURL& target_url) {
controller_.ssl_manager()->DidRunInsecureContent(security_origin); controller_.ssl_manager()->DidRunInsecureContent(security_origin);
} }
......
...@@ -807,7 +807,8 @@ class TabContents : public PageNavigator, ...@@ -807,7 +807,8 @@ class TabContents : public PageNavigator,
const std::string& main_frame_origin, const std::string& main_frame_origin,
const std::string& security_info); const std::string& security_info);
void OnDidDisplayInsecureContent(); void OnDidDisplayInsecureContent();
void OnDidRunInsecureContent(const std::string& security_origin); void OnDidRunInsecureContent(const std::string& security_origin,
const GURL& target_url);
void OnDocumentLoadedInFrame(int64 frame_id); void OnDocumentLoadedInFrame(int64 frame_id);
void OnDidFinishLoad(int64 frame_id); void OnDidFinishLoad(int64 frame_id);
......
...@@ -1252,8 +1252,9 @@ IPC_MESSAGE_ROUTED4(ViewHostMsg_DidLoadResourceFromMemoryCache, ...@@ -1252,8 +1252,9 @@ IPC_MESSAGE_ROUTED4(ViewHostMsg_DidLoadResourceFromMemoryCache,
IPC_MESSAGE_ROUTED0(ViewHostMsg_DidDisplayInsecureContent) IPC_MESSAGE_ROUTED0(ViewHostMsg_DidDisplayInsecureContent)
// Sent when the renderer runs insecure content in a secure origin. // Sent when the renderer runs insecure content in a secure origin.
IPC_MESSAGE_ROUTED1(ViewHostMsg_DidRunInsecureContent, IPC_MESSAGE_ROUTED2(ViewHostMsg_DidRunInsecureContent,
std::string /* security_origin */) std::string /* security_origin */,
GURL /* target URL */);
// Sent when the renderer starts a provisional load for a frame. // Sent when the renderer starts a provisional load for a frame.
IPC_MESSAGE_ROUTED3(ViewHostMsg_DidStartProvisionalLoadForFrame, IPC_MESSAGE_ROUTED3(ViewHostMsg_DidStartProvisionalLoadForFrame,
......
...@@ -3682,11 +3682,20 @@ void RenderView::didDisplayInsecureContent(WebFrame* frame) { ...@@ -3682,11 +3682,20 @@ void RenderView::didDisplayInsecureContent(WebFrame* frame) {
Send(new ViewHostMsg_DidDisplayInsecureContent(routing_id_)); Send(new ViewHostMsg_DidDisplayInsecureContent(routing_id_));
} }
// We have two didRunInsecureContent's with the same name. That's because
// we're in the process of adding an argument and one of them will be correct.
// Once the WebKit change is in, the first should be removed.
void RenderView::didRunInsecureContent( void RenderView::didRunInsecureContent(
WebFrame* frame, const WebSecurityOrigin& origin) { WebFrame* frame, const WebSecurityOrigin& origin) {
didRunInsecureContent(frame, origin, GURL());
}
void RenderView::didRunInsecureContent(
WebFrame* frame, const WebSecurityOrigin& origin, const WebURL& target) {
Send(new ViewHostMsg_DidRunInsecureContent( Send(new ViewHostMsg_DidRunInsecureContent(
routing_id_, routing_id_,
origin.toString().utf8())); origin.toString().utf8(),
target));
} }
bool RenderView::allowScript(WebFrame* frame, bool enabled_per_settings) { bool RenderView::allowScript(WebFrame* frame, bool enabled_per_settings) {
......
...@@ -576,9 +576,19 @@ class RenderView : public RenderWidget, ...@@ -576,9 +576,19 @@ class RenderView : public RenderWidget,
const WebKit::WebURLRequest& request, const WebKit::WebURLRequest& request,
const WebKit::WebURLResponse&); const WebKit::WebURLResponse&);
virtual void didDisplayInsecureContent(WebKit::WebFrame* frame); virtual void didDisplayInsecureContent(WebKit::WebFrame* frame);
// We have two didRunInsecureContent's with the same name. That's because
// we're in the process of adding an argument and one of them will be correct.
// Once the WebKit change is in, the first should be removed the the second
// should be tagged with OVERRIDE.
virtual void didRunInsecureContent(
WebKit::WebFrame* frame,
const WebKit::WebSecurityOrigin& origin);
virtual void didRunInsecureContent( virtual void didRunInsecureContent(
WebKit::WebFrame* frame, WebKit::WebFrame* frame,
const WebKit::WebSecurityOrigin& origin) OVERRIDE; const WebKit::WebSecurityOrigin& origin,
const WebKit::WebURL& target);
virtual bool allowScript(WebKit::WebFrame* frame, bool enabled_per_settings); virtual bool allowScript(WebKit::WebFrame* frame, bool enabled_per_settings);
virtual bool allowDatabase(WebKit::WebFrame* frame, virtual bool allowDatabase(WebKit::WebFrame* frame,
const WebKit::WebString& name, const WebKit::WebString& name,
......
...@@ -1106,12 +1106,21 @@ void TestWebViewDelegate::didDisplayInsecureContent(WebFrame* frame) { ...@@ -1106,12 +1106,21 @@ void TestWebViewDelegate::didDisplayInsecureContent(WebFrame* frame) {
printf("didDisplayInsecureContent\n"); printf("didDisplayInsecureContent\n");
} }
// We have two didRunInsecureContent's with the same name. That's because
// we're in the process of adding an argument and one of them will be correct.
// Once the WebKit change is in, the first should be removed.
void TestWebViewDelegate::didRunInsecureContent( void TestWebViewDelegate::didRunInsecureContent(
WebFrame* frame, const WebSecurityOrigin& origin) { WebFrame* frame, const WebSecurityOrigin& origin) {
if (shell_->ShouldDumpFrameLoadCallbacks()) if (shell_->ShouldDumpFrameLoadCallbacks())
printf("didRunInsecureContent\n"); printf("didRunInsecureContent\n");
} }
void TestWebViewDelegate::didRunInsecureContent(
WebFrame* frame, const WebSecurityOrigin& origin, const WebURL& target) {
if (shell_->ShouldDumpFrameLoadCallbacks())
printf("didRunInsecureContent\n");
}
bool TestWebViewDelegate::allowScript(WebFrame* frame, bool TestWebViewDelegate::allowScript(WebFrame* frame,
bool enabled_per_settings) { bool enabled_per_settings) {
return enabled_per_settings && shell_->allow_scripts(); return enabled_per_settings && shell_->allow_scripts();
......
...@@ -225,9 +225,18 @@ class TestWebViewDelegate : public WebKit::WebViewClient, ...@@ -225,9 +225,18 @@ class TestWebViewDelegate : public WebKit::WebViewClient,
virtual void didFailResourceLoad( virtual void didFailResourceLoad(
WebKit::WebFrame*, unsigned identifier, const WebKit::WebURLError&); WebKit::WebFrame*, unsigned identifier, const WebKit::WebURLError&);
virtual void didDisplayInsecureContent(WebKit::WebFrame* frame); virtual void didDisplayInsecureContent(WebKit::WebFrame* frame);
// We have two didRunInsecureContent's with the same name. That's because
// we're in the process of adding an argument and one of them will be correct.
// Once the WebKit change is in, the first should be removed the the second
// should be tagged with OVERRIDE.
virtual void didRunInsecureContent(
WebKit::WebFrame* frame, const WebKit::WebSecurityOrigin& origin);
virtual void didRunInsecureContent( virtual void didRunInsecureContent(
WebKit::WebFrame* frame, WebKit::WebFrame* frame,
const WebKit::WebSecurityOrigin& origin) OVERRIDE; const WebKit::WebSecurityOrigin& origin,
const WebKit::WebURL& target_url);
virtual bool allowScript(WebKit::WebFrame* frame, bool enabled_per_settings); virtual bool allowScript(WebKit::WebFrame* frame, bool enabled_per_settings);
virtual void openFileSystem( virtual void openFileSystem(
WebKit::WebFrame* frame, WebKit::WebFrame* 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