Replace static_casts with to* functions for document types.
[WebKit-https.git] / Source / WebCore / inspector / InspectorInstrumentation.h
index 4588865..b4a8322 100644 (file)
 #define InspectorInstrumentation_h
 
 #include "CSSSelector.h"
+#include "ConsoleAPITypes.h"
 #include "ConsoleTypes.h"
 #include "Element.h"
+#include "EventContext.h"
+#include "FormData.h"
 #include "Frame.h"
+#include "HitTestResult.h"
 #include "Page.h"
 #include "ScriptExecutionContext.h"
 #include "ScriptState.h"
 #include "StorageArea.h"
+#include "WebSocketFrame.h"
+#include "WebSocketHandshakeRequest.h"
+#include "WebSocketHandshakeResponse.h"
+#include <wtf/RefPtr.h>
+#include <wtf/UnusedParam.h>
 
 namespace WebCore {
 
 class CSSRule;
+class CachedResource;
 class CharacterData;
 class DOMWindow;
 class DOMWrapperWorld;
@@ -51,15 +61,19 @@ class Document;
 class Element;
 class EventContext;
 class DocumentLoader;
+class DocumentStyleSheetCollection;
 class DeviceOrientationData;
 class GeolocationPosition;
 class GraphicsContext;
-class HitTestResult;
 class InspectorCSSAgent;
+class InspectorCSSOMWrappers;
+class InspectorInstrumentation;
 class InspectorTimelineAgent;
 class InstrumentingAgents;
 class KURL;
 class Node;
+class PseudoElement;
+class RenderLayer;
 class RenderObject;
 class ResourceRequest;
 class ResourceResponse;
@@ -71,21 +85,34 @@ class ScriptProfile;
 class SecurityOrigin;
 class ShadowRoot;
 class StorageArea;
+class StyleResolver;
 class StyleRule;
 class ThreadableLoaderClient;
 class WorkerContext;
 class WorkerContextProxy;
 class XMLHttpRequest;
 
-#if ENABLE(WEB_SOCKETS)
-struct WebSocketFrame;
-class WebSocketHandshakeRequest;
-class WebSocketHandshakeResponse;
-#endif
-
 #define FAST_RETURN_IF_NO_FRONTENDS(value) if (!hasFrontends()) return value;
 
-typedef pair<InstrumentingAgents*, int> InspectorInstrumentationCookie;
+class InspectorInstrumentationCookie {
+#if ENABLE(INSPECTOR)
+public:
+    InspectorInstrumentationCookie();
+    InspectorInstrumentationCookie(InstrumentingAgents*, int);
+    InspectorInstrumentationCookie(const InspectorInstrumentationCookie&);
+    InspectorInstrumentationCookie& operator=(const InspectorInstrumentationCookie&);
+    ~InspectorInstrumentationCookie();
+
+private:
+    friend class InspectorInstrumentation;
+    InstrumentingAgents* instrumentingAgents() const { return m_instrumentingAgents.get(); }
+    bool isValid() const { return !!m_instrumentingAgents; }
+    bool hasMatchingTimelineAgentId(int id) const { return m_timelineAgentId == id; }
+
+    RefPtr<InstrumentingAgents> m_instrumentingAgents;
+    int m_timelineAgentId;
+#endif
+};
 
 class InspectorInstrumentation {
 public:
@@ -122,7 +149,7 @@ public:
     static void didCallFunction(const InspectorInstrumentationCookie&);
     static InspectorInstrumentationCookie willDispatchXHRReadyStateChangeEvent(ScriptExecutionContext*, XMLHttpRequest*);
     static void didDispatchXHRReadyStateChangeEvent(const InspectorInstrumentationCookie&);
-    static InspectorInstrumentationCookie willDispatchEvent(Document*, const Event& event, DOMWindow* window, Node* node, const Vector<EventContext>& ancestors);
+    static InspectorInstrumentationCookie willDispatchEvent(Document*, const Event&, DOMWindow*, Node*, const EventPath&);
     static void didDispatchEvent(const InspectorInstrumentationCookie&);
     static InspectorInstrumentationCookie willHandleEvent(ScriptExecutionContext*, Event*);
     static void didHandleEvent(const InspectorInstrumentationCookie&);
@@ -130,34 +157,34 @@ public:
     static void didDispatchEventOnWindow(const InspectorInstrumentationCookie&);
     static InspectorInstrumentationCookie willEvaluateScript(Frame*, const String& url, int lineNumber);
     static void didEvaluateScript(const InspectorInstrumentationCookie&);
+    static void scriptsEnabled(Page*, bool isEnabled);
     static void didCreateIsolatedContext(Frame*, ScriptState*, SecurityOrigin*);
     static InspectorInstrumentationCookie willFireTimer(ScriptExecutionContext*, int timerId);
     static void didFireTimer(const InspectorInstrumentationCookie&);
-    static void didBeginFrame(Page*);
-    static void didCancelFrame(Page*);
     static void didInvalidateLayout(Frame*);
     static InspectorInstrumentationCookie willLayout(Frame*);
     static void didLayout(const InspectorInstrumentationCookie&, RenderObject*);
     static void didScroll(Page*);
     static InspectorInstrumentationCookie willDispatchXHRLoadEvent(ScriptExecutionContext*, XMLHttpRequest*);
     static void didDispatchXHRLoadEvent(const InspectorInstrumentationCookie&);
-    static InspectorInstrumentationCookie willPaint(Frame*, GraphicsContext*, const LayoutRect&);
-    static void didPaint(const InspectorInstrumentationCookie&);
+    static void willScrollLayer(Frame*);
+    static void didScrollLayer(Frame*);
+    static InspectorInstrumentationCookie willPaint(Frame*);
+    static void didPaint(const InspectorInstrumentationCookie&, GraphicsContext*, const LayoutRect&);
     static void willComposite(Page*);
     static void didComposite(Page*);
     static InspectorInstrumentationCookie willRecalculateStyle(Document*);
     static void didRecalculateStyle(const InspectorInstrumentationCookie&);
     static void didScheduleStyleRecalculation(Document*);
-    static InspectorInstrumentationCookie willMatchRule(Document*, const StyleRule*);
+    static InspectorInstrumentationCookie willMatchRule(Document*, StyleRule*, InspectorCSSOMWrappers&, DocumentStyleSheetCollection*);
     static void didMatchRule(const InspectorInstrumentationCookie&, bool matched);
-    static InspectorInstrumentationCookie willProcessRule(Document*, const StyleRule*);
+    static InspectorInstrumentationCookie willProcessRule(Document*, StyleRule*, StyleResolver*);
     static void didProcessRule(const InspectorInstrumentationCookie&);
-    static void willProcessTask(Page*);
-    static void didProcessTask(Page*);
 
     static void applyUserAgentOverride(Frame*, String*);
     static void applyScreenWidthOverride(Frame*, long*);
     static void applyScreenHeightOverride(Frame*, long*);
+    static void applyEmulatedMedia(Frame*, String*);
     static bool shouldApplyScreenWidthOverride(Frame*);
     static bool shouldApplyScreenHeightOverride(Frame*);
     static void willSendRequest(Frame*, unsigned long identifier, DocumentLoader*, ResourceRequest&, const ResourceResponse& redirectResponse);
@@ -188,19 +215,29 @@ public:
     static void loadEventFired(Frame*);
     static void frameDetachedFromParent(Frame*);
     static void didCommitLoad(Frame*, DocumentLoader*);
+    static void frameDocumentUpdated(Frame*);
     static void loaderDetachedFromFrame(Frame*, DocumentLoader*);
+    static void frameStartedLoading(Frame*);
+    static void frameStoppedLoading(Frame*);
+    static void frameScheduledNavigation(Frame*, double delay);
+    static void frameClearedScheduledNavigation(Frame*);
+    static InspectorInstrumentationCookie willRunJavaScriptDialog(Page*, const String& message);
+    static void didRunJavaScriptDialog(const InspectorInstrumentationCookie&);
     static void willDestroyCachedResource(CachedResource*);
 
-    static InspectorInstrumentationCookie willWriteHTML(Document*, unsigned int length, unsigned int startLine);
-    static void didWriteHTML(const InspectorInstrumentationCookie&, unsigned int endLine);
+    static InspectorInstrumentationCookie willWriteHTML(Document*, unsigned startLine);
+    static void didWriteHTML(const InspectorInstrumentationCookie&, unsigned endLine);
 
-    static void addMessageToConsole(Page*, MessageSource, MessageType, MessageLevel, const String& message, PassRefPtr<ScriptArguments>, PassRefPtr<ScriptCallStack>);
-    static void addMessageToConsole(Page*, MessageSource, MessageType, MessageLevel, const String& message, const String&, unsigned lineNumber);
+    // FIXME: Remove once we no longer generate stacks outside of Inspector.
+    static void addMessageToConsole(Page*, MessageSource, MessageType, MessageLevel, const String& message, PassRefPtr<ScriptCallStack>, unsigned long requestIdentifier = 0);
+    static void addMessageToConsole(Page*, MessageSource, MessageType, MessageLevel, const String& message, ScriptState*, PassRefPtr<ScriptArguments>, unsigned long requestIdentifier = 0);
+    static void addMessageToConsole(Page*, MessageSource, MessageType, MessageLevel, const String& message, const String&, unsigned lineNumber, ScriptState* = 0, unsigned long requestIdentifier = 0);
 #if ENABLE(WORKERS)
-    static void addMessageToConsole(WorkerContext*, MessageSource, MessageType, MessageLevel, const String& message, PassRefPtr<ScriptArguments>, PassRefPtr<ScriptCallStack>);
-    static void addMessageToConsole(WorkerContext*, MessageSource, MessageType, MessageLevel, const String& message, const String&, unsigned lineNumber);
+    // FIXME: Convert to ScriptArguments to match non-worker context.
+    static void addMessageToConsole(WorkerContext*, MessageSource, MessageType, MessageLevel, const String& message, PassRefPtr<ScriptCallStack>, unsigned long requestIdentifier = 0);
+    static void addMessageToConsole(WorkerContext*, MessageSource, MessageType, MessageLevel, const String& message, const String&, unsigned lineNumber, ScriptState* = 0, unsigned long requestIdentifier = 0);
 #endif
-    static void consoleCount(Page*, PassRefPtr<ScriptArguments>, PassRefPtr<ScriptCallStack>);
+    static void consoleCount(Page*, ScriptState*, PassRefPtr<ScriptArguments>);
     static void startConsoleTiming(Frame*, const String& title);
     static void stopConsoleTiming(Frame*, const String& title, PassRefPtr<ScriptCallStack>);
     static void consoleTimeStamp(Frame*, PassRefPtr<ScriptArguments>);
@@ -221,7 +258,6 @@ public:
     static void didOpenDatabase(ScriptExecutionContext*, PassRefPtr<Database>, const String& domain, const String& name, const String& version);
 #endif
 
-    static void didUseDOMStorage(Page*, StorageArea*, bool isLocalStorage, Frame*);
     static void didDispatchDOMStorageEvent(const String& key, const String& oldValue, const String& newValue, StorageType, SecurityOrigin*, Page*);
 
 #if ENABLE(WORKERS)
@@ -232,10 +268,10 @@ public:
 #endif
 
 #if ENABLE(WEB_SOCKETS)
-    static void didCreateWebSocket(ScriptExecutionContext*, unsigned long identifier, const KURL& requestURL, const KURL& documentURL);
-    static void willSendWebSocketHandshakeRequest(ScriptExecutionContext*, unsigned long identifier, const WebSocketHandshakeRequest&);
-    static void didReceiveWebSocketHandshakeResponse(ScriptExecutionContext*, unsigned long identifier, const WebSocketHandshakeResponse&);
-    static void didCloseWebSocket(ScriptExecutionContext*, unsigned long identifier);
+    static void didCreateWebSocket(Document*, unsigned long identifier, const KURL& requestURL, const KURL& documentURL, const String& protocol);
+    static void willSendWebSocketHandshakeRequest(Document*, unsigned long identifier, const WebSocketHandshakeRequest&);
+    static void didReceiveWebSocketHandshakeResponse(Document*, unsigned long identifier, const WebSocketHandshakeResponse&);
+    static void didCloseWebSocket(Document*, unsigned long identifier);
     static void didReceiveWebSocketFrame(Document*, unsigned long identifier, const WebSocketFrame&);
     static void didSendWebSocketFrame(Document*, unsigned long identifier, const WebSocketFrame&);
     static void didReceiveWebSocketFrameError(Document*, unsigned long identifier, const String& errorMessage);
@@ -255,7 +291,6 @@ public:
     static bool hasFrontends() { return s_frontendCounter; }
     static bool canvasAgentEnabled(ScriptExecutionContext*);
     static bool consoleAgentEnabled(ScriptExecutionContext*);
-    static bool runtimeAgentEnabled(Frame*);
     static bool timelineAgentEnabled(ScriptExecutionContext*);
     static bool collectingHTMLParseErrors(Page*);
 #else
@@ -276,6 +311,12 @@ public:
 
     static DeviceOrientationData* overrideDeviceOrientation(Page*, DeviceOrientationData*);
 
+#if USE(ACCELERATED_COMPOSITING)
+    static void layerTreeDidChange(Page*);
+    static void renderLayerDestroyed(Page*, const RenderLayer*);
+    static void pseudoElementDestroyed(Page*, PseudoElement*);
+#endif
+
 private:
 #if ENABLE(INSPECTOR)
     static void didClearWindowObjectInWorldImpl(InstrumentingAgents*, Frame*, DOMWrapperWorld*);
@@ -312,7 +353,7 @@ private:
     static void didCallFunctionImpl(const InspectorInstrumentationCookie&);
     static InspectorInstrumentationCookie willDispatchXHRReadyStateChangeEventImpl(InstrumentingAgents*, XMLHttpRequest*, ScriptExecutionContext*);
     static void didDispatchXHRReadyStateChangeEventImpl(const InspectorInstrumentationCookie&);
-    static InspectorInstrumentationCookie willDispatchEventImpl(InstrumentingAgents*, const Event&, DOMWindow*, Node*, const Vector<EventContext>& ancestors, Document*);
+    static InspectorInstrumentationCookie willDispatchEventImpl(InstrumentingAgents*, const Event&, DOMWindow*, Node*, const EventPath&, Document*);
     static InspectorInstrumentationCookie willHandleEventImpl(InstrumentingAgents*, Event*);
     static void didHandleEventImpl(const InspectorInstrumentationCookie&);
     static void didDispatchEventImpl(const InspectorInstrumentationCookie&);
@@ -320,34 +361,32 @@ private:
     static void didDispatchEventOnWindowImpl(const InspectorInstrumentationCookie&);
     static InspectorInstrumentationCookie willEvaluateScriptImpl(InstrumentingAgents*, const String& url, int lineNumber, Frame*);
     static void didEvaluateScriptImpl(const InspectorInstrumentationCookie&);
+    static void scriptsEnabledImpl(InstrumentingAgents*, bool isEnabled);
     static void didCreateIsolatedContextImpl(InstrumentingAgents*, Frame*, ScriptState*, SecurityOrigin*);
     static InspectorInstrumentationCookie willFireTimerImpl(InstrumentingAgents*, int timerId, ScriptExecutionContext*);
     static void didFireTimerImpl(const InspectorInstrumentationCookie&);
-    static void didBeginFrameImpl(InstrumentingAgents*);
-    static void didCancelFrameImpl(InstrumentingAgents*);
     static void didInvalidateLayoutImpl(InstrumentingAgents*, Frame*);
     static InspectorInstrumentationCookie willLayoutImpl(InstrumentingAgents*, Frame*);
     static void didLayoutImpl(const InspectorInstrumentationCookie&, RenderObject*);
     static void didScrollImpl(InstrumentingAgents*);
     static InspectorInstrumentationCookie willDispatchXHRLoadEventImpl(InstrumentingAgents*, XMLHttpRequest*, ScriptExecutionContext*);
     static void didDispatchXHRLoadEventImpl(const InspectorInstrumentationCookie&);
-    static InspectorInstrumentationCookie willPaintImpl(InstrumentingAgents*, GraphicsContext*, const LayoutRect&, Frame*);
-    static void didPaintImpl(const InspectorInstrumentationCookie&);
-    static void willCompositeImpl(InstrumentingAgents*);
-    static void didCompositeImpl(InstrumentingAgents*);
+    static void willScrollLayerImpl(InstrumentingAgents*, Frame*);
+    static void didScrollLayerImpl(InstrumentingAgents*);
+    static InspectorInstrumentationCookie willPaintImpl(InstrumentingAgents*, Frame*);
+    static void didPaintImpl(const InspectorInstrumentationCookie&, GraphicsContext*, const LayoutRect&);
     static InspectorInstrumentationCookie willRecalculateStyleImpl(InstrumentingAgents*, Frame*);
     static void didRecalculateStyleImpl(const InspectorInstrumentationCookie&);
     static void didScheduleStyleRecalculationImpl(InstrumentingAgents*, Document*);
-    static InspectorInstrumentationCookie willMatchRuleImpl(InstrumentingAgents*, const StyleRule*);
+    static InspectorInstrumentationCookie willMatchRuleImpl(InstrumentingAgents*, StyleRule*, InspectorCSSOMWrappers&, DocumentStyleSheetCollection*);
     static void didMatchRuleImpl(const InspectorInstrumentationCookie&, bool matched);
-    static InspectorInstrumentationCookie willProcessRuleImpl(InstrumentingAgents*, const StyleRule*);
+    static InspectorInstrumentationCookie willProcessRuleImpl(InstrumentingAgents*, StyleRule*, StyleResolver*);
     static void didProcessRuleImpl(const InspectorInstrumentationCookie&);
-    static void willProcessTaskImpl(InstrumentingAgents*);
-    static void didProcessTaskImpl(InstrumentingAgents*);
 
     static void applyUserAgentOverrideImpl(InstrumentingAgents*, String*);
     static void applyScreenWidthOverrideImpl(InstrumentingAgents*, long*);
     static void applyScreenHeightOverrideImpl(InstrumentingAgents*, long*);
+    static void applyEmulatedMediaImpl(InstrumentingAgents*, String*);
     static bool shouldApplyScreenWidthOverrideImpl(InstrumentingAgents*);
     static bool shouldApplyScreenHeightOverrideImpl(InstrumentingAgents*);
     static void willSendRequestImpl(InstrumentingAgents*, unsigned long identifier, DocumentLoader*, ResourceRequest&, const ResourceResponse& redirectResponse);
@@ -379,15 +418,26 @@ private:
     static void loadEventFiredImpl(InstrumentingAgents*, Frame*);
     static void frameDetachedFromParentImpl(InstrumentingAgents*, Frame*);
     static void didCommitLoadImpl(InstrumentingAgents*, Page*, DocumentLoader*);
+    static void frameDocumentUpdatedImpl(InstrumentingAgents*, Frame*);
     static void loaderDetachedFromFrameImpl(InstrumentingAgents*, DocumentLoader*);
+    static void frameStartedLoadingImpl(InstrumentingAgents*, Frame*);
+    static void frameStoppedLoadingImpl(InstrumentingAgents*, Frame*);
+    static void frameScheduledNavigationImpl(InstrumentingAgents*, Frame*, double delay);
+    static void frameClearedScheduledNavigationImpl(InstrumentingAgents*, Frame*);
+    static InspectorInstrumentationCookie willRunJavaScriptDialogImpl(InstrumentingAgents*, const String& message);
+    static void didRunJavaScriptDialogImpl(const InspectorInstrumentationCookie&);
     static void willDestroyCachedResourceImpl(CachedResource*);
 
-    static InspectorInstrumentationCookie willWriteHTMLImpl(InstrumentingAgents*, unsigned int length, unsigned int startLine, Frame*);
-    static void didWriteHTMLImpl(const InspectorInstrumentationCookie&, unsigned int endLine);
+    static InspectorInstrumentationCookie willWriteHTMLImpl(InstrumentingAgents*, unsigned startLine, Frame*);
+    static void didWriteHTMLImpl(const InspectorInstrumentationCookie&, unsigned endLine);
+
+    static void addMessageToConsoleImpl(InstrumentingAgents*, MessageSource, MessageType, MessageLevel, const String& message, ScriptState*, PassRefPtr<ScriptArguments>, unsigned long requestIdentifier);
+    static void addMessageToConsoleImpl(InstrumentingAgents*, MessageSource, MessageType, MessageLevel, const String& message, const String& scriptId, unsigned lineNumber, ScriptState*, unsigned long requestIdentifier);
+
+    // FIXME: Remove once we no longer generate stacks outside of Inspector.
+    static void addMessageToConsoleImpl(InstrumentingAgents*, MessageSource, MessageType, MessageLevel, const String& message, PassRefPtr<ScriptCallStack>, unsigned long requestIdentifier);
 
-    static void addMessageToConsoleImpl(InstrumentingAgents*, MessageSource, MessageType, MessageLevel, const String& message, PassRefPtr<ScriptArguments>, PassRefPtr<ScriptCallStack>);
-    static void addMessageToConsoleImpl(InstrumentingAgents*, MessageSource, MessageType, MessageLevel, const String& message, const String& scriptId, unsigned lineNumber);
-    static void consoleCountImpl(InstrumentingAgents*, PassRefPtr<ScriptArguments>, PassRefPtr<ScriptCallStack>);
+    static void consoleCountImpl(InstrumentingAgents*, ScriptState*, PassRefPtr<ScriptArguments>);
     static void startConsoleTimingImpl(InstrumentingAgents*, Frame*, const String& title);
     static void stopConsoleTimingImpl(InstrumentingAgents*, Frame*, const String& title, PassRefPtr<ScriptCallStack>);
     static void consoleTimeStampImpl(InstrumentingAgents*, Frame*, PassRefPtr<ScriptArguments>);
@@ -408,7 +458,6 @@ private:
     static void didOpenDatabaseImpl(InstrumentingAgents*, PassRefPtr<Database>, const String& domain, const String& name, const String& version);
 #endif
 
-    static void didUseDOMStorageImpl(InstrumentingAgents*, StorageArea*, bool isLocalStorage, Frame*);
     static void didDispatchDOMStorageEventImpl(InstrumentingAgents*, const String& key, const String& oldValue, const String& newValue, StorageType, SecurityOrigin*, Page*);
 
 #if ENABLE(WORKERS)
@@ -418,10 +467,10 @@ private:
 #endif
 
 #if ENABLE(WEB_SOCKETS)
-    static void didCreateWebSocketImpl(InstrumentingAgents*, unsigned long identifier, const KURL& requestURL, const KURL& documentURL);
-    static void willSendWebSocketHandshakeRequestImpl(InstrumentingAgents*, unsigned long identifier, const WebSocketHandshakeRequest&);
-    static void didReceiveWebSocketHandshakeResponseImpl(InstrumentingAgents*, unsigned long identifier, const WebSocketHandshakeResponse&);
-    static void didCloseWebSocketImpl(InstrumentingAgents*, unsigned long identifier);
+    static void didCreateWebSocketImpl(InstrumentingAgents*, unsigned long identifier, const KURL& requestURL, const KURL& documentURL, const String& protocol, Document*);
+    static void willSendWebSocketHandshakeRequestImpl(InstrumentingAgents*, unsigned long identifier, const WebSocketHandshakeRequest&, Document*);
+    static void didReceiveWebSocketHandshakeResponseImpl(InstrumentingAgents*, unsigned long identifier, const WebSocketHandshakeResponse&, Document*);
+    static void didCloseWebSocketImpl(InstrumentingAgents*, unsigned long identifier, Document*);
     static void didReceiveWebSocketFrameImpl(InstrumentingAgents*, unsigned long identifier, const WebSocketFrame&);
     static void didSendWebSocketFrameImpl(InstrumentingAgents*, unsigned long identifier, const WebSocketFrame&);
     static void didReceiveWebSocketFrameErrorImpl(InstrumentingAgents*, unsigned long identifier, const String&);
@@ -449,15 +498,38 @@ private:
 #endif
 
     static DeviceOrientationData* overrideDeviceOrientationImpl(InstrumentingAgents*, DeviceOrientationData*);
+
+#if USE(ACCELERATED_COMPOSITING)
+    static void layerTreeDidChangeImpl(InstrumentingAgents*);
+    static void renderLayerDestroyedImpl(InstrumentingAgents*, const RenderLayer*);
+    static void pseudoElementDestroyedImpl(InstrumentingAgents*, PseudoElement*);
+#endif
+
     static int s_frontendCounter;
 #endif
 };
 
+namespace InstrumentationEvents {
+extern const char PaintLayer[];
+extern const char RasterTask[];
+extern const char Paint[];
+extern const char Layer[];
+extern const char BeginFrame[];
+};
+
+namespace InstrumentationEventArguments {
+extern const char LayerId[];
+extern const char PageId[];
+};
+
 inline void InspectorInstrumentation::didClearWindowObjectInWorld(Frame* frame, DOMWrapperWorld* world)
 {
 #if ENABLE(INSPECTOR)
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
         didClearWindowObjectInWorldImpl(instrumentingAgents, frame, world);
+#else
+    UNUSED_PARAM(frame);
+    UNUSED_PARAM(world);
 #endif
 }
 
@@ -467,6 +539,8 @@ inline bool InspectorInstrumentation::isDebuggerPaused(Frame* frame)
     FAST_RETURN_IF_NO_FRONTENDS(false);
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
         return isDebuggerPausedImpl(instrumentingAgents);
+#else
+    UNUSED_PARAM(frame);
 #endif
     return false;
 }
