chromium/headless/lib/browser/headless_devtools.cc

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

#include "headless/lib/browser/headless_devtools.h"

#include <memory>
#include <string>
#include <utility>

#include "base/files/file_path.h"
#include "base/memory/ptr_util.h"
#include "build/build_config.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/devtools_agent_host.h"
#include "content/public/browser/devtools_socket_factory.h"
#include "content/public/browser/navigation_entry.h"
#include "headless/public/headless_browser.h"
#include "net/base/net_errors.h"
#include "net/log/net_log_source.h"
#include "net/socket/tcp_server_socket.h"
#include "ui/base/resource/resource_bundle.h"

namespace headless {

namespace {

const int kBackLog =;

class TCPServerSocketFactory : public content::DevToolsSocketFactory {};

#if BUILDFLAG(IS_POSIX)
class TCPAdoptServerSocketFactory : public content::DevToolsSocketFactory {};
#else   // BUILDFLAG(IS_POSIX)

// Placeholder class to use when a socket_fd is passed in on non-Posix.
class DummyTCPServerSocketFactory : public content::DevToolsSocketFactory {
 public:
  explicit DummyTCPServerSocketFactory() {}

  DummyTCPServerSocketFactory(const DummyTCPServerSocketFactory&) = delete;
  DummyTCPServerSocketFactory& operator=(const DummyTCPServerSocketFactory&) =
      delete;

 private:
  std::unique_ptr<net::ServerSocket> CreateForHttpServer() override {
    return nullptr;
  }

  std::unique_ptr<net::ServerSocket> CreateForTethering(
      std::string* out_name) override {
    return nullptr;
  }
};
#endif  // BUILDFLAG(IS_POSIX)

void PostTaskToCloseBrowser(base::WeakPtr<HeadlessBrowserImpl> browser) {}

}  // namespace

void StartLocalDevToolsHttpHandler(HeadlessBrowserImpl* browser) {}

void StopLocalDevToolsHttpHandler() {}

}  // namespace headless