Unreviewed, rolling out r218376.
authorjlewis3@apple.com <jlewis3@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Jun 2017 16:47:21 +0000 (16:47 +0000)
committerjlewis3@apple.com <jlewis3@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Jun 2017 16:47:21 +0000 (16:47 +0000)
The patch cause multiple Layout Test Crashes.

Reverted changeset:

"Web Inspector: Instrument 2D/WebGL canvas contexts in the
backend"
https://bugs.webkit.org/show_bug.cgi?id=172623
http://trac.webkit.org/changeset/218376

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

29 files changed:
LayoutTests/ChangeLog
LayoutTests/inspector/canvas/create-canvas-contexts-expected.txt [deleted file]
LayoutTests/inspector/canvas/create-canvas-contexts.html [deleted file]
Source/JavaScriptCore/CMakeLists.txt
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/DerivedSources.make
Source/JavaScriptCore/inspector/protocol/Canvas.json [deleted file]
Source/JavaScriptCore/inspector/scripts/codegen/generator.py
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/dom/Document.cpp
Source/WebCore/html/HTMLCanvasElement.cpp
Source/WebCore/inspector/InspectorAllInOne.cpp
Source/WebCore/inspector/InspectorCanvasAgent.cpp [deleted file]
Source/WebCore/inspector/InspectorCanvasAgent.h [deleted file]
Source/WebCore/inspector/InspectorController.cpp
Source/WebCore/inspector/InspectorInstrumentation.cpp
Source/WebCore/inspector/InspectorInstrumentation.h
Source/WebCore/inspector/InstrumentingAgents.cpp
Source/WebCore/inspector/InstrumentingAgents.h
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Base/Main.js
Source/WebInspectorUI/UserInterface/Controllers/CanvasManager.js [deleted file]
Source/WebInspectorUI/UserInterface/Main.html
Source/WebInspectorUI/UserInterface/Models/Canvas.js [deleted file]
Source/WebInspectorUI/UserInterface/Protocol/CanvasObserver.js [deleted file]
Source/WebInspectorUI/UserInterface/Test.html
Source/WebInspectorUI/UserInterface/Test/Test.js

index eef8bd3be734c670ea213ee8536a64234e98001d..ac8dc3a6187cac467a19a4fac6f6b159a49f051d 100644 (file)
@@ -1,3 +1,16 @@
+2017-06-16  Matt Lewis  <jlewis3@apple.com>
+
+        Unreviewed, rolling out r218376.
+
+        The patch cause multiple Layout Test Crashes.
+
+        Reverted changeset:
+
+        "Web Inspector: Instrument 2D/WebGL canvas contexts in the
+        backend"
+        https://bugs.webkit.org/show_bug.cgi?id=172623
+        http://trac.webkit.org/changeset/218376
+
 2017-06-16  Fujii Hironori  <Hironori.Fujii@sony.com>
 
         [GTK] Layout Test fast/events/tabindex-focus-blur-all.html is flaky
