Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Unreviewed, rolling out r103620.
http://trac.webkit.org/changeset/103620
https://bugs.webkit.org/show_bug.cgi?id=75316

Causes many crashes (Requested by abarth on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2011-12-28

Source/WebCore:

* loader/FrameLoaderClient.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::postMessageTimerFired):

Source/WebKit/chromium:

* public/WebDOMMessageEvent.h:
* public/WebFrameClient.h:
* src/FrameLoaderClientImpl.cpp:
* src/FrameLoaderClientImpl.h:

Tools:

* DumpRenderTree/chromium/LayoutTestController.cpp:
(LayoutTestController::LayoutTestController):
(LayoutTestController::reset):
* DumpRenderTree/chromium/LayoutTestController.h:
* DumpRenderTree/chromium/WebViewHost.cpp:
* DumpRenderTree/chromium/WebViewHost.h:

LayoutTests:

* platform/chromium/fast/events/intercept-postmessage-expected.txt: Removed.
* platform/chromium/fast/events/intercept-postmessage.html: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103770 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
webkit-commit-queue committed Dec 28, 2011
1 parent 35f0705 commit 160dae7
Show file tree
Hide file tree
Showing 16 changed files with 55 additions and 123 deletions.
11 changes: 11 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,14 @@
2011-12-28 Sheriff Bot <webkit.review.bot@gmail.com>

Unreviewed, rolling out r103620.
http://trac.webkit.org/changeset/103620
https://bugs.webkit.org/show_bug.cgi?id=75316

Causes many crashes (Requested by abarth on #webkit).

* platform/chromium/fast/events/intercept-postmessage-expected.txt: Removed.
* platform/chromium/fast/events/intercept-postmessage.html: Removed.

2011-12-28 Alexander Pavlov <apavlov@chromium.org>

[V8][Chromium] 'randomString' in document.body.style always returns true
Expand Down

This file was deleted.

This file was deleted.

12 changes: 12 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,15 @@
2011-12-28 Sheriff Bot <webkit.review.bot@gmail.com>

Unreviewed, rolling out r103620.
http://trac.webkit.org/changeset/103620
https://bugs.webkit.org/show_bug.cgi?id=75316

Causes many crashes (Requested by abarth on #webkit).

* loader/FrameLoaderClient.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::postMessageTimerFired):

2011-12-28 Alexander Pavlov <apavlov@chromium.org>

[V8][Chromium] 'randomString' in document.body.style always returns true
Expand Down
4 changes: 0 additions & 4 deletions Source/WebCore/loader/FrameLoaderClient.h
Expand Up @@ -79,7 +79,6 @@ namespace WebCore {
class HTMLPlugInElement;
class IntSize;
class KURL;
class MessageEvent;
class NavigationAction;
class Page;
class ProtectionSpace;
Expand Down Expand Up @@ -320,9 +319,6 @@ namespace WebCore {
virtual PassRefPtr<FrameNetworkingContext> createNetworkingContext() = 0;

virtual bool shouldPaintBrokenImage(const KURL&) const { return true; }

// Returns true if the embedder intercepted the postMessage call
virtual bool willCheckAndDispatchMessageEvent(SecurityOrigin* /*target*/, MessageEvent*) const { return false; }
};

} // namespace WebCore
Expand Down
13 changes: 2 additions & 11 deletions Source/WebCore/page/DOMWindow.cpp
Expand Up @@ -60,7 +60,6 @@
#include "Frame.h"
#include "FrameLoadRequest.h"
#include "FrameLoader.h"
#include "FrameLoaderClient.h"
#include "FrameTree.h"
#include "FrameView.h"
#include "HTMLFrameOwnerElement.h"
Expand Down Expand Up @@ -911,16 +910,8 @@ void DOMWindow::postMessageTimerFired(PassOwnPtr<PostMessageTimer> t)
if (!document())
return;

RefPtr<MessageEvent> event = timer->event(document());

// Give the embedder a chance to intercept this postMessage because this
// DOMWindow might be a proxy for another in browsers that support
// postMessage calls across WebKit instances.
if (isCurrentlyDisplayedInFrame() && m_frame->loader()->client()->willCheckAndDispatchMessageEvent(timer->targetOrigin(), PassRefPtr<MessageEvent>(event).leakRef()))
return;

if (timer->targetOrigin()) {
// Check target origin now since the target document may have changed since the timer was scheduled.
// Check target origin now since the target document may have changed since the simer was scheduled.
if (!timer->targetOrigin()->isSameSchemeHostPort(document()->securityOrigin())) {
String message = "Unable to post message to " + timer->targetOrigin()->toString() +
". Recipient has origin " + document()->securityOrigin()->toString() + ".\n";
Expand All @@ -929,7 +920,7 @@ void DOMWindow::postMessageTimerFired(PassOwnPtr<PostMessageTimer> t)
}
}

dispatchEvent(event);
dispatchEvent(timer->event(document()));
}