@@ -477,6 +551,9 @@ inline void InspectorInstrumentation::willInsertDOMNode(Document* document, Node
     FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
         willInsertDOMNodeImpl(instrumentingAgents, parent);
+#else
+    UNUSED_PARAM(document);
+    UNUSED_PARAM(parent);
 #endif
 }
 
@@ -486,6 +563,9 @@ inline void InspectorInstrumentation::didInsertDOMNode(Document* document, Node*
     FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
         didInsertDOMNodeImpl(instrumentingAgents, node);
+#else
+    UNUSED_PARAM(document);
+    UNUSED_PARAM(node);
 #endif
 }
 
@@ -497,6 +577,9 @@ inline void InspectorInstrumentation::willRemoveDOMNode(Document* document, Node
         willRemoveDOMNodeImpl(instrumentingAgents, node);
         didRemoveDOMNodeImpl(instrumentingAgents, node);
     }
+#else
+    UNUSED_PARAM(document);
+    UNUSED_PARAM(node);
 #endif
 }
 
@@ -506,6 +589,11 @@ inline void InspectorInstrumentation::willModifyDOMAttr(Document* document, Elem
     FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
         willModifyDOMAttrImpl(instrumentingAgents, element, oldValue, newValue);
+#else
+    UNUSED_PARAM(document);
+    UNUSED_PARAM(element);
+    UNUSED_PARAM(oldValue);
+    UNUSED_PARAM(newValue);
 #endif
 }
 
