chromium/chrome/browser/ui/webui/devtools/devtools_ui_data_source.cc

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/ui/webui/devtools/devtools_ui_data_source.h"

#include <list>
#include <utility>

#include "base/command_line.h"
#include "base/containers/span.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/memory/ref_counted_memory.h"
#include "base/path_service.h"
#include "base/strings/strcat.h"
#include "base/task/thread_pool.h"
#include "chrome/browser/devtools/devtools_ui_bindings.h"
#include "chrome/browser/devtools/url_constants.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/url_constants.h"
#include "chrome/common/webui_url_constants.h"
#include "content/public/browser/devtools_frontend_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/url_constants.h"
#include "net/base/filename_util.h"
#include "net/base/load_flags.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
#include "services/network/public/cpp/resource_request.h"
#include "url/url_constants.h"

namespace {

std::string PathWithoutParams(const std::string& path) {}

scoped_refptr<base::RefCountedMemory> CreateNotFoundResponse() {}

// DevToolsDataSource ---------------------------------------------------------

std::string GetMimeTypeForUrl(const GURL& url) {}

// Checks if the path starts with a prefix followed by a revision. In that case,
// the prefix and the revision is removed from the path. For example,
// "$prefix@76e4c1bb2ab4671b8beba3444e61c0f17584b2fc/inspector.html" becomes
// "inspector.html".
std::string StripDevToolsRevisionWithPrefix(const std::string& path,
                                            const std::string& prefix) {}
}  // namespace

DevToolsDataSource::DevToolsDataSource(
    scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory)
    :{}

DevToolsDataSource::~DevToolsDataSource() {}

std::string DevToolsDataSource::GetSource() {}

// static
GURL GetCustomDevToolsFrontendURL() {}

bool DevToolsDataSource::MaybeHandleCustomRequest(const std::string& path,
                                                  GotDataCallback* callback) {}

void DevToolsDataSource::StartDataRequest(
    const GURL& url,
    const content::WebContents::Getter& wc_getter,
    GotDataCallback callback) {}

std::string DevToolsDataSource::GetMimeType(const GURL& url) {}

bool DevToolsDataSource::ShouldAddContentSecurityPolicy() {}

bool DevToolsDataSource::ShouldDenyXFrameOptions() {}

bool DevToolsDataSource::ShouldServeMimeTypeAsContentTypeHeader() {}

void DevToolsDataSource::StartBundledDataRequest(
    const std::string& path,
    content::URLDataSource::GotDataCallback callback) {}

void DevToolsDataSource::StartRemoteDataRequest(
    const GURL& url,
    content::URLDataSource::GotDataCallback callback) {}

void DevToolsDataSource::StartCustomDataRequest(
    const GURL& url,
    content::URLDataSource::GotDataCallback callback) {}

void DevToolsDataSource::StartNetworkRequest(
    const GURL& url,
    const net::NetworkTrafficAnnotationTag& traffic_annotation,
    int load_flags,
    GotDataCallback callback) {}

scoped_refptr<base::RefCountedMemory> ReadFileForDevTools(
    const base::FilePath& path) {}

void DevToolsDataSource::StartFileRequest(const std::string& path,
                                          GotDataCallback callback) {}

void DevToolsDataSource::OnLoadComplete(
    std::list<PendingRequest>::iterator request_iter,
    std::unique_ptr<std::string> response_body) {}

DevToolsDataSource::PendingRequest::PendingRequest() = default;

DevToolsDataSource::PendingRequest::PendingRequest(PendingRequest&& other) =
    default;

DevToolsDataSource::PendingRequest::~PendingRequest() {}