Demo/bin/Debug/front_end/common/StaticContentProvider.js

(开头部分) 1KB

这里只显示每个文件的开头 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
 * @implements {WebInspector.ContentProvider}
 * @param {!WebInspector.ResourceType} contentType
 * @param {string} content
 * @param {string=} contentURL
 */
WebInspector.StaticContentProvider = function(contentType, content, contentURL)
{
    this._content = content;
    this._contentType = contentType;
    this._contentURL = contentURL || "";
}

/**
 * @param {string} content
 * @param {string} query
 * @param {boolean} caseSensitive
 * @param {boolean} isRegex
 * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} callback
 */
WebInspector.StaticContentProvider.searchInContent = function(content, query, caseSensitive, isRegex, callback)
{
    function performSearch()
    {
        callback(WebInspector.ContentProvider.performSearchInContent(content, query, caseSensitive, isRegex));
    }

    // searchInContent should call back later.
    setTimeout(performSearch.bind(null), 0);
}

WebInspector.StaticContentProvider.prototype = {
    /**
     * @override
     * @return {string}
     */
    contentURL: function()
    {
        return this._contentURL;
    },

    /**
     * @override
     * @return {!WebInspector.ResourceType}
     */
    contentType: function()
    {
        return this._contentType;
    },

    /**
     * @override
     * @param {function(?string)} callback
     */
    requestContent: function(callback)
后面还有 16 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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