diff --git a/LayoutTests/inspector/canvas/create-canvas-contexts-expected.txt b/LayoutTests/inspector/canvas/create-canvas-contexts-expected.txt
deleted file mode 100644 (file)
index ffeea0f..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-Test that CanvasManager tracks creation and destruction of 2D and WebGL canvases.
-
-
-== Running test suite: Canvas.canvasContexts
--- Running test case: CheckNoCanvases
-PASS: CanvasManager should have no canvases.
-
--- Running test case: CheckCanvasesCleared
-Added canvas.
-Cleared canvases after reloading page.
-PASS: CanvasManager should have no canvases.
-
--- Running test case: Create2DCanvasContext
-Added canvas.
-PASS: Canvas context should be 2D.
-Removed canvas.
-PASS: Removed canvas has expected ID.
-
--- Running test case: CreateWebGLCanvasContext
-Added canvas.
-PASS: Canvas context should be WebGL.
-Removed canvas.
-PASS: Removed canvas has expected ID.
-
--- Running test case: Create2DCanvasContextOffscreen
-Added canvas.
-PASS: Canvas context should be 2D.
-Removed canvas.
-PASS: Removed canvas has expected ID.
-
--- Running test case: CreateWebGLCanvasContextOffscreen
-Added canvas.
-PASS: Canvas context should be WebGL.
-Removed canvas.
-PASS: Removed canvas has expected ID.
-
--- Running test case: CreateCSSCanvas2D
-Create CSS canvas from -webkit-canvas(css-canvas-2d).
-Added canvas.
-PASS: Canvas context should be 2D.
-PASS: Canvas name should equal the identifier passed to -webkit-canvas.
-
--- Running test case: CreateCSSCanvasWebGL
-Create CSS canvas from -webkit-canvas(css-canvas-webgl).
-Added canvas.
-PASS: Canvas context should be WebGL.
-PASS: Canvas name should equal the identifier passed to -webkit-canvas.
-
diff --git a/LayoutTests/inspector/canvas/create-canvas-contexts.html b/LayoutTests/inspector/canvas/create-canvas-contexts.html
deleted file mode 100644 (file)
index a3ff4bd..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
-<script>
-let contexts = [];
-
-function createCanvas(contextType) {
-    let canvas = document.body.appendChild(document.createElement("canvas"));
-    contexts.push(canvas.getContext(contextType));
-}
-
-function createCSSCanvas(contextType, canvasName) {
-    contexts.push(document.getCSSCanvasContext(contextType, canvasName, 10, 10));
-}
-
-function createOffscreenCanvas(contextType) {
-    contexts.push(document.createElement("canvas").getContext(contextType));
-}
-
-function destroyCanvases() {
-    for (let context of contexts) {
-        let canvasElement = context.canvas;
-        if (canvasElement && canvasElement.parentNode)
-            canvasElement.remove();
-    }
-
-    contexts = [];
-
-    // Force GC to make sure the canvas element is destroyed, otherwise the frontend
-    // does not receive WebInspector.CanvasManager.Event.CanvasWasRemoved events.
-    setTimeout(() => { GCController.collect(); }, 0);
-}
-
-function test() {
-    let suite = InspectorTest.createAsyncSuite("Canvas.canvasContexts");
-
-    function awaitCanvasAdded(contextType) {
-        return WebInspector.canvasManager.awaitEvent(WebInspector.CanvasManager.Event.CanvasWasAdded)
-        .then((event) => {
-            let canvas = event.data.canvas;
-            InspectorTest.log("Added canvas.");
-
-            let contextDisplayName = WebInspector.Canvas.displayNameForContextType(contextType);
-            InspectorTest.expectEqual(canvas.contextType, contextType, `Canvas context should be ${contextDisplayName}.`);
-
-            return canvas;
-        });
-    }
-
-    function awaitCanvasRemoved(canvasIdentifier) {
-        return WebInspector.canvasManager.awaitEvent(WebInspector.CanvasManager.Event.CanvasWasRemoved)
-        .then((event) => {
-            let canvas = event.data.canvas;
-            InspectorTest.log("Removed canvas.");
-            InspectorTest.expectEqual(canvas.identifier, canvasIdentifier, "Removed canvas has expected ID.");
-        });
-    }
-
-    suite.addTestCase({
-        name: "CheckNoCanvases",
-        description: "Check that the CanvasManager has no canvases initially.",
-        test(resolve, reject) {
-            InspectorTest.expectEqual(WebInspector.canvasManager.canvases.length, 0, "CanvasManager should have no canvases.");
-            resolve();
-        }
-    });
-
-    suite.addTestCase({
-        name: "CheckCanvasesCleared",
-        description: "Check that canvases are cleared on reload.",
-        test(resolve, reject) {
-            WebInspector.canvasManager.awaitEvent(WebInspector.CanvasManager.Event.Cleared)
-            .then((event) => {
-                InspectorTest.log("Cleared canvases after reloading page.");
-                InspectorTest.expectEqual(WebInspector.canvasManager.canvases.length, 0, "CanvasManager should have no canvases.");
-            })
-            .then(resolve, reject);
-
-            WebInspector.canvasManager.awaitEvent(WebInspector.CanvasManager.Event.CanvasWasAdded)
-            .then((event) => {
-                InspectorTest.log("Added canvas.");
-                InspectorTest.reloadPage();
-            });
-
-            InspectorTest.evaluateInPage(`createCanvas('2d')`);
-        }
-    });
-
-    function addSimpleTestCase({name, description, expression, contextType}) {
-        suite.addTestCase({
-            name,
-            description,
-            test(resolve, reject) {
-                awaitCanvasAdded(contextType)
-                .then((canvas) => {
-                    if (canvas.cssCanvasName) {
-                        InspectorTest.log("CSS canvas will not be destroyed");
-                        resolve();
-                        return;
-                    }
-
-                    let promise = awaitCanvasRemoved(canvas.identifier);
-                    InspectorTest.evaluateInPage(`destroyCanvases()`);
-                    return promise;
-                })
-                .then(resolve, reject);
-
-                InspectorTest.evaluateInPage(expression);
-            }
-        });
-    }
-
-    let simpleTestCases = [
-        {
-            name: "Create2DCanvasContext",
-            expression: `createCanvas("2d")`,
-            contextType: WebInspector.Canvas.ContextType.Canvas2D,
-        },
-        {
-            name: "CreateWebGLCanvasContext",
-            expression: `createCanvas("webgl")`,
-            contextType: WebInspector.Canvas.ContextType.WebGL,
-        },
-        {
-            name: "Create2DCanvasContextOffscreen",
-            expression: `createOffscreenCanvas("2d")`,
-            contextType: WebInspector.Canvas.ContextType.Canvas2D,
-        },
-        {
-            name: "CreateWebGLCanvasContextOffscreen",
-            expression: `createOffscreenCanvas("webgl")`,
-            contextType: WebInspector.Canvas.ContextType.WebGL,
-        }
-    ];
-
-    simpleTestCases.forEach(addSimpleTestCase);
-
-    function addCSSCanvasTest(contextType, cssCanvasIdentifier) {
-        let displayContextType = WebInspector.Canvas.displayNameForContextType(contextType);
-
-        suite.addTestCase({
-            name: `CreateCSSCanvas${displayContextType}`,
-            description: "Check that CSS canvases have the correct name and type.",
-            test(resolve, reject) {
-                awaitCanvasAdded(contextType, !!cssCanvasIdentifier)
-                .then((canvas) => { InspectorTest.expectEqual(canvas.cssCanvasName, cssCanvasIdentifier, "Canvas name should equal the identifier passed to -webkit-canvas."); })
-                .then(resolve, reject);
-
-                let contextId = contextType === WebInspector.Canvas.ContextType.Canvas2D ? "2d" : "webgl";
-                InspectorTest.log(`Create CSS canvas from -webkit-canvas(${cssCanvasIdentifier}).`);
-                InspectorTest.evaluateInPage(`createCSSCanvas("${contextId}", "${cssCanvasIdentifier}")`);
-            }
-        });
-    }
-
-    addCSSCanvasTest(WebInspector.Canvas.ContextType.Canvas2D, "css-canvas-2d");
-    addCSSCanvasTest(WebInspector.Canvas.ContextType.WebGL, "css-canvas-webgl");
-
-    suite.runTestCasesAndFinish();
-}
-</script>
-<style>
-    .canvas1 { background-image: -webkit-canvas(css-canvas-2d); }
-    .canvas2 { background-image: -webkit-canvas(css-canvas-webgl); }
-</style>
-</head>
-<body onload="runTest()">
-    <p>Test that CanvasManager tracks creation and destruction of 2D and WebGL canvases.</p>
-</body>
-</html>
index 4a654bb25767223f9ea3e393edd893760c85df5f..3f4a97d67b2973bb81e0be274380a392013ab324 100644 (file)
@@ -1350,7 +1350,6 @@ set(JavaScriptCore_INSPECTOR_PROTOCOL_SCRIPTS
 set(JavaScriptCore_INSPECTOR_DOMAINS
     ${JAVASCRIPTCORE_DIR}/inspector/protocol/ApplicationCache.json
     ${JAVASCRIPTCORE_DIR}/inspector/protocol/CSS.json
-    ${JAVASCRIPTCORE_DIR}/inspector/protocol/Canvas.json
     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Console.json
     ${JAVASCRIPTCORE_DIR}/inspector/protocol/DOM.json
     ${JAVASCRIPTCORE_DIR}/inspector/protocol/DOMDebugger.json
index 0c9fc056a6895c2682af00dffd2166da3ef3283d..833876305f8305f110edfc7137222a2c8c0fb6f8 100644 (file)
@@ -1,3 +1,16 @@
+2017-06-16  Matt Lewis  <jlewis3@apple.com>
+
+        Unreviewed, rolling out r218376.
+
+        The patch cause multiple Layout Test Crashes.
+
+        Reverted changeset:
+
+        "Web Inspector: Instrument 2D/WebGL canvas contexts in the
+        backend"
+        https://bugs.webkit.org/show_bug.cgi?id=172623
+        http://trac.webkit.org/changeset/218376
+
 2017-06-16  Konstantin Tokarev  <annulen@yandex.ru>
 
         REGRESSION(r166799): LogsPageMessagesToSystemConsoleEnabled corrupts non-ASCII characters
index d42534816f95562bdb338107ee3719cbf69ad3e3..640d5ade558c178568d89ac6ce79ee304301bc4e 100644 (file)
@@ -214,7 +214,6 @@ InitBytecodes.asm: $(JavaScriptCore)/generate-bytecode-files $(JavaScriptCore)/b
 INSPECTOR_DOMAINS = \
     $(JavaScriptCore)/inspector/protocol/ApplicationCache.json \
     $(JavaScriptCore)/inspector/protocol/CSS.json \
-    $(JavaScriptCore)/inspector/protocol/Canvas.json \
     $(JavaScriptCore)/inspector/protocol/Console.json \
     $(JavaScriptCore)/inspector/protocol/DOM.json \
     $(JavaScriptCore)/inspector/protocol/DOMDebugger.json \
diff --git a/Source/JavaScriptCore/inspector/protocol/Canvas.json b/Source/JavaScriptCore/inspector/protocol/Canvas.json
deleted file mode 100644 (file)
index 6e9e8a6..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-{
-    "domain": "Canvas",
-    "availability": "web",
-    "description": "Canvas domain allows tracking of 2D and WebGL canvases that have an associated graphics context. Tracks canvases in the DOM and CSS canvases created with -webkit-canvas.",
-    "types": [
-        {
-            "id": "CanvasId",
-            "type": "string",
-            "description": "Unique canvas identifier."
-        },
-        {
-            "id": "ContextType",
-            "type": "string",
-            "enum": ["canvas-2d", "webgl"],
-            "description": "The type of rendering context backing the canvas element."
-        },
-        {
-            "id": "Canvas",
-            "type": "object",
-            "description": "Information about a 2D/WebGL canvas for which a rendering context has been created.",
-            "properties": [
-                { "name": "canvasId", "$ref": "CanvasId", "description": "Canvas identifier." },
-                { "name": "contextType", "$ref": "ContextType", "description": "The type of rendering context backing the canvas." },
-                { "name": "frameId", "$ref": "Network.FrameId", "description": "Parent frame identifier." },
-                { "name": "cssCanvasName", "type": "string", "optional": true, "description": "The CSS canvas identifier, for canvases created with <code>document.getCSSCanvasContext</code>." }
-            ]
-        }
-    ],
-    "commands": [
-        {
-            "name": "enable",
-            "description": "Enables Canvas domain events."
-        },
-        {
-            "name": "disable",
-            "description": "Disables Canvas domain events."
-        }
-    ],
-    "events": [
-        {
-            "name": "canvasAdded",
-            "parameters": [
-                { "name": "canvas", "$ref": "Canvas", "description": "Canvas object." }
-            ]
-        },
-        {
-            "name": "canvasRemoved",
-            "parameters": [
-                { "name": "canvasId", "$ref": "CanvasId", "description": "Removed canvas identifier." }
-            ]
-        }
-    ]
-}
index e3d7b8f78ec9eea140144f716b9a61a28b239246..6e609a6a87cfc1d8971e38c8ebf6db698e41fdcd 100755 (executable)
@@ -38,13 +38,9 @@ log = logging.getLogger('global')
 def ucfirst(str):
     return str[:1].upper() + str[1:]
 
-_ALWAYS_SPECIALCASED_ENUM_VALUE_SUBSTRINGS = set(['2D', 'API', 'CSS', 'DOM', 'HTML', 'JIT', 'XHR', 'XML', 'IOS', 'MacOS'])
+_ALWAYS_SPECIALCASED_ENUM_VALUE_SUBSTRINGS = set(['API', 'CSS', 'DOM', 'HTML', 'JIT', 'XHR', 'XML', 'IOS', 'MacOS'])
 _ALWAYS_SPECIALCASED_ENUM_VALUE_LOOKUP_TABLE = dict([(s.upper(), s) for s in _ALWAYS_SPECIALCASED_ENUM_VALUE_SUBSTRINGS])
 
-_ENUM_IDENTIFIER_RENAME_MAP = {
-    'webgl': 'WebGL',  # Canvas.ContextType.webgl
-}
-
 # These objects are built manually by creating and setting InspectorValues.
 # Before sending these over the protocol, their shapes are checked against the specification.
 # So, any types referenced by these types require debug-only assertions that check values.
@@ -255,7 +251,7 @@ class Generator:
             return _ALWAYS_SPECIALCASED_ENUM_VALUE_LOOKUP_TABLE[match.group(1).upper()]
 
         # Split on hyphen, introduce camelcase, and force uppercasing of acronyms.
-        subwords = map(ucfirst, _ENUM_IDENTIFIER_RENAME_MAP.get(enum_value, enum_value).split('-'))
+        subwords = map(ucfirst, enum_value.split('-'))
         return re.sub(re.compile(regex, re.IGNORECASE), replaceCallback, "".join(subwords))
 
     @staticmethod
index 177f1776a6fcb048c746cf5be1d9f4e2a2b80d06..3fe925c0456f6aaf9dadc1f9a09030af836e3060 100644 (file)
@@ -1889,7 +1889,6 @@ set(WebCore_SOURCES
     inspector/DOMPatchSupport.cpp
     inspector/InspectorApplicationCacheAgent.cpp
     inspector/InspectorCSSAgent.cpp
-    inspector/InspectorCanvasAgent.cpp
     inspector/InspectorClient.cpp
     inspector/InspectorController.cpp
     inspector/InspectorDOMAgent.cpp
index eb0f879f09ef639d8c38958e3eee370777972bdf..a59be663be49ad75c0e7904d5f004af45035ef68 100644 (file)
@@ -1,3 +1,16 @@
+2017-06-16  Matt Lewis  <jlewis3@apple.com>
+
+        Unreviewed, rolling out r218376.
+
+        The patch cause multiple Layout Test Crashes.
+
+        Reverted changeset:
+
+        "Web Inspector: Instrument 2D/WebGL canvas contexts in the
+        backend"
+        https://bugs.webkit.org/show_bug.cgi?id=172623
+        http://trac.webkit.org/changeset/218376
+
 2017-06-16  Daniel Bates  <dabates@apple.com>
 
         Use the term icon instead of favicon
index 694d1fb37e4df4f4b5f4debb817f51967971280f..d3b50348246f6167c2737b0aacdb3db2dd3e2aa5 100644 (file)
                6C4C96DF1AD4483500363F64 /* JSReadableByteStreamController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C4C96DB1AD4483500363F64 /* JSReadableByteStreamController.h */; };
                6C4C96DF1AD4483500365672 /* JSReadableStreamBYOBRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C4C96DB1AD4483500365672 /* JSReadableStreamBYOBRequest.h */; };
                6C4C96DF1AD4483500365A50 /* JSReadableStreamDefaultController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C4C96DB1AD4483500365A50 /* JSReadableStreamDefaultController.h */; };
