Changeset 160099 in webkit


Ignore:
Timestamp:
Dec 4, 2013, 10:20:37 AM (12 years ago)
Author:
Joseph Pecoraro
Message:

Web Inspector: Push Remote Inspector debugging connection management into JavaScriptCore
https://bugs.webkit.org/show_bug.cgi?id=124613

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

Move the ENABLE(REMOTE_INSPECTOR) remote debugger connection management
into JavaScriptCore (originally from WebKit/mac). Include enhancements:

  • allow for different types of remote debuggable targets, eventually at least a JSContext, WebView, WKView.
  • allow debuggables to be registered and debugged on any thread. Unlike WebViews, JSContexts may be run entirely off of the main thread.
  • move the remote connection (XPC connection) itself off of the main thread, it doesn't need to be on the main thread.

Make JSContext @class and JavaScriptCore::JSContextRef
"JavaScript" Remote Debuggables.

  • inspector/remote/RemoteInspectorDebuggable.h: Added.
  • inspector/remote/RemoteInspectorDebuggable.cpp: Added.

(Inspector::RemoteInspectorDebuggable::RemoteInspectorDebuggable):
(Inspector::RemoteInspectorDebuggable::~RemoteInspectorDebuggable):
(Inspector::RemoteInspectorDebuggable::init):
(Inspector::RemoteInspectorDebuggable::update):
(Inspector::RemoteInspectorDebuggable::setRemoteDebuggingAllowed):
(Inspector::RemoteInspectorDebuggable::info):
RemoteInspectorDebuggable defines a debuggable target. As long as
something creates a debuggable and is set to allow remote inspection
it will be listed in remote debuggers. For the different types of
debuggables (JavaScript and Web) there is different basic information
that may be listed.

  • inspector/InspectorFrontendChannel.h: Added.

(Inspector::InspectorFrontendChannel::~InspectorFrontendChannel):
The only thing a debuggable needs for remote debugging is an
InspectorFrontendChannel a way to send messages to a remote frontend.
This class provides that method, and is vended to the
RemoteInspectorDebuggable when a remote connection is setup.

  • inspector/remote/RemoteInspector.h: Added.
  • inspector/remote/RemoteInspector.mm: Added.

Singleton, created at least when the first Debuggable is created.
This class manages the list of debuggables, any connection to a
remote debugger proxy (XPC service "com.apple.webinspector").

(Inspector::dispatchAsyncOnQueueSafeForAnyDebuggable):
(Inspector::RemoteInspector::shared):
(Inspector::RemoteInspector::RemoteInspector):
(Inspector::RemoteInspector::nextAvailableIdentifier):
(Inspector::RemoteInspector::registerDebuggable):
(Inspector::RemoteInspector::unregisterDebuggable):
(Inspector::RemoteInspector::updateDebuggable):
Debuggable management. When debuggables are added, removed, or updated
we stash a copy of the debuggable information and push an update to
debuggers. Stashing a copy of the information in the RemoteInspector
is a thread safe way to avoid walking over all debuggables to gather
the information when it is needed.

(Inspector::RemoteInspector::start):
(Inspector::RemoteInspector::stop):
Runtime API to enable / disable the feature.

(Inspector::RemoteInspector::listingForDebuggable):
(Inspector::RemoteInspector::pushListingNow):
(Inspector::RemoteInspector::pushListingSoon):
Pushing a listing to remote debuggers.

(Inspector::RemoteInspector::sendMessageToRemoteFrontend):
(Inspector::RemoteInspector::setupXPCConnectionIfNeeded):
(Inspector::RemoteInspector::xpcConnectionReceivedMessage):
(Inspector::RemoteInspector::xpcConnectionFailed):
(Inspector::RemoteInspector::xpcConnectionUnhandledMessage):
XPC setup, send, and receive handling.

(Inspector::RemoteInspector::updateHasActiveDebugSession):
Applications being debugged may want to know when a debug
session is active. This provides that notification.

(Inspector::RemoteInspector::receivedSetupMessage):
(Inspector::RemoteInspector::receivedDataMessage):
(Inspector::RemoteInspector::receivedDidCloseMessage):
(Inspector::RemoteInspector::receivedGetListingMessage):
(Inspector::RemoteInspector::receivedIndicateMessage):
(Inspector::RemoteInspector::receivedConnectionDiedMessage):
Dispatching incoming remote debugging protocol messages.
These are wrapping above the inspector protocol messages.

  • inspector/remote/RemoteInspectorConstants.h: Added.

Protocol messages and dictionary keys inside the messages.

(Inspector::RemoteInspectorDebuggableInfo::RemoteInspectorDebuggableInfo):

  • inspector/remote/RemoteInspectorDebuggableConnection.h: Added.
  • inspector/remote/RemoteInspectorDebuggableConnection.mm: Added.

This is a connection between the RemoteInspector singleton and a RemoteInspectorDebuggable.

(Inspector::RemoteInspectorDebuggableConnection::RemoteInspectorDebuggableConnection):
(Inspector::RemoteInspectorDebuggableConnection::~RemoteInspectorDebuggableConnection):
Allow for dispatching messages on JavaScript debuggables on a dispatch_queue
instead of the main queue.

(Inspector::RemoteInspectorDebuggableConnection::destination):
(Inspector::RemoteInspectorDebuggableConnection::connectionIdentifier):
Needed in the remote debugging protocol to identify the remote debugger.

(Inspector::RemoteInspectorDebuggableConnection::dispatchSyncOnDebuggable):
(Inspector::RemoteInspectorDebuggableConnection::dispatchAsyncOnDebuggable):
(Inspector::RemoteInspectorDebuggableConnection::setup):
(Inspector::RemoteInspectorDebuggableConnection::closeFromDebuggable):
(Inspector::RemoteInspectorDebuggableConnection::close):
(Inspector::RemoteInspectorDebuggableConnection::sendMessageToBackend):
(Inspector::RemoteInspectorDebuggableConnection::sendMessageToFrontend):
The connection is a thin channel between the two sides that can be closed
from either side, so there is some logic around multi-threaded access.

  • inspector/remote/RemoteInspectorXPCConnection.h: Added.

(Inspector::RemoteInspectorXPCConnection::Client::~Client):

  • inspector/remote/RemoteInspectorXPCConnection.mm: Added.

(Inspector::RemoteInspectorXPCConnection::RemoteInspectorXPCConnection):
(Inspector::RemoteInspectorXPCConnection::~RemoteInspectorXPCConnection):
(Inspector::RemoteInspectorXPCConnection::close):
(Inspector::RemoteInspectorXPCConnection::deserializeMessage):
(Inspector::RemoteInspectorXPCConnection::handleEvent):
(Inspector::RemoteInspectorXPCConnection::sendMessage):
This is a connection between the RemoteInspector singleton and an XPC service
named "com.apple.webinspector". This handles serialization of the dictionary
messages to and from the service. The receiving is done on a non-main queue.

  • API/JSContext.h:
  • API/JSContext.mm:

(-[JSContext name]):
(-[JSContext setName:]):
ObjC API to enable/disable JSContext remote inspection and give a name.

  • API/JSContextRef.h:
  • API/JSContextRef.cpp:

(JSGlobalContextGetName):
(JSGlobalContextSetName):
C API to give a JSContext a name.

  • runtime/JSGlobalObject.cpp:

(JSC::JSGlobalObject::setName):

  • runtime/JSGlobalObject.h:

(JSC::JSGlobalObject::name):
Shared handling of the APIs above.

  • runtime/JSGlobalObjectDebuggable.cpp: Added.

(JSC::JSGlobalObjectDebuggable::JSGlobalObjectDebuggable):
(JSC::JSGlobalObjectDebuggable::name):
(JSC::JSGlobalObjectDebuggable::connect):
(JSC::JSGlobalObjectDebuggable::disconnect):
(JSC::JSGlobalObjectDebuggable::dispatchMessageFromRemoteFrontend):

  • runtime/JSGlobalObjectDebuggable.h: Added.

Stub for the actual remote debugging implementation. We will push
down the appropriate WebCore/inspector peices suitable for debugging
just a JavaScript context.

Update build files.

Source/WebCore:

Make a WebCore::Page a "Web" Remote Debuggable.

  • bindings/js/JSDOMGlobalObject.cpp:

Disable JavaScript context inspection on JSGlobalObjects inside WebCore::Page's.

  • page/Page.cpp:

(WebCore::Page::Page):
(WebCore::Page::remoteInspectionAllowed):
(WebCore::Page::setRemoteInspectionAllowed):
(WebCore::Page::remoteInspectorInformationDidChange):

  • page/Page.h:
  • page/PageDebuggable.h:
  • page/PageDebuggable.cpp: Added.

(WebCore::PageDebuggable::PageDebuggable):
(WebCore::PageDebuggable::name):
(WebCore::PageDebuggable::url):
(WebCore::PageDebuggable::hasLocalDebugger):
(WebCore::PageDebuggable::connect):
(WebCore::PageDebuggable::disconnect):
(WebCore::PageDebuggable::dispatchMessageFromRemoteFrontend):
(WebCore::PageDebuggable::setIndicating):
Make a page a "Web" debuggable.

  • GNUmakefile.list.am:
  • WebCore.exp.in:
  • WebCore.vcxproj/WebCore.vcxproj:
  • WebCore.vcxproj/WebCore.vcxproj.filters:
  • WebCore.xcodeproj/project.pbxproj:

Misc.

  • inspector/InspectorClient.h:

(WebCore::InspectorClient::indicate):
(WebCore::InspectorClient::hideIndicate):
Forward indicate methods to WebKit clients.

  • loader/FrameLoader.cpp:

(WebCore::FrameLoader::didChangeTitle):
(WebCore::FrameLoader::dispatchDidCommitLoad):
Push updates when remote debuggable information like the Page's
URL or title change.

  • ForwardingHeaders/inspector/InspectorFrontendChannel.h:
  • inspector/InspectorForwarding.h:

Re-export Inspector::InspectorFrontendChannel as WebCore::InspectorFrontendChannel
to avoid needlessly updating code all over the place.

  • inspector/CodeGeneratorInspectorStrings.py:
  • inspector/InspectorWorkerAgent.cpp:
  • inspector/WorkerInspectorController.cpp:
  • testing/Internals.cpp:

Update include names.

  • page/ContextMenuController.cpp:

(WebCore::ContextMenuController::populate):
Make the "Inspect Element" context menu work correctly when there is a
remote inspector instead of a local inspector.

Source/WebKit:

  • WebKit.xcodeproj/project.pbxproj:

Source/WebKit/blackberry:

  • WebCoreSupport/InspectorClientBlackBerry.h:

Source/WebKit/cf:

  • WebCoreSupport/WebInspectorClientCF.cpp:

(WebInspectorClient::sendMessageToFrontend):

Source/WebKit/efl:

  • WebCoreSupport/InspectorClientEfl.h:

Source/WebKit/gtk:

  • WebCoreSupport/InspectorClientGtk.h:

Source/WebKit/ios:

  • WebCoreSupport/WebInspectorClientIOS.mm:

(WebInspectorClient::WebInspectorClient):
(WebInspectorClient::inspectorDestroyed):

Source/WebKit/mac:

Remove the old ENABLE(REMOTE_INSPECTOR) connection management implementation.

  • WebCoreSupport/WebInspectorClient.h:
  • WebCoreSupport/WebInspectorClient.mm:

(WebInspectorClient::indicate):
(WebInspectorClient::hideIndicate):
Hook up WebView indication through this new path.

  • WebCoreSupport/WebFrameLoaderClient.mm:

(WebFrameLoaderClient::dispatchDidReceiveTitle):

  • WebCoreSupport/WebInspectorClient.h:
  • WebCoreSupport/WebInspectorClient.mm:

(WebInspectorClient::WebInspectorClient):
(WebInspectorClient::inspectorDestroyed):

  • WebInspector/remote/WebInspectorClientRegistry.h: Removed.
  • WebInspector/remote/WebInspectorClientRegistry.mm: Removed.
  • WebInspector/remote/WebInspectorRelayDefinitions.h: Removed.
  • WebInspector/remote/WebInspectorRemoteChannel.h: Removed.
  • WebInspector/remote/WebInspectorRemoteChannel.mm: Removed.
  • WebInspector/remote/WebInspectorServer.h: Removed.
  • WebInspector/remote/WebInspectorServer.mm: Removed.
  • WebInspector/remote/WebInspectorServerWebViewConnection.h: Removed.
  • WebInspector/remote/WebInspectorServerWebViewConnection.mm: Removed.
  • WebInspector/remote/WebInspectorServerWebViewConnectionController.h: Removed.
  • WebInspector/remote/WebInspectorServerWebViewConnectionController.mm: Removed.
  • WebInspector/remote/WebInspectorXPCWrapper.h: Removed.
  • WebInspector/remote/WebInspectorXPCWrapper.m: Removed.
  • WebKit.exp:
  • WebView/WebView.mm:

(-[WebView _commonInitializationWithFrameName:groupName:]):
(+[WebView _enableRemoteInspector]):
(+[WebView _disableRemoteInspector]):
(+[WebView _disableAutoStartRemoteInspector]):
(+[WebView _isRemoteInspectorEnabled]):
(+[WebView _hasRemoteInspectorSession]):
(-[WebView allowsRemoteInspection]):
(-[WebView setAllowsRemoteInspection:]):
(-[WebView setIndicatingForRemoteInspector:]):
(-[WebView setHostApplicationBundleId:name:]):
(-[WebView _didCommitLoadForFrame:]):

  • WebView/WebViewData.h:
  • WebView/WebViewData.mm:

(-[WebViewPrivate init]):
(-[WebViewPrivate dealloc]):

  • WebView/WebViewInternal.h:
  • WebView/WebViewPrivate.h:

Remove old REMOTE_INSPECTOR.

Source/WebKit/win:

  • WebCoreSupport/WebInspectorClient.h:

Source/WebKit/wince:

  • WebCoreSupport/InspectorClientWinCE.h:

Source/WebKit2:

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::WebPage):

  • WebProcess/com.apple.WebProcess.sb.in:

Allow the WebProcess to access the "com.apple.webinspector" named
XPC service to expose its WebCore::Page's to remote debuggers.

Source/WTF:

  • wtf/ios/WebCoreThread.cpp:
  • wtf/ios/WebCoreThread.h:

Expose WebThreadRun/WebThreadRunSync iOS methods defined in WebCore through
WTF so that JavaScriptCore can use it. Another such method already existed.

