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

Unified Diff: content/browser/security_exploit_browsertest.cc

Issue 1977313002: Define parameter structs of resource messages out of resource_messages.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « content/browser/loader/resource_message_filter.h ('k') | content/child/request_extra_data.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/security_exploit_browsertest.cc
diff --git a/content/browser/security_exploit_browsertest.cc b/content/browser/security_exploit_browsertest.cc
index 07e84bb284639fd7ccff134244b8fdae3e13326d..e225045e0a0e8856ab2ea973ea552bbaa44d50b8 100644
--- a/content/browser/security_exploit_browsertest.cc
+++ b/content/browser/security_exploit_browsertest.cc
@@ -18,6 +18,7 @@
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/common/frame_messages.h"
#include "content/common/resource_messages.h"
+#include "content/common/resource_request.h"
#include "content/common/view_messages.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/content_browser_client.h"
@@ -106,8 +107,8 @@ RenderViewHostImpl* PrepareToDuplicateHosts(Shell* shell,
return next_rfh->render_view_host();
}
-ResourceHostMsg_Request CreateXHRRequest(const char* url) {
- ResourceHostMsg_Request request;
+ResourceRequest CreateXHRRequest(const char* url) {
+ ResourceRequest request;
request.method = "GET";
request.url = GURL(url);
request.referrer_policy = blink::WebReferrerPolicyDefault;
@@ -126,9 +127,8 @@ ResourceHostMsg_Request CreateXHRRequest(const char* url) {
return request;
}
-ResourceHostMsg_Request CreateXHRRequestWithOrigin(const char* origin) {
- ResourceHostMsg_Request request =
- CreateXHRRequest("http://bar.com/simple_page.html");
+ResourceRequest CreateXHRRequestWithOrigin(const char* origin) {
+ ResourceRequest request = CreateXHRRequest("http://bar.com/simple_page.html");
request.first_party_for_cookies = GURL(origin);
request.headers = base::StringPrintf("Origin: %s\r\n", origin);
return request;
@@ -148,7 +148,7 @@ void TryCreateDuplicateRequestIds(Shell* shell, bool block_loaders) {
// blocks indefinitely, which is good because the request stays alive and the
// test can try to reuse the request id without a race.
const char* blocking_url = net::URLRequestSlowDownloadJob::kUnknownSizeUrl;
- ResourceHostMsg_Request request(CreateXHRRequest(blocking_url));
+ ResourceRequest request(CreateXHRRequest(blocking_url));
// Use the same request id twice.
RenderProcessHostWatcher process_killed(
@@ -414,13 +414,12 @@ class IsolatedAppContentBrowserClient : public TestContentBrowserClient {
// Renderer processes should not be able to spoof Origin HTTP headers.
IN_PROC_BROWSER_TEST_F(SecurityExploitBrowserTest, InvalidOriginHeaders) {
// Create a set of IPC messages with various Origin headers.
- ResourceHostMsg_Request chrome_origin_msg(
+ ResourceRequest chrome_origin_msg(
CreateXHRRequestWithOrigin("chrome://settings"));
- ResourceHostMsg_Request embedder_isolated_origin_msg(
+ ResourceRequest embedder_isolated_origin_msg(
CreateXHRRequestWithOrigin("https://isolated.bar.com"));
- ResourceHostMsg_Request invalid_origin_msg(
- CreateXHRRequestWithOrigin("invalidurl"));
- ResourceHostMsg_Request invalid_scheme_origin_msg(
+ ResourceRequest invalid_origin_msg(CreateXHRRequestWithOrigin("invalidurl"));
+ ResourceRequest invalid_scheme_origin_msg(
CreateXHRRequestWithOrigin("fake-scheme://foo"));
GURL web_url("http://foo.com/simple_page.html");
@@ -443,7 +442,7 @@ IN_PROC_BROWSER_TEST_F(SecurityExploitBrowserTest, InvalidOriginHeaders) {
// Web processes cannot make XHRs with URLs that the content embedder expects
// to have process isolation. Ideally this would test chrome-extension://
// URLs for Chrome Apps, but those can't be tested inside content/ and the
- // ResourceHostMsg_Request IPC can't be created in a test outside content/.
+ // ResourceRequest IPC can't be created in a test outside content/.
NavigateToURL(shell(), web_url);
{
// Set up a ContentBrowserClient that simulates an app URL in a non-app
« no previous file with comments | « content/browser/loader/resource_message_filter.h ('k') | content/child/request_extra_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698