-               6A32D7CE1A16D8C000412F0B /* InspectorCanvasAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6A4B6D6619D225D8006F11D3 /* InspectorCanvasAgent.cpp */; };
-               6A4B6D6519D22519006F11D3 /* InspectorCanvasAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 6A4B6D6419D22519006F11D3 /* InspectorCanvasAgent.h */; };
                6C638895A96CCEE50C8C946C /* CachedResourceRequestInitiators.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C638893A96CCEE50C8C946C /* CachedResourceRequestInitiators.h */; settings = {ATTRIBUTES = (Private, ); }; };
                6C638896A96CCEE50C8C946C /* CachedResourceRequestInitiators.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6C638894A96CCEE50C8C946C /* CachedResourceRequestInitiators.cpp */; };
                6CDDE8D01770BB220016E072 /* RegionOversetState.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C70A81417707C49009A446E /* RegionOversetState.h */; settings = {ATTRIBUTES = (Private, ); }; };
                6C4C96DB1AD4483500363F64 /* JSReadableByteStreamController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSReadableByteStreamController.h; sourceTree = "<group>"; };
                6C4C96DB1AD4483500365672 /* JSReadableStreamBYOBRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSReadableStreamBYOBRequest.h; sourceTree = "<group>"; };
                6C4C96DB1AD4483500365A50 /* JSReadableStreamDefaultController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSReadableStreamDefaultController.h; sourceTree = "<group>"; };
-               6A4B6D6419D22519006F11D3 /* InspectorCanvasAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorCanvasAgent.h; sourceTree = "<group>"; };
-               6A4B6D6619D225D8006F11D3 /* InspectorCanvasAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorCanvasAgent.cpp; sourceTree = "<group>"; };
                6C638893A96CCEE50C8C946C /* CachedResourceRequestInitiators.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CachedResourceRequestInitiators.h; sourceTree = "<group>"; };
                6C638894A96CCEE50C8C946C /* CachedResourceRequestInitiators.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CachedResourceRequestInitiators.cpp; sourceTree = "<group>"; };
                6C70A81417707C49009A446E /* RegionOversetState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegionOversetState.h; sourceTree = "<group>"; };
                                7A54881514E432A1006AE05A /* DOMPatchSupport.h */,
                                B885E8D211E06DD2009FFBF4 /* InspectorApplicationCacheAgent.cpp */,
                                B885E8D311E06DD2009FFBF4 /* InspectorApplicationCacheAgent.h */,
