Skip to content

Commit

Permalink
Headless: remove devtools protocol network handler
Browse files Browse the repository at this point in the history
Network conditions management is now done in content, so support for
this in headless is redundant.

This is a re-land of https://chromium-review.googlesource.com/c/chromium/src/+/1255610
fix network_dp.{h,cc} being removed from BUILD.gn.

Change-Id: I6903c58f72bfc20588bf795da7b9f2e647dd0801
Reviewed-on: https://chromium-review.googlesource.com/1255726
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Andrey Kosyakov <caseq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595870}
  • Loading branch information
caseq authored and Commit Bot committed Oct 2, 2018
1 parent 09f2146 commit 2a84881
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 198 deletions.
6 changes: 0 additions & 6 deletions headless/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,6 @@ inspector_protocol_generate("protocol_sources") {
"lib/browser/protocol/dp_browser.h",
"lib/browser/protocol/dp_headless_experimental.cc",
"lib/browser/protocol/dp_headless_experimental.h",
"lib/browser/protocol/dp_network.cc",
"lib/browser/protocol/dp_network.h",
"lib/browser/protocol/dp_page.cc",
"lib/browser/protocol/dp_page.h",
"lib/browser/protocol/dp_target.cc",
Expand Down Expand Up @@ -304,8 +302,6 @@ jumbo_component("headless") {
"lib/browser/headless_devtools_client_impl.cc",
"lib/browser/headless_devtools_manager_delegate.cc",
"lib/browser/headless_devtools_manager_delegate.h",
"lib/browser/headless_network_conditions.cc",
"lib/browser/headless_network_conditions.h",
"lib/browser/headless_permission_manager.cc",
"lib/browser/headless_permission_manager.h",
"lib/browser/headless_platform_event_source.cc",
Expand All @@ -327,8 +323,6 @@ jumbo_component("headless") {
"lib/browser/protocol/headless_devtools_session.h",
"lib/browser/protocol/headless_handler.cc",
"lib/browser/protocol/headless_handler.h",
"lib/browser/protocol/network_handler.cc",
"lib/browser/protocol/network_handler.h",
"lib/browser/protocol/page_handler.cc",
"lib/browser/protocol/page_handler.h",
"lib/browser/protocol/protocol_string.cc",
Expand Down
9 changes: 0 additions & 9 deletions headless/lib/browser/headless_browser_context_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -363,15 +363,6 @@ const std::string& HeadlessBrowserContextImpl::Id() const {
return UniqueId();
}

void HeadlessBrowserContextImpl::SetNetworkConditions(
HeadlessNetworkConditions conditions) {
network_conditions_ = conditions;
}

HeadlessNetworkConditions HeadlessBrowserContextImpl::GetNetworkConditions() {
return network_conditions_;
}

HeadlessBrowserContext::Builder::Builder(HeadlessBrowserImpl* browser)
: browser_(browser),
options_(new HeadlessBrowserContextOptions(browser->options())) {}
Expand Down
6 changes: 0 additions & 6 deletions headless/lib/browser/headless_browser_context_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include "content/public/browser/global_routing_id.h"
#include "content/public/browser/resource_context.h"
#include "headless/lib/browser/headless_browser_context_options.h"
#include "headless/lib/browser/headless_network_conditions.h"
#include "headless/lib/browser/headless_url_request_context_getter.h"
#include "headless/public/headless_browser.h"
#include "headless/public/headless_browser_context.h"
Expand Down Expand Up @@ -110,9 +109,6 @@ class HEADLESS_EXPORT HeadlessBrowserContextImpl final
const base::UnguessableToken* GetDevToolsFrameTokenForFrameTreeNodeId(
int frame_tree_node_id) const;

void SetNetworkConditions(HeadlessNetworkConditions conditions);
HeadlessNetworkConditions GetNetworkConditions() override;

private:
HeadlessBrowserContextImpl(
HeadlessBrowserImpl* browser,
Expand Down Expand Up @@ -144,8 +140,6 @@ class HEADLESS_EXPORT HeadlessBrowserContextImpl final
std::unique_ptr<content::PermissionControllerDelegate>
permission_controller_delegate_;

HeadlessNetworkConditions network_conditions_;

DISALLOW_COPY_AND_ASSIGN(HeadlessBrowserContextImpl);
};

Expand Down
26 changes: 0 additions & 26 deletions headless/lib/browser/headless_network_conditions.cc

This file was deleted.

36 changes: 0 additions & 36 deletions headless/lib/browser/headless_network_conditions.h

This file was deleted.

2 changes: 0 additions & 2 deletions headless/lib/browser/protocol/headless_devtools_session.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include "content/public/browser/devtools_agent_host_client.h"
#include "headless/lib/browser/protocol/browser_handler.h"
#include "headless/lib/browser/protocol/headless_handler.h"
#include "headless/lib/browser/protocol/network_handler.h"
#include "headless/lib/browser/protocol/page_handler.h"
#include "headless/lib/browser/protocol/target_handler.h"

Expand All @@ -32,7 +31,6 @@ HeadlessDevToolsSession::HeadlessDevToolsSession(
}
if (agent_host->GetType() == content::DevToolsAgentHost::kTypeBrowser)
AddHandler(std::make_unique<BrowserHandler>(browser_));
AddHandler(std::make_unique<NetworkHandler>(browser_));
AddHandler(std::make_unique<TargetHandler>(browser_));
}

Expand Down
61 changes: 0 additions & 61 deletions headless/lib/browser/protocol/network_handler.cc

This file was deleted.

44 changes: 0 additions & 44 deletions headless/lib/browser/protocol/network_handler.h

This file was deleted.

5 changes: 0 additions & 5 deletions headless/protocol_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@
"domain": "HeadlessExperimental",
"async": ["beginFrame"]
},
{
"domain": "Network",
"include": ["emulateNetworkConditions", "disable"],
"include_events": []
},
{
"domain": "Page",
"include": ["printToPDF"],
Expand Down
3 changes: 0 additions & 3 deletions headless/public/headless_browser_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include "base/optional.h"
#include "content/public/browser/browser_context.h"
#include "content/public/common/web_preferences.h"
#include "headless/lib/browser/headless_network_conditions.h"
#include "headless/public/headless_export.h"
#include "headless/public/headless_web_contents.h"
#include "net/proxy_resolution/proxy_resolution_service.h"
Expand Down Expand Up @@ -65,8 +64,6 @@ class HEADLESS_EXPORT HeadlessBrowserContext {
// GUID for this browser context.
virtual const std::string& Id() const = 0;

virtual HeadlessNetworkConditions GetNetworkConditions() = 0;

// TODO(skyostil): Allow saving and restoring contexts (crbug.com/617931).

protected:
Expand Down

0 comments on commit 2a84881

Please sign in to comment.