Demo/bin/Debug/front_end/promises/PromisePane.js

(开头部分) 27KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

// 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("ui/filter.css");
    this.registerRequiredCSS("promises/promisePane.css");
    this.element.classList.add("promises");

    var toolbar = new WebInspector.Toolbar(this.element);
    this._recordButton = new WebInspector.ToolbarButton("", "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.element.appendChild(this._filterBar.filtersElement());

    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);

    this._dataGridContainer = new WebInspector.VBox();
    this._dataGridContainer.show(this.element);
    // 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 }
    ];
后面还有 737 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。