@@ -515,6 +603,11 @@ inline void InspectorInstrumentation::didModifyDOMAttr(Document* document, Eleme
     FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
         didModifyDOMAttrImpl(instrumentingAgents, element, name, value);
+#else
+    UNUSED_PARAM(document);
+    UNUSED_PARAM(element);
+    UNUSED_PARAM(name);
+    UNUSED_PARAM(value);
 #endif
 }
 
@@ -524,6 +617,10 @@ inline void InspectorInstrumentation::didRemoveDOMAttr(Document* document, Eleme
     FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
         didRemoveDOMAttrImpl(instrumentingAgents, element, name);
+#else
+    UNUSED_PARAM(document);
+    UNUSED_PARAM(element);
+    UNUSED_PARAM(name);
 #endif
 }
 
@@ -533,6 +630,9 @@ inline void InspectorInstrumentation::didInvalidateStyleAttr(Document* document,
     FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
         didInvalidateStyleAttrImpl(instrumentingAgents, node);
+#else
+    UNUSED_PARAM(document);
+    UNUSED_PARAM(node);
 #endif
 }
 
@@ -541,6 +641,9 @@ inline void InspectorInstrumentation::frameWindowDiscarded(Frame* frame, DOMWind
 #if ENABLE(INSPECTOR)
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
         frameWindowDiscardedImpl(instrumentingAgents, domWindow);
+#else
+    UNUSED_PARAM(frame);
+    UNUSED_PARAM(domWindow);
 #endif
 }
 
@@ -550,6 +653,8 @@ inline void InspectorInstrumentation::mediaQueryResultChanged(Document* document
     FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
         mediaQueryResultChangedImpl(instrumentingAgents);
+#else
+    UNUSED_PARAM(document);
 #endif
 }
 
@@ -559,6 +664,9 @@ inline void InspectorInstrumentation::didPushShadowRoot(Element* host, ShadowRoo
     FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(host->ownerDocument()))
         didPushShadowRootImpl(instrumentingAgents, host, root);
+#else
+    UNUSED_PARAM(host);
+    UNUSED_PARAM(root);
 #endif
 }
 
@@ -568,6 +676,9 @@ inline void InspectorInstrumentation::willPopShadowRoot(Element* host, ShadowRoo
     FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(host->ownerDocument()))
         willPopShadowRootImpl(instrumentingAgents, host, root);
+#else
+    UNUSED_PARAM(host);
+    UNUSED_PARAM(root);
 #endif
 }
 
@@ -577,6 +688,9 @@ inline void InspectorInstrumentation::didCreateNamedFlow(Document* document, Web
     FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
         didCreateNamedFlowImpl(instrumentingAgents, document, namedFlow);
+#else
+    UNUSED_PARAM(document);
+    UNUSED_PARAM(namedFlow);
 #endif
 }
 
@@ -586,6 +700,9 @@ inline void InspectorInstrumentation::willRemoveNamedFlow(Document* document, We
     FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
         willRemoveNamedFlowImpl(instrumentingAgents, document, namedFlow);
+#else
+    UNUSED_PARAM(document);
+    UNUSED_PARAM(namedFlow);
 #endif
 }
 
@@ -595,6 +712,9 @@ inline void InspectorInstrumentation::didUpdateRegionLayout(Document* document,
     FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
         didUpdateRegionLayoutImpl(instrumentingAgents, document, namedFlow);
+#else
+    UNUSED_PARAM(document);
+    UNUSED_PARAM(namedFlow);
 #endif
 }
 
