Skip to content
This repository has been archived by the owner on Jan 4, 2019. It is now read-only.

Commit

Permalink
don’t duplicate chrome devtools classes
Browse files Browse the repository at this point in the history
  • Loading branch information
bridiver committed Feb 25, 2017
1 parent 65a0151 commit 3a6ea67
Show file tree
Hide file tree
Showing 27 changed files with 46 additions and 1,591 deletions.
12 changes: 6 additions & 6 deletions atom/browser/api/atom_api_session.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
#include "base/threading/thread_task_runner_handle.h"
#include "brave/browser/brave_content_browser_client.h"
#include "brave/browser/brave_permission_manager.h"
#include "brightray/browser/net/devtools_network_conditions.h"
#include "brightray/browser/net/devtools_network_controller_handle.h"
#include "chrome/browser/devtools/devtools_network_conditions.h"
#include "chrome/browser/devtools/devtools_network_controller_handle.h"
#include "chrome/common/pref_names.h"
#include "components/prefs/pref_service.h"
#include "content/public/browser/browser_thread.h"
Expand Down Expand Up @@ -433,17 +433,17 @@ void Session::SetDownloadPath(const base::FilePath& path) {
}

void Session::EnableNetworkEmulation(const mate::Dictionary& options) {
std::unique_ptr<brightray::DevToolsNetworkConditions> conditions;
std::unique_ptr<DevToolsNetworkConditions> conditions;
bool offline = false;
double latency = 0.0, download_throughput = 0.0, upload_throughput = 0.0;
if (options.Get("offline", &offline) && offline) {
conditions.reset(new brightray::DevToolsNetworkConditions(offline));
conditions.reset(new DevToolsNetworkConditions(offline));
} else {
options.Get("latency", &latency);
options.Get("downloadThroughput", &download_throughput);
options.Get("uploadThroughput", &upload_throughput);
conditions.reset(
new brightray::DevToolsNetworkConditions(false,
new DevToolsNetworkConditions(false,
latency,
download_throughput,
upload_throughput));
Expand All @@ -456,7 +456,7 @@ void Session::EnableNetworkEmulation(const mate::Dictionary& options) {
}

void Session::DisableNetworkEmulation() {
std::unique_ptr<brightray::DevToolsNetworkConditions> conditions;
std::unique_ptr<DevToolsNetworkConditions> conditions;
browser_context_->network_controller_handle()->SetNetworkState(
devtools_network_emulation_client_id_, std::move(conditions));
browser_context_->network_delegate()->SetDevToolsNetworkEmulationClientId(
Expand Down
3 changes: 1 addition & 2 deletions atom/browser/net/atom_network_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "atom/common/native_mate_converters/net_converter.h"
#include "base/stl_util.h"
#include "base/strings/string_util.h"
#include "brightray/browser/net/devtools_network_transaction.h"
#include "chrome/browser/devtools/devtools_network_transaction.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/websocket_handshake_request_info.h"
#include "extensions/features/features.h"
Expand All @@ -20,7 +20,6 @@
#include "extensions/browser/extension_api_frame_id_map.h"
#endif

using brightray::DevToolsNetworkTransaction;
using content::BrowserThread;

namespace atom {
Expand Down
5 changes: 5 additions & 0 deletions brave/browser/brave_browser_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ class BraveBrowserContext : public Profile {

base::FilePath GetPath() const override;

DevToolsNetworkControllerHandle*
GetDevToolsNetworkControllerHandle() override {
return network_controller_handle();
}

private:
void OnPrefsLoaded(bool success);
void TrackZoomLevelsFromParent();
Expand Down
23 changes: 23 additions & 0 deletions chromium_src/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ source_set("browser") {
public_deps = []
deps = [
"//electron/atom/browser",
"//chrome/browser/devtools:devtools_protocol_constants",
"//chrome/common",
"//chrome/utility",
"//components/certificate_transparency",
Expand All @@ -137,6 +138,28 @@ source_set("browser") {
"chrome/browser/chrome_notification_types.h",
"chrome/browser/custom_handlers/protocol_handler_registry.cc",
"chrome/browser/custom_handlers/protocol_handler_registry_factory.cc",
# devtools
"//chrome/browser/devtools/devtools_network_conditions.cc",
"//chrome/browser/devtools/devtools_network_conditions.h",
"//chrome/browser/devtools/devtools_network_controller.cc",
"//chrome/browser/devtools/devtools_network_controller.h",
"//chrome/browser/devtools/devtools_network_controller_handle.cc",
"//chrome/browser/devtools/devtools_network_controller_handle.h",
"//chrome/browser/devtools/devtools_network_interceptor.cc",
"//chrome/browser/devtools/devtools_network_interceptor.h",
"//chrome/browser/devtools/devtools_network_protocol_handler.cc",
"//chrome/browser/devtools/devtools_network_protocol_handler.h",
"//chrome/browser/devtools/devtools_network_transaction_factory.cc",
"//chrome/browser/devtools/devtools_network_transaction_factory.h",
"//chrome/browser/devtools/devtools_network_transaction.cc",
"//chrome/browser/devtools/devtools_network_transaction.h",
"//chrome/browser/devtools/devtools_network_upload_data_stream.cc",
"//chrome/browser/devtools/devtools_network_upload_data_stream.h",
"//chrome/browser/devtools/devtools_protocol.cc",
"//chrome/browser/devtools/devtools_protocol.h",
"$root_gen_dir/chrome/browser/devtools/devtools_protocol_constants.cc",
"$root_gen_dir/chrome/browser/devtools/devtools_protocol_constants.h",
# extensions
"//chrome/browser/extensions/global_shortcut_listener.cc",
"//chrome/browser/extensions/global_shortcut_listener.h",
"//chrome/browser/extensions/global_shortcut_listener_mac.h",
Expand Down
4 changes: 4 additions & 0 deletions chromium_src/chrome/browser/profiles/profile.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ class Profile : public atom::AtomBrowserContext {
GetAutofillWebdataService() = 0;

virtual PrefChangeRegistrar* user_prefs_change_registrar() const = 0;

virtual DevToolsNetworkControllerHandle*
GetDevToolsNetworkControllerHandle() = 0;

private:
// bool restored_last_session_;

Expand Down
16 changes: 0 additions & 16 deletions vendor/brightray/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -110,22 +110,6 @@ source_set("browser") {
"browser/media/media_capture_devices_dispatcher.h",
"browser/media/media_stream_devices_controller.cc",
"browser/media/media_stream_devices_controller.h",
"browser/net/devtools_network_conditions.cc",
"browser/net/devtools_network_conditions.h",
"browser/net/devtools_network_controller.cc",
"browser/net/devtools_network_controller.h",
"browser/net/devtools_network_controller_handle.cc",
"browser/net/devtools_network_controller_handle.h",
"browser/net/devtools_network_interceptor.cc",
"browser/net/devtools_network_interceptor.h",
"browser/net/devtools_network_protocol_handler.cc",
"browser/net/devtools_network_protocol_handler.h",
"browser/net/devtools_network_transaction_factory.cc",
"browser/net/devtools_network_transaction_factory.h",
"browser/net/devtools_network_transaction.cc",
"browser/net/devtools_network_transaction.h",
"browser/net/devtools_network_upload_data_stream.cc",
"browser/net/devtools_network_upload_data_stream.h",
"browser/net_log.cc",
"browser/net_log.h",
"browser/network_delegate.cc",
Expand Down
7 changes: 3 additions & 4 deletions vendor/brightray/browser/browser_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@

#include <map>

#include "browser/net/devtools_network_controller_handle.h"
#include "browser/permission_manager.h"
#include "browser/url_request_context_getter.h"

#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "browser/permission_manager.h"
#include "browser/url_request_context_getter.h"
#include "content/public/browser/browser_context.h"
#include "chrome/browser/devtools/devtools_network_controller_handle.h"

class PrefRegistrySimple;
class PrefService;
Expand Down
2 changes: 0 additions & 2 deletions vendor/brightray/browser/devtools_manager_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

#include <vector>

#include "browser/net/devtools_network_protocol_handler.h"

#include "base/bind.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
Expand Down
3 changes: 1 addition & 2 deletions vendor/brightray/browser/devtools_manager_delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@

#include "base/macros.h"
#include "base/compiler_specific.h"
#include "chrome/browser/devtools/devtools_network_protocol_handler.h"
#include "content/browser/devtools/devtools_http_handler.h"
#include "content/public/browser/devtools_agent_host_observer.h"
#include "content/public/browser/devtools_manager_delegate.h"

namespace brightray {

class DevToolsNetworkProtocolHandler;

class DevToolsManagerDelegate : public content::DevToolsManagerDelegate,
public content::DevToolsAgentHostObserver {
public:
Expand Down
35 changes: 0 additions & 35 deletions vendor/brightray/browser/net/devtools_network_conditions.cc

This file was deleted.

43 changes: 0 additions & 43 deletions vendor/brightray/browser/net/devtools_network_conditions.h

This file was deleted.

80 changes: 0 additions & 80 deletions vendor/brightray/browser/net/devtools_network_controller.cc

This file was deleted.

38 changes: 0 additions & 38 deletions vendor/brightray/browser/net/devtools_network_controller.h

This file was deleted.

Loading

1 comment on commit 3a6ea67

@darkdh
Copy link
Member

@darkdh darkdh commented on 3a6ea67 Feb 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++

Please sign in to comment.