Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(414)

Unified Diff: ios/web/public/test/response_providers/response_provider.mm

Issue 2291393003: Add capability to simple http server to bound Set-Cookie to URLs. (Closed)
Patch Set: Addressed comments from Peter Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/web/public/test/response_providers/response_provider.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/public/test/response_providers/response_provider.mm
diff --git a/ios/web/public/test/response_providers/response_provider.mm b/ios/web/public/test/response_providers/response_provider.mm
index 00436cd6ba80861d4c6eebce08c0f35bda2188d5..22752a039c7ed2d50e2f9b6c39fd397ba4739981 100644
--- a/ios/web/public/test/response_providers/response_provider.mm
+++ b/ios/web/public/test/response_providers/response_provider.mm
@@ -50,11 +50,20 @@
}
// static
-scoped_refptr<net::HttpResponseHeaders>
-ResponseProvider::GetDefaultResponseHeaders(const std::string& cookie) {
- scoped_refptr<net::HttpResponseHeaders> result = GetDefaultResponseHeaders();
- result->AddCookie(cookie);
- return result;
+std::map<GURL, scoped_refptr<net::HttpResponseHeaders>>
+ResponseProvider::GetDefaultResponseHeaders(
+ const std::map<GURL, std::pair<std::string, std::string>>& responses) {
+ std::map<GURL, scoped_refptr<net::HttpResponseHeaders>> headers;
+ for (const auto& pair : responses) {
+ std::string cookie = pair.second.first;
+ scoped_refptr<net::HttpResponseHeaders> result =
+ GetDefaultResponseHeaders();
+ if (!cookie.empty()) {
+ result->AddCookie(cookie);
+ }
+ headers.insert(std::make_pair(pair.first, result));
+ }
+ return headers;
}
// static
« no previous file with comments | « ios/web/public/test/response_providers/response_provider.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698