@@ -604,6 +724,10 @@ inline void InspectorInstrumentation::mouseDidMoveOverElement(Page* page, const
     FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
         mouseDidMoveOverElementImpl(instrumentingAgents, result, modifierFlags);
+#else
+    UNUSED_PARAM(page);
+    UNUSED_PARAM(result);
+    UNUSED_PARAM(modifierFlags);
 #endif
 }
 
@@ -613,6 +737,9 @@ inline bool InspectorInstrumentation::handleTouchEvent(Page* page, Node* node)
     FAST_RETURN_IF_NO_FRONTENDS(false);
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
         return handleTouchEventImpl(instrumentingAgents, node);
+#else
+    UNUSED_PARAM(page);
+    UNUSED_PARAM(node);
 #endif
     return false;
 }
@@ -623,6 +750,8 @@ inline bool InspectorInstrumentation::handleMousePress(Page* page)
     FAST_RETURN_IF_NO_FRONTENDS(false);
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
         return handleMousePressImpl(instrumentingAgents);
+#else
+    UNUSED_PARAM(page);
 #endif
     return false;
 }
@@ -633,6 +762,9 @@ inline bool InspectorInstrumentation::forcePseudoState(Element* element, CSSSele
     FAST_RETURN_IF_NO_FRONTENDS(false);
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(element->document()))
         return forcePseudoStateImpl(instrumentingAgents, element, pseudoState);
+#else
+    UNUSED_PARAM(element);
+    UNUSED_PARAM(pseudoState);
 #endif
     return false;
 }
@@ -643,6 +775,9 @@ inline void InspectorInstrumentation::characterDataModified(Document* document,
     FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
         characterDataModifiedImpl(instrumentingAgents, characterData);
+#else
+    UNUSED_PARAM(document);
+    UNUSED_PARAM(characterData);
 #endif
 }
 
@@ -652,6 +787,9 @@ inline void InspectorInstrumentation::willSendXMLHttpRequest(ScriptExecutionCont
     FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
         willSendXMLHttpRequestImpl(instrumentingAgents, url);
+#else
+    UNUSED_PARAM(context);
+    UNUSED_PARAM(url);
 #endif
 }
 
@@ -661,6 +799,9 @@ inline void InspectorInstrumentation::didScheduleResourceRequest(Document* docum
     FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
         didScheduleResourceRequestImpl(instrumentingAgents, url, document->frame());
+#else
+    UNUSED_PARAM(document);
+    UNUSED_PARAM(url);
 #endif
 }
 
@@ -670,6 +811,11 @@ inline void InspectorInstrumentation::didInstallTimer(ScriptExecutionContext* co
     FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
         didInstallTimerImpl(instrumentingAgents, timerId, timeout, singleShot, context);
+#else
+    UNUSED_PARAM(context);
+    UNUSED_PARAM(timerId);
+    UNUSED_PARAM(timeout);
+    UNUSED_PARAM(singleShot);
 #endif
 }
 
@@ -679,6 +825,9 @@ inline void InspectorInstrumentation::didRemoveTimer(ScriptExecutionContext* con
     FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
         didRemoveTimerImpl(instrumentingAgents, timerId, context);
+#else
+    UNUSED_PARAM(context);
+    UNUSED_PARAM(timerId);
 #endif
 }
 
@@ -688,6 +837,10 @@ inline InspectorInstrumentationCookie InspectorInstrumentation::willCallFunction
     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
         return willCallFunctionImpl(instrumentingAgents, scriptName, scriptLine, context);
+#else
+    UNUSED_PARAM(context);
+    UNUSED_PARAM(scriptName);
+    UNUSED_PARAM(scriptLine);
 #endif
     return InspectorInstrumentationCookie();
 }
@@ -697,8 +850,10 @@ inline void InspectorInstrumentation::didCallFunction(const InspectorInstrumenta
 {
 #if ENABLE(INSPECTOR)
     FAST_RETURN_IF_NO_FRONTENDS(void());
-    if (cookie.first)
+    if (cookie.isValid())
         didCallFunctionImpl(cookie);
+#else
+    UNUSED_PARAM(cookie);
 #endif
 }
 
@@ -708,6 +863,9 @@ inline InspectorInstrumentationCookie InspectorInstrumentation::willDispatchXHRR
     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
         return willDispatchXHRReadyStateChangeEventImpl(instrumentingAgents, request, context);
+#else
+    UNUSED_PARAM(context);
+    UNUSED_PARAM(request);
 #endif
     return InspectorInstrumentationCookie();
 }
@@ -716,17 +874,25 @@ inline void InspectorInstrumentation::didDispatchXHRReadyStateChangeEvent(const
 {
 #if ENABLE(INSPECTOR)
     FAST_RETURN_IF_NO_FRONTENDS(void());
-    if (cookie.first)
+    if (cookie.isValid())
         didDispatchXHRReadyStateChangeEventImpl(cookie);
+#else
+    UNUSED_PARAM(cookie);
 #endif
 }
 
-inline InspectorInstrumentationCookie InspectorInstrumentation::willDispatchEvent(Document* document, const Event& event, DOMWindow* window, Node* node, const Vector<EventContext>& ancestors)
+inline InspectorInstrumentationCookie InspectorInstrumentation::willDispatchEvent(Document* document, const Event& event, DOMWindow* window, Node* node, const EventPath& eventPath)
 {
 #if ENABLE(INSPECTOR)
     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
-        return willDispatchEventImpl(instrumentingAgents, event, window, node, ancestors, document);
+        return willDispatchEventImpl(instrumentingAgents, event, window, node, eventPath, document);
+#else
+    UNUSED_PARAM(document);
+    UNUSED_PARAM(event);
+    UNUSED_PARAM(window);
+    UNUSED_PARAM(node);
+    UNUSED_PARAM(eventPath);
 #endif
     return InspectorInstrumentationCookie();
 }
@@ -735,8 +901,10 @@ inline void InspectorInstrumentation::didDispatchEvent(const InspectorInstrument
 {
 #if ENABLE(INSPECTOR)
     FAST_RETURN_IF_NO_FRONTENDS(void());
-    if (cookie.first)
+    if (cookie.isValid())
         didDispatchEventImpl(cookie);
+#else
+    UNUSED_PARAM(cookie);
 #endif
 }
 
@@ -746,6 +914,9 @@ inline InspectorInstrumentationCookie InspectorInstrumentation::willHandleEvent(
     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
         return willHandleEventImpl(instrumentingAgents, event);
+#else
+    UNUSED_PARAM(context);
+    UNUSED_PARAM(event);
 #endif
     return InspectorInstrumentationCookie();
 }
@@ -754,8 +925,10 @@ inline void InspectorInstrumentation::didHandleEvent(const InspectorInstrumentat
 {
 #if ENABLE(INSPECTOR)
     FAST_RETURN_IF_NO_FRONTENDS(void());
-    if (cookie.first)
+    if (cookie.isValid())
         didHandleEventImpl(cookie);
+#else
+    UNUSED_PARAM(cookie);
 #endif
 }
 
@@ -765,6 +938,10 @@ inline InspectorInstrumentationCookie InspectorInstrumentation::willDispatchEven
     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
         return willDispatchEventOnWindowImpl(instrumentingAgents, event, window);
+#else
+    UNUSED_PARAM(frame);
+    UNUSED_PARAM(event);
+    UNUSED_PARAM(window);
 #endif
     return InspectorInstrumentationCookie();
 }
@@ -773,8 +950,10 @@ inline void InspectorInstrumentation::didDispatchEventOnWindow(const InspectorIn
 {
 #if ENABLE(INSPECTOR)
     FAST_RETURN_IF_NO_FRONTENDS(void());
-    if (cookie.first)
+    if (cookie.isValid())
         didDispatchEventOnWindowImpl(cookie);
+#else
+    UNUSED_PARAM(cookie);
 #endif
 }
 
@@ -784,6 +963,10 @@ inline InspectorInstrumentationCookie InspectorInstrumentation::willEvaluateScri
     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
         return willEvaluateScriptImpl(instrumentingAgents, url, lineNumber, frame);
+#else
+    UNUSED_PARAM(frame);
+    UNUSED_PARAM(url);
+    UNUSED_PARAM(lineNumber);
 #endif
     return InspectorInstrumentationCookie();
 }
@@ -792,8 +975,22 @@ inline void InspectorInstrumentation::didEvaluateScript(const InspectorInstrumen
 {
 #if ENABLE(INSPECTOR)
     FAST_RETURN_IF_NO_FRONTENDS(void());
-    if (cookie.first)
+    if (cookie.isValid())
         didEvaluateScriptImpl(cookie);
+#else
+    UNUSED_PARAM(cookie);
+#endif
+}
+
+inline void InspectorInstrumentation::scriptsEnabled(Page* page, bool isEnabled)
+{
+#if ENABLE(INSPECTOR)
+    FAST_RETURN_IF_NO_FRONTENDS(void());
+    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
+        return scriptsEnabledImpl(instrumentingAgents, isEnabled);
+#else
+    UNUSED_PARAM(page);
+    UNUSED_PARAM(isEnabled);
 #endif
 }
 
@@ -803,6 +1000,10 @@ inline void InspectorInstrumentation::didCreateIsolatedContext(Frame* frame, Scr
     FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
         return didCreateIsolatedContextImpl(instrumentingAgents, frame, scriptState, origin);
+#else
+    UNUSED_PARAM(frame);
+    UNUSED_PARAM(scriptState);
+    UNUSED_PARAM(origin);
 #endif
 }
 
@@ -812,6 +1013,9 @@ inline InspectorInstrumentationCookie InspectorInstrumentation::willFireTimer(Sc
     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
         return willFireTimerImpl(instrumentingAgents, timerId, context);
+#else
+    UNUSED_PARAM(context);
+    UNUSED_PARAM(timerId);
 #endif
     return InspectorInstrumentationCookie();
 }
@@ -820,26 +1024,10 @@ inline void InspectorInstrumentation::didFireTimer(const InspectorInstrumentatio
 {
 #if ENABLE(INSPECTOR)
     FAST_RETURN_IF_NO_FRONTENDS(void());
-    if (cookie.first)
+    if (cookie.isValid())
         didFireTimerImpl(cookie);
-#endif
-}
-
-inline void InspectorInstrumentation::didBeginFrame(Page* page)
-{
-#if ENABLE(INSPECTOR)
-    FAST_RETURN_IF_NO_FRONTENDS(void());
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
-        didBeginFrameImpl(instrumentingAgents);
-#endif
-}
-
-inline void InspectorInstrumentation::didCancelFrame(Page* page)
-{
-#if ENABLE(INSPECTOR)
-    FAST_RETURN_IF_NO_FRONTENDS(void());
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
-        didCancelFrameImpl(instrumentingAgents);
+#else
+    UNUSED_PARAM(cookie);
 #endif
 }
 
@@ -849,6 +1037,8 @@ inline void InspectorInstrumentation::didInvalidateLayout(Frame* frame)
     FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
         didInvalidateLayoutImpl(instrumentingAgents, frame);
+#else
+    UNUSED_PARAM(frame);
 #endif
 }
 
@@ -858,6 +1048,8 @@ inline InspectorInstrumentationCookie InspectorInstrumentation::willLayout(Frame
     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
         return willLayoutImpl(instrumentingAgents, frame);
+#else
+    UNUSED_PARAM(frame);
 #endif
     return InspectorInstrumentationCookie();
 }
@@ -866,8 +1058,11 @@ inline void InspectorInstrumentation::didLayout(const InspectorInstrumentationCo
 {
 #if ENABLE(INSPECTOR)
     FAST_RETURN_IF_NO_FRONTENDS(void());
-    if (cookie.first)
+    if (cookie.isValid())
         didLayoutImpl(cookie, root);
+#else
+    UNUSED_PARAM(cookie);
+    UNUSED_PARAM(root);
 #endif
 }
 
@@ -877,6 +1072,8 @@ inline void InspectorInstrumentation::didScroll(Page* page)
     FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
         didScrollImpl(instrumentingAgents);
+#else
+    UNUSED_PARAM(page);
 #endif
 }
 
@@ -886,6 +1083,9 @@ inline InspectorInstrumentationCookie InspectorInstrumentation::willDispatchXHRL
     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
         return willDispatchXHRLoadEventImpl(instrumentingAgents, request, context);
+#else
+    UNUSED_PARAM(context);
+    UNUSED_PARAM(request);
 #endif
     return InspectorInstrumentationCookie();
 }
@@ -894,45 +1094,57 @@ inline void InspectorInstrumentation::didDispatchXHRLoadEvent(const InspectorIns
 {
 #if ENABLE(INSPECTOR)
     FAST_RETURN_IF_NO_FRONTENDS(void());
-    if (cookie.first)
+    if (cookie.isValid())
         didDispatchXHRLoadEventImpl(cookie);
+#else
+    UNUSED_PARAM(cookie);
 #endif
 }
 
-inline InspectorInstrumentationCookie InspectorInstrumentation::willPaint(Frame* frame, GraphicsContext* context, const LayoutRect& rect)
+inline InspectorInstrumentationCookie InspectorInstrumentation::willPaint(Frame* frame)
 {
 #if ENABLE(INSPECTOR)
     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
-        return willPaintImpl(instrumentingAgents, context, rect, frame);
+        return willPaintImpl(instrumentingAgents, frame);
+#else
+    UNUSED_PARAM(frame);
 #endif
     return InspectorInstrumentationCookie();
 }
 
-inline void InspectorInstrumentation::didPaint(const InspectorInstrumentationCookie& cookie)
+inline void InspectorInstrumentation::didPaint(const InspectorInstrumentationCookie& cookie, GraphicsContext* context, const LayoutRect& rect)
 {
 #if ENABLE(INSPECTOR)
     FAST_RETURN_IF_NO_FRONTENDS(void());
-    if (cookie.first)
-        didPaintImpl(cookie);
+    if (cookie.isValid())
+        didPaintImpl(cookie, context, rect);
+#else
+    UNUSED_PARAM(cookie);
+    UNUSED_PARAM(context);
+    UNUSED_PARAM(rect);
 #endif
 }
 
-inline void InspectorInstrumentation::willComposite(Page* page)
+inline void InspectorInstrumentation::willScrollLayer(Frame* frame)
 {
 #if ENABLE(INSPECTOR)
     FAST_RETURN_IF_NO_FRONTENDS(void());
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
-        willCompositeImpl(instrumentingAgents);
+    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
+        willScrollLayerImpl(instrumentingAgents, frame);
+#else
+    UNUSED_PARAM(frame);
 #endif
 }
 
-inline void InspectorInstrumentation::didComposite(Page* page)
+inline void InspectorInstrumentation::didScrollLayer(Frame* frame)
 {
 #if ENABLE(INSPECTOR)
     FAST_RETURN_IF_NO_FRONTENDS(void());
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
-        didCompositeImpl(instrumentingAgents);
+    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
+        didScrollLayerImpl(instrumentingAgents);
+#else
+    UNUSED_PARAM(frame);
 #endif
 }
 
@@ -942,6 +1154,8 @@ inline InspectorInstrumentationCookie InspectorInstrumentation::willRecalculateS
     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
         return willRecalculateStyleImpl(instrumentingAgents, document->frame());
+#else
+    UNUSED_PARAM(document);
 #endif
     return InspectorInstrumentationCookie();
 }
@@ -950,8 +1164,10 @@ inline void InspectorInstrumentation::didRecalculateStyle(const InspectorInstrum
 {
 #if ENABLE(INSPECTOR)
     FAST_RETURN_IF_NO_FRONTENDS(void());
-    if (cookie.first)
+    if (cookie.isValid())
         didRecalculateStyleImpl(cookie);
+#else
+    UNUSED_PARAM(cookie);
 #endif
 }
 
@@ -961,15 +1177,22 @@ inline void InspectorInstrumentation::didScheduleStyleRecalculation(Document* do
     FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
         didScheduleStyleRecalculationImpl(instrumentingAgents, document);
+#else
+    UNUSED_PARAM(document);
 #endif
 }
 
-inline InspectorInstrumentationCookie InspectorInstrumentation::willMatchRule(Document* document, const StyleRule* rule)
+inline InspectorInstrumentationCookie InspectorInstrumentation::willMatchRule(Document* document, StyleRule* rule, InspectorCSSOMWrappers& inspectorCSSOMWrappers, DocumentStyleSheetCollection* styleSheetCollection)
 {
 #if ENABLE(INSPECTOR)
     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
-        return willMatchRuleImpl(instrumentingAgents, rule);
+        return willMatchRuleImpl(instrumentingAgents, rule, inspectorCSSOMWrappers, styleSheetCollection);
+#else
+    UNUSED_PARAM(document);
+    UNUSED_PARAM(rule);
+    UNUSED_PARAM(inspectorCSSOMWrappers);
+    UNUSED_PARAM(styleSheetCollection);
 #endif
     return InspectorInstrumentationCookie();
 }
@@ -978,19 +1201,26 @@ inline void InspectorInstrumentation::didMatchRule(const InspectorInstrumentatio
 {
 #if ENABLE(INSPECTOR)
     FAST_RETURN_IF_NO_FRONTENDS(void());
-    if (cookie.first)
+    if (cookie.isValid())
         didMatchRuleImpl(cookie, matched);
+#else
+    UNUSED_PARAM(cookie);
+    UNUSED_PARAM(matched);
 #endif
 }
 
-inline InspectorInstrumentationCookie InspectorInstrumentation::willProcessRule(Document* document, const StyleRule* rule)
+inline InspectorInstrumentationCookie InspectorInstrumentation::willProcessRule(Document* document, StyleRule* rule, StyleResolver* styleResolver)
 {
 #if ENABLE(INSPECTOR)
     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
     if (!rule)
         return InspectorInstrumentationCookie();
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
-        return willProcessRuleImpl(instrumentingAgents, rule);
+        return willProcessRuleImpl(instrumentingAgents, rule, styleResolver);
+#else
+    UNUSED_PARAM(document);
+    UNUSED_PARAM(rule);
+    UNUSED_PARAM(styleResolver);
 #endif
     return InspectorInstrumentationCookie();
 }
@@ -999,26 +1229,10 @@ inline void InspectorInstrumentation::didProcessRule(const InspectorInstrumentat
 {
 #if ENABLE(INSPECTOR)
     FAST_RETURN_IF_NO_FRONTENDS(void());
-    if (cookie.first)
+    if (cookie.isValid())
         didProcessRuleImpl(cookie);
-#endif
-}
-
-inline void InspectorInstrumentation::willProcessTask(Page* page)
-{
-#if ENABLE(INSPECTOR)
-    FAST_RETURN_IF_NO_FRONTENDS(void());
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
-        willProcessTaskImpl(instrumentingAgents);
-#endif
-}
-
-inline void InspectorInstrumentation::didProcessTask(Page* page)
-{
-#if ENABLE(INSPECTOR)
-    FAST_RETURN_IF_NO_FRONTENDS(void());
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
-        didProcessTaskImpl(instrumentingAgents);
+#else
+    UNUSED_PARAM(cookie);
 #endif
 }
 
@@ -1028,6 +1242,9 @@ inline void InspectorInstrumentation::applyUserAgentOverride(Frame* frame, Strin
     FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
         applyUserAgentOverrideImpl(instrumentingAgents, userAgent);
+#else
+    UNUSED_PARAM(frame);
+    UNUSED_PARAM(userAgent);
 #endif
 }
 
@@ -1037,6 +1254,9 @@ inline void InspectorInstrumentation::applyScreenWidthOverride(Frame* frame, lon
     FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
         applyScreenWidthOverrideImpl(instrumentingAgents, width);
+#else
+    UNUSED_PARAM(frame);
+    UNUSED_PARAM(width);
 #endif
 }
 
@@ -1046,6 +1266,9 @@ inline void InspectorInstrumentation::applyScreenHeightOverride(Frame* frame, lo
     FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
         applyScreenHeightOverrideImpl(instrumentingAgents, height);
+#else
+    UNUSED_PARAM(frame);
+    UNUSED_PARAM(height);
 #endif
 }
 
@@ -1055,16 +1278,32 @@ inline bool InspectorInstrumentation::shouldApplyScreenWidthOverride(Frame* fram
     FAST_RETURN_IF_NO_FRONTENDS(false);
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
         return shouldApplyScreenWidthOverrideImpl(instrumentingAgents);
+#else
+    UNUSED_PARAM(frame);
 #endif
     return false;
 }
 
+inline void InspectorInstrumentation::applyEmulatedMedia(Frame* frame, String* media)
+{
+#if ENABLE(INSPECTOR)
+    FAST_RETURN_IF_NO_FRONTENDS(void());
+    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
+        applyEmulatedMediaImpl(instrumentingAgents, media);
+#else
+    UNUSED_PARAM(frame);
+    UNUSED_PARAM(media);
+#endif
+}
+
 inline bool InspectorInstrumentation::shouldApplyScreenHeightOverride(Frame* frame)
 {
 #if ENABLE(INSPECTOR)
     FAST_RETURN_IF_NO_FRONTENDS(false);
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
         return shouldApplyScreenHeightOverrideImpl(instrumentingAgents);
+#else
+    UNUSED_PARAM(frame);
 #endif
     return false;
 }
@@ -1074,6 +1313,12 @@ inline void InspectorInstrumentation::willSendRequest(Frame* frame, unsigned lon
 #if ENABLE(INSPECTOR)
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
         willSendRequestImpl(instrumentingAgents, identifier, loader, request, redirectResponse);
+#else
+    UNUSED_PARAM(frame);
+    UNUSED_PARAM(identifier);
+    UNUSED_PARAM(loader);
+    UNUSED_PARAM(request);
+    UNUSED_PARAM(redirectResponse);
 #endif
 }
 
@@ -1082,6 +1327,12 @@ inline void InspectorInstrumentation::continueAfterPingLoader(Frame* frame, unsi
 #if ENABLE(INSPECTOR)
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
         InspectorInstrumentation::continueAfterPingLoaderImpl(instrumentingAgents, identifier, loader, request, response);
+#else
+    UNUSED_PARAM(frame);
+    UNUSED_PARAM(identifier);
+    UNUSED_PARAM(loader);
+    UNUSED_PARAM(request);
+    UNUSED_PARAM(response);
 #endif
 }
 
@@ -1090,6 +1341,9 @@ inline void InspectorInstrumentation::markResourceAsCached(Page* page, unsigned
 #if ENABLE(INSPECTOR)
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
         markResourceAsCachedImpl(instrumentingAgents, identifier);
+#else
+    UNUSED_PARAM(page);
+    UNUSED_PARAM(identifier);
 #endif
 }
 
@@ -1098,6 +1352,10 @@ inline void InspectorInstrumentation::didLoadResourceFromMemoryCache(Page* page,
 #if ENABLE(INSPECTOR)
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
         didLoadResourceFromMemoryCacheImpl(instrumentingAgents, loader, resource);
+#else
+    UNUSED_PARAM(page);
+    UNUSED_PARAM(loader);
+    UNUSED_PARAM(resource);
 #endif
 }
 
@@ -1107,6 +1365,10 @@ inline InspectorInstrumentationCookie InspectorInstrumentation::willReceiveResou
     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
         return willReceiveResourceDataImpl(instrumentingAgents, identifier, frame, length);
+#else
+    UNUSED_PARAM(frame);
+    UNUSED_PARAM(identifier);
+    UNUSED_PARAM(length);
 #endif
     return InspectorInstrumentationCookie();
 }
@@ -1115,8 +1377,10 @@ inline void InspectorInstrumentation::didReceiveResourceData(const InspectorInst
 {
 #if ENABLE(INSPECTOR)
     FAST_RETURN_IF_NO_FRONTENDS(void());
-    if (cookie.first)
+    if (cookie.isValid())
         didReceiveResourceDataImpl(cookie);
+#else
+    UNUSED_PARAM(cookie);
 #endif
 }
 
@@ -1125,6 +1389,10 @@ inline InspectorInstrumentationCookie InspectorInstrumentation::willReceiveResou
 #if ENABLE(INSPECTOR)
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
         return willReceiveResourceResponseImpl(instrumentingAgents, identifier, response, frame);
+#else
+    UNUSED_PARAM(frame);
+    UNUSED_PARAM(identifier);
+    UNUSED_PARAM(response);
 #endif
     return InspectorInstrumentationCookie();
 }
@@ -1133,7 +1401,14 @@ inline void InspectorInstrumentation::didReceiveResourceResponse(const Inspector
 {
 #if ENABLE(INSPECTOR)
     // Call this unconditionally so that we're able to log to console with no front-end attached.
-    didReceiveResourceResponseImpl(cookie, identifier, loader, response, resourceLoader);
+    if (cookie.isValid())
+        didReceiveResourceResponseImpl(cookie, identifier, loader, response, resourceLoader);
+#else
+    UNUSED_PARAM(cookie);
+    UNUSED_PARAM(identifier);
+    UNUSED_PARAM(loader);
+    UNUSED_PARAM(response);
+    UNUSED_PARAM(resourceLoader);
 #endif
 }
 
@@ -1142,6 +1417,11 @@ inline void InspectorInstrumentation::continueAfterXFrameOptionsDenied(Frame* fr
 #if ENABLE(INSPECTOR)
     FAST_RETURN_IF_NO_FRONTENDS(void());
     InspectorInstrumentation::continueAfterXFrameOptionsDeniedImpl(frame, loader, identifier, r);
+#else
+    UNUSED_PARAM(frame);
+    UNUSED_PARAM(loader);
+    UNUSED_PARAM(identifier);
+    UNUSED_PARAM(r);
 #endif
 }
 
@@ -1150,6 +1430,11 @@ inline void InspectorInstrumentation::continueWithPolicyDownload(Frame* frame, D
 #if ENABLE(INSPECTOR)
     FAST_RETURN_IF_NO_FRONTENDS(void());
     InspectorInstrumentation::continueWithPolicyDownloadImpl(frame, loader, identifier, r);
+#else
+    UNUSED_PARAM(frame);
+    UNUSED_PARAM(loader);
+    UNUSED_PARAM(identifier);
+    UNUSED_PARAM(r);
 #endif
 }
 
@@ -1158,6 +1443,11 @@ inline void InspectorInstrumentation::continueWithPolicyIgnore(Frame* frame, Doc
 #if ENABLE(INSPECTOR)
     FAST_RETURN_IF_NO_FRONTENDS(void());
     InspectorInstrumentation::continueWithPolicyIgnoreImpl(frame, loader, identifier, r);
+#else
+    UNUSED_PARAM(frame);
+    UNUSED_PARAM(loader);
+    UNUSED_PARAM(identifier);
+    UNUSED_PARAM(r);
 #endif
 }
 
@@ -1166,6 +1456,12 @@ inline void InspectorInstrumentation::didReceiveData(Frame* frame, unsigned long
 #if ENABLE(INSPECTOR)
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
         didReceiveDataImpl(instrumentingAgents, identifier, data, dataLength, encodedDataLength);
+#else
+    UNUSED_PARAM(frame);
+    UNUSED_PARAM(identifier);
+    UNUSED_PARAM(data);
+    UNUSED_PARAM(dataLength);
+    UNUSED_PARAM(encodedDataLength);
 #endif
 }
 
@@ -1174,6 +1470,11 @@ inline void InspectorInstrumentation::didFinishLoading(Frame* frame, DocumentLoa
 #if ENABLE(INSPECTOR)
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
         didFinishLoadingImpl(instrumentingAgents, identifier, loader, finishTime);
+#else
+    UNUSED_PARAM(frame);
+    UNUSED_PARAM(loader);
+    UNUSED_PARAM(identifier);
+    UNUSED_PARAM(finishTime);
 #endif
 }
 
@@ -1182,6 +1483,11 @@ inline void InspectorInstrumentation::didFailLoading(Frame* frame, DocumentLoade
 #if ENABLE(INSPECTOR)
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
         didFailLoadingImpl(instrumentingAgents, identifier, loader, error);
+#else
+    UNUSED_PARAM(frame);
+    UNUSED_PARAM(loader);
+    UNUSED_PARAM(identifier);
+    UNUSED_PARAM(error);
 #endif
 }
 
@@ -1190,6 +1496,10 @@ inline void InspectorInstrumentation::documentThreadableLoaderStartedLoadingForC
 #if ENABLE(INSPECTOR)
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
         documentThreadableLoaderStartedLoadingForClientImpl(instrumentingAgents, identifier, client);
+#else
+    UNUSED_PARAM(context);
+    UNUSED_PARAM(identifier);
+    UNUSED_PARAM(client);
 #endif
 }
 
@@ -1198,6 +1508,15 @@ inline void InspectorInstrumentation::willLoadXHR(ScriptExecutionContext* contex
 #if ENABLE(INSPECTOR)
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
         willLoadXHRImpl(instrumentingAgents, client, method, url, async, formData, headers, includeCredentials);
+#else
+    UNUSED_PARAM(context);
+    UNUSED_PARAM(client);
+    UNUSED_PARAM(method);
+    UNUSED_PARAM(url);
+    UNUSED_PARAM(async);
+    UNUSED_PARAM(formData);
+    UNUSED_PARAM(headers);
+    UNUSED_PARAM(includeCredentials);
 #endif
 }
 
@@ -1206,6 +1525,9 @@ inline void InspectorInstrumentation::didFailXHRLoading(ScriptExecutionContext*
 #if ENABLE(INSPECTOR)
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
         didFailXHRLoadingImpl(instrumentingAgents, client);
+#else
+    UNUSED_PARAM(context);
+    UNUSED_PARAM(client);
 #endif
 }
 
@@ -1215,6 +1537,14 @@ inline void InspectorInstrumentation::didFinishXHRLoading(ScriptExecutionContext
 #if ENABLE(INSPECTOR)
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
         didFinishXHRLoadingImpl(instrumentingAgents, client, identifier, sourceString, url, sendURL, sendLineNumber);
+#else
+    UNUSED_PARAM(context);
+    UNUSED_PARAM(client);
+    UNUSED_PARAM(identifier);
+    UNUSED_PARAM(sourceString);
+    UNUSED_PARAM(url);
+    UNUSED_PARAM(sendURL);
+    UNUSED_PARAM(sendLineNumber);
 #endif
 }
 
@@ -1223,6 +1553,9 @@ inline void InspectorInstrumentation::didReceiveXHRResponse(ScriptExecutionConte
 #if ENABLE(INSPECTOR)
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
         didReceiveXHRResponseImpl(instrumentingAgents, identifier);
+#else
+    UNUSED_PARAM(context);
+    UNUSED_PARAM(identifier);
 #endif
 }
 
@@ -1231,6 +1564,8 @@ inline void InspectorInstrumentation::willLoadXHRSynchronously(ScriptExecutionCo
 #if ENABLE(INSPECTOR)
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
         willLoadXHRSynchronouslyImpl(instrumentingAgents);
+#else
+    UNUSED_PARAM(context);
 #endif
 }
 
@@ -1239,6 +1574,8 @@ inline void InspectorInstrumentation::didLoadXHRSynchronously(ScriptExecutionCon
 #if ENABLE(INSPECTOR)
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
         didLoadXHRSynchronouslyImpl(instrumentingAgents);
+#else
+    UNUSED_PARAM(context);
 #endif
 }
 
@@ -1247,6 +1584,10 @@ inline void InspectorInstrumentation::scriptImported(ScriptExecutionContext* con
 #if ENABLE(INSPECTOR)
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
         scriptImportedImpl(instrumentingAgents, identifier, sourceString);
+#else
+    UNUSED_PARAM(context);
+    UNUSED_PARAM(identifier);
+    UNUSED_PARAM(sourceString);
 #endif
 }
 
@@ -1255,6 +1596,9 @@ inline void InspectorInstrumentation::scriptExecutionBlockedByCSP(ScriptExecutio
 #if ENABLE(INSPECTOR)
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
         scriptExecutionBlockedByCSPImpl(instrumentingAgents, directiveText);
+#else
+    UNUSED_PARAM(context);
+    UNUSED_PARAM(directiveText);
 #endif
 }
 
@@ -1263,6 +1607,9 @@ inline void InspectorInstrumentation::didReceiveScriptResponse(ScriptExecutionCo
 #if ENABLE(INSPECTOR)
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
         didReceiveScriptResponseImpl(instrumentingAgents, identifier);
+#else
+    UNUSED_PARAM(context);
+    UNUSED_PARAM(identifier);
 #endif
 }
 
@@ -1271,6 +1618,8 @@ inline void InspectorInstrumentation::domContentLoadedEventFired(Frame* frame)
 #if ENABLE(INSPECTOR)
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
         domContentLoadedEventFiredImpl(instrumentingAgents, frame);
+#else
+    UNUSED_PARAM(frame);
 #endif
 }
 
@@ -1279,6 +1628,8 @@ inline void InspectorInstrumentation::loadEventFired(Frame* frame)
 #if ENABLE(INSPECTOR)
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
         loadEventFiredImpl(instrumentingAgents, frame);
+#else
+    UNUSED_PARAM(frame);
 #endif
 }
 
@@ -1287,19 +1638,30 @@ inline void InspectorInstrumentation::frameDetachedFromParent(Frame* frame)
 #if ENABLE(INSPECTOR)
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
         frameDetachedFromParentImpl(instrumentingAgents, frame);
+#else
+    UNUSED_PARAM(frame);
 #endif
 }
 
 inline void InspectorInstrumentation::didCommitLoad(Frame* frame, DocumentLoader* loader)
 {
 #if ENABLE(INSPECTOR)
-    if (!frame)
-        return;
-    Page* page = frame->page();
-    if (!page)
-        return;
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
-        didCommitLoadImpl(instrumentingAgents, page, loader);
+    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
+        didCommitLoadImpl(instrumentingAgents, frame->page(), loader);
+#else
+    UNUSED_PARAM(frame);
+    UNUSED_PARAM(loader);
+#endif
+}
+
+inline void InspectorInstrumentation::frameDocumentUpdated(Frame* frame)
+{
+#if ENABLE(INSPECTOR)
+    FAST_RETURN_IF_NO_FRONTENDS(void());
+    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
+        frameDocumentUpdatedImpl(instrumentingAgents, frame);
+#else
+    UNUSED_PARAM(frame);
 #endif
 }
 
@@ -1308,41 +1670,109 @@ inline void InspectorInstrumentation::loaderDetachedFromFrame(Frame* frame, Docu
 #if ENABLE(INSPECTOR)
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
         loaderDetachedFromFrameImpl(instrumentingAgents, loader);
+#else
+    UNUSED_PARAM(frame);
+    UNUSED_PARAM(loader);
 #endif
 }
 
-inline void InspectorInstrumentation::willDestroyCachedResource(CachedResource* cachedResource)
+inline void InspectorInstrumentation::frameStartedLoading(Frame* frame)
 {
 #if ENABLE(INSPECTOR)
-    FAST_RETURN_IF_NO_FRONTENDS(void());
-    willDestroyCachedResourceImpl(cachedResource);
+    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
+        frameStartedLoadingImpl(instrumentingAgents, frame);
+#else
+    UNUSED_PARAM(frame);
+#endif
+}
+
+inline void InspectorInstrumentation::frameStoppedLoading(Frame* frame)
+{
+#if ENABLE(INSPECTOR)
+    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
+        frameStoppedLoadingImpl(instrumentingAgents, frame);
+#else
+    UNUSED_PARAM(frame);
+#endif
+}
+
+inline void InspectorInstrumentation::frameScheduledNavigation(Frame* frame, double delay)
+{
+#if ENABLE(INSPECTOR)
+    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
+        frameScheduledNavigationImpl(instrumentingAgents, frame, delay);
+#else
+    UNUSED_PARAM(frame);
+    UNUSED_PARAM(delay);
 #endif
 }
 
-inline InspectorInstrumentationCookie InspectorInstrumentation::willWriteHTML(Document* document, unsigned int length, unsigned int startLine)
+inline void InspectorInstrumentation::frameClearedScheduledNavigation(Frame* frame)
+{
+#if ENABLE(INSPECTOR)
+    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
+        frameClearedScheduledNavigationImpl(instrumentingAgents, frame);
+#else
+    UNUSED_PARAM(frame);
+#endif
+}
+
+inline InspectorInstrumentationCookie InspectorInstrumentation::willRunJavaScriptDialog(Page* page, const String& message)
 {
 #if ENABLE(INSPECTOR)
     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
-        return willWriteHTMLImpl(instrumentingAgents, length, startLine, document->frame());
+    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
+        return willRunJavaScriptDialogImpl(instrumentingAgents, message);
+#else
+    UNUSED_PARAM(page);
+    UNUSED_PARAM(message);
 #endif
     return InspectorInstrumentationCookie();
 }
 
-inline void InspectorInstrumentation::didWriteHTML(const InspectorInstrumentationCookie& cookie, unsigned int endLine)
+inline void InspectorInstrumentation::didRunJavaScriptDialog(const InspectorInstrumentationCookie& cookie)
 {
 #if ENABLE(INSPECTOR)
     FAST_RETURN_IF_NO_FRONTENDS(void());
-    if (cookie.first)
-        didWriteHTMLImpl(cookie, endLine);
+    if (cookie.isValid())
+        didRunJavaScriptDialogImpl(cookie);
+#else
+    UNUSED_PARAM(cookie);
 #endif
 }
 
-inline void InspectorInstrumentation::didUseDOMStorage(Page* page, StorageArea* storageArea, bool isLocalStorage, Frame* frame)
+inline void InspectorInstrumentation::willDestroyCachedResource(CachedResource* cachedResource)
 {
 #if ENABLE(INSPECTOR)
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
-        didUseDOMStorageImpl(instrumentingAgents, storageArea, isLocalStorage, frame);
+    FAST_RETURN_IF_NO_FRONTENDS(void());
+    willDestroyCachedResourceImpl(cachedResource);
+#else
+    UNUSED_PARAM(cachedResource);
+#endif
+}
+
+inline InspectorInstrumentationCookie InspectorInstrumentation::willWriteHTML(Document* document, unsigned startLine)
+{
+#if ENABLE(INSPECTOR)
+    FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
+    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
+        return willWriteHTMLImpl(instrumentingAgents, startLine, document->frame());
+#else
+    UNUSED_PARAM(document);
+    UNUSED_PARAM(startLine);
+#endif
+    return InspectorInstrumentationCookie();
+}
+
+inline void InspectorInstrumentation::didWriteHTML(const InspectorInstrumentationCookie& cookie, unsigned endLine)
+{
+#if ENABLE(INSPECTOR)
+    FAST_RETURN_IF_NO_FRONTENDS(void());
+    if (cookie.isValid())
+        didWriteHTMLImpl(cookie, endLine);
+#else
+    UNUSED_PARAM(cookie);
+    UNUSED_PARAM(endLine);
 #endif
 }
 
@@ -1352,6 +1782,13 @@ inline void InspectorInstrumentation::didDispatchDOMStorageEvent(const String& k
     FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
         didDispatchDOMStorageEventImpl(instrumentingAgents, key, oldValue, newValue, storageType, securityOrigin, page);
+#else
+    UNUSED_PARAM(key);
+    UNUSED_PARAM(oldValue);
+    UNUSED_PARAM(newValue);
+    UNUSED_PARAM(storageType);
+    UNUSED_PARAM(securityOrigin);
+    UNUSED_PARAM(page);
 #endif // ENABLE(INSPECTOR)
 }
 
@@ -1362,6 +1799,8 @@ inline bool InspectorInstrumentation::shouldPauseDedicatedWorkerOnStart(ScriptEx
     FAST_RETURN_IF_NO_FRONTENDS(false);
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
         return shouldPauseDedicatedWorkerOnStartImpl(instrumentingAgents);
+#else
+    UNUSED_PARAM(context);
 #endif
     return false;
 }
@@ -1371,6 +1810,10 @@ inline void InspectorInstrumentation::didStartWorkerContext(ScriptExecutionConte
 #if ENABLE(INSPECTOR)
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
         didStartWorkerContextImpl(instrumentingAgents, proxy, url);
+#else
+    UNUSED_PARAM(context);
+    UNUSED_PARAM(proxy);
+    UNUSED_PARAM(url);
 #endif
 }
 
@@ -1379,6 +1822,9 @@ inline void InspectorInstrumentation::workerContextTerminated(ScriptExecutionCon
 #if ENABLE(INSPECTOR)
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
         workerContextTerminatedImpl(instrumentingAgents, proxy);
+#else
+    UNUSED_PARAM(context);
+    UNUSED_PARAM(proxy);
 #endif
 }
 
@@ -1386,35 +1832,52 @@ inline void InspectorInstrumentation::workerContextTerminated(ScriptExecutionCon
 
 
 #if ENABLE(WEB_SOCKETS)
-inline void InspectorInstrumentation::didCreateWebSocket(ScriptExecutionContext* context, unsigned long identifier, const KURL& requestURL, const KURL& documentURL)
+inline void InspectorInstrumentation::didCreateWebSocket(Document* document, unsigned long identifier, const KURL& requestURL, const KURL& documentURL, const String& protocol)
 {
 #if ENABLE(INSPECTOR)
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
-        didCreateWebSocketImpl(instrumentingAgents, identifier, requestURL, documentURL);
+    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
+        didCreateWebSocketImpl(instrumentingAgents, identifier, requestURL, documentURL, protocol, document);
+#else
+    UNUSED_PARAM(document);
+    UNUSED_PARAM(identifier);
+    UNUSED_PARAM(requestURL);
+    UNUSED_PARAM(documentURL);
+    UNUSED_PARAM(protocol);
 #endif
 }
 
-inline void InspectorInstrumentation::willSendWebSocketHandshakeRequest(ScriptExecutionContext* context, unsigned long identifier, const WebSocketHandshakeRequest& request)
+inline void InspectorInstrumentation::willSendWebSocketHandshakeRequest(Document* document, unsigned long identifier, const WebSocketHandshakeRequest& request)
 {
 #if ENABLE(INSPECTOR)
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
-        willSendWebSocketHandshakeRequestImpl(instrumentingAgents, identifier, request);
+    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
+        willSendWebSocketHandshakeRequestImpl(instrumentingAgents, identifier, request, document);
+#else
+    UNUSED_PARAM(document);
+    UNUSED_PARAM(identifier);
+    UNUSED_PARAM(request);
 #endif
 }
 
-inline void InspectorInstrumentation::didReceiveWebSocketHandshakeResponse(ScriptExecutionContext* context, unsigned long identifier, const WebSocketHandshakeResponse& response)
+inline void InspectorInstrumentation::didReceiveWebSocketHandshakeResponse(Document* document, unsigned long identifier, const WebSocketHandshakeResponse& response)
 {
 #if ENABLE(INSPECTOR)
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
-        didReceiveWebSocketHandshakeResponseImpl(instrumentingAgents, identifier, response);
+    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
+        didReceiveWebSocketHandshakeResponseImpl(instrumentingAgents, identifier, response, document);
+#else
+    UNUSED_PARAM(document);
+    UNUSED_PARAM(identifier);
+    UNUSED_PARAM(response);
 #endif
 }
 
-inline void InspectorInstrumentation::didCloseWebSocket(ScriptExecutionContext* context, unsigned long identifier)
+inline void InspectorInstrumentation::didCloseWebSocket(Document* document, unsigned long identifier)
 {
 #if ENABLE(INSPECTOR)
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
-        didCloseWebSocketImpl(instrumentingAgents, identifier);
+    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
+        didCloseWebSocketImpl(instrumentingAgents, identifier, document);
+#else
+    UNUSED_PARAM(document);
+    UNUSED_PARAM(identifier);
 #endif
 }
 inline void InspectorInstrumentation::didReceiveWebSocketFrame(Document* document, unsigned long identifier, const WebSocketFrame& frame)
@@ -1422,6 +1885,10 @@ inline void InspectorInstrumentation::didReceiveWebSocketFrame(Document* documen
 #if ENABLE(INSPECTOR)
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
         didReceiveWebSocketFrameImpl(instrumentingAgents, identifier, frame);
+#else
+    UNUSED_PARAM(document);
+    UNUSED_PARAM(identifier);
+    UNUSED_PARAM(frame);
 #endif
 }
 inline void InspectorInstrumentation::didReceiveWebSocketFrameError(Document* document, unsigned long identifier, const String& errorMessage)
@@ -1429,6 +1896,10 @@ inline void InspectorInstrumentation::didReceiveWebSocketFrameError(Document* do
 #if ENABLE(INSPECTOR)
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
         didReceiveWebSocketFrameErrorImpl(instrumentingAgents, identifier, errorMessage);
+#else
+    UNUSED_PARAM(document);
+    UNUSED_PARAM(identifier);
+    UNUSED_PARAM(errorMessage);
 #endif
 }
 inline void InspectorInstrumentation::didSendWebSocketFrame(Document* document, unsigned long identifier, const WebSocketFrame& frame)
@@ -1436,6 +1907,10 @@ inline void InspectorInstrumentation::didSendWebSocketFrame(Document* document,
 #if ENABLE(INSPECTOR)
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
         didSendWebSocketFrameImpl(instrumentingAgents, identifier, frame);
+#else
+    UNUSED_PARAM(document);
+    UNUSED_PARAM(identifier);
+    UNUSED_PARAM(frame);
 #endif
 }
 #endif
@@ -1446,6 +1921,8 @@ inline void InspectorInstrumentation::networkStateChanged(Page* page)
     FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
         networkStateChangedImpl(instrumentingAgents);
+#else
+    UNUSED_PARAM(page);
 #endif
 }
 
@@ -1455,6 +1932,8 @@ inline void InspectorInstrumentation::updateApplicationCacheStatus(Frame* frame)
     FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
         updateApplicationCacheStatusImpl(instrumentingAgents, frame);
+#else
+    UNUSED_PARAM(frame);
 #endif
 }
 
