[iOS] Clean up REMOTE_INSPECTOR code in OpenSource after the iOS merge

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

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

Source/JavaScriptCore:

* JavaScriptCore.xcodeproj/project.pbxproj:
Export XPCConnection because it is needed by RemoteInspector.h.

* inspector/remote/RemoteInspectorXPCConnection.h:
* inspector/remote/RemoteInspector.h:
* inspector/remote/RemoteInspector.mm:
(Inspector::RemoteInspector::startDisabled):
(Inspector::RemoteInspector::shared):
Allow RemoteInspector singleton to start disabled.

Source/WebCore:

* WebCore.exp.in:

Source/WebKit/mac:

* WebView/WebView.mm:
(-[WebView initSimpleHTMLDocumentWithStyle:frame:preferences:groupName:]):
(+[WebView _enableRemoteInspector]):
(+[WebView _disableRemoteInspector]):
(+[WebView _disableAutoStartRemoteInspector]):
(+[WebView _isRemoteInspectorEnabled]):
(+[WebView _hasRemoteInspectorSession]):
(-[WebView allowsRemoteInspection]):
Implement with RemoteInspector.h SPIs.

(-[WebView setAllowsRemoteInspection:]):
(-[WebView setHostApplicationBundleId:name:]):
Still unimplemented, update comment.

(-[WebView _didCommitLoadForFrame:]):
Remove dead path, WebCore now pushes updates on navigations.

