From fba2ab099693d09f11a4a2d78cc53abaab434fe5 Mon Sep 17 00:00:00 2001 From: Aleksei Kuzmin Date: Wed, 11 Apr 2018 13:12:35 +0200 Subject: [PATCH] Move throttling to network service https://chromium-review.googlesource.com/703674 --- atom/browser/api/atom_api_session.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/atom/browser/api/atom_api_session.cc b/atom/browser/api/atom_api_session.cc index 513b6ea40304..fd66b32308d1 100644 --- a/atom/browser/api/atom_api_session.cc +++ b/atom/browser/api/atom_api_session.cc @@ -34,8 +34,8 @@ #include "chrome/browser/browser_process.h" #include "chrome/common/pref_names.h" #include "components/prefs/pref_service.h" -#include "content/common/devtools/devtools_network_conditions.h" -#include "content/common/devtools/devtools_network_controller.h" +#include "content/network/throttling/network_conditions.h" +#include "content/network/throttling/throttling_controller.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/download_manager_delegate.h" #include "content/public/browser/storage_partition.h" @@ -576,20 +576,20 @@ void Session::SetDownloadPath(const base::FilePath& path) { } void Session::EnableNetworkEmulation(const mate::Dictionary& options) { - std::unique_ptr conditions; + std::unique_ptr 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 content::DevToolsNetworkConditions(offline)); + conditions.reset(new content::NetworkConditions(offline)); } else { options.Get("latency", &latency); options.Get("downloadThroughput", &download_throughput); options.Get("uploadThroughput", &upload_throughput); - conditions.reset(new content::DevToolsNetworkConditions( + conditions.reset(new content::NetworkConditions( false, latency, download_throughput, upload_throughput)); } - content::DevToolsNetworkController::SetNetworkState( + content::ThrottlingController::SetConditions( devtools_network_emulation_client_id_, std::move(conditions)); BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, @@ -600,8 +600,8 @@ void Session::EnableNetworkEmulation(const mate::Dictionary& options) { } void Session::DisableNetworkEmulation() { - auto conditions = std::make_unique(); - content::DevToolsNetworkController::SetNetworkState( + auto conditions = std::make_unique(); + content::ThrottlingController::SetConditions( devtools_network_emulation_client_id_, std::move(conditions)); BrowserThread::PostTask( BrowserThread::IO, FROM_HERE,