Location:
trunk/Source
Files:
11 added
1 deleted
66 edited
7 copied
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSContext.h

    r159723 r160099  
    165165@property(readonly, retain) JSVirtualMachine *virtualMachine;
    166166
     167/*!
     168@property
     169@discussion Name of the JSContext. Exposed when remote debugging the context.
     170*/
     171@property(copy) NSString *name;
     172
    167173@end
    168174
  • trunk/Source/JavaScriptCore/API/JSContext.mm

    r159531 r160099  
    167167}
    168168
     169- (NSString *)name
     170{
     171    JSStringRef name = JSGlobalContextCopyName(m_context);
     172    if (!name)
     173        return nil;
     174
     175    return [(NSString *)JSStringCopyCFString(kCFAllocatorDefault, name) autorelease];
     176}
     177
     178- (void)setName:(NSString *)name
     179{
     180    JSStringRef nameJS = JSStringCreateWithCFString((CFStringRef)[name copy]);
     181    JSGlobalContextSetName(m_context, nameJS);
     182    JSStringRelease(nameJS);
     183}
     184
    169185@end
    170186
  • trunk/Source/JavaScriptCore/API/JSContextRef.cpp

    r159605 r160099  
    214214}
    215215
     216JSStringRef JSGlobalContextCopyName(JSGlobalContextRef ctx)
     217{
     218    if (!ctx) {
     219        ASSERT_NOT_REACHED();
     220        return 0;
     221    }
     222
     223    ExecState* exec = toJS(ctx);
     224    APIEntryShim entryShim(exec);
     225
     226    String name = exec->vmEntryGlobalObject()->name();
     227    if (name.isNull())
     228        return 0;
     229
     230    return OpaqueJSString::create(name).leakRef();
     231}
     232
     233void JSGlobalContextSetName(JSGlobalContextRef ctx, JSStringRef name)
     234{
     235    if (!ctx) {
     236        ASSERT_NOT_REACHED();
     237        return;
     238    }
     239
     240    ExecState* exec = toJS(ctx);
     241    APIEntryShim entryShim(exec);
     242
     243    exec->vmEntryGlobalObject()->setName(name ? name->string() : String());
     244}
     245
     246
    216247class BacktraceFunctor {
    217248public:
  • trunk/Source/JavaScriptCore/API/JSContextRef.h

    r157468 r160099  
    134134JS_EXPORT JSGlobalContextRef JSContextGetGlobalContext(JSContextRef ctx) CF_AVAILABLE(10_7, 4_0);
    135135
     136/*!
     137@function
     138@abstract Gets a copy of the name of a context.
     139@param ctx The JSGlobalContext whose name you want to get.
     140@result The name for ctx.
     141@discussion A JSGlobalContext's name is exposed for remote debugging to make it
     142easier to identify the context you would like to attach to.
     143*/
     144JS_EXPORT JSStringRef JSGlobalContextCopyName(JSGlobalContextRef ctx);
     145
     146/*!
     147@function
     148@abstract Sets the remote debugging name for a context.
     149@param ctx The JSGlobalContext that you want to name.
     150@param name The remote debugging name to set on ctx.
     151*/
     152JS_EXPORT void JSGlobalContextSetName(JSGlobalContextRef ctx, JSStringRef name);
     153
    136154#ifdef __cplusplus
    137155}
  • trunk/Source/JavaScriptCore/CMakeLists.txt

    r160094 r160099  
    1212    "${JAVASCRIPTCORE_DIR}/heap"
    1313    "${JAVASCRIPTCORE_DIR}/debugger"
     14    "${JAVASCRIPTCORE_DIR}/inspector"
    1415    "${JAVASCRIPTCORE_DIR}/interpreter"
    1516    "${JAVASCRIPTCORE_DIR}/jit"
     
    585586    debugger
    586587    heap
     588    inspector
    587589    interpreter
    588590    jit
  • trunk/Source/JavaScriptCore/ChangeLog

    r160094 r160099  
     12013-12-03  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Push Remote Inspector debugging connection management into JavaScriptCore
     4        https://bugs.webkit.org/show_bug.cgi?id=124613
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        Move the ENABLE(REMOTE_INSPECTOR) remote debugger connection management
     9        into JavaScriptCore (originally from WebKit/mac). Include enhancements:
     10
     11          * allow for different types of remote debuggable targets,
     12            eventually at least a JSContext, WebView, WKView.
     13          * allow debuggables to be registered and debugged on any thread. Unlike
     14            WebViews, JSContexts may be run entirely off of the main thread.
     15          * move the remote connection (XPC connection) itself off of the main thread,
     16            it doesn't need to be on the main thread.
     17
     18        Make JSContext @class and JavaScriptCore::JSContextRef
     19        "JavaScript" Remote Debuggables.
     20
     21        * inspector/remote/RemoteInspectorDebuggable.h: Added.
     22        * inspector/remote/RemoteInspectorDebuggable.cpp: Added.
     23        (Inspector::RemoteInspectorDebuggable::RemoteInspectorDebuggable):
     24        (Inspector::RemoteInspectorDebuggable::~RemoteInspectorDebuggable):
     25        (Inspector::RemoteInspectorDebuggable::init):
     26        (Inspector::RemoteInspectorDebuggable::update):
     27        (Inspector::RemoteInspectorDebuggable::setRemoteDebuggingAllowed):
     28        (Inspector::RemoteInspectorDebuggable::info):
     29        RemoteInspectorDebuggable defines a debuggable target. As long as
     30        something creates a debuggable and is set to allow remote inspection
     31        it will be listed in remote debuggers. For the different types of
     32        debuggables (JavaScript and Web) there is different basic information
     33        that may be listed.
     34
     35        * inspector/InspectorFrontendChannel.h: Added.
     36        (Inspector::InspectorFrontendChannel::~InspectorFrontendChannel):
     37        The only thing a debuggable needs for remote debugging is an
     38        InspectorFrontendChannel a way to send messages to a remote frontend.
     39        This class provides that method, and is vended to the
     40        RemoteInspectorDebuggable when a remote connection is setup.
     41
     42        * inspector/remote/RemoteInspector.h: Added.
     43        * inspector/remote/RemoteInspector.mm: Added.
     44        Singleton, created at least when the first Debuggable is created.
     45        This class manages the list of debuggables, any connection to a
     46        remote debugger proxy (XPC service "com.apple.webinspector").
     47
     48        (Inspector::dispatchAsyncOnQueueSafeForAnyDebuggable):
     49        (Inspector::RemoteInspector::shared):
     50        (Inspector::RemoteInspector::RemoteInspector):
     51        (Inspector::RemoteInspector::nextAvailableIdentifier):
     52        (Inspector::RemoteInspector::registerDebuggable):
     53        (Inspector::RemoteInspector::unregisterDebuggable):
     54        (Inspector::RemoteInspector::updateDebuggable):
     55        Debuggable management. When debuggables are added, removed, or updated
     56        we stash a copy of the debuggable information and push an update to
     57        debuggers. Stashing a copy of the information in the RemoteInspector
     58        is a thread safe way to avoid walking over all debuggables to gather
     59        the information when it is needed.
     60
     61        (Inspector::RemoteInspector::start):
     62        (Inspector::RemoteInspector::stop):
     63        Runtime API to enable / disable the feature.
     64
     65        (Inspector::RemoteInspector::listingForDebuggable):
     66        (Inspector::RemoteInspector::pushListingNow):
     67        (Inspector::RemoteInspector::pushListingSoon):
     68        Pushing a listing to remote debuggers.
     69
     70        (Inspector::RemoteInspector::sendMessageToRemoteFrontend):
     71        (Inspector::RemoteInspector::setupXPCConnectionIfNeeded):
     72        (Inspector::RemoteInspector::xpcConnectionReceivedMessage):
     73        (Inspector::RemoteInspector::xpcConnectionFailed):
     74        (Inspector::RemoteInspector::xpcConnectionUnhandledMessage):
     75        XPC setup, send, and receive handling.
     76
     77        (Inspector::RemoteInspector::updateHasActiveDebugSession):
     78        Applications being debugged may want to know when a debug
     79        session is active. This provides that notification.
     80
     81        (Inspector::RemoteInspector::receivedSetupMessage):
     82        (Inspector::RemoteInspector::receivedDataMessage):
     83        (Inspector::RemoteInspector::receivedDidCloseMessage):
     84        (Inspector::RemoteInspector::receivedGetListingMessage):
     85        (Inspector::RemoteInspector::receivedIndicateMessage):
     86        (Inspector::RemoteInspector::receivedConnectionDiedMessage):
     87        Dispatching incoming remote debugging protocol messages.
     88        These are wrapping above the inspector protocol messages.
     89
     90        * inspector/remote/RemoteInspectorConstants.h: Added.
     91        Protocol messages and dictionary keys inside the messages.
     92
     93        (Inspector::RemoteInspectorDebuggableInfo::RemoteInspectorDebuggableInfo):
     94        * inspector/remote/RemoteInspectorDebuggableConnection.h: Added.
     95        * inspector/remote/RemoteInspectorDebuggableConnection.mm: Added.
     96        This is a connection between the RemoteInspector singleton and a RemoteInspectorDebuggable.
     97
     98        (Inspector::RemoteInspectorDebuggableConnection::RemoteInspectorDebuggableConnection):
     99        (Inspector::RemoteInspectorDebuggableConnection::~RemoteInspectorDebuggableConnection):
     100        Allow for dispatching messages on JavaScript debuggables on a dispatch_queue
     101        instead of the main queue.
     102
     103        (Inspector::RemoteInspectorDebuggableConnection::destination):
     104        (Inspector::RemoteInspectorDebuggableConnection::connectionIdentifier):
     105        Needed in the remote debugging protocol to identify the remote debugger.
     106
     107        (Inspector::RemoteInspectorDebuggableConnection::dispatchSyncOnDebuggable):
     108        (Inspector::RemoteInspectorDebuggableConnection::dispatchAsyncOnDebuggable):
     109        (Inspector::RemoteInspectorDebuggableConnection::setup):
     110        (Inspector::RemoteInspectorDebuggableConnection::closeFromDebuggable):
     111        (Inspector::RemoteInspectorDebuggableConnection::close):
     112        (Inspector::RemoteInspectorDebuggableConnection::sendMessageToBackend):
     113        (Inspector::RemoteInspectorDebuggableConnection::sendMessageToFrontend):
     114        The connection is a thin channel between the two sides that can be closed
     115        from either side, so there is some logic around multi-threaded access.
     116
     117        * inspector/remote/RemoteInspectorXPCConnection.h: Added.
     118        (Inspector::RemoteInspectorXPCConnection::Client::~Client):
     119        * inspector/remote/RemoteInspectorXPCConnection.mm: Added.
     120        (Inspector::RemoteInspectorXPCConnection::RemoteInspectorXPCConnection):
     121        (Inspector::RemoteInspectorXPCConnection::~RemoteInspectorXPCConnection):
     122        (Inspector::RemoteInspectorXPCConnection::close):
     123        (Inspector::RemoteInspectorXPCConnection::deserializeMessage):
     124        (Inspector::RemoteInspectorXPCConnection::handleEvent):
     125        (Inspector::RemoteInspectorXPCConnection::sendMessage):
     126        This is a connection between the RemoteInspector singleton and an XPC service
     127        named "com.apple.webinspector". This handles serialization of the dictionary
     128        messages to and from the service. The receiving is done on a non-main queue.
     129
     130        * API/JSContext.h:
     131        * API/JSContext.mm:
     132        (-[JSContext name]):
     133        (-[JSContext setName:]):
     134        ObjC API to enable/disable JSContext remote inspection and give a name.
     135
     136        * API/JSContextRef.h:
     137        * API/JSContextRef.cpp:
     138        (JSGlobalContextGetName):
     139        (JSGlobalContextSetName):
     140        C API to give a JSContext a name.
     141
     142        * runtime/JSGlobalObject.cpp:
     143        (JSC::JSGlobalObject::setName):
     144        * runtime/JSGlobalObject.h:
     145        (JSC::JSGlobalObject::name):
     146        Shared handling of the APIs above.
     147
     148        * runtime/JSGlobalObjectDebuggable.cpp: Added.
     149        (JSC::JSGlobalObjectDebuggable::JSGlobalObjectDebuggable):
     150        (JSC::JSGlobalObjectDebuggable::name):
     151        (JSC::JSGlobalObjectDebuggable::connect):
     152        (JSC::JSGlobalObjectDebuggable::disconnect):
     153        (JSC::JSGlobalObjectDebuggable::dispatchMessageFromRemoteFrontend):
     154        * runtime/JSGlobalObjectDebuggable.h: Added.
     155        Stub for the actual remote debugging implementation. We will push
     156        down the appropriate WebCore/inspector peices suitable for debugging
     157        just a JavaScript context.
     158
     159        * CMakeLists.txt:
     160        * JavaScriptCore.xcodeproj/project.pbxproj:
     161        * GNUmakefile.am:
     162        * GNUmakefile.list.am:
     163        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
     164        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
     165        Update build files.
     166
    11672013-12-04  Michael Saboff  <msaboff@apple.com>
    2168
  • trunk/Source/JavaScriptCore/GNUmakefile.am

    r154747 r160099  
    6060        -I$(srcdir)/Source/JavaScriptCore/ftl \
    6161        -I$(srcdir)/Source/JavaScriptCore/heap \
     62        -I$(srcdir)/Source/JavaScriptCore/inspector \
    6263        -I$(srcdir)/Source/JavaScriptCore/interpreter \
    6364        -I$(srcdir)/Source/JavaScriptCore/jit \
  • trunk/Source/JavaScriptCore/GNUmakefile.list.am

    r160094 r160099  
    611611        Source/JavaScriptCore/icu/unicode/utypes.h \
    612612        Source/JavaScriptCore/icu/unicode/uversion.h \
     613        Source/JavaScriptCore/inspector/InspectorFrontendChannel.h \
    613614        Source/JavaScriptCore/interpreter/AbstractPC.cpp \
    614615        Source/JavaScriptCore/interpreter/AbstractPC.h \
  • trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj

    r160094 r160099  
    997997    <ClInclude Include="..\heap\WeakSetInlines.h" />
    998998    <ClInclude Include="..\heap\WriteBarrierSupport.h" />
     999    <ClInclude Include="..\inspector\InspectorFrontendChannel.h" />
    9991000    <ClInclude Include="..\interpreter\AbstractPC.h" />
    10001001    <ClInclude Include="..\interpreter\CachedCall.h" />
  • trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters

    r160094 r160099  
    2525    <Filter Include="heap">
    2626      <UniqueIdentifier>{bd49e5cf-95d6-4151-b286-8837ccd347fa}</UniqueIdentifier>
     27    </Filter>
     28    <Filter Include="inspector">
     29      <UniqueIdentifier>{09ae09da-1239-00ea-8dfe-9087ae123bbe}</UniqueIdentifier>
    2730    </Filter>
    2831    <Filter Include="interpreter">
     
    17071710      <Filter>heap</Filter>
    17081711    </ClInclude>
     1712    <ClInclude Include="..\inspector\InspectorFrontendChannel.h">
     1713      <Filter>inspector</Filter>
     1714    </ClInclude>
    17091715    <ClInclude Include="..\interpreter\AbstractPC.h">
    17101716      <Filter>interpreter</Filter>
  • trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r160094 r160099  
    888888                A1A009C01831A22D00CF8711 /* MacroAssemblerARM64.h in Headers */ = {isa = PBXBuildFile; fileRef = 8640923C156EED3B00566CB2 /* MacroAssemblerARM64.h */; settings = {ATTRIBUTES = (Private, ); }; };
    889889                A1A009C11831A26E00CF8711 /* ARM64Assembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 8640923B156EED3B00566CB2 /* ARM64Assembler.h */; settings = {ATTRIBUTES = (Private, ); }; };
     890                A594558F18245EFD00CC3843 /* RemoteInspectorDebuggable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A594558E18245EDE00CC3843 /* RemoteInspectorDebuggable.cpp */; };
     891                A59455921824744700CC3843 /* JSGlobalObjectDebuggable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A59455901824744700CC3843 /* JSGlobalObjectDebuggable.cpp */; };
     892                A59455931824744700CC3843 /* JSGlobalObjectDebuggable.h in Headers */ = {isa = PBXBuildFile; fileRef = A59455911824744700CC3843 /* JSGlobalObjectDebuggable.h */; };
     893                A5945595182479EB00CC3843 /* InspectorFrontendChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = A5945594182479EB00CC3843 /* InspectorFrontendChannel.h */; settings = {ATTRIBUTES = (Private, ); }; };
     894                A5BA15E8182340B300A82E69 /* RemoteInspector.h in Headers */ = {isa = PBXBuildFile; fileRef = A5BA15E1182340B300A82E69 /* RemoteInspector.h */; settings = {ATTRIBUTES = (Private, ); }; };
     895                A5BA15E9182340B300A82E69 /* RemoteInspector.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15E2182340B300A82E69 /* RemoteInspector.mm */; };
     896                A5BA15EA182340B400A82E69 /* RemoteInspectorConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = A5BA15E3182340B300A82E69 /* RemoteInspectorConstants.h */; settings = {ATTRIBUTES = (Private, ); }; };
     897                A5BA15EB182340B400A82E69 /* RemoteInspectorDebuggableConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = A5BA15E4182340B300A82E69 /* RemoteInspectorDebuggableConnection.h */; };
     898                A5BA15EC182340B400A82E69 /* RemoteInspectorDebuggableConnection.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15E5182340B300A82E69 /* RemoteInspectorDebuggableConnection.mm */; };
     899                A5BA15ED182340B400A82E69 /* RemoteInspectorXPCConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = A5BA15E6182340B300A82E69 /* RemoteInspectorXPCConnection.h */; };
     900                A5BA15EE182340B400A82E69 /* RemoteInspectorXPCConnection.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15E7182340B300A82E69 /* RemoteInspectorXPCConnection.mm */; };
     901                A5BA15F0182345AF00A82E69 /* RemoteInspectorDebuggable.h in Headers */ = {isa = PBXBuildFile; fileRef = A5BA15EF182345AF00A82E69 /* RemoteInspectorDebuggable.h */; settings = {ATTRIBUTES = (Private, ); }; };
    890902                A700873917CBE85300C3E643 /* MapConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A700873717CBE85300C3E643 /* MapConstructor.cpp */; };
    891903                A700873A17CBE85300C3E643 /* MapConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = A700873817CBE85300C3E643 /* MapConstructor.h */; };
     
    22002212                A1712B3E11C7B228007A5315 /* RegExpCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegExpCache.h; sourceTree = "<group>"; };
    22012213                A1712B4011C7B235007A5315 /* RegExpKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegExpKey.h; sourceTree = "<group>"; };
     2214                A594558E18245EDE00CC3843 /* RemoteInspectorDebuggable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RemoteInspectorDebuggable.cpp; path = inspector/remote/RemoteInspectorDebuggable.cpp; sourceTree = "<group>"; };
     2215                A59455901824744700CC3843 /* JSGlobalObjectDebuggable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSGlobalObjectDebuggable.cpp; sourceTree = "<group>"; };
     2216                A59455911824744700CC3843 /* JSGlobalObjectDebuggable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSGlobalObjectDebuggable.h; sourceTree = "<group>"; };
     2217                A5945594182479EB00CC3843 /* InspectorFrontendChannel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InspectorFrontendChannel.h; path = inspector/InspectorFrontendChannel.h; sourceTree = "<group>"; };
     2218                A5BA15E1182340B300A82E69 /* RemoteInspector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RemoteInspector.h; path = inspector/remote/RemoteInspector.h; sourceTree = "<group>"; };
     2219                A5BA15E2182340B300A82E69 /* RemoteInspector.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = RemoteInspector.mm; path = inspector/remote/RemoteInspector.mm; sourceTree = "<group>"; };
     2220                A5BA15E3182340B300A82E69 /* RemoteInspectorConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RemoteInspectorConstants.h; path = inspector/remote/RemoteInspectorConstants.h; sourceTree = "<group>"; };
     2221                A5BA15E4182340B300A82E69 /* RemoteInspectorDebuggableConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RemoteInspectorDebuggableConnection.h; path = inspector/remote/RemoteInspectorDebuggableConnection.h; sourceTree = "<group>"; };
     2222                A5BA15E5182340B300A82E69 /* RemoteInspectorDebuggableConnection.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = RemoteInspectorDebuggableConnection.mm; path = inspector/remote/RemoteInspectorDebuggableConnection.mm; sourceTree = "<group>"; };
     2223                A5BA15E6182340B300A82E69 /* RemoteInspectorXPCConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RemoteInspectorXPCConnection.h; path = inspector/remote/RemoteInspectorXPCConnection.h; sourceTree = "<group>"; };
     2224                A5BA15E7182340B300A82E69 /* RemoteInspectorXPCConnection.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = RemoteInspectorXPCConnection.mm; path = inspector/remote/RemoteInspectorXPCConnection.mm; sourceTree = "<group>"; };
     2225                A5BA15EF182345AF00A82E69 /* RemoteInspectorDebuggable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RemoteInspectorDebuggable.h; path = inspector/remote/RemoteInspectorDebuggable.h; sourceTree = "<group>"; };
    22022226                A700873717CBE85300C3E643 /* MapConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MapConstructor.cpp; sourceTree = "<group>"; };
    22032227                A700873817CBE85300C3E643 /* MapConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MapConstructor.h; sourceTree = "<group>"; };
     
    26982722                                0FEA09FC1705137F00BB722C /* ftl */,
    26992723                                142E312A134FF0A600AFADB5 /* heap */,
     2724                                A5BA15DF1823409200A82E69 /* inspector */,
    27002725                                1429D77A0ED20D7300B89619 /* interpreter */,
    27012726                                1429D92C0ED22D7000B89619 /* jit */,
     
    34833508                                14DE0D680D02431400AACCA2 /* JSGlobalObject.cpp */,
    34843509                                A8E894330CD0603F00367179 /* JSGlobalObject.h */,
     3510                                A59455901824744700CC3843 /* JSGlobalObjectDebuggable.cpp */,
     3511                                A59455911824744700CC3843 /* JSGlobalObjectDebuggable.h */,
    34853512                                BC756FC60E2031B200DE7D12 /* JSGlobalObjectFunctions.cpp */,
    34863513                                BC756FC70E2031B200DE7D12 /* JSGlobalObjectFunctions.h */,
     
    41514178                        sourceTree = "<group>";
    41524179                };
     4180                A5BA15DF1823409200A82E69 /* inspector */ = {
     4181                        isa = PBXGroup;
     4182                        children = (
     4183                                A5BA15E01823409D00A82E69 /* remote */,
     4184                                A5945594182479EB00CC3843 /* InspectorFrontendChannel.h */,
     4185                        );
     4186                        name = inspector;
     4187                        sourceTree = "<group>";
     4188                };
     4189                A5BA15E01823409D00A82E69 /* remote */ = {
     4190                        isa = PBXGroup;
     4191                        children = (
     4192                                A5BA15E1182340B300A82E69 /* RemoteInspector.h */,
     4193                                A5BA15E2182340B300A82E69 /* RemoteInspector.mm */,
     4194                                A5BA15E3182340B300A82E69 /* RemoteInspectorConstants.h */,
     4195                                A5BA15EF182345AF00A82E69 /* RemoteInspectorDebuggable.h */,
     4196                                A594558E18245EDE00CC3843 /* RemoteInspectorDebuggable.cpp */,
     4197                                A5BA15E4182340B300A82E69 /* RemoteInspectorDebuggableConnection.h */,
     4198                                A5BA15E5182340B300A82E69 /* RemoteInspectorDebuggableConnection.mm */,
     4199                                A5BA15E6182340B300A82E69 /* RemoteInspectorXPCConnection.h */,
     4200                                A5BA15E7182340B300A82E69 /* RemoteInspectorXPCConnection.mm */,
     4201                        );
     4202                        name = remote;
     4203                        sourceTree = "<group>";
     4204                };
    41534205/* End PBXGroup section */
    41544206
     
    42214273                                14816E1C154CC56C00B8054C /* BlockAllocator.h in Headers */,
    42224274                                BC18C3EC0E16F5CD00B34460 /* BooleanObject.h in Headers */,
     4275                                A5BA15EA182340B400A82E69 /* RemoteInspectorConstants.h in Headers */,
    42234276                                0FB7F39715ED8E4600F167B2 /* Butterfly.h in Headers */,
    42244277                                0FB7F39815ED8E4600F167B2 /* ButterflyInlines.h in Headers */,
     
    42914344                                0F05C3B41683CF9200BAF45B /* DFGArrayifySlowPathGenerator.h in Headers */,
    42924345                                0F63948515E4811B006A597C /* DFGArrayMode.h in Headers */,
     4346                                A5BA15EB182340B400A82E69 /* RemoteInspectorDebuggableConnection.h in Headers */,
    42934347                                A7D9A29517A0BC7400EE2618 /* DFGAtTailAbstractState.h in Headers */,
    42944348                                0F714CA516EA92F200F3EBEB /* DFGBackwardsPropagationPhase.h in Headers */,
     
    43664420                                0FC0976A1468A6F700CF2442 /* DFGOSRExit.h in Headers */,
    43674421                                0F235BEC17178E7300690C7F /* DFGOSRExitBase.h in Headers */,
     4422                                A5BA15ED182340B400A82E69 /* RemoteInspectorXPCConnection.h in Headers */,
    43684423                                0FFB921C16D02F110055A5DB /* DFGOSRExitCompilationInfo.h in Headers */,
    43694424                                0FC0977114693AF500CF2442 /* DFGOSRExitCompiler.h in Headers */,
     
    44244479                                0FEA0A1D1708B00700BB722C /* FTLAbstractHeap.h in Headers */,
    44254480                                0FEA0A1F1708B00700BB722C /* FTLAbstractHeapRepository.h in Headers */,
     4481                                A59455931824744700CC3843 /* JSGlobalObjectDebuggable.h in Headers */,
    44264482                                0FEA0A0A170513DB00BB722C /* FTLCapabilities.h in Headers */,
    44274483                                0FEA0A231709606900BB722C /* FTLCommonValues.h in Headers */,
     
    45164572                                0F0776BF14FF002B00102332 /* JITCompilationEffort.h in Headers */,
    45174573                                0FAF7EFE165BA91F000C8455 /* JITDisassembler.h in Headers */,
     4574                                A5BA15F0182345AF00A82E69 /* RemoteInspectorDebuggable.h in Headers */,
    45184575                                0F46808214BA572D00BFE272 /* JITExceptions.h in Headers */,
    45194576                                0FB14E1F18124ACE009B6B4D /* JITInlineCacheGenerator.h in Headers */,
     
    46874744                                142D6F1213539A4100B02E86 /* MarkStack.h in Headers */,
    46884745                                C21122E315DD9AB300790E3A /* MarkStackInlines.h in Headers */,
     4746                                A5945595182479EB00CC3843 /* InspectorFrontendChannel.h in Headers */,
    46894747                                8612E4CD152389EC00C836BE /* MatchResult.h in Headers */,
    46904748                                BC18C43C0E16F5CD00B34460 /* MathObject.h in Headers */,
     
    48554913                                14E84F9F14EE1ACC00D6D5D4 /* WeakBlock.h in Headers */,
    48564914                                14BFCE6910CDB1FC00364CCE /* WeakGCMap.h in Headers */,
     4915                                A5BA15E8182340B300A82E69 /* RemoteInspector.h in Headers */,
    48574916                                14F7256614EE265E00B1652B /* WeakHandleOwner.h in Headers */,
    48584917                                14E84FA214EE1ACC00D6D5D4 /* WeakImpl.h in Headers */,
     
    54505509                                86DB64640F95C6FC00D7D921 /* ExecutableAllocatorFixedVMPool.cpp in Sources */,
    54515510                                0F56A1D515001CF4002992B1 /* ExecutionCounter.cpp in Sources */,
     5511                                A59455921824744700CC3843 /* JSGlobalObjectDebuggable.cpp in Sources */,
    54525512                                0FB105851675480F00F8AB6E /* ExitKind.cpp in Sources */,
    54535513                                0FEA0A1C1708B00700BB722C /* FTLAbstractHeap.cpp in Sources */,
     
    56115671                                0F4680CC14BBB17A00BFE272 /* LowLevelInterpreter.cpp in Sources */,
    56125672                                14B723B212D7DA46003BD5ED /* MachineStackMarker.cpp in Sources */,
     5673                                A594558F18245EFD00CC3843 /* RemoteInspectorDebuggable.cpp in Sources */,
    56135674                                0FEB3ECF16237F6C00AB67AD /* MacroAssembler.cpp in Sources */,
    56145675                                86C568E011A213EE0007F7F0 /* MacroAssemblerARM.cpp in Sources */,
     
    57385799                                14E84FA014EE1ACC00D6D5D4 /* WeakSet.cpp in Sources */,
    57395800                                0FC8150B14043C0E00CFA603 /* WriteBarrierSupport.cpp in Sources */,
     5801                                A5BA15E9182340B300A82E69 /* RemoteInspector.mm in Sources */,
     5802                                A5BA15EC182340B400A82E69 /* RemoteInspectorDebuggableConnection.mm in Sources */,
     5803                                A5BA15EE182340B400A82E69 /* RemoteInspectorXPCConnection.mm in Sources */,
    57405804                                A7E5AB3A1799E4B200D2833D /* X86Disassembler.cpp in Sources */,
    57415805                                863C6D9C1521111A00585E4E /* YarrCanonicalizeUCS2.cpp in Sources */,
  • trunk/Source/JavaScriptCore/inspector/InspectorFrontendChannel.h

    r160098 r160099  
    11/*
    2  * Copyright (C) 2011 Google Inc. All rights reserved.
     2 * Copyright (C) 2013 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    1111 *    documentation and/or other materials provided with the distribution.
    1212 *
    13  * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
     13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
    1414 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    1515 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    16  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
     16 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
    1717 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    1818 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     
    2121 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    2222 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    23  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
     23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2424 */
    2525
     
    2727#define InspectorFrontendChannel_h
    2828
    29 #include <wtf/Forward.h>
     29#include <wtf/text/WTFString.h>
    3030
    31 namespace WebCore {
     31namespace Inspector {
    3232
    3333class InspectorFrontendChannel {
     
    3737};
    3838
    39 } // namespace WebCore
     39} // namespace Inspector
    4040
    4141#endif // !defined(InspectorFrontendChannel_h)
  • trunk/Source/JavaScriptCore/inspector/remote/RemoteInspectorConstants.h

    r160098 r160099  
    2424 */
    2525
    26 #ifndef WebInspectorRelayDefinitions_h
    27 #define WebInspectorRelayDefinitions_h
     26#ifndef RemoteInspectorConstants_h
     27#define RemoteInspectorConstants_h
    2828
    2929// WIRConstants are "Web Inspector Relay" constants shared between
    30 // the WebInspector framework on the debugger side, webinspectord,
    31 // and WebKit on the debuggable application side.
     30// the WebInspector framework on the OS X side, webinspectord, and
     31// iOS WebKit on the device side.
    3232
    3333#define WIRSimulatorTCPPortNumber               27753
  • trunk/Source/JavaScriptCore/inspector/remote/RemoteInspectorDebuggable.cpp

    r160098 r160099  
    11/*
    2  * Copyright (C) 2011 Apple Inc. All Rights Reserved.
     2 * Copyright (C) 2013 Apple Inc. All Rights Reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 @class WebInspectorRemoteChannel;
    27 @class WebInspectorServerWebViewConnectionController;
     26#include "config.h"
     27#include "RemoteInspectorDebuggable.h"
    2828
    29 @interface WebInspectorServerWebViewConnection : NSObject {
    30 @private
    31     WebInspectorRemoteChannel *_channel;
     29#if ENABLE(REMOTE_INSPECTOR)
    3230
    33     WebInspectorServerWebViewConnectionController *_controller; // weak, the controller owns us.
    34     NSString *_connectionIdentifier;
    35     NSString *_destination;
    36     NSNumber *_identifier;
     31#include "InspectorFrontendChannel.h"
     32#include "RemoteInspector.h"
     33
     34namespace Inspector {
     35
     36RemoteInspectorDebuggable::RemoteInspectorDebuggable()
     37    : m_identifier(0)
     38    , m_allowed(false)
     39{
    3740}
    3841
    39 - (id)initWithController:(WebInspectorServerWebViewConnectionController *)controller connectionIdentifier:(NSString *)connectionIdentifier destination:(NSString *)destination identifier:(NSNumber *)identifier;
    40 - (BOOL)setupChannel;
    41 - (NSString *)connectionIdentifier;
    42 - (NSNumber *)identifier;
     42RemoteInspectorDebuggable::~RemoteInspectorDebuggable()
     43{
     44    RemoteInspector::shared().unregisterDebuggable(this);
     45}
    4346
    44 // Messages from the InspectorServer.
    45 - (void)receivedData:(NSDictionary *)dictionary;
    46 - (void)receivedDidClose:(NSDictionary *)dictionary;
     47void RemoteInspectorDebuggable::init()
     48{
     49    RemoteInspector::shared().registerDebuggable(this);
     50}
    4751
    48 // Messages from the Channel.
    49 - (void)clearChannel;
    50 - (void)sendMessageToFrontend:(NSString *)message;
     52void RemoteInspectorDebuggable::update()
     53{
     54    RemoteInspector::shared().updateDebuggable(this);
     55}
    5156
    52 // Messages to the Channel.
    53 - (void)sendMessageToBackend:(NSString *)message;
     57void RemoteInspectorDebuggable::setRemoteDebuggingAllowed(bool allowed)
     58{
     59    if (m_allowed == allowed)
     60        return;
    5461
    55 @end
     62    m_allowed = allowed;
     63
     64    update();
     65}
     66
     67RemoteInspectorDebuggableInfo RemoteInspectorDebuggable::info() const
     68{
     69    RemoteInspectorDebuggableInfo info;
     70    info.identifier = identifier();
     71    info.type = type();
     72    info.name = name();
     73    info.url = url();
     74    info.hasLocalDebugger = hasLocalDebugger();
     75    info.remoteDebuggingAllowed = remoteDebuggingAllowed();
     76    return info;
     77}
     78
     79} // namespace Inspector
     80
     81#endif // ENABLE(REMOTE_INSPECTOR)
  • trunk/Source/JavaScriptCore/inspector/remote/RemoteInspectorXPCConnection.h

    r160098 r160099  
    11/*
    2  * Copyright (C) 2011 Apple Inc. All Rights Reserved.
     2 * Copyright (C) 2013 Apple Inc. All Rights Reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #import <Foundation/Foundation.h>
     26#if ENABLE(REMOTE_INSPECTOR)
     27
     28#ifndef RemoteInspectorXPCConnection_h
     29#define RemoteInspectorXPCConnection_h
     30
     31#import <dispatch/dispatch.h>
     32#import <wtf/Noncopyable.h>
    2733#import <xpc/xpc.h>
    2834
    29 @class WebInspectorXPCWrapper;
     35OBJC_CLASS NSString;
     36OBJC_CLASS NSDictionary;
    3037
    31 @protocol WebInspectorXPCWrapperDelegate <NSObject>
    32 - (void)xpcConnection:(WebInspectorXPCWrapper *)connection receivedMessage:(NSString *)messageName userInfo:(NSDictionary *)userInfo;
    33 - (void)xpcConnectionFailed:(WebInspectorXPCWrapper *)connection;
    34 @optional
    35 - (void)xpcConnection:(WebInspectorXPCWrapper *)connection unhandledMessage:(xpc_object_t)message;
    36 @end
     38namespace Inspector {
    3739
    38 @interface WebInspectorXPCWrapper : NSObject
    39 {
    40     id <WebInspectorXPCWrapperDelegate> _delegate;
    41     xpc_connection_t _connection;
    42     NSString *_tag;
    43 }
     40class RemoteInspectorXPCConnection {
     41    WTF_MAKE_NONCOPYABLE(RemoteInspectorXPCConnection);
    4442
    45 - (WebInspectorXPCWrapper *)initWithConnection:(xpc_connection_t)connection;
    46 - (void)close;
    47 - (void)sendMessage:(NSString *)messageName userInfo:(NSDictionary *)userInfo;
     43public:
     44    class Client {
     45    public:
     46        virtual ~Client() { }
     47        virtual void xpcConnectionReceivedMessage(RemoteInspectorXPCConnection*, NSString *messageName, NSDictionary *userInfo) = 0;
     48        virtual void xpcConnectionFailed(RemoteInspectorXPCConnection*) = 0;
     49        virtual void xpcConnectionUnhandledMessage(RemoteInspectorXPCConnection*, xpc_object_t) = 0;
     50    };
    4851
    49 @property (nonatomic, assign) id <WebInspectorXPCWrapperDelegate> delegate;
    50 @property (nonatomic, readonly) xpc_connection_t connection;
    51 @property (nonatomic, readonly) BOOL available;
    52 @property (nonatomic, copy) NSString *tag;
     52    RemoteInspectorXPCConnection(xpc_connection_t, Client*);
     53    virtual ~RemoteInspectorXPCConnection();
    5354
    54 @end
     55    void close();
     56    void sendMessage(NSString *messageName, NSDictionary *userInfo);
     57
     58private:
     59    NSDictionary *deserializeMessage(xpc_object_t);
     60    void handleEvent(xpc_object_t);
     61
     62    xpc_connection_t m_connection;
     63    dispatch_queue_t m_queue;
     64    Client* m_client;
     65};
     66
     67} // namespace Inspector
     68
     69#endif // RemoteInspectorXPCConnection_h
     70
     71#endif // ENABLE(REMOTE_INSPECTOR)
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp

    r159798 r160099  
    126126#endif // ENABLE(PROMISES)
    127127
     128#if ENABLE(REMOTE_INSPECTOR)
     129#include "JSGlobalObjectDebuggable.h"
     130#include "RemoteInspector.h"
     131#endif
     132
    128133#include "JSGlobalObject.lut.h"
    129134
     
    187192
    188193    m_debugger = 0;
     194
     195#if ENABLE(REMOTE_INSPECTOR)
     196    m_inspectorDebuggable = std::make_unique<JSGlobalObjectDebuggable>(*this);
     197    m_inspectorDebuggable->init();
     198    m_inspectorDebuggable->setRemoteDebuggingAllowed(true);
     199#endif
    189200
    190201    reset(prototype());
     
    761772}
    762773
     774void JSGlobalObject::setRemoteDebuggingEnabled(bool enabled)
     775{
     776#if ENABLE(REMOTE_INSPECTOR)
     777    m_inspectorDebuggable->setRemoteDebuggingAllowed(enabled);
     778#else
     779    UNUSED_PARAM(enabled);
     780#endif
     781}
     782
     783bool JSGlobalObject::remoteDebuggingEnabled() const
     784{
     785#if ENABLE(REMOTE_INSPECTOR)
     786    return m_inspectorDebuggable->remoteDebuggingAllowed();
     787#else
     788    return false;
     789#endif
     790}
     791
     792void JSGlobalObject::setName(const String& name)
     793{
     794    m_name = name;
     795
     796#if ENABLE(REMOTE_INSPECTOR)
     797    m_inspectorDebuggable->update();
     798#endif
     799}
     800
    763801} // namespace JSC
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h

    r159798 r160099  
    5959class GetterSetter;
    6060class GlobalCodeBlock;
     61class JSGlobalObjectDebuggable;
    6162class JSPromisePrototype;
    6263class JSPromiseResolverPrototype;
     
    230231    void* m_specialPointers[Special::TableSize]; // Special pointers used by the LLInt and JIT.
    231232
     233    String m_name;
     234
    232235    Debugger* m_debugger;
     236
     237#if ENABLE(REMOTE_INSPECTOR)
     238    std::unique_ptr<JSGlobalObjectDebuggable> m_inspectorDebuggable;
     239#endif
    233240
    234241    RefPtr<WatchpointSet> m_masqueradesAsUndefinedWatchpoint;
     
    421428#endif // ENABLE(PROMISES)
    422429
     430    JS_EXPORT_PRIVATE void setRemoteDebuggingEnabled(bool);
     431    JS_EXPORT_PRIVATE bool remoteDebuggingEnabled() const;
     432
     433    void setName(const String&);
     434    const String& name() const { return m_name; }
     435
    423436    JSArrayBufferPrototype* arrayBufferPrototype() const { return m_arrayBufferPrototype.get(); }
    424437
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObjectDebuggable.cpp

    r160098 r160099  
    11/*
    2  * Copyright (C) 2011 Apple Inc. All Rights Reserved.
     2 * Copyright (C) 2013 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #import <Foundation/Foundation.h>
    27 #import <xpc/xpc.h>
     26#include "config.h"
     27#include "JSGlobalObjectDebuggable.h"
    2828
    29 @class WebInspectorXPCWrapper;
     29#if ENABLE(REMOTE_INSPECTOR)
    3030
    31 @protocol WebInspectorXPCWrapperDelegate <NSObject>
    32 - (void)xpcConnection:(WebInspectorXPCWrapper *)connection receivedMessage:(NSString *)messageName userInfo:(NSDictionary *)userInfo;
    33 - (void)xpcConnectionFailed:(WebInspectorXPCWrapper *)connection;
    34 @optional
    35 - (void)xpcConnection:(WebInspectorXPCWrapper *)connection unhandledMessage:(xpc_object_t)message;
    36 @end
     31#include "InspectorFrontendChannel.h"
     32#include "JSGlobalObject.h"
     33#include "RemoteInspector.h"
    3734
    38 @interface WebInspectorXPCWrapper : NSObject
     35using namespace Inspector;
     36
     37namespace JSC {
     38
     39JSGlobalObjectDebuggable::JSGlobalObjectDebuggable(JSGlobalObject& globalObject)
     40    : m_globalObject(globalObject)
    3941{
    40     id <WebInspectorXPCWrapperDelegate> _delegate;
    41     xpc_connection_t _connection;
    42     NSString *_tag;
    4342}
    4443
    45 - (WebInspectorXPCWrapper *)initWithConnection:(xpc_connection_t)connection;
    46 - (void)close;
    47 - (void)sendMessage:(NSString *)messageName userInfo:(NSDictionary *)userInfo;
     44String JSGlobalObjectDebuggable::name() const
     45{
     46    String name = m_globalObject.name();
     47    return name.isEmpty() ? ASCIILiteral("JSContext") : name;
     48}
    4849
    49 @property (nonatomic, assign) id <WebInspectorXPCWrapperDelegate> delegate;
    50 @property (nonatomic, readonly) xpc_connection_t connection;
    51 @property (nonatomic, readonly) BOOL available;
    52 @property (nonatomic, copy) NSString *tag;
     50void JSGlobalObjectDebuggable::connect(InspectorFrontendChannel*)
     51{
     52    // FIXME: Implement.
     53    // Create an InspectorController, InspectorFrontend, InspectorBackend, and Agents.
     54    // "InspectorController::connectFrontend".
     55}
    5356
    54 @end
     57void JSGlobalObjectDebuggable::disconnect()
     58{
     59    // FIXME: Implement.
     60    // "InspectorController::disconnectFrontend".
     61}
     62
     63void JSGlobalObjectDebuggable::dispatchMessageFromRemoteFrontend(const String&)
     64{
     65    // FIXME: Implement.
     66    // "InspectorController::dispatchMessageFromFrontend"
     67}
     68
     69} // namespace JSC
     70
     71#endif // ENABLE(REMOTE_INSPECTOR)
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObjectDebuggable.h

    r160098 r160099  
    11/*
    2  * Copyright (C) 2011 Apple Inc. All Rights Reserved.
     2 * Copyright (C) 2013 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #import <wtf/HashMap.h>
     26#ifndef JSGlobalObjectDebuggable_h
     27#define JSGlobalObjectDebuggable_h
    2728
    28 class WebInspectorClient;
     29#if ENABLE(REMOTE_INSPECTOR)
    2930
    30 @protocol WebInspectorClientRegistryDelegate
    31 - (void)didRegisterClient:(WebInspectorClient*)client;
    32 - (void)didUnregisterClient:(WebInspectorClient*)client;
    33 @end
     31#include "RemoteInspectorDebuggable.h"
     32#include <wtf/Noncopyable.h>
    3433
    35 @interface WebInspectorClientRegistry : NSObject {
    36 @private
    37     unsigned _nextAvailablePageId;
    38     HashMap<unsigned, WebInspectorClient*> _pageClientMap;
    39     id <WebInspectorClientRegistryDelegate> _delegate;
    40 }
     34namespace JSC {
    4135
    42 @property (nonatomic, assign) id <WebInspectorClientRegistryDelegate> delegate;
     36class JSGlobalObject;
    4337
    44 + (WebInspectorClientRegistry *)sharedRegistry;
     38class JSGlobalObjectDebuggable FINAL : public Inspector::RemoteInspectorDebuggable {
     39    WTF_MAKE_NONCOPYABLE(JSGlobalObjectDebuggable);
     40public:
     41    JSGlobalObjectDebuggable(JSGlobalObject&);
     42    ~JSGlobalObjectDebuggable() { }
    4543
    46 - (void)registerClient:(WebInspectorClient*)client;
    47 - (void)unregisterClient:(WebInspectorClient*)client;
    48 - (WebInspectorClient*)clientForPageId:(unsigned)pageId;
    49 - (NSDictionary *)inspectableWebViews;
     44    virtual Inspector::RemoteInspectorDebuggable::DebuggableType type() const OVERRIDE { return Inspector::RemoteInspectorDebuggable::JavaScript; }
    5045
    51 @end
     46    virtual String name() const OVERRIDE;
     47    virtual bool hasLocalDebugger() const OVERRIDE { return false; }
     48
     49    virtual void connect(Inspector::InspectorFrontendChannel*) OVERRIDE;
     50    virtual void disconnect() OVERRIDE;
     51    virtual void dispatchMessageFromRemoteFrontend(const String& message) OVERRIDE;
     52
     53private:
     54    JSGlobalObject& m_globalObject;
     55};
     56
     57} // namespace JSC
     58
     59#endif // ENABLE(REMOTE_INSPECTOR)
     60
     61#endif // !defined(JSGlobalObjectDebuggable_h)
  • trunk/Source/WTF/ChangeLog

    r160063 r160099  
     12013-12-03  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Push Remote Inspector debugging connection management into JavaScriptCore
     4        https://bugs.webkit.org/show_bug.cgi?id=124613
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * wtf/ios/WebCoreThread.cpp:
     9        * wtf/ios/WebCoreThread.h:
     10        Expose WebThreadRun/WebThreadRunSync iOS methods defined in WebCore through
     11        WTF so that JavaScriptCore can use it. Another such method already existed.
     12
    1132013-12-03  Mark Lam  <mark.lam@apple.com>
    214
  • trunk/Source/WTF/wtf/ios/WebCoreThread.cpp

    r154307 r160099  
    2929#if USE(WEB_THREAD)
    3030WTF_EXPORT_PRIVATE bool (*WebCoreWebThreadIsLockedOrDisabled)(void);
     31WTF_EXPORT_PRIVATE bool (*WebCoreWebThreadIsEnabled)(void);
     32WTF_EXPORT_PRIVATE void (*WebCoreWebThreadRun)(void (^block)());
     33WTF_EXPORT_PRIVATE void (*WebCoreWebThreadRunSync)(void (^block)());
    3134#endif
  • trunk/Source/WTF/wtf/ios/WebCoreThread.h

    r154307 r160099  
    3434
    3535extern bool (*WebCoreWebThreadIsLockedOrDisabled)(void);
     36extern bool (*WebCoreWebThreadIsEnabled)(void);
     37extern void (*WebCoreWebThreadRun)(void (^block)());
     38extern void (*WebCoreWebThreadRunSync)(void (^block)());
    3639
    3740#ifdef __cplusplus
  • trunk/Source/WebCore/ChangeLog

    r160098 r160099  
     12013-12-03  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Push Remote Inspector debugging connection management into JavaScriptCore
     4        https://bugs.webkit.org/show_bug.cgi?id=124613
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        Make a WebCore::Page a "Web" Remote Debuggable.
     9
     10        * bindings/js/JSDOMGlobalObject.cpp:
     11        Disable JavaScript context inspection on JSGlobalObjects inside WebCore::Page's.
     12
     13        * page/Page.cpp:
     14        (WebCore::Page::Page):
     15        (WebCore::Page::remoteInspectionAllowed):
     16        (WebCore::Page::setRemoteInspectionAllowed):
     17        (WebCore::Page::remoteInspectorInformationDidChange):
     18        * page/Page.h:
     19        * page/PageDebuggable.h:
     20        * page/PageDebuggable.cpp: Added.
     21        (WebCore::PageDebuggable::PageDebuggable):
     22        (WebCore::PageDebuggable::name):
     23        (WebCore::PageDebuggable::url):
     24        (WebCore::PageDebuggable::hasLocalDebugger):
     25        (WebCore::PageDebuggable::connect):
     26        (WebCore::PageDebuggable::disconnect):
     27        (WebCore::PageDebuggable::dispatchMessageFromRemoteFrontend):
     28        (WebCore::PageDebuggable::setIndicating):
     29        Make a page a "Web" debuggable.
     30
     31        * GNUmakefile.list.am:
     32        * WebCore.exp.in:
     33        * WebCore.vcxproj/WebCore.vcxproj:
     34        * WebCore.vcxproj/WebCore.vcxproj.filters:
     35        * WebCore.xcodeproj/project.pbxproj:
     36        Misc.
     37
     38        * inspector/InspectorClient.h:
     39        (WebCore::InspectorClient::indicate):
     40        (WebCore::InspectorClient::hideIndicate):
     41        Forward indicate methods to WebKit clients.
     42
     43        * loader/FrameLoader.cpp:
     44        (WebCore::FrameLoader::didChangeTitle):
     45        (WebCore::FrameLoader::dispatchDidCommitLoad):
     46        Push updates when remote debuggable information like the Page's
     47        URL or title change.
     48
     49        * ForwardingHeaders/inspector/InspectorFrontendChannel.h:
     50        * inspector/InspectorForwarding.h:
     51        Re-export Inspector::InspectorFrontendChannel as WebCore::InspectorFrontendChannel
     52        to avoid needlessly updating code all over the place.
     53
     54        * inspector/CodeGeneratorInspectorStrings.py:
     55        * inspector/InspectorWorkerAgent.cpp:
     56        * inspector/WorkerInspectorController.cpp:
     57        * testing/Internals.cpp:
     58        Update include names.
     59
     60        * page/ContextMenuController.cpp:
     61        (WebCore::ContextMenuController::populate):
     62        Make the "Inspect Element" context menu work correctly when there is a
     63        remote inspector instead of a local inspector.
     64
    1652013-12-03  Joseph Pecoraro  <pecoraro@apple.com>
    266
  • trunk/Source/WebCore/GNUmakefile.list.am

    r160030 r160099  
    38163816        Source/WebCore/inspector/InspectorDOMStorageAgent.cpp \
    38173817        Source/WebCore/inspector/InspectorDOMStorageAgent.h \
    3818         Source/WebCore/inspector/InspectorFrontendChannel.h \
     3818        Source/WebCore/inspector/InspectorForwarding.h \
    38193819        Source/WebCore/inspector/InspectorFrontendClient.h \
    38203820        Source/WebCore/inspector/InspectorFrontendClientLocal.cpp \
  • trunk/Source/WebCore/WebCore.exp.in

    r160050 r160099  
    28052805
    28062806#if ENABLE(REMOTE_INSPECTOR)
     2807__ZN7WebCore4Page26setRemoteInspectionAllowedEb
    28072808__ZN7WebCore19InspectorController27dispatchMessageFromFrontendERKN3WTF6StringE
    28082809#endif
  • trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj

    r160030 r160099  
    2096120961    <ClInclude Include="..\inspector\InspectorDOMDebuggerAgent.h" />
    2096220962    <ClInclude Include="..\inspector\InspectorDOMStorageAgent.h" />
    20963     <ClInclude Include="..\inspector\InspectorFrontendChannel.h" />
     20963    <ClInclude Include="..\inspector\InspectorForwarding.h" />
    2096420964    <ClInclude Include="..\inspector\InspectorFrontendClient.h" />
    2096520965    <ClInclude Include="..\inspector\InspectorFrontendClientLocal.h" />
  • trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters

    r160030 r160099  
    266266      <UniqueIdentifier>{82ba9bb4-eaa0-4973-9bb3-a27667a1c167}</UniqueIdentifier>
    267267    </Filter>
     268    <Filter Include="ForwardingHeaders\inspector">
     269      <UniqueIdentifier>{132bade2-0aab-6274-0adff-ae8aed5aed4}</UniqueIdentifier>
     270    </Filter>
    268271    <Filter Include="history">
    269272      <UniqueIdentifier>{6f39dedf-2d3a-414e-83fe-7bf64f911cfb}</UniqueIdentifier>
     
    1223212235      <Filter>ForwardingHeaders\heap</Filter>
    1223312236    </ClInclude>
     12237    <ClInclude Include="..\ForwardingHeaders\inspector\InspectorForwarding.h">
     12238      <Filter>ForwardingHeaders\inspector</Filter>
     12239    </ClInclude>
    1223412240    <ClInclude Include="..\history\BackForwardClient.h">
    1223512241      <Filter>history</Filter>
     
    1243612442      <Filter>inspector</Filter>
    1243712443    </ClInclude>
    12438     <ClInclude Include="..\inspector\InspectorFrontendChannel.h">
     12444    <ClInclude Include="..\inspector\InspectorForwarding.h">
    1243912445      <Filter>inspector</Filter>
    1244012446    </ClInclude>
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r160098 r160099  
    886886                20D629261253690B00081543 /* InspectorInstrumentation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 20D629241253690B00081543 /* InspectorInstrumentation.cpp */; };
    887887                20D629271253690B00081543 /* InspectorInstrumentation.h in Headers */ = {isa = PBXBuildFile; fileRef = 20D629251253690B00081543 /* InspectorInstrumentation.h */; };
    888                 227777601345DEA9008EA455 /* InspectorFrontendChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 2277775F1345DEA9008EA455 /* InspectorFrontendChannel.h */; settings = {ATTRIBUTES = (Private, ); }; };
     888                227777601345DEA9008EA455 /* InspectorForwarding.h in Headers */ = {isa = PBXBuildFile; fileRef = 2277775F1345DEA9008EA455 /* InspectorForwarding.h */; settings = {ATTRIBUTES = (Private, ); }; };
    889889                228C284510D82500009D0D0E /* ScriptWrappable.h in Headers */ = {isa = PBXBuildFile; fileRef = 228C284410D82500009D0D0E /* ScriptWrappable.h */; settings = {ATTRIBUTES = (Private, ); }; };
    890890                2292B27C1356669400CF11EF /* ImageBufferDataCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2292B27B1356669400CF11EF /* ImageBufferDataCG.cpp */; };
     
    35283528                A5732B0A136A161D005C8D7C /* DateComponents.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5732B08136A161D005C8D7C /* DateComponents.cpp */; };
    35293529                A5732B0B136A161D005C8D7C /* DateComponents.h in Headers */ = {isa = PBXBuildFile; fileRef = A5732B09136A161D005C8D7C /* DateComponents.h */; };
     3530                A5A2AF0B1829734300DE1729 /* PageDebuggable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5A2AF091829734300DE1729 /* PageDebuggable.cpp */; };
     3531                A5A2AF0C1829734300DE1729 /* PageDebuggable.h in Headers */ = {isa = PBXBuildFile; fileRef = A5A2AF0A1829734300DE1729 /* PageDebuggable.h */; };
    35303532                A5ABB78713B904BC00F197E3 /* LineBreakIteratorPoolICU.h in Headers */ = {isa = PBXBuildFile; fileRef = A5ABB78613B904BC00F197E3 /* LineBreakIteratorPoolICU.h */; };
    35313533                A5AC4AEF18336975007114E0 /* InspectorBackendDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5AC4AED18336975007114E0 /* InspectorBackendDispatcher.cpp */; };
     
    75117513                20D629241253690B00081543 /* InspectorInstrumentation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorInstrumentation.cpp; sourceTree = "<group>"; };
    75127514                20D629251253690B00081543 /* InspectorInstrumentation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorInstrumentation.h; sourceTree = "<group>"; };
    7513                 2277775F1345DEA9008EA455 /* InspectorFrontendChannel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorFrontendChannel.h; sourceTree = "<group>"; };
     7515                2277775F1345DEA9008EA455 /* InspectorForwarding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorForwarding.h; sourceTree = "<group>"; };
    75147516                228C284410D82500009D0D0E /* ScriptWrappable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptWrappable.h; sourceTree = "<group>"; };
    75157517                2292B27B1356669400CF11EF /* ImageBufferDataCG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ImageBufferDataCG.cpp; sourceTree = "<group>"; };
     
    1034310345                A593CF7418402D4B00BFCE27 /* CodeGeneratorInspectorStrings.py */ = {isa = PBXFileReference; lastKnownFileType = text.script.python; path = CodeGeneratorInspectorStrings.py; sourceTree = "<group>"; };
    1034410346                A593CF7518402D4B00BFCE27 /* combine-javascript-resources.pl */ = {isa = PBXFileReference; lastKnownFileType = text.script.perl; path = "combine-javascript-resources.pl"; sourceTree = "<group>"; };
     10347                A5A2AF091829734300DE1729 /* PageDebuggable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageDebuggable.cpp; sourceTree = "<group>"; };
     10348                A5A2AF0A1829734300DE1729 /* PageDebuggable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageDebuggable.h; sourceTree = "<group>"; };
    1034510349                A5ABB78613B904BC00F197E3 /* LineBreakIteratorPoolICU.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LineBreakIteratorPoolICU.h; sourceTree = "<group>"; };
    1034610350                A5AC4AED18336975007114E0 /* InspectorBackendDispatcher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorBackendDispatcher.cpp; sourceTree = "<group>"; };
     
    1451114515                                7A74ECB8101839A500BF939E /* InspectorDOMStorageAgent.cpp */,
    1451214516                                7A74ECB9101839A600BF939E /* InspectorDOMStorageAgent.h */,
    14513                                 2277775F1345DEA9008EA455 /* InspectorFrontendChannel.h */,
     14517                                2277775F1345DEA9008EA455 /* InspectorForwarding.h */,
    1451414518                                F344C7121125B82C00F26EEE /* InspectorFrontendClient.h */,
    1451514519                                F344C75711294FF600F26EEE /* InspectorFrontendClientLocal.cpp */,
     
    1572015724                                DAACB3D916F2416400666135 /* PageConsole.cpp */,
    1572115725                                DAACB3DA16F2416400666135 /* PageConsole.h */,
     15726                                A5A2AF091829734300DE1729 /* PageDebuggable.cpp */,
     15727                                A5A2AF0A1829734300DE1729 /* PageDebuggable.h */,
    1572215728                                9302B0BC0D79F82900C7EE83 /* PageGroup.cpp */,
    1572315729                                9302B0BE0D79F82C00C7EE83 /* PageGroup.h */,
     
    2307923085                                E4D58EBB17B8F12800CBDCA8 /* ElementTraversal.h in Headers */,
    2308023086                                93B77A380ADD792500EA4B81 /* FrameLoaderTypes.h in Headers */,
     23087                                A5A2AF0C1829734300DE1729 /* PageDebuggable.h in Headers */,
    2308123088                                658436860AE01B7400E53753 /* FrameLoadRequest.h in Headers */,
    2308223089                                628D214E12131EF40055DCFC /* FrameNetworkingContext.h in Headers */,
     
    2336723374                                0705853417FDE6D9005F2BCB /* JSMediaTrackConstraints.h in Headers */,
    2336823375                                578DA20E1520EB8C006141C1 /* InspectorFrontend.h in Headers */,
    23369                                 227777601345DEA9008EA455 /* InspectorFrontendChannel.h in Headers */,
     23376                                227777601345DEA9008EA455 /* InspectorForwarding.h in Headers */,
    2337023377                                F344C7141125B82C00F26EEE /* InspectorFrontendClient.h in Headers */,
    2337123378                                F344C75311294D9D00F26EEE /* InspectorFrontendClientLocal.h in Headers */,
     
    2781927826                                C5A1EA7C152BCF04004D00B6 /* SimplifyMarkupCommand.cpp in Sources */,
    2782027827                                FD00D7A414A3F61900734011 /* SincResampler.cpp in Sources */,
     27828                                A5A2AF0B1829734300DE1729 /* PageDebuggable.cpp in Sources */,
    2782127829                                51327D6111A33A2B004F9D65 /* SinkDocument.cpp in Sources */,
    2782227830                                49E911CC0EF86D47009D0CAF /* SkewTransformOperation.cpp in Sources */,
  • trunk/Source/WebCore/bindings/js/JSDOMGlobalObject.cpp

    r159679 r160099  
    5757    Base::finishCreation(vm);
    5858    ASSERT(inherits(info()));
     59
     60#if ENABLE(REMOTE_INSPECTOR)
     61    setRemoteDebuggingEnabled(false);
     62#endif
    5963}
    6064
     
    6367    Base::finishCreation(vm, thisValue);
    6468    ASSERT(inherits(info()));
     69
     70#if ENABLE(REMOTE_INSPECTOR)
     71    setRemoteDebuggingEnabled(false);
     72#endif
    6573}
    6674
  • trunk/Source/WebCore/inspector/CodeGeneratorInspectorStrings.py

    r159308 r160099  
    180180#include "InspectorAgent.h"
    181181#include "InspectorValues.h"
    182 #include "InspectorFrontendChannel.h"
     182#include "InspectorForwarding.h"
    183183#include <wtf/text/CString.h>
    184184#include <wtf/text/WTFString.h>
     
    201201#include "InspectorFrontend.h"
    202202
    203 #include "InspectorFrontendChannel.h"
     203#include "InspectorForwarding.h"
    204204#include <wtf/text/CString.h>
    205205#include <wtf/text/WTFString.h>
  • trunk/Source/WebCore/inspector/InspectorBackendDispatcher.cpp

    r159289 r160099  
    3030#if ENABLE(INSPECTOR)
    3131
    32 #include "InspectorFrontendChannel.h"
     32#include "InspectorForwarding.h"
    3333#include "InspectorValues.h"
    3434#include <wtf/text/CString.h>
  • trunk/Source/WebCore/inspector/InspectorClient.h

    r158415 r160099  
    5353    virtual void hideHighlight() = 0;
    5454
     55    virtual void indicate() { }
     56    virtual void hideIndication() { }
     57
    5558    virtual bool canClearBrowserCache() { return false; }
    5659    virtual void clearBrowserCache() { }
  • trunk/Source/WebCore/inspector/InspectorController.cpp

    r160012 r160099  
    8585    , m_inspectorClient(inspectorClient)
    8686    , m_isUnderTest(false)
     87#if ENABLE(REMOTE_INSPECTOR)
     88    , m_hasRemoteFrontend(false)
     89#endif
    8790{
    8891    OwnPtr<InspectorAgent> inspectorAgentPtr(InspectorAgent::create(page, m_injectedScriptManager.get(), m_instrumentingAgents.get()));
     
    149152
    150153    m_agents.append(InspectorHeapProfilerAgent::create(m_instrumentingAgents.get(), m_injectedScriptManager.get()));
    151 
    152154#endif
    153155
     
    204206}
    205207
     208bool InspectorController::hasLocalFrontend() const
     209{
     210#if ENABLE(REMOTE_INSPECTOR)
     211    return hasFrontend() && !m_hasRemoteFrontend;
     212#else
     213    return hasFrontend();
     214#endif
     215}
     216
     217bool InspectorController::hasRemoteFrontend() const
     218{
     219#if ENABLE(REMOTE_INSPECTOR)
     220    return m_hasRemoteFrontend;
     221#else
     222    return false;
     223#endif
     224}
     225
    206226bool InspectorController::hasInspectorFrontendClient() const
    207227{
     
    234254    InspectorInstrumentation::registerInstrumentingAgents(m_instrumentingAgents.get());
    235255    InspectorInstrumentation::frontendCreated();
     256
     257#if ENABLE(REMOTE_INSPECTOR)
     258    if (!m_hasRemoteFrontend)
     259        m_page->remoteInspectorInformationDidChange();
     260#endif
    236261}
    237262
     
    251276    InspectorInstrumentation::frontendDeleted();
    252277    InspectorInstrumentation::unregisterInstrumentingAgents(m_instrumentingAgents.get());
     278
     279#if ENABLE(REMOTE_INSPECTOR)
     280    if (!m_hasRemoteFrontend)
     281        m_page->remoteInspectorInformationDidChange();
     282#endif
    253283}
    254284
    255285void InspectorController::show()
    256286{
     287    ASSERT(!hasRemoteFrontend());
     288
    257289    if (!enabled())
    258290        return;
     
    311343        return;
    312344
    313     show();
     345    if (!hasRemoteFrontend())
     346        show();
    314347
    315348    m_domAgent->inspect(node);
     
    346379{
    347380    return m_overlay->highlightedNode();
     381}
     382
     383void InspectorController::setIndicating(bool indicating)
     384{
     385    // FIXME: For non-iOS clients, we should have InspectorOverlay do something here.
     386    if (indicating)
     387        m_inspectorClient->indicate();
     388    else
     389        m_inspectorClient->hideIndication();
    348390}
    349391
  • trunk/Source/WebCore/inspector/InspectorController.h

    r160013 r160099  
    9292    void dispatchMessageFromFrontend(const String& message);
    9393
     94    bool hasFrontend() const { return !!m_inspectorFrontendChannel; }
     95    bool hasLocalFrontend() const;
     96    bool hasRemoteFrontend() const;
     97
    9498    void connectFrontend(InspectorFrontendChannel*);
    9599    void disconnectFrontend();
    96100    void setProcessId(long);
     101
     102#if ENABLE(REMOTE_INSPECTOR)
     103    void setHasRemoteFrontend(bool hasRemote) { m_hasRemoteFrontend = hasRemote; }
     104#endif
    97105
    98106    void inspect(Node*);
     
    101109    void hideHighlight();
    102110    Node* highlightedNode() const;
     111
     112    void setIndicating(bool);
    103113
    104114    PassRefPtr<InspectorObject> buildObjectForHighlightedNode() const;
     
    152162    InspectorAgentRegistry m_agents;
    153163    bool m_isUnderTest;
     164
     165#if ENABLE(REMOTE_INSPECTOR)
     166    bool m_hasRemoteFrontend;
     167#endif
    154168};
    155169
  • trunk/Source/WebCore/inspector/InspectorForwarding.h

    r160098 r160099  
    11/*
    2  * Copyright (C) 2011 Apple Inc. All Rights Reserved.
     2 * Copyright (C) 2013 Apple Inc. All Rights Reserved.
     3 * Copyright (C) 2011 Google Inc.  All rights reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    1112 *    documentation and/or other materials provided with the distribution.
    1213 *
    13  * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
     14 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
    1415 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    1516 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    16  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
     17 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
    1718 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    1819 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     
    2425 */
    2526
    26 class WebInspectorClient;
    27 @class WebInspectorServerWebViewConnection;
     27#ifndef InspectorForwarding_h
     28#define InspectorForwarding_h
    2829
    29 @interface WebInspectorRemoteChannel : NSObject {
    30 @private
    31     WebInspectorServerWebViewConnection *_remote;
    32     WebInspectorClient* _local;
     30#include <inspector/InspectorFrontendChannel.h>
     31
     32namespace WebCore {
     33class InspectorFrontendChannel : public Inspector::InspectorFrontendChannel { };
    3334}
    3435
    35 + (WebInspectorRemoteChannel *)createChannelForPageId:(unsigned)pageId connection:(WebInspectorServerWebViewConnection *)connection;
    36 
    37 - (void)closeFromLocalSide;
    38 - (void)closeFromRemoteSide;
    39 - (void)sendMessageToFrontend:(NSString *)message;
    40 - (void)sendMessageToBackend:(NSString *)message;
    41 
    42 @end
     36#endif // !defined(InspectorForwarding_h)
  • trunk/Source/WebCore/inspector/InspectorWorkerAgent.cpp

    r159679 r160099  
    3535#include "InspectorWorkerAgent.h"
    3636
     37#include "InspectorForwarding.h"
    3738#include "InspectorFrontend.h"
    38 #include "InspectorFrontendChannel.h"
    3939#include "InspectorValues.h"
    4040#include "InstrumentingAgents.h"
  • trunk/Source/WebCore/inspector/WorkerInspectorController.cpp

    r159679 r160099  
    4040#include "InspectorClient.h"
    4141#include "InspectorConsoleAgent.h"
     42#include "InspectorForwarding.h"
    4243#include "InspectorFrontend.h"
    43 #include "InspectorFrontendChannel.h"
    4444#include "InspectorHeapProfilerAgent.h"
    4545#include "InspectorProfilerAgent.h"
  • trunk/Source/WebCore/loader/FrameLoader.cpp

    r159986 r160099  
    33203320        m_client.dispatchDidReceiveTitle(loader->title());
    33213321    }
     3322
     3323#if ENABLE(REMOTE_INSPECTOR)
     3324    if (m_frame.isMainFrame())
     3325        m_frame.page()->remoteInspectorInformationDidChange();
     3326#endif
    33223327}
    33233328
     
    33413346    InspectorInstrumentation::didCommitLoad(&m_frame, m_documentLoader.get());
    33423347
    3343     if (m_frame.isMainFrame())
     3348    if (m_frame.isMainFrame()) {
    33443349        m_frame.page()->featureObserver()->didCommitLoad();
    3345 
     3350#if ENABLE(REMOTE_INSPECTOR)
     3351        m_frame.page()->remoteInspectorInformationDidChange();
     3352#endif
     3353    }
    33463354}
    33473355
  • trunk/Source/WebCore/page/ContextMenuController.cpp

    r158629 r160099  
    893893            } else {
    894894#if ENABLE(INSPECTOR)
    895                 if (!(frame->page() && frame->page()->inspectorController()->hasInspectorFrontendClient())) {
     895                if (!(frame->page() && (frame->page()->inspectorController()->hasInspectorFrontendClient() || frame->page()->inspectorController()->hasRemoteFrontend()))) {
    896896#endif
    897897
  • trunk/Source/WebCore/page/Page.cpp

    r158461 r160099  
    6060#include "PageCache.h"
    6161#include "PageConsole.h"
     62#include "PageDebuggable.h"
    6263#include "PageGroup.h"
    6364#include "PageThrottler.h"
     
    187188    , m_pageThrottler(std::make_unique<PageThrottler>(*this))
    188189    , m_console(std::make_unique<PageConsole>(*this))
     190#if ENABLE(REMOTE_INSPECTOR)
     191    , m_inspectorDebuggable(std::make_unique<PageDebuggable>(*this))
     192#endif
    189193    , m_lastSpatialNavigationCandidatesCount(0) // NOTE: Only called from Internals for Spatial Navigation testing.
    190194    , m_framesHandlingBeforeUnloadEvent(0)
     
    203207#ifndef NDEBUG
    204208    pageCounter.increment();
     209#endif
     210
     211#if ENABLE(REMOTE_INSPECTOR)
     212    m_inspectorDebuggable->init();
    205213#endif
    206214}
     
    12921300#endif
    12931301
     1302#if ENABLE(REMOTE_INSPECTOR)
     1303bool Page::remoteInspectionAllowed() const
     1304{
     1305    return m_inspectorDebuggable->remoteDebuggingAllowed();
     1306}
     1307
     1308void Page::setRemoteInspectionAllowed(bool allowed)
     1309{
     1310    m_inspectorDebuggable->setRemoteDebuggingAllowed(allowed);
     1311}
     1312
     1313void Page::remoteInspectorInformationDidChange() const
     1314{
     1315    m_inspectorDebuggable->update();
     1316}
     1317#endif
     1318
    12941319void Page::addLayoutMilestones(LayoutMilestones milestones)
    12951320{
  • trunk/Source/WebCore/page/Page.h

    r158416 r160099  
    8181class PageActivityAssertionToken;
    8282class PageConsole;
     83class PageDebuggable;
    8384class PageGroup;
    8485class PageThrottler;
     
    179180    int subframeCount() const { checkSubframeCountConsistency(); return m_subframeCount; }
    180181
     182#if ENABLE(REMOTE_INSPECTOR)
     183    bool remoteInspectionAllowed() const;
     184    void setRemoteInspectionAllowed(bool);
     185    void remoteInspectorInformationDidChange() const;
     186#endif
     187
    181188    Chrome& chrome() const { return *m_chrome; }
    182189    DragCaretController& dragCaretController() const { return *m_dragCaretController; }
     
    533540    const std::unique_ptr<PageConsole> m_console;
    534541
     542#if ENABLE(REMOTE_INSPECTOR)
     543    const std::unique_ptr<PageDebuggable> m_inspectorDebuggable;
     544#endif
     545
    535546    HashSet<String> m_seenPlugins;
    536547    HashSet<String> m_seenMediaEngines;
  • trunk/Source/WebCore/page/PageDebuggable.h

    r160098 r160099  
    11/*
    2  * Copyright (C) 2012 Apple Inc. All Rights Reserved.
     2 * Copyright (C) 2013 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 @class WebInspectorServer;
    27 @class WebInspectorServerWebViewConnection;
    28 @class WebInspectorXPCWrapper;
     26#ifndef PageDebuggable_h
     27#define PageDebuggable_h
    2928
    30 @interface WebInspectorServerWebViewConnectionController : NSObject {
    31 @private
    32     WebInspectorServer *_server; // weak, the server should never deallocate.
    33     NSMutableDictionary *_openConnections;
    34     BOOL _hasScheduledPush;
    35 }
     29#if ENABLE(REMOTE_INSPECTOR)
    3630
    37 - (id)initWithServer:(WebInspectorServer *)server;
     31#include <JavaScriptCore/RemoteInspectorDebuggable.h>
     32#include <wtf/Noncopyable.h>
    3833
    39 - (void)closeAllConnections;
     34namespace WebCore {
    4035
    41 - (void)pushListing;
    42 - (void)receivedMessage:(NSString *)messageName userInfo:(NSDictionary *)userInfo;
     36class Page;
    4337
    44 - (void)connectionClosing:(WebInspectorServerWebViewConnection *)connection;
     38class PageDebuggable FINAL : public Inspector::RemoteInspectorDebuggable {
     39    WTF_MAKE_NONCOPYABLE(PageDebuggable);
     40public:
     41    PageDebuggable(Page&);
     42    ~PageDebuggable() { }
    4543
    46 - (void)sendMessageToFrontend:(NSString *)messageName userInfo:(NSDictionary *)userInfo;
     44    virtual Inspector::RemoteInspectorDebuggable::DebuggableType type() const OVERRIDE { return Inspector::RemoteInspectorDebuggable::Web; }
    4745
    48 @end
     46    virtual String name() const OVERRIDE;
     47    virtual String url() const OVERRIDE;
     48    virtual bool hasLocalDebugger() const OVERRIDE;
     49
     50    virtual void connect(Inspector::InspectorFrontendChannel*) OVERRIDE;
     51    virtual void disconnect() OVERRIDE;
     52    virtual void dispatchMessageFromRemoteFrontend(const String& message) OVERRIDE;
     53    virtual void setIndicating(bool) OVERRIDE;
     54
     55private:
     56    Page& m_page;
     57};
     58
     59} // namespace WebCore
     60
     61#endif // ENABLE(REMOTE_INSPECTOR)
     62
     63#endif // !defined(PageDebuggable_h)
  • trunk/Source/WebCore/testing/Internals.cpp

    r159679 r160099  
    6060#include "InspectorController.h"
    6161#include "InspectorCounters.h"
    62 #include "InspectorFrontendChannel.h"
     62#include "InspectorForwarding.h"
    6363#include "InspectorFrontendClientLocal.h"
    6464#include "InspectorInstrumentation.h"
  • trunk/Source/WebKit/ChangeLog

    r160017 r160099  
     12013-12-03  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Push Remote Inspector debugging connection management into JavaScriptCore
     4        https://bugs.webkit.org/show_bug.cgi?id=124613
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * WebKit.xcodeproj/project.pbxproj:
     9
    1102013-12-03  Brent Fulgham  <bfulgham@apple.com>
    211
  • trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj

    r159831 r160099  
    379379                A10C1D8E1820305E0036883A /* WebPDFViewPlaceholder.mm in Sources */ = {isa = PBXBuildFile; fileRef = A10C1D891820305E0036883A /* WebPDFViewPlaceholder.mm */; };
    380380                A17A11B1180DC84800E5498C /* WebPluginPackagePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = A17A11B0180DC84800E5498C /* WebPluginPackagePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
    381                 A5214FC713B975C8000015EF /* WebInspectorRemoteChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = A5214FC113B975C8000015EF /* WebInspectorRemoteChannel.h */; };
    382                 A5214FC813B975C8000015EF /* WebInspectorRemoteChannel.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5214FC213B975C8000015EF /* WebInspectorRemoteChannel.mm */; };
    383                 A52209F813C53E75004BA7B1 /* WebInspectorRelayDefinitions.h in Headers */ = {isa = PBXBuildFile; fileRef = A52209F713C53E75004BA7B1 /* WebInspectorRelayDefinitions.h */; settings = {ATTRIBUTES = (Private, ); }; };
    384                 A55E20FF14D7264C0031549E /* WebInspectorServerWebViewConnectionController.h in Headers */ = {isa = PBXBuildFile; fileRef = A55E20FD14D7264C0031549E /* WebInspectorServerWebViewConnectionController.h */; };
    385                 A55E210014D7264C0031549E /* WebInspectorServerWebViewConnectionController.mm in Sources */ = {isa = PBXBuildFile; fileRef = A55E20FE14D7264C0031549E /* WebInspectorServerWebViewConnectionController.mm */; };
    386381                A560946614D8AD2600799A8A /* WebIndicateLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = A560946414D8AD2600799A8A /* WebIndicateLayer.h */; };
    387382                A560946714D8AD2600799A8A /* WebIndicateLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = A560946514D8AD2600799A8A /* WebIndicateLayer.mm */; };
    388383                A5687BDA135B791A0074CBCB /* WebNodeHighlighter.h in Headers */ = {isa = PBXBuildFile; fileRef = A5687BD8135B791A0074CBCB /* WebNodeHighlighter.h */; };
    389384                A5687BDB135B791A0074CBCB /* WebNodeHighlighter.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5687BD9135B791A0074CBCB /* WebNodeHighlighter.mm */; };
    390                 A57C28A713BAA5AD0070ACAB /* WebInspectorServerWebViewConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = A57C28A113BAA5AD0070ACAB /* WebInspectorServerWebViewConnection.h */; };
    391                 A57C28A813BAA5AD0070ACAB /* WebInspectorServerWebViewConnection.mm in Sources */ = {isa = PBXBuildFile; fileRef = A57C28A213BAA5AD0070ACAB /* WebInspectorServerWebViewConnection.mm */; };
    392                 A57C28A913BAA5AD0070ACAB /* WebInspectorServer.h in Headers */ = {isa = PBXBuildFile; fileRef = A57C28A313BAA5AD0070ACAB /* WebInspectorServer.h */; };
    393                 A57C28AA13BAA5AD0070ACAB /* WebInspectorServer.mm in Sources */ = {isa = PBXBuildFile; fileRef = A57C28A413BAA5AD0070ACAB /* WebInspectorServer.mm */; };
    394                 A57C28AB13BAA5AD0070ACAB /* WebInspectorXPCWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = A57C28A513BAA5AD0070ACAB /* WebInspectorXPCWrapper.h */; settings = {ATTRIBUTES = (Private, ); }; };
    395                 A57C28AC13BAA5AD0070ACAB /* WebInspectorXPCWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = A57C28A613BAA5AD0070ACAB /* WebInspectorXPCWrapper.m */; };
    396385                A57E2F24120749E600048DF3 /* WebQuotaManager.h in Headers */ = {isa = PBXBuildFile; fileRef = A57E2F22120749E600048DF3 /* WebQuotaManager.h */; settings = {ATTRIBUTES = (Private, ); }; };
    397                 A57EB78F13B97A4E008D691D /* WebInspectorClientRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = A57EB78D13B97A4E008D691D /* WebInspectorClientRegistry.h */; };
    398                 A57EB79013B97A4E008D691D /* WebInspectorClientRegistry.mm in Sources */ = {isa = PBXBuildFile; fileRef = A57EB78E13B97A4E008D691D /* WebInspectorClientRegistry.mm */; };
    399386                A58A5799143E727000125F50 /* WebOpenPanelResultListener.h in Headers */ = {isa = PBXBuildFile; fileRef = A58A5797143E727000125F50 /* WebOpenPanelResultListener.h */; };
    400387                A58A579A143E727000125F50 /* WebOpenPanelResultListener.mm in Sources */ = {isa = PBXBuildFile; fileRef = A58A5798143E727000125F50 /* WebOpenPanelResultListener.mm */; };
     
    779766                A10C1D8F1820307D0036883A /* WebKit.iOS.exp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.exports; name = WebKit.iOS.exp; path = ios/WebKit.iOS.exp; sourceTree = "<group>"; };
    780767                A17A11B0180DC84800E5498C /* WebPluginPackagePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPluginPackagePrivate.h; sourceTree = "<group>"; };
    781                 A5214FC113B975C8000015EF /* WebInspectorRemoteChannel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebInspectorRemoteChannel.h; path = remote/WebInspectorRemoteChannel.h; sourceTree = "<group>"; };
    782                 A5214FC213B975C8000015EF /* WebInspectorRemoteChannel.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WebInspectorRemoteChannel.mm; path = remote/WebInspectorRemoteChannel.mm; sourceTree = "<group>"; };
    783                 A52209F713C53E75004BA7B1 /* WebInspectorRelayDefinitions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebInspectorRelayDefinitions.h; path = remote/WebInspectorRelayDefinitions.h; sourceTree = "<group>"; };
    784                 A55E20FD14D7264C0031549E /* WebInspectorServerWebViewConnectionController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebInspectorServerWebViewConnectionController.h; path = remote/WebInspectorServerWebViewConnectionController.h; sourceTree = "<group>"; };
    785                 A55E20FE14D7264C0031549E /* WebInspectorServerWebViewConnectionController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WebInspectorServerWebViewConnectionController.mm; path = remote/WebInspectorServerWebViewConnectionController.mm; sourceTree = "<group>"; };
    786768                A560946414D8AD2600799A8A /* WebIndicateLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebIndicateLayer.h; sourceTree = "<group>"; };
    787769                A560946514D8AD2600799A8A /* WebIndicateLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebIndicateLayer.mm; sourceTree = "<group>"; };
    788770                A5687BD8135B791A0074CBCB /* WebNodeHighlighter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNodeHighlighter.h; sourceTree = "<group>"; };
    789771                A5687BD9135B791A0074CBCB /* WebNodeHighlighter.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebNodeHighlighter.mm; sourceTree = "<group>"; };
    790                 A57C28A113BAA5AD0070ACAB /* WebInspectorServerWebViewConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebInspectorServerWebViewConnection.h; path = remote/WebInspectorServerWebViewConnection.h; sourceTree = "<group>"; };
    791                 A57C28A213BAA5AD0070ACAB /* WebInspectorServerWebViewConnection.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WebInspectorServerWebViewConnection.mm; path = remote/WebInspectorServerWebViewConnection.mm; sourceTree = "<group>"; };
    792                 A57C28A313BAA5AD0070ACAB /* WebInspectorServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebInspectorServer.h; path = remote/WebInspectorServer.h; sourceTree = "<group>"; };
    793                 A57C28A413BAA5AD0070ACAB /* WebInspectorServer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WebInspectorServer.mm; path = remote/WebInspectorServer.mm; sourceTree = "<group>"; };
    794                 A57C28A513BAA5AD0070ACAB /* WebInspectorXPCWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebInspectorXPCWrapper.h; path = remote/WebInspectorXPCWrapper.h; sourceTree = "<group>"; };
    795                 A57C28A613BAA5AD0070ACAB /* WebInspectorXPCWrapper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = WebInspectorXPCWrapper.m; path = remote/WebInspectorXPCWrapper.m; sourceTree = "<group>"; };
    796772                A57E2F22120749E600048DF3 /* WebQuotaManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebQuotaManager.h; sourceTree = "<group>"; };
    797                 A57EB78D13B97A4E008D691D /* WebInspectorClientRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebInspectorClientRegistry.h; path = remote/WebInspectorClientRegistry.h; sourceTree = "<group>"; };
    798                 A57EB78E13B97A4E008D691D /* WebInspectorClientRegistry.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WebInspectorClientRegistry.mm; path = remote/WebInspectorClientRegistry.mm; sourceTree = "<group>"; };
    799773                A58A5797143E727000125F50 /* WebOpenPanelResultListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebOpenPanelResultListener.h; sourceTree = "<group>"; };
    800774                A58A5798143E727000125F50 /* WebOpenPanelResultListener.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebOpenPanelResultListener.mm; sourceTree = "<group>"; };
     
    10531027                        isa = PBXGroup;
    10541028                        children = (
    1055                                 A5214FBF13B97596000015EF /* remote */,
    10561029                                5D7BF8120C2A1D90008CE06D /* WebInspector.h */,
    10571030                                5D7BF8130C2A1D90008CE06D /* WebInspector.mm */,
     
    15081481                        );
    15091482                        name = ios;
    1510                         sourceTree = "<group>";
    1511                 };
    1512                 A5214FBF13B97596000015EF /* remote */ = {
    1513                         isa = PBXGroup;
    1514                         children = (
    1515                                 A57EB78D13B97A4E008D691D /* WebInspectorClientRegistry.h */,
    1516                                 A57EB78E13B97A4E008D691D /* WebInspectorClientRegistry.mm */,
    1517                                 A52209F713C53E75004BA7B1 /* WebInspectorRelayDefinitions.h */,
    1518                                 A5214FC113B975C8000015EF /* WebInspectorRemoteChannel.h */,
    1519                                 A5214FC213B975C8000015EF /* WebInspectorRemoteChannel.mm */,
    1520                                 A57C28A313BAA5AD0070ACAB /* WebInspectorServer.h */,
    1521                                 A57C28A413BAA5AD0070ACAB /* WebInspectorServer.mm */,
    1522                                 A57C28A113BAA5AD0070ACAB /* WebInspectorServerWebViewConnection.h */,
    1523                                 A57C28A213BAA5AD0070ACAB /* WebInspectorServerWebViewConnection.mm */,
    1524                                 A55E20FD14D7264C0031549E /* WebInspectorServerWebViewConnectionController.h */,
    1525                                 A55E20FE14D7264C0031549E /* WebInspectorServerWebViewConnectionController.mm */,
    1526                                 A57C28A513BAA5AD0070ACAB /* WebInspectorXPCWrapper.h */,
    1527                                 A57C28A613BAA5AD0070ACAB /* WebInspectorXPCWrapper.m */,
    1528                         );
    1529                         name = remote;
    15301483                        sourceTree = "<group>";
    15311484                };
     
    18261779                                5D7BF8140C2A1D90008CE06D /* WebInspector.h in Headers */,
    18271780                                06693DDC0BFBA85200216072 /* WebInspectorClient.h in Headers */,
    1828                                 A57EB78F13B97A4E008D691D /* WebInspectorClientRegistry.h in Headers */,
    18291781                                B804176F1217A83100466BAE /* WebInspectorFrontend.h in Headers */,
    18301782                                7A8FF0D11075024A00A80A08 /* WebInspectorPrivate.h in Headers */,
    1831                                 A52209F813C53E75004BA7B1 /* WebInspectorRelayDefinitions.h in Headers */,
    1832                                 A5214FC713B975C8000015EF /* WebInspectorRemoteChannel.h in Headers */,
    1833                                 A57C28A913BAA5AD0070ACAB /* WebInspectorServer.h in Headers */,
    1834                                 A57C28A713BAA5AD0070ACAB /* WebInspectorServerWebViewConnection.h in Headers */,
    1835                                 A55E20FF14D7264C0031549E /* WebInspectorServerWebViewConnectionController.h in Headers */,
    1836                                 A57C28AB13BAA5AD0070ACAB /* WebInspectorXPCWrapper.h in Headers */,
    18371783                                939810420824BF01008DF038 /* WebJavaScriptTextInputPanel.h in Headers */,
    18381784                                37D1DCA81065928C0068F7EF /* WebJSPDFDoc.h in Headers */,
     
    22772223                                06693DDD0BFBA85200216072 /* WebInspectorClient.mm in Sources */,
    22782224                                1C7B0C660EB2464D00A28502 /* WebInspectorClientCF.cpp in Sources */,
    2279                                 A57EB79013B97A4E008D691D /* WebInspectorClientRegistry.mm in Sources */,
    22802225                                B80417701217A83100466BAE /* WebInspectorFrontend.mm in Sources */,
    2281                                 A5214FC813B975C8000015EF /* WebInspectorRemoteChannel.mm in Sources */,
    2282                                 A57C28AA13BAA5AD0070ACAB /* WebInspectorServer.mm in Sources */,
    2283                                 A57C28A813BAA5AD0070ACAB /* WebInspectorServerWebViewConnection.mm in Sources */,
    2284                                 A55E210014D7264C0031549E /* WebInspectorServerWebViewConnectionController.mm in Sources */,
    2285                                 A57C28AC13BAA5AD0070ACAB /* WebInspectorXPCWrapper.m in Sources */,
    22862226                                A10C1D1918202F9C0036883A /* WebDefaultFormDelegate.m in Sources */,
    22872227                                939810E40824BF01008DF038 /* WebJavaScriptTextInputPanel.m in Sources */,
  • trunk/Source/WebKit/blackberry/ChangeLog

    r160023 r160099  
     12013-12-03  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Push Remote Inspector debugging connection management into JavaScriptCore
     4        https://bugs.webkit.org/show_bug.cgi?id=124613
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * WebCoreSupport/InspectorClientBlackBerry.h:
     9
    1102013-12-03  Nick Diego Yamane  <nick.yamane@openbossa.org>
    211
  • trunk/Source/WebKit/blackberry/WebCoreSupport/InspectorClientBlackBerry.h

    r158415 r160099  
    2222
    2323#include "InspectorClient.h"
    24 #include "InspectorFrontendChannel.h"
     24#include "InspectorForwarding.h"
    2525#include "InspectorOverlay.h"
    2626#include "InspectorOverlayBlackBerry.h"
  • trunk/Source/WebKit/cf/ChangeLog

    r158050 r160099  
     12013-12-03  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Push Remote Inspector debugging connection management into JavaScriptCore
     4        https://bugs.webkit.org/show_bug.cgi?id=124613
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * WebCoreSupport/WebInspectorClientCF.cpp:
     9        (WebInspectorClient::sendMessageToFrontend):
     10
    1112013-10-25  Joseph Pecoraro  <pecoraro@apple.com>
    212
  • trunk/Source/WebKit/cf/WebCoreSupport/WebInspectorClientCF.cpp

    r158050 r160099  
    9292}
    9393
    94 #if !ENABLE(REMOTE_INSPECTOR)
    9594bool WebInspectorClient::sendMessageToFrontend(const String& message)
    9695{
    9796    return doDispatchMessageOnFrontendPage(m_frontendPage, message);
    9897}
    99 #endif
    10098
    10199bool WebInspectorClient::inspectorAttachDisabled()
  • trunk/Source/WebKit/efl/ChangeLog

    r159730 r160099  
     12013-12-03  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Push Remote Inspector debugging connection management into JavaScriptCore
     4        https://bugs.webkit.org/show_bug.cgi?id=124613
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * WebCoreSupport/InspectorClientEfl.h:
     9
    1102013-11-23  Xabier Rodriguez Calvar  <calvaris@igalia.com>
    211
  • trunk/Source/WebKit/efl/WebCoreSupport/InspectorClientEfl.h

    r150680 r160099  
    3636
    3737#include "InspectorClient.h"
    38 #include "InspectorFrontendChannel.h"
     38#include "InspectorForwarding.h"
    3939#include "InspectorFrontendClientLocal.h"
    4040#include <Evas.h>
  • trunk/Source/WebKit/gtk/ChangeLog

    r159926 r160099  
     12013-12-03  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Push Remote Inspector debugging connection management into JavaScriptCore
     4        https://bugs.webkit.org/show_bug.cgi?id=124613
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * WebCoreSupport/InspectorClientGtk.h:
     9
    1102013-12-02  Gustavo Noronha Silva  <gustavo.noronha@collabora.com>
    211
  • trunk/Source/WebKit/gtk/WebCoreSupport/InspectorClientGtk.h

    r150041 r160099  
    3131
    3232#include "InspectorClient.h"
    33 #include "InspectorFrontendChannel.h"
     33#include "InspectorForwarding.h"
    3434#include "InspectorFrontendClientLocal.h"
    3535#include "webkitwebinspector.h"
  • trunk/Source/WebKit/ios/ChangeLog

    r160044 r160099  
     12013-12-03  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Push Remote Inspector debugging connection management into JavaScriptCore
     4        https://bugs.webkit.org/show_bug.cgi?id=124613
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * WebCoreSupport/WebInspectorClientIOS.mm:
     9        (WebInspectorClient::WebInspectorClient):
     10        (WebInspectorClient::inspectorDestroyed):
     11
    1122013-12-03  Ralph Thomas  <ralpht@gmail.com>
    213
  • trunk/Source/WebKit/ios/WebCoreSupport/WebInspectorClientIOS.mm

    r158050 r160099  
    4343#import <wtf/PassOwnPtr.h>
    4444
    45 #if ENABLE(REMOTE_INSPECTOR)
    46 #import "WebInspectorClientRegistry.h"
    47 #import "WebInspectorRemoteChannel.h"
    48 #endif
    49 
    5045using namespace WebCore;
    5146
     
    5550    , m_frontendPage(0)
    5651    , m_frontendClient(0)
    57 #if ENABLE(REMOTE_INSPECTOR)
    58     , m_remoteChannel(0)
    59     , m_pageId(0)
    60 #endif
    6152{
    62 #if ENABLE(REMOTE_INSPECTOR)
    63     [[WebInspectorClientRegistry sharedRegistry] registerClient:this];
    64 #endif
    6553}
    6654
    6755void WebInspectorClient::inspectorDestroyed()
    6856{
    69 #if ENABLE(REMOTE_INSPECTOR)
    70     [[WebInspectorClientRegistry sharedRegistry] unregisterClient:this];
    71     teardownRemoteConnection(true);
    72 #endif
    73 
    7457    delete this;
    7558}
     
    117100}
    118101
    119 #pragma mark -
    120 #pragma mark Remote Web Inspector Implementation
    121 
    122 #if ENABLE(REMOTE_INSPECTOR)
    123 bool WebInspectorClient::sendMessageToFrontend(const String& message)
    124 {
    125     if (m_remoteChannel) {
    126         [m_remoteChannel sendMessageToFrontend:message];
    127         return true;
    128     }
    129 
    130     // iOS does not have a local inspector. There should be no way to reach this.
    131     ASSERT_NOT_REACHED();
    132     notImplemented();
    133 
    134     return doDispatchMessageOnFrontendPage(m_frontendPage, message);
    135 }
    136 
    137 void WebInspectorClient::sendMessageToBackend(const String& message)
    138 {
    139     ASSERT(m_remoteChannel);
    140 
    141     Page* page = core(m_webView);
    142     page->inspectorController()->dispatchMessageFromFrontend(message);
    143 }
    144 
    145 bool WebInspectorClient::setupRemoteConnection(WebInspectorRemoteChannel *remoteChannel)
    146 {
    147     // There is already a local session, do not allow a remote session.
    148     if (hasLocalSession())
    149         return false;
    150 
    151     // There is already a remote session, do not allow a new remote session.
    152     if (m_remoteChannel)
    153         return false;
    154 
    155     m_remoteChannel = remoteChannel;
    156 
    157     Page* page = core(m_webView);
    158     page->inspectorController()->connectFrontend(this);
    159 
    160     // Force developer extras to be enabled in WebCore when a remote connection starts.
    161     if (page->settings())
    162         page->settings()->setDeveloperExtrasEnabled(true);
    163 
    164     return true;
    165 }
    166 
    167 void WebInspectorClient::teardownRemoteConnection(bool fromLocalSide)
    168 {
    169     ASSERT(WebThreadIsLockedOrDisabled());
    170     if (!m_remoteChannel)
    171         return;
    172 
    173     if (fromLocalSide)
    174         [m_remoteChannel closeFromLocalSide];
    175 
    176     Page* page = core(m_webView);
    177     if (page) {
    178         page->inspectorController()->disconnectFrontend();
    179 
    180         // Restore developer extras setting in WebCore.
    181         if (page && page->settings())
    182             page->settings()->setDeveloperExtrasEnabled([[m_webView preferences] developerExtrasEnabled]);
    183     }
    184 
    185     if (fromLocalSide)
    186         [m_remoteChannel release];
    187 
    188     m_remoteChannel = 0;
    189 }
    190 
    191 bool WebInspectorClient::hasLocalSession() const
    192 {
    193     return m_frontendPage != 0;
    194 }
    195 
    196 bool WebInspectorClient::canBeRemotelyInspected() const
    197 {
    198     return [m_webView canBeRemotelyInspected];
    199 }
    200 
    201 WebView *WebInspectorClient::inspectedWebView()
    202 {
    203     return m_webView;
    204 }
    205 #endif
    206 
    207102
    208103#pragma mark -
  • trunk/Source/WebKit/mac/ChangeLog

    r160015 r160099  
     12013-12-03  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Push Remote Inspector debugging connection management into JavaScriptCore
     4        https://bugs.webkit.org/show_bug.cgi?id=124613
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        Remove the old ENABLE(REMOTE_INSPECTOR) connection management implementation.
     9
     10        * WebCoreSupport/WebInspectorClient.h:
     11        * WebCoreSupport/WebInspectorClient.mm:
     12        (WebInspectorClient::indicate):
     13        (WebInspectorClient::hideIndicate):
     14        Hook up WebView indication through this new path.
     15
     16        * WebCoreSupport/WebFrameLoaderClient.mm:
     17        (WebFrameLoaderClient::dispatchDidReceiveTitle):
     18        * WebCoreSupport/WebInspectorClient.h:
     19        * WebCoreSupport/WebInspectorClient.mm:
     20        (WebInspectorClient::WebInspectorClient):
     21        (WebInspectorClient::inspectorDestroyed):
     22        * WebInspector/remote/WebInspectorClientRegistry.h: Removed.
     23        * WebInspector/remote/WebInspectorClientRegistry.mm: Removed.
     24        * WebInspector/remote/WebInspectorRelayDefinitions.h: Removed.
     25        * WebInspector/remote/WebInspectorRemoteChannel.h: Removed.
     26        * WebInspector/remote/WebInspectorRemoteChannel.mm: Removed.
     27        * WebInspector/remote/WebInspectorServer.h: Removed.
     28        * WebInspector/remote/WebInspectorServer.mm: Removed.
     29        * WebInspector/remote/WebInspectorServerWebViewConnection.h: Removed.
     30        * WebInspector/remote/WebInspectorServerWebViewConnection.mm: Removed.
     31        * WebInspector/remote/WebInspectorServerWebViewConnectionController.h: Removed.
     32        * WebInspector/remote/WebInspectorServerWebViewConnectionController.mm: Removed.
     33        * WebInspector/remote/WebInspectorXPCWrapper.h: Removed.
     34        * WebInspector/remote/WebInspectorXPCWrapper.m: Removed.
     35        * WebKit.exp:
     36        * WebView/WebView.mm:
     37        (-[WebView _commonInitializationWithFrameName:groupName:]):
     38        (+[WebView _enableRemoteInspector]):
     39        (+[WebView _disableRemoteInspector]):
     40        (+[WebView _disableAutoStartRemoteInspector]):
     41        (+[WebView _isRemoteInspectorEnabled]):
     42        (+[WebView _hasRemoteInspectorSession]):
     43        (-[WebView allowsRemoteInspection]):
     44        (-[WebView setAllowsRemoteInspection:]):
     45        (-[WebView setIndicatingForRemoteInspector:]):
     46        (-[WebView setHostApplicationBundleId:name:]):
     47        (-[WebView _didCommitLoadForFrame:]):
     48        * WebView/WebViewData.h:
     49        * WebView/WebViewData.mm:
     50        (-[WebViewPrivate init]):
     51        (-[WebViewPrivate dealloc]):
     52        * WebView/WebViewInternal.h:
     53        * WebView/WebViewPrivate.h:
     54        Remove old REMOTE_INSPECTOR.
     55
    1562013-12-02  Chris Fleizach  <cfleizach@apple.com>
    257
  • trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm

    r159001 r160099  
    139139#endif
    140140
    141 #if ENABLE(REMOTE_INSPECTOR)
    142 #import "WebInspectorServer.h"
    143 #endif
    144 
    145141using namespace WebCore;
    146142using namespace HTMLNames;
     
    622618        // FIXME: use direction of title.
    623619        CallFrameLoadDelegate(implementations->didReceiveTitleForFrameFunc, webView, @selector(webView:didReceiveTitle:forFrame:), (NSString *)title.string(), m_webFrame.get());
    624 
    625 #if ENABLE(REMOTE_INSPECTOR)
    626     BOOL isMainFrame = [webView mainFrame] == m_webFrame.get();
    627     if (isMainFrame)
    628         [[WebView sharedWebInspectorServer] pushListing];
    629 #endif
    630620}
    631621
  • trunk/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.h

    r158884 r160099  
    2828
    2929#import <WebCore/InspectorClient.h>
    30 #import <WebCore/InspectorFrontendChannel.h>
     30#import <WebCore/InspectorForwarding.h>
    3131#import <WebCore/InspectorFrontendClientLocal.h>
    3232
     
    7474    virtual void hideHighlight() OVERRIDE;
    7575
     76    virtual void indicate() OVERRIDE;
     77    virtual void hideIndication() OVERRIDE;
     78
    7679    virtual void didSetSearchingForNode(bool) OVERRIDE;
    7780
     
    8689    void releaseFrontend();
    8790
    88 #if ENABLE(REMOTE_INSPECTOR)
    89     void sendMessageToBackend(const String&);
    90 
    91     bool setupRemoteConnection(WebInspectorRemoteChannel *remoteChannel);
    92     void teardownRemoteConnection(bool fromLocalSide);
    93 
    94     unsigned pageId() const { return m_pageId; }
    95     void setPageId(unsigned pageId) { m_pageId = pageId; }
    96 
    97     bool hasLocalSession() const;
    98 
    99     bool canBeRemotelyInspected() const;
    100 
    101     WebView *inspectedWebView();
    102 #endif
    103 
    10491private:
    10592    PassOwnPtr<WebCore::InspectorFrontendClientLocal::Settings> createFrontendSettings();
     
    10996    WebCore::Page* m_frontendPage;
    11097    WebInspectorFrontendClient* m_frontendClient;
    111 
    112 #if ENABLE(REMOTE_INSPECTOR)
    113     WebInspectorRemoteChannel *m_remoteChannel;
    114     unsigned m_pageId;
    115 #endif
    11698};
    11799
  • trunk/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm

    r158884 r160099  
    5656#import <wtf/text/Base64.h>
    5757
    58 #if ENABLE(REMOTE_INSPECTOR)
    59 #import "WebInspectorClientRegistry.h"
    60 #import "WebInspectorRemoteChannel.h"
    61 #endif
    62 
    6358SOFT_LINK_STAGED_FRAMEWORK(WebInspectorUI, PrivateFrameworks, A)
    6459
     
    136131    , m_frontendPage(0)
    137132    , m_frontendClient(0)
    138 #if ENABLE(REMOTE_INSPECTOR)
    139     , m_remoteChannel(0)
    140     , m_pageId(0)
    141 #endif
    142 {
    143 #if ENABLE(REMOTE_INSPECTOR)
    144     [[WebInspectorClientRegistry sharedRegistry] registerClient:this];
    145 #endif
     133{
    146134}
    147135
    148136void WebInspectorClient::inspectorDestroyed()
    149137{
    150 #if ENABLE(REMOTE_INSPECTOR)
    151     [[WebInspectorClientRegistry sharedRegistry] unregisterClient:this];
    152     teardownRemoteConnection(true);
    153 #endif
    154 
    155138    closeInspectorFrontend();
    156139    delete this;
     
    198181}
    199182
     183void WebInspectorClient::indicate()
     184{
     185    [m_webView setIndicatingForRemoteInspector:YES];
     186}
     187
     188void WebInspectorClient::hideIndication()
     189{
     190    [m_webView setIndicatingForRemoteInspector:NO];
     191}
     192
    200193void WebInspectorClient::didSetSearchingForNode(bool enabled)
    201194{
     
    215208    m_frontendPage = 0;
    216209}
    217 
    218 #if ENABLE(REMOTE_INSPECTOR)
    219 bool WebInspectorClient::sendMessageToFrontend(const String& message)
    220 {
    221     if (m_remoteChannel) {
    222         [m_remoteChannel sendMessageToFrontend:message];
    223         return true;
    224     }
    225 
    226     return doDispatchMessageOnFrontendPage(m_frontendPage, message);
    227 }
    228 
    229 void WebInspectorClient::sendMessageToBackend(const String& message)
    230 {
    231     ASSERT(m_remoteChannel);
    232 
    233     Page* page = core(m_webView);
    234     page->inspectorController()->dispatchMessageFromFrontend(message);
    235 }
    236 
    237 bool WebInspectorClient::setupRemoteConnection(WebInspectorRemoteChannel *remoteChannel)
    238 {
    239     // There is already a local session, do not allow a remote session.
    240     if (hasLocalSession())
    241         return false;
    242 
    243     // There is already a remote session, do not allow a new remote session.
    244     if (m_remoteChannel)
    245         return false;
    246 
    247     ASSERT([[m_webView preferences] developerExtrasEnabled]);
    248 
    249     m_remoteChannel = remoteChannel;
    250 
    251     Page* page = core(m_webView);
    252     page->inspectorController()->connectFrontend(this);
    253 
    254     return true;
    255 }
    256 
    257 void WebInspectorClient::teardownRemoteConnection(bool fromLocalSide)
    258 {
    259     if (!m_remoteChannel)
    260         return;
    261 
    262     if (fromLocalSide)
    263         [m_remoteChannel closeFromLocalSide];
    264 
    265     if (Page* page = core(m_webView))
    266         page->inspectorController()->disconnectFrontend();
    267 
    268     if (fromLocalSide)
    269         [m_remoteChannel release];
    270 
    271     m_remoteChannel = 0;
    272 }
    273 
    274 bool WebInspectorClient::hasLocalSession() const
    275 {
    276     return m_frontendPage != 0;
    277 }
    278 
    279 bool WebInspectorClient::canBeRemotelyInspected() const
    280 {
    281     return [m_webView canBeRemotelyInspected];
    282 }
    283 
    284 WebView *WebInspectorClient::inspectedWebView()
    285 {
    286     return m_webView;
    287 }
    288 #endif
    289210
    290211
  • trunk/Source/WebKit/mac/WebKit.exp

    r158884 r160099  
    2323.objc_class_name_WebIconDatabase
    2424.objc_class_name_WebInspector
    25 .objc_class_name_WebInspectorXPCWrapper
    2625.objc_class_name_WebJavaScriptTextInputPanel
    2726.objc_class_name_WebKeyGenerator
  • trunk/Source/WebKit/mac/WebView/WebView.mm

    r159856 r160099  
    213213
    214214#if ENABLE(REMOTE_INSPECTOR)
    215 #import "WebInspectorServer.h"
    216215#if PLATFORM(IOS)
    217216#import "WebIndicateLayer.h"
     
    392391#endif
    393392
    394 #if ENABLE(REMOTE_INSPECTOR)
    395 static BOOL autoStartRemoteInspector = YES;
    396 #endif
    397 
    398393@interface NSObject (WebValidateWithoutDelegate)
    399394- (BOOL)validateUserInterfaceItemWithoutDelegate:(id <NSValidatedUserInterfaceItem>)item;
     
    526521
    527522#if ENABLE(REMOTE_INSPECTOR)
     523// FIXME: Legacy, remove this, switch to something from JavaScriptCore Inspector::RemoteInspectorServer.
    528524NSString *_WebViewRemoteInspectorHasSessionChangedNotification = @"_WebViewRemoteInspectorHasSessionChangedNotification";
    529525#endif
     
    767763        Settings::setShouldRespectPriorityInCSSAttributeSetters(shouldRespectPriorityInCSSAttributeSetters());
    768764
    769 #if ENABLE(REMOTE_INSPECTOR)
    770         if (autoStartRemoteInspector)
    771             [WebView _enableRemoteInspector];
    772 #endif
    773 
    774765        didOneTimeInitialization = true;
    775766    }
     
    797788#if ENABLE(MEDIA_STREAM)
    798789    WebCore::provideUserMediaTo(_private->page, new WebUserMediaClient(self));
     790#endif
     791
     792#if ENABLE(REMOTE_INSPECTOR)
     793    _private->page->setRemoteInspectionAllowed(true);
    799794#endif
    800795
     
    12681263
    12691264#if ENABLE(REMOTE_INSPECTOR)
    1270 + (WebInspectorServer *)sharedWebInspectorServer
    1271 {
    1272     static WebInspectorServer *sharedServer = [[WebInspectorServer alloc] init];
    1273     return sharedServer;
    1274 }
    1275 
    12761265+ (void)_enableRemoteInspector
    12771266{
    1278     [[WebView sharedWebInspectorServer] start];
     1267    // FIXME: Move this to a new Inspector::RemoteInspectorServer interface or remove it.
    12791268}
    12801269
    12811270+ (void)_disableRemoteInspector
    12821271{
    1283     [[WebView sharedWebInspectorServer] stop];
     1272    // FIXME: Move this to a new Inspector::RemoteInspectorServer interface or remove it.
    12841273}
    12851274
    12861275+ (void)_disableAutoStartRemoteInspector
    12871276{
    1288     autoStartRemoteInspector = NO;
     1277    // FIXME: Move this to a new Inspector::RemoteInspectorServer interface or remove it.
    12891278}
    12901279
    12911280+ (BOOL)_isRemoteInspectorEnabled
    12921281{
    1293     return [[WebView sharedWebInspectorServer] isEnabled];
     1282    // FIXME: Move this to a new Inspector::RemoteInspectorServer interface or remove it.
     1283    return NO;
    12941284}
    12951285
    12961286+ (BOOL)_hasRemoteInspectorSession
    12971287{
    1298     return [[WebView sharedWebInspectorServer] hasActiveDebugSession];
    1299 }
    1300 
    1301 - (BOOL)canBeRemotelyInspected
    1302 {
    1303 #if !PLATFORM(IOS)
    1304     if (![[self preferences] developerExtrasEnabled])
    1305         return NO;
    1306 #endif
    1307 
    1308     return [self allowsRemoteInspection];
     1288    // FIXME: Move this to a new Inspector::RemoteInspectorServer interface or remove it.
     1289    return NO;
    13091290}
    13101291
    13111292- (BOOL)allowsRemoteInspection
    13121293{
    1313     return _private->allowsRemoteInspection;
     1294    // FIXME: Move this to a new API.
     1295    return NO;
    13141296}
    13151297
    13161298- (void)setAllowsRemoteInspection:(BOOL)allow
    13171299{
    1318     if (_private->allowsRemoteInspection == allow)
    1319         return;
    1320 
    1321     _private->allowsRemoteInspection = allow;
    1322 
    1323     [[WebView sharedWebInspectorServer] pushListing];
     1300    // FIXME: Move this to a new API.
    13241301}
    13251302
     
    13411318    }
    13421319#else
    1343     // FIXME: Needs implementation.
    1344 #endif
    1345 }
    1346 
    1347 - (void)setRemoteInspectorUserInfo:(NSDictionary *)userInfo
    1348 {
    1349     if ([_private->remoteInspectorUserInfo isEqualToDictionary:userInfo])
    1350         return;
    1351 
    1352     [_private->remoteInspectorUserInfo release];
    1353     _private->remoteInspectorUserInfo = [userInfo copy];
    1354 
    1355     [[WebView sharedWebInspectorServer] pushListing];
    1356 }
    1357 
    1358 - (NSDictionary *)remoteInspectorUserInfo
    1359 {
    1360     return _private->remoteInspectorUserInfo;
     1320    // FIXME: Needs implementation or put an implementation in WebCore::InspectorOverlay.
     1321#endif
    13611322}
    13621323
     
    13641325- (void)setHostApplicationBundleId:(NSString *)bundleId name:(NSString *)name
    13651326{
     1327    // FIXME: This has not yet been ported to Inspector::RemoteInspectorServer.
     1328
    13661329    if (![_private->hostApplicationBundleId isEqualToString:bundleId]) {
    13671330        [_private->hostApplicationBundleId release];
     
    21192082        [self _didChangeValueForKey: _WebMainFrameURLKey];
    21202083    [NSApp setWindowsNeedUpdate:YES];
    2121 #if ENABLE(REMOTE_INSPECTOR)
    2122     [[WebView sharedWebInspectorServer] pushListing];
    2123 #endif
    21242084}
    21252085
  • trunk/Source/WebKit/mac/WebView/WebViewData.h

    r158137 r160099  
    209209
    210210#if ENABLE(REMOTE_INSPECTOR)
    211     BOOL allowsRemoteInspection;
    212     NSDictionary *remoteInspectorUserInfo;
    213211#if PLATFORM(IOS)
    214212    WebIndicateLayer *indicateLayer;
  • trunk/Source/WebKit/mac/WebView/WebViewData.mm

    r159001 r160099  
    100100#endif
    101101
    102 #if ENABLE(REMOTE_INSPECTOR)
    103     allowsRemoteInspection = YES;
    104 #endif
    105 
    106102    shouldCloseWithWindow = objc_collectingEnabled();
    107103
     
    136132
    137133#if ENABLE(REMOTE_INSPECTOR)
    138     [remoteInspectorUserInfo release];
    139134#if PLATFORM(IOS)
    140135    [indicateLayer release];
  • trunk/Source/WebKit/mac/WebView/WebViewInternal.h

    r158050 r160099  
    6262@class WebDownload;
    6363@class WebNodeHighlight;
    64 #if ENABLE(REMOTE_INSPECTOR)
    65 @class WebInspectorServer;
    66 #endif
    6764
    6865#ifdef __cplusplus
     
    218215#endif
    219216
    220 #if ENABLE(REMOTE_INSPECTOR)
    221 + (WebInspectorServer *)sharedWebInspectorServer;
    222 #endif
    223 
    224217// Conversion functions between WebCore root view coordinates and web view coordinates.
    225218- (NSPoint)_convertPointFromRootView:(NSPoint)point;
  • trunk/Source/WebKit/mac/WebView/WebViewPrivate.h

    r158050 r160099  
    7878
    7979#if ENABLE_REMOTE_INSPECTOR
     80// FIXME: Legacy, remove this, switch to something from JavaScriptCore Inspector::RemoteInspectorServer.
    8081// Notification when the number of inspector sessions becomes non-zero or returns to 0.
    8182// Check the current state via -[WebView _hasRemoteInspectorSession].
     
    264265
    265266/*!
    266     @method canBeRemotelyInspected
    267     @result Looks at all the factors of this WebView and returns whether or not
    268     this WebView should allow a Remote Web Inspector to attach to it. This takes
    269     into account -allowsRemoteInspection, Private Browsing, and potentially other
    270     factors.
    271 */
    272 - (BOOL)canBeRemotelyInspected;
    273 
    274 /*!
    275267    @method allowsRemoteInspection
    276268    @result Returns whether or not this WebView will allow a Remote Web Inspector
     
    293285*/
    294286- (void)setIndicatingForRemoteInspector:(BOOL)enabled;
    295 
    296 /*
    297     @method setRemoteInspectorUserInfo
    298     @param tag The dictionary to be associated with the WebView.
    299     @abstract Developer specified dictionary for the WebView that will be
    300     sent to the Remote Debugger. The dictionary must contain property
    301     list serializable values.
    302 */
    303 - (void)setRemoteInspectorUserInfo:(NSDictionary *)userInfo;
    304 
    305 /*!
    306     @method remoteInspectorUserInfo
    307     @result Returns the dictionary associated with this WebView.
    308 */
    309 - (NSDictionary *)remoteInspectorUserInfo;
    310287#endif
    311288
  • trunk/Source/WebKit/win/ChangeLog

    r159768 r160099  
     12013-12-03  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Push Remote Inspector debugging connection management into JavaScriptCore
     4        https://bugs.webkit.org/show_bug.cgi?id=124613
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * WebCoreSupport/WebInspectorClient.h:
     9
    1102013-11-25  peavo@outlook.com  <peavo@outlook.com>
    211
  • trunk/Source/WebKit/win/WebCoreSupport/WebInspectorClient.h

    r150041 r160099  
    3232#include <WebCore/COMPtr.h>
    3333#include <WebCore/InspectorClient.h>
    34 #include <WebCore/InspectorFrontendChannel.h>
     34#include <WebCore/InspectorForwarding.h>
    3535#include <WebCore/InspectorFrontendClientLocal.h>
    3636#include <WebCore/WindowMessageListener.h>
  • trunk/Source/WebKit/wince/ChangeLog

    r158616 r160099  
     12013-12-03  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Push Remote Inspector debugging connection management into JavaScriptCore
     4        https://bugs.webkit.org/show_bug.cgi?id=124613
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * WebCoreSupport/InspectorClientWinCE.h:
     9
    1102013-11-04  Zhuang Zhigang  <zhuangzg@cn.fujitsu.com>
    211
  • trunk/Source/WebKit/wince/WebCoreSupport/InspectorClientWinCE.h

    r158501 r160099  
    2727
    2828#include "InspectorClient.h"
    29 #include "InspectorFrontendChannel.h"
     29#include "InspectorForwarding.h"
    3030
    3131class WebView;
  • trunk/Source/WebKit2/ChangeLog

    r160097 r160099  
     12013-12-03  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Push Remote Inspector debugging connection management into JavaScriptCore
     4        https://bugs.webkit.org/show_bug.cgi?id=124613
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * WebProcess/WebCoreSupport/WebInspectorClient.h:
     9        * WebProcess/WebPage/WebInspector.cpp:
     10        Updated includes.
     11
     12        * WebProcess/WebPage/WebPage.cpp:
     13        (WebKit::WebPage::WebPage):
     14        * WebProcess/com.apple.WebProcess.sb.in:
     15        Allow the WebProcess to access the "com.apple.webinspector" named
     16        XPC service to expose its WebCore::Page's to remote debuggers.
     17
    1182013-12-04  David Farler  <dfarler@apple.com>
    219
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.h

    r150578 r160099  
    3232
    3333#include <WebCore/InspectorClient.h>
    34 #include <WebCore/InspectorFrontendChannel.h>
     34#include <WebCore/InspectorForwarding.h>
    3535
    3636namespace WebCore {
  • trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp

    r157323 r160099  
    3535#include "WebProcess.h"
    3636#include <WebCore/InspectorController.h>
    37 #include <WebCore/InspectorFrontendChannel.h>
     37#include <WebCore/InspectorForwarding.h>
    3838#include <WebCore/InspectorFrontendClient.h>
    3939#include <WebCore/MainFrame.h>
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r160050 r160099  
    346346#endif
    347347
     348#if ENABLE(REMOTE_INSPECTOR)
     349    m_page->setRemoteInspectionAllowed(true);
     350#endif
     351
    348352    m_page->setCanStartMedia(false);
    349353    m_mayStartMediaWhenInWindow = parameters.mayStartMediaWhenInWindow;
  • trunk/Source/WebKit2/WebProcess/com.apple.WebProcess.sb.in

    r158330 r160099  
    139139
    140140#endif
     141
     142;; Remote Web Inspector
     143(allow mach-lookup
     144       (global-name "com.apple.webinspector"))
    141145
    142146;; Various services required by AppKit and other frameworks
Note: See TracChangeset for help on using the changeset viewer.