@@ -1463,6 +1942,9 @@ inline void InspectorInstrumentation::didRequestAnimationFrame(Document* documen
 #if ENABLE(INSPECTOR)
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
         didRequestAnimationFrameImpl(instrumentingAgents, callbackId, document->frame());
+#else
+    UNUSED_PARAM(document);
+    UNUSED_PARAM(callbackId);
 #endif
 }
 
@@ -1471,6 +1953,9 @@ inline void InspectorInstrumentation::didCancelAnimationFrame(Document* document
 #if ENABLE(INSPECTOR)
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
         didCancelAnimationFrameImpl(instrumentingAgents, callbackId, document->frame());
+#else
+    UNUSED_PARAM(document);
+    UNUSED_PARAM(callbackId);
 #endif
 }
 
@@ -1479,6 +1964,9 @@ inline InspectorInstrumentationCookie InspectorInstrumentation::willFireAnimatio
 #if ENABLE(INSPECTOR)
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
         return willFireAnimationFrameImpl(instrumentingAgents, callbackId, document->frame());
+#else
+    UNUSED_PARAM(document);
+    UNUSED_PARAM(callbackId);
 #endif
     return InspectorInstrumentationCookie();
 }
@@ -1487,8 +1975,10 @@ inline void InspectorInstrumentation::didFireAnimationFrame(const InspectorInstr
 {
 #if ENABLE(INSPECTOR)
     FAST_RETURN_IF_NO_FRONTENDS(void());
-    if (cookie.first)
+    if (cookie.isValid())
         didFireAnimationFrameImpl(cookie);
+#else
+    UNUSED_PARAM(cookie);
 #endif
 }
 
@@ -1499,6 +1989,8 @@ inline GeolocationPosition* InspectorInstrumentation::overrideGeolocationPositio
     FAST_RETURN_IF_NO_FRONTENDS(position);
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
         return overrideGeolocationPositionImpl(instrumentingAgents, position);
+#else
+    UNUSED_PARAM(page);
 #endif
     return position;
 }