DOMSelection* DOMWindow::getSelection()
Expand Down
13 changes: 13 additions & 0 deletions Source/WebKit/chromium/ChangeLog
@@ -1,3 +1,16 @@
2011-12-28 Sheriff Bot <webkit.review.bot@gmail.com>

Unreviewed, rolling out r103620.
http://trac.webkit.org/changeset/103620
https://bugs.webkit.org/show_bug.cgi?id=75316

Causes many crashes (Requested by abarth on #webkit).

* public/WebDOMMessageEvent.h:
* public/WebFrameClient.h:
* src/FrameLoaderClientImpl.cpp:
* src/FrameLoaderClientImpl.h:

2011-12-27 Sheriff Bot <webkit.review.bot@gmail.com>

Unreviewed, rolling out r103734.
Expand Down
7 changes: 1 addition & 6 deletions Source/WebKit/chromium/public/WebDOMMessageEvent.h
Expand Up @@ -35,8 +35,7 @@
#include "platform/WebSerializedScriptValue.h"

#if WEBKIT_IMPLEMENTATION
#include "Event.h"
#include "MessageEvent.h"
namespace WebCore { class Event; }
#endif

namespace WebKit {
Expand All @@ -50,10 +49,6 @@ class WebDOMMessageEvent : public WebDOMEvent {

WEBKIT_EXPORT WebSerializedScriptValue data() const;
WEBKIT_EXPORT WebString origin() const;

#if WEBKIT_IMPLEMENTATION
explicit WebDOMMessageEvent(const WTF::PassRefPtr<WebCore::MessageEvent>& e) : WebDOMEvent(e) { }
#endif
};

} // namespace WebKit
Expand Down
14 changes: 1 addition & 13 deletions Source/WebKit/chromium/public/WebFrameClient.h
Expand Up @@ -31,11 +31,9 @@
#ifndef WebFrameClient_h
#define WebFrameClient_h

#include "WebDOMMessageEvent.h"
#include "WebIconURL.h"
#include "WebNavigationPolicy.h"
#include "WebNavigationType.h"
#include "WebSecurityOrigin.h"
#include "WebStorageQuotaType.h"
#include "WebTextDirection.h"
#include "platform/WebCommon.h"
Expand All @@ -52,7 +50,6 @@ class WebApplicationCacheHost;
class WebApplicationCacheHostClient;
class WebCookieJar;
class WebDataSource;
class WebDOMEvent;
class WebFormElement;
class WebFrame;
class WebIntentServiceInfo;
Expand All @@ -61,6 +58,7 @@ class WebMediaPlayer;
class WebMediaPlayerClient;
class WebNode;
class WebPlugin;
class WebSecurityOrigin;
class WebSharedWorker;
class WebStorageQuotaCallbacks;
class WebString;
Expand Down Expand Up @@ -387,16 +385,6 @@ class WebFrameClient {
// the WebFrame starting the activity.
virtual void dispatchIntent(WebFrame*, const WebIntent&) { }

// Messages ------------------------------------------------------

// Notifies the embedder that a postMessage was issued on this frame, and
// gives the embedder a chance to handle it instead of WebKit. Returns true
// if the embedder handled it.
virtual bool willCheckAndDispatchMessageEvent(
WebFrame* source,
WebSecurityOrigin target,
WebDOMMessageEvent) { return false; }

protected:
~WebFrameClient() { }
};
Expand Down
9 changes: 0 additions & 9 deletions Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp
Expand Up @@ -47,7 +47,6 @@
#include "HTMLAppletElement.h"
#include "HTMLFormElement.h" // needed by FormState.h
#include "HTMLNames.h"
#include "MessageEvent.h"
#include "MIMETypeRegistry.h"
#include "MouseEvent.h"
#include "Page.h"
Expand All @@ -59,7 +58,6 @@
#include "ResourceLoader.h"
#include "Settings.h"
#include "StringExtras.h"
#include "WebDOMEvent.h"
#include "WebDataSourceImpl.h"
#include "WebDevToolsAgentPrivate.h"
#include "WebDocument.h"
Expand Down Expand Up @@ -1619,11 +1617,4 @@ PassRefPtr<FrameNetworkingContext> FrameLoaderClientImpl::createNetworkingContex
return FrameNetworkingContextImpl::create(m_webFrame->frame());
}

