Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(791)

Unified Diff: Source/core/events/MessageEvent.cpp

Issue 344833002: Oilpan: move MessagePortArray to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/events/MessageEvent.h ('k') | Source/core/frame/LocalDOMWindow.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/events/MessageEvent.cpp
diff --git a/Source/core/events/MessageEvent.cpp b/Source/core/events/MessageEvent.cpp
index 18efe77326218a48d9c089a917ae719d570a9ead..3c7cec44a94d0b55bee8ed89fcbb4749066154d0 100644
--- a/Source/core/events/MessageEvent.cpp
+++ b/Source/core/events/MessageEvent.cpp
@@ -54,13 +54,13 @@ MessageEvent::MessageEvent(const AtomicString& type, const MessageEventInit& ini
, m_origin(initializer.origin)
, m_lastEventId(initializer.lastEventId)
, m_source(isValidSource(initializer.source.get()) ? initializer.source : nullptr)
- , m_ports(adoptPtr(new MessagePortArray(initializer.ports)))
+ , m_ports(adoptPtrWillBeNoop(new MessagePortArray(initializer.ports)))
{
ScriptWrappable::init(this);
ASSERT(isValidSource(m_source.get()));
}
-MessageEvent::MessageEvent(const String& origin, const String& lastEventId, PassRefPtrWillBeRawPtr<EventTarget> source, PassOwnPtr<MessagePortArray> ports)
+MessageEvent::MessageEvent(const String& origin, const String& lastEventId, PassRefPtrWillBeRawPtr<EventTarget> source, PassOwnPtrWillBeRawPtr<MessagePortArray> ports)
: Event(EventTypeNames::message, false, false)
, m_dataType(DataTypeScriptValue)
, m_origin(origin)
@@ -72,7 +72,7 @@ MessageEvent::MessageEvent(const String& origin, const String& lastEventId, Pass
ASSERT(isValidSource(m_source.get()));
}
-MessageEvent::MessageEvent(PassRefPtr<SerializedScriptValue> data, const String& origin, const String& lastEventId, PassRefPtrWillBeRawPtr<EventTarget> source, PassOwnPtr<MessagePortArray> ports)
+MessageEvent::MessageEvent(PassRefPtr<SerializedScriptValue> data, const String& origin, const String& lastEventId, PassRefPtrWillBeRawPtr<EventTarget> source, PassOwnPtrWillBeRawPtr<MessagePortArray> ports)
: Event(EventTypeNames::message, false, false)
, m_dataType(DataTypeSerializedScriptValue)
, m_dataAsSerializedScriptValue(data)
@@ -142,7 +142,7 @@ PassRefPtrWillBeRawPtr<MessageEvent> MessageEvent::create(const AtomicString& ty
return adoptRefWillBeNoop(new MessageEvent(type, initializer));
}
-void MessageEvent::initMessageEvent(const AtomicString& type, bool canBubble, bool cancelable, const String& origin, const String& lastEventId, LocalDOMWindow* source, PassOwnPtr<MessagePortArray> ports)
+void MessageEvent::initMessageEvent(const AtomicString& type, bool canBubble, bool cancelable, const String& origin, const String& lastEventId, LocalDOMWindow* source, PassOwnPtrWillBeRawPtr<MessagePortArray> ports)
{
if (dispatched())
return;
@@ -156,7 +156,7 @@ void MessageEvent::initMessageEvent(const AtomicString& type, bool canBubble, bo
m_ports = ports;
}
-void MessageEvent::initMessageEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<SerializedScriptValue> data, const String& origin, const String& lastEventId, LocalDOMWindow* source, PassOwnPtr<MessagePortArray> ports)
+void MessageEvent::initMessageEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<SerializedScriptValue> data, const String& origin, const String& lastEventId, LocalDOMWindow* source, PassOwnPtrWillBeRawPtr<MessagePortArray> ports)
{
if (dispatched())
return;
@@ -188,6 +188,9 @@ void MessageEvent::trace(Visitor* visitor)
{
visitor->trace(m_dataAsBlob);
visitor->trace(m_source);
+#if ENABLE(OILPAN)
+ visitor->trace(m_ports);
+#endif
Event::trace(visitor);
}
« no previous file with comments | « Source/core/events/MessageEvent.h ('k') | Source/core/frame/LocalDOMWindow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698