Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / inspector / InspectorInstrumentation.h
index 2f86c3d..f00c621 100644 (file)
 #ifndef InspectorInstrumentation_h
 #define InspectorInstrumentation_h
 
-#include "bindings/v8/ScriptString.h"
+#include "bindings/core/v8/ScriptString.h"
 #include "core/css/CSSSelector.h"
+#include "core/css/CSSStyleDeclaration.h"
 #include "core/css/CSSStyleSheet.h"
 #include "core/dom/CharacterData.h"
 #include "core/dom/Element.h"
 #include "core/dom/ExecutionContext.h"
-#include "core/events/EventContext.h"
-#include "core/frame/Frame.h"
+#include "core/events/NodeEventContext.h"
+#include "core/frame/LocalFrame.h"
 #include "core/inspector/ConsoleAPITypes.h"
-#include "core/page/Page.h"
 #include "core/rendering/HitTestResult.h"
 #include "core/rendering/RenderImage.h"
 #include "core/storage/StorageArea.h"
-#include "modules/websockets/WebSocketFrame.h"
-#include "modules/websockets/WebSocketHandshakeRequest.h"
-#include "modules/websockets/WebSocketHandshakeResponse.h"
 #include "platform/network/FormData.h"
+#include "platform/network/WebSocketHandshakeRequest.h"
+#include "platform/network/WebSocketHandshakeResponse.h"
 #include "wtf/RefPtr.h"
 
-namespace WebCore {
+namespace blink {
 
 struct CSSParserString;
 class Document;
 class Element;
-class DeviceOrientationData;
-class GeolocationPosition;
+class EventTarget;
+class ExecutionContext;
 class GraphicsContext;
+class GraphicsLayer;
 class InspectorTimelineAgent;
 class InstrumentingAgents;
 class RenderLayer;
-class ExecutionContext;
 class ThreadableLoaderClient;
 class WorkerGlobalScope;
-class WorkerGlobalScopeProxy;
+class WorkerInspectorProxy;
 
 #define FAST_RETURN_IF_NO_FRONTENDS(value) if (!hasFrontends()) return value;
 
@@ -81,7 +80,7 @@ public:
     bool hasMatchingTimelineAgentId(int id) const { return m_timelineAgentId == id; }
 
 private:
-    RefPtr<InstrumentingAgents> m_instrumentingAgents;
+    RefPtrWillBePersistent<InstrumentingAgents> m_instrumentingAgents;
     int m_timelineAgentId;
 };
 
@@ -95,8 +94,8 @@ private:
     static int s_frontendCounter;
 };
 
-inline void frontendCreated() { FrontendCounter::s_frontendCounter += 1; }
-inline void frontendDeleted() { FrontendCounter::s_frontendCounter -= 1; }
+inline void frontendCreated() { atomicIncrement(&FrontendCounter::s_frontendCounter); }
+inline void frontendDeleted() { atomicDecrement(&FrontendCounter::s_frontendCounter); }
 inline bool hasFrontends() { return FrontendCounter::s_frontendCounter; }
 
 void registerInstrumentingAgents(InstrumentingAgents*);
@@ -106,7 +105,8 @@ InspectorTimelineAgent* retrieveTimelineAgent(const InspectorInstrumentationCook
 
 // Called from generated instrumentation code.
 InstrumentingAgents* instrumentingAgentsFor(Page*);
-InstrumentingAgents* instrumentingAgentsFor(Frame*);
+InstrumentingAgents* instrumentingAgentsFor(LocalFrame*);
+InstrumentingAgents* instrumentingAgentsFor(EventTarget*);
 InstrumentingAgents* instrumentingAgentsFor(ExecutionContext*);
 InstrumentingAgents* instrumentingAgentsFor(Document&);
 InstrumentingAgents* instrumentingAgentsFor(Document*);
@@ -121,21 +121,22 @@ InstrumentingAgents* instrumentingAgentsForNonDocumentContext(ExecutionContext*)
 
 namespace InstrumentationEvents {
 extern const char PaintSetup[];
-extern const char PaintLayer[];
 extern const char RasterTask[];
-extern const char ImageDecodeTask[];
 extern const char Paint[];
 extern const char Layer[];
+extern const char RequestMainThreadFrame[];
 extern const char BeginFrame[];
-extern const char UpdateLayer[];
+extern const char DrawFrame[];
+extern const char ActivateLayerTree[];
+extern const char EmbedderCallback[];
 };
 
 namespace InstrumentationEventArguments {
+extern const char FrameId[];
 extern const char LayerId[];
 extern const char LayerTreeId[];
-extern const char NodeId[];
 extern const char PageId[];
-extern const char PixelRefId[];
+extern const char CallbackName[];
 };
 
 namespace InspectorInstrumentation {
@@ -147,7 +148,7 @@ inline InstrumentingAgents* instrumentingAgentsFor(ExecutionContext* context)
     return context->isDocument() ? instrumentingAgentsFor(*toDocument(context)) : instrumentingAgentsForNonDocumentContext(context);
 }
 
-inline InstrumentingAgents* instrumentingAgentsFor(Frame* frame)
+inline InstrumentingAgents* instrumentingAgentsFor(LocalFrame* frame)
 {
     return frame ? instrumentingAgentsFor(frame->page()) : 0;
 }
@@ -165,24 +166,33 @@ inline InstrumentingAgents* instrumentingAgentsFor(Document* document)
     return document ? instrumentingAgentsFor(*document) : 0;
 }
 
+inline InstrumentingAgents* instrumentingAgentsFor(CSSStyleSheet* styleSheet)
+{
+    return styleSheet ? instrumentingAgentsFor(styleSheet->ownerDocument()) : 0;
+}
+
 inline InstrumentingAgents* instrumentingAgentsFor(Node* node)
 {
     return node ? instrumentingAgentsFor(node->document()) : 0;
 }
 
+inline InstrumentingAgents* instrumentingAgentsFor(CSSStyleDeclaration* declaration)
+{
+    return declaration ? instrumentingAgentsFor(declaration->parentStyleSheet()) : 0;
+}
+
 } // namespace InspectorInstrumentation
 
 InstrumentingAgents* instrumentationForPage(Page*);
 
 InstrumentingAgents* instrumentationForWorkerGlobalScope(WorkerGlobalScope*);
 
-} // namespace WebCore
+} // namespace blink
 
-// This file will soon be generated
-#include "InspectorInstrumentationInl.h"
+#include "core/InspectorInstrumentationInl.h"
 
-#include "InspectorInstrumentationCustomInl.h"
+#include "core/inspector/InspectorInstrumentationCustomInl.h"
 
-#include "InspectorOverridesInl.h"
+#include "core/InspectorOverridesInl.h"
 
 #endif // !defined(InspectorInstrumentation_h)