| OLD | NEW |
| 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 #ifndef CONTENT_BROWSER_DEVTOOLS_PROTOCOL_NETWORK_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_DEVTOOLS_PROTOCOL_NETWORK_HANDLER_H_ |
| 6 #define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_NETWORK_HANDLER_H_ | 6 #define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_NETWORK_HANDLER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "content/browser/devtools/protocol/devtools_protocol_dispatcher.h" | 10 #include "content/browser/devtools/protocol/devtools_protocol_dispatcher.h" |
| 11 #include "net/cookies/canonical_cookie.h" | 11 #include "net/cookies/canonical_cookie.h" |
| 12 | 12 |
| 13 namespace content { | 13 namespace content { |
| 14 | 14 |
| 15 class RenderFrameHostImpl; | 15 class RenderFrameHostImpl; |
| 16 | 16 |
| 17 namespace devtools { | 17 namespace devtools { |
| 18 namespace network { | 18 namespace network { |
| 19 | 19 |
| 20 class NetworkHandler { | 20 class NetworkHandler { |
| 21 public: | 21 public: |
| 22 typedef DevToolsProtocolClient::Response Response; | 22 typedef DevToolsProtocolClient::Response Response; |
| 23 | 23 |
| 24 NetworkHandler(); | 24 NetworkHandler(); |
| 25 virtual ~NetworkHandler(); | 25 virtual ~NetworkHandler(); |
| 26 | 26 |
| 27 void SetRenderFrameHost(RenderFrameHostImpl* host); | 27 void SetRenderFrameHost(RenderFrameHostImpl* host); |
| 28 void SetClient(scoped_ptr<Client> client); | 28 void SetClient(std::unique_ptr<Client> client); |
| 29 | 29 |
| 30 Response ClearBrowserCache(); | 30 Response ClearBrowserCache(); |
| 31 Response ClearBrowserCookies(); | 31 Response ClearBrowserCookies(); |
| 32 Response GetCookies(DevToolsCommandId command_id); | 32 Response GetCookies(DevToolsCommandId command_id); |
| 33 Response DeleteCookie(DevToolsCommandId command_id, | 33 Response DeleteCookie(DevToolsCommandId command_id, |
| 34 const std::string& cookie_name, | 34 const std::string& cookie_name, |
| 35 const std::string& url); | 35 const std::string& url); |
| 36 | 36 |
| 37 Response CanEmulateNetworkConditions(bool* result); | 37 Response CanEmulateNetworkConditions(bool* result); |
| 38 Response EmulateNetworkConditions(bool offline, | 38 Response EmulateNetworkConditions(bool offline, |
| 39 double latency, | 39 double latency, |
| 40 double download_throughput, | 40 double download_throughput, |
| 41 double upload_throughput); | 41 double upload_throughput); |
| 42 Response GetCertificateDetails(int certificate_id, | 42 Response GetCertificateDetails(int certificate_id, |
| 43 scoped_refptr<CertificateDetails>* result); | 43 scoped_refptr<CertificateDetails>* result); |
| 44 Response ShowCertificateViewer(int certificate_id); | 44 Response ShowCertificateViewer(int certificate_id); |
| 45 | 45 |
| 46 private: | 46 private: |
| 47 void SendGetCookiesResponse( | 47 void SendGetCookiesResponse( |
| 48 DevToolsCommandId command_id, | 48 DevToolsCommandId command_id, |
| 49 const net::CookieList& cookie_list); | 49 const net::CookieList& cookie_list); |
| 50 void SendDeleteCookieResponse(DevToolsCommandId command_id); | 50 void SendDeleteCookieResponse(DevToolsCommandId command_id); |
| 51 | 51 |
| 52 RenderFrameHostImpl* host_; | 52 RenderFrameHostImpl* host_; |
| 53 scoped_ptr<Client> client_; | 53 std::unique_ptr<Client> client_; |
| 54 base::WeakPtrFactory<NetworkHandler> weak_factory_; | 54 base::WeakPtrFactory<NetworkHandler> weak_factory_; |
| 55 | 55 |
| 56 DISALLOW_COPY_AND_ASSIGN(NetworkHandler); | 56 DISALLOW_COPY_AND_ASSIGN(NetworkHandler); |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 } // namespace network | 59 } // namespace network |
| 60 } // namespace devtools | 60 } // namespace devtools |
| 61 } // namespace content | 61 } // namespace content |
| 62 | 62 |
| 63 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_NETWORK_HANDLER_H_ | 63 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_NETWORK_HANDLER_H_ |
| OLD | NEW |