* WebView/WebViewData.h:
* WebView/WebViewData.mm:
(-[WebViewPrivate init]):
Remove now unused ivar.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162112 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent ce9f665e
2014-01-15 Joseph Pecoraro <pecoraro@apple.com>
[iOS] Clean up REMOTE_INSPECTOR code in OpenSource after the iOS merge
https://bugs.webkit.org/show_bug.cgi?id=127069
Reviewed by Timothy Hatcher.
* JavaScriptCore.xcodeproj/project.pbxproj:
Export XPCConnection because it is needed by RemoteInspector.h.
* inspector/remote/RemoteInspectorXPCConnection.h:
* inspector/remote/RemoteInspector.h:
* inspector/remote/RemoteInspector.mm:
(Inspector::RemoteInspector::startDisabled):
(Inspector::RemoteInspector::shared):
Allow RemoteInspector singleton to start disabled.
2014-01-15 Brian Burg <bburg@apple.com>
Web Inspector: capture probe samples on the backend
......
......@@ -954,7 +954,7 @@
A5BA15EA182340B400A82E69 /* RemoteInspectorConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = A5BA15E3182340B300A82E69 /* RemoteInspectorConstants.h */; settings = {ATTRIBUTES = (Private, ); }; };
A5BA15EB182340B400A82E69 /* RemoteInspectorDebuggableConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = A5BA15E4182340B300A82E69 /* RemoteInspectorDebuggableConnection.h */; };
A5BA15EC182340B400A82E69 /* RemoteInspectorDebuggableConnection.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15E5182340B300A82E69 /* RemoteInspectorDebuggableConnection.mm */; };
A5BA15ED182340B400A82E69 /* RemoteInspectorXPCConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = A5BA15E6182340B300A82E69 /* RemoteInspectorXPCConnection.h */; };
A5BA15ED182340B400A82E69 /* RemoteInspectorXPCConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = A5BA15E6182340B300A82E69 /* RemoteInspectorXPCConnection.h */; settings = {ATTRIBUTES = (Private, ); }; };
A5BA15EE182340B400A82E69 /* RemoteInspectorXPCConnection.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15E7182340B300A82E69 /* RemoteInspectorXPCConnection.mm */; };
A5BA15F0182345AF00A82E69 /* RemoteInspectorDebuggable.h in Headers */ = {isa = PBXBuildFile; fileRef = A5BA15EF182345AF00A82E69 /* RemoteInspectorDebuggable.h */; settings = {ATTRIBUTES = (Private, ); }; };
A5CEEE14187F3BAD00E55C99 /* InspectorAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5CEEE12187F3BAD00E55C99 /* InspectorAgent.cpp */; };
......
......@@ -28,23 +28,24 @@
#ifndef RemoteInspector_h
#define RemoteInspector_h
#import "RemoteInspectorDebuggableConnection.h"
#import "RemoteInspectorXPCConnection.h"
#import <wtf/Forward.h>
#import <wtf/HashMap.h>
#import <wtf/NeverDestroyed.h>
#import <wtf/Threading.h>
OBJC_CLASS NSString;
OBJC_CLASS NSDictionary;
OBJC_CLASS NSString;
namespace Inspector {
class RemoteInspectorDebuggable;
class RemoteInspectorDebuggableConnection;
struct RemoteInspectorDebuggableInfo;
class JS_EXPORT_PRIVATE RemoteInspector FINAL : public RemoteInspectorXPCConnection::Client {
public:
static void startDisabled();
static RemoteInspector& shared();
friend class NeverDestroyed<RemoteInspector>;
......@@ -83,6 +84,8 @@ private:
void receivedIndicateMessage(NSDictionary *userInfo);
void receivedConnectionDiedMessage(NSDictionary *userInfo);
static bool startEnabled;
// Debuggables can be registered from any thread at any time.
// Any debuggable can send messages over the XPC connection.
// So lock access to all maps and state as they can change
......@@ -101,6 +104,6 @@ private:
} // namespace Inspector
#endif // ENABLE(REMOTE_INSPECTOR)
#endif // RemoteInspector_h
#endif // WebInspectorServer_h
#endif // ENABLE(REMOTE_INSPECTOR)
......@@ -31,12 +31,13 @@
#import "InitializeThreading.h"
#import "RemoteInspectorConstants.h"
#import "RemoteInspectorDebuggable.h"
#import <notify.h>
#import <xpc/xpc.h>
#import "RemoteInspectorDebuggableConnection.h"
#import <Foundation/Foundation.h>
#import <notify.h>
#import <wtf/Assertions.h>
#import <wtf/MainThread.h>
#import <wtf/text/WTFString.h>
#import <xpc/xpc.h>
#if PLATFORM(IOS)
#import <wtf/ios/WebCoreThread.h>
......@@ -56,6 +57,13 @@ static void dispatchAsyncOnQueueSafeForAnyDebuggable(void (^block)())
dispatch_async(dispatch_get_main_queue(), block);
}
bool RemoteInspector::startEnabled = true;
void RemoteInspector::startDisabled()
{
RemoteInspector::startEnabled = false;
}
RemoteInspector& RemoteInspector::shared()
{
static NeverDestroyed<RemoteInspector> shared;
......@@ -64,7 +72,8 @@ RemoteInspector& RemoteInspector::shared()
dispatch_once(&once, ^{
JSC::initializeThreading();
WTF::initializeMainThread();
shared.get().start();
if (RemoteInspector::startEnabled)
shared.get().start();
});
return shared;
......
......@@ -32,8 +32,8 @@
#import <wtf/Noncopyable.h>
#import <xpc/xpc.h>
OBJC_CLASS NSString;
OBJC_CLASS NSDictionary;
OBJC_CLASS NSString;
namespace Inspector {
......
2014-01-15 Joseph Pecoraro <pecoraro@apple.com>
[iOS] Clean up REMOTE_INSPECTOR code in OpenSource after the iOS merge
https://bugs.webkit.org/show_bug.cgi?id=127069
Reviewed by Timothy Hatcher.
* WebCore.exp.in:
2014-01-15 Sam Weinig <sam@webkit.org>
TextBreakIterator's should support Latin-1 for all iterator types (Part 2)
......@@ -2932,8 +2932,9 @@ __ZN7WebCore34registerQLPreviewConverterIfNeededEP5NSURLP8NSStringP6NSData
#endif
#if ENABLE(REMOTE_INSPECTOR)
__ZN7WebCore4Page26setRemoteInspectionAllowedEb
__ZN7WebCore19InspectorController27dispatchMessageFromFrontendERKN3WTF6StringE
__ZN7WebCore4Page26setRemoteInspectionAllowedEb
__ZNK7WebCore4Page23remoteInspectionAllowedEv
#endif
#if ENABLE(REQUEST_ANIMATION_FRAME)
......
2014-01-15 Joseph Pecoraro <pecoraro@apple.com>
[iOS] Clean up REMOTE_INSPECTOR code in OpenSource after the iOS merge
https://bugs.webkit.org/show_bug.cgi?id=127069
Reviewed by Timothy Hatcher.
* WebView/WebView.mm:
(-[WebView initSimpleHTMLDocumentWithStyle:frame:preferences:groupName:]):
(+[WebView _enableRemoteInspector]):
(+[WebView _disableRemoteInspector]):
(+[WebView _disableAutoStartRemoteInspector]):
(+[WebView _isRemoteInspectorEnabled]):
(+[WebView _hasRemoteInspectorSession]):
(-[WebView allowsRemoteInspection]):
Implement with RemoteInspector.h SPIs.
(-[WebView setAllowsRemoteInspection:]):
(-[WebView setHostApplicationBundleId:name:]):
Still unimplemented, update comment.
(-[WebView _didCommitLoadForFrame:]):
Remove dead path, WebCore now pushes updates on navigations.
* WebView/WebViewData.h:
* WebView/WebViewData.mm:
(-[WebViewPrivate init]):
Remove now unused ivar.
2014-01-15 Alexey Proskuryakov <ap@apple.com>
More iOS build fixing.
......
......@@ -259,6 +259,7 @@
#endif
#if ENABLE(REMOTE_INSPECTOR)
#import <JavaScriptCore/RemoteInspector.h>
#if PLATFORM(IOS)
#import "WebIndicateLayer.h"
#endif
......@@ -300,8 +301,9 @@
@end
#endif
using namespace WebCore;
using namespace JSC;
using namespace Inspector;
using namespace WebCore;
#if defined(__ppc__) || defined(__ppc64__)
#define PROCESSOR "PPC"
......@@ -1183,7 +1185,7 @@ static bool shouldUseLegacyBackgroundSizeShorthandBehavior()
}
- (id)initSimpleHTMLDocumentWithStyle:(NSString *)style frame:(CGRect)frame preferences:(WebPreferences *)preferences groupName:(NSString *)groupName
{
{
self = [super initWithFrame:frame];
if (!self)
return nil;
......@@ -1207,13 +1209,10 @@ static bool shouldUseLegacyBackgroundSizeShorthandBehavior()
// Production installs always disallow debugging simple HTML documents.
// Internal installs allow debugging simple HTML documents (TextFields) if the Internal Setting is enabled.
if (!isInternalInstall())
_private->allowsRemoteInspection = NO;
_private->page->setRemoteInspectionAllowed(false);
else {
static BOOL textFieldInspectionEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebKitTextFieldRemoteInspectionEnabledPreferenceKey];
_private->allowsRemoteInspection = textFieldInspectionEnabled;
BOOL autoStartRemoteInspector = YES; // FIXME: <rdar://problem/15810991>
if (_private->allowsRemoteInspection && autoStartRemoteInspector)
[WebView _enableRemoteInspector];
_private->page->setRemoteInspectionAllowed(textFieldInspectionEnabled);
}
#endif
......@@ -1923,40 +1922,37 @@ static bool fastDocumentTeardownEnabled()
#if ENABLE(REMOTE_INSPECTOR)
+ (void)_enableRemoteInspector
{
// FIXME: Move this to a new Inspector::RemoteInspectorServer interface or remove it.
RemoteInspector::shared().start();
}
+ (void)_disableRemoteInspector
{
// FIXME: Move this to a new Inspector::RemoteInspectorServer interface or remove it.
RemoteInspector::shared().stop();
}
+ (void)_disableAutoStartRemoteInspector
{
// FIXME: Move this to a new Inspector::RemoteInspectorServer interface or remove it.
RemoteInspector::startDisabled();
}
+ (BOOL)_isRemoteInspectorEnabled
{
// FIXME: Move this to a new Inspector::RemoteInspectorServer interface or remove it.
return NO;
return RemoteInspector::shared().enabled();
}
+ (BOOL)_hasRemoteInspectorSession
{
// FIXME: Move this to a new Inspector::RemoteInspectorServer interface or remove it.
return NO;
return RemoteInspector::shared().hasActiveDebugSession();
}
- (BOOL)allowsRemoteInspection
{
// FIXME: Move this to a new API.
return NO;
return _private->page->remoteInspectionAllowed();
}
- (void)setAllowsRemoteInspection:(BOOL)allow
{
// FIXME: Move this to a new API.
_private->page->setRemoteInspectionAllowed(allow);
}
- (void)setIndicatingForRemoteInspector:(BOOL)enabled
......@@ -1983,8 +1979,6 @@ static bool fastDocumentTeardownEnabled()
#if PLATFORM(IOS)
- (void)setHostApplicationBundleId:(NSString *)bundleId name:(NSString *)name
{
// FIXME: This has not yet been ported to Inspector::RemoteInspectorServer.
if (![_private->hostApplicationBundleId isEqualToString:bundleId]) {
[_private->hostApplicationBundleId release];
_private->hostApplicationBundleId = [bundleId copy];
......@@ -1995,8 +1989,7 @@ static bool fastDocumentTeardownEnabled()
_private->hostApplicationName = [name copy];
}
// FIXME: <rdar://problem/15810991>
// [[WebView sharedWebInspectorServer] pushListing];
// FIXME: This has not yet been ported to Inspector::RemoteInspectorServer.
}
- (NSString *)hostApplicationBundleId
......@@ -3032,13 +3025,8 @@ static inline IMP getMethod(id o, SEL s)
- (void)_didCommitLoadForFrame:(WebFrame *)frame
{
if (frame == [self mainFrame]) {
if (frame == [self mainFrame])
_private->didDrawTiles = 0;
#if ENABLE(REMOTE_INSPECTOR)
// FIXME: <rdar://problem/15810991>
// [[WebView sharedWebInspectorServer] pushListing];
#endif
}
}
#endif // PLATFORM(IOS)
......
......@@ -255,7 +255,6 @@ private:
#endif
#if ENABLE(REMOTE_INSPECTOR)
BOOL allowsRemoteInspection;
#if PLATFORM(IOS)
WebIndicateLayer *indicateLayer;
NSString *hostApplicationBundleId;
......
......@@ -105,10 +105,6 @@ WebViewLayerFlushScheduler::WebViewLayerFlushScheduler(LayerFlushController* flu
dashboardBehaviorAllowWheelScrolling = YES;
#endif
#if ENABLE(REMOTE_INSPECTOR)
allowsRemoteInspection = YES;
#endif
#if PLATFORM(IOS)
isStopping = NO;
_geolocationProvider = [WebGeolocationProviderIOS sharedGeolocationProvider];
......
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