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

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

Issue 2291393003: Add capability to simple http server to bound Set-Cookie to URLs. (Closed)
Patch Set: Update comments Created 4 years, 4 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
Index: ios/web/public/test/response_providers/html_response_provider_impl.mm
diff --git a/ios/web/public/test/response_providers/html_response_provider_impl.mm b/ios/web/public/test/response_providers/html_response_provider_impl.mm
index 97f000df161467ee863cfb721c3d0272482c77ae..48f7115beb7b1a005db475798d03d6f0543cca9c 100644
--- a/ios/web/public/test/response_providers/html_response_provider_impl.mm
+++ b/ios/web/public/test/response_providers/html_response_provider_impl.mm
@@ -20,6 +20,20 @@
}
return responses;
}
+
+std::map<GURL, HtmlResponseProviderImpl::Response> BuildResponseMap(
+ const std::map<GURL, std::pair<std::string, std::string>>& responses,
+ const std::map<GURL, scoped_refptr<net::HttpResponseHeaders>>& headers) {
+ std::map<GURL, HtmlResponseProviderImpl::Response> response_map;
+ for (const std::pair<const GURL, std::pair<std::string, std::string>>& pair :
pkl (ping after 24h if needed) 2016/09/01 00:18:15 Can auto type make this for loop more readable? f
+ responses) {
+ response_map.insert(std::make_pair(
+ pair.first, HtmlResponseProviderImpl::Response(
+ pair.second.second, headers.at(pair.first))));
+ }
+ return response_map;
+}
+
} // namespace
HtmlResponseProviderImpl::Response::Response(
@@ -61,11 +75,10 @@
web::ResponseProvider::GetDefaultResponseHeaders())) {}
HtmlResponseProviderImpl::HtmlResponseProviderImpl(
- const std::map<GURL, std::string>& responses,
- const std::string& cookie)
+ const std::map<GURL, std::pair<std::string, std::string>>& responses)
: responses_(BuildResponseMap(
responses,
- web::ResponseProvider::GetDefaultResponseHeaders(cookie))) {}
+ web::ResponseProvider::GetDefaultResponseHeaders(responses))) {}
HtmlResponseProviderImpl::HtmlResponseProviderImpl(
const std::map<GURL, HtmlResponseProviderImpl::Response>& responses)

Powered by Google App Engine
This is Rietveld 408576698