[Webkit-unassigned] [Bug 91196] Web Inspector: refactor InspectorController::connectFrontend() to accept InspectorFrontendChannel.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jul 13 06:39:37 PDT 2012


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





--- Comment #2 from Vivek Galatage <vivekgalatage at gmail.com>  2012-07-13 06:39:37 PST ---
For this refactoring, as now we are planning to remove InspectorFrontendChannel from being inherited by InspectorClient, all the clients must be refactored as well. Here I propose the following approaches:

Approach 1:
-----------
All the clients will implement InspectorClient now without InspectorFrontendChannel. As a result of this, all of the clients(e.g. InspectorClientQt) needs to implement InspectorFrontendChannel separately. Now in this approach, the required objects within InspectorFrontendChannel::sendMessageToFrontend(), can be made members of the class who is implementing InspectorFrontendChannel lets say InspectorFrontendChannelQt. In turn, InspectorClientQt can own this new channel object InspectorFrontendChannelQt(InspectorClientQt::m_frontendChannel). And provide method within InspectorClient to return this channel object as: InspectorFrontendChannel* InspectorClient::frontendChannel()

class InspectorClientQt : public InspectorClient {
   ...
private:
    InspectorFrontendChannelQt* m_frontendChannel;
};

class InspectorFrontendChannelQt : public InspectorFrontendChannel {
public:
    InspectorFrontendChannelQt(QWebPage*, InspectorServerRequestHandlerQt* m_remoteFrontEndChannel);
    bool sendMessageToFrontend(const String& message);

private:
    QWebPage* m_frontendWebPage;
    InspectorServerRequestHandlerQt* m_remoteFrontEndChannel;
};


Approach 2:
-----------
This would be same as above except that the InspectorFrontendChannelQt can be declared as friend of InspectorClientQt. The class InspectorFrontendChannelQt can have just the reference to InspectorClientQt. So while we migrate the sendMessageToFrontend() to this new class InspectorFrontendChannelQt, we can access all the objects owned by InspectorClientQt.

class InspectorClientQt : public InspectorClient {
   ...
private:
    InspectorFrontendChannelQt* m_frontendChannel;
    friend class InspectorFrontendChannelQt;
};

class InspectorFrontendChannelQt : public InspectorFrontendChannel {
public:
    InspectorFrontendChannelQt(InspectorClientQt* m_inspectorClient);
    bool sendMessageToFrontend(const String& message);

private:
    InspectorClientQt* m_inspectorClient;
};


Please let me know your comments/suggestion on these approaches.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list