-                               6A4B6D6619D225D8006F11D3 /* InspectorCanvasAgent.cpp */,
-                               6A4B6D6419D22519006F11D3 /* InspectorCanvasAgent.h */,
                                7A1F2B51126C61B20006A7E6 /* InspectorClient.cpp */,
                                1C81B9580E97330800266E07 /* InspectorClient.h */,
                                1C81B9570E97330800266E07 /* InspectorController.cpp */,
                                1C81B95A0E97330800266E07 /* InspectorController.h in Headers */,
                                82AB1744124B99EC00C5069D /* InspectorCSSAgent.h in Headers */,
                                4A9CC82116BF9BB400EC645A /* InspectorCSSOMWrappers.h in Headers */,
-                               6A4B6D6519D22519006F11D3 /* InspectorCanvasAgent.h in Headers */,
                                7AB0B1C11211A62200A76940 /* InspectorDatabaseAgent.h in Headers */,
                                41F062140F5F192600A07EAC /* InspectorDatabaseResource.h in Headers */,
                                7A24587C1021EAF4000A00AA /* InspectorDOMAgent.h in Headers */,
                                93309DEF099E64920056E581 /* InsertParagraphSeparatorCommand.cpp in Sources */,
                                93309DF1099E64920056E581 /* InsertTextCommand.cpp in Sources */,
                                B885E8D411E06DD2009FFBF4 /* InspectorApplicationCacheAgent.cpp in Sources */,
-                               6A32D7CE1A16D8C000412F0B /* InspectorCanvasAgent.cpp in Sources */,
                                7A1F2B52126C61B20006A7E6 /* InspectorClient.cpp in Sources */,
                                1C81B95B0E97330800266E07 /* InspectorController.cpp in Sources */,
                                82AB1743124B99EC00C5069D /* InspectorCSSAgent.cpp in Sources */,
