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 #include "content/browser/devtools/protocol/network_handler.h" | 5 #include "content/browser/devtools/protocol/network_handler.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/containers/hash_tables.h" | 9 #include "base/containers/hash_tables.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 const std::string& path, | 123 const std::string& path, |
124 bool secure, | 124 bool secure, |
125 bool http_only, | 125 bool http_only, |
126 net::CookieSameSite same_site, | 126 net::CookieSameSite same_site, |
127 base::Time expires, | 127 base::Time expires, |
128 std::unique_ptr<SetCookieCallback> callback) { | 128 std::unique_ptr<SetCookieCallback> callback) { |
129 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 129 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
130 net::URLRequestContext* request_context = | 130 net::URLRequestContext* request_context = |
131 GetRequestContextOnIO(resource_context, context_getter, url); | 131 GetRequestContextOnIO(resource_context, context_getter, url); |
132 | 132 |
133 bool are_experimental_cookie_features_enabled = | |
134 request_context->network_delegate() | |
135 ->AreExperimentalCookieFeaturesEnabled(); | |
136 | |
137 request_context->cookie_store()->SetCookieWithDetailsAsync( | 133 request_context->cookie_store()->SetCookieWithDetailsAsync( |
138 url, name, value, domain, path, | 134 url, name, value, domain, path, |
139 base::Time(), | 135 base::Time(), |
140 expires, | 136 expires, |
141 base::Time(), | 137 base::Time(), |
142 secure, | 138 secure, |
143 http_only, | 139 http_only, |
144 same_site, | 140 same_site, |
145 are_experimental_cookie_features_enabled, | |
146 net::COOKIE_PRIORITY_DEFAULT, | 141 net::COOKIE_PRIORITY_DEFAULT, |
147 base::Bind(&CookieSetOnIO, base::Passed(std::move(callback)))); | 142 base::Bind(&CookieSetOnIO, base::Passed(std::move(callback)))); |
148 } | 143 } |
149 | 144 |
150 template <typename Callback> | 145 template <typename Callback> |
151 class GetCookiesCommandBase { | 146 class GetCookiesCommandBase { |
152 public: | 147 public: |
153 GetCookiesCommandBase(std::unique_ptr<Callback> callback) | 148 GetCookiesCommandBase(std::unique_ptr<Callback> callback) |
154 : callback_(std::move(callback)), request_count_(0) {} | 149 : callback_(std::move(callback)), request_count_(0) {} |
155 | 150 |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 *result = false; | 400 *result = false; |
406 return Response::OK(); | 401 return Response::OK(); |
407 } | 402 } |
408 | 403 |
409 std::string NetworkHandler::UserAgentOverride() const { | 404 std::string NetworkHandler::UserAgentOverride() const { |
410 return enabled_ ? user_agent_ : std::string(); | 405 return enabled_ ? user_agent_ : std::string(); |
411 } | 406 } |
412 | 407 |
413 } // namespace protocol | 408 } // namespace protocol |
414 } // namespace content | 409 } // namespace content |
OLD | NEW |