bool FrameLoaderClientImpl::willCheckAndDispatchMessageEvent(
SecurityOrigin* target, MessageEvent* event) const
{
return m_webFrame->client()->willCheckAndDispatchMessageEvent(
m_webFrame, WebSecurityOrigin(target), WebDOMMessageEvent(event));
}

} // namespace WebKit
1 change: 0 additions & 1 deletion Source/WebKit/chromium/src/FrameLoaderClientImpl.h
Expand Up @@ -206,7 +206,6 @@ class FrameLoaderClientImpl : public WebCore::FrameLoaderClient {
virtual void didNotAllowPlugins();

virtual PassRefPtr<WebCore::FrameNetworkingContext> createNetworkingContext();
virtual bool willCheckAndDispatchMessageEvent(WebCore::SecurityOrigin* target, WebCore::MessageEvent*) const;

private:
void makeDocumentView();
Expand Down
15 changes: 15 additions & 0 deletions Tools/ChangeLog
@@ -1,3 +1,18 @@
2011-12-28 Sheriff Bot <webkit.review.bot@gmail.com>

Unreviewed, rolling out r103620.
http://trac.webkit.org/changeset/103620
https://bugs.webkit.org/show_bug.cgi?id=75316

Causes many crashes (Requested by abarth on #webkit).

* DumpRenderTree/chromium/LayoutTestController.cpp:
(LayoutTestController::LayoutTestController):
(LayoutTestController::reset):
* DumpRenderTree/chromium/LayoutTestController.h:
* DumpRenderTree/chromium/WebViewHost.cpp:
* DumpRenderTree/chromium/WebViewHost.h:

2011-12-27 Sheriff Bot <webkit.review.bot@gmail.com>

Unreviewed, rolling out r103734.
Expand Down
2 changes: 0 additions & 2 deletions Tools/DumpRenderTree/chromium/LayoutTestController.cpp
Expand Up @@ -250,7 +250,6 @@ LayoutTestController::LayoutTestController(TestShell* shell)
bindProperty("webHistoryItemCount", &m_webHistoryItemCount);
bindProperty("titleTextDirection", &m_titleTextDirection);
bindProperty("platformName", &m_platformName);
bindProperty("interceptPostMessage", &m_interceptPostMessage);
}

LayoutTestController::~LayoutTestController()
Expand Down Expand Up @@ -638,7 +637,6 @@ void LayoutTestController::reset()
m_webHistoryItemCount.set(0);
m_titleTextDirection.set("ltr");
m_platformName.set("chromium");
m_interceptPostMessage.set(false);
m_userStyleSheetLocation = WebURL();
m_isPrinting = false;

Expand Down
8 changes: 0 additions & 8 deletions Tools/DumpRenderTree/chromium/LayoutTestController.h
Expand Up @@ -469,11 +469,6 @@ class LayoutTestController : public CppBoundClass {
m_titleTextDirection.set(dir == WebKit::WebTextDirectionLeftToRight ? "ltr" : "rtl");
}

bool shouldInterceptPostMessage()
{
return m_interceptPostMessage.isBool() && m_interceptPostMessage.toBoolean();
}

void setIsPrinting(bool value) { m_isPrinting = value; }
bool isPrinting() { return m_isPrinting; }

Expand Down Expand Up @@ -685,9 +680,6 @@ class LayoutTestController : public CppBoundClass {
// Bound variable to return the name of this platform (chromium).
CppVariant m_platformName;

// Bound variable to set whether postMessages should be intercepted or not
CppVariant m_interceptPostMessage;

WebKit::WebURL m_userStyleSheetLocation;

OwnPtr<WebKit::WebSpeechInputControllerMock> m_speechInputControllerMock;
Expand Down
11 changes: 0 additions & 11 deletions Tools/DumpRenderTree/chromium/WebViewHost.cpp
Expand Up @@ -39,7 +39,6 @@
#include "platform/WebCString.h"
#include "WebConsoleMessage.h"
#include "WebContextMenuData.h"
#include "WebDOMMessageEvent.h"
#include "WebDataSource.h"
#include "WebDeviceOrientationClientMock.h"
#include "platform/WebDragData.h"
Expand Down Expand Up @@ -1205,16 +1204,6 @@ void WebViewHost::openFileSystem(WebFrame* frame, WebFileSystem::Type type, long
webkit_support::OpenFileSystem(frame, type, size, create, callbacks);
}

bool WebViewHost::willCheckAndDispatchMessageEvent(WebFrame* source, WebSecurityOrigin target, WebDOMMessageEvent event)
{
if (m_shell->layoutTestController()->shouldInterceptPostMessage()) {
fputs("intercepted postMessage\n", stdout);
return true;
}

return false;
}

// Public functions -----------------------------------------------------------

WebViewHost::WebViewHost(TestShell* shell)
Expand Down
1 change: 0 additions & 1 deletion Tools/DumpRenderTree/chromium/WebViewHost.h
Expand Up @@ -213,7 +213,6 @@ class WebViewHost : public WebKit::WebSpellCheckClient, public WebKit::WebViewCl
virtual void didRunInsecureContent(WebKit::WebFrame*, const WebKit::WebSecurityOrigin&, const WebKit::WebURL&);
virtual void didDetectXSS(WebKit::WebFrame*, const WebKit::WebURL&, bool didBlockEntirePage);
virtual void openFileSystem(WebKit::WebFrame*, WebKit::WebFileSystem::Type, long long size, bool create, WebKit::WebFileSystemCallbacks*);
virtual bool willCheckAndDispatchMessageEvent(WebKit::WebFrame* source, WebKit::WebSecurityOrigin target, WebKit::WebDOMMessageEvent);

WebKit::WebDeviceOrientationClientMock* deviceOrientationClientMock();

Expand Down

0 comments on commit 160dae7

Please sign in to comment.