Web Inspector: For Remote Inspection link WebProcess's to their parent UIProcess

https://bugs.webkit.org/show_bug.cgi?id=126995

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2014-01-14
Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

* inspector/remote/RemoteInspector.mm:
(Inspector::RemoteInspector::listingForDebuggable):
For each WebView, list the parent process. Listing the parent per WebView
is already supported back when we supported processes that could host WebViews
for multiple applications.

* inspector/remote/RemoteInspectorConstants.h:
Add a separate key for the bundle identifier, separate from application identifier.

* inspector/remote/RemoteInspectorDebuggable.cpp:
(Inspector::RemoteInspectorDebuggable::info):
* inspector/remote/RemoteInspectorDebuggable.h:
(Inspector::RemoteInspectorDebuggableInfo::RemoteInspectorDebuggableInfo):
(Inspector::RemoteInspectorDebuggableInfo::hasParentProcess):
If a RemoteInspectorDebuggable has a non-zero parent process identifier
it is a proxy for the parent process.

Source/WebCore:

* inspector/InspectorClient.h:
(WebCore::InspectorClient::parentProcessIdentifier):
Client method intended for WebKit2 so a WebProcess can link to its UIProcess.

* page/PageDebuggable.h:
* page/PageDebuggable.cpp:
(WebCore::PageDebuggable::parentProcessIdentifier):
Provide parent process identifier if there is one.

Source/WebKit2:

* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
(WebKit::WebInspectorClient::parentProcessIdentifier):
WebProcesses are proxies for a parent UIProcess.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161994 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 2db5b81e
2014-01-14 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: For Remote Inspection link WebProcess's to their parent UIProcess
https://bugs.webkit.org/show_bug.cgi?id=126995
Reviewed by Timothy Hatcher.
* inspector/remote/RemoteInspector.mm:
(Inspector::RemoteInspector::listingForDebuggable):
For each WebView, list the parent process. Listing the parent per WebView
is already supported back when we supported processes that could host WebViews
for multiple applications.
* inspector/remote/RemoteInspectorConstants.h:
Add a separate key for the bundle identifier, separate from application identifier.
* inspector/remote/RemoteInspectorDebuggable.cpp:
(Inspector::RemoteInspectorDebuggable::info):
* inspector/remote/RemoteInspectorDebuggable.h:
(Inspector::RemoteInspectorDebuggableInfo::RemoteInspectorDebuggableInfo):
(Inspector::RemoteInspectorDebuggableInfo::hasParentProcess):
If a RemoteInspectorDebuggable has a non-zero parent process identifier
it is a proxy for the parent process.
2014-01-14 Brian J. Burg <burg@cs.washington.edu>
Add ENABLE(WEB_REPLAY) feature flag to the build system
......
......@@ -297,6 +297,11 @@ NSDictionary *RemoteInspector::listingForDebuggable(const RemoteInspectorDebugga
if (debuggableInfo.hasLocalDebugger)
[debuggableDetails setObject:@YES forKey:WIRHasLocalDebuggerKey];
if (debuggableInfo.hasParentProcess()) {
NSString *parentApplicationIdentifier = [NSString stringWithFormat:@"PID:%lu", (unsigned long)debuggableInfo.parentProcessIdentifier];
[debuggableDetails setObject:parentApplicationIdentifier forKey:WIRHostApplicationIdentifierKey];
}
return debuggableDetails;
}
......
......@@ -40,6 +40,7 @@
#define WIRApplicationIdentifierKey @"WIRApplicationIdentifierKey"
#define WIRApplicationBundleIdentifierKey @"WIRApplicationBundleIdentifierKey"
#define WIRApplicationNameKey @"WIRApplicationNameKey"
#define WIRIsApplicationProxyKey @"WIRIsApplicationProxyKey"
#define WIRHostApplicationIdentifierKey @"WIRHostApplicationIdentifierKey"
......
......@@ -73,6 +73,7 @@ RemoteInspectorDebuggableInfo RemoteInspectorDebuggable::info() const
info.url = url();
info.hasLocalDebugger = hasLocalDebugger();
info.remoteDebuggingAllowed = remoteDebuggingAllowed();
info.parentProcessIdentifier = parentProcessIdentifier();
return info;
}
......
......@@ -56,6 +56,7 @@ public:
virtual String name() const { return String(); } // JavaScript and Web
virtual String url() const { return String(); } // Web
virtual bool hasLocalDebugger() const = 0;
virtual pid_t parentProcessIdentifier() const { return 0; }
virtual void connect(InspectorFrontendChannel*) = 0;
virtual void disconnect() = 0;
......@@ -73,15 +74,19 @@ struct RemoteInspectorDebuggableInfo {
, type(RemoteInspectorDebuggable::JavaScript)
, hasLocalDebugger(false)
, remoteDebuggingAllowed(false)
, parentProcessIdentifier(0)
{
}
bool hasParentProcess() const { return !!parentProcessIdentifier; }
unsigned identifier;
RemoteInspectorDebuggable::DebuggableType type;
String name;
String url;
bool hasLocalDebugger;
bool remoteDebuggingAllowed;
pid_t parentProcessIdentifier;
};
} // namespace Inspector
......
2014-01-14 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: For Remote Inspection link WebProcess's to their parent UIProcess
https://bugs.webkit.org/show_bug.cgi?id=126995
Reviewed by Timothy Hatcher.
* inspector/InspectorClient.h:
(WebCore::InspectorClient::parentProcessIdentifier):
Client method intended for WebKit2 so a WebProcess can link to its UIProcess.
* page/PageDebuggable.h:
* page/PageDebuggable.cpp:
(WebCore::PageDebuggable::parentProcessIdentifier):
Provide parent process identifier if there is one.
2014-01-14 Tim Horton <timothy_horton@apple.com>
iOS WebKit2 build fixes, part 2
......@@ -49,6 +49,10 @@ public:
virtual void bringFrontendToFront() = 0;
virtual void didResizeMainFrame(Frame*) { }
#if ENABLE(REMOTE_INSPECTOR)
virtual pid_t parentProcessIdentifier() const { return 0; }
#endif
virtual void highlight() = 0;
virtual void hideHighlight() = 0;
......
......@@ -29,6 +29,7 @@
#if ENABLE(REMOTE_INSPECTOR)
#include "Document.h"
#include "InspectorClient.h"
#include "InspectorController.h"
#include "InspectorForwarding.h"
#include "MainFrame.h"
......@@ -65,6 +66,14 @@ bool PageDebuggable::hasLocalDebugger() const
return m_page.inspectorController()->hasLocalFrontend();
}
pid_t PageDebuggable::parentProcessIdentifier() const
{
if (InspectorClient* inspectorClient = m_page.inspectorController()->inspectorClient())
return inspectorClient->parentProcessIdentifier();
return 0;
}
void PageDebuggable::connect(Inspector::InspectorFrontendChannel* channel)
{
InspectorController* inspectorController = m_page.inspectorController();
......
......@@ -46,6 +46,7 @@ public:
virtual String name() const OVERRIDE;
virtual String url() const OVERRIDE;
virtual bool hasLocalDebugger() const OVERRIDE;
virtual pid_t parentProcessIdentifier() const OVERRIDE;
virtual void connect(Inspector::InspectorFrontendChannel*) OVERRIDE;
virtual void disconnect() OVERRIDE;
......
2014-01-14 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: For Remote Inspection link WebProcess's to their parent UIProcess
https://bugs.webkit.org/show_bug.cgi?id=126995
Reviewed by Timothy Hatcher.
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
(WebKit::WebInspectorClient::parentProcessIdentifier):
WebProcesses are proxies for a parent UIProcess.
2014-01-14 Tim Horton <timothy_horton@apple.com>
iOS WebKit2 build fixes, part 3
......
......@@ -33,6 +33,10 @@
#include <WebCore/InspectorController.h>
#include <WebCore/Page.h>
#if ENABLE(REMOTE_INSPECTOR)
#include "WebProcess.h"
#endif
using namespace WebCore;
namespace WebKit {
......@@ -67,6 +71,13 @@ void WebInspectorClient::didResizeMainFrame(Frame*)
m_page->inspector()->updateDockingAvailability();
}
#if ENABLE(REMOTE_INSPECTOR)
pid_t WebInspectorClient::parentProcessIdentifier() const
{
return WebProcess::shared().presenterApplicationPid();
}
#endif
void WebInspectorClient::highlight()
{
if (!m_highlightOverlay) {
......
......@@ -58,6 +58,10 @@ private:
virtual void bringFrontendToFront() OVERRIDE;
virtual void didResizeMainFrame(WebCore::Frame*) OVERRIDE;
#if ENABLE(REMOTE_INSPECTOR)
virtual pid_t parentProcessIdentifier() const OVERRIDE;
#endif
virtual void highlight() OVERRIDE;
virtual void hideHighlight() OVERRIDE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment