Web Inspector: Canvas: lazily create the agent
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Mar 2019 08:41:25 +0000 (08:41 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Mar 2019 08:41:25 +0000 (08:41 +0000)
https://bugs.webkit.org/show_bug.cgi?id=195241

Reviewed by Joseph Pecoraro.

No functionality change.

* html/canvas/CanvasRenderingContext.h:
* html/canvas/CanvasRenderingContext.cpp:
(WebCore::CanvasRenderingContext::instances): Added.
(WebCore::CanvasRenderingContext::instancesMutex): Added.
(WebCore::CanvasRenderingContext::CanvasRenderingContext):
(WebCore::CanvasRenderingContext::~CanvasRenderingContext):

* html/canvas/WebGLProgram.h:
* html/canvas/WebGLProgram.cpp:
(WebCore::WebGLProgram::instances): Added.
(WebCore::WebGLProgram::instancesMutex): Added.
(WebCore::WebGLProgram::WebGLProgram):
(WebCore::WebGLProgram::~WebGLProgram):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::~WebGLRenderingContextBase):

* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
(WebCore::InspectorController::createLazyAgents):

* inspector/agents/InspectorCanvasAgent.h:
* inspector/agents/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::enable):
(WebCore::InspectorCanvasAgent::disable):
(WebCore::InspectorCanvasAgent::frameNavigated):
(WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
(WebCore::InspectorCanvasAgent::canvasDestroyed):
(WebCore::InspectorCanvasAgent::didCreateProgram):
(WebCore::InspectorCanvasAgent::willDeleteProgram):
(WebCore::InspectorCanvasAgent::bindCanvas): Added.
(WebCore::InspectorCanvasAgent::canvasDestroyedTimerFired):

* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didCreateCanvasRenderingContext):
(WebCore::InspectorInstrumentation::didCreateProgram):
(WebCore::InspectorInstrumentation::willDeleteProgram):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242594 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/html/canvas/CanvasRenderingContext.cpp
Source/WebCore/html/canvas/CanvasRenderingContext.h
Source/WebCore/html/canvas/WebGLProgram.cpp
Source/WebCore/html/canvas/WebGLProgram.h
Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
Source/WebCore/inspector/InspectorController.cpp
Source/WebCore/inspector/InspectorInstrumentation.h
Source/WebCore/inspector/agents/InspectorCanvasAgent.cpp
Source/WebCore/inspector/agents/InspectorCanvasAgent.h

