Title: [162112] trunk/Source
Revision
162112
Author
[email protected]
Date
2014-01-15 21:05:55 -0800 (Wed, 15 Jan 2014)

Log Message

[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 <[email protected]> on 2014-01-15
Reviewed by Timothy Hatcher.

Source/_javascript_Core:

* _javascript_Core.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.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (162111 => 162112)


--- trunk/Source/_javascript_Core/ChangeLog	2014-01-16 04:29:04 UTC (rev 162111)
+++ trunk/Source/_javascript_Core/ChangeLog	2014-01-16 05:05:55 UTC (rev 162112)
@@ -1,3 +1,20 @@
+2014-01-15  Joseph Pecoraro  <[email protected]>
+
+        [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.
+
+        * _javascript_Core.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  <[email protected]>
 
         Web Inspector: capture probe samples on the backend

Modified: trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj (162111 => 162112)


--- trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj	2014-01-16 04:29:04 UTC (rev 162111)
+++ trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj	2014-01-16 05:05:55 UTC (rev 162112)
@@ -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 */; };

Modified: trunk/Source/_javascript_Core/inspector/remote/RemoteInspector.h (162111 => 162112)


--- trunk/Source/_javascript_Core/inspector/remote/RemoteInspector.h	2014-01-16 04:29:04 UTC (rev 162111)
+++ trunk/Source/_javascript_Core/inspector/remote/RemoteInspector.h	2014-01-16 05:05:55 UTC (rev 162112)
@@ -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 NSDictionary;
 OBJC_CLASS NSString;
-OBJC_CLASS NSDictionary;
 
 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 @@
     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 @@
 
 } // namespace Inspector
 
+#endif // RemoteInspector_h
+
 #endif // ENABLE(REMOTE_INSPECTOR)
-
-#endif // WebInspectorServer_h

Modified: trunk/Source/_javascript_Core/inspector/remote/RemoteInspector.mm (162111 => 162112)


--- trunk/Source/_javascript_Core/inspector/remote/RemoteInspector.mm	2014-01-16 04:29:04 UTC (rev 162111)
+++ trunk/Source/_javascript_Core/inspector/remote/RemoteInspector.mm	2014-01-16 05:05:55 UTC (rev 162112)
@@ -31,12 +31,13 @@
 #import "InitializeThreading.h"
 #import "RemoteInspectorConstants.h"
 #import "RemoteInspectorDebuggable.h"
+#import "RemoteInspectorDebuggableConnection.h"
+#import <Foundation/Foundation.h>
 #import <notify.h>
-#import <xpc/xpc.h>
-#import <Foundation/Foundation.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 @@
     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 @@
     dispatch_once(&once, ^{
         JSC::initializeThreading();
         WTF::initializeMainThread();
-        shared.get().start();
+        if (RemoteInspector::startEnabled)
+            shared.get().start();
     });
 
     return shared;

Modified: trunk/Source/_javascript_Core/inspector/remote/RemoteInspectorXPCConnection.h (162111 => 162112)


--- trunk/Source/_javascript_Core/inspector/remote/RemoteInspectorXPCConnection.h	2014-01-16 04:29:04 UTC (rev 162111)
+++ trunk/Source/_javascript_Core/inspector/remote/RemoteInspectorXPCConnection.h	2014-01-16 05:05:55 UTC (rev 162112)
@@ -32,8 +32,8 @@
 #import <wtf/Noncopyable.h>
 #import <xpc/xpc.h>
 
+OBJC_CLASS NSDictionary;
 OBJC_CLASS NSString;
-OBJC_CLASS NSDictionary;
 
 namespace Inspector {
 

Modified: trunk/Source/WebCore/ChangeLog (162111 => 162112)


--- trunk/Source/WebCore/ChangeLog	2014-01-16 04:29:04 UTC (rev 162111)
+++ trunk/Source/WebCore/ChangeLog	2014-01-16 05:05:55 UTC (rev 162112)
@@ -1,3 +1,12 @@
+2014-01-15  Joseph Pecoraro  <[email protected]>
+
+        [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  <[email protected]>
 
         TextBreakIterator's should support Latin-1 for all iterator types (Part 2)

Modified: trunk/Source/WebCore/WebCore.exp.in (162111 => 162112)


--- trunk/Source/WebCore/WebCore.exp.in	2014-01-16 04:29:04 UTC (rev 162111)
+++ trunk/Source/WebCore/WebCore.exp.in	2014-01-16 05:05:55 UTC (rev 162112)
@@ -2932,8 +2932,9 @@
 #endif
 
 #if ENABLE(REMOTE_INSPECTOR)
+__ZN7WebCore19InspectorController27dispatchMessageFromFrontendERKN3WTF6StringE
 __ZN7WebCore4Page26setRemoteInspectionAllowedEb
-__ZN7WebCore19InspectorController27dispatchMessageFromFrontendERKN3WTF6StringE
+__ZNK7WebCore4Page23remoteInspectionAllowedEv
 #endif
 
 #if ENABLE(REQUEST_ANIMATION_FRAME)

Modified: trunk/Source/WebKit/mac/ChangeLog (162111 => 162112)


--- trunk/Source/WebKit/mac/ChangeLog	2014-01-16 04:29:04 UTC (rev 162111)
+++ trunk/Source/WebKit/mac/ChangeLog	2014-01-16 05:05:55 UTC (rev 162112)
@@ -1,3 +1,32 @@
+2014-01-15  Joseph Pecoraro  <[email protected]>
+
+        [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  <[email protected]>
 
         More iOS build fixing.

Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (162111 => 162112)


--- trunk/Source/WebKit/mac/WebView/WebView.mm	2014-01-16 04:29:04 UTC (rev 162111)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm	2014-01-16 05:05:55 UTC (rev 162112)
@@ -259,6 +259,7 @@
 #endif
 
 #if ENABLE(REMOTE_INSPECTOR)
+#import <_javascript_Core/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 @@
 }
 
 - (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 @@
     // 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 @@
 #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 @@
 #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 @@
         _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 @@
 
 - (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)

Modified: trunk/Source/WebKit/mac/WebView/WebViewData.h (162111 => 162112)


--- trunk/Source/WebKit/mac/WebView/WebViewData.h	2014-01-16 04:29:04 UTC (rev 162111)
+++ trunk/Source/WebKit/mac/WebView/WebViewData.h	2014-01-16 05:05:55 UTC (rev 162112)
@@ -255,7 +255,6 @@
 #endif
 
 #if ENABLE(REMOTE_INSPECTOR)
-    BOOL allowsRemoteInspection;
 #if PLATFORM(IOS)
     WebIndicateLayer *indicateLayer;
     NSString *hostApplicationBundleId;

Modified: trunk/Source/WebKit/mac/WebView/WebViewData.mm (162111 => 162112)


--- trunk/Source/WebKit/mac/WebView/WebViewData.mm	2014-01-16 04:29:04 UTC (rev 162111)
+++ trunk/Source/WebKit/mac/WebView/WebViewData.mm	2014-01-16 05:05:55 UTC (rev 162112)
@@ -105,10 +105,6 @@
     dashboardBehaviorAllowWheelScrolling = YES;
 #endif
 
-#if ENABLE(REMOTE_INSPECTOR)
-    allowsRemoteInspection = YES;
-#endif
-
 #if PLATFORM(IOS)
     isStopping = NO;
     _geolocationProvider = [WebGeolocationProviderIOS sharedGeolocationProvider];
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to