| Index: third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp
|
| diff --git a/third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp b/third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp
|
| index e7d005333b686f332fb64a173e789ece4d5ca05e..da9c1ca45619f6a3701b3c827e565a967df21928 100644
|
| --- a/third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp
|
| +++ b/third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp
|
| @@ -9,6 +9,7 @@
|
| #include "core/dom/DOMArrayBufferView.h"
|
| #include "core/dom/Document.h"
|
| #include "core/dom/ExceptionCode.h"
|
| +#include "core/dom/ExecutionContextTask.h"
|
| #include "core/events/Event.h"
|
| #include "core/events/MessageEvent.h"
|
| #include "core/fileapi/FileReaderLoader.h"
|
| @@ -191,9 +192,6 @@ PresentationConnection* PresentationConnection::take(
|
| PresentationConnection* connection = new PresentationConnection(
|
| controller->frame(), client->getId(), client->getUrl());
|
| controller->registerConnection(connection);
|
| - request->dispatchEvent(PresentationConnectionAvailableEvent::create(
|
| - EventTypeNames::connectionavailable, connection));
|
| -
|
| return connection;
|
| }
|
|
|
| @@ -415,7 +413,10 @@ void PresentationConnection::didChangeState(
|
| NOTREACHED();
|
| return;
|
| case WebPresentationConnectionState::Connected:
|
| - dispatchEvent(Event::create(EventTypeNames::connect));
|
| + getExecutionContext()->postTask(
|
| + BLINK_FROM_HERE,
|
| + createSameThreadTask(&PresentationConnection::dispatchConnectEvent,
|
| + wrapPersistent(this)));
|
| return;
|
| case WebPresentationConnectionState::Terminated:
|
| dispatchEvent(Event::create(EventTypeNames::terminate));
|
| @@ -464,6 +465,10 @@ void PresentationConnection::didFailLoadingBlob(
|
| handleMessageQueue();
|
| }
|
|
|
| +void PresentationConnection::dispatchConnectEvent() {
|
| + dispatchEvent(Event::create(EventTypeNames::connect));
|
| +}
|
| +
|
| void PresentationConnection::tearDown() {
|
| // Cancel current Blob loading if any.
|
| if (m_blobLoader) {
|
|
|