summaryrefslogtreecommitdiff
path: root/Source/WebKit2/UIProcess/WebIntentData.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit2/UIProcess/WebIntentData.cpp')
-rw-r--r--Source/WebKit2/UIProcess/WebIntentData.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/Source/WebKit2/UIProcess/WebIntentData.cpp b/Source/WebKit2/UIProcess/WebIntentData.cpp
index 96128dbe2..632aa3b75 100644
--- a/Source/WebKit2/UIProcess/WebIntentData.cpp
+++ b/Source/WebKit2/UIProcess/WebIntentData.cpp
@@ -30,16 +30,29 @@
#include "ImmutableArray.h"
#include "ImmutableDictionary.h"
+#include "WebProcessProxy.h"
+#include "WebSerializedScriptValue.h"
#include "WebString.h"
#include "WebURL.h"
namespace WebKit {
-WebIntentData::WebIntentData(const IntentData& store)
+WebIntentData::WebIntentData(const IntentData& store, WebProcessProxy* process)
: m_store(store)
+ , m_process(process)
{
}
+WebIntentData::~WebIntentData()
+{
+ // Remove MessagePortChannels from WebProcess.
+ if (m_process) {
+ size_t numMessagePorts = m_store.messagePorts.size();
+ for (size_t i = 0; i < numMessagePorts; ++i)
+ m_process->removeMessagePortChannel(m_store.messagePorts[i]);
+ }
+}
+
PassRefPtr<WebSerializedScriptValue> WebIntentData::data() const
{
Vector<uint8_t> dataCopy = m_store.data;
@@ -66,6 +79,7 @@ PassRefPtr<ImmutableDictionary> WebIntentData::extras() const
HashMap<String, String>::const_iterator end = m_store.extras.end();
for (HashMap<String, String>::const_iterator it = m_store.extras.begin(); it != end; ++it)
wkExtras.set(it->first, WebString::create(it->second));
+
return ImmutableDictionary::adopt(wkExtras);
}