[refactor] More post-NSS WebCrypto cleanups (utility functions).
[chromium-blink-merge.git] / content / browser / devtools / protocol / network_handler.h
blob0c8a9890ce710a529904b133a02d3a61bdd802bb
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_DEVTOOLS_PROTOCOL_NETWORK_HANDLER_H_
6 #define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_NETWORK_HANDLER_H_
8 #include "base/memory/weak_ptr.h"
9 #include "content/browser/devtools/protocol/devtools_protocol_dispatcher.h"
10 #include "net/cookies/canonical_cookie.h"
12 namespace content {
14 class RenderFrameHostImpl;
16 namespace devtools {
17 namespace network {
19 class NetworkHandler {
20 public:
21 typedef DevToolsProtocolClient::Response Response;
23 NetworkHandler();
24 virtual ~NetworkHandler();
26 void SetRenderFrameHost(RenderFrameHostImpl* host);
27 void SetClient(scoped_ptr<Client> client);
29 Response ClearBrowserCache();
30 Response ClearBrowserCookies();
31 Response GetCookies(DevToolsCommandId command_id);
32 Response DeleteCookie(DevToolsCommandId command_id,
33 const std::string& cookie_name,
34 const std::string& url);
36 Response CanEmulateNetworkConditions(bool* result);
37 Response EmulateNetworkConditions(bool offline,
38 double latency,
39 double download_throughput,
40 double upload_throughput);
41 Response GetCertificateDetails(int certificate_id,
42 scoped_refptr<CertificateDetails>* result);
43 Response ShowCertificateViewer(int certificate_id);
45 private:
46 void SendGetCookiesResponse(
47 DevToolsCommandId command_id,
48 const net::CookieList& cookie_list);
49 void SendDeleteCookieResponse(DevToolsCommandId command_id);
51 RenderFrameHostImpl* host_;
52 scoped_ptr<Client> client_;
53 base::WeakPtrFactory<NetworkHandler> weak_factory_;
55 DISALLOW_COPY_AND_ASSIGN(NetworkHandler);
58 } // namespace network
59 } // namespace devtools
60 } // namespace content
62 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_NETWORK_HANDLER_H_