Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Side by Side Diff: content/browser/devtools/protocol/network_handler.cc

Issue 633413002: [DevTools] Move Network domain overrides to NetworkHandler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/devtools/protocol/network_handler.h" 5 #include "content/browser/devtools/protocol/network_handler.h"
6 6
7 #include "content/public/browser/content_browser_client.h"
8 #include "content/public/common/content_client.h"
9
7 namespace content { 10 namespace content {
8 namespace devtools { 11 namespace devtools {
9 namespace network { 12 namespace network {
10 13
11 typedef DevToolsProtocolClient::Response Response; 14 typedef DevToolsProtocolClient::Response Response;
12 15
13 NetworkHandler::NetworkHandler() { 16 NetworkHandler::NetworkHandler() : host_(nullptr) {
14 } 17 }
15 18
16 NetworkHandler::~NetworkHandler() { 19 NetworkHandler::~NetworkHandler() {
17 } 20 }
18 21
22 void NetworkHandler::SetRenderViewHost(RenderViewHost* host) {
23 host_ = host;
24 }
25
19 Response NetworkHandler::ClearBrowserCache() { 26 Response NetworkHandler::ClearBrowserCache() {
20 return Response::FallThrough(); 27 GetContentClient()->browser()->ClearCache(host_);
28 return Response::OK();
21 } 29 }
22 30
23 Response NetworkHandler::ClearBrowserCookies() { 31 Response NetworkHandler::ClearBrowserCookies() {
24 return Response::FallThrough(); 32 GetContentClient()->browser()->ClearCookies(host_);
33 return Response::OK();
25 } 34 }
26 35
27 Response NetworkHandler::CanEmulateNetworkConditions(bool* result) { 36 Response NetworkHandler::CanEmulateNetworkConditions(bool* result) {
28 return Response::FallThrough(); 37 *result = false;
38 return Response::OK();
29 } 39 }
30 40
31 Response NetworkHandler::EmulateNetworkConditions(bool offline, 41 Response NetworkHandler::EmulateNetworkConditions(bool offline,
32 double latency, 42 double latency,
33 double download_throughput, 43 double download_throughput,
34 double upload_throughput) { 44 double upload_throughput) {
35 return Response::FallThrough(); 45 return Response::FallThrough();
36 } 46 }
37 47
38 } // namespace dom 48 } // namespace dom
39 } // namespace devtools 49 } // namespace devtools
40 } // namespace content 50 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/devtools/protocol/network_handler.h ('k') | content/browser/devtools/render_view_devtools_agent_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698