index 9ca56d25fcaf9cdc947044cca0d53b4c985298ad..ed086b420409abaedc01a3051b37f31735200308 100644 (file)
@@ -5408,10 +5408,8 @@ CanvasRenderingContext* Document::getCSSCanvasContext(const String& type, const
 HTMLCanvasElement* Document::getCSSCanvasElement(const String& name)
 {
     RefPtr<HTMLCanvasElement>& element = m_cssCanvasElements.add(name, nullptr).iterator->value;
-    if (!element) {
+    if (!element)
         element = HTMLCanvasElement::create(*this);
-        InspectorInstrumentation::didCreateCSSCanvas(*element, name);
-    }
     return element.get();
 }
 
index 4572d91a29803a0a1666d240972547ac704c5f3f..39cedd15999f2139e77897daa8df09779a4b3bfc 100644 (file)
@@ -43,7 +43,6 @@
 #include "HTMLNames.h"
 #include "HTMLParserIdioms.h"
 #include "ImageData.h"
-#include "InspectorInstrumentation.h"
 #include "MIMETypeRegistry.h"
 #include "RenderHTMLCanvas.h"
 #include "RuntimeEnabledFeatures.h"
@@ -248,8 +247,6 @@ CanvasRenderingContext* HTMLCanvasElement::getContext2d(const String& type)
         downcast<CanvasRenderingContext2D>(*m_context).setUsesDisplayListDrawing(m_usesDisplayListDrawing);
         downcast<CanvasRenderingContext2D>(*m_context).setTracksDisplayListReplay(m_tracksDisplayListReplay);
 
-        InspectorInstrumentation::didCreateCanvasRenderingContext(*this);
-
 #if USE(IOSURFACE_CANVAS_BACKING_STORE) || ENABLE(ACCELERATED_2D_CANVAS)
         // Need to make sure a RenderLayer and compositing layer get created for the Canvas
         invalidateStyleAndLayerComposition();
@@ -305,8 +302,6 @@ CanvasRenderingContext* HTMLCanvasElement::getContextWebGL(const String& type, W
         if (m_context) {
             // Need to make sure a RenderLayer and compositing layer get created for the Canvas
             invalidateStyleAndLayerComposition();
-
-            InspectorInstrumentation::didCreateCanvasRenderingContext(*this);
         }
     }
 
index e89e6696b4b6c38ebe3e2e34416edc4e701e8a68..88728d41d9d2f0bdb3401e0e1b803452a60fbfe1 100644 (file)
@@ -31,7 +31,6 @@
 #include "DOMPatchSupport.cpp"
 #include "InspectorApplicationCacheAgent.cpp"
 #include "InspectorCSSAgent.cpp"
-#include "InspectorCanvasAgent.cpp"
 #include "InspectorClient.cpp"
 #include "InspectorController.cpp"
 #include "InspectorDOMAgent.cpp"
diff --git a/Source/WebCore/inspector/InspectorCanvasAgent.cpp b/Source/WebCore/inspector/InspectorCanvasAgent.cpp
deleted file mode 100644 (file)
index 6806ebc..0000000
+++ /dev/null
@@ -1,235 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "InspectorCanvasAgent.h"
-
-#include "CanvasRenderingContext.h"
-#include "Document.h"
-#include "DocumentLoader.h"
-#include "Frame.h"
-#include "InspectorDOMAgent.h"
-#include "InspectorPageAgent.h"
-#include "InstrumentingAgents.h"
-#include "MainFrame.h"
-#include <inspector/IdentifiersFactory.h>
-#include <inspector/InspectorProtocolObjects.h>
-
-using namespace Inspector;
-
-namespace WebCore {
-
-InspectorCanvasAgent::InspectorCanvasAgent(WebAgentContext& context, InspectorPageAgent* pageAgent)
-    : InspectorAgentBase(ASCIILiteral("Canvas"), context)
-    , m_frontendDispatcher(std::make_unique<Inspector::CanvasFrontendDispatcher>(context.frontendRouter))
-    , m_backendDispatcher(Inspector::CanvasBackendDispatcher::create(context.backendDispatcher, this))
-    , m_pageAgent(pageAgent)
-    , m_timer(*this, &InspectorCanvasAgent::canvasDestroyedTimerFired)
-{
-}
-
-void InspectorCanvasAgent::didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*)
-{
-}
-
-void InspectorCanvasAgent::willDestroyFrontendAndBackend(Inspector::DisconnectReason)
-{
-    ErrorString ignored;
-    disable(ignored);
-}
-
-void InspectorCanvasAgent::discardAgent()
-{
-    clearCanvasData();
-}
-
-void InspectorCanvasAgent::enable(ErrorString&)
-{
-    if (m_enabled)
-        return;
-
-    m_enabled = true;
-
-    for (const auto& pair : m_canvasEntries) {
-        auto* canvasElement = pair.key;
-        auto& canvasEntry = pair.value;
-        m_frontendDispatcher->canvasAdded(buildObjectForCanvas(canvasEntry, *canvasElement));
-    }
-}
-
-void InspectorCanvasAgent::disable(ErrorString&)
-{
-    if (!m_enabled)
-        return;
-
-    m_enabled = false;
-}
-
-void InspectorCanvasAgent::frameNavigated(DocumentLoader* loader)
-{
-    if (loader->frame()->isMainFrame()) {
-        clearCanvasData();
-        return;
-    }
-
-    Vector<HTMLCanvasElement*> canvasesForFrame;
-    for (const auto& canvasElement : m_canvasEntries.keys()) {
-        if (canvasElement->document().frame() == loader->frame())
-            canvasesForFrame.append(canvasElement);
-    }
-
-    if (!m_enabled) {
-        m_canvasEntries.clear();
-        return;
-    }
-
-    for (auto* canvasElement : canvasesForFrame) {
-        auto canvasEntry = m_canvasEntries.take(canvasElement);
-        m_frontendDispatcher->canvasRemoved(canvasEntry.identifier);
-    }
-}
-
-void InspectorCanvasAgent::didCreateCSSCanvas(HTMLCanvasElement& canvasElement, const String& name)
-{
-    ASSERT(!m_canvasToCSSCanvasId.contains(&canvasElement));
-    ASSERT(!m_canvasEntries.contains(&canvasElement));
-
-    m_canvasToCSSCanvasId.set(&canvasElement, name);
-}
-
-void InspectorCanvasAgent::didCreateCanvasRenderingContext(HTMLCanvasElement& canvasElement)
-{
-    if (m_canvasEntries.contains(&canvasElement)) {
-        ASSERT_NOT_REACHED();
-        return;
-    }
-
-    CanvasEntry newCanvasEntry("canvas:" + IdentifiersFactory::createIdentifier(), &canvasElement);
-    if (m_canvasToCSSCanvasId.contains(&canvasElement)) {
-        newCanvasEntry.cssCanvasName = m_canvasToCSSCanvasId.get(&canvasElement);
-        m_canvasToCSSCanvasId.remove(&canvasElement);
-    }
-
-    m_canvasEntries.set(&canvasElement, newCanvasEntry);
-    canvasElement.addObserver(*this);
-
-    if (!m_enabled)
-        return;
-
-    m_frontendDispatcher->canvasAdded(buildObjectForCanvas(newCanvasEntry, canvasElement));
-}
-
-void InspectorCanvasAgent::canvasDestroyed(HTMLCanvasElement& canvasElement)
-{
-    auto it = m_canvasEntries.find(&canvasElement);
-    if (it == m_canvasEntries.end())
-        return;
-
-    canvasElement.removeObserver(*this);
-
-    String canvasIdentifier = it->value.identifier;
-    m_canvasEntries.remove(it);
-
-    if (!m_enabled)
-        return;
-
-    // WebCore::CanvasObserver::canvasDestroyed is called in response to the GC destroying the HTMLCanvasElement.
-    // Due to the single-process model used in WebKit1, the event must be dispatched from a timer to prevent
-    // the frontend from making JS allocations while the GC is still active.
-    m_removedCanvasIdentifiers.append(canvasIdentifier);
-
-    if (!m_timer.isActive())
-        m_timer.startOneShot(0_s);
-}
-
-void InspectorCanvasAgent::canvasDestroyedTimerFired()
-{
-    if (!m_removedCanvasIdentifiers.size())
-        return;
-
-    for (const auto& identifier : m_removedCanvasIdentifiers)
-        m_frontendDispatcher->canvasRemoved(identifier);
-
-    m_removedCanvasIdentifiers.clear();
-}
-
-void InspectorCanvasAgent::clearCanvasData()
-{
-    for (auto* canvasElement : m_canvasEntries.keys())
-        canvasElement->removeObserver(*this);
-
-    m_canvasEntries.clear();
-    m_canvasToCSSCanvasId.clear();
-    m_removedCanvasIdentifiers.clear();
-
-    if (m_timer.isActive())
-        m_timer.stop();
-}
-
-InspectorCanvasAgent::CanvasEntry* InspectorCanvasAgent::getCanvasEntry(HTMLCanvasElement& canvasElement)
-{
-    auto findResult = m_canvasEntries.find(&canvasElement);
-    if (findResult != m_canvasEntries.end())
-        return &findResult->value;
-
-    return nullptr;
-}
-
-InspectorCanvasAgent::CanvasEntry* InspectorCanvasAgent::getCanvasEntry(const String& canvasIdentifier)
-{
-    for (auto& canvasEntry : m_canvasEntries.values()) {
-        if (canvasEntry.identifier == canvasIdentifier)
-            return &canvasEntry;
-    }
-
-    return nullptr;
-}
-
-Ref<Inspector::Protocol::Canvas::Canvas> InspectorCanvasAgent::buildObjectForCanvas(const CanvasEntry& canvasEntry, HTMLCanvasElement& canvasElement)
-{
-    Frame* frame = canvasElement.document().frame();
-    CanvasRenderingContext* context = canvasElement.renderingContext();
-
-    Inspector::Protocol::Canvas::ContextType contextType;
-    if (context->is2d())
-        contextType = Inspector::Protocol::Canvas::ContextType::Canvas2D;
-    else {
-        ASSERT(context->isWebGL());
-        contextType = Inspector::Protocol::Canvas::ContextType::WebGL;
-    }
-
-    auto canvas = Inspector::Protocol::Canvas::Canvas::create()
-        .setCanvasId(canvasEntry.identifier)
-        .setFrameId(m_pageAgent->frameId(frame))
-        .setContextType(contextType)
-        .release();
-
-    if (!canvasEntry.cssCanvasName.isEmpty())
-        canvas->setCssCanvasName(canvasEntry.cssCanvasName);
-
-    return canvas;
-}
-
-} // namespace WebCore
diff --git a/Source/WebCore/inspector/InspectorCanvasAgent.h b/Source/WebCore/inspector/InspectorCanvasAgent.h
deleted file mode 100644 (file)
index f8ef578..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include "HTMLCanvasElement.h"
-#include "InspectorWebAgentBase.h"
-#include "Timer.h"
-#include <inspector/InspectorBackendDispatchers.h>
-#include <inspector/InspectorFrontendDispatchers.h>
-#include <wtf/HashMap.h>
-#include <wtf/HashSet.h>
-#include <wtf/RefPtr.h>
-#include <wtf/Vector.h>
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-class DocumentLoader;
-class InspectorPageAgent;
-class WebGLRenderingContextBase;
-
-typedef String ErrorString;
-
-class InspectorCanvasAgent final : public InspectorAgentBase, public CanvasObserver, public Inspector::CanvasBackendDispatcherHandler {
-    WTF_MAKE_NONCOPYABLE(InspectorCanvasAgent);
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    InspectorCanvasAgent(WebAgentContext&, InspectorPageAgent*);
-    virtual ~InspectorCanvasAgent() { }
-
-    void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) override;
-    void willDestroyFrontendAndBackend(Inspector::DisconnectReason) override;
-    void discardAgent() override;
-
-    // CanvasBackendDispatcherHandler
-    void enable(ErrorString&) override;
-    void disable(ErrorString&) override;
-
-    // InspectorInstrumentation
-    void frameNavigated(DocumentLoader*);
-    void didCreateCSSCanvas(HTMLCanvasElement&, const String&);
-    void didCreateCanvasRenderingContext(HTMLCanvasElement&);
-
-    // CanvasObserver
-    void canvasChanged(HTMLCanvasElement&, const FloatRect&) override { }
-    void canvasResized(HTMLCanvasElement&) override { }
-    void canvasDestroyed(HTMLCanvasElement&) override;
-
-private:
-    struct CanvasEntry {
-        String identifier;
-        String cssCanvasName;
-        HTMLCanvasElement* element = { nullptr };
-
-        CanvasEntry() { }
-
-        CanvasEntry(const String& identifier, HTMLCanvasElement* canvasElement)
-            : identifier(identifier)
-            , element(canvasElement)
-        {
-        }
-    };
-
-    void canvasDestroyedTimerFired();
-    void clearCanvasData();
-    CanvasEntry* getCanvasEntry(HTMLCanvasElement&);
-    CanvasEntry* getCanvasEntry(const String&);
-    Ref<Inspector::Protocol::Canvas::Canvas> buildObjectForCanvas(const CanvasEntry&, HTMLCanvasElement&);
-
-    std::unique_ptr<Inspector::CanvasFrontendDispatcher> m_frontendDispatcher;
-    RefPtr<Inspector::CanvasBackendDispatcher> m_backendDispatcher;
-    InspectorPageAgent* m_pageAgent;
-
-    HashMap<HTMLCanvasElement*, CanvasEntry> m_canvasEntries;
-    HashMap<HTMLCanvasElement*, String> m_canvasToCSSCanvasId;
-    Vector<String> m_removedCanvasIdentifiers;
-    Timer m_timer;
-    bool m_enabled { false };
-};
-
-} // namespace WebCore
index 4f8113d0fcccb082469b22a2e5d4e49ae4ee7c5a..98feb0584e2de8dbd265ef530f9b8333badb0b7e 100644 (file)
@@ -38,7 +38,6 @@
 #include "GraphicsContext.h"
 #include "InspectorApplicationCacheAgent.h"
 #include "InspectorCSSAgent.h"