@@ -1510,10 +2002,46 @@ inline DeviceOrientationData* InspectorInstrumentation::overrideDeviceOrientatio
     FAST_RETURN_IF_NO_FRONTENDS(deviceOrientation);
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
         return overrideDeviceOrientationImpl(instrumentingAgents, deviceOrientation);
+#else
+    UNUSED_PARAM(page);
 #endif
     return deviceOrientation;
 }
 
+#if USE(ACCELERATED_COMPOSITING)
+inline void InspectorInstrumentation::layerTreeDidChange(Page* page)
+{
+#if ENABLE(INSPECTOR)
+    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
+        layerTreeDidChangeImpl(instrumentingAgents);
+#else
+    UNUSED_PARAM(page);
+#endif
+}
+
+inline void InspectorInstrumentation::renderLayerDestroyed(Page* page, const RenderLayer* renderLayer)
+{
+#if ENABLE(INSPECTOR)
+    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
+        renderLayerDestroyedImpl(instrumentingAgents, renderLayer);
+#else
+    UNUSED_PARAM(page);
+    UNUSED_PARAM(renderLayer);
+#endif
+}
+
+inline void InspectorInstrumentation::pseudoElementDestroyed(Page* page, PseudoElement* pseudoElement)
+{
+#if ENABLE(INSPECTOR)
+    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
+        pseudoElementDestroyedImpl(instrumentingAgents, pseudoElement);
+#else
+    UNUSED_PARAM(page);
+    UNUSED_PARAM(pseudoElement);
+#endif
+}
+#endif
+
 #if ENABLE(INSPECTOR)
 inline bool InspectorInstrumentation::collectingHTMLParseErrors(Page* page)
 {
@@ -1528,7 +2056,7 @@ inline InstrumentingAgents* InspectorInstrumentation::instrumentingAgentsForCont
     if (!context)
         return 0;
     if (context->isDocument())
-        return instrumentingAgentsForPage(static_cast<Document*>(context)->page());
+        return instrumentingAgentsForPage(toDocument(context)->page());
 #if ENABLE(WORKERS)
     return instrumentingAgentsForNonDocumentContext(context);
 #else
@@ -1545,8 +2073,14 @@ inline InstrumentingAgents* InspectorInstrumentation::instrumentingAgentsForFram
 
 inline InstrumentingAgents* InspectorInstrumentation::instrumentingAgentsForDocument(Document* document)
 {
-    if (document)
-        return instrumentingAgentsForPage(document->page());
+    if (document) {
+        Page* page = document->page();
+#if ENABLE(TEMPLATE_ELEMENT)
+        if (!page && document->templateDocumentHost())
+            page = document->templateDocumentHost()->page();
+#endif
+        return instrumentingAgentsForPage(page);
+    }
     return 0;
 }
 #endif