index 2d51777..6956414 100644 (file)
@@ -1,3 +1,49 @@
+2019-03-07  Devin Rousso  <drousso@apple.com>
+
+        Web Inspector: Canvas: lazily create the agent
+        https://bugs.webkit.org/show_bug.cgi?id=195241
+
+        Reviewed by Joseph Pecoraro.
+
+        No functionality change.
+
+        * html/canvas/CanvasRenderingContext.h:
+        * html/canvas/CanvasRenderingContext.cpp:
+        (WebCore::CanvasRenderingContext::instances): Added.
+        (WebCore::CanvasRenderingContext::instancesMutex): Added.
+        (WebCore::CanvasRenderingContext::CanvasRenderingContext):
+        (WebCore::CanvasRenderingContext::~CanvasRenderingContext):
+
+        * html/canvas/WebGLProgram.h:
+        * html/canvas/WebGLProgram.cpp:
+        (WebCore::WebGLProgram::instances): Added.
+        (WebCore::WebGLProgram::instancesMutex): Added.
+        (WebCore::WebGLProgram::WebGLProgram):
+        (WebCore::WebGLProgram::~WebGLProgram):
+        * html/canvas/WebGLRenderingContextBase.cpp:
+        (WebCore::WebGLRenderingContextBase::~WebGLRenderingContextBase):
+
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::InspectorController):
+        (WebCore::InspectorController::createLazyAgents):
+
+        * inspector/agents/InspectorCanvasAgent.h:
+        * inspector/agents/InspectorCanvasAgent.cpp:
+        (WebCore::InspectorCanvasAgent::enable):
+        (WebCore::InspectorCanvasAgent::disable):
+        (WebCore::InspectorCanvasAgent::frameNavigated):
+        (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
+        (WebCore::InspectorCanvasAgent::canvasDestroyed):
+        (WebCore::InspectorCanvasAgent::didCreateProgram):
+        (WebCore::InspectorCanvasAgent::willDeleteProgram):
+        (WebCore::InspectorCanvasAgent::bindCanvas): Added.
+        (WebCore::InspectorCanvasAgent::canvasDestroyedTimerFired):
+
+        * inspector/InspectorInstrumentation.h:
+        (WebCore::InspectorInstrumentation::didCreateCanvasRenderingContext):
+        (WebCore::InspectorInstrumentation::didCreateProgram):
+        (WebCore::InspectorInstrumentation::willDeleteProgram):
+
 2019-03-06  Ross Kirsling  <ross.kirsling@sony.com>
 
         [Win] Remove -DUCHAR_TYPE=wchar_t stopgap and learn to live with char16_t.
index 79202b5..f048a63 100644 (file)
 #include "Image.h"
 #include "ImageBitmap.h"
 #include "OffscreenCanvas.h"
-#include <wtf/URL.h>
 #include "SecurityOrigin.h"
+#include <wtf/HashSet.h>
+#include <wtf/Lock.h>
+#include <wtf/NeverDestroyed.h>
+#include <wtf/URL.h>
 
 namespace WebCore {
 
+HashSet<CanvasRenderingContext*>& CanvasRenderingContext::instances(const LockHolder&)
+{
+    static NeverDestroyed<HashSet<CanvasRenderingContext*>> instances;
+    return instances;
+}
+
+Lock& CanvasRenderingContext::instancesMutex()
+{
+    static LazyNeverDestroyed<Lock> mutex;
+    static std::once_flag initializeMutex;
+    std::call_once(initializeMutex, [] {
+        mutex.construct();
+    });
+    return mutex.get();
+}
+
 CanvasRenderingContext::CanvasRenderingContext(CanvasBase& canvas)
     : m_canvas(canvas)
 {
+    LockHolder lock(instancesMutex());
+    instances(lock).add(this);
+}
+
+CanvasRenderingContext::~CanvasRenderingContext()
+{
+    LockHolder lock(instancesMutex());
+    ASSERT(instances(lock).contains(this));
+    instances(lock).remove(this);
 }
 
 void CanvasRenderingContext::ref()
index 5172e27..7e1a6ce 100644 (file)
@@ -28,6 +28,7 @@
 #include "CanvasBase.h"
 #include "GraphicsLayer.h"
 #include "ScriptWrappable.h"
+#include <wtf/Forward.h>
 #include <wtf/Noncopyable.h>
 #include <wtf/text/StringHash.h>
 
@@ -44,7 +45,10 @@ class WebGLObject;
 class CanvasRenderingContext : public ScriptWrappable {
     WTF_MAKE_NONCOPYABLE(CanvasRenderingContext); WTF_MAKE_FAST_ALLOCATED;
 public:
-    virtual ~CanvasRenderingContext() = default;
+    virtual ~CanvasRenderingContext();
+
+    static HashSet<CanvasRenderingContext*>& instances(const LockHolder&);
+    static Lock& instancesMutex();
 
     void ref();
     WEBCORE_EXPORT void deref();
index c24335d..6ba381a 100644 (file)
 #include "WebGLContextGroup.h"
 #include "WebGLRenderingContextBase.h"
 #include "WebGLShader.h"
+#include <wtf/HashMap.h>
+#include <wtf/Lock.h>
+#include <wtf/NeverDestroyed.h>
 
 namespace WebCore {
 
+HashMap<WebGLProgram*, WebGLRenderingContextBase*>& WebGLProgram::instances(const LockHolder&)
+{
+    static NeverDestroyed<HashMap<WebGLProgram*, WebGLRenderingContextBase*>> instances;
+    return instances;
+}
+
+Lock& WebGLProgram::instancesMutex()
+{
+    static LazyNeverDestroyed<Lock> mutex;
+    static std::once_flag initializeMutex;
+    std::call_once(initializeMutex, [] {
+        mutex.construct();
+    });
+    return mutex.get();
+}
+
 Ref<WebGLProgram> WebGLProgram::create(WebGLRenderingContextBase& ctx)
 {
     return adoptRef(*new WebGLProgram(ctx));
@@ -42,12 +61,23 @@ Ref<WebGLProgram> WebGLProgram::create(WebGLRenderingContextBase& ctx)
 WebGLProgram::WebGLProgram(WebGLRenderingContextBase& ctx)
     : WebGLSharedObject(ctx)
 {
+    {
+        LockHolder lock(instancesMutex());
+        instances(lock).add(this, &ctx);
+    }
+
     setObject(ctx.graphicsContext3D()->createProgram());
 }
 
 WebGLProgram::~WebGLProgram()
 {
     deleteObject(0);
+
+    {
+        LockHolder lock(instancesMutex());
+        ASSERT(instances(lock).contains(this));
+        instances(lock).remove(this);
+    }
 }
 
 void WebGLProgram::deleteObjectImpl(GraphicsContext3D* context3d, Platform3DObject obj)
index eab76c8..b7846cb 100644 (file)
@@ -26,6 +26,7 @@
 #pragma once
 
 #include "WebGLSharedObject.h"
+#include <wtf/Forward.h>
 
 namespace WebCore {
 
@@ -36,6 +37,9 @@ public:
     static Ref<WebGLProgram> create(WebGLRenderingContextBase&);
     virtual ~WebGLProgram();
 
+    static HashMap<WebGLProgram*, WebGLRenderingContextBase*>& instances(const LockHolder&);
+    static Lock& instancesMutex();
+
     unsigned numActiveAttribLocations();
     GC3Dint getActiveAttribLocation(GC3Duint index);
 
index 1cb4935..606877a 100644 (file)
@@ -98,7 +98,9 @@
 #include <JavaScriptCore/TypedArrayInlines.h>
 #include <JavaScriptCore/Uint32Array.h>
 #include <wtf/CheckedArithmetic.h>
+#include <wtf/HashMap.h>
 #include <wtf/HexNumber.h>
+#include <wtf/Lock.h>
 #include <wtf/StdLibExtras.h>
 #include <wtf/UniqueArray.h>
 #include <wtf/text/CString.h>
@@ -891,6 +893,17 @@ WebGLRenderingContextBase::~WebGLRenderingContextBase()
         destroyGraphicsContext3D();
         m_contextGroup->removeContext(*this);
     }
+
+    {
+        LockHolder lock(WebGLProgram::instancesMutex());
+        for (auto& entry : WebGLProgram::instances(lock)) {
+            if (entry.value == this) {
+                // Don't remove any WebGLProgram from the instances list, as they may still exist.
+                // Only remove the association with a WebGL context.
+                entry.value = nullptr;
+            }
+        }
+    }
 }
 
 void WebGLRenderingContextBase::destroyGraphicsContext3D()
index 0f6134e..3969037 100644 (file)
@@ -146,10 +146,6 @@ InspectorController::InspectorController(Page& page, InspectorClient* inspectorC
 
     m_agents.append(std::make_unique<InspectorTimelineAgent>(pageContext, scriptProfilerAgent, heapAgent, pageAgent));
 
-    auto canvasAgentPtr = std::make_unique<InspectorCanvasAgent>(pageContext);
-    m_instrumentingAgents->setInspectorCanvasAgent(canvasAgentPtr.get());
-    m_agents.append(WTFMove(canvasAgentPtr));
-
     ASSERT(m_injectedScriptManager->commandLineAPIHost());
     if (CommandLineAPIHost* commandLineAPIHost = m_injectedScriptManager->commandLineAPIHost())
         commandLineAPIHost->init(m_inspectorAgent, consoleAgent, m_domAgent, domStorageAgent, databaseAgent);
@@ -210,6 +206,7 @@ void InspectorController::createLazyAgents()
     m_agents.append(std::make_unique<InspectorMemoryAgent>(pageContext));
 #endif
     m_agents.append(std::make_unique<PageAuditAgent>(pageContext));
+    m_agents.append(std::make_unique<InspectorCanvasAgent>(pageContext));
 }
 
 void InspectorController::inspectedPageDestroyed()
index efe265a..ad99aad 100644 (file)
@@ -1272,6 +1272,7 @@ inline void InspectorInstrumentation::didChangeCSSCanvasClientNodes(CanvasBase&
 
 inline void InspectorInstrumentation::didCreateCanvasRenderingContext(CanvasRenderingContext& context)
 {
+    FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context.canvasBase().scriptExecutionContext()))
         didCreateCanvasRenderingContextImpl(*instrumentingAgents, context);
 }
@@ -1307,12 +1308,14 @@ inline void InspectorInstrumentation::didEnableExtension(WebGLRenderingContextBa
 
 inline void InspectorInstrumentation::didCreateProgram(WebGLRenderingContextBase& contextWebGLBase, WebGLProgram& program)
 {
+    FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(contextWebGLBase.canvasBase().scriptExecutionContext()))
         didCreateProgramImpl(*instrumentingAgents, contextWebGLBase, program);
 }
 
 inline void InspectorInstrumentation::willDeleteProgram(WebGLRenderingContextBase& contextWebGLBase, WebGLProgram& program)
 {
+    FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(contextWebGLBase.canvasBase().scriptExecutionContext()))
         willDeleteProgramImpl(*instrumentingAgents, program);
 }
index e937f14..b2e1896 100644 (file)
@@ -31,8 +31,8 @@
 #include "Document.h"
 #include "Element.h"
 #include "Frame.h"
+#include "HTMLCanvasElement.h"
 #include "ImageBitmapRenderingContext.h"
-#include "InspectorDOMAgent.h"
 #include "InstrumentingAgents.h"
 #include "JSCanvasRenderingContext2D.h"
 #include "JSExecState.h"
@@ -45,6 +45,8 @@
 #include <JavaScriptCore/InjectedScriptManager.h>
 #include <JavaScriptCore/InspectorProtocolObjects.h>
 #include <JavaScriptCore/JSCInlines.h>
+#include <wtf/HashSet.h>
+#include <wtf/Lock.h>
 
 #if ENABLE(WEBGL)
 #include "JSWebGLRenderingContext.h"
@@ -92,57 +94,65 @@ void InspectorCanvasAgent::discardAgent()
 
 void InspectorCanvasAgent::enable(ErrorString&)
 {
-    if (m_enabled)
+    if (m_instrumentingAgents.inspectorCanvasAgent() == this)
         return;
 
-    m_recordingAutoCaptureFrameCount = WTF::nullopt;
+    m_instrumentingAgents.setInspectorCanvasAgent(this);
 
-    m_enabled = true;
+    const auto canvasExistsInCurrentPage = [&] (CanvasRenderingContext* canvasRenderingContext) {
+        if (!canvasRenderingContext)
+            return false;
 
-    const bool captureBacktrace = false;
-    for (auto& inspectorCanvas : m_identifierToInspectorCanvas.values()) {
-        m_frontendDispatcher->canvasAdded(inspectorCanvas->buildObjectForCanvas(captureBacktrace));
+        auto* scriptExecutionContext = canvasRenderingContext->canvasBase().scriptExecutionContext();
+        if (!is<Document>(scriptExecutionContext))
+            return false;
 
-#if ENABLE(WEBGL)
-        if (is<WebGLRenderingContextBase>(inspectorCanvas->context())) {
-            WebGLRenderingContextBase& contextWebGL = downcast<WebGLRenderingContextBase>(inspectorCanvas->context());
-            if (Optional<Vector<String>> extensions = contextWebGL.getSupportedExtensions()) {
-                for (const String& extension : *extensions) {
-                    if (contextWebGL.extensionIsEnabled(extension))
-                        m_frontendDispatcher->extensionEnabled(inspectorCanvas->identifier(), extension);
-                }
-            }
+        if (auto* inspectorPageAgent = m_instrumentingAgents.inspectorPageAgent()) {
+            // FIXME: <https://webkit.org/b/168475> Web Inspector: Correctly display iframe's WebSockets
+            auto* document = downcast<Document>(scriptExecutionContext);
+            return document->page() == &inspectorPageAgent->page();
+        }
+
+        return false;
+    };
+
+    {
+        LockHolder lock(CanvasRenderingContext::instancesMutex());
+        for (auto* canvasRenderingContext : CanvasRenderingContext::instances(lock)) {
+            if (canvasExistsInCurrentPage(canvasRenderingContext))
+                bindCanvas(*canvasRenderingContext, false);
         }
-#endif
     }
 
 #if ENABLE(WEBGL)
-    for (auto& inspectorProgram : m_identifierToInspectorProgram.values()) {
-        auto& inspectorCanvas = inspectorProgram->canvas();
-        m_frontendDispatcher->programCreated(inspectorCanvas.identifier(), inspectorProgram->identifier());
+    {
+        LockHolder lock(WebGLProgram::instancesMutex());
+        for (auto& entry : WebGLProgram::instances(lock)) {
+            if (canvasExistsInCurrentPage(entry.value))
+                didCreateProgram(*entry.value, *entry.key);
+        }
     }
 #endif
 }
 
 void InspectorCanvasAgent::disable(ErrorString&)
 {
-    if (!m_enabled)
-        return;
+    m_instrumentingAgents.setInspectorCanvasAgent(nullptr);
 
-    if (m_canvasDestroyedTimer.isActive())
-        m_canvasDestroyedTimer.stop();
+#if ENABLE(WEBGL)
+    m_identifierToInspectorProgram.clear();
+#endif
 
+    m_identifierToInspectorCanvas.clear();
     m_removedCanvasIdentifiers.clear();
 
+    if (m_canvasDestroyedTimer.isActive())
+        m_canvasDestroyedTimer.stop();
+
     if (m_canvasRecordingTimer.isActive())
         m_canvasRecordingTimer.stop();
 
-    for (auto& inspectorCanvas : m_identifierToInspectorCanvas.values())
-        inspectorCanvas->resetRecordingData();
-
     m_recordingAutoCaptureFrameCount = WTF::nullopt;
-
-    m_enabled = false;
 }
 
 void InspectorCanvasAgent::requestNode(ErrorString& errorString, const String& canvasId, int* nodeId)
@@ -408,8 +418,7 @@ void InspectorCanvasAgent::frameNavigated(Frame& frame)
         inspectorCanvas->context().canvasBase().removeObserver(*this);
 
         String identifier = unbindCanvas(*inspectorCanvas);
-        if (m_enabled)
-            m_frontendDispatcher->canvasRemoved(identifier);
+        m_frontendDispatcher->canvasRemoved(identifier);
     }
 }
 
@@ -436,21 +445,12 @@ void InspectorCanvasAgent::didCreateCanvasRenderingContext(CanvasRenderingContex
         return;
     }
 
-    context.canvasBase().addObserver(*this);
-
-    auto inspectorCanvas = InspectorCanvas::create(context);
-    m_identifierToInspectorCanvas.set(inspectorCanvas->identifier(), inspectorCanvas.copyRef());
-
-    if (!m_enabled)
-        return;
-
-    const bool captureBacktrace = true;
-    m_frontendDispatcher->canvasAdded(inspectorCanvas->buildObjectForCanvas(captureBacktrace));
+    auto& inspectorCanvas = bindCanvas(context, true);
 
     if (m_recordingAutoCaptureFrameCount) {
         RecordingOptions recordingOptions;
         recordingOptions.frameCount = m_recordingAutoCaptureFrameCount.value();
-        startRecording(inspectorCanvas.get(), Inspector::Protocol::Recording::Initiator::AutoCapture, WTFMove(recordingOptions));
+        startRecording(inspectorCanvas, Inspector::Protocol::Recording::Initiator::AutoCapture, WTFMove(recordingOptions));
     }
 }
 
@@ -490,18 +490,14 @@ void InspectorCanvasAgent::recordCanvasAction(CanvasRenderingContext& canvasRend
 void InspectorCanvasAgent::canvasDestroyed(CanvasBase& canvasBase)
 {
     auto* context = canvasBase.renderingContext();
-    ASSERT(context);
     if (!context)
         return;
 
     auto* inspectorCanvas = findInspectorCanvas(*context);
-    ASSERT(inspectorCanvas);
     if (!inspectorCanvas)
         return;
 
     String identifier = unbindCanvas(*inspectorCanvas);
-    if (!m_enabled)
-        return;
 
     // WebCore::CanvasObserver::canvasDestroyed is called in response to the GC destroying the CanvasBase.
     // Due to the single-process model used in WebKit1, the event must be dispatched from a timer to prevent
@@ -615,9 +611,7 @@ void InspectorCanvasAgent::didCreateProgram(WebGLRenderingContextBase& context,
     auto inspectorProgram = InspectorShaderProgram::create(program, *inspectorCanvas);
     String programIdentifier = inspectorProgram->identifier();
     m_identifierToInspectorProgram.set(programIdentifier, WTFMove(inspectorProgram));
-
-    if (m_enabled)
-        m_frontendDispatcher->programCreated(inspectorCanvas->identifier(), programIdentifier);
+    m_frontendDispatcher->programCreated(inspectorCanvas->identifier(), programIdentifier);
 }
 
 void InspectorCanvasAgent::willDeleteProgram(WebGLProgram& program)
@@ -627,8 +621,7 @@ void InspectorCanvasAgent::willDeleteProgram(WebGLProgram& program)
         return;
 
     String identifier = unbindProgram(*inspectorProgram);
-    if (m_enabled)
-        m_frontendDispatcher->programDeleted(identifier);
+    m_frontendDispatcher->programDeleted(identifier);
 }
 
 bool InspectorCanvasAgent::isShaderProgramDisabled(WebGLProgram& program)
@@ -681,10 +674,8 @@ void InspectorCanvasAgent::canvasDestroyedTimerFired()
     if (!m_removedCanvasIdentifiers.size())
         return;
 
-    if (m_enabled) {
-        for (auto& identifier : m_removedCanvasIdentifiers)
-            m_frontendDispatcher->canvasRemoved(identifier);
-    }
+    for (auto& identifier : m_removedCanvasIdentifiers)
+        m_frontendDispatcher->canvasRemoved(identifier);
 
     m_removedCanvasIdentifiers.clear();
 }
@@ -717,6 +708,30 @@ void InspectorCanvasAgent::clearCanvasData()
         m_canvasDestroyedTimer.stop();
 }
 
+InspectorCanvas& InspectorCanvasAgent::bindCanvas(CanvasRenderingContext& context, bool captureBacktrace)
+{
+    context.canvasBase().addObserver(*this);
+
+    auto inspectorCanvas = InspectorCanvas::create(context);
+    m_identifierToInspectorCanvas.set(inspectorCanvas->identifier(), inspectorCanvas.copyRef());
+
+    m_frontendDispatcher->canvasAdded(inspectorCanvas->buildObjectForCanvas(captureBacktrace));
+
+#if ENABLE(WEBGL)
+    if (is<WebGLRenderingContextBase>(inspectorCanvas->context())) {
+        WebGLRenderingContextBase& contextWebGL = downcast<WebGLRenderingContextBase>(inspectorCanvas->context());
+        if (Optional<Vector<String>> extensions = contextWebGL.getSupportedExtensions()) {
+            for (const String& extension : *extensions) {
+                if (contextWebGL.extensionIsEnabled(extension))
+                    m_frontendDispatcher->extensionEnabled(inspectorCanvas->identifier(), extension);
+            }
+        }
+    }
+#endif
+
+    return inspectorCanvas;
+}
+
 String InspectorCanvasAgent::unbindCanvas(InspectorCanvas& inspectorCanvas)
 {
 #if ENABLE(WEBGL)
index fa3ff79..469e3ed 100644 (file)
@@ -114,6 +114,7 @@ private:
     void canvasDestroyedTimerFired();
     void canvasRecordingTimerFired();
     void clearCanvasData();
+    InspectorCanvas& bindCanvas(CanvasRenderingContext&, bool captureBacktrace);
     String unbindCanvas(InspectorCanvas&);
     InspectorCanvas* assertInspectorCanvas(ErrorString&, const String& identifier);
     InspectorCanvas* findInspectorCanvas(CanvasRenderingContext&);
@@ -133,8 +134,6 @@ private:
     Timer m_canvasDestroyedTimer;
     Timer m_canvasRecordingTimer;
     Optional<size_t> m_recordingAutoCaptureFrameCount;
-
-    bool m_enabled { false };
 };
 
 } // namespace WebCore