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

Unified Diff: content/child/site_isolation_stats_gatherer.cc

Issue 2557673006: Move Origin::GetURL() out of resource request critical path (Closed)
Patch Set: Created 4 years 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/child/site_isolation_stats_gatherer.h ('k') | content/child/url_response_body_consumer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/site_isolation_stats_gatherer.cc
diff --git a/content/child/site_isolation_stats_gatherer.cc b/content/child/site_isolation_stats_gatherer.cc
index 1cdea5ff8c0fac323dc97befb300d24ae28d2ba6..aeea241a06e6a86615854fff414aa39ce3e73655 100644
--- a/content/child/site_isolation_stats_gatherer.cc
+++ b/content/child/site_isolation_stats_gatherer.cc
@@ -98,7 +98,7 @@ void SiteIsolationStatsGatherer::SetEnabled(bool enabled) {
std::unique_ptr<SiteIsolationResponseMetaData>
SiteIsolationStatsGatherer::OnReceivedResponse(
- const GURL& frame_origin,
+ const url::Origin& frame_origin,
const GURL& response_url,
ResourceType resource_type,
int origin_pid,
@@ -124,7 +124,10 @@ SiteIsolationStatsGatherer::OnReceivedResponse(
if (!CrossSiteDocumentClassifier::IsBlockableScheme(response_url))
return nullptr;
- if (CrossSiteDocumentClassifier::IsSameSite(frame_origin, response_url))
+ // TODO(csharrison): Add a path for IsSameSite/IsValidCorsHeaderSet to take an
+ // Origin.
ncarter (slow) 2016/12/08 21:39:49 Another option here is to delete this class, or en
Charlie Harrison 2016/12/08 21:57:33 I think once the CL I referenced lands, it will be
+ GURL frame_origin_url = frame_origin.GetURL();
+ if (CrossSiteDocumentClassifier::IsSameSite(frame_origin_url, response_url))
return nullptr;
CrossSiteDocumentMimeType canonical_mime_type =
@@ -143,7 +146,7 @@ SiteIsolationStatsGatherer::OnReceivedResponse(
info.headers->EnumerateHeader(NULL, "access-control-allow-origin",
&access_control_origin);
if (CrossSiteDocumentClassifier::IsValidCorsHeaderSet(
- frame_origin, response_url, access_control_origin))
+ frame_origin_url, response_url, access_control_origin))
return nullptr;
// Real XSD data collection starts from here.
@@ -152,7 +155,7 @@ SiteIsolationStatsGatherer::OnReceivedResponse(
std::unique_ptr<SiteIsolationResponseMetaData> resp_data(
new SiteIsolationResponseMetaData);
- resp_data->frame_origin = frame_origin.spec();
+ resp_data->frame_origin = frame_origin_url.spec();
resp_data->response_url = response_url;
resp_data->resource_type = resource_type;
resp_data->canonical_mime_type = canonical_mime_type;
« no previous file with comments | « content/child/site_isolation_stats_gatherer.h ('k') | content/child/url_response_body_consumer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698