summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkozyatinskiy <kozyatinskiy@chromium.org>2016-03-25 12:20:37 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-25 19:22:06 +0000
commit559a35b9574ea1e17b2d6ccc5bc4f0cc955bb570 (patch)
treeccfc17a6243135bcb66e0220352e58544e912d81
parentc1f6d44ec2dcadd4dccc13a7ee4d1f139191ff9b (diff)
downloadchromium_src-559a35b9574ea1e17b2d6ccc5bc4f0cc955bb570.zip
chromium_src-559a35b9574ea1e17b2d6ccc5bc4f0cc955bb570.tar.gz
chromium_src-559a35b9574ea1e17b2d6ccc5bc4f0cc955bb570.tar.bz2
[DevTools] Remove promise inspector experiment
We decided to remove this experiment because it doesn't really help in most scenarios. We should instead polish async stacks and finish async stepping to make debugging of promises and any other async code easy. BUG=526811,348919,587850 R=dgozman@chromium.org,pfeldman@chromium.org Review URL: https://codereview.chromium.org/1827993002 Cr-Commit-Position: refs/heads/master@{#383328}
-rw-r--r--third_party/WebKit/LayoutTests/inspector/sources/debugger/promise-events-expected.txt33
-rw-r--r--third_party/WebKit/LayoutTests/inspector/sources/debugger/promise-events.html112
-rw-r--r--third_party/WebKit/LayoutTests/inspector/sources/debugger/promise-pane-expected.txt27
-rw-r--r--third_party/WebKit/LayoutTests/inspector/sources/debugger/promise-pane.html120
-rw-r--r--third_party/WebKit/LayoutTests/inspector/sources/debugger/promise-tracker-expected.txt44
-rw-r--r--third_party/WebKit/LayoutTests/inspector/sources/debugger/promise-tracker.html115
-rw-r--r--third_party/WebKit/Source/core/inspector/InspectorDebuggerAgent.cpp20
-rw-r--r--third_party/WebKit/Source/core/inspector/InspectorDebuggerAgent.h3
-rw-r--r--third_party/WebKit/Source/devtools/BUILD.gn3
-rw-r--r--third_party/WebKit/Source/devtools/devtools.gyp2
-rw-r--r--third_party/WebKit/Source/devtools/devtools.gypi6
-rw-r--r--third_party/WebKit/Source/devtools/front_end/inspector.json1
-rw-r--r--third_party/WebKit/Source/devtools/front_end/main/Main.js3
-rw-r--r--third_party/WebKit/Source/devtools/front_end/promises/PromisePane.js791
-rw-r--r--third_party/WebKit/Source/devtools/front_end/promises/module.json20
-rw-r--r--third_party/WebKit/Source/devtools/front_end/promises/promisePane.css95
-rw-r--r--third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js59
-rw-r--r--third_party/WebKit/Source/devtools/protocol.json49
-rw-r--r--third_party/WebKit/Source/platform/blink_platform.gypi2
-rw-r--r--third_party/WebKit/Source/platform/v8_inspector/DebuggerScript.js9
-rw-r--r--third_party/WebKit/Source/platform/v8_inspector/PromiseTracker.cpp160
-rw-r--r--third_party/WebKit/Source/platform/v8_inspector/PromiseTracker.h58
-rw-r--r--third_party/WebKit/Source/platform/v8_inspector/V8DebuggerAgentImpl.cpp64
-rw-r--r--third_party/WebKit/Source/platform/v8_inspector/V8DebuggerAgentImpl.h11
-rw-r--r--third_party/WebKit/Source/platform/v8_inspector/V8DebuggerImpl.cpp22
-rw-r--r--third_party/WebKit/Source/platform/v8_inspector/V8DebuggerImpl.h1
26 files changed, 2 insertions, 1828 deletions
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger/promise-events-expected.txt b/third_party/WebKit/LayoutTests/inspector/sources/debugger/promise-events-expected.txt
deleted file mode 100644
index 5d7172c..0000000
--- a/third_party/WebKit/LayoutTests/inspector/sources/debugger/promise-events-expected.txt
+++ /dev/null
@@ -1,33 +0,0 @@
-Tests promise tracker events in debugger.
-
-Set timer for test function.
-gc:
- id: 0
-gc:
- id: 1
-gc:
- id: 2
-new:
- id: 0
-new:
- id: 1
-new:
- id: 2
-new:
- id: 3
-update:
- id: 0
- status: resolved
-update:
- id: 1
- status: rejected
-update:
- id: 2
- parent id: 1
-update:
- id: 2
- status: resolved
-update:
- id: 3
- parent id: 2
-
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger/promise-events.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger/promise-events.html
deleted file mode 100644
index 9578e1f..0000000
--- a/third_party/WebKit/LayoutTests/inspector/sources/debugger/promise-events.html
+++ /dev/null
@@ -1,112 +0,0 @@
-<html>
-<head>
-<script src="../../../http/tests/inspector/inspector-test.js"></script>
-<script src="../../../http/tests/inspector/debugger-test.js"></script>
-<script>
-
-function testFunction()
-{
- var promise1 = new Promise(
- function promiseConstructor1(resolve, reject)
- {
- resolve("Resolved!");
- }
- );
- var promise2 = new Promise(
- function promiseConstructor2(resolve, reject)
- {
- reject("Rejected!");
- }
- );
- promise2
- .then(thenCallback1, thenCallback1)
- .then(thenCallback2);
-}
-
-function thenCallback1()
-{
- return 0;
-}
-
-function thenCallback2()
-{
- if (window.GCController)
- GCController.collectAll();
- debugger;
-}
-
-function test()
-{
- var events = [];
- var minPromiseId;
-
- InspectorTest.startDebuggerTest(step1, true);
-
- function step1()
- {
- InspectorTest.DebuggerAgent.enablePromiseTracker(true);
- InspectorTest.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.PromiseUpdated, promiseUpdated);
- InspectorTest.runTestFunctionAndWaitUntilPaused(step2);
- }
-
- function promiseUpdated(event)
- {
- var promiseId = event.data.promise.id;
- minPromiseId = Math.min(minPromiseId, promiseId) || promiseId;
- events.push(event.data);
- }
-
- function step2()
- {
- outputResults();
- InspectorTest.DebuggerAgent.disablePromiseTracker();
- InspectorTest.completeDebuggerTest();
- }
-
- function outputResults()
- {
- var output = [];
- for (var i = 0; i < events.length; i++) {
- var eventType = events[i].eventType;
- var promise = events[i].promise;
- var outputItem = [
- eventType + ":",
- "id: " + (promise.id - minPromiseId)
- ];
- switch (eventType) {
- case "new":
- var callFrame = promise.callFrame;
- if (callFrame) {
- var url = WebInspector.displayNameForURL(callFrame.url);
- outputItem.push(callFrame.functionName + " " + url + ":" + callFrame.lineNumber);
- }
- break;
- case "update":
- if (promise.status !== "pending") {
- outputItem.push("status: " + promise.status)
- var callFrame = promise.settlementStack && promise.settlementStack[0];
- if (callFrame) {
- var url = WebInspector.displayNameForURL(callFrame.url);
- outputItem.push(callFrame.functionName + " " + url + ":" + callFrame.lineNumber);
- }
- } else {
- outputItem.push("parent id: " + (promise.parentId - minPromiseId));
- }
- break;
- }
- output.push(outputItem.join("\n "));
- }
- output.sort();
- InspectorTest.addResults(output);
- }
-}
-
-</script>
-</head>
-
-<body onload="runTest()">
-<p>
-Tests promise tracker events in debugger.
-</p>
-</body>
-</html>
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger/promise-pane-expected.txt b/third_party/WebKit/LayoutTests/inspector/sources/debugger/promise-pane-expected.txt
deleted file mode 100644
index aeaa689..0000000
--- a/third_party/WebKit/LayoutTests/inspector/sources/debugger/promise-pane-expected.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-CONSOLE ERROR: line 16: Uncaught (in promise) Error: EXPECTED
-CONSOLE MESSAGE: Handler added to rejected promise
-Tests promise pane view.
-
-Set timer for test function.
-Is drawer visible: true
-Selected view in drawer: promises
-Rejected | func1 | promise-pane.html:16 | promise-pane.html:16 | <number> ms |
-Fulfilled | func3 | promise-pane.html:36 | | <number> ms |
-Fulfilled | func2 | promise-pane.html:24 | promise-pane.html:38 | <number> ms |
-
-Setting search value: func3
-Fulfilled | func3 | promise-pane.html:36 | | <number> ms |
-
-Setting search value: func
-Rejected | func1 | promise-pane.html:16 | promise-pane.html:16 | <number> ms |
-Fulfilled | func3 | promise-pane.html:36 | | <number> ms |
-Fulfilled | func2 | promise-pane.html:24 | promise-pane.html:38 | <number> ms |
-
-Setting search value: promise-pane.html
-Rejected | func1 | promise-pane.html:16 | promise-pane.html:16 | <number> ms |
-Fulfilled | func3 | promise-pane.html:36 | | <number> ms |
-Fulfilled | func2 | promise-pane.html:24 | promise-pane.html:38 | <number> ms |
-
-Setting search value: promise-pane.html:38
-Fulfilled | func2 | promise-pane.html:24 | promise-pane.html:38 | <number> ms |
-
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger/promise-pane.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger/promise-pane.html
deleted file mode 100644
index 12f8c4f..0000000
--- a/third_party/WebKit/LayoutTests/inspector/sources/debugger/promise-pane.html
+++ /dev/null
@@ -1,120 +0,0 @@
-<html>
-<head>
-<script src="../../../http/tests/inspector/inspector-test.js"></script>
-<script src="../../../http/tests/inspector/debugger-test.js"></script>
-<script>
-var p1, p2, p3;
-
-function testFunction()
-{
- debugger; // <- will turn on async call stacks here.
- setTimeout(func1, 0);
-}
-
-function func1()
-{
- p1 = Promise.reject(new Error("EXPECTED"));
- setTimeout(func2, 0);
-}
-
-function func2()
-{
- var resolve;
- var reject;
- p2 = new Promise(
- function (a, b)
- {
- resolve = a;
- reject = b;
- }
- );
- setTimeout(func3.bind(null, resolve, reject), 50);
-}
-
-function func3(resolve, reject)
-{
- p3 = p1.catch(function() {});
- var x = 42;
- resolve(x);
- setTimeout(func4, 0);
-}
-
-function func4()
-{
- debugger; // <- will stop the test here.
-}
-
-function test()
-{
- var maxAsyncCallStackDepth = 4;
- var promisePane;
-
- InspectorTest.addSniffer(WebInspector.TabbedPane.prototype, "changeTabView", onChangeTabView, true);
- WebInspector.inspectorView.showViewInDrawer("promises", true);
-
- function onChangeTabView(id, view)
- {
- if (!promisePane && id === "promises") {
- promisePane = view;
- InspectorTest.assertTrue(promisePane instanceof WebInspector.PromisePane);
- InspectorTest.startDebuggerTest(step1, true);
- }
- }
-
- function dumpPromiseDataGrid(callback)
- {
- promisePane._dataGrid._update();
- var result = InspectorTest.dumpDataGridIntoString(promisePane._dataGrid);
- result = result.replace(/\|\s+\d+\s+\w*\s*\|/g, "| <number> ms |");
- InspectorTest.addResult(result);
- if (callback)
- callback();
- }
-
- function step1()
- {
- InspectorTest.runTestFunctionAndWaitUntilPaused(step2);
- }
-
- function step2()
- {
- InspectorTest.DebuggerAgent.setAsyncCallStackDepth(maxAsyncCallStackDepth, step3);
- }
-
- function step3()
- {
- InspectorTest.addResult("Is drawer visible: " + WebInspector.inspectorView.drawerVisible());
- InspectorTest.addResult("Selected view in drawer: " + WebInspector.inspectorView.selectedViewInDrawer());
- InspectorTest.resumeExecution(InspectorTest.waitUntilPaused.bind(InspectorTest, dumpPromiseDataGrid.bind(null, step4)));
- }
-
- var searchValues = [
- "func3",
- "func",
- "promise-pane.html",
- "promise-pane.html:38",
- ];
-
- function step4()
- {
- var text = searchValues.shift();
- if (!text) {
- InspectorTest.completeDebuggerTest();
- return;
- }
- InspectorTest.addResult("\nSetting search value: " + text);
- promisePane._textFilterUI.setValue(text);
- promisePane._refresh();
- dumpPromiseDataGrid(step4);
- }
-}
-
-</script>
-</head>
-
-<body onload="runTest()">
-<p>
-Tests promise pane view.
-</p>
-</body>
-</html>
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger/promise-tracker-expected.txt b/third_party/WebKit/LayoutTests/inspector/sources/debugger/promise-tracker-expected.txt
deleted file mode 100644
index a9c8f68..0000000
--- a/third_party/WebKit/LayoutTests/inspector/sources/debugger/promise-tracker-expected.txt
+++ /dev/null
@@ -1,44 +0,0 @@
-Tests promise tracker in debugger.
-
-Set timer for test function.
-Promise (new):
- id: 0
- status: pending
- testFunction promise-tracker.html:10
- creationTime: true
-Promise (update):
- id: 0
- status: resolved
- settlementTime: true
-Promise (new):
- id: 1
- status: pending
- testFunction promise-tracker.html:14
- creationTime: true
-Promise (update):
- id: 1
- status: pending
-Promise (new):
- id: 2
- status: pending
- testFunction promise-tracker.html:15
- creationTime: true
-Promise (update):
- id: 2
- status: pending
- parent id: 1
-Promise (update):
- id: 1
- status: resolved
- settlementTime: true
-Script execution paused.
-Got promise by id: true
-Resolved object class: Promise
-Promise:
- status: resolved
- value: Resolved!
-Promise (gc):
-Promise (gc):
-Promise (gc):
-Script execution resumed.
-
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger/promise-tracker.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger/promise-tracker.html
deleted file mode 100644
index 1ad6a43..0000000
--- a/third_party/WebKit/LayoutTests/inspector/sources/debugger/promise-tracker.html
+++ /dev/null
@@ -1,115 +0,0 @@
-<html>
-<head>
-<script src="../../../http/tests/inspector/inspector-test.js"></script>
-<script src="../../../http/tests/inspector/debugger-test.js"></script>
-<script>
-
-var promise;
-function testFunction()
-{
- promise = new Promise(function promiseConstructor(resolve, reject) {
- resolve("Resolved!");
- });
- promise
- .then(thenCallback, errorCallback)
- .then(thenCallback2, errorCallback);
-}
-
-function thenCallback() { }
-
-function thenCallback2()
-{
- debugger;
-}
-
-function errorCallback() { }
-
-var test = function ()
-{
- InspectorTest.startDebuggerTest(step1);
-
- var minPromiseId;
- WebInspector.targetManager.addModelListener(WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.PromiseUpdated, onPromiseUpdated, this);
- function onPromiseUpdated(event)
- {
- var target = /** @type {!WebInspector.Target} */ (event.target.target());
- var eventType = /** @type {string} */ (event.data.eventType);
- var promise = /** @type {!DebuggerAgent.PromiseDetails} */ (event.data.promise);
-
- if (typeof minPromiseId === "undefined")
- minPromiseId = promise.id;
-
- var parentId = promise.parentId ? promise.parentId - minPromiseId : undefined;
- var promiseInfo = [];
- promiseInfo.push("Promise (" + eventType + "):");
- if (eventType !== "gc") {
- promiseInfo.push("id: " + (promise.id - minPromiseId));
- promiseInfo.push("status: " + promise.status);
- if (parentId)
- promiseInfo.push("parent id: " + parentId);
- var callFrame = promise.creationStack ? promise.creationStack.callFrames[0] : null;
- if (callFrame) {
- var url = WebInspector.displayNameForURL(callFrame.url);
- promiseInfo.push(callFrame.functionName + " " + url + ":" + callFrame.lineNumber);
- }
- if (promise.creationTime)
- promiseInfo.push("creationTime: " + (promise.creationTime > 0));
- if (promise.settlementTime)
- promiseInfo.push("settlementTime: " + (promise.settlementTime > 0));
- }
- InspectorTest.addResult(promiseInfo.join("\n "));
- }
-
- function step1()
- {
- InspectorTest.DebuggerAgent.enablePromiseTracker();
- InspectorTest.runTestFunctionAndWaitUntilPaused(step2);
- }
-
- function step2()
- {
- InspectorTest.DebuggerAgent.getPromiseById(minPromiseId, "console", didGetPromiseById);
- }
-
- function didGetPromiseById(error, response)
- {
- if (error) {
- InspectorTest.addResult("Failed to get promise by id: " + error);
- InspectorTest.DebuggerAgent.disablePromiseTracker();
- InspectorTest.completeDebuggerTest();
- return;
- }
- InspectorTest.addResult("Got promise by id: " + !error);
- InspectorTest.addResult("Resolved object class: " + response.className);
- InspectorTest.RuntimeAgent.getProperties(response.objectId, didGetProperties);
- }
-
- function didGetProperties(error, properties, internalProperties)
- {
- InspectorTest.assertTrue("Received internal properties of the first promise: " + (internalProperties && internalProperties.length > 0));
-
- var status, value;
- for (var i = 0; i < internalProperties.length; i++) {
- var property = internalProperties[i];
- if (property.name === "[[PromiseStatus]]")
- status = property.value.value;
- if (property.name === "[[PromiseValue]]")
- value = property.value.value;
- }
-
- InspectorTest.addResult("Promise:\n status: " + status + "\n value: " + value);
-
- InspectorTest.DebuggerAgent.disablePromiseTracker();
- InspectorTest.completeDebuggerTest();
- }
-}
-
-</script>
-</head>
-
-<body onload="runTest()">
-<p>
-Tests promise tracker in debugger.
-</p>
-</body>
-</html>
diff --git a/third_party/WebKit/Source/core/inspector/InspectorDebuggerAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorDebuggerAgent.cpp
index b5867e7..d8869e5 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorDebuggerAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorDebuggerAgent.cpp
@@ -259,26 +259,6 @@ void InspectorDebuggerAgent::setAsyncCallStackDepth(ErrorString* errorString, in
setTrackingAsyncCalls(m_v8DebuggerAgent->trackingAsyncCalls());
}
-void InspectorDebuggerAgent::enablePromiseTracker(ErrorString* errorString,
- const Maybe<bool>& inCaptureStacks)
-{
- m_v8DebuggerAgent->enablePromiseTracker(errorString, inCaptureStacks);
-}
-
-void InspectorDebuggerAgent::disablePromiseTracker(ErrorString* errorString)
-{
- m_v8DebuggerAgent->disablePromiseTracker(errorString);
-}
-
-void InspectorDebuggerAgent::getPromiseById(
- ErrorString* errorString,
- int inPromiseId,
- const Maybe<String16>& inObjectGroup,
- OwnPtr<protocol::Runtime::RemoteObject>* outPromise)
-{
- m_v8DebuggerAgent->getPromiseById(errorString, inPromiseId, inObjectGroup, outPromise);
-}
-
void InspectorDebuggerAgent::flushAsyncOperationEvents(ErrorString* errorString)
{
m_v8DebuggerAgent->flushAsyncOperationEvents(errorString);
diff --git a/third_party/WebKit/Source/core/inspector/InspectorDebuggerAgent.h b/third_party/WebKit/Source/core/inspector/InspectorDebuggerAgent.h
index ed2358e..5abd291 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorDebuggerAgent.h
+++ b/third_party/WebKit/Source/core/inspector/InspectorDebuggerAgent.h
@@ -73,9 +73,6 @@ public:
void setVariableValue(ErrorString*, int scopeNumber, const String16& variableName, PassOwnPtr<protocol::Runtime::CallArgument> newValue, const String16& callFrameId) override;
void getBacktrace(ErrorString*, OwnPtr<protocol::Array<protocol::Debugger::CallFrame>>* callFrames, Maybe<protocol::Runtime::StackTrace>* asyncStackTrace) override;
void setAsyncCallStackDepth(ErrorString*, int maxDepth) override;
- void enablePromiseTracker(ErrorString*, const Maybe<bool>& captureStacks) override;
- void disablePromiseTracker(ErrorString*) override;
- void getPromiseById(ErrorString*, int promiseId, const Maybe<String16>& objectGroup, OwnPtr<protocol::Runtime::RemoteObject>* promise) override;
void flushAsyncOperationEvents(ErrorString*) override;
void setAsyncOperationBreakpoint(ErrorString*, int operationId) override;
void removeAsyncOperationBreakpoint(ErrorString*, int operationId) override;
diff --git a/third_party/WebKit/Source/devtools/BUILD.gn b/third_party/WebKit/Source/devtools/BUILD.gn
index 7b22252..e0294a7 100644
--- a/third_party/WebKit/Source/devtools/BUILD.gn
+++ b/third_party/WebKit/Source/devtools/BUILD.gn
@@ -41,7 +41,6 @@ devtools_modules_js_files =
gypi_values.devtools_layers_js_files +
gypi_values.devtools_network_js_files +
gypi_values.devtools_profiler_js_files +
- gypi_values.devtools_promises_js_files +
gypi_values.devtools_resources_js_files +
gypi_values.devtools_sass_js_files +
gypi_values.devtools_security_js_files +
@@ -150,7 +149,6 @@ action("generate_devtools_grd") {
resources_out_dir + "layers_module.js",
resources_out_dir + "network_module.js",
resources_out_dir + "profiler_module.js",
- resources_out_dir + "promises_module.js",
resources_out_dir + "resources_module.js",
resources_out_dir + "sass_module.js",
resources_out_dir + "security_module.js",
@@ -282,7 +280,6 @@ action("build_applications") {
resources_out_dir + "layers_module.js",
resources_out_dir + "network_module.js",
resources_out_dir + "profiler_module.js",
- resources_out_dir + "promises_module.js",
resources_out_dir + "resources_module.js",
resources_out_dir + "sass_module.js",
resources_out_dir + "security_module.js",
diff --git a/third_party/WebKit/Source/devtools/devtools.gyp b/third_party/WebKit/Source/devtools/devtools.gyp
index ab14a9a..bfb3128 100644
--- a/third_party/WebKit/Source/devtools/devtools.gyp
+++ b/third_party/WebKit/Source/devtools/devtools.gyp
@@ -115,7 +115,6 @@
'<(PRODUCT_DIR)/resources/inspector/layers_module.js',
'<(PRODUCT_DIR)/resources/inspector/network_module.js',
'<(PRODUCT_DIR)/resources/inspector/profiler_module.js',
- '<(PRODUCT_DIR)/resources/inspector/promises_module.js',
'<(PRODUCT_DIR)/resources/inspector/resources_module.js',
'<(PRODUCT_DIR)/resources/inspector/sass_module.js',
'<(PRODUCT_DIR)/resources/inspector/security_module.js',
@@ -283,7 +282,6 @@
'<(_output_path)/layers_module.js',
'<(_output_path)/network_module.js',
'<(_output_path)/profiler_module.js',
- '<(_output_path)/promises_module.js',
'<(_output_path)/resources_module.js',
'<(_output_path)/sass_module.js',
'<(_output_path)/security_module.js',
diff --git a/third_party/WebKit/Source/devtools/devtools.gypi b/third_party/WebKit/Source/devtools/devtools.gypi
index 27a3c6c..752a145 100644
--- a/third_party/WebKit/Source/devtools/devtools.gypi
+++ b/third_party/WebKit/Source/devtools/devtools.gypi
@@ -337,7 +337,6 @@
'front_end/network/module.json',
'front_end/platform/module.json',
'front_end/profiler/module.json',
- 'front_end/promises/module.json',
'front_end/resources/module.json',
'front_end/sass/module.json',
'front_end/security/module.json',
@@ -497,10 +496,6 @@
'front_end/extensions/ExtensionView.js',
'<@(devtools_extension_api_files)',
],
- 'devtools_promises_js_files': [
- 'front_end/promises/promisePane.css',
- 'front_end/promises/PromisePane.js',
- ],
'devtools_heap_snapshot_worker_js_files': [
'front_end/common/TextUtils.js',
'front_end/common/UIString.js',
@@ -775,7 +770,6 @@
'<@(devtools_layers_js_files)',
'<@(devtools_network_js_files)',
'<@(devtools_profiler_js_files)',
- '<@(devtools_promises_js_files)',
'<@(devtools_resources_js_files)',
'<@(devtools_sass_js_files)',
'<@(devtools_security_js_files)',
diff --git a/third_party/WebKit/Source/devtools/front_end/inspector.json b/third_party/WebKit/Source/devtools/front_end/inspector.json
index 657336c..f3a0a2b 100644
--- a/third_party/WebKit/Source/devtools/front_end/inspector.json
+++ b/third_party/WebKit/Source/devtools/front_end/inspector.json
@@ -26,7 +26,6 @@
{ "name": "cm_modes", "type": "remote" },
{ "name": "settings" },
{ "name": "layers" },
- { "name": "promises" },
{ "name": "snippets" },
{ "name": "diff" },
{ "name": "sass" },
diff --git a/third_party/WebKit/Source/devtools/front_end/main/Main.js b/third_party/WebKit/Source/devtools/front_end/main/Main.js
index b67f01d..d0ba0c9 100644
--- a/third_party/WebKit/Source/devtools/front_end/main/Main.js
+++ b/third_party/WebKit/Source/devtools/front_end/main/Main.js
@@ -116,7 +116,6 @@ WebInspector.Main.prototype = {
Runtime.experiments.register("networkRequestHeadersFilterInDetailsView", "Network request headers filter in details view", true);
Runtime.experiments.register("networkRequestsOnTimeline", "Network requests on Timeline", true);
Runtime.experiments.register("privateScriptInspection", "Private script inspection");
- Runtime.experiments.register("promiseTracker", "Promise inspector");
Runtime.experiments.register("reducedIndentation", "Reduced indentation in Elements DOM tree");
Runtime.experiments.register("requestBlocking", "Request blocking", true);
Runtime.experiments.register("resolveVariableNames", "Resolve variable names", true);
@@ -134,8 +133,6 @@ WebInspector.Main.prototype = {
if (InspectorFrontendHost.isUnderTest()) {
var testPath = JSON.parse(prefs["testPath"] || "\"\"");
// Enable experiments for testing.
- if (testPath.indexOf("debugger/promise") !== -1)
- Runtime.experiments.enableForTest("promiseTracker");
if (testPath.indexOf("layers/") !== -1)
Runtime.experiments.enableForTest("layersPanel");
if (testPath.indexOf("timeline/") !== -1 || testPath.indexOf("layers/") !== -1)
diff --git a/third_party/WebKit/Source/devtools/front_end/promises/PromisePane.js b/third_party/WebKit/Source/devtools/front_end/promises/PromisePane.js
deleted file mode 100644
index 24381fe..0000000
--- a/third_party/WebKit/Source/devtools/front_end/promises/PromisePane.js
+++ /dev/null
@@ -1,791 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-/**
- * @constructor
- * @extends {WebInspector.VBox}
- * @implements {WebInspector.TargetManager.Observer}
- */
-WebInspector.PromisePane = function()
-{
- WebInspector.VBox.call(this);
- this.registerRequiredCSS("promises/promisePane.css");
- this.element.classList.add("promises");
-
- var toolbar = new WebInspector.Toolbar("", this.element);
- this._recordButton = new WebInspector.ToolbarToggle("", "record-toolbar-item");
- this._recordButton.addEventListener("click", this._recordButtonClicked.bind(this));
- toolbar.appendToolbarItem(this._recordButton);
-
- var clearButton = new WebInspector.ToolbarButton(WebInspector.UIString("Clear"), "clear-toolbar-item");
- clearButton.addEventListener("click", this._clearButtonClicked.bind(this));
- toolbar.appendToolbarItem(clearButton);
- toolbar.appendSeparator();
-
- this._promiseStatusFiltersSetting = WebInspector.settings.createSetting("promiseStatusFilters", {});
- this._hideCollectedPromisesSetting = WebInspector.settings.createSetting("hideCollectedPromises", false);
-
- this._createFilterBar();
- toolbar.appendToolbarItem(this._filterBar.filterButton());
-
- var garbageCollectButton = new WebInspector.ToolbarButton(WebInspector.UIString("Collect garbage"), "garbage-collect-toolbar-item");
- garbageCollectButton.addEventListener("click", this._garbageCollectButtonClicked, this);
- toolbar.appendToolbarItem(garbageCollectButton);
-
- toolbar.appendSeparator();
- var asyncCheckbox = new WebInspector.ToolbarCheckbox(WebInspector.UIString("Async"), WebInspector.UIString("Capture async stack traces"), WebInspector.moduleSetting("enableAsyncStackTraces"));
- toolbar.appendToolbarItem(asyncCheckbox);
-
- this._filterBar.show(this.element);
-
- this._hiddenByFilterCount = 0;
- this._filterStatusMessageElement = this.element.createChild("div", "promises-filter-status hidden");
- this._filterStatusTextElement = this._filterStatusMessageElement.createChild("span");
- this._filterStatusMessageElement.createTextChild(" ");
- var resetFiltersLink = this._filterStatusMessageElement.createChild("span", "link");
- resetFiltersLink.textContent = WebInspector.UIString("Show all promises.");
- resetFiltersLink.addEventListener("click", this._resetFilters.bind(this), true);
-
- // FIXME: Make "status" column width fixed to ~16px.
- var columns = [
- { id: "status", weight: 1 },
- { id: "function", title: WebInspector.UIString("Function"), disclosure: true, weight: 10 },
- { id: "created", title: WebInspector.UIString("Created"), weight: 10 },
- { id: "settled", title: WebInspector.UIString("Settled"), weight: 10 },
- { id: "tts", title: WebInspector.UIString("Time to settle"), weight: 10 }
- ];
- this._dataGrid = new WebInspector.ViewportDataGrid(columns, undefined, undefined, undefined, this._onContextMenu.bind(this));
- this._dataGrid.setStickToBottom(true);
- this._dataGrid.asWidget().show(this.element);
-
- this._linkifier = new WebInspector.Linkifier();
-
- /** @type {!Map.<!WebInspector.DebuggerModel, !Map.<number, !WebInspector.PromiseDetails>>} */
- this._promiseDetailsByDebuggerModel = new Map();
- /** @type {!Map.<number, !WebInspector.DataGridNode>} */
- this._promiseIdToNode = new Map();
-
- this._popoverHelper = new WebInspector.PopoverHelper(this.element, this._getPopoverAnchor.bind(this), this._showPopover.bind(this));
- this._popoverHelper.setTimeout(250, 250);
-
- this.element.addEventListener("click", this._hidePopover.bind(this), true);
-
- WebInspector.targetManager.addModelListener(WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.PromiseUpdated, this._onPromiseUpdated, this);
- WebInspector.targetManager.addModelListener(WebInspector.ResourceTreeModel, WebInspector.ResourceTreeModel.EventTypes.MainFrameNavigated, this._mainFrameNavigated, this);
- WebInspector.context.addFlavorChangeListener(WebInspector.Target, this._targetChanged, this);
-
- WebInspector.targetManager.observeTargets(this);
-}
-
-WebInspector.PromisePane._maxPromiseCount = 10000;
-
-
-/**
- * @constructor
- * @param {!DebuggerAgent.PromiseDetails} details
- */
-WebInspector.PromiseDetails = function(details)
-{
- this.id = details.id;
- this.isGarbageCollected = false;
- this.update(details);
-}
-
-WebInspector.PromiseDetails.prototype = {
- /**
- * @param {!DebuggerAgent.PromiseDetails} details
- */
- update: function(details)
- {
- if (this.id !== details.id)
- throw new Error("Invalid id, expected " + this.id + " was " + details.id);
- if (details.status)
- this.status = details.status;
- if (details.parentId)
- this.parentId = details.parentId;
- if (details.creationTime)
- this.creationTime = details.creationTime;
- if (details.settlementTime)
- this.settlementTime = details.settlementTime;
- if (details.creationStack) {
- this.creationStack = details.creationStack;
- if (this.creationStack.callFrames.length)
- this.callFrame = this.creationStack.callFrames[0];
- }
- if (details.asyncCreationStack)
- this.asyncCreationStack = details.asyncCreationStack;
- if (details.settlementStack)
- this.settlementStack = details.settlementStack;
- if (details.asyncSettlementStack)
- this.asyncSettlementStack = details.asyncSettlementStack;
- }
-}
-
-
-WebInspector.PromisePane.prototype = {
- _createFilterBar: function()
- {
- this._filterBar = new WebInspector.FilterBar("promisePane");
-
- this._textFilterUI = new WebInspector.TextFilterUI(true);
- this._textFilterUI.addEventListener(WebInspector.FilterUI.Events.FilterChanged, this._onFilterChanged, this);
- this._filterBar.addFilter(this._textFilterUI);
-
- var statuses = [
- { name: "pending", label: WebInspector.UIString("Pending") },
- { name: "resolved", label: WebInspector.UIString("Fulfilled") },
- { name: "rejected", label: WebInspector.UIString("Rejected") }
- ];
- this._statusFilterUI = new WebInspector.NamedBitSetFilterUI(statuses, this._promiseStatusFiltersSetting);
- this._statusFilterUI.addEventListener(WebInspector.FilterUI.Events.FilterChanged, this._onFilterChanged, this);
- this._filterBar.addFilter(this._statusFilterUI);
-
- var hideCollectedCheckbox = new WebInspector.CheckboxFilterUI("hide-collected-promises", WebInspector.UIString("Hide collected promises"), true, this._hideCollectedPromisesSetting);
- hideCollectedCheckbox.addEventListener(WebInspector.FilterUI.Events.FilterChanged, this._onFilterChanged, this);
- this._filterBar.addFilter(hideCollectedCheckbox);
- },
-
- /**
- * @param {!WebInspector.PromiseDetails} details
- * @param {!WebInspector.DataGridNode} node
- * @return {boolean}
- */
- _shouldBeVisible: function(details, node)
- {
- if (!this._statusFilterUI.accept(details.status))
- return false;
-
- if (this._hideCollectedPromisesSetting.get() && details.isGarbageCollected)
- return false;
-
- var regex = this._textFilterUI.regex();
- if (!regex)
- return true;
-
- var text = node.dataTextForSearch();
- regex.lastIndex = 0;
- return regex.test(text);
- },
-
- _onFilterChanged: function()
- {
- if (this._filterChangedTimeout)
- clearTimeout(this._filterChangedTimeout);
- this._filterChangedTimeout = setTimeout(onTimerFired.bind(this), 100);
-
- /**
- * @this {WebInspector.PromisePane}
- */
- function onTimerFired()
- {
- delete this._filterChangedTimeout;
- this._refresh();
- }
- },
-
- /**
- * @override
- * @return {!Array.<!Element>}
- */
- elementsToRestoreScrollPositionsFor: function()
- {
- return [this._dataGrid.scrollContainer];
- },
-
- /**
- * @override
- * @param {!WebInspector.Target} target
- */
- targetAdded: function(target)
- {
- var debuggerModel = WebInspector.DebuggerModel.fromTarget(target);
- if (debuggerModel && this._enabled)
- this._enablePromiseTracker(debuggerModel);
- },
-
- /**
- * @override
- * @param {!WebInspector.Target} target
- */
- targetRemoved: function(target)
- {
- var debuggerModel = WebInspector.DebuggerModel.fromTarget(target);
- if (!debuggerModel)
- return;
- this._promiseDetailsByDebuggerModel.delete(debuggerModel);
- if (this._debuggerModel === debuggerModel) {
- this._clear();
- delete this._debuggerModel;
- }
- },
-
- /**
- * @param {!WebInspector.Event} event
- */
- _targetChanged: function(event)
- {
- if (!this._enabled)
- return;
- var target = /** @type {!WebInspector.Target} */ (event.data);
- var debuggerModel = WebInspector.DebuggerModel.fromTarget(target);
- if (!debuggerModel || this._debuggerModel === debuggerModel)
- return;
- this._debuggerModel = debuggerModel;
- this._refresh();
- },
-
- /**
- * @param {!WebInspector.Event} event
- */
- _mainFrameNavigated: function(event)
- {
- var frame = /** @type {!WebInspector.ResourceTreeFrame} */ (event.data);
- var target = frame.target();
- var debuggerModel = WebInspector.DebuggerModel.fromTarget(target);
- if (!debuggerModel)
- return;
- this._promiseDetailsByDebuggerModel.delete(debuggerModel);
- if (this._debuggerModel === debuggerModel)
- this._clear();
- },
-
- /** @override */
- wasShown: function()
- {
- // Auto enable upon the very first show.
- if (typeof this._enabled === "undefined") {
- var target = WebInspector.context.flavor(WebInspector.Target);
- this._debuggerModel = WebInspector.DebuggerModel.fromTarget(target);
- this._updateRecordingState(true);
- }
- if (this._refreshIsNeeded)
- this._refresh();
- },
-
- /**
- * @param {!WebInspector.DebuggerModel} debuggerModel
- */
- _enablePromiseTracker: function(debuggerModel)
- {
- debuggerModel.enablePromiseTracker(true);
- },
-
- /**
- * @param {!WebInspector.DebuggerModel} debuggerModel
- */
- _disablePromiseTracker: function(debuggerModel)
- {
- debuggerModel.disablePromiseTracker();
- },
-
- /** @override */
- willHide: function()
- {
- this._hidePopover();
- },
-
- _hidePopover: function()
- {
- this._popoverHelper.hidePopover();
- },
-
- _recordButtonClicked: function()
- {
- this._updateRecordingState(!this._recordButton.toggled());
- },
-
- /**
- * @param {boolean} enabled
- */
- _updateRecordingState: function(enabled)
- {
- this._enabled = enabled;
- this._recordButton.setToggled(this._enabled);
- this._recordButton.setTitle(this._enabled ? WebInspector.UIString("Stop Recording Promises Log") : WebInspector.UIString("Record Promises Log"));
- WebInspector.DebuggerModel.instances().forEach(this._enabled ? this._enablePromiseTracker : this._disablePromiseTracker, this);
- },
-
- _clearButtonClicked: function()
- {
- this._clear();
- if (this._debuggerModel)
- this._promiseDetailsByDebuggerModel.delete(this._debuggerModel);
- },
-
- _resetFilters: function()
- {
- this._hideCollectedPromisesSetting.set(false);
- this._promiseStatusFiltersSetting.set({});
- this._textFilterUI.setValue("");
- },
-
- _updateFilterStatus: function()
- {
- this._filterStatusTextElement.textContent = WebInspector.UIString(this._hiddenByFilterCount === 1 ? "%d promise is hidden by filters." : "%d promises are hidden by filters.", this._hiddenByFilterCount);
- this._filterStatusMessageElement.classList.toggle("hidden", !this._hiddenByFilterCount);
- },
-
- _garbageCollectButtonClicked: function()
- {
- var targets = WebInspector.targetManager.targets();
- for (var i = 0; i < targets.length; ++i)
- targets[i].heapProfilerAgent().collectGarbage();
- },
-
- /**
- * @param {!WebInspector.DebuggerModel} debuggerModel
- * @return {boolean}
- */
- _truncateLogIfNeeded: function(debuggerModel)
- {
- var promiseIdToDetails = this._promiseDetailsByDebuggerModel.get(debuggerModel);
- if (!promiseIdToDetails || promiseIdToDetails.size <= WebInspector.PromisePane._maxPromiseCount)
- return false;
-
- var elementsToTruncate = WebInspector.PromisePane._maxPromiseCount / 10;
- var sortedDetails = promiseIdToDetails.valuesArray().sort(compare);
- for (var i = 0; i < elementsToTruncate; ++i)
- promiseIdToDetails.delete(sortedDetails[i].id);
- return true;
-
- /**
- * @param {!WebInspector.PromiseDetails} x
- * @param {!WebInspector.PromiseDetails} y
- * @return {number}
- */
- function compare(x, y)
- {
- var t1 = x.creationTime || 0;
- var t2 = y.creationTime || 0;
- return t1 - t2 || x.id - y.id;
- }
- },
-
- /**
- * @param {!WebInspector.Event} event
- */
- _onPromiseUpdated: function(event)
- {
- var debuggerModel = /** @type {!WebInspector.DebuggerModel} */ (event.target);
- var eventType = /** @type {string} */ (event.data.eventType);
- var protocolDetails = /** @type {!DebuggerAgent.PromiseDetails} */ (event.data.promise);
-
- var promiseIdToDetails = this._promiseDetailsByDebuggerModel.get(debuggerModel);
- if (!promiseIdToDetails) {
- promiseIdToDetails = new Map();
- this._promiseDetailsByDebuggerModel.set(debuggerModel, promiseIdToDetails);
- }
-
- var details = promiseIdToDetails.get(protocolDetails.id);
- if (!details && eventType === "gc")
- return;
-
- var truncated = this._truncateLogIfNeeded(debuggerModel);
- if (details)
- details.update(protocolDetails)
- else
- details = new WebInspector.PromiseDetails(protocolDetails);
- promiseIdToDetails.set(details.id, details);
-
- if (eventType === "gc")
- details.isGarbageCollected = true;
-
- if (debuggerModel === this._debuggerModel) {
- if (!this.isShowing()) {
- this._refreshIsNeeded = true;
- return;
- }
- if (truncated || this._refreshIsNeeded) {
- this._refresh();
- return;
- }
-
- var node = /** @type {!WebInspector.DataGridNode} */ (this._promiseIdToNode.get(details.id));
- var wasVisible = !node || !node._isPromiseHidden;
-
- // Check for the fast path on GC events.
- if (eventType === "gc" && node && node.parent && !this._hideCollectedPromisesSetting.get())
- node.update(details);
- else
- this._attachDataGridNode(details);
-
- var isVisible = this._shouldBeVisible(details, /** @type {!WebInspector.DataGridNode} */(this._promiseIdToNode.get(details.id)));
- if (wasVisible !== isVisible) {
- this._hiddenByFilterCount += wasVisible ? 1 : -1;
- this._updateFilterStatus();
- }
- }
- },
-
- /**
- * @param {!WebInspector.PromiseDetails} details
- */
- _attachDataGridNode: function(details)
- {
- var node = this._createDataGridNode(details);
- var parentNode = this._findVisibleParentNodeDetails(details);
- if (parentNode !== node.parent)
- parentNode.appendChild(node);
- if (this._shouldBeVisible(details, node))
- parentNode.expanded = true;
- else
- node.remove();
- },
-
- /**
- * @param {!WebInspector.PromiseDetails} details
- * @return {!WebInspector.DataGridNode}
- */
- _findVisibleParentNodeDetails: function(details)
- {
- var promiseIdToDetails = /** @type {!Map.<number, !WebInspector.PromiseDetails>} */ (this._promiseDetailsByDebuggerModel.get(this._debuggerModel));
- var currentDetails = details;
- while (currentDetails) {
- var parentId = currentDetails.parentId;
- if (typeof parentId !== "number")
- break;
- currentDetails = promiseIdToDetails.get(parentId);
- if (!currentDetails)
- break;
- var node = this._promiseIdToNode.get(currentDetails.id);
- if (node && this._shouldBeVisible(currentDetails, node))
- return node;
- }
- return this._dataGrid.rootNode();
- },
-
- /**
- * @param {!WebInspector.PromiseDetails} details
- * @return {!WebInspector.DataGridNode}
- */
- _createDataGridNode: function(details)
- {
- var node = this._promiseIdToNode.get(details.id);
- if (!node) {
- node = new WebInspector.PromiseDataGridNode(details, this._debuggerModel, this._linkifier, this._dataGrid);
- this._promiseIdToNode.set(details.id, node);
- } else {
- node.update(details);
- }
- return node;
- },
-
- _refresh: function()
- {
- delete this._refreshIsNeeded;
- this._clear();
- if (!this._debuggerModel)
- return;
- if (!this._promiseDetailsByDebuggerModel.has(this._debuggerModel))
- return;
-
- var rootNode = this._dataGrid.rootNode();
- var promiseIdToDetails = /** @type {!Map.<number, !WebInspector.PromiseDetails>} */ (this._promiseDetailsByDebuggerModel.get(this._debuggerModel));
-
- var nodesToInsert = { __proto__: null };
- // The for..of loop iterates in insertion order.
- for (var pair of promiseIdToDetails) {
- var id = /** @type {number} */ (pair[0]);
- var details = /** @type {!WebInspector.PromiseDetails} */ (pair[1]);
- var node = this._createDataGridNode(details);
- node._isPromiseHidden = !this._shouldBeVisible(details, node);
- if (node._isPromiseHidden) {
- ++this._hiddenByFilterCount;
- continue;
- }
- nodesToInsert[id] = { details: details, node: node };
- }
-
- for (var id in nodesToInsert) {
- var node = nodesToInsert[id].node;
- var details = nodesToInsert[id].details;
- this._findVisibleParentNodeDetails(details).appendChild(node);
- }
-
- for (var id in nodesToInsert) {
- var node = nodesToInsert[id].node;
- var details = nodesToInsert[id].details;
- node.expanded = true;
- }
-
- this._updateFilterStatus();
- },
-
- _clear: function()
- {
- this._hiddenByFilterCount = 0;
- this._updateFilterStatus();
- this._promiseIdToNode.clear();
- this._hidePopover();
- this._dataGrid.rootNode().removeChildren();
- this._linkifier.reset();
- },
-
- /**
- * @param {!WebInspector.ContextMenu} contextMenu
- * @param {!WebInspector.DataGridNode} node
- */
- _onContextMenu: function(contextMenu, node)
- {
- var debuggerModel = this._debuggerModel;
- if (!debuggerModel)
- return;
-
- var promiseId = node.promiseId();
- if (this._promiseDetailsByDebuggerModel.has(debuggerModel)) {
- var details = this._promiseDetailsByDebuggerModel.get(debuggerModel).get(promiseId);
- if (details.isGarbageCollected)
- return;
- }
-
- contextMenu.appendItem(WebInspector.UIString.capitalize("Show in ^console"), showPromiseInConsole);
- contextMenu.show();
-
- function showPromiseInConsole()
- {
- debuggerModel.getPromiseById(promiseId, "console", didGetPromiseById);
- }
-
- /**
- * @param {?RuntimeAgent.RemoteObject} promise
- */
- function didGetPromiseById(promise)
- {
- if (!promise)
- return;
- var object = debuggerModel.target().runtimeModel.createRemoteObject(promise);
- object.callFunction(dumpIntoConsole);
- object.release();
- /**
- * @suppressReceiverCheck
- * @this {Object}
- */
- function dumpIntoConsole()
- {
- console.log(this);
- }
- WebInspector.console.show();
- }
- },
-
- /**
- * @param {!Element} element
- * @param {!Event} event
- * @return {!Element|!AnchorBox|undefined}
- */
- _getPopoverAnchor: function(element, event)
- {
- if (!this._debuggerModel || !this._promiseDetailsByDebuggerModel.has(this._debuggerModel))
- return undefined;
- var node = this._dataGrid.dataGridNodeFromNode(element);
- if (!node)
- return undefined;
- var details = this._promiseDetailsByDebuggerModel.get(this._debuggerModel).get(node.promiseId());
- if (!details)
- return undefined;
- var anchor = element.enclosingNodeOrSelfWithClass("created-column");
- if (anchor)
- return details.creationStack ? anchor : undefined;
- anchor = element.enclosingNodeOrSelfWithClass("settled-column");
- return (anchor && details.settlementStack) ? anchor : undefined;
- },
-
- /**
- * @param {!Element} anchor
- * @param {!WebInspector.Popover} popover
- */
- _showPopover: function(anchor, popover)
- {
- var node = this._dataGrid.dataGridNodeFromNode(anchor);
- var details = this._promiseDetailsByDebuggerModel.get(this._debuggerModel).get(node.promiseId());
-
- var stackTrace;
- if (anchor.classList.contains("created-column"))
- stackTrace = details.creationStack;
- else
- stackTrace = details.settlementStack;
-
- var content = WebInspector.DOMPresentationUtils.buildStackTracePreviewContents(this._debuggerModel.target(), this._linkifier, stackTrace);
- popover.setCanShrink(true);
- popover.showForAnchor(content, anchor);
- },
-
- __proto__: WebInspector.VBox.prototype
-}
-
-/**
- * @constructor
- * @extends {WebInspector.ViewportDataGridNode}
- * @param {!WebInspector.PromiseDetails} details
- * @param {!WebInspector.DebuggerModel} debuggerModel
- * @param {!WebInspector.Linkifier} linkifier
- * @param {!WebInspector.ViewportDataGrid} dataGrid
- */
-WebInspector.PromiseDataGridNode = function(details, debuggerModel, linkifier, dataGrid)
-{
- WebInspector.ViewportDataGridNode.call(this, {});
- this._details = details;
- this._debuggerModel = debuggerModel;
- this._linkifier = linkifier;
- /** @type {!Array.<!Element>} */
- this._linkifiedAnchors = [];
- this.dataGrid = dataGrid;
-}
-
-WebInspector.PromiseDataGridNode.prototype = {
- _disposeAnchors: function()
- {
- for (var i = 0; i < this._linkifiedAnchors.length; ++i)
- this._linkifier.disposeAnchor(this._debuggerModel.target(), this._linkifiedAnchors[i]);
- this._linkifiedAnchors = [];
- },
-
- /**
- * @param {!WebInspector.PromiseDetails} details
- */
- update: function(details)
- {
- this._disposeAnchors();
- this._details = details;
- this.refresh();
- },
-
- /**
- * @override
- */
- wasDetached: function()
- {
- this._disposeAnchors();
- },
-
- /**
- * @override
- * @return {number}
- */
- nodeSelfHeight: function()
- {
- return 24;
- },
-
- /**
- * @return {number}
- */
- promiseId: function()
- {
- return this._details.id;
- },
-
- /**
- * @override
- */
- createCells: function()
- {
- this._element.classList.toggle("promise-gc", !!this._details.isGarbageCollected);
- WebInspector.ViewportDataGridNode.prototype.createCells.call(this);
- },
-
- /**
- * @param {!Element} cell
- * @param {?RuntimeAgent.CallFrame=} callFrame
- */
- _appendCallFrameAnchor: function(cell, callFrame)
- {
- if (!callFrame)
- return;
- var anchor = this._linkifier.linkifyConsoleCallFrame(this._debuggerModel.target(), callFrame);
- this._linkifiedAnchors.push(anchor);
- cell.appendChild(anchor);
- },
-
- /**
- * @override
- * @param {string} columnIdentifier
- * @return {!Element}
- */
- createCell: function(columnIdentifier)
- {
- var cell = this.createTD(columnIdentifier);
- var details = this._details;
-
- switch (columnIdentifier) {
- case "status":
- var title = "";
- switch (details.status) {
- case "pending":
- title = WebInspector.UIString("Pending");
- break;
- case "resolved":
- title = WebInspector.UIString("Fulfilled");
- break;
- case "rejected":
- title = WebInspector.UIString("Rejected");
- break;
- }
- if (details.isGarbageCollected)
- title += " " + WebInspector.UIString("(garbage collected)");
- cell.createChild("div", "status " + details.status).title = title;
- break;
-
- case "function":
- cell.createTextChild(WebInspector.beautifyFunctionName(details.callFrame ? details.callFrame.functionName : ""));
- break;
-
- case "created":
- this._appendCallFrameAnchor(cell, details.callFrame);
- break;
-
- case "settled":
- this._appendCallFrameAnchor(cell, details.settlementStack && details.settlementStack.callFrames.length ? details.settlementStack.callFrames[0] : null);
- break;
-
- case "tts":
- cell.createTextChild(this._ttsCellText());
- break;
- }
-
- return cell;
- },
-
- /**
- * @return {string}
- */
- _ttsCellText: function()
- {
- var details = this._details;
- if (details.creationTime && details.settlementTime && details.settlementTime >= details.creationTime)
- return Number.millisToString(details.settlementTime - details.creationTime);
- return "";
- },
-
- /**
- * @param {?RuntimeAgent.CallFrame=} callFrame
- * @return {string}
- */
- _callFrameAnchorTextForSearch: function(callFrame)
- {
- if (!callFrame)
- return "";
- var script = callFrame.scriptId && this._debuggerModel ? this._debuggerModel.scriptForId(callFrame.scriptId) : null;
- var sourceURL = script ? script.sourceURL : callFrame.url;
- var lineNumber = callFrame.lineNumber || 0;
- return WebInspector.displayNameForURL(sourceURL) + ":" + lineNumber;
- },
-
- /**
- * @return {string}
- */
- dataTextForSearch: function()
- {
- var details = this._details;
- var texts = [
- WebInspector.beautifyFunctionName(details.callFrame ? details.callFrame.functionName : ""),
- this._callFrameAnchorTextForSearch(details.callFrame),
- this._callFrameAnchorTextForSearch(details.settlementStack && details.settlementStack.callFrames.length ? details.settlementStack.callFrames[0] : null),
- this._ttsCellText().replace(/\u2009/g, " ") // \u2009 is a thin space.
- ];
- return texts.join(" ");
- },
-
- __proto__: WebInspector.ViewportDataGridNode.prototype
-}
diff --git a/third_party/WebKit/Source/devtools/front_end/promises/module.json b/third_party/WebKit/Source/devtools/front_end/promises/module.json
deleted file mode 100644
index 520e4f6..0000000
--- a/third_party/WebKit/Source/devtools/front_end/promises/module.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "extensions": [
- {
- "type": "drawer-view",
- "name": "promises",
- "title": "Promises",
- "order": 30,
- "persistence": "permanent",
- "className": "WebInspector.PromisePane"
- }
- ],
- "dependencies": ["components", "ui_lazy"],
- "experiment": "promiseTracker",
- "scripts": [
- "PromisePane.js"
- ],
- "resources": [
- "promisePane.css"
- ]
-}
diff --git a/third_party/WebKit/Source/devtools/front_end/promises/promisePane.css b/third_party/WebKit/Source/devtools/front_end/promises/promisePane.css
deleted file mode 100644
index 55a61a69..0000000
--- a/third_party/WebKit/Source/devtools/front_end/promises/promisePane.css
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright 2014 The Chromium Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-.promises .data-grid {
- border: none;
- flex: 1 1;
-}
-
-.promises > .toolbar {
- border-bottom: 1px solid #dadada;
-}
-
-.promises .promise-gc {
- opacity: 0.6;
-}
-
-.promises .data-grid th:hover {
- background-color: inherit !important;
-}
-
-.promises .data-grid .odd {
- background-color: #eee;
-}
-
-.promises .data-grid .header-container {
- height: 30px;
-}
-
-.promises .data-grid .data-container {
- top: 29px;
-}
-
-.promises .data-grid table.data {
- background: transparent;
-}
-
-.promises .data-grid th {
- background-color: white;
-}
-
-.promises .data-grid td {
- line-height: 17px;
- height: 24px;
- vertical-align: middle;
-}
-
-.promises .data-grid th,
-.promises .data-grid td {
- border-bottom: 1px solid rgb(205, 205, 205);
- border-left: 1px solid rgb(205, 205, 205);
-}
-
-.promises .status {
- -webkit-mask-image: url(Images/toolbarButtonGlyphs.png);
- -webkit-mask-size: 352px 168px;
- -webkit-mask-position: -294px -26px;
- background-color: #bbb;
- height: 20px;
- width: 20px;
-}
-
-@media (-webkit-min-device-pixel-ratio: 1.5) {
-.promises .status {
- -webkit-mask-image: url(Images/toolbarButtonGlyphs_2x.png);
-}
-} /* media */
-
-.promises .status.rejected {
- background-color: rgb(216, 0, 0);
-}
-
-.promises .status.resolved {
- background-color: #696;
-}
-
-.promises-filters-header {
- flex: 0 0 23px;
- overflow: hidden;
-}
-
-.promises-filter-status {
- flex: 0 0 23px;
- padding-left: 18px;
- color: rgb(128, 128, 128);
- font-style: italic;
-}
-.promises-filter-status .link:hover {
- color: rgb(15%, 15%, 15%);
-}
-.promises-filter-status .link {
- color: rgb(33%, 33%, 33%);
-}
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js
index 3c65ab3..491729e 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js
@@ -89,8 +89,7 @@ WebInspector.DebuggerModel.Events = {
FailedToParseScriptSource: "FailedToParseScriptSource",
GlobalObjectCleared: "GlobalObjectCleared",
CallFrameSelected: "CallFrameSelected",
- ConsoleCommandEvaluatedInSelectedCallFrame: "ConsoleCommandEvaluatedInSelectedCallFrame",
- PromiseUpdated: "PromiseUpdated",
+ ConsoleCommandEvaluatedInSelectedCallFrame: "ConsoleCommandEvaluatedInSelectedCallFrame"
}
/** @enum {string} */
@@ -351,43 +350,6 @@ WebInspector.DebuggerModel.prototype = {
}
},
- /**
- * @param {boolean} captureStacks
- */
- enablePromiseTracker: function(captureStacks)
- {
- this._agent.enablePromiseTracker(captureStacks);
- },
-
- disablePromiseTracker: function()
- {
- this._agent.disablePromiseTracker();
- },
-
- /**
- * @param {number} promiseId
- * @param {string=} objectGroup
- * @param {function(?RuntimeAgent.RemoteObject)=} callback
- */
- getPromiseById: function(promiseId, objectGroup, callback)
- {
- this._agent.getPromiseById(promiseId, objectGroup, innerCallback);
-
- /**
- * @param {?Protocol.Error} error
- * @param {?RuntimeAgent.RemoteObject} promise
- */
- function innerCallback(error, promise)
- {
- if (error) {
- console.error(error);
- callback(null);
- return;
- }
- callback(promise);
- }
- },
-
flushAsyncOperationEvents: function()
{
this._agent.flushAsyncOperationEvents();
@@ -427,15 +389,6 @@ WebInspector.DebuggerModel.prototype = {
},
/**
- * @param {string} eventType
- * @param {!DebuggerAgent.PromiseDetails} promise
- */
- _promiseUpdated: function(eventType, promise)
- {
- this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.PromiseUpdated, { eventType: eventType, promise: promise });
- },
-
- /**
* @param {!DebuggerAgent.AsyncOperation} operation
*/
_asyncOperationStarted: function(operation)
@@ -1025,16 +978,6 @@ WebInspector.DebuggerDispatcher.prototype = {
/**
* @override
- * @param {string} eventType
- * @param {!DebuggerAgent.PromiseDetails} promise
- */
- promiseUpdated: function(eventType, promise)
- {
- this._debuggerModel._promiseUpdated(eventType, promise);
- },
-
- /**
- * @override
* @param {!DebuggerAgent.AsyncOperation} operation
*/
asyncOperationStarted: function(operation)
diff --git a/third_party/WebKit/Source/devtools/protocol.json b/third_party/WebKit/Source/devtools/protocol.json
index 9462985..c0e06c5 100644
--- a/third_party/WebKit/Source/devtools/protocol.json
+++ b/third_party/WebKit/Source/devtools/protocol.json
@@ -3455,21 +3455,6 @@
"hidden": true
},
{
- "id": "PromiseDetails",
- "type": "object",
- "description": "Information about the promise. All fields but id are optional and if present they reflect the new state of the property on the promise with given id.",
- "properties": [
- { "name": "id", "type": "integer", "description": "Unique id of the promise." },
- { "name": "status", "type": "string", "optional": true, "enum": ["pending", "resolved", "rejected"], "description": "Status of the promise." },
- { "name": "parentId", "type": "integer", "optional": true, "description": "Id of the parent promise." },
- { "name": "creationTime", "type": "number", "optional": true, "description": "Creation time of the promise." },
- { "name": "settlementTime", "type": "number", "optional": true, "description": "Settlement time of the promise." },
- { "name": "creationStack", "$ref": "Runtime.StackTrace", "optional": true, "description": "JavaScript stack trace on promise creation." },
- { "name": "settlementStack", "$ref": "Runtime.StackTrace", "optional": true, "description": "JavaScript stack trace on promise settlement." }
- ],
- "hidden": true
- },
- {
"id": "AsyncOperation",
"type": "object",
"description": "Information about the async operation.",
@@ -3725,31 +3710,6 @@
"description": "Enables or disables async call stacks tracking."
},
{
- "name": "enablePromiseTracker",
- "parameters": [
- { "name": "captureStacks", "type": "boolean", "optional": true, "description": "Whether to capture stack traces for promise creation and settlement events (default: false)." }
- ],
- "hidden": true,
- "description": "Enables promise tracking, information about <code>Promise</code>s created or updated will now be stored on the backend."
- },
- {
- "name": "disablePromiseTracker",
- "hidden": true,
- "description": "Disables promise tracking."
- },
- {
- "name": "getPromiseById",
- "parameters": [
- { "name": "promiseId", "type": "integer" },
- { "name": "objectGroup", "type": "string", "optional": true, "description": "Symbolic group name that can be used to release multiple objects." }
- ],
- "returns": [
- { "name": "promise", "$ref": "Runtime.RemoteObject", "description": "Object wrapper for <code>Promise</code> with specified ID, if any." }
- ],
- "hidden": true,
- "description": "Returns <code>Promise</code> with specified ID."
- },
- {
"name": "flushAsyncOperationEvents",
"hidden": true,
"description": "Fires pending <code>asyncOperationStarted</code> events (if any), as if a debugger stepping session has just been started."
@@ -3844,15 +3804,6 @@
"description": "Fired when the virtual machine resumed execution."
},
{
- "name": "promiseUpdated",
- "parameters": [
- { "name": "eventType", "type": "string", "enum": ["new", "update", "gc"], "description": "Type of the event." },
- { "name": "promise", "$ref": "PromiseDetails", "description": "Information about the updated <code>Promise</code>." }
- ],
- "description": "Fired when a <code>Promise</code> is created, updated or garbage collected.",
- "hidden": true
- },
- {
"name": "asyncOperationStarted",
"parameters": [
{ "name": "operation", "$ref": "AsyncOperation", "description": "Information about the async operation." }
diff --git a/third_party/WebKit/Source/platform/blink_platform.gypi b/third_party/WebKit/Source/platform/blink_platform.gypi
index 5cf2090..69e2e4d 100644
--- a/third_party/WebKit/Source/platform/blink_platform.gypi
+++ b/third_party/WebKit/Source/platform/blink_platform.gypi
@@ -1049,8 +1049,6 @@
'v8_inspector/InjectedScriptManager.h',
'v8_inspector/JavaScriptCallFrame.cpp',
'v8_inspector/JavaScriptCallFrame.h',
- 'v8_inspector/PromiseTracker.cpp',
- 'v8_inspector/PromiseTracker.h',
'v8_inspector/ScriptBreakpoint.h',
'v8_inspector/RemoteObjectId.cpp',
'v8_inspector/RemoteObjectId.h',
diff --git a/third_party/WebKit/Source/platform/v8_inspector/DebuggerScript.js b/third_party/WebKit/Source/platform/v8_inspector/DebuggerScript.js
index 866c120..7d8c166 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/DebuggerScript.js
+++ b/third_party/WebKit/Source/platform/v8_inspector/DebuggerScript.js
@@ -573,15 +573,6 @@ DebuggerScript._buildScopeObject = function(scopeType, scopeObject)
return result;
}
-DebuggerScript.getPromiseDetails = function(eventData)
-{
- return {
- "promise": eventData.promise().value(),
- "parentPromise": eventData.parentPromise().value(),
- "status": eventData.status()
- };
-}
-
// We never resolve Mirror by its handle so to avoid memory leaks caused by Mirrors in the cache we disable it.
ToggleMirrorCache(false);
diff --git a/third_party/WebKit/Source/platform/v8_inspector/PromiseTracker.cpp b/third_party/WebKit/Source/platform/v8_inspector/PromiseTracker.cpp
deleted file mode 100644
index 96ad587..0000000
--- a/third_party/WebKit/Source/platform/v8_inspector/PromiseTracker.cpp
+++ /dev/null
@@ -1,160 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "platform/v8_inspector/PromiseTracker.h"
-
-#include "platform/inspector_protocol/String16.h"
-#include "platform/v8_inspector/V8DebuggerAgentImpl.h"
-#include "platform/v8_inspector/V8StackTraceImpl.h"
-#include "platform/v8_inspector/public/V8DebuggerClient.h"
-#include "wtf/PassOwnPtr.h"
-
-using namespace blink::protocol;
-
-namespace blink {
-
-class PromiseTracker::PromiseWrapper {
-public:
- PromiseWrapper(PromiseTracker* tracker, int id, v8::Local<v8::Object> promise)
- : m_tracker(tracker)
- , m_id(id)
- , m_promise(tracker->m_isolate, promise) { }
-
- ~PromiseWrapper()
- {
- OwnPtr<Debugger::PromiseDetails> promiseDetails = Debugger::PromiseDetails::create().setId(m_id).build();
- m_tracker->m_agent->didUpdatePromise(Debugger::PromiseUpdated::EventTypeEnum::Gc, promiseDetails.release());
- }
-
-private:
- friend class PromiseTracker;
-
- PromiseTracker* m_tracker;
- int m_id;
- v8::Global<v8::Object> m_promise;
-};
-
-PromiseTracker::PromiseTracker(V8DebuggerAgentImpl* agent, v8::Isolate* isolate)
- : m_circularSequentialId(0)
- , m_isEnabled(false)
- , m_captureStacks(false)
- , m_agent(agent)
- , m_isolate(isolate)
-{
- clear();
-}
-
-PromiseTracker::~PromiseTracker()
-{
-}
-
-void PromiseTracker::setEnabled(bool enabled, bool captureStacks)
-{
- m_isEnabled = enabled;
- m_captureStacks = captureStacks;
- if (!enabled)
- clear();
-}
-
-void PromiseTracker::clear()
-{
- v8::HandleScope scope(m_isolate);
- m_promiseToId.Reset(m_isolate, v8::NativeWeakMap::New(m_isolate));
- m_idToPromise.clear();
-}
-
-int PromiseTracker::circularSequentialId()
-{
- ++m_circularSequentialId;
- if (m_circularSequentialId <= 0)
- m_circularSequentialId = 1;
- return m_circularSequentialId;
-}
-
-void PromiseTracker::weakCallback(const v8::WeakCallbackInfo<PromiseWrapper>& data)
-{
- PromiseWrapper* wrapper = data.GetParameter();
- wrapper->m_tracker->m_idToPromise.remove(wrapper->m_id);
-}
-
-void PromiseTracker::promiseCollected(int id)
-{
-}
-
-int PromiseTracker::promiseId(v8::Local<v8::Object> promise, bool* isNewPromise)
-{
- v8::HandleScope scope(m_isolate);
- v8::Local<v8::NativeWeakMap> map = v8::Local<v8::NativeWeakMap>::New(m_isolate, m_promiseToId);
- v8::Local<v8::Value> value = map->Get(promise);
- if (value->IsInt32()) {
- *isNewPromise = false;
- return value.As<v8::Int32>()->Value();
- }
- *isNewPromise = true;
- int id = circularSequentialId();
- map->Set(promise, v8::Int32::New(m_isolate, id));
-
- OwnPtr<PromiseWrapper> wrapper = adoptPtr(new PromiseWrapper(this, id, promise));
- wrapper->m_promise.SetWeak(wrapper.get(), weakCallback, v8::WeakCallbackType::kParameter);
- m_idToPromise.set(id, wrapper.release());
- return id;
-}
-
-void PromiseTracker::didReceiveV8PromiseEvent(v8::Local<v8::Context> context, v8::Local<v8::Object> promise, v8::Local<v8::Value> parentPromise, int status)
-{
- ASSERT(isEnabled());
- ASSERT(!context.IsEmpty());
-
- bool isNewPromise = false;
- int id = promiseId(promise, &isNewPromise);
-
- blink::protocol::String16 eventType = isNewPromise ? Debugger::PromiseUpdated::EventTypeEnum::New : Debugger::PromiseUpdated::EventTypeEnum::Update;
-
- blink::protocol::String16 promiseStatus;
- switch (status) {
- case 0:
- promiseStatus = Debugger::PromiseDetails::StatusEnum::Pending;
- break;
- case 1:
- promiseStatus = Debugger::PromiseDetails::StatusEnum::Resolved;
- break;
- default:
- promiseStatus = Debugger::PromiseDetails::StatusEnum::Rejected;
- };
- OwnPtr<Debugger::PromiseDetails> promiseDetails = Debugger::PromiseDetails::create().setId(id).setStatus(promiseStatus).build();
-
- if (!parentPromise.IsEmpty() && parentPromise->IsObject()) {
- v8::Local<v8::Object> handle = parentPromise->ToObject(context->GetIsolate());
- bool parentIsNewPromise = false;
- int parentPromiseId = promiseId(handle, &parentIsNewPromise);
- promiseDetails->setParentId(parentPromiseId);
- } else {
- if (!status) {
- if (isNewPromise) {
- promiseDetails->setCreationTime(m_agent->debugger().client()->currentTimeMS());
- OwnPtr<V8StackTraceImpl> stack = V8StackTraceImpl::capture(m_agent, m_captureStacks ? V8StackTraceImpl::maxCallStackSizeToCapture : 1);
- if (stack)
- promiseDetails->setCreationStack(stack->buildInspectorObject());
- }
- } else {
- promiseDetails->setSettlementTime(m_agent->debugger().client()->currentTimeMS());
- if (m_captureStacks) {
- OwnPtr<V8StackTraceImpl> stack = V8StackTraceImpl::capture(m_agent, V8StackTrace::maxCallStackSizeToCapture);
- if (stack)
- promiseDetails->setSettlementStack(stack->buildInspectorObject());
- }
- }
- }
-
- m_agent->didUpdatePromise(eventType, promiseDetails.release());
-}
-
-v8::Local<v8::Object> PromiseTracker::promiseById(int promiseId)
-{
- ASSERT(isEnabled());
- PromiseWrapper* wrapper = m_idToPromise.get(promiseId);
- return wrapper ? wrapper->m_promise.Get(m_isolate) : v8::Local<v8::Object>();
-}
-
-} // namespace blink
diff --git a/third_party/WebKit/Source/platform/v8_inspector/PromiseTracker.h b/third_party/WebKit/Source/platform/v8_inspector/PromiseTracker.h
deleted file mode 100644
index 067e05f..0000000
--- a/third_party/WebKit/Source/platform/v8_inspector/PromiseTracker.h
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef PromiseTracker_h
-#define PromiseTracker_h
-
-#include "platform/inspector_protocol/Allocator.h"
-#include "platform/inspector_protocol/Collections.h"
-#include "platform/inspector_protocol/Frontend.h"
-#include "platform/inspector_protocol/TypeBuilder.h"
-#include "wtf/PassOwnPtr.h"
-#include <v8.h>
-
-namespace blink {
-
-class V8DebuggerAgentImpl;
-
-class PromiseTracker final {
- PROTOCOL_DISALLOW_COPY(PromiseTracker);
-public:
- static PassOwnPtr<PromiseTracker> create(V8DebuggerAgentImpl* agent, v8::Isolate* isolate)
- {
- return adoptPtr(new PromiseTracker(agent, isolate));
- }
-
- ~PromiseTracker();
-
- bool isEnabled() const { return m_isEnabled; }
- void setEnabled(bool enabled, bool captureStacks);
- void clear();
- void didReceiveV8PromiseEvent(v8::Local<v8::Context>, v8::Local<v8::Object> promise, v8::Local<v8::Value> parentPromise, int status);
- v8::Local<v8::Object> promiseById(int promiseId);
-
-private:
- class PromiseWrapper;
- static void weakCallback(const v8::WeakCallbackInfo<PromiseWrapper>& data);
-
- PromiseTracker(V8DebuggerAgentImpl*, v8::Isolate*);
-
- int circularSequentialId();
- int promiseId(v8::Local<v8::Object> promise, bool* isNewPromise);
- void promiseCollected(int id);
-
- int m_circularSequentialId;
- bool m_isEnabled;
- bool m_captureStacks;
- V8DebuggerAgentImpl* m_agent;
-
- v8::Isolate* m_isolate;
- v8::Persistent<v8::NativeWeakMap> m_promiseToId;
-
- protocol::HashMap<int, OwnPtr<PromiseWrapper>> m_idToPromise;
-};
-
-} // namespace blink
-
-#endif // !defined(PromiseTracker_h)
diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8DebuggerAgentImpl.cpp b/third_party/WebKit/Source/platform/v8_inspector/V8DebuggerAgentImpl.cpp
index 0ecff62..e4d02ed 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/V8DebuggerAgentImpl.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8DebuggerAgentImpl.cpp
@@ -11,7 +11,6 @@
#include "platform/v8_inspector/InjectedScriptHost.h"
#include "platform/v8_inspector/InjectedScriptManager.h"
#include "platform/v8_inspector/JavaScriptCallFrame.h"
-#include "platform/v8_inspector/PromiseTracker.h"
#include "platform/v8_inspector/RemoteObjectId.h"
#include "platform/v8_inspector/ScriptBreakpoint.h"
#include "platform/v8_inspector/V8AsyncCallTracker.h"
@@ -33,7 +32,6 @@ using blink::protocol::Debugger::CollectionEntry;
using blink::protocol::Runtime::ExceptionDetails;
using blink::protocol::Debugger::FunctionDetails;
using blink::protocol::Debugger::GeneratorObjectDetails;
-using blink::protocol::Debugger::PromiseDetails;
using blink::protocol::Runtime::ScriptId;
using blink::protocol::Runtime::StackTrace;
using blink::protocol::Runtime::RemoteObject;
@@ -44,8 +42,6 @@ namespace DebuggerAgentState {
static const char javaScriptBreakpoints[] = "javaScriptBreakopints";
static const char pauseOnExceptionsState[] = "pauseOnExceptionsState";
static const char asyncCallStackDepth[] = "asyncCallStackDepth";
-static const char promiseTrackerEnabled[] = "promiseTrackerEnabled";
-static const char promiseTrackerCaptureStacks[] = "promiseTrackerCaptureStacks";
// Breakpoint properties.
static const char url[] = "url";
@@ -196,7 +192,6 @@ V8DebuggerAgentImpl::V8DebuggerAgentImpl(InjectedScriptManager* injectedScriptMa
// FIXME: remove once InjectedScriptManager moves to v8.
m_v8AsyncCallTracker = V8AsyncCallTracker::create(this);
- m_promiseTracker = PromiseTracker::create(this, m_isolate);
clearBreakDetails();
}
@@ -245,8 +240,6 @@ void V8DebuggerAgentImpl::disable(ErrorString*)
m_state->setObject(DebuggerAgentState::javaScriptBreakpoints, protocol::DictionaryValue::create());
m_state->setNumber(DebuggerAgentState::pauseOnExceptionsState, V8DebuggerImpl::DontPauseOnExceptions);
m_state->setNumber(DebuggerAgentState::asyncCallStackDepth, 0);
- m_state->setBoolean(DebuggerAgentState::promiseTrackerEnabled, false);
- m_state->setBoolean(DebuggerAgentState::promiseTrackerCaptureStacks, false);
debugger().removeDebuggerAgent(m_contextGroupId);
m_pausedContext.Reset();
@@ -255,7 +248,6 @@ void V8DebuggerAgentImpl::disable(ErrorString*)
m_blackboxedPositions.clear();
m_breakpointIdToDebuggerBreakpointIds.clear();
internalSetAsyncCallStackDepth(0);
- m_promiseTracker->setEnabled(false, false);
m_continueToLocationBreakpointId = String16();
clearBreakDetails();
m_scheduledDebuggerStep = NoStep;
@@ -310,8 +302,6 @@ void V8DebuggerAgentImpl::restore()
int asyncCallStackDepth = 0;
m_state->getNumber(DebuggerAgentState::asyncCallStackDepth, &asyncCallStackDepth);
internalSetAsyncCallStackDepth(asyncCallStackDepth);
-
- m_promiseTracker->setEnabled(m_state->booleanProperty(DebuggerAgentState::promiseTrackerEnabled, false), m_state->booleanProperty(DebuggerAgentState::promiseTrackerCaptureStacks, false));
}
void V8DebuggerAgentImpl::setBreakpointsActive(ErrorString* errorString, bool active)
@@ -872,17 +862,6 @@ void V8DebuggerAgentImpl::didReceiveV8AsyncTaskEvent(v8::Local<v8::Context> cont
m_v8AsyncCallTracker->didReceiveV8AsyncTaskEvent(context, eventType, eventName, id);
}
-bool V8DebuggerAgentImpl::v8PromiseEventsEnabled() const
-{
- return m_promiseTracker->isEnabled();
-}
-
-void V8DebuggerAgentImpl::didReceiveV8PromiseEvent(v8::Local<v8::Context> context, v8::Local<v8::Object> promise, v8::Local<v8::Value> parentPromise, int status)
-{
- ASSERT(m_promiseTracker->isEnabled());
- m_promiseTracker->didReceiveV8PromiseEvent(context, promise, parentPromise, status);
-}
-
void V8DebuggerAgentImpl::pause(ErrorString* errorString)
{
if (!checkEnabled(errorString))
@@ -1094,48 +1073,6 @@ void V8DebuggerAgentImpl::setAsyncCallStackDepth(ErrorString* errorString, int d
internalSetAsyncCallStackDepth(depth);
}
-void V8DebuggerAgentImpl::enablePromiseTracker(ErrorString* errorString,
- const Maybe<bool>& captureStacks)
-{
- if (!checkEnabled(errorString))
- return;
- m_state->setBoolean(DebuggerAgentState::promiseTrackerEnabled, true);
- m_state->setBoolean(DebuggerAgentState::promiseTrackerCaptureStacks, captureStacks.fromMaybe(false));
- m_promiseTracker->setEnabled(true, captureStacks.fromMaybe(false));
-}
-
-void V8DebuggerAgentImpl::disablePromiseTracker(ErrorString* errorString)
-{
- if (!checkEnabled(errorString))
- return;
- m_state->setBoolean(DebuggerAgentState::promiseTrackerEnabled, false);
- m_promiseTracker->setEnabled(false, false);
-}
-
-void V8DebuggerAgentImpl::getPromiseById(ErrorString* errorString, int promiseId, const Maybe<String16>& objectGroup, OwnPtr<RemoteObject>* promise)
-{
- if (!checkEnabled(errorString))
- return;
- if (!m_promiseTracker->isEnabled()) {
- *errorString = "Promise tracking is disabled";
- return;
- }
- v8::HandleScope handles(m_isolate);
- v8::Local<v8::Object> value = m_promiseTracker->promiseById(promiseId);
- if (value.IsEmpty()) {
- *errorString = "Promise with specified ID not found.";
- return;
- }
- InjectedScript* injectedScript = m_injectedScriptManager->injectedScriptFor(value->CreationContext());
- *promise = injectedScript->wrapObject(errorString, value, objectGroup.fromMaybe(""));
-}
-
-void V8DebuggerAgentImpl::didUpdatePromise(const String16& eventType, PassOwnPtr<protocol::Debugger::PromiseDetails> promise)
-{
- if (m_frontend)
- m_frontend->promiseUpdated(eventType, promise);
-}
-
int V8DebuggerAgentImpl::traceAsyncOperationStarting(const String16& description)
{
v8::HandleScope scope(m_isolate);
@@ -1702,7 +1639,6 @@ void V8DebuggerAgentImpl::reset()
m_blackboxedPositions.clear();
m_breakpointIdToDebuggerBreakpointIds.clear();
resetAsyncCallTracker();
- m_promiseTracker->clear();
}
} // namespace blink
diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8DebuggerAgentImpl.h b/third_party/WebKit/Source/platform/v8_inspector/V8DebuggerAgentImpl.h
index f0cff42..0a47745 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/V8DebuggerAgentImpl.h
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8DebuggerAgentImpl.h
@@ -132,13 +132,6 @@ public:
PassOwnPtr<protocol::Runtime::CallArgument> newValue,
const String16& callFrame) override;
void setAsyncCallStackDepth(ErrorString*, int depth) override;
- void enablePromiseTracker(ErrorString*,
- const Maybe<bool>& captureStacks) override;
- void disablePromiseTracker(ErrorString*) override;
- void getPromiseById(ErrorString*,
- int promiseId,
- const Maybe<String16>& objectGroup,
- OwnPtr<protocol::Runtime::RemoteObject>* promise) override;
void flushAsyncOperationEvents(ErrorString*) override;
void setAsyncOperationBreakpoint(ErrorString*, int operationId) override;
void removeAsyncOperationBreakpoint(ErrorString*, int operationId) override;
@@ -167,7 +160,6 @@ public:
void traceAsyncOperationCompleted(int operationId) override;
bool trackingAsyncCalls() const override { return m_maxAsyncCallStackDepth; }
- void didUpdatePromise(const String16& eventType, PassOwnPtr<protocol::Debugger::PromiseDetails>);
void reset();
// Interface for V8DebuggerImpl
@@ -176,8 +168,6 @@ public:
void didParseSource(const V8DebuggerParsedScript&);
bool v8AsyncTaskEventsEnabled() const;
void didReceiveV8AsyncTaskEvent(v8::Local<v8::Context>, const String16& eventType, const String16& eventName, int id);
- bool v8PromiseEventsEnabled() const;
- void didReceiveV8PromiseEvent(v8::Local<v8::Context>, v8::Local<v8::Object> promise, v8::Local<v8::Value> parentPromise, int status);
v8::Isolate* isolate() { return m_isolate; }
int maxAsyncCallChainDepth() { return m_maxAsyncCallStackDepth; }
@@ -256,7 +246,6 @@ private:
// This field must be destroyed before the listeners set above.
OwnPtr<V8AsyncCallTracker> m_v8AsyncCallTracker;
- OwnPtr<PromiseTracker> m_promiseTracker;
using AsyncOperationIdToStackTrace = protocol::HashMap<int, OwnPtr<V8StackTraceImpl>>;
AsyncOperationIdToStackTrace m_asyncOperations;
diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8DebuggerImpl.cpp b/third_party/WebKit/Source/platform/v8_inspector/V8DebuggerImpl.cpp
index a9b6f28..feb0f4e 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/V8DebuggerImpl.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8DebuggerImpl.cpp
@@ -598,7 +598,7 @@ void V8DebuggerImpl::handleV8DebugEvent(const v8::Debug::EventDetails& eventDeta
if (!enabled())
return;
v8::DebugEvent event = eventDetails.GetEvent();
- if (event != v8::AsyncTaskEvent && event != v8::Break && event != v8::Exception && event != v8::AfterCompile && event != v8::BeforeCompile && event != v8::CompileError && event != v8::PromiseEvent)
+ if (event != v8::AsyncTaskEvent && event != v8::Break && event != v8::Exception && event != v8::AfterCompile && event != v8::BeforeCompile && event != v8::CompileError)
return;
v8::Local<v8::Context> eventContext = eventDetails.GetEventContext();
@@ -628,9 +628,6 @@ void V8DebuggerImpl::handleV8DebugEvent(const v8::Debug::EventDetails& eventDeta
} else if (event == v8::AsyncTaskEvent) {
if (agent->v8AsyncTaskEventsEnabled())
handleV8AsyncTaskEvent(agent, eventContext, eventDetails.GetExecutionState(), eventDetails.GetEventData());
- } else if (event == v8::PromiseEvent) {
- if (agent->v8PromiseEventsEnabled())
- handleV8PromiseEvent(agent, eventContext, eventDetails.GetExecutionState(), eventDetails.GetEventData());
}
}
}
@@ -648,23 +645,6 @@ void V8DebuggerImpl::handleV8AsyncTaskEvent(V8DebuggerAgentImpl* agent, v8::Loca
m_executionState.Clear();
}
-void V8DebuggerImpl::handleV8PromiseEvent(V8DebuggerAgentImpl* agent, v8::Local<v8::Context> context, v8::Local<v8::Object> executionState, v8::Local<v8::Object> eventData)
-{
- v8::Local<v8::Value> argv[] = { eventData };
- v8::Local<v8::Value> value = callDebuggerMethod("getPromiseDetails", 1, argv).ToLocalChecked();
- ASSERT(value->IsObject());
- v8::Local<v8::Object> promiseDetails = v8::Local<v8::Object>::Cast(value);
- v8::Local<v8::Object> promise = promiseDetails->Get(v8InternalizedString("promise"))->ToObject(m_isolate);
- int status = promiseDetails->Get(v8InternalizedString("status"))->ToInteger(m_isolate)->Value();
- v8::Local<v8::Value> parentPromise = promiseDetails->Get(v8InternalizedString("parentPromise"));
-
- m_pausedContext = context;
- m_executionState = executionState;
- agent->didReceiveV8PromiseEvent(context, promise, parentPromise, status);
- m_pausedContext.Clear();
- m_executionState.Clear();
-}
-
V8DebuggerParsedScript V8DebuggerImpl::createParsedScript(v8::Local<v8::Object> object, bool success)
{
v8::Local<v8::Value> id = object->Get(v8InternalizedString("id"));
diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8DebuggerImpl.h b/third_party/WebKit/Source/platform/v8_inspector/V8DebuggerImpl.h
index 6176979..83213ec 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/V8DebuggerImpl.h
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8DebuggerImpl.h
@@ -137,7 +137,6 @@ private:
v8::Local<v8::String> v8InternalizedString(const char*) const;
void handleV8AsyncTaskEvent(V8DebuggerAgentImpl*, v8::Local<v8::Context>, v8::Local<v8::Object> executionState, v8::Local<v8::Object> eventData);
- void handleV8PromiseEvent(V8DebuggerAgentImpl*, v8::Local<v8::Context>, v8::Local<v8::Object> executionState, v8::Local<v8::Object> eventData);
v8::Isolate* m_isolate;
V8DebuggerClient* m_client;