Bug 54455 - Web Inspector: move Database and DOMStorage related things from InspectorAgent
Summary: Web Inspector: move Database and DOMStorage related things from InspectorAgent
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Ilya Tikhonovsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-15 06:41 PST by Ilya Tikhonovsky
Modified: 2011-02-16 03:22 PST (History)
10 users (show)

See Also:


Attachments
[patch] initial version (23.50 KB, patch)
2011-02-15 06:54 PST, Ilya Tikhonovsky
pfeldman: review-
Details | Formatted Diff | Diff
[patch] second version (23.64 KB, patch)
2011-02-15 10:31 PST, Ilya Tikhonovsky
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ilya Tikhonovsky 2011-02-15 06:41:40 PST
Some set of instrumentation calls should work even if we have no InspectorFrontend instance and corresponding agents.
At the moment we are using InspectorAgent instance for such calls.
Comment 1 Ilya Tikhonovsky 2011-02-15 06:54:28 PST
Created attachment 82447 [details]
[patch] initial version
Comment 2 Yury Semikhatsky 2011-02-15 07:29:55 PST
Comment on attachment 82447 [details]
[patch] initial version

View in context: https://bugs.webkit.org/attachment.cgi?id=82447&action=review

> Source/WebCore/ChangeLog:5
> +        Web Inspector: move Database and DOMStorage related things from InspectorAgent to thecorresponding agents.

thecorresponding ->  the corresponding

> Source/WebCore/inspector/InspectorAgent.cpp:142
> +    , m_databaseAgentResources(InspectorDatabaseAgent::createOfflineStorage())

Consider renaming createOfflineStorage to createStorage

> Source/WebCore/inspector/InspectorAgent.cpp:463
> +    m_databaseAgentResources->pushDataCollectedOffline(m_frontend);

pushDataCollectedOffline should be a method on the database agent.

> Source/WebCore/inspector/InspectorAgent.cpp:466
> +    m_domStorageAgentResources->pushDataCollectedOffline(m_frontend);

Same here.
Comment 3 Pavel Feldman 2011-02-15 08:25:17 PST
Comment on attachment 82447 [details]
[patch] initial version

View in context: https://bugs.webkit.org/attachment.cgi?id=82447&action=review

>> Source/WebCore/inspector/InspectorAgent.cpp:142
>> +    , m_databaseAgentResources(InspectorDatabaseAgent::createOfflineStorage())
> 
> Consider renaming createOfflineStorage to createStorage

This does not really make the agents modular.

> Source/WebCore/inspector/InspectorAgent.cpp:393
> +    m_databaseAgent = InspectorDatabaseAgent::create(databaseAgentResources(), m_frontend);

Pass inspectorAgent into it instead.

>> Source/WebCore/inspector/InspectorAgent.cpp:463
>> +    m_databaseAgentResources->pushDataCollectedOffline(m_frontend);
> 
> pushDataCollectedOffline should be a method on the database agent.

This should be done upon agent instantiation, from within agent.

>> Source/WebCore/inspector/InspectorAgent.cpp:466
>> +    m_domStorageAgentResources->pushDataCollectedOffline(m_frontend);
> 
> Same here.

ditto.

> Source/WebCore/inspector/InspectorAgent.h:105
> +    virtual void pushDataCollectedOffline(InspectorFrontend*) = 0;

I think adding pushToFrontend method to the storage does not make much sense. Storage should be simple, it should store.
Comment 4 Ilya Tikhonovsky 2011-02-15 10:31:10 PST
Created attachment 82482 [details]
[patch] second version

(In reply to comment #2)
> (From update of attachment 82447 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=82447&action=review
> 
> > Source/WebCore/ChangeLog:5
> > +        Web Inspector: move Database and DOMStorage related things from InspectorAgent to thecorresponding agents.
> 
> thecorresponding ->  the corresponding

done

> > Source/WebCore/inspector/InspectorAgent.cpp:142
> > +    , m_databaseAgentResources(InspectorDatabaseAgent::createOfflineStorage())
> 
> Consider renaming createOfflineStorage to createStorage

done


> > Source/WebCore/inspector/InspectorAgent.cpp:463
> > +    m_databaseAgentResources->pushDataCollectedOffline(m_frontend);
> 
> pushDataCollectedOffline should be a method on the database agent.

This call is moved into ctor of InspectorDatabaseAgent.

> > Source/WebCore/inspector/InspectorAgent.cpp:466
> > +    m_domStorageAgentResources->pushDataCollectedOffline(m_frontend);
> 
> Same here.


This call is moved into ctor of InspectorDOMStorageAgent.
Comment 5 Ilya Tikhonovsky 2011-02-16 03:21:49 PST
Comment on attachment 82482 [details]
[patch] second version

Clearing flags on attachment: 82482

Committed r78692: <http://trac.webkit.org/changeset/78692>
Comment 6 Ilya Tikhonovsky 2011-02-16 03:22:01 PST
All reviewed patches have been landed.  Closing bug.