Index: content/common/net/url_request_devtools_user_data.h |
diff --git a/content/common/net/url_request_devtools_user_data.h b/content/common/net/url_request_devtools_user_data.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..1c82d99512292cd56197ad7750b44ab46de39e45 |
--- /dev/null |
+++ b/content/common/net/url_request_devtools_user_data.h |
@@ -0,0 +1,42 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CONTENT_COMMON_NET_URL_REQUEST_DEVTOOLS_USER_DATA_H_ |
+#define CONTENT_COMMON_NET_URL_REQUEST_DEVTOOLS_USER_DATA_H_ |
+ |
+#include "base/supports_user_data.h" |
+ |
+namespace content { |
+ |
+// Used to annotate all URLRequests for which the request can be associated |
+// with a given DevToolsAgentHost. |
+class URLRequestDevtoolsUserData : public base::SupportsUserData::Data { |
+ public: |
+ URLRequestDevtoolsUserData(const std::string& devtools_agent_host_id, |
+ const std::string& devtools_request_id); |
+ ~URLRequestDevtoolsUserData() override; |
+ |
+ const std::string& devtools_agent_host_id() const { |
+ return devtools_agent_host_id_; |
+ } |
+ |
+ const std::string& devtools_request_id() const { |
+ return devtools_request_id_; |
+ } |
+ |
+ bool is_redirect() const { return is_redirect_; } |
+ |
+ void SetIsRedirect(bool is_redirect) { is_redirect_ = is_redirect; } |
+ |
+ static const void* kUserDataKey; |
+ |
+ private: |
+ const std::string devtools_agent_host_id_; |
+ const std::string devtools_request_id_; |
+ bool is_redirect_; |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_COMMON_NET_URL_REQUEST_DEVTOOLS_USER_DATA_H_ |