Bug 52510

Summary: Web Inspector: further split InspectorController meta bug.
Product: WebKit Reporter: Pavel Feldman <pfeldman>
Component: Web Inspector (Deprecated)Assignee: Pavel Feldman <pfeldman>
Status: RESOLVED FIXED    
Severity: Normal CC: apavlov, bweinstein, joepeck, keishi, loislo, pfeldman, pmuellr, rik, webkit.review.bot, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on: 52532, 52797, 52955    
Bug Blocks:    
Attachments:
Description Flags
[PATCH] Proposed change none

Description Pavel Feldman 2011-01-15 04:31:25 PST
We've done a lot of great work in splitting various aspects of InspectorController during the last year. I think it is time for another iteration and here is what I would suggest:

[PLAN]
- InspectorController gets renamed to the InspectorAgent, it gets public API defined in the Inspector.idl [domain=Inspector]. It continues to own other agents.
- New InspectorController is created, it only contains non-instrumentation methods of the InspectorController. WebCore and WebKit use this API to control inspector (show it, close it, toggle various high-level functions):

    bool enabled() const;
    void show();
    void inspect(Node*);
    void close();

    void startUserInitiatedProfiling();
    void stopUserInitiatedProfiling();
    bool profilerEnabled() const;

    void showAndEnableDebugger();
    bool debuggerEnabled() const;

    void connectFrontend();
    void reuseFrontend();
    void disconnectFrontend();

- WebCore uses only static InspectorInstrumentation:: calls for feeding instrumentation information to the inspector. Its implementation, InspectorInstrumentationImpl is aware of the agent(s) it should dispatch signals to.
- Each Agent inherits from two interfaces: one is generated from the corresponding Inspector.idl domain (and is only used for dispatching), the other is used by the internal clients: InspectorInstrumentationImpl, InspectorController and other agents. For example:

class InspectorDebuggerAgent {
public:
    void resume();
}
}

class InspectorDebuggerDispatch {
// Generate from inspector.idl...
}

class InspectorDebuggerAgentImpl : public InspectorDebuggerAgent, public InspectorDebuggerDispatch {
...
}

InspectorInstrumentationImpl and other inspector internals only see "InspectorDebuggerAgent" aspect.

[STEPS]
- Rename InspectorController to InspectorAgent
- Replace all the direct instrumentation calls to the inspectorController() with InspectorInstrumentation:: wrapper delegating to the new InspectorAgent instance.
- InspectorInstrumentation gets a static binding from Page to InspectorAgent (in order to hide latter from WebCore)
- Generate dispatch interfaces for all agents
- Provide inspector internals with pointers to pure agent APIs only
Comment 1 Pavel Feldman 2011-01-16 05:42:04 PST
Created attachment 79095 [details]
[PATCH] Proposed change
Comment 2 WebKit Review Bot 2011-01-16 05:43:22 PST
Attachment 79095 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1

Source/WebCore/inspector/InspectorInstrumentation.h:146:  The parameter name "database" adds no information, so it should be removed.  [readability/parameter_name] [5]
Source/WebCore/inspector/InspectorInstrumentation.h:154:  The parameter name "context" adds no information, so it should be removed.  [readability/parameter_name] [5]
Source/WebCore/inspector/InspectorInstrumentation.h:155:  The parameter name "context" adds no information, so it should be removed.  [readability/parameter_name] [5]
Source/WebCore/inspector/InspectorInstrumentation.h:254:  The parameter name "database" adds no information, so it should be removed.  [readability/parameter_name] [5]
Source/WebCore/inspector/InspectorController.h:157:  The parameter name "frame" adds no information, so it should be removed.  [readability/parameter_name] [5]
Source/WebCore/inspector/InspectorController.h:157:  The parameter name "world" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 6 in 24 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Pavel Feldman 2011-01-16 10:29:45 PST
Comment on attachment 79095 [details]
[PATCH] Proposed change

(attached to wrong bug)