Commit 62c83e3c authored by sgurun@chromium.org's avatar sgurun@chromium.org

Remove the deprecated messageevent API

BUG=473258

Message ports were using the source frame's execution context
rather than the targets when ports were transferred from a frame
to another. This seems to be leaky and also creates difficulties
when implementing message port support for android webview
and OOPIF. Use the target instead.

This is patch 3 of 3 and removes the deprecated API.

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

git-svn-id: svn://svn.chromium.org/blink/trunk@200786 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 068dfea7
...@@ -63,16 +63,6 @@ void WebDOMMessageEvent::initMessageEvent(const WebString& type, bool canBubble, ...@@ -63,16 +63,6 @@ void WebDOMMessageEvent::initMessageEvent(const WebString& type, bool canBubble,
unwrap<MessageEvent>()->initMessageEvent(type, canBubble, cancelable, messageData, origin, lastEventId, window, ports); unwrap<MessageEvent>()->initMessageEvent(type, canBubble, cancelable, messageData, origin, lastEventId, window, ports);
} }
void WebDOMMessageEvent::initMessageEvent(const WebString& type, bool canBubble, bool cancelable, const WebSerializedScriptValue& messageData, const WebString& origin, const WebFrame* sourceFrame, const WebString& lastEventId, const WebMessagePortChannelArray& webChannels)
{
WebDocument document;
if (sourceFrame && sourceFrame->isWebLocalFrame()) {
DOMWindow* window = toCoreFrame(sourceFrame)->domWindow();
document = toLocalDOMWindow(window)->document();
}
initMessageEvent(type, canBubble, cancelable, messageData, origin, sourceFrame, document, lastEventId, webChannels);
}
WebSerializedScriptValue WebDOMMessageEvent::data() const WebSerializedScriptValue WebDOMMessageEvent::data() const
{ {
return WebSerializedScriptValue(constUnwrap<MessageEvent>()->dataAsSerializedScriptValue()); return WebSerializedScriptValue(constUnwrap<MessageEvent>()->dataAsSerializedScriptValue());
......
...@@ -44,12 +44,13 @@ namespace blink { ...@@ -44,12 +44,13 @@ namespace blink {
class WebFrame; class WebFrame;
class WebString; class WebString;
// An interface for posting message events to the target frame. The message
// events are used for communication between documents and described here:
// http://www.w3.org/TR/2012/WD-webmessaging-20120313/#terminology
class WebDOMMessageEvent : public WebDOMEvent { class WebDOMMessageEvent : public WebDOMEvent {
public: public:
WebDOMMessageEvent() { } WebDOMMessageEvent() { }
BLINK_EXPORT void initMessageEvent(const WebString& type, bool canBubble, bool cancelable, const WebSerializedScriptValue& messageData, const WebString& origin, const WebFrame* sourceFrame, const WebDocument& targetDocument, const WebString& lastEventId, const WebMessagePortChannelArray& channels = WebMessagePortChannelArray()); BLINK_EXPORT void initMessageEvent(const WebString& type, bool canBubble, bool cancelable, const WebSerializedScriptValue& messageData, const WebString& origin, const WebFrame* sourceFrame, const WebDocument& targetDocument, const WebString& lastEventId, const WebMessagePortChannelArray& channels = WebMessagePortChannelArray());
// DEPRECATED: Use the initMessageEvent method above. This method will be removed.
BLINK_EXPORT void initMessageEvent(const WebString& type, bool canBubble, bool cancelable, const WebSerializedScriptValue& messageData, const WebString& origin, const WebFrame* sourceFrame, const WebString& lastEventId, const WebMessagePortChannelArray& channels = WebMessagePortChannelArray());
BLINK_EXPORT WebSerializedScriptValue data() const; BLINK_EXPORT WebSerializedScriptValue data() const;
BLINK_EXPORT WebString origin() const; BLINK_EXPORT WebString origin() const;
......
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