-#include "InspectorCanvasAgent.h"
 #include "InspectorClient.h"
 #include "InspectorDOMAgent.h"
 #include "InspectorDOMDebuggerAgent.h"
@@ -184,10 +183,6 @@ InspectorController::InspectorController(Page& page, InspectorClient* inspectorC
     m_agents.append(std::make_unique<InspectorLayerTreeAgent>(pageContext));
     m_agents.append(std::make_unique<InspectorWorkerAgent>(pageContext));
 
-    auto canvasAgentPtr = std::make_unique<InspectorCanvasAgent>(pageContext, pageAgent);
-    m_instrumentingAgents->setInspectorCanvasAgent(canvasAgentPtr.get());
-    m_agents.append(WTFMove(canvasAgentPtr));
-
     ASSERT(m_injectedScriptManager->commandLineAPIHost());
     if (CommandLineAPIHost* commandLineAPIHost = m_injectedScriptManager->commandLineAPIHost()) {
         commandLineAPIHost->init(m_inspectorAgent
index 24b2c5cd730382c80efdf7a3c0949668d5841f05..c1b4688f56b8c87c55c1bfeb80c6e32b40871773 100644 (file)
@@ -40,7 +40,6 @@
 #include "EventDispatcher.h"
 #include "InspectorApplicationCacheAgent.h"
 #include "InspectorCSSAgent.h"
-#include "InspectorCanvasAgent.h"
 #include "InspectorDOMAgent.h"
 #include "InspectorDOMDebuggerAgent.h"
 #include "InspectorDOMStorageAgent.h"
@@ -62,7 +61,6 @@
 #include "RenderView.h"
 #include "ScriptController.h"
 #include "WebConsoleAgent.h"
-#include "WebGLRenderingContextBase.h"
 #include "WebSocketFrame.h"
 #include <inspector/ConsoleMessage.h>
 #include <inspector/ScriptArguments.h>
@@ -750,9 +748,6 @@ void InspectorInstrumentation::didCommitLoadImpl(InstrumentingAgents& instrument
             pageHeapAgent->mainFrameNavigated();
     }
 
-    if (InspectorCanvasAgent* canvasAgent = instrumentingAgents.inspectorCanvasAgent())
-        canvasAgent->frameNavigated(loader);
-
     if (InspectorDOMAgent* domAgent = instrumentingAgents.inspectorDOMAgent())
         domAgent->didCommitLoad(frame.document());
 
@@ -993,18 +988,6 @@ void InspectorInstrumentation::didSendWebSocketFrameImpl(InstrumentingAgents& in
 }
 #endif
 
-void InspectorInstrumentation::didCreateCSSCanvasImpl(InstrumentingAgents* instrumentingAgents, HTMLCanvasElement& canvasElement, const String& name)
-{
-    if (InspectorCanvasAgent* canvasAgent = instrumentingAgents->inspectorCanvasAgent())
-        canvasAgent->didCreateCSSCanvas(canvasElement, name);
-}
-
-void InspectorInstrumentation::didCreateCanvasRenderingContextImpl(InstrumentingAgents* instrumentingAgents, HTMLCanvasElement& canvasElement)
-{
-    if (InspectorCanvasAgent* canvasAgent = instrumentingAgents->inspectorCanvasAgent())
-        canvasAgent->didCreateCanvasRenderingContext(canvasElement);
-}
-
 #if ENABLE(WEB_REPLAY)
 void InspectorInstrumentation::sessionCreatedImpl(InstrumentingAgents& instrumentingAgents, RefPtr<ReplaySession>&& session)
 {
index 3f90e25cb4d0ae2f5aa9b583c0cb8fbde6aab986..9c2112667738eafa69a6ff47c7d95d6cf05e4fbc 100644 (file)
@@ -36,7 +36,6 @@
 #include "Element.h"
 #include "FormData.h"
 #include "Frame.h"
-#include "HTMLCanvasElement.h"
 #include "HitTestResult.h"
 #include "InspectorController.h"
 #include "InspectorInstrumentationCookie.h"
@@ -82,7 +81,6 @@ class ResourceResponse;
 class SecurityOrigin;
 class ShadowRoot;
 class URL;
-class WebGLRenderingContextBase;
 class WebKitNamedFlow;
 class WorkerInspectorProxy;
 
@@ -245,9 +243,6 @@ public:
     static void didHandleMemoryPressure(Page&, Critical);
 #endif
 
-    static void didCreateCSSCanvas(HTMLCanvasElement&, const String&);
-    static void didCreateCanvasRenderingContext(HTMLCanvasElement&);
-
     static void networkStateChanged(Page&);
     static void updateApplicationCacheStatus(Frame*);
 
@@ -420,9 +415,6 @@ private:
     static void networkStateChangedImpl(InstrumentingAgents&);
     static void updateApplicationCacheStatusImpl(InstrumentingAgents&, Frame&);
 
-    static void didCreateCSSCanvasImpl(InstrumentingAgents*, HTMLCanvasElement&, const String&);
-    static void didCreateCanvasRenderingContextImpl(InstrumentingAgents*, HTMLCanvasElement&);
-
     static void layerTreeDidChangeImpl(InstrumentingAgents&);
     static void renderLayerDestroyedImpl(InstrumentingAgents&, const RenderLayer&);
 
@@ -1181,18 +1173,6 @@ inline void InspectorInstrumentation::didHandleMemoryPressure(Page& page, Critic
 }
 #endif
 
-inline void InspectorInstrumentation::didCreateCSSCanvas(HTMLCanvasElement& canvasElement, const String& name)
-{
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(&canvasElement.document()))
-        didCreateCSSCanvasImpl(instrumentingAgents, canvasElement, name);
-}
-    
-inline void InspectorInstrumentation::didCreateCanvasRenderingContext(HTMLCanvasElement& canvasElement)
-{
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(&canvasElement.document()))
-        didCreateCanvasRenderingContextImpl(instrumentingAgents, canvasElement);
-}
-
 inline void InspectorInstrumentation::networkStateChanged(Page& page)
 {
     FAST_RETURN_IF_NO_FRONTENDS(void());
index 0932716a5154cb4586e2b8a3577a00b38cd4e050..7118ea88b44c8d5156cd90de2a99f6aa523addf9 100644 (file)
@@ -67,7 +67,6 @@ void InstrumentingAgents::reset()
     m_pageDebuggerAgent = nullptr;
     m_pageHeapAgent = nullptr;
     m_inspectorDOMDebuggerAgent = nullptr;
-    m_inspectorCanvasAgent = nullptr;
 }
 
 } // namespace WebCore
index 5773320686931fcb982e7762eeb742a0914e61e2..64e8138a1eca5f136794f6e0276eb121744c4889 100644 (file)
@@ -44,7 +44,6 @@ class InspectorDebuggerAgent;
 namespace WebCore {
 
 class InspectorApplicationCacheAgent;
-class InspectorCanvasAgent;
 class InspectorCSSAgent;
 class InspectorDOMAgent;
 class InspectorDOMDebuggerAgent;
@@ -84,9 +83,6 @@ public:
     InspectorPageAgent* inspectorPageAgent() const { return m_inspectorPageAgent; }
     void setInspectorPageAgent(InspectorPageAgent* agent) { m_inspectorPageAgent = agent; }
 
-    InspectorCanvasAgent* inspectorCanvasAgent() const { return m_inspectorCanvasAgent; }
-    void setInspectorCanvasAgent(InspectorCanvasAgent* agent) { m_inspectorCanvasAgent = agent; }
-
     InspectorCSSAgent* inspectorCSSAgent() const { return m_inspectorCSSAgent; }
     void setInspectorCSSAgent(InspectorCSSAgent* agent) { m_inspectorCSSAgent = agent; }
 
@@ -174,7 +170,6 @@ private:
     PageDebuggerAgent* m_pageDebuggerAgent { nullptr };
     PageHeapAgent* m_pageHeapAgent { nullptr };
     InspectorDOMDebuggerAgent* m_inspectorDOMDebuggerAgent { nullptr };
-    InspectorCanvasAgent* m_inspectorCanvasAgent { nullptr };
 };
 
 } // namespace WebCore
