diff options
Diffstat (limited to 'src/core/renderer/web_channel_ipc_transport.cpp')
-rw-r--r-- | src/core/renderer/web_channel_ipc_transport.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/core/renderer/web_channel_ipc_transport.cpp b/src/core/renderer/web_channel_ipc_transport.cpp index fff3eb70f..8525c3619 100644 --- a/src/core/renderer/web_channel_ipc_transport.cpp +++ b/src/core/renderer/web_channel_ipc_transport.cpp @@ -259,21 +259,21 @@ void WebChannelIPCTransport::DispatchWebChannelMessage(const std::vector<uint8_t frame->CallFunctionEvenIfScriptDisabled(callback, webChannelObject, 1, argv); } -void WebChannelIPCTransport::WillReleaseScriptContext(v8::Local<v8::Context> context, int worldId) -{ - if (static_cast<uint>(worldId) == m_worldId) - m_canUseContext = false; -} - -void WebChannelIPCTransport::DidClearWindowObject() +void WebChannelIPCTransport::DidCreateScriptContext(v8::Local<v8::Context> context, int32_t worldId) { - if (!m_canUseContext) { + if (static_cast<uint>(worldId) == m_worldId && !m_canUseContext) { m_canUseContext = true; if (m_worldInitialized) WebChannelTransport::Install(render_frame()->GetWebFrame(), m_worldId); } } +void WebChannelIPCTransport::WillReleaseScriptContext(v8::Local<v8::Context> context, int worldId) +{ + if (static_cast<uint>(worldId) == m_worldId) + m_canUseContext = false; +} + void WebChannelIPCTransport::OnDestruct() { delete this; |