| 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 <memory> |
| 9 |
| 8 #include "base/macros.h" | 10 #include "base/macros.h" |
| 9 #include "content/browser/devtools/protocol/devtools_domain_handler.h" | 11 #include "content/browser/devtools/protocol/devtools_domain_handler.h" |
| 10 #include "content/browser/devtools/protocol/network.h" | 12 #include "content/browser/devtools/protocol/network.h" |
| 11 #include "net/cookies/canonical_cookie.h" | 13 #include "net/cookies/canonical_cookie.h" |
| 12 | 14 |
| 13 namespace content { | 15 namespace content { |
| 14 | 16 |
| 15 class DevToolsSession; | 17 class DevToolsSession; |
| 16 class RenderFrameHostImpl; | 18 class RenderFrameHostImpl; |
| 19 struct ResourceRequest; |
| 20 struct ResourceRequestCompletionStatus; |
| 21 struct ResourceResponseHead; |
| 17 | 22 |
| 18 namespace protocol { | 23 namespace protocol { |
| 19 | 24 |
| 20 class NetworkHandler : public DevToolsDomainHandler, | 25 class NetworkHandler : public DevToolsDomainHandler, |
| 21 public Network::Backend { | 26 public Network::Backend { |
| 22 public: | 27 public: |
| 23 NetworkHandler(); | 28 NetworkHandler(); |
| 24 ~NetworkHandler() override; | 29 ~NetworkHandler() override; |
| 25 | 30 |
| 26 static NetworkHandler* FromSession(DevToolsSession* session); | 31 static NetworkHandler* FromSession(DevToolsSession* session); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 49 Maybe<std::string> path, | 54 Maybe<std::string> path, |
| 50 Maybe<bool> secure, | 55 Maybe<bool> secure, |
| 51 Maybe<bool> http_only, | 56 Maybe<bool> http_only, |
| 52 Maybe<std::string> same_site, | 57 Maybe<std::string> same_site, |
| 53 Maybe<double> expires, | 58 Maybe<double> expires, |
| 54 std::unique_ptr<SetCookieCallback> callback) override; | 59 std::unique_ptr<SetCookieCallback> callback) override; |
| 55 | 60 |
| 56 Response SetUserAgentOverride(const std::string& user_agent) override; | 61 Response SetUserAgentOverride(const std::string& user_agent) override; |
| 57 Response CanEmulateNetworkConditions(bool* result) override; | 62 Response CanEmulateNetworkConditions(bool* result) override; |
| 58 | 63 |
| 64 void NavigationPreloadRequestSent(int worker_version_id, |
| 65 const std::string& request_id, |
| 66 const ResourceRequest& request); |
| 67 void NavigationPreloadResponseReceived(int worker_version_id, |
| 68 const std::string& request_id, |
| 69 const GURL& url, |
| 70 const ResourceResponseHead& head); |
| 71 void NavigationPreloadCompleted( |
| 72 const std::string& request_id, |
| 73 const ResourceRequestCompletionStatus& completion_status); |
| 74 |
| 59 bool enabled() const { return enabled_; } | 75 bool enabled() const { return enabled_; } |
| 60 std::string UserAgentOverride() const; | 76 std::string UserAgentOverride() const; |
| 61 | 77 |
| 62 private: | 78 private: |
| 79 std::unique_ptr<Network::Frontend> frontend_; |
| 63 RenderFrameHostImpl* host_; | 80 RenderFrameHostImpl* host_; |
| 64 bool enabled_; | 81 bool enabled_; |
| 65 std::string user_agent_; | 82 std::string user_agent_; |
| 66 | 83 |
| 67 DISALLOW_COPY_AND_ASSIGN(NetworkHandler); | 84 DISALLOW_COPY_AND_ASSIGN(NetworkHandler); |
| 68 }; | 85 }; |
| 69 | 86 |
| 70 } // namespace protocol | 87 } // namespace protocol |
| 71 } // namespace content | 88 } // namespace content |
| 72 | 89 |
| 73 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_NETWORK_HANDLER_H_ | 90 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_NETWORK_HANDLER_H_ |
| OLD | NEW |