index 7152cd2d964a11f3d9531a966d37e6ad7fe4321c..061bb82c182578cd74a84b028444fcade1ee7f34 100644 (file)
@@ -1,3 +1,16 @@
+2017-06-16  Matt Lewis  <jlewis3@apple.com>
+
+        Unreviewed, rolling out r218376.
+
+        The patch cause multiple Layout Test Crashes.
+
+        Reverted changeset:
+
+        "Web Inspector: Instrument 2D/WebGL canvas contexts in the
+        backend"
+        https://bugs.webkit.org/show_bug.cgi?id=172623
+        http://trac.webkit.org/changeset/218376
+
 2017-06-15  Matt Baker  <mattbaker@apple.com>
 
         Web Inspector: Instrument 2D/WebGL canvas contexts in the backend
index d4a16bbd04c00a7029196fc0bad8014d39002c6c..e42a4916e36cab196acd556f6e2d59871b5c63f7 100644 (file)
@@ -95,8 +95,6 @@ WebInspector.loaded = function()
         InspectorBackend.registerWorkerDispatcher(new WebInspector.WorkerObserver);
     if (InspectorBackend.registerReplayDispatcher)
         InspectorBackend.registerReplayDispatcher(new WebInspector.ReplayObserver);
-    if (InspectorBackend.registerCanvasDispatcher)
-        InspectorBackend.registerCanvasDispatcher(new WebInspector.CanvasObserver);
 
     // Main backend target.
     WebInspector.mainTarget = new WebInspector.MainTarget;
@@ -138,7 +136,6 @@ WebInspector.loaded = function()
     this.workerManager = new WebInspector.WorkerManager;
     this.replayManager = new WebInspector.ReplayManager;
     this.domDebuggerManager = new WebInspector.DOMDebuggerManager;
-    this.canvasManager = new WebInspector.CanvasManager;
 
     // Enable the Console Agent after creating the singleton managers.
     ConsoleAgent.enable();
diff --git a/Source/WebInspectorUI/UserInterface/Controllers/CanvasManager.js b/Source/WebInspectorUI/UserInterface/Controllers/CanvasManager.js
deleted file mode 100644 (file)
index 86937b6..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-WebInspector.CanvasManager = class CanvasManager extends WebInspector.Object
-{
-    constructor()
-    {
-        super();
-
-        WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
-
-        this._canvasIdentifierMap = new Map;
-
-        if (window.CanvasAgent)
-            CanvasAgent.enable();
-    }
-
-    // Public
-
-    get canvases()
-    {
-        return [...this._canvasIdentifierMap.values()];
-    }
-
-    canvasAdded(canvasPayload)
-    {
-        // Called from WebInspector.CanvasObserver.
-
-        console.assert(!this._canvasIdentifierMap.has(canvasPayload.canvasId), `Canvas already exists with id ${canvasPayload.canvasId}.`);
-
-        let canvas = WebInspector.Canvas.fromPayload(canvasPayload);
-        this._canvasIdentifierMap.set(canvas.identifier, canvas);
-
-        this.dispatchEventToListeners(WebInspector.CanvasManager.Event.CanvasWasAdded, {canvas});
-    }
-
-    canvasRemoved(canvasIdentifier)
-    {
-        // Called from WebInspector.CanvasObserver.
-
-        let canvas = this._canvasIdentifierMap.take(canvasIdentifier);
-        console.assert(canvas);
-        if (!canvas)
-            return;
-
-        this.dispatchEventToListeners(WebInspector.CanvasManager.Event.CanvasWasRemoved, {canvas});
-    }
-
-    // Private
-
-    _mainResourceDidChange(event)
-    {
-        console.assert(event.target instanceof WebInspector.Frame);
-        if (!event.target.isMainFrame())
-            return;
-
-        WebInspector.Canvas.resetUniqueDisplayNameNumbers();
-
-        if (this._canvasIdentifierMap.size) {
-            this._canvasIdentifierMap.clear();
-            this.dispatchEventToListeners(WebInspector.CanvasManager.Event.Cleared);
-        }
-    }
-};
-
-WebInspector.CanvasManager.Event = {
-    Cleared: "canvas-manager-cleared",
-    CanvasWasAdded: "canvas-manager-canvas-was-added",
-    CanvasWasRemoved: "canvas-manager-canvas-was-removed",
-};
index bd7f98fe318cf361b813e8ebc93f23314acaf714..ef90d39665477a201a5bdc7bbf7ce0f49183453a 100644 (file)
 
     <script src="Protocol/ApplicationCacheObserver.js"></script>
     <script src="Protocol/CSSObserver.js"></script>
-    <script src="Protocol/CanvasObserver.js"></script>
     <script src="Protocol/ConsoleObserver.js"></script>
     <script src="Protocol/DOMObserver.js"></script>
     <script src="Protocol/DOMStorageObserver.js"></script>
     <script src="Models/CSSStyleDeclaration.js"></script>
     <script src="Models/CSSStyleSheet.js"></script>
     <script src="Models/CallFrame.js"></script>
