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

Unified Diff: content/child/url_response_body_consumer.cc

Issue 2646753002: [Mojo-Loading] Implement "Site Isolation Stats Gathering" feature (Closed)
Patch Set: Created 3 years, 11 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/child/site_isolation_stats_gatherer_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/url_response_body_consumer.cc
diff --git a/content/child/url_response_body_consumer.cc b/content/child/url_response_body_consumer.cc
index 1e6859cc784b8571d1513a9d7e2d07be4a76e8c1..9e838796628a4b63a29c4a97891758a60b1278be 100644
--- a/content/child/url_response_body_consumer.cc
+++ b/content/child/url_response_body_consumer.cc
@@ -9,6 +9,7 @@
#include "base/macros.h"
#include "base/memory/ptr_util.h"
#include "content/child/resource_dispatcher.h"
+#include "content/child/site_isolation_stats_gatherer.h"
#include "content/common/resource_messages.h"
#include "content/common/resource_request_completion_status.h"
#include "content/public/child/request_peer.h"
@@ -143,6 +144,16 @@ void URLResponseBodyConsumer::OnReadable(MojoResult unused) {
ResourceDispatcher::PendingRequestInfo* request_info =
resource_dispatcher_->GetPendingRequestInfo(request_id_);
DCHECK(request_info);
+
+ // Check whether this response data is compliant with our cross-site
yhirano 2017/01/19 10:35:55 This code is copied from ResourceDispatcher::OnRec
+ // document blocking policy. We only do this for the first chunk of data.
+ if (request_info->site_isolation_metadata.get()) {
+ SiteIsolationStatsGatherer::OnReceivedFirstChunk(
+ request_info->site_isolation_metadata,
+ static_cast<const char*>(buffer), available);
+ request_info->site_isolation_metadata.reset();
+ }
+
request_info->peer->OnReceivedData(base::MakeUnique<ReceivedData>(
static_cast<const char*>(buffer), available, this));
}
« no previous file with comments | « content/child/site_isolation_stats_gatherer_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698