Changeset 162112 in webkit


Ignore:
Timestamp:
Jan 15, 2014 9:05:55 PM (10 years ago)
Author:
commit-queue@webkit.org
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 <Joseph Pecoraro> on 2014-01-15
Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

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.

Location:
trunk/Source
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r162096 r162112  
     12014-01-15  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        [iOS] Clean up REMOTE_INSPECTOR code in OpenSource after the iOS merge
     4        https://bugs.webkit.org/show_bug.cgi?id=127069
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * JavaScriptCore.xcodeproj/project.pbxproj:
     9        Export XPCConnection because it is needed by RemoteInspector.h.
     10
     11        * inspector/remote/RemoteInspectorXPCConnection.h:
     12        * inspector/remote/RemoteInspector.h:
     13        * inspector/remote/RemoteInspector.mm:
     14        (Inspector::RemoteInspector::startDisabled):
     15        (Inspector::RemoteInspector::shared):
     16        Allow RemoteInspector singleton to start disabled.
     17
    1182014-01-15  Brian Burg  <bburg@apple.com>
    219
  • trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r161733 r162112  
    955955                A5BA15EB182340B400A82E69 /* RemoteInspectorDebuggableConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = A5BA15E4182340B300A82E69 /* RemoteInspectorDebuggableConnection.h */; };
    956956                A5BA15EC182340B400A82E69 /* RemoteInspectorDebuggableConnection.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15E5182340B300A82E69 /* RemoteInspectorDebuggableConnection.mm */; };
    957                 A5BA15ED182340B400A82E69 /* RemoteInspectorXPCConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = A5BA15E6182340B300A82E69 /* RemoteInspectorXPCConnection.h */; };
     957                A5BA15ED182340B400A82E69 /* RemoteInspectorXPCConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = A5BA15E6182340B300A82E69 /* RemoteInspectorXPCConnection.h */; settings = {ATTRIBUTES = (Private, ); }; };
    958958                A5BA15EE182340B400A82E69 /* RemoteInspectorXPCConnection.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15E7182340B300A82E69 /* RemoteInspectorXPCConnection.mm */; };
    959959                A5BA15F0182345AF00A82E69 /* RemoteInspectorDebuggable.h in Headers */ = {isa = PBXBuildFile; fileRef = A5BA15EF182345AF00A82E69 /* RemoteInspectorDebuggable.h */; settings = {ATTRIBUTES = (Private, ); }; };
  • trunk/Source/JavaScriptCore/inspector/remote/RemoteInspector.h

    r160099 r162112  
    2929#define RemoteInspector_h
    3030
    31 #import "RemoteInspectorDebuggableConnection.h"
    3231#import "RemoteInspectorXPCConnection.h"
    3332#import <wtf/Forward.h>
     
    3635#import <wtf/Threading.h>
    3736
     37OBJC_CLASS NSDictionary;
    3838OBJC_CLASS NSString;
    39 OBJC_CLASS NSDictionary;
    4039
    4140namespace Inspector {
    4241
    4342class RemoteInspectorDebuggable;
     43class RemoteInspectorDebuggableConnection;
    4444struct RemoteInspectorDebuggableInfo;
    4545
    4646class JS_EXPORT_PRIVATE RemoteInspector FINAL : public RemoteInspectorXPCConnection::Client {
    4747public:
     48    static void startDisabled();
    4849    static RemoteInspector& shared();
    4950    friend class NeverDestroyed<RemoteInspector>;
     
    8485    void receivedConnectionDiedMessage(NSDictionary *userInfo);
    8586
     87    static bool startEnabled;
     88
    8689    // Debuggables can be registered from any thread at any time.
    8790    // Any debuggable can send messages over the XPC connection.
     
    102105} // namespace Inspector
    103106
     107#endif // RemoteInspector_h
     108
    104109#endif // ENABLE(REMOTE_INSPECTOR)
    105 
    106 #endif // WebInspectorServer_h
  • trunk/Source/JavaScriptCore/inspector/remote/RemoteInspector.mm

    r161994 r162112  
    3232#import "RemoteInspectorConstants.h"
    3333#import "RemoteInspectorDebuggable.h"
     34#import "RemoteInspectorDebuggableConnection.h"
     35#import <Foundation/Foundation.h>
    3436#import <notify.h>
    35 #import <xpc/xpc.h>
    36 #import <Foundation/Foundation.h>
    3737#import <wtf/Assertions.h>
    3838#import <wtf/MainThread.h>
    3939#import <wtf/text/WTFString.h>
     40#import <xpc/xpc.h>
    4041
    4142#if PLATFORM(IOS)
     
    5556
    5657    dispatch_async(dispatch_get_main_queue(), block);
     58}
     59
     60bool RemoteInspector::startEnabled = true;
     61
     62void RemoteInspector::startDisabled()
     63{
     64    RemoteInspector::startEnabled = false;
    5765}
    5866
     
    6573        JSC::initializeThreading();
    6674        WTF::initializeMainThread();
    67         shared.get().start();
     75        if (RemoteInspector::startEnabled)
     76            shared.get().start();
    6877    });
    6978
  • trunk/Source/JavaScriptCore/inspector/remote/RemoteInspectorXPCConnection.h

    r160099 r162112  
    3333#import <xpc/xpc.h>
    3434
     35OBJC_CLASS NSDictionary;
    3536OBJC_CLASS NSString;
    36 OBJC_CLASS NSDictionary;
    3737
    3838namespace Inspector {
  • trunk/Source/WebCore/ChangeLog

    r162109 r162112  
     12014-01-15  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        [iOS] Clean up REMOTE_INSPECTOR code in OpenSource after the iOS merge
     4        https://bugs.webkit.org/show_bug.cgi?id=127069
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * WebCore.exp.in:
     9
    1102014-01-15  Sam Weinig  <sam@webkit.org>
    211
  • trunk/Source/WebCore/WebCore.exp.in

    r162107 r162112  
    29332933
    29342934#if ENABLE(REMOTE_INSPECTOR)
     2935__ZN7WebCore19InspectorController27dispatchMessageFromFrontendERKN3WTF6StringE
    29352936__ZN7WebCore4Page26setRemoteInspectionAllowedEb
    2936 __ZN7WebCore19InspectorController27dispatchMessageFromFrontendERKN3WTF6StringE
     2937__ZNK7WebCore4Page23remoteInspectionAllowedEv
    29372938#endif
    29382939
  • trunk/Source/WebKit/mac/ChangeLog

    r162094 r162112  
     12014-01-15  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        [iOS] Clean up REMOTE_INSPECTOR code in OpenSource after the iOS merge
     4        https://bugs.webkit.org/show_bug.cgi?id=127069
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * WebView/WebView.mm:
     9        (-[WebView initSimpleHTMLDocumentWithStyle:frame:preferences:groupName:]):
     10        (+[WebView _enableRemoteInspector]):
     11        (+[WebView _disableRemoteInspector]):
     12        (+[WebView _disableAutoStartRemoteInspector]):
     13        (+[WebView _isRemoteInspectorEnabled]):
     14        (+[WebView _hasRemoteInspectorSession]):
     15        (-[WebView allowsRemoteInspection]):
     16        Implement with RemoteInspector.h SPIs.
     17
     18        (-[WebView setAllowsRemoteInspection:]):
     19        (-[WebView setHostApplicationBundleId:name:]):
     20        Still unimplemented, update comment.
     21
     22        (-[WebView _didCommitLoadForFrame:]):
     23        Remove dead path, WebCore now pushes updates on navigations.
     24
     25        * WebView/WebViewData.h:
     26        * WebView/WebViewData.mm:
     27        (-[WebViewPrivate init]):
     28        Remove now unused ivar.
     29
    1302014-01-15  Alexey Proskuryakov  <ap@apple.com>
    231
  • trunk/Source/WebKit/mac/WebView/WebView.mm

    r162087 r162112  
    260260
    261261#if ENABLE(REMOTE_INSPECTOR)
     262#import <JavaScriptCore/RemoteInspector.h>
    262263#if PLATFORM(IOS)
    263264#import "WebIndicateLayer.h"
     
    301302#endif
    302303
     304using namespace JSC;
     305using namespace Inspector;
    303306using namespace WebCore;
    304 using namespace JSC;
    305307
    306308#if defined(__ppc__) || defined(__ppc64__)
     
    11841186
    11851187- (id)initSimpleHTMLDocumentWithStyle:(NSString *)style frame:(CGRect)frame preferences:(WebPreferences *)preferences groupName:(NSString *)groupName
    1186 {   
     1188{
    11871189    self = [super initWithFrame:frame];
    11881190    if (!self)
     
    12081210    // Internal installs allow debugging simple HTML documents (TextFields) if the Internal Setting is enabled.
    12091211    if (!isInternalInstall())
    1210         _private->allowsRemoteInspection = NO;
     1212        _private->page->setRemoteInspectionAllowed(false);
    12111213    else {
    12121214        static BOOL textFieldInspectionEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebKitTextFieldRemoteInspectionEnabledPreferenceKey];
    1213         _private->allowsRemoteInspection = textFieldInspectionEnabled;
    1214         BOOL autoStartRemoteInspector = YES; // FIXME: <rdar://problem/15810991>
    1215         if (_private->allowsRemoteInspection && autoStartRemoteInspector)
    1216             [WebView _enableRemoteInspector];
     1215        _private->page->setRemoteInspectionAllowed(textFieldInspectionEnabled);
    12171216    }
    12181217#endif
     
    19241923+ (void)_enableRemoteInspector
    19251924{
    1926     // FIXME: Move this to a new Inspector::RemoteInspectorServer interface or remove it.
     1925    RemoteInspector::shared().start();
    19271926}
    19281927
    19291928+ (void)_disableRemoteInspector
    19301929{
    1931     // FIXME: Move this to a new Inspector::RemoteInspectorServer interface or remove it.
     1930    RemoteInspector::shared().stop();
    19321931}
    19331932
    19341933+ (void)_disableAutoStartRemoteInspector
    19351934{
    1936     // FIXME: Move this to a new Inspector::RemoteInspectorServer interface or remove it.
     1935    RemoteInspector::startDisabled();
    19371936}
    19381937
    19391938+ (BOOL)_isRemoteInspectorEnabled
    19401939{
    1941     // FIXME: Move this to a new Inspector::RemoteInspectorServer interface or remove it.
    1942     return NO;
     1940    return RemoteInspector::shared().enabled();
    19431941}
    19441942
    19451943+ (BOOL)_hasRemoteInspectorSession
    19461944{
    1947     // FIXME: Move this to a new Inspector::RemoteInspectorServer interface or remove it.
    1948     return NO;
     1945    return RemoteInspector::shared().hasActiveDebugSession();
    19491946}
    19501947
    19511948- (BOOL)allowsRemoteInspection
    19521949{
    1953     // FIXME: Move this to a new API.
    1954     return NO;
     1950    return _private->page->remoteInspectionAllowed();
    19551951}
    19561952
    19571953- (void)setAllowsRemoteInspection:(BOOL)allow
    19581954{
    1959     // FIXME: Move this to a new API.
     1955    _private->page->setRemoteInspectionAllowed(allow);
    19601956}
    19611957
     
    19841980- (void)setHostApplicationBundleId:(NSString *)bundleId name:(NSString *)name
    19851981{
    1986     // FIXME: This has not yet been ported to Inspector::RemoteInspectorServer.
    1987 
    19881982    if (![_private->hostApplicationBundleId isEqualToString:bundleId]) {
    19891983        [_private->hostApplicationBundleId release];
     
    19961990    }
    19971991
    1998     // FIXME: <rdar://problem/15810991>
    1999     // [[WebView sharedWebInspectorServer] pushListing];
     1992    // FIXME: This has not yet been ported to Inspector::RemoteInspectorServer.
    20001993}
    20011994
     
    30333026- (void)_didCommitLoadForFrame:(WebFrame *)frame
    30343027{
    3035     if (frame == [self mainFrame]) {
     3028    if (frame == [self mainFrame])
    30363029        _private->didDrawTiles = 0;
    3037 #if ENABLE(REMOTE_INSPECTOR)
    3038         // FIXME: <rdar://problem/15810991>
    3039         // [[WebView sharedWebInspectorServer] pushListing];
    3040 #endif
    3041     }
    30423030}
    30433031
  • trunk/Source/WebKit/mac/WebView/WebViewData.h

    r161936 r162112  
    256256
    257257#if ENABLE(REMOTE_INSPECTOR)
    258     BOOL allowsRemoteInspection;
    259258#if PLATFORM(IOS)
    260259    WebIndicateLayer *indicateLayer;
  • trunk/Source/WebKit/mac/WebView/WebViewData.mm

    r161936 r162112  
    106106#endif
    107107
    108 #if ENABLE(REMOTE_INSPECTOR)
    109     allowsRemoteInspection = YES;
    110 #endif
    111 
    112108#if PLATFORM(IOS)
    113109    isStopping = NO;
Note: See TracChangeset for help on using the changeset viewer.