-    <script src="Models/Canvas.js"></script>
     <script src="Models/Collection.js"></script>
     <script src="Models/CollectionEntry.js"></script>
     <script src="Models/CollectionEntryPreview.js"></script>
     <script src="Controllers/BreakpointLogMessageLexer.js"></script>
     <script src="Controllers/BreakpointPopoverController.js"></script>
     <script src="Controllers/CSSStyleManager.js"></script>
-    <script src="Controllers/CanvasManager.js"></script>
     <script src="Controllers/CodeMirrorColorEditingController.js"></script>
     <script src="Controllers/CodeMirrorCompletionController.js"></script>
     <script src="Controllers/CodeMirrorBezierEditingController.js"></script>
diff --git a/Source/WebInspectorUI/UserInterface/Models/Canvas.js b/Source/WebInspectorUI/UserInterface/Models/Canvas.js
deleted file mode 100644 (file)
index 57cd4da..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-WebInspector.Canvas = class Canvas extends WebInspector.Object
-{
-    constructor(identifier, contextType, frame, cssCanvasName)
-    {
-        super();
-
-        console.assert(identifier);
-        console.assert(contextType);
-        console.assert(frame instanceof WebInspector.Frame);
-
-        this._identifier = identifier;
-        this._contextType = contextType;
-        this._frame = frame;
-        this._cssCanvasName = cssCanvasName || "";
-    }
-
-    // Static
-
-    static fromPayload(payload)
-    {
-        let contextType = null;
-        switch (payload.contextType) {
-        case CanvasAgent.ContextType.Canvas2D:
-            contextType = WebInspector.Canvas.ContextType.Canvas2D;
-            break;
-        case CanvasAgent.ContextType.WebGL:
-            contextType = WebInspector.Canvas.ContextType.WebGL;
-            break;
-        default:
-            console.error("Invalid canvas context type", payload.contextType);
-        }
-
-        let frame = WebInspector.frameResourceManager.frameForIdentifier(payload.frameId);
-        return new WebInspector.Canvas(payload.canvasId, contextType, frame, payload.cssCanvasName);
-    }
-
-    static displayNameForContextType(contextType)
-    {
-        switch (contextType) {
-        case WebInspector.Canvas.ContextType.Canvas2D:
-            return WebInspector.UIString("2D");
-        case WebInspector.Canvas.ContextType.WebGL:
-            return WebInspector.UIString("WebGL");
-        default:
-            console.error("Invalid canvas context type", contextType);
-        }
-    }
-
-    static resetUniqueDisplayNameNumbers()
-    {
-        WebInspector.Canvas._nextUniqueDisplayNameNumber = 1;
-    }
-
-    // Public
-
-    get identifier() { return this._identifier; }
-    get contextType() { return this._contextType; }
-    get frame() { return this._frame; }
-    get cssCanvasName() { return this._cssCanvasName; }
-
-    get displayName()
-    {
-        if (this.cssCanvasName) {
-            console.assert(!this._node, "Unexpected DOM node for CSS canvas.");
-            return WebInspector.UIString("CSS canvas ā€œ%sā€").format(this._cssCanvasName);
-        }
-
-        // TODO:if the DOM node for the canvas is known and an id attribute value
-        // exists, return the following: WebInspector.UIString("Canvas #%s").format(id);
-
-        if (!this._uniqueDisplayNameNumber)
-            this._uniqueDisplayNameNumber = this.constructor._nextUniqueDisplayNameNumber++;
-        return WebInspector.UIString("Canvas %d").format(this._uniqueDisplayNameNumber);
-    }
-
-    saveIdentityToCookie(cookie)
-    {
-        cookie[WebInspector.Canvas.FrameURLCookieKey] = this._frame.url.hash;
-        if (this._cssCanvasName)
-            cookie[WebInspector.Canvas.CSSCanvasNameCookieKey] = this._cssCanvasName;
-
-        // TODO: if the canvas has an associated DOM node, and the node path to the cookie.
-    }
-};
-
-WebInspector.Canvas._nextUniqueDisplayNameNumber = 1;
-
-WebInspector.Canvas.FrameURLCookieKey = "canvas-frame-url";
-WebInspector.Canvas.CSSCanvasNameCookieKey = "canvas-css-canvas-name";
-
-WebInspector.Canvas.ContextType = {
-    Canvas2D: Symbol("canvas-2d"),
-    WebGL: Symbol("webgl"),
-};
diff --git a/Source/WebInspectorUI/UserInterface/Protocol/CanvasObserver.js b/Source/WebInspectorUI/UserInterface/Protocol/CanvasObserver.js
deleted file mode 100644 (file)
index 3652001..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-WebInspector.CanvasObserver = class CanvasObserver
-{
-    // Events defined by the "Canvas" domain.
-
-    canvasAdded(canvas)
-    {
-        WebInspector.canvasManager.canvasAdded(canvas);
-    }
-
-    canvasRemoved(canvasId)
-    {
-        WebInspector.canvasManager.canvasRemoved(canvasId);
-    }
-};
index 0ae7f2da7f05e2ee65e22d2d65b28e9fecf08a71..41f7ff65477595fa33bc5ce87665a43ed4eb5c18 100644 (file)
@@ -71,7 +71,6 @@
 
     <script src="Protocol/InspectorObserver.js"></script>
     <script src="Protocol/CSSObserver.js"></script>
-    <script src="Protocol/CanvasObserver.js"></script>
     <script src="Protocol/ConsoleObserver.js"></script>
     <script src="Protocol/DOMObserver.js"></script>
     <script src="Protocol/DOMStorageObserver.js"></script>
     <script src="Models/CallFrame.js"></script>
     <script src="Models/CallingContextTree.js"></script>
     <script src="Models/CallingContextTreeNode.js"></script>
-    <script src="Models/Canvas.js"></script>
     <script src="Models/Collection.js"></script>
     <script src="Models/CollectionEntry.js"></script>
     <script src="Models/CollectionEntryPreview.js"></script>
 
     <script src="Controllers/BreakpointLogMessageLexer.js"></script>
     <script src="Controllers/CSSStyleManager.js"></script>
-    <script src="Controllers/CanvasManager.js"></script>
     <script src="Controllers/DOMDebuggerManager.js"></script>
     <script src="Controllers/DOMTreeManager.js"></script>
     <script src="Controllers/DebuggerManager.js"></script>
index 26a83b5fabd748f3e90c807cab2b17414129984c..79575785bb9137872fa42a45996dfd9a7be0a24c 100644 (file)
@@ -49,7 +49,6 @@ WebInspector.loaded = function()
     InspectorBackend.registerWorkerDispatcher(new WebInspector.WorkerObserver);
     if (InspectorBackend.registerReplayDispatcher)
         InspectorBackend.registerReplayDispatcher(new WebInspector.ReplayObserver);
-    InspectorBackend.registerCanvasDispatcher(new WebInspector.CanvasObserver);
 
     WebInspector.mainTarget = new WebInspector.MainTarget;
 
@@ -70,7 +69,6 @@ WebInspector.loaded = function()
     this.workerManager = new WebInspector.WorkerManager;
     this.replayManager = new WebInspector.ReplayManager;
     this.domDebuggerManager = new WebInspector.DOMDebuggerManager;
-    this.canvasManager = new WebInspector.CanvasManager;
 
     document.addEventListener("DOMContentLoaded", this.contentLoaded);