Diff
Modified: trunk/Source/_javascript_Core/CMakeLists.txt (189339 => 189340)
--- trunk/Source/_javascript_Core/CMakeLists.txt 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/_javascript_Core/CMakeLists.txt 2015-09-04 04:54:09 UTC (rev 189340)
@@ -323,7 +323,6 @@
inspector/InjectedScriptManager.cpp
inspector/InjectedScriptModule.cpp
inspector/InspectorAgentRegistry.cpp
- inspector/InspectorFrontendRouter.cpp
inspector/InspectorBackendDispatcher.cpp
inspector/InspectorValues.cpp
inspector/JSGlobalObjectConsoleClient.cpp
Modified: trunk/Source/_javascript_Core/ChangeLog (189339 => 189340)
--- trunk/Source/_javascript_Core/ChangeLog 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/_javascript_Core/ChangeLog 2015-09-04 04:54:09 UTC (rev 189340)
@@ -1,3 +1,17 @@
+2015-09-03 Commit Queue <[email protected]>
+
+ Unreviewed, rolling out r189338.
+ https://bugs.webkit.org/show_bug.cgi?id=148785
+
+ Caused tons of crashes (Requested by cdumez on #webkit).
+
+ Reverted changeset:
+
+ "Web Inspector: InspectorController should support multiple
+ frontend channels"
+ https://bugs.webkit.org/show_bug.cgi?id=148538
+ http://trac.webkit.org/changeset/189338
+
2015-09-03 Yusuke Suzuki <[email protected]>
[ES6] Instantiate Module Environment bindings and execute module
Modified: trunk/Source/_javascript_Core/_javascript_Core.vcxproj/_javascript_Core.vcxproj (189339 => 189340)
--- trunk/Source/_javascript_Core/_javascript_Core.vcxproj/_javascript_Core.vcxproj 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/_javascript_Core/_javascript_Core.vcxproj/_javascript_Core.vcxproj 2015-09-04 04:54:09 UTC (rev 189340)
@@ -595,7 +595,6 @@
<ClCompile Include="..\inspector\InjectedScriptModule.cpp" />
<ClCompile Include="..\inspector\InspectorAgentRegistry.cpp" />
<ClCompile Include="..\inspector\InspectorBackendDispatcher.cpp" />
- <ClCompile Include="..\inspector\InspectorFrontendRouter.cpp" />
<ClCompile Include="..\inspector\InspectorValues.cpp" />
<ClCompile Include="..\inspector\JSInjectedScriptHost.cpp" />
<ClCompile Include="..\inspector\JSInjectedScriptHostPrototype.cpp" />
@@ -1386,7 +1385,6 @@
<ClInclude Include="..\inspector\InspectorBackendDispatcher.h" />
<ClInclude Include="..\inspector\InspectorEnvironment.h" />
<ClInclude Include="..\inspector\InspectorFrontendChannel.h" />
- <ClInclude Include="..\inspector\InspectorFrontendRouter.h" />
<ClInclude Include="..\inspector\InspectorValues.h" />
<ClInclude Include="..\inspector\JSInjectedScriptHost.h" />
<ClInclude Include="..\inspector\JSInjectedScriptHostPrototype.h" />
Modified: trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj (189339 => 189340)
--- trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj 2015-09-04 04:54:09 UTC (rev 189340)
@@ -1195,8 +1195,6 @@
99E45A2618A1B2590026D88F /* EncodedValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 99E45A2118A1B2590026D88F /* EncodedValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
99E45A2718A1B2590026D88F /* InputCursor.h in Headers */ = {isa = PBXBuildFile; fileRef = 99E45A2218A1B2590026D88F /* InputCursor.h */; settings = {ATTRIBUTES = (Private, ); }; };
99E45A2818A1B2590026D88F /* NondeterministicInput.h in Headers */ = {isa = PBXBuildFile; fileRef = 99E45A2318A1B2590026D88F /* NondeterministicInput.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 99F1A6FE1B8E6D9400463B26 /* InspectorFrontendRouter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 99F1A6FC1B8E6D9400463B26 /* InspectorFrontendRouter.cpp */; };
- 99F1A7011B98FBEC00463B26 /* InspectorFrontendRouter.h in Headers */ = {isa = PBXBuildFile; fileRef = 99F1A7001B98FBEC00463B26 /* InspectorFrontendRouter.h */; settings = {ATTRIBUTES = (Private, ); }; };
9E729407190F01A5001A91B5 /* InitializeThreading.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E178636C0D9BEEC300D74E75 /* InitializeThreading.cpp */; };
9E729408190F021E001A91B5 /* InitializeLLVMPOSIX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FCEFAC51805E75500472CE4 /* InitializeLLVMPOSIX.cpp */; };
9E72940B190F0514001A91B5 /* BundlePath.h in Headers */ = {isa = PBXBuildFile; fileRef = 9E72940A190F0514001A91B5 /* BundlePath.h */; };
@@ -3065,8 +3063,6 @@
99E45A2118A1B2590026D88F /* EncodedValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EncodedValue.h; sourceTree = "<group>"; };
99E45A2218A1B2590026D88F /* InputCursor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InputCursor.h; sourceTree = "<group>"; };
99E45A2318A1B2590026D88F /* NondeterministicInput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NondeterministicInput.h; sourceTree = "<group>"; };
- 99F1A6FC1B8E6D9400463B26 /* InspectorFrontendRouter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorFrontendRouter.cpp; sourceTree = "<group>"; };
- 99F1A7001B98FBEC00463B26 /* InspectorFrontendRouter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorFrontendRouter.h; sourceTree = "<group>"; };
9B4954E81A6640DB002815A6 /* ParserFunctionInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ParserFunctionInfo.h; sourceTree = "<group>"; };
9E729409190F0306001A91B5 /* BundlePath.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = BundlePath.mm; sourceTree = "<group>"; };
9E72940A190F0514001A91B5 /* BundlePath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BundlePath.h; sourceTree = "<group>"; };
@@ -5717,7 +5713,6 @@
A5BA15DF1823409200A82E69 /* inspector */ = {
isa = PBXGroup;
children = (
- 99F1A7001B98FBEC00463B26 /* InspectorFrontendRouter.h */,
A513E5CC185FB992007E95AD /* agents */,
A5EA70E319F5B0E20098F5EC /* augmentable */,
A532438D185696CA002ED692 /* protocol */,
@@ -5749,7 +5744,6 @@
A593CF7B1840360300BFCE27 /* InspectorBackendDispatcher.h */,
A5D0A1BA1862301B00C7B496 /* InspectorEnvironment.h */,
A5945594182479EB00CC3843 /* InspectorFrontendChannel.h */,
- 99F1A6FC1B8E6D9400463B26 /* InspectorFrontendRouter.cpp */,
A55D93AB18514F7900400DED /* InspectorProtocolTypes.h */,
A593CF801840377100BFCE27 /* InspectorValues.cpp */,
A593CF811840377100BFCE27 /* InspectorValues.h */,
@@ -5913,7 +5907,6 @@
A1A009C11831A26E00CF8711 /* ARM64Assembler.h in Headers */,
0F898F321B27689F0083A33C /* DFGIntegerRangeOptimizationPhase.h in Headers */,
86D3B2C410156BDE002865E7 /* ARMAssembler.h in Headers */,
- 99F1A7011B98FBEC00463B26 /* InspectorFrontendRouter.h in Headers */,
7964656A1B952FF0003059EE /* GetPutInfo.h in Headers */,
797E07AA1B8FCFB9008400BA /* JSGlobalLexicalEnvironment.h in Headers */,
0FE050281AA9095600D33B33 /* ScopedArguments.h in Headers */,
@@ -7948,7 +7941,6 @@
C225494315F7DBAA0065E898 /* SlotVisitor.cpp in Sources */,
9330402C0E6A764000786E6A /* SmallStrings.cpp in Sources */,
E3EF88741B66DF23003F26CB /* JSPropertyNameIterator.cpp in Sources */,
- 99F1A6FE1B8E6D9400463B26 /* InspectorFrontendRouter.cpp in Sources */,
0F8F2B9E17306C8D007DBDA5 /* SourceCode.cpp in Sources */,
0F493AFA16D0CAD30084508B /* SourceProvider.cpp in Sources */,
E33E8D1C1B9013C300346B52 /* JSNativeStdFunction.cpp in Sources */,
Modified: trunk/Source/_javascript_Core/inspector/InspectorBackendDispatcher.cpp (189339 => 189340)
--- trunk/Source/_javascript_Core/inspector/InspectorBackendDispatcher.cpp 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/_javascript_Core/inspector/InspectorBackendDispatcher.cpp 2015-09-04 04:54:09 UTC (rev 189340)
@@ -28,7 +28,6 @@
#include "InspectorBackendDispatcher.h"
#include "InspectorFrontendChannel.h"
-#include "InspectorFrontendRouter.h"
#include "InspectorValues.h"
#include <wtf/TemporaryChange.h>
#include <wtf/text/CString.h>
@@ -36,15 +35,6 @@
namespace Inspector {
-SupplementalBackendDispatcher::SupplementalBackendDispatcher(BackendDispatcher& backendDispatcher)
- : m_backendDispatcher(backendDispatcher)
-{
-}
-
-SupplementalBackendDispatcher::~SupplementalBackendDispatcher()
-{
-}
-
BackendDispatcher::CallbackBase::CallbackBase(Ref<BackendDispatcher>&& backendDispatcher, long requestId)
: m_backendDispatcher(WTF::move(backendDispatcher))
, m_requestId(requestId)
@@ -79,28 +69,15 @@
m_backendDispatcher->sendResponse(m_requestId, WTF::move(partialMessage));
}
-BackendDispatcher::BackendDispatcher(Ref<FrontendRouter>&& router)
- : m_frontendRouter(WTF::move(router))
+Ref<BackendDispatcher> BackendDispatcher::create(FrontendChannel* frontendChannel)
{
+ return adoptRef(*new BackendDispatcher(frontendChannel));
}
-Ref<BackendDispatcher> BackendDispatcher::create(Ref<FrontendRouter>&& router)
-{
- return adoptRef(*new BackendDispatcher(WTF::move(router)));
-}
-
-bool BackendDispatcher::isActive() const
-{
- return m_frontendRouter->hasFrontends();
-}
-
void BackendDispatcher::registerDispatcherForDomain(const String& domain, SupplementalBackendDispatcher* dispatcher)
{
- ASSERT_ARG(dispatcher, dispatcher);
-
- // FIXME: <https://webkit.org/b/148492> Agents should only register with the backend once,
- // and we should re-add the assertion that only one dispatcher is registered per domain.
- m_dispatchers.set(domain, dispatcher);
+ auto result = m_dispatchers.add(domain, dispatcher);
+ ASSERT_UNUSED(result, result.isNewEntry);
}
void BackendDispatcher::dispatch(const String& message)
@@ -188,6 +165,9 @@
void BackendDispatcher::sendResponse(long requestId, RefPtr<InspectorObject>&& result)
{
+ if (!m_frontendChannel)
+ return;
+
ASSERT(!m_protocolErrors.size());
// The JSON-RPC 2.0 specification requires that the "error" member have the value 'null'
@@ -195,7 +175,7 @@
Ref<InspectorObject> responseMessage = InspectorObject::create();
responseMessage->setObject(ASCIILiteral("result"), result);
responseMessage->setInteger(ASCIILiteral("id"), requestId);
- m_frontendRouter->sendResponse(responseMessage->toJSONString());
+ m_frontendChannel->sendMessageToFrontend(responseMessage->toJSONString());
}
void BackendDispatcher::sendPendingErrors()
@@ -210,6 +190,9 @@
-32000, // ServerError
};
+ if (!m_frontendChannel)
+ return;
+
// To construct the error object, only use the last error's code and message.
// Per JSON-RPC 2.0, Section 5.1, the 'data' member may contain nested errors,
// but only one top-level Error object should be sent per request.
@@ -244,7 +227,7 @@
message->setValue(ASCIILiteral("id"), InspectorValue::null());
}
- m_frontendRouter->sendResponse(message->toJSONString());
+ m_frontendChannel->sendMessageToFrontend(message->toJSONString());
m_protocolErrors.clear();
m_currentRequestId = Nullopt;
Modified: trunk/Source/_javascript_Core/inspector/InspectorBackendDispatcher.h (189339 => 189340)
--- trunk/Source/_javascript_Core/inspector/InspectorBackendDispatcher.h 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/_javascript_Core/inspector/InspectorBackendDispatcher.h 2015-09-04 04:54:09 UTC (rev 189340)
@@ -35,14 +35,15 @@
namespace Inspector {
class BackendDispatcher;
-class FrontendRouter;
+class FrontendChannel;
typedef String ErrorString;
class SupplementalBackendDispatcher : public RefCounted<SupplementalBackendDispatcher> {
public:
- SupplementalBackendDispatcher(BackendDispatcher&);
- virtual ~SupplementalBackendDispatcher();
+ SupplementalBackendDispatcher(BackendDispatcher& backendDispatcher)
+ : m_backendDispatcher(backendDispatcher) { }
+ virtual ~SupplementalBackendDispatcher() { }
virtual void dispatch(long requestId, const String& method, Ref<InspectorObject>&& message) = 0;
protected:
Ref<BackendDispatcher> m_backendDispatcher;
@@ -50,7 +51,7 @@
class BackendDispatcher : public RefCounted<BackendDispatcher> {
public:
- JS_EXPORT_PRIVATE static Ref<BackendDispatcher> create(Ref<FrontendRouter>&&);
+ JS_EXPORT_PRIVATE static Ref<BackendDispatcher> create(FrontendChannel*);
class JS_EXPORT_PRIVATE CallbackBase : public RefCounted<CallbackBase> {
public:
@@ -68,7 +69,8 @@
bool m_alreadySent { false };
};
- bool isActive() const;
+ void clearFrontend() { m_frontendChannel = nullptr; }
+ bool isActive() const { return !!m_frontendChannel; }
bool hasProtocolErrors() const { return m_protocolErrors.size() > 0; }
@@ -102,9 +104,12 @@
RefPtr<InspectorArray> getArray(InspectorObject*, const String& name, bool* valueFound);
private:
- BackendDispatcher(Ref<FrontendRouter>&&);
+ BackendDispatcher(FrontendChannel* channel)
+ : m_frontendChannel(channel)
+ {
+ }
- Ref<FrontendRouter> m_frontendRouter;
+ FrontendChannel* m_frontendChannel;
HashMap<String, SupplementalBackendDispatcher*> m_dispatchers;
// Protocol errors reported for the top-level request being processed.
Deleted: trunk/Source/_javascript_Core/inspector/InspectorFrontendRouter.cpp (189339 => 189340)
--- trunk/Source/_javascript_Core/inspector/InspectorFrontendRouter.cpp 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/_javascript_Core/inspector/InspectorFrontendRouter.cpp 2015-09-04 04:54:09 UTC (rev 189340)
@@ -1,110 +0,0 @@
-/*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "InspectorFrontendRouter.h"
-
-#include "InspectorFrontendChannel.h"
-#include <wtf/Assertions.h>
-
-namespace Inspector {
-
-Ref<FrontendRouter> FrontendRouter::create()
-{
- return adoptRef(*new FrontendRouter);
-}
-
-void FrontendRouter::connectFrontend(FrontendChannel* connection)
-{
- ASSERT_ARG(connection, connection);
-
- if (m_connections.contains(connection)) {
- ASSERT_NOT_REACHED();
- return;
- }
-
- m_connections.append(connection);
-}
-
-void FrontendRouter::disconnectFrontend(FrontendChannel* connection)
-{
- ASSERT_ARG(connection, connection);
-
- if (!m_connections.contains(connection)) {
- ASSERT_NOT_REACHED();
- return;
- }
-
- m_connections.removeFirst(connection);
-}
-
-void FrontendRouter::disconnectAllFrontends()
-{
- m_connections.clear();
-}
-
-// FIXME: <https://webkit.org/b/148492> remove this method once agents move to using FrontendRouter directly.
-FrontendChannel* FrontendRouter::leakChannel() const
-{
- if (m_connections.size())
- return m_connections.at(0);
-
- return nullptr;
-}
-
-bool FrontendRouter::hasLocalFrontend() const
-{
- for (auto* connection : m_connections) {
- if (connection->connectionType() == FrontendChannel::ConnectionType::Local)
- return true;
- }
-
- return false;
-}
-
-bool FrontendRouter::hasRemoteFrontend() const
-{
- for (auto* connection : m_connections) {
- if (connection->connectionType() == FrontendChannel::ConnectionType::Remote)
- return true;
- }
-
- return false;
-}
-
-void FrontendRouter::sendEvent(const String& message) const
-{
- for (auto* connection : m_connections)
- connection->sendMessageToFrontend(message);
-}
-
-void FrontendRouter::sendResponse(const String& message) const
-{
- // FIXME: send responses to the appropriate frontend.
- for (auto* connection : m_connections)
- connection->sendMessageToFrontend(message);
-}
-
-} // namespace Inspector
Deleted: trunk/Source/_javascript_Core/inspector/InspectorFrontendRouter.h (189339 => 189340)
--- trunk/Source/_javascript_Core/inspector/InspectorFrontendRouter.h 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/_javascript_Core/inspector/InspectorFrontendRouter.h 2015-09-04 04:54:09 UTC (rev 189340)
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef InspectorFrontendRouter_h
-#define InspectorFrontendRouter_h
-
-#include <wtf/Vector.h>
-#include <wtf/text/WTFString.h>
-
-namespace Inspector {
-
-class FrontendChannel;
-
-class JS_EXPORT_PRIVATE FrontendRouter : public RefCounted<FrontendRouter> {
-public:
- static Ref<FrontendRouter> create();
-
- bool hasFrontends() const { return !m_connections.isEmpty(); }
- bool hasLocalFrontend() const;
- bool hasRemoteFrontend() const;
-
- void connectFrontend(FrontendChannel*);
- void disconnectFrontend(FrontendChannel*);
- void disconnectAllFrontends();
-
- // FIXME: <https://webkit.org/b/148492> remove this method once agents move to using FrontendRouter directly.
- FrontendChannel* leakChannel() const;
-
- void sendEvent(const String& message) const;
- void sendResponse(const String& message) const;
-
-private:
- Vector<FrontendChannel*, 2> m_connections;
-};
-
-} // namespace Inspector
-
-#endif // !defined(InspectorFrontendRouter_h)
Modified: trunk/Source/_javascript_Core/inspector/JSGlobalObjectInspectorController.cpp (189339 => 189340)
--- trunk/Source/_javascript_Core/inspector/JSGlobalObjectInspectorController.cpp 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/_javascript_Core/inspector/JSGlobalObjectInspectorController.cpp 2015-09-04 04:54:09 UTC (rev 189340)
@@ -35,7 +35,6 @@
#include "InspectorAgent.h"
#include "InspectorBackendDispatcher.h"
#include "InspectorFrontendChannel.h"
-#include "InspectorFrontendRouter.h"
#include "JSGlobalObject.h"
#include "JSGlobalObjectConsoleAgent.h"
#include "JSGlobalObjectConsoleClient.h"
@@ -64,8 +63,7 @@
JSGlobalObjectInspectorController::JSGlobalObjectInspectorController(JSGlobalObject& globalObject)
: m_globalObject(globalObject)
, m_injectedScriptManager(std::make_unique<InjectedScriptManager>(*this, InjectedScriptHost::create()))
- , m_frontendRouter(FrontendRouter::create())
- , m_backendDispatcher(BackendDispatcher::create(m_frontendRouter.copyRef()))
+ , m_frontendChannel(nullptr)
, m_executionStopwatch(Stopwatch::create())
, m_includeNativeCallStackWithExceptions(true)
, m_isAutomaticInspection(false)
@@ -100,25 +98,23 @@
void JSGlobalObjectInspectorController::globalObjectDestroyed()
{
- disconnectAllFrontends();
+ disconnectFrontend(DisconnectReason::InspectedTargetDestroyed);
m_injectedScriptManager->disconnect();
}
void JSGlobalObjectInspectorController::connectFrontend(FrontendChannel* frontendChannel, bool isAutomaticInspection)
{
- ASSERT_ARG(frontendChannel, frontendChannel);
+ ASSERT(!m_frontendChannel);
+ ASSERT(!m_backendDispatcher);
m_isAutomaticInspection = isAutomaticInspection;
- bool connectedFirstFrontend = !m_frontendRouter->hasFrontends();
- m_frontendRouter->connectFrontend(frontendChannel);
+ m_frontendChannel = frontendChannel;
+ m_backendDispatcher = BackendDispatcher::create(frontendChannel);
- if (!connectedFirstFrontend)
- return;
+ m_agents.didCreateFrontendAndBackend(frontendChannel, m_backendDispatcher.get());
- m_agents.didCreateFrontendAndBackend(frontendChannel, &m_backendDispatcher.get());
-
#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
m_inspectorAgent->activateExtraDomains(m_agents.extraDomains());
@@ -127,32 +123,17 @@
#endif
}
-void JSGlobalObjectInspectorController::disconnectFrontend(FrontendChannel* frontendChannel)
+void JSGlobalObjectInspectorController::disconnectFrontend(DisconnectReason reason)
{
- ASSERT_ARG(frontendChannel, frontendChannel);
-
- m_agents.willDestroyFrontendAndBackend(DisconnectReason::InspectorDestroyed);
-
- m_frontendRouter->disconnectFrontend(frontendChannel);
-
- m_isAutomaticInspection = false;
-
- bool disconnectedLastFrontend = !m_frontendRouter->hasFrontends();
- if (!disconnectedLastFrontend)
+ if (!m_frontendChannel)
return;
-#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
- if (m_augmentingClient)
- m_augmentingClient->inspectorDisconnected();
-#endif
-}
+ m_agents.willDestroyFrontendAndBackend(reason);
-void JSGlobalObjectInspectorController::disconnectAllFrontends()
-{
- m_agents.willDestroyFrontendAndBackend(DisconnectReason::InspectedTargetDestroyed);
+ m_backendDispatcher->clearFrontend();
+ m_backendDispatcher = nullptr;
+ m_frontendChannel = nullptr;
- m_frontendRouter->disconnectAllFrontends();
-
m_isAutomaticInspection = false;
#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
@@ -163,11 +144,15 @@
void JSGlobalObjectInspectorController::dispatchMessageFromFrontend(const String& message)
{
- m_backendDispatcher->dispatch(message);
+ if (m_backendDispatcher)
+ m_backendDispatcher->dispatch(message);
}
void JSGlobalObjectInspectorController::pause()
{
+ if (!m_frontendChannel)
+ return;
+
ErrorString dummyError;
m_debuggerAgent->enable(dummyError);
m_debuggerAgent->pause(dummyError);
@@ -277,11 +262,13 @@
{
String domainName = agent->domainName();
- agent->didCreateFrontendAndBackend(m_frontendRouter->leakChannel(), &m_backendDispatcher.get());
+ if (m_frontendChannel)
+ agent->didCreateFrontendAndBackend(m_frontendChannel, m_backendDispatcher.get());
m_agents.appendExtraAgent(WTF::move(agent));
- m_inspectorAgent->activateExtraDomain(domainName);
+ if (m_frontendChannel)
+ m_inspectorAgent->activateExtraDomain(domainName);
}
#endif
Modified: trunk/Source/_javascript_Core/inspector/JSGlobalObjectInspectorController.h (189339 => 189340)
--- trunk/Source/_javascript_Core/inspector/JSGlobalObjectInspectorController.h 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/_javascript_Core/inspector/JSGlobalObjectInspectorController.h 2015-09-04 04:54:09 UTC (rev 189340)
@@ -53,7 +53,6 @@
class BackendDispatcher;
class FrontendChannel;
-class FrontendRouter;
class InjectedScriptManager;
class InspectorAgent;
class InspectorConsoleAgent;
@@ -74,9 +73,7 @@
~JSGlobalObjectInspectorController();
void connectFrontend(FrontendChannel*, bool isAutomaticInspection);
- void disconnectFrontend(FrontendChannel*);
- void disconnectAllFrontends();
-
+ void disconnectFrontend(DisconnectReason);
void dispatchMessageFromFrontend(const String&);
void globalObjectDestroyed();
@@ -102,7 +99,7 @@
virtual AugmentableInspectorControllerClient* augmentableInspectorControllerClient() const override { return m_augmentingClient; }
virtual void setAugmentableInspectorControllerClient(AugmentableInspectorControllerClient* client) override { m_augmentingClient = client; }
- virtual const FrontendRouter& frontendRouter() const override { return m_frontendRouter.get(); }
+ virtual FrontendChannel* frontendChannel() const override { return m_frontendChannel; }
virtual void appendExtraAgent(std::unique_ptr<InspectorAgentBase>) override;
#endif
@@ -116,8 +113,8 @@
InspectorConsoleAgent* m_consoleAgent;
InspectorDebuggerAgent* m_debuggerAgent;
AgentRegistry m_agents;
- Ref<FrontendRouter> m_frontendRouter;
- Ref<BackendDispatcher> m_backendDispatcher;
+ FrontendChannel* m_frontendChannel;
+ RefPtr<BackendDispatcher> m_backendDispatcher;
Ref<WTF::Stopwatch> m_executionStopwatch;
bool m_includeNativeCallStackWithExceptions;
bool m_isAutomaticInspection;
Modified: trunk/Source/_javascript_Core/inspector/agents/InspectorAgent.cpp (189339 => 189340)
--- trunk/Source/_javascript_Core/inspector/agents/InspectorAgent.cpp 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/_javascript_Core/inspector/agents/InspectorAgent.cpp 2015-09-04 04:54:09 UTC (rev 189340)
@@ -32,7 +32,6 @@
#include "InspectorAgent.h"
#include "InspectorEnvironment.h"
-#include "InspectorFrontendRouter.h"
#include "InspectorValues.h"
#include "ScriptValue.h"
Modified: trunk/Source/_javascript_Core/inspector/agents/InspectorConsoleAgent.cpp (189339 => 189340)
--- trunk/Source/_javascript_Core/inspector/agents/InspectorConsoleAgent.cpp 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/_javascript_Core/inspector/agents/InspectorConsoleAgent.cpp 2015-09-04 04:54:09 UTC (rev 189340)
@@ -28,7 +28,6 @@
#include "ConsoleMessage.h"
#include "InjectedScriptManager.h"
-#include "InspectorFrontendRouter.h"
#include "ScriptArguments.h"
#include "ScriptCallFrame.h"
#include "ScriptCallStack.h"
Modified: trunk/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.cpp (189339 => 189340)
--- trunk/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.cpp 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.cpp 2015-09-04 04:54:09 UTC (rev 189340)
@@ -33,7 +33,6 @@
#include "ContentSearchUtilities.h"
#include "InjectedScript.h"
#include "InjectedScriptManager.h"
-#include "InspectorFrontendRouter.h"
#include "InspectorValues.h"
#include "RegularExpression.h"
#include "ScriptDebugServer.h"
Modified: trunk/Source/_javascript_Core/inspector/agents/InspectorRuntimeAgent.cpp (189339 => 189340)
--- trunk/Source/_javascript_Core/inspector/agents/InspectorRuntimeAgent.cpp 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/_javascript_Core/inspector/agents/InspectorRuntimeAgent.cpp 2015-09-04 04:54:09 UTC (rev 189340)
@@ -37,7 +37,6 @@
#include "HeapIterationScope.h"
#include "InjectedScript.h"
#include "InjectedScriptManager.h"
-#include "InspectorFrontendRouter.h"
#include "InspectorValues.h"
#include "JSLock.h"
#include "ParserError.h"
Modified: trunk/Source/_javascript_Core/inspector/augmentable/AugmentableInspectorController.h (189339 => 189340)
--- trunk/Source/_javascript_Core/inspector/augmentable/AugmentableInspectorController.h 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/_javascript_Core/inspector/augmentable/AugmentableInspectorController.h 2015-09-04 04:54:09 UTC (rev 189340)
@@ -29,7 +29,7 @@
#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
#include <_javascript_Core/AugmentableInspectorControllerClient.h>
-#include <_javascript_Core/InspectorFrontendRouter.h>
+#include <_javascript_Core/InspectorFrontendChannel.h>
namespace Inspector {
@@ -42,10 +42,10 @@
virtual AugmentableInspectorControllerClient* augmentableInspectorControllerClient() const = 0;
virtual void setAugmentableInspectorControllerClient(AugmentableInspectorControllerClient*) = 0;
- virtual const FrontendRouter& frontendRouter() const = 0;
+ virtual FrontendChannel* frontendChannel() const = 0;
virtual void appendExtraAgent(std::unique_ptr<InspectorAgentBase>) = 0;
- bool connected() const { return frontendRouter().hasFrontends(); }
+ bool connected() const { return !!frontendChannel(); }
};
} // namespace Inspector
Modified: trunk/Source/_javascript_Core/inspector/remote/RemoteInspectorDebuggable.h (189339 => 189340)
--- trunk/Source/_javascript_Core/inspector/remote/RemoteInspectorDebuggable.h 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/_javascript_Core/inspector/remote/RemoteInspectorDebuggable.h 2015-09-04 04:54:09 UTC (rev 189340)
@@ -64,7 +64,7 @@
virtual bool hasLocalDebugger() const = 0;
virtual void connect(FrontendChannel*, bool isAutomaticInspection) = 0;
- virtual void disconnect(FrontendChannel*) = 0;
+ virtual void disconnect() = 0;
virtual void dispatchMessageFromRemoteFrontend(const String& message) = 0;
virtual void setIndicating(bool) { } // Default is to do nothing.
virtual void pause() { };
Modified: trunk/Source/_javascript_Core/inspector/remote/RemoteInspectorDebuggableConnection.mm (189339 => 189340)
--- trunk/Source/_javascript_Core/inspector/remote/RemoteInspectorDebuggableConnection.mm 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/_javascript_Core/inspector/remote/RemoteInspectorDebuggableConnection.mm 2015-09-04 04:54:09 UTC (rev 189340)
@@ -191,7 +191,7 @@
if (m_debuggable) {
if (m_connected)
- m_debuggable->disconnect(this);
+ m_debuggable->disconnect();
m_debuggable = nullptr;
}
Modified: trunk/Source/_javascript_Core/inspector/scripts/codegen/generate_cpp_alternate_backend_dispatcher_header.py (189339 => 189340)
--- trunk/Source/_javascript_Core/inspector/scripts/codegen/generate_cpp_alternate_backend_dispatcher_header.py 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/_javascript_Core/inspector/scripts/codegen/generate_cpp_alternate_backend_dispatcher_header.py 2015-09-04 04:54:09 UTC (rev 189340)
@@ -47,7 +47,6 @@
def generate_output(self):
headers = [
'"InspectorProtocolTypes.h"',
- '<inspector/InspectorFrontendRouter.h>',
'<_javascript_Core/InspectorBackendDispatcher.h>',
]
Modified: trunk/Source/_javascript_Core/inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py (189339 => 189340)
--- trunk/Source/_javascript_Core/inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/_javascript_Core/inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py 2015-09-04 04:54:09 UTC (rev 189340)
@@ -50,7 +50,6 @@
def generate_output(self):
secondary_headers = [
'<inspector/InspectorFrontendChannel.h>',
- '<inspector/InspectorFrontendRouter.h>',
'<inspector/InspectorValues.h>',
'<wtf/NeverDestroyed.h>',
'<wtf/text/CString.h>']
Modified: trunk/Source/_javascript_Core/inspector/scripts/codegen/generate_objc_frontend_dispatcher_implementation.py (189339 => 189340)
--- trunk/Source/_javascript_Core/inspector/scripts/codegen/generate_objc_frontend_dispatcher_implementation.py 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/_javascript_Core/inspector/scripts/codegen/generate_objc_frontend_dispatcher_implementation.py 2015-09-04 04:54:09 UTC (rev 189340)
@@ -98,7 +98,9 @@
lines = []
lines.append(self._generate_event_signature(domain, event))
lines.append('{')
- lines.append(' const FrontendRouter& router = _controller->frontendRouter();')
+ lines.append(' FrontendChannel* frontendChannel = _controller->frontendChannel();')
+ lines.append(' if (!frontendChannel)')
+ lines.append(' return;')
lines.append('')
required_pointer_parameters = filter(lambda parameter: not parameter.is_optional and ObjCGenerator.is_type_objc_pointer_type(parameter.type), event.event_parameters)
@@ -124,7 +126,7 @@
lines.append(' jsonMessage->setString(ASCIILiteral("method"), ASCIILiteral("%s.%s"));' % (domain.domain_name, event.event_name))
if event.event_parameters:
lines.extend(self._generate_event_out_parameters(domain, event))
- lines.append(' router.sendEvent(jsonMessage->toJSONString());')
+ lines.append(' frontendChannel->sendMessageToFrontend(jsonMessage->toJSONString());')
lines.append('}')
return '\n'.join(lines)
Modified: trunk/Source/_javascript_Core/runtime/JSGlobalObjectDebuggable.cpp (189339 => 189340)
--- trunk/Source/_javascript_Core/runtime/JSGlobalObjectDebuggable.cpp 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalObjectDebuggable.cpp 2015-09-04 04:54:09 UTC (rev 189340)
@@ -56,11 +56,11 @@
m_globalObject.inspectorController().connectFrontend(frontendChannel, automaticInspection);
}
-void JSGlobalObjectDebuggable::disconnect(FrontendChannel* frontendChannel)
+void JSGlobalObjectDebuggable::disconnect()
{
JSLockHolder locker(&m_globalObject.vm());
- m_globalObject.inspectorController().disconnectFrontend(frontendChannel);
+ m_globalObject.inspectorController().disconnectFrontend(DisconnectReason::InspectorDestroyed);
}
void JSGlobalObjectDebuggable::pause()
Modified: trunk/Source/_javascript_Core/runtime/JSGlobalObjectDebuggable.h (189339 => 189340)
--- trunk/Source/_javascript_Core/runtime/JSGlobalObjectDebuggable.h 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalObjectDebuggable.h 2015-09-04 04:54:09 UTC (rev 189340)
@@ -54,7 +54,7 @@
virtual bool hasLocalDebugger() const override { return false; }
virtual void connect(Inspector::FrontendChannel*, bool automaticInspection) override;
- virtual void disconnect(Inspector::FrontendChannel*) override;
+ virtual void disconnect() override;
virtual void dispatchMessageFromRemoteFrontend(const String& message) override;
virtual void pause() override;
Modified: trunk/Source/WebCore/ChangeLog (189339 => 189340)
--- trunk/Source/WebCore/ChangeLog 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/WebCore/ChangeLog 2015-09-04 04:54:09 UTC (rev 189340)
@@ -1,3 +1,17 @@
+2015-09-03 Commit Queue <[email protected]>
+
+ Unreviewed, rolling out r189338.
+ https://bugs.webkit.org/show_bug.cgi?id=148785
+
+ Caused tons of crashes (Requested by cdumez on #webkit).
+
+ Reverted changeset:
+
+ "Web Inspector: InspectorController should support multiple
+ frontend channels"
+ https://bugs.webkit.org/show_bug.cgi?id=148538
+ http://trac.webkit.org/changeset/189338
+
2015-09-03 Brian Burg <[email protected]>
Web Inspector: InspectorController should support multiple frontend channels
Deleted: trunk/Source/WebCore/ForwardingHeaders/inspector/InspectorFrontendRouter.h (189339 => 189340)
--- trunk/Source/WebCore/ForwardingHeaders/inspector/InspectorFrontendRouter.h 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/WebCore/ForwardingHeaders/inspector/InspectorFrontendRouter.h 2015-09-04 04:54:09 UTC (rev 189340)
@@ -1,4 +0,0 @@
-#ifndef WebCore_FWD_InspectorFrontendRouter_h
-#define WebCore_FWD_InspectorFrontendRouter_h
-#include <_javascript_Core/InspectorFrontendRouter.h>
-#endif
Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (189339 => 189340)
--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj 2015-09-04 04:54:09 UTC (rev 189340)
@@ -20336,7 +20336,6 @@
<ClInclude Include="..\ForwardingHeaders\inspector\InspectorBackendDispatcher.h" />
<ClInclude Include="..\ForwardingHeaders\inspector\InspectorEnvironment.h" />
<ClInclude Include="..\ForwardingHeaders\inspector\InspectorFrontendChannel.h" />
- <ClInclude Include="..\ForwardingHeaders\inspector\InspectorFrontendRouter.h" />
<ClInclude Include="..\ForwardingHeaders\inspector\InspectorBackendDispatchers.h" />
<ClInclude Include="..\ForwardingHeaders\inspector\InspectorFrontendDispatchers.h" />
<ClInclude Include="..\ForwardingHeaders\inspector\InspectorProtocolObjects.h" />
Modified: trunk/Source/WebCore/inspector/InspectorClient.h (189339 => 189340)
--- trunk/Source/WebCore/inspector/InspectorClient.h 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/WebCore/inspector/InspectorClient.h 2015-09-04 04:54:09 UTC (rev 189340)
@@ -27,14 +27,11 @@
#ifndef InspectorClient_h
#define InspectorClient_h
+#include "InspectorForwarding.h"
#include <wtf/Forward.h>
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
-namespace Inspector {
-class FrontendChannel;
-}
-
namespace WebCore {
class FloatRect;
@@ -48,7 +45,7 @@
virtual void inspectorDestroyed() = 0;
- virtual Inspector::FrontendChannel* openInspectorFrontend(InspectorController*) = 0;
+ virtual InspectorFrontendChannel* openInspectorFrontend(InspectorController*) = 0;
virtual void closeInspectorFrontend() = 0;
virtual void bringFrontendToFront() = 0;
virtual void didResizeMainFrame(Frame*) { }
Modified: trunk/Source/WebCore/inspector/InspectorController.cpp (189339 => 189340)
--- trunk/Source/WebCore/inspector/InspectorController.cpp 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/WebCore/inspector/InspectorController.cpp 2015-09-04 04:54:09 UTC (rev 189340)
@@ -68,7 +68,6 @@
#include <inspector/InspectorBackendDispatcher.h>
#include <inspector/InspectorBackendDispatchers.h>
#include <inspector/InspectorFrontendDispatchers.h>
-#include <inspector/InspectorFrontendRouter.h>
#include <inspector/agents/InspectorAgent.h>
#include <profiler/LegacyProfiler.h>
#include <runtime/JSLock.h>
@@ -86,8 +85,6 @@
InspectorController::InspectorController(Page& page, InspectorClient* inspectorClient)
: m_instrumentingAgents(InstrumentingAgents::create(*this))
, m_injectedScriptManager(std::make_unique<WebInjectedScriptManager>(*this, WebInjectedScriptHost::create()))
- , m_frontendRouter(FrontendRouter::create())
- , m_backendDispatcher(BackendDispatcher::create(m_frontendRouter.copyRef()))
, m_overlay(std::make_unique<InspectorOverlay>(page, inspectorClient))
, m_executionStopwatch(Stopwatch::create())
, m_page(page)
@@ -180,8 +177,7 @@
void InspectorController::inspectedPageDestroyed()
{
- disconnectAllFrontends();
-
+ disconnectFrontend(DisconnectReason::InspectedTargetDestroyed);
m_injectedScriptManager->disconnect();
m_inspectorClient->inspectorDestroyed();
m_inspectorClient = nullptr;
@@ -194,12 +190,12 @@
bool InspectorController::hasLocalFrontend() const
{
- return m_frontendRouter->hasLocalFrontend();
+ return m_frontendChannel && m_frontendChannel->connectionType() == FrontendChannel::ConnectionType::Local;
}
bool InspectorController::hasRemoteFrontend() const
{
- return m_frontendRouter->hasRemoteFrontend();
+ return m_frontendChannel && m_frontendChannel->connectionType() == FrontendChannel::ConnectionType::Remote;
}
bool InspectorController::hasInspectorFrontendClient() const
@@ -223,96 +219,74 @@
void InspectorController::connectFrontend(Inspector::FrontendChannel* frontendChannel, bool isAutomaticInspection)
{
- ASSERT_ARG(frontendChannel, frontendChannel);
+ ASSERT(frontendChannel);
ASSERT(m_inspectorClient);
+ ASSERT(!m_frontendChannel);
+ ASSERT(!m_backendDispatcher);
- bool connectedFirstFrontend = !m_frontendRouter->hasFrontends();
m_isAutomaticInspection = isAutomaticInspection;
- m_frontendRouter->connectFrontend(frontendChannel);
+ m_frontendChannel = frontendChannel;
+ m_backendDispatcher = BackendDispatcher::create(frontendChannel);
+ m_agents.didCreateFrontendAndBackend(frontendChannel, m_backendDispatcher.get());
+
+ InspectorInstrumentation::registerInstrumentingAgents(m_instrumentingAgents.get());
InspectorInstrumentation::frontendCreated();
- if (connectedFirstFrontend) {
- InspectorInstrumentation::registerInstrumentingAgents(m_instrumentingAgents.get());
- m_agents.didCreateFrontendAndBackend(frontendChannel, &m_backendDispatcher.get());
- }
-
#if ENABLE(REMOTE_INSPECTOR)
- if (!m_frontendRouter->hasRemoteFrontend())
+ if (!hasRemoteFrontend())
m_page.remoteInspectorInformationDidChange();
#endif
}
-void InspectorController::disconnectFrontend(FrontendChannel* frontendChannel)
+void InspectorController::disconnectFrontend(DisconnectReason reason)
{
- // The local frontend client should be disconnected first so it stops sending messages.
- ASSERT(!m_frontendRouter->hasLocalFrontend() || !m_inspectorFrontendClient);
+ if (!m_frontendChannel)
+ return;
- m_frontendRouter->disconnectFrontend(frontendChannel);
- m_isAutomaticInspection = false;
-
- InspectorInstrumentation::frontendDeleted();
-
- bool disconnectedLastFrontend = !m_frontendRouter->hasFrontends();
- if (disconnectedLastFrontend) {
- // Release overlay page resources.
- m_overlay->freePage();
- m_agents.willDestroyFrontendAndBackend(DisconnectReason::InspectorDestroyed);
- InspectorInstrumentation::unregisterInstrumentingAgents(m_instrumentingAgents.get());
- }
-
#if ENABLE(REMOTE_INSPECTOR)
- if (!m_frontendRouter->hasFrontends())
+ if (!hasRemoteFrontend())
m_page.remoteInspectorInformationDidChange();
#endif
-}
-void InspectorController::disconnectAllFrontends()
-{
- // The local frontend client should be disconnected first so it stops sending messages.
- ASSERT(!m_frontendRouter->hasLocalFrontend() || !m_inspectorFrontendClient);
+ m_agents.willDestroyFrontendAndBackend(reason);
- m_agents.willDestroyFrontendAndBackend(DisconnectReason::InspectedTargetDestroyed);
+ m_backendDispatcher->clearFrontend();
+ m_backendDispatcher = nullptr;
+ m_frontendChannel = nullptr;
- m_frontendRouter->disconnectAllFrontends();
m_isAutomaticInspection = false;
// Release overlay page resources.
m_overlay->freePage();
-
- while (InspectorInstrumentation::hasFrontends())
- InspectorInstrumentation::frontendDeleted();
-
+ InspectorInstrumentation::frontendDeleted();
InspectorInstrumentation::unregisterInstrumentingAgents(m_instrumentingAgents.get());
-
-#if ENABLE(REMOTE_INSPECTOR)
- m_page.remoteInspectorInformationDidChange();
-#endif
}
void InspectorController::show()
{
- ASSERT(!m_frontendRouter->hasRemoteFrontend());
+ ASSERT(!hasRemoteFrontend());
- // The local frontend client should be disconnected if there's no local frontend.
- ASSERT(m_frontendRouter->hasLocalFrontend() || !m_inspectorFrontendClient);
-
if (!enabled())
return;
- if (m_frontendRouter->hasLocalFrontend())
+ if (m_frontendChannel)
m_inspectorClient->bringFrontendToFront();
- else if (Inspector::FrontendChannel* frontendChannel = m_inspectorClient->openInspectorFrontend(this))
- connectFrontend(frontendChannel);
+ else {
+ if (Inspector::FrontendChannel* frontendChannel = m_inspectorClient->openInspectorFrontend(this)) {
+ bool isAutomaticInspection = false;
+ connectFrontend(frontendChannel, isAutomaticInspection);
+ }
+ }
}
void InspectorController::close()
{
- if (m_frontendRouter->hasLocalFrontend())
- m_inspectorClient->closeInspectorFrontend();
-
- ASSERT(!m_frontendRouter->hasLocalFrontend());
+ if (!m_frontendChannel)
+ return;
+ disconnectFrontend(DisconnectReason::InspectorDestroyed);
+ m_inspectorClient->closeInspectorFrontend();
}
void InspectorController::setProcessId(long processId)
@@ -363,7 +337,8 @@
void InspectorController::dispatchMessageFromFrontend(const String& message)
{
- m_backendDispatcher->dispatch(message);
+ if (m_backendDispatcher)
+ m_backendDispatcher->dispatch(message);
}
void InspectorController::hideHighlight()
Modified: trunk/Source/WebCore/inspector/InspectorController.h (189339 => 189340)
--- trunk/Source/WebCore/inspector/InspectorController.h 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/WebCore/inspector/InspectorController.h 2015-09-04 04:54:09 UTC (rev 189340)
@@ -45,7 +45,6 @@
namespace Inspector {
class BackendDispatcher;
class FrontendChannel;
-class FrontendRouter;
class InspectorAgent;
class InspectorObject;
@@ -99,9 +98,8 @@
bool hasLocalFrontend() const;
bool hasRemoteFrontend() const;
- WEBCORE_EXPORT void connectFrontend(Inspector::FrontendChannel*, bool isAutomaticInspection = false);
- WEBCORE_EXPORT void disconnectFrontend(Inspector::FrontendChannel*);
- WEBCORE_EXPORT void disconnectAllFrontends();
+ WEBCORE_EXPORT void connectFrontend(Inspector::FrontendChannel*, bool isAutomaticInspection);
+ WEBCORE_EXPORT void disconnectFrontend(Inspector::DisconnectReason);
void setProcessId(long);
void inspect(Node*);
@@ -142,8 +140,8 @@
Ref<InstrumentingAgents> m_instrumentingAgents;
std::unique_ptr<WebInjectedScriptManager> m_injectedScriptManager;
- Ref<Inspector::FrontendRouter> m_frontendRouter;
- Ref<Inspector::BackendDispatcher> m_backendDispatcher;
+ RefPtr<Inspector::BackendDispatcher> m_backendDispatcher;
+ Inspector::FrontendChannel* m_frontendChannel { nullptr };
std::unique_ptr<InspectorOverlay> m_overlay;
Ref<WTF::Stopwatch> m_executionStopwatch;
Inspector::AgentRegistry m_agents;
Modified: trunk/Source/WebCore/inspector/InspectorDatabaseAgent.cpp (189339 => 189340)
--- trunk/Source/WebCore/inspector/InspectorDatabaseAgent.cpp 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/WebCore/inspector/InspectorDatabaseAgent.cpp 2015-09-04 04:54:09 UTC (rev 189340)
@@ -44,7 +44,6 @@
#include "SQLTransactionErrorCallback.h"
#include "SQLValue.h"
#include "VoidCallback.h"
-#include <inspector/InspectorFrontendRouter.h>
#include <inspector/InspectorValues.h>
#include <wtf/Vector.h>
Modified: trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp (189339 => 189340)
--- trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp 2015-09-04 04:54:09 UTC (rev 189340)
@@ -64,7 +64,6 @@
#include <inspector/InjectedScript.h>
#include <inspector/InjectedScriptManager.h>
#include <inspector/InspectorFrontendDispatchers.h>
-#include <inspector/InspectorFrontendRouter.h>
#include <inspector/InspectorValues.h>
#include <wtf/NeverDestroyed.h>
#include <wtf/Vector.h>
Modified: trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp (189339 => 189340)
--- trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp 2015-09-04 04:54:09 UTC (rev 189340)
@@ -62,7 +62,6 @@
#include "URL.h"
#include "WebSocketFrame.h"
#include <inspector/IdentifiersFactory.h>
-#include <inspector/InspectorFrontendRouter.h>
#include <inspector/InspectorValues.h>
#include <inspector/ScriptCallStack.h>
#include <inspector/ScriptCallStackFactory.h>
Modified: trunk/Source/WebCore/inspector/WorkerInspectorController.cpp (189339 => 189340)
--- trunk/Source/WebCore/inspector/WorkerInspectorController.cpp 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/WebCore/inspector/WorkerInspectorController.cpp 2015-09-04 04:54:09 UTC (rev 189340)
@@ -48,7 +48,6 @@
#include "WorkerThread.h"
#include <inspector/InspectorBackendDispatcher.h>
#include <inspector/InspectorFrontendDispatchers.h>
-#include <inspector/InspectorFrontendRouter.h>
#include <wtf/Stopwatch.h>
using namespace Inspector;
@@ -81,8 +80,6 @@
, m_instrumentingAgents(InstrumentingAgents::create(*this))
, m_injectedScriptManager(std::make_unique<WebInjectedScriptManager>(*this, WebInjectedScriptHost::create()))
, m_executionStopwatch(Stopwatch::create())
- , m_frontendRouter(FrontendRouter::create())
- , m_backendDispatcher(BackendDispatcher::create(m_frontendRouter.copyRef()))
{
auto runtimeAgent = std::make_unique<WorkerRuntimeAgent>(*m_injectedScriptManager, &workerGlobalScope);
m_runtimeAgent = runtimeAgent.get();
@@ -117,27 +114,27 @@
void WorkerInspectorController::connectFrontend()
{
- ASSERT(!m_frontendRouter->hasFrontends());
- ASSERT(!m_forwardingChannel);
-
- m_forwardingChannel = std::make_unique<PageInspectorProxy>(m_workerGlobalScope);
- m_frontendRouter->connectFrontend(m_forwardingChannel.get());
- m_agents.didCreateFrontendAndBackend(m_forwardingChannel.get(), &m_backendDispatcher.get());
+ ASSERT(!m_frontendChannel);
+ m_frontendChannel = std::make_unique<PageInspectorProxy>(m_workerGlobalScope);
+ m_backendDispatcher = BackendDispatcher::create(m_frontendChannel.get());
+ m_agents.didCreateFrontendAndBackend(m_frontendChannel.get(), m_backendDispatcher.get());
}
void WorkerInspectorController::disconnectFrontend(Inspector::DisconnectReason reason)
{
- ASSERT(m_frontendRouter->hasFrontends());
- ASSERT(m_forwardingChannel);
+ if (!m_frontendChannel)
+ return;
m_agents.willDestroyFrontendAndBackend(reason);
- m_frontendRouter->disconnectFrontend(m_forwardingChannel.get());
- m_forwardingChannel = nullptr;
+ m_backendDispatcher->clearFrontend();
+ m_backendDispatcher = nullptr;
+ m_frontendChannel = nullptr;
}
void WorkerInspectorController::dispatchMessageFromFrontend(const String& message)
{
- m_backendDispatcher->dispatch(message);
+ if (m_backendDispatcher)
+ m_backendDispatcher->dispatch(message);
}
void WorkerInspectorController::resume()
Modified: trunk/Source/WebCore/inspector/WorkerInspectorController.h (189339 => 189340)
--- trunk/Source/WebCore/inspector/WorkerInspectorController.h 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/WebCore/inspector/WorkerInspectorController.h 2015-09-04 04:54:09 UTC (rev 189340)
@@ -41,10 +41,6 @@
#include <wtf/RefPtr.h>
#include <wtf/Vector.h>
-namespace Inspector {
-class FrontendRouter;
-};
-
namespace WebCore {
class InspectorInstrumentation;
@@ -82,10 +78,9 @@
std::unique_ptr<WebInjectedScriptManager> m_injectedScriptManager;
WorkerRuntimeAgent* m_runtimeAgent { nullptr };
Inspector::AgentRegistry m_agents;
- std::unique_ptr<Inspector::FrontendChannel> m_forwardingChannel;
+ std::unique_ptr<Inspector::FrontendChannel> m_frontendChannel;
Ref<WTF::Stopwatch> m_executionStopwatch;
- Ref<Inspector::FrontendRouter> m_frontendRouter;
- Ref<Inspector::BackendDispatcher> m_backendDispatcher;
+ RefPtr<Inspector::BackendDispatcher> m_backendDispatcher;
Vector<InspectorInstrumentationCookie, 2> m_injectedScriptInstrumentationCookies;
};
Modified: trunk/Source/WebCore/page/PageDebuggable.cpp (189339 => 189340)
--- trunk/Source/WebCore/page/PageDebuggable.cpp 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/WebCore/page/PageDebuggable.cpp 2015-09-04 04:54:09 UTC (rev 189340)
@@ -80,10 +80,10 @@
inspectorController.connectFrontend(channel, isAutomaticInspection);
}
-void PageDebuggable::disconnect(Inspector::FrontendChannel* channel)
+void PageDebuggable::disconnect()
{
InspectorController& inspectorController = m_page.inspectorController();
- inspectorController.disconnectFrontend(channel);
+ inspectorController.disconnectFrontend(Inspector::DisconnectReason::InspectorDestroyed);
if (m_forcedDeveloperExtrasEnabled) {
m_forcedDeveloperExtrasEnabled = false;
Modified: trunk/Source/WebCore/page/PageDebuggable.h (189339 => 189340)
--- trunk/Source/WebCore/page/PageDebuggable.h 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/WebCore/page/PageDebuggable.h 2015-09-04 04:54:09 UTC (rev 189340)
@@ -49,7 +49,7 @@
virtual bool hasLocalDebugger() const override;
virtual void connect(Inspector::FrontendChannel*, bool isAutomaticInspection) override;
- virtual void disconnect(Inspector::FrontendChannel*) override;
+ virtual void disconnect() override;
virtual void dispatchMessageFromRemoteFrontend(const String& message) override;
virtual void setIndicating(bool) override;
Modified: trunk/Source/WebCore/testing/Internals.cpp (189339 => 189340)
--- trunk/Source/WebCore/testing/Internals.cpp 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/WebCore/testing/Internals.cpp 2015-09-04 04:54:09 UTC (rev 189340)
@@ -1734,8 +1734,9 @@
m_frontendClient = std::make_unique<InspectorFrontendClientDummy>(&page->inspectorController(), frontendPage);
frontendPage->inspectorController().setInspectorFrontendClient(m_frontendClient.get());
+ bool isAutomaticInspection = false;
m_frontendChannel = std::make_unique<InspectorFrontendChannelDummy>(frontendPage);
- page->inspectorController().connectFrontend(m_frontendChannel.get());
+ page->inspectorController().connectFrontend(m_frontendChannel.get(), isAutomaticInspection);
return m_frontendWindow;
}
@@ -1746,13 +1747,9 @@
ASSERT(page);
ASSERT(m_frontendWindow);
- Page* frontendPage = m_frontendWindow->document()->page();
- ASSERT(frontendPage);
+ page->inspectorController().disconnectFrontend(Inspector::DisconnectReason::InspectorDestroyed);
- frontendPage->inspectorController().setInspectorFrontendClient(nullptr);
m_frontendClient = nullptr;
-
- page->inspectorController().disconnectFrontend(m_frontendChannel.get());
m_frontendChannel = nullptr;
m_frontendWindow->close(m_frontendWindow->scriptExecutionContext());
Modified: trunk/Source/WebKit/mac/ChangeLog (189339 => 189340)
--- trunk/Source/WebKit/mac/ChangeLog 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/WebKit/mac/ChangeLog 2015-09-04 04:54:09 UTC (rev 189340)
@@ -1,3 +1,17 @@
+2015-09-03 Commit Queue <[email protected]>
+
+ Unreviewed, rolling out r189338.
+ https://bugs.webkit.org/show_bug.cgi?id=148785
+
+ Caused tons of crashes (Requested by cdumez on #webkit).
+
+ Reverted changeset:
+
+ "Web Inspector: InspectorController should support multiple
+ frontend channels"
+ https://bugs.webkit.org/show_bug.cgi?id=148538
+ http://trac.webkit.org/changeset/189338
+
2015-09-03 Brian Burg <[email protected]>
Web Inspector: InspectorController should support multiple frontend channels
Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.h (189339 => 189340)
--- trunk/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.h 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.h 2015-09-04 04:54:09 UTC (rev 189340)
@@ -124,7 +124,7 @@
virtual void bringToFront() override;
virtual void closeWindow() override;
- void disconnectFromBackend();
+ virtual void disconnectFromBackend();
virtual void attachWindow(DockSide) override;
virtual void detachWindow() override;
Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm (189339 => 189340)
--- trunk/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm 2015-09-04 04:54:09 UTC (rev 189340)
@@ -87,7 +87,7 @@
- (WebInspectorClient*)inspectorClient;
- (void)setAttachedWindowHeight:(unsigned)height;
- (void)setDockingUnavailable:(BOOL)unavailable;
-- (void)destroyInspectorView;
+- (void)destroyInspectorView:(bool)notifyInspectorController;
@end
@@ -130,7 +130,6 @@
void WebInspectorClient::bringFrontendToFront()
{
- ASSERT(m_frontendClient);
m_frontendClient->bringToFront();
}
@@ -253,12 +252,12 @@
void WebInspectorFrontendClient::closeWindow()
{
- [m_windowController.get() destroyInspectorView];
+ [m_windowController.get() destroyInspectorView:true];
}
void WebInspectorFrontendClient::disconnectFromBackend()
{
- [m_windowController.get() destroyInspectorView];
+ [m_windowController.get() destroyInspectorView:false];
}
void WebInspectorFrontendClient::attachWindow(DockSide)
@@ -523,7 +522,7 @@
- (BOOL)windowShouldClose:(id)sender
{
- [self destroyInspectorView];
+ [self destroyInspectorView:true];
return YES;
}
@@ -677,7 +676,7 @@
// Do nothing.
}
-- (void)destroyInspectorView
+- (void)destroyInspectorView:(bool)notifyInspectorController
{
RetainPtr<WebInspectorWindowController> protect(self);
@@ -693,9 +692,9 @@
_visible = NO;
- if (Page* inspectedPage = [_inspectedWebView.get() page]) {
- inspectedPage->inspectorController().setInspectorFrontendClient(nullptr);
- inspectedPage->inspectorController().disconnectFrontend(_inspectorClient);
+ if (notifyInspectorController) {
+ if (Page* inspectedPage = [_inspectedWebView.get() page])
+ inspectedPage->inspectorController().disconnectFrontend(Inspector::DisconnectReason::InspectorDestroyed);
}
[_webView close];
Modified: trunk/Source/WebKit/win/ChangeLog (189339 => 189340)
--- trunk/Source/WebKit/win/ChangeLog 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/WebKit/win/ChangeLog 2015-09-04 04:54:09 UTC (rev 189340)
@@ -1,3 +1,17 @@
+2015-09-03 Commit Queue <[email protected]>
+
+ Unreviewed, rolling out r189338.
+ https://bugs.webkit.org/show_bug.cgi?id=148785
+
+ Caused tons of crashes (Requested by cdumez on #webkit).
+
+ Reverted changeset:
+
+ "Web Inspector: InspectorController should support multiple
+ frontend channels"
+ https://bugs.webkit.org/show_bug.cgi?id=148538
+ http://trac.webkit.org/changeset/189338
+
2015-09-03 Brian Burg <[email protected]>
Web Inspector: InspectorController should support multiple frontend channels
Modified: trunk/Source/WebKit/win/WebCoreSupport/WebInspectorClient.cpp (189339 => 189340)
--- trunk/Source/WebKit/win/WebCoreSupport/WebInspectorClient.cpp 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/WebKit/win/WebCoreSupport/WebInspectorClient.cpp 2015-09-04 04:54:09 UTC (rev 189340)
@@ -174,7 +174,7 @@
void WebInspectorClient::closeInspectorFrontend()
{
if (m_frontendClient)
- m_frontendClient->destroyInspectorView();
+ m_frontendClient->destroyInspectorView(false);
}
void WebInspectorClient::bringFrontendToFront()
@@ -237,7 +237,7 @@
WebInspectorFrontendClient::~WebInspectorFrontendClient()
{
- destroyInspectorView();
+ destroyInspectorView(true);
}
void WebInspectorFrontendClient::frontendLoaded()
@@ -269,7 +269,7 @@
void WebInspectorFrontendClient::closeWindow()
{
- destroyInspectorView();
+ destroyInspectorView(true);
}
void WebInspectorFrontendClient::attachWindow(DockSide)
@@ -421,7 +421,7 @@
m_inspectorClient->updateHighlight();
}
-void WebInspectorFrontendClient::destroyInspectorView()
+void WebInspectorFrontendClient::destroyInspectorView(bool notifyInspectorController)
{
m_inspectorClient->releaseFrontend();
@@ -431,10 +431,10 @@
closeWindowWithoutNotifications();
- m_inspectedWebView->page()->inspectorController().setInspectorFrontendClient(nullptr);
- m_inspectedWebView->page()->inspectorController().disconnectFrontend(m_inspectorClient);
- m_inspectorClient->updateHighlight();
-
+ if (notifyInspectorController) {
+ m_inspectedWebView->page()->inspectorController().disconnectFrontend(Inspector::DisconnectReason::InspectorDestroyed);
+ m_inspectorClient->updateHighlight();
+ }
::DestroyWindow(m_frontendHwnd);
}
Modified: trunk/Source/WebKit/win/WebCoreSupport/WebInspectorClient.h (189339 => 189340)
--- trunk/Source/WebKit/win/WebCoreSupport/WebInspectorClient.h 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/WebKit/win/WebCoreSupport/WebInspectorClient.h 2015-09-04 04:54:09 UTC (rev 189340)
@@ -113,7 +113,7 @@
virtual void inspectedURLChanged(const WTF::String& newURL);
- void destroyInspectorView();
+ void destroyInspectorView(bool notifyInspectorController);
private:
void closeWindowWithoutNotifications();
Modified: trunk/Source/WebKit2/ChangeLog (189339 => 189340)
--- trunk/Source/WebKit2/ChangeLog 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/WebKit2/ChangeLog 2015-09-04 04:54:09 UTC (rev 189340)
@@ -1,3 +1,17 @@
+2015-09-03 Commit Queue <[email protected]>
+
+ Unreviewed, rolling out r189338.
+ https://bugs.webkit.org/show_bug.cgi?id=148785
+
+ Caused tons of crashes (Requested by cdumez on #webkit).
+
+ Reverted changeset:
+
+ "Web Inspector: InspectorController should support multiple
+ frontend channels"
+ https://bugs.webkit.org/show_bug.cgi?id=148538
+ http://trac.webkit.org/changeset/189338
+
2015-09-03 Brian Burg <[email protected]>
Web Inspector: InspectorController should support multiple frontend channels
Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.cpp (189339 => 189340)
--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.cpp 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.cpp 2015-09-04 04:54:09 UTC (rev 189340)
@@ -82,19 +82,17 @@
delete this;
}
-Inspector::FrontendChannel* WebInspectorClient::openInspectorFrontend(InspectorController* controller)
+WebCore::InspectorFrontendChannel* WebInspectorClient::openInspectorFrontend(InspectorController* controller)
{
- m_page->inspector()->openFrontendConnection(controller->isUnderTest());
+ m_page->inspector()->createInspectorPage(controller->isUnderTest());
return m_page->inspector();
}
void WebInspectorClient::closeInspectorFrontend()
{
- if (m_page->inspector()) {
- m_page->corePage()->inspectorController().disconnectFrontend(m_page->inspector());
- m_page->inspector()->closeFrontendConnection();
- }
+ if (m_page->inspector())
+ m_page->inspector()->closeFrontend();
}
void WebInspectorClient::bringFrontendToFront()
Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.h (189339 => 189340)
--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.h 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.h 2015-09-04 04:54:09 UTC (rev 189340)
@@ -27,6 +27,7 @@
#define WebInspectorClient_h
#include <WebCore/InspectorClient.h>
+#include <WebCore/InspectorForwarding.h>
#include <WebCore/PageOverlay.h>
#include <wtf/HashSet.h>
@@ -52,7 +53,7 @@
// WebCore::InspectorClient
void inspectorDestroyed() override;
- Inspector::FrontendChannel* openInspectorFrontend(WebCore::InspectorController*) override;
+ WebCore::InspectorFrontendChannel* openInspectorFrontend(WebCore::InspectorController*) override;
void closeInspectorFrontend() override;
void bringFrontendToFront() override;
void didResizeMainFrame(WebCore::Frame*) override;
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp (189339 => 189340)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp 2015-09-04 04:54:09 UTC (rev 189340)
@@ -70,7 +70,7 @@
}
// Called from WebInspectorClient
-void WebInspector::openFrontendConnection(bool underTest)
+void WebInspector::createInspectorPage(bool underTest)
{
#if OS(DARWIN)
mach_port_t listeningPort;
@@ -93,7 +93,7 @@
WebProcess::singleton().parentProcessConnection()->send(Messages::WebInspectorProxy::CreateInspectorPage(connectionClientPort, canAttachWindow(), underTest), m_page->pageID());
}
-void WebInspector::closeFrontendConnection()
+void WebInspector::closeFrontend()
{
WebProcess::singleton().parentProcessConnection()->send(Messages::WebInspectorProxy::DidClose(), m_page->pageID());
@@ -262,7 +262,8 @@
{
if (m_page->corePage()) {
m_remoteFrontendConnected = true;
- m_page->corePage()->inspectorController().connectFrontend(this);
+ bool isAutomaticInspection = false;
+ m_page->corePage()->inspectorController().connectFrontend(this, isAutomaticInspection);
}
}
@@ -271,7 +272,7 @@
m_remoteFrontendConnected = false;
if (m_page->corePage())
- m_page->corePage()->inspectorController().disconnectFrontend(this);
+ m_page->corePage()->inspectorController().disconnectFrontend(Inspector::DisconnectReason::InspectorDestroyed);
}
#endif
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.h (189339 => 189340)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.h 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.h 2015-09-04 04:54:09 UTC (rev 189340)
@@ -97,9 +97,9 @@
bool canAttachWindow();
// Called from WebInspectorClient
- void openFrontendConnection(bool underTest);
- void closeFrontendConnection();
+ void createInspectorPage(bool underTest);
+ void closeFrontend();
void bringToFront();
WebPage* m_page;
Modified: trunk/Tools/ChangeLog (189339 => 189340)
--- trunk/Tools/ChangeLog 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Tools/ChangeLog 2015-09-04 04:54:09 UTC (rev 189340)
@@ -1,3 +1,17 @@
+2015-09-03 Commit Queue <[email protected]>
+
+ Unreviewed, rolling out r189338.
+ https://bugs.webkit.org/show_bug.cgi?id=148785
+
+ Caused tons of crashes (Requested by cdumez on #webkit).
+
+ Reverted changeset:
+
+ "Web Inspector: InspectorController should support multiple
+ frontend channels"
+ https://bugs.webkit.org/show_bug.cgi?id=148538
+ http://trac.webkit.org/changeset/189338
+
2015-09-03 Brian Burg <[email protected]>
Web Inspector: InspectorController should support multiple frontend channels
Modified: trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm (189339 => 189340)
--- trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm 2015-09-04 04:54:09 UTC (rev 189340)
@@ -2039,13 +2039,6 @@
workQueue.clear();
- // If the test page could have possibly opened the Web Inspector frontend,
- // then try to close it in case it was accidentally left open.
- if (shouldEnableDeveloperExtras(pathOrURL.c_str())) {
- gTestRunner->closeWebInspector();
- gTestRunner->setDeveloperExtrasEnabled(false);
- }
-
if (gTestRunner->closeRemainingWindowsWhenComplete()) {
NSArray* array = [DumpRenderTreeWindow openWindows];
@@ -2069,6 +2062,12 @@
}
}
+ // If developer extras enabled Web Inspector may have been open by the test.
+ if (shouldEnableDeveloperExtras(pathOrURL.c_str())) {
+ gTestRunner->closeWebInspector();
+ gTestRunner->setDeveloperExtrasEnabled(false);
+ }
+
resetWebViewToConsistentStateBeforeTesting();
// Loading an empty request synchronously replaces the document with a blank one, which is necessary
Modified: trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp (189339 => 189340)
--- trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp 2015-09-04 04:29:04 UTC (rev 189339)
+++ trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp 2015-09-04 04:54:09 UTC (rev 189340)
@@ -1147,13 +1147,6 @@
// EventSendingController clearSavedEvents
workQueue.clear();
- // If the test page could have possibly opened the Web Inspector frontend,
- // then try to close it in case it was accidentally left open.
- if (shouldEnableDeveloperExtras(pathOrURL.c_str())) {
- ::gTestRunner->closeWebInspector();
- ::gTestRunner->setDeveloperExtrasEnabled(false);
- }
-
if (::gTestRunner->closeRemainingWindowsWhenComplete()) {
Vector<HWND> windows = openWindows();
unsigned size = windows.size();
@@ -1168,6 +1161,11 @@
}
}
+ if (shouldEnableDeveloperExtras(pathOrURL.c_str())) {
+ ::gTestRunner->closeWebInspector();
+ ::gTestRunner->setDeveloperExtrasEnabled(false);
+ }
+
resetWebViewToConsistentStateBeforeTesting();
// Loading an empty request synchronously replaces the document with a blank one, which is necessary