summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/inspector/InspectorDOMAgent.h
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2011-05-18 13:36:51 +0100
committerSteve Block <steveblock@google.com>2011-05-24 15:38:28 +0100
commit2fc2651226baac27029e38c9d6ef883fa32084db (patch)
treee396d4bf89dcce6ed02071be66212495b1df1dec /Source/WebCore/inspector/InspectorDOMAgent.h
parentb3725cedeb43722b3b175aaeff70552e562d2c94 (diff)
downloadexternal_webkit-2fc2651226baac27029e38c9d6ef883fa32084db.zip
external_webkit-2fc2651226baac27029e38c9d6ef883fa32084db.tar.gz
external_webkit-2fc2651226baac27029e38c9d6ef883fa32084db.tar.bz2
Merge WebKit at r78450: Initial merge by git.
Change-Id: I6d3e5f1f868ec266a0aafdef66182ddc3f265dc1
Diffstat (limited to 'Source/WebCore/inspector/InspectorDOMAgent.h')
-rw-r--r--Source/WebCore/inspector/InspectorDOMAgent.h41
1 files changed, 10 insertions, 31 deletions
diff --git a/Source/WebCore/inspector/InspectorDOMAgent.h b/Source/WebCore/inspector/InspectorDOMAgent.h
index e4edf5d..4e603da 100644
--- a/Source/WebCore/inspector/InspectorDOMAgent.h
+++ b/Source/WebCore/inspector/InspectorDOMAgent.h
@@ -30,29 +30,22 @@
#ifndef InspectorDOMAgent_h
#define InspectorDOMAgent_h
-#include "EventListener.h"
-#include "EventTarget.h"
#include "InjectedScript.h"
#include "InjectedScriptHost.h"
#include "InspectorValues.h"
-#include "NodeList.h"
#include "Timer.h"
#include <wtf/Deque.h>
#include <wtf/ListHashSet.h>
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
-#include <wtf/PassRefPtr.h>
+#include <wtf/PassOwnPtr.h>
#include <wtf/RefPtr.h>
+#include <wtf/Vector.h>
#include <wtf/text/AtomicString.h>
namespace WebCore {
class ContainerNode;
-class CSSRule;
-class CSSRuleList;
-class CSSStyleDeclaration;
-class CSSStyleRule;
-class CSSStyleSheet;
class CharacterData;
class Document;
class Element;
@@ -79,7 +72,7 @@ struct EventListenerInfo {
const EventListenerVector eventListenerVector;
};
-class InspectorDOMAgent : public EventListener {
+class InspectorDOMAgent {
public:
struct DOMListener {
virtual ~DOMListener()
@@ -90,25 +83,17 @@ public:
virtual void didModifyDOMAttr(Element*) = 0;
};
- static PassRefPtr<InspectorDOMAgent> create(InjectedScriptHost* injectedScriptHost, InspectorFrontend* frontend)
+ static PassOwnPtr<InspectorDOMAgent> create(InjectedScriptHost* injectedScriptHost, InspectorFrontend* frontend)
{
- return adoptRef(new InspectorDOMAgent(injectedScriptHost, frontend));
- }
-
- static const InspectorDOMAgent* cast(const EventListener* listener)
- {
- return listener->type() == InspectorDOMAgentType
- ? static_cast<const InspectorDOMAgent*>(listener)
- : 0;
+ return adoptPtr(new InspectorDOMAgent(injectedScriptHost, frontend));
}
InspectorDOMAgent(InjectedScriptHost*, InspectorFrontend*);
~InspectorDOMAgent();
+ Vector<Document*> documents();
void reset();
- virtual bool operator==(const EventListener& other);
-
// Methods called from the frontend for DOM nodes inspection.
void getChildNodes(long nodeId);
void setAttribute(long elementId, const String& name, const String& value, bool* success);
@@ -131,6 +116,9 @@ public:
void setDocument(Document*);
void releaseDanglingNodes();
+ void mainFrameDOMContentLoaded();
+ void loadEventFired(Document*);
+
void didInsertDOMNode(Node*);
void didRemoveDOMNode(Node*);
void didModifyDOMAttr(Element*);
@@ -142,7 +130,6 @@ public:
void pushNodeByPathToFrontend(const String& path, long* nodeId);
long inspectedNode(unsigned long num);
void copyNode(long nodeId);
- const ListHashSet<RefPtr<Document> >& documents() { return m_documents; }
void setDOMListener(DOMListener*);
String documentURLString(Document*) const;
@@ -157,12 +144,6 @@ public:
static bool isWhitespace(Node*);
private:
- void startListeningFrameDocument(Node* frameOwnerNode);
- void startListening(Document*);
- void stopListening(Document*);
-
- virtual void handleEvent(ScriptExecutionContext*, Event*);
-
// Node-related methods.
typedef HashMap<RefPtr<Node>, long> NodeToIdMap;
long bind(Node*, NodeToIdMap*);
@@ -179,8 +160,6 @@ private:
PassRefPtr<InspectorArray> buildArrayForContainerChildren(Node* container, int depth, NodeToIdMap* nodesMap);
PassRefPtr<InspectorObject> buildObjectForEventListener(const RegisteredEventListener&, const AtomicString& eventType, Node*);
- Document* mainFrameDocument() const;
-
void onMatchJobsTimer(Timer<InspectorDOMAgent>*);
void reportNodesAsSearchResults(ListHashSet<Node*>& resultCollector);
@@ -201,7 +180,7 @@ private:
HashMap<long, NodeToIdMap*> m_idToNodesMap;
HashSet<long> m_childrenRequested;
long m_lastNodeId;
- ListHashSet<RefPtr<Document> > m_documents;
+ RefPtr<Document> m_document;
Deque<MatchJob*> m_pendingMatchJobs;
Timer<InspectorDOMAgent> m_matchJobsTimer;
HashSet<RefPtr<Node> > m_searchResults;