| 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/barrier_closure.h" |
| 9 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
| 10 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
| 11 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 12 #include "content/browser/devtools/devtools_session.h" | 13 #include "content/browser/devtools/devtools_session.h" |
| 13 #include "content/browser/frame_host/frame_tree_node.h" | 14 #include "content/browser/frame_host/frame_tree_node.h" |
| 14 #include "content/browser/frame_host/render_frame_host_impl.h" | 15 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 15 #include "content/public/browser/browser_context.h" | 16 #include "content/public/browser/browser_context.h" |
| 16 #include "content/public/browser/browser_thread.h" | 17 #include "content/public/browser/browser_thread.h" |
| 17 #include "content/public/browser/content_browser_client.h" | 18 #include "content/public/browser/content_browser_client.h" |
| 18 #include "content/public/browser/render_process_host.h" | 19 #include "content/public/browser/render_process_host.h" |
| 19 #include "content/public/browser/resource_context.h" | 20 #include "content/public/browser/resource_context.h" |
| 20 #include "content/public/browser/site_instance.h" | 21 #include "content/public/browser/site_instance.h" |
| 21 #include "content/public/browser/storage_partition.h" | 22 #include "content/public/browser/storage_partition.h" |
| 22 #include "content/public/browser/web_contents.h" | 23 #include "content/public/browser/web_contents.h" |
| 23 #include "content/public/common/content_client.h" | 24 #include "content/public/common/content_client.h" |
| 24 #include "net/cookies/cookie_store.h" | 25 #include "net/cookies/cookie_store.h" |
| 25 #include "net/url_request/url_request_context.h" | 26 #include "net/url_request/url_request_context.h" |
| 26 #include "net/url_request/url_request_context_getter.h" | 27 #include "net/url_request/url_request_context_getter.h" |
| 27 | 28 |
| 28 namespace content { | 29 namespace content { |
| 29 namespace protocol { | 30 namespace protocol { |
| 30 namespace { | 31 namespace { |
| 31 | 32 |
| 33 using ProtocolCookieArray = protocol::Array<Network::Cookie>; |
| 32 using GetCookiesCallback = protocol::Network::Backend::GetCookiesCallback; | 34 using GetCookiesCallback = protocol::Network::Backend::GetCookiesCallback; |
| 33 using GetAllCookiesCallback = protocol::Network::Backend::GetAllCookiesCallback; | 35 using GetAllCookiesCallback = protocol::Network::Backend::GetAllCookiesCallback; |
| 34 using SetCookieCallback = protocol::Network::Backend::SetCookieCallback; | 36 using SetCookieCallback = protocol::Network::Backend::SetCookieCallback; |
| 35 using DeleteCookieCallback = protocol::Network::Backend::DeleteCookieCallback; | 37 using DeleteCookieCallback = protocol::Network::Backend::DeleteCookieCallback; |
| 36 | 38 |
| 37 net::URLRequestContext* GetRequestContextOnIO( | 39 net::URLRequestContext* GetRequestContextOnIO( |
| 38 ResourceContext* resource_context, | 40 ResourceContext* resource_context, |
| 39 net::URLRequestContextGetter* context_getter, | 41 net::URLRequestContextGetter* context_getter, |
| 40 const GURL& url) { | 42 const GURL& url) { |
| 41 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 43 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 42 net::URLRequestContext* context = | 44 net::URLRequestContext* context = |
| 43 GetContentClient()->browser()->OverrideRequestContextForURL( | 45 GetContentClient()->browser()->OverrideRequestContextForURL( |
| 44 url, resource_context); | 46 url, resource_context); |
| 45 if (!context) | 47 if (!context) |
| 46 context = context_getter->GetURLRequestContext(); | 48 context = context_getter->GetURLRequestContext(); |
| 47 return context; | 49 return context; |
| 48 } | 50 } |
| 49 | 51 |
| 50 void GotCookiesOnIO( | 52 class CookieRetriever : public base::RefCountedThreadSafe<CookieRetriever> { |
| 51 const net::CookieStore::GetCookieListCallback& callback, | 53 public: |
| 52 const net::CookieList& cookie_list) { | 54 CookieRetriever(std::unique_ptr<GetCookiesCallback> callback) |
| 53 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 55 : callback_(std::move(callback)), |
| 54 BrowserThread::PostTask( | 56 all_callback_(nullptr) {} |
| 55 BrowserThread::UI, | |
| 56 FROM_HERE, | |
| 57 base::Bind(callback, cookie_list)); | |
| 58 } | |
| 59 | 57 |
| 60 void GetCookiesForURLOnIO( | 58 CookieRetriever(std::unique_ptr<GetAllCookiesCallback> callback) |
| 61 ResourceContext* resource_context, | 59 : callback_(nullptr), |
| 62 net::URLRequestContextGetter* context_getter, | 60 all_callback_(std::move(callback)) {} |
| 63 const GURL& url, | |
| 64 const net::CookieStore::GetCookieListCallback& callback) { | |
| 65 DCHECK_CURRENTLY_ON(BrowserThread::IO); | |
| 66 net::URLRequestContext* request_context = | |
| 67 GetRequestContextOnIO(resource_context, context_getter, url); | |
| 68 request_context->cookie_store()->GetAllCookiesForURLAsync( | |
| 69 url, base::Bind(&GotCookiesOnIO, callback)); | |
| 70 } | |
| 71 | 61 |
| 72 void GetAllCookiesOnIO( | 62 void RetrieveCookiesOnIO( |
| 73 ResourceContext* resource_context, | 63 ResourceContext* resource_context, |
| 74 net::URLRequestContextGetter* context_getter, | 64 net::URLRequestContextGetter* context_getter, |
| 75 const net::CookieStore::GetCookieListCallback& callback) { | 65 const std::vector<GURL>& urls) { |
| 76 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 66 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 77 net::URLRequestContext* request_context = | 67 callback_count_ = urls.size(); |
| 78 context_getter->GetURLRequestContext(); | 68 |
| 79 request_context->cookie_store()->GetAllCookiesAsync( | 69 if (callback_count_ == 0) { |
| 80 base::Bind(&GotCookiesOnIO, callback)); | 70 GotAllCookies(); |
| 81 } | 71 return; |
| 72 } |
| 73 |
| 74 for (const GURL& url : urls) { |
| 75 net::URLRequestContext* request_context = |
| 76 GetRequestContextOnIO(resource_context, context_getter, url); |
| 77 request_context->cookie_store()->GetAllCookiesForURLAsync(url, |
| 78 base::Bind(&CookieRetriever::GotCookies, this)); |
| 79 } |
| 80 } |
| 81 |
| 82 void RetrieveAllCookiesOnIO( |
| 83 ResourceContext* resource_context, |
| 84 net::URLRequestContextGetter* context_getter) { |
| 85 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 86 callback_count_ = 1; |
| 87 |
| 88 net::URLRequestContext* request_context = |
| 89 context_getter->GetURLRequestContext(); |
| 90 request_context->cookie_store()->GetAllCookiesAsync( |
| 91 base::Bind(&CookieRetriever::GotCookies, this)); |
| 92 } |
| 93 protected: |
| 94 virtual ~CookieRetriever() {} |
| 95 |
| 96 void GotCookies(const net::CookieList& cookie_list) { |
| 97 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 98 for (const net::CanonicalCookie& cookie : cookie_list) { |
| 99 std::string key = base::StringPrintf( |
| 100 "%s::%s::%s::%d", cookie.Name().c_str(), cookie.Domain().c_str(), |
| 101 cookie.Path().c_str(), cookie.IsSecure()); |
| 102 cookies_[key] = cookie; |
| 103 } |
| 104 |
| 105 --callback_count_; |
| 106 if (callback_count_ == 0) |
| 107 GotAllCookies(); |
| 108 } |
| 109 |
| 110 void GotAllCookies() { |
| 111 net::CookieList master_cookie_list; |
| 112 for (const auto& pair : cookies_) |
| 113 master_cookie_list.push_back(pair.second); |
| 114 |
| 115 BrowserThread::PostTask( |
| 116 BrowserThread::UI, |
| 117 FROM_HERE, |
| 118 base::Bind(&CookieRetriever::SendCookiesResponseOnUI, |
| 119 this, |
| 120 master_cookie_list)); |
| 121 } |
| 122 |
| 123 void SendCookiesResponseOnUI(const net::CookieList& cookie_list) { |
| 124 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 125 std::unique_ptr<ProtocolCookieArray> cookies = |
| 126 ProtocolCookieArray::create(); |
| 127 |
| 128 for (const net::CanonicalCookie& cookie : cookie_list) { |
| 129 std::unique_ptr<Network::Cookie> devtools_cookie = |
| 130 Network::Cookie::Create() |
| 131 .SetName(cookie.Name()) |
| 132 .SetValue(cookie.Value()) |
| 133 .SetDomain(cookie.Domain()) |
| 134 .SetPath(cookie.Path()) |
| 135 .SetExpires(cookie.ExpiryDate().ToDoubleT() * 1000) |
| 136 .SetSize(cookie.Name().length() + cookie.Value().length()) |
| 137 .SetHttpOnly(cookie.IsHttpOnly()) |
| 138 .SetSecure(cookie.IsSecure()) |
| 139 .SetSession(!cookie.IsPersistent()) |
| 140 .Build(); |
| 141 |
| 142 switch (cookie.SameSite()) { |
| 143 case net::CookieSameSite::STRICT_MODE: |
| 144 devtools_cookie->SetSameSite(Network::CookieSameSiteEnum::Strict); |
| 145 break; |
| 146 case net::CookieSameSite::LAX_MODE: |
| 147 devtools_cookie->SetSameSite(Network::CookieSameSiteEnum::Lax); |
| 148 break; |
| 149 case net::CookieSameSite::NO_RESTRICTION: |
| 150 break; |
| 151 } |
| 152 |
| 153 cookies->addItem(std::move(devtools_cookie)); |
| 154 } |
| 155 |
| 156 if (callback_) { |
| 157 callback_->sendSuccess(std::move(cookies)); |
| 158 } else { |
| 159 DCHECK(all_callback_); |
| 160 all_callback_->sendSuccess(std::move(cookies)); |
| 161 } |
| 162 } |
| 163 |
| 164 std::unique_ptr<GetCookiesCallback> callback_; |
| 165 std::unique_ptr<GetAllCookiesCallback> all_callback_; |
| 166 int callback_count_ = 0; |
| 167 std::unordered_map<std::string, net::CanonicalCookie> cookies_; |
| 168 |
| 169 private: |
| 170 friend class base::RefCountedThreadSafe<CookieRetriever>; |
| 171 }; |
| 82 | 172 |
| 83 void DeletedCookieOnIO(std::unique_ptr<DeleteCookieCallback> callback) { | 173 void DeletedCookieOnIO(std::unique_ptr<DeleteCookieCallback> callback) { |
| 84 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 174 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 85 BrowserThread::PostTask( | 175 BrowserThread::PostTask( |
| 86 BrowserThread::UI, | 176 BrowserThread::UI, |
| 87 FROM_HERE, | 177 FROM_HERE, |
| 88 base::Bind(&DeleteCookieCallback::sendSuccess, | 178 base::Bind(&DeleteCookieCallback::sendSuccess, |
| 89 base::Passed(std::move(callback)))); | 179 base::Passed(std::move(callback)))); |
| 90 } | 180 } |
| 91 | 181 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 expires, | 230 expires, |
| 141 base::Time(), | 231 base::Time(), |
| 142 secure, | 232 secure, |
| 143 http_only, | 233 http_only, |
| 144 same_site, | 234 same_site, |
| 145 are_experimental_cookie_features_enabled, | 235 are_experimental_cookie_features_enabled, |
| 146 net::COOKIE_PRIORITY_DEFAULT, | 236 net::COOKIE_PRIORITY_DEFAULT, |
| 147 base::Bind(&CookieSetOnIO, base::Passed(std::move(callback)))); | 237 base::Bind(&CookieSetOnIO, base::Passed(std::move(callback)))); |
| 148 } | 238 } |
| 149 | 239 |
| 150 template <typename Callback> | 240 std::vector<GURL> ComputeCookieURLs( |
| 151 class GetCookiesCommandBase { | 241 RenderFrameHostImpl* frame_host, |
| 152 public: | 242 Maybe<protocol::Array<String>>& protocol_urls) { |
| 153 GetCookiesCommandBase(std::unique_ptr<Callback> callback) | 243 std::vector<GURL> urls; |
| 154 : callback_(std::move(callback)), request_count_(0) {} | |
| 155 | 244 |
| 156 protected: | 245 if (protocol_urls.isJust()) { |
| 157 void GotCookiesForURL(const net::CookieList& cookie_list) { | 246 std::unique_ptr<protocol::Array<std::string>> actual_urls = |
| 158 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 247 protocol_urls.takeJust(); |
| 159 for (const net::CanonicalCookie& cookie : cookie_list) { | |
| 160 std::string key = base::StringPrintf( | |
| 161 "%s::%s::%s::%d", cookie.Name().c_str(), cookie.Domain().c_str(), | |
| 162 cookie.Path().c_str(), cookie.IsSecure()); | |
| 163 cookies_[key] = cookie; | |
| 164 } | |
| 165 --request_count_; | |
| 166 if (!request_count_) { | |
| 167 SendResponse(); | |
| 168 delete this; | |
| 169 } | |
| 170 } | |
| 171 | 248 |
| 172 void SendResponse() { | 249 for (size_t i = 0; i < actual_urls->length(); i++) |
| 173 std::unique_ptr<protocol::Array<Network::Cookie>> cookies = | 250 urls.push_back(GURL(actual_urls->get(i))); |
| 174 protocol::Array<Network::Cookie>::create(); | 251 } else { |
| 175 for (const auto& pair : cookies_) { | |
| 176 const net::CanonicalCookie& cookie = pair.second; | |
| 177 std::unique_ptr<Network::Cookie> devtools_cookie = | |
| 178 Network::Cookie::Create() | |
| 179 .SetName(cookie.Name()) | |
| 180 .SetValue(cookie.Value()) | |
| 181 .SetDomain(cookie.Domain()) | |
| 182 .SetPath(cookie.Path()) | |
| 183 .SetExpires(cookie.ExpiryDate().ToDoubleT() * 1000) | |
| 184 .SetSize(cookie.Name().length() + cookie.Value().length()) | |
| 185 .SetHttpOnly(cookie.IsHttpOnly()) | |
| 186 .SetSecure(cookie.IsSecure()) | |
| 187 .SetSession(!cookie.IsPersistent()) | |
| 188 .Build(); | |
| 189 | |
| 190 switch (cookie.SameSite()) { | |
| 191 case net::CookieSameSite::STRICT_MODE: | |
| 192 devtools_cookie->SetSameSite(Network::CookieSameSiteEnum::Strict); | |
| 193 break; | |
| 194 case net::CookieSameSite::LAX_MODE: | |
| 195 devtools_cookie->SetSameSite(Network::CookieSameSiteEnum::Lax); | |
| 196 break; | |
| 197 case net::CookieSameSite::NO_RESTRICTION: | |
| 198 break; | |
| 199 } | |
| 200 cookies->addItem(std::move(devtools_cookie)); | |
| 201 } | |
| 202 callback_->sendSuccess(std::move(cookies)); | |
| 203 } | |
| 204 | |
| 205 std::unique_ptr<Callback> callback_; | |
| 206 int request_count_; | |
| 207 base::hash_map<std::string, net::CanonicalCookie> cookies_; | |
| 208 }; | |
| 209 | |
| 210 class GetCookiesCommand : public GetCookiesCommandBase<GetCookiesCallback> { | |
| 211 public: | |
| 212 GetCookiesCommand(RenderFrameHostImpl* frame_host, | |
| 213 std::unique_ptr<GetCookiesCallback> callback) | |
| 214 : GetCookiesCommandBase(std::move(callback)) { | |
| 215 net::CookieStore::GetCookieListCallback got_cookies_callback = base::Bind( | |
| 216 &GetCookiesCommand::GotCookiesForURL, base::Unretained(this)); | |
| 217 | |
| 218 std::queue<FrameTreeNode*> queue; | 252 std::queue<FrameTreeNode*> queue; |
| 219 queue.push(frame_host->frame_tree_node()); | 253 queue.push(frame_host->frame_tree_node()); |
| 220 while (!queue.empty()) { | 254 while (!queue.empty()) { |
| 221 FrameTreeNode* node = queue.front(); | 255 FrameTreeNode* node = queue.front(); |
| 222 queue.pop(); | 256 queue.pop(); |
| 223 | 257 |
| 224 // Only traverse nodes with the same local root. | 258 urls.push_back(node->current_url()); |
| 225 if (node->current_frame_host()->IsCrossProcessSubframe()) | |
| 226 continue; | |
| 227 ++request_count_; | |
| 228 BrowserThread::PostTask( | |
| 229 BrowserThread::IO, FROM_HERE, | |
| 230 base::Bind(&GetCookiesForURLOnIO, | |
| 231 base::Unretained(frame_host->GetSiteInstance() | |
| 232 ->GetBrowserContext() | |
| 233 ->GetResourceContext()), | |
| 234 base::Unretained(frame_host->GetProcess() | |
| 235 ->GetStoragePartition() | |
| 236 ->GetURLRequestContext()), | |
| 237 node->current_url(), got_cookies_callback)); | |
| 238 | |
| 239 for (size_t i = 0; i < node->child_count(); ++i) | 259 for (size_t i = 0; i < node->child_count(); ++i) |
| 240 queue.push(node->child_at(i)); | 260 queue.push(node->child_at(i)); |
| 241 } | 261 } |
| 242 } | 262 } |
| 243 }; | |
| 244 | 263 |
| 245 class GetAllCookiesCommand | 264 return urls; |
| 246 : public GetCookiesCommandBase<GetAllCookiesCallback> { | 265 } |
| 247 public: | |
| 248 GetAllCookiesCommand(RenderFrameHostImpl* frame_host, | |
| 249 std::unique_ptr<GetAllCookiesCallback> callback) | |
| 250 : GetCookiesCommandBase(std::move(callback)) { | |
| 251 net::CookieStore::GetCookieListCallback got_cookies_callback = base::Bind( | |
| 252 &GetAllCookiesCommand::GotCookiesForURL, base::Unretained(this)); | |
| 253 | |
| 254 request_count_ = 1; | |
| 255 BrowserThread::PostTask( | |
| 256 BrowserThread::IO, FROM_HERE, | |
| 257 base::Bind(&GetAllCookiesOnIO, | |
| 258 base::Unretained(frame_host->GetSiteInstance() | |
| 259 ->GetBrowserContext() | |
| 260 ->GetResourceContext()), | |
| 261 base::Unretained(frame_host->GetProcess() | |
| 262 ->GetStoragePartition() | |
| 263 ->GetURLRequestContext()), | |
| 264 got_cookies_callback)); | |
| 265 } | |
| 266 }; | |
| 267 | 266 |
| 268 } // namespace | 267 } // namespace |
| 269 | 268 |
| 270 NetworkHandler::NetworkHandler() | 269 NetworkHandler::NetworkHandler() |
| 271 : DevToolsDomainHandler(Network::Metainfo::domainName), | 270 : DevToolsDomainHandler(Network::Metainfo::domainName), |
| 272 host_(nullptr), | 271 host_(nullptr), |
| 273 enabled_(false) { | 272 enabled_(false) { |
| 274 } | 273 } |
| 275 | 274 |
| 276 NetworkHandler::~NetworkHandler() { | 275 NetworkHandler::~NetworkHandler() { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 return Response::OK(); | 307 return Response::OK(); |
| 309 } | 308 } |
| 310 | 309 |
| 311 Response NetworkHandler::ClearBrowserCookies() { | 310 Response NetworkHandler::ClearBrowserCookies() { |
| 312 if (host_) | 311 if (host_) |
| 313 GetContentClient()->browser()->ClearCookies(host_); | 312 GetContentClient()->browser()->ClearCookies(host_); |
| 314 return Response::OK(); | 313 return Response::OK(); |
| 315 } | 314 } |
| 316 | 315 |
| 317 void NetworkHandler::GetCookies( | 316 void NetworkHandler::GetCookies( |
| 317 Maybe<protocol::Array<String>> protocol_urls, |
| 318 std::unique_ptr<GetCookiesCallback> callback) { | 318 std::unique_ptr<GetCookiesCallback> callback) { |
| 319 if (!host_) | 319 if (!host_) { |
| 320 callback->sendFailure(Response::InternalError()); | 320 callback->sendFailure(Response::InternalError()); |
| 321 else | 321 return; |
| 322 new GetCookiesCommand(host_, std::move(callback)); | 322 } |
| 323 |
| 324 std::vector<GURL> urls = ComputeCookieURLs(host_, protocol_urls); |
| 325 scoped_refptr<CookieRetriever> retriever = |
| 326 new CookieRetriever(std::move(callback)); |
| 327 |
| 328 BrowserThread::PostTask( |
| 329 BrowserThread::IO, FROM_HERE, |
| 330 base::Bind(&CookieRetriever::RetrieveCookiesOnIO, |
| 331 retriever, |
| 332 base::Unretained(host_->GetSiteInstance() |
| 333 ->GetBrowserContext() |
| 334 ->GetResourceContext()), |
| 335 base::Unretained(host_->GetProcess() |
| 336 ->GetStoragePartition() |
| 337 ->GetURLRequestContext()), |
| 338 urls)); |
| 323 } | 339 } |
| 324 | 340 |
| 325 void NetworkHandler::GetAllCookies( | 341 void NetworkHandler::GetAllCookies( |
| 326 std::unique_ptr<GetAllCookiesCallback> callback) { | 342 std::unique_ptr<GetAllCookiesCallback> callback) { |
| 327 if (!host_) | 343 if (!host_) { |
| 328 callback->sendFailure(Response::InternalError()); | 344 callback->sendFailure(Response::InternalError()); |
| 329 else | 345 return; |
| 330 new GetAllCookiesCommand(host_, std::move(callback)); | 346 } |
| 347 |
| 348 scoped_refptr<CookieRetriever> retriever = |
| 349 new CookieRetriever(std::move(callback)); |
| 350 |
| 351 BrowserThread::PostTask( |
| 352 BrowserThread::IO, FROM_HERE, |
| 353 base::Bind(&CookieRetriever::RetrieveAllCookiesOnIO, |
| 354 retriever, |
| 355 base::Unretained(host_->GetSiteInstance() |
| 356 ->GetBrowserContext() |
| 357 ->GetResourceContext()), |
| 358 base::Unretained(host_->GetProcess() |
| 359 ->GetStoragePartition() |
| 360 ->GetURLRequestContext()))); |
| 331 } | 361 } |
| 332 | 362 |
| 333 void NetworkHandler::SetCookie( | 363 void NetworkHandler::SetCookie( |
| 334 const std::string& url, | 364 const std::string& url, |
| 335 const std::string& name, | 365 const std::string& name, |
| 336 const std::string& value, | 366 const std::string& value, |
| 337 Maybe<std::string> domain, | 367 Maybe<std::string> domain, |
| 338 Maybe<std::string> path, | 368 Maybe<std::string> path, |
| 339 Maybe<bool> secure, | 369 Maybe<bool> secure, |
| 340 Maybe<bool> http_only, | 370 Maybe<bool> http_only, |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 *result = false; | 435 *result = false; |
| 406 return Response::OK(); | 436 return Response::OK(); |
| 407 } | 437 } |
| 408 | 438 |
| 409 std::string NetworkHandler::UserAgentOverride() const { | 439 std::string NetworkHandler::UserAgentOverride() const { |
| 410 return enabled_ ? user_agent_ : std::string(); | 440 return enabled_ ? user_agent_ : std::string(); |
| 411 } | 441 } |
| 412 | 442 |
| 413 } // namespace protocol | 443 } // namespace protocol |
| 414 } // namespace content | 444 } // namespace content |
| OLD | NEW |