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

Unified Diff: content/child/resource_dispatcher.cc

Issue 22254005: UMA data collector for cross-site documents(XSD) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: a problem with refcounted is fixed Created 7 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: content/child/resource_dispatcher.cc
diff --git a/content/child/resource_dispatcher.cc b/content/child/resource_dispatcher.cc
index 424902fb0411288794a78d12f8710e7034edd9d5..67b062585a2dbbe89ec7d8e7b776bcf73a1272bd 100644
--- a/content/child/resource_dispatcher.cc
+++ b/content/child/resource_dispatcher.cc
@@ -16,6 +16,7 @@
#include "base/metrics/histogram.h"
#include "base/strings/string_util.h"
#include "content/child/request_extra_data.h"
+#include "content/child/site_isolation_policy.h"
#include "content/common/inter_process_time_ticks_converter.h"
#include "content/common/resource_messages.h"
#include "content/public/child/resource_dispatcher_delegate.h"
@@ -96,6 +97,9 @@ class IPCResourceLoaderBridge : public ResourceLoaderBridge {
// The routing id used when sending IPC messages.
int routing_id_;
+ // The security origin of the frame that initiates this request.
+ WebKit::WebString frame_origin_;
+
bool is_synchronous_request_;
};
@@ -135,7 +139,9 @@ IPCResourceLoaderBridge::IPCResourceLoaderBridge(
extra_data->transferred_request_child_id();
request_.transferred_request_request_id =
extra_data->transferred_request_request_id();
+ frame_origin_ = extra_data->frame_origin();
} else {
+ // TODO(dsjang): Consult the expert when this branch is taken.
Charlie Reis 2013/08/19 16:20:06 What are you trying to figure out?
dsjang 2013/08/19 21:37:18 I'm trying to make sure that the lack of request_i
request_.is_main_frame = false;
request_.frame_id = -1;
request_.parent_is_main_frame = false;
@@ -175,7 +181,18 @@ bool IPCResourceLoaderBridge::Start(Peer* peer) {
return false;
}
- peer_ = peer;
+ // TODO(dsjang): Figure out when exactly frame_id gets -1 to see if that case
+ // is security irrelevant.
Charlie Reis 2013/08/19 16:20:06 Any luck tracking this down?
dsjang 2013/08/19 21:37:18 Resolved this issue, and added a comment about the
+ if (request_.frame_id >= 0) {
+ // SiteIsolationPolicy is refcounted, and it is deallocated when
+ // IPCResourceLoaderBridge is freed.
+ // This is buggy.
Charlie Reis 2013/08/19 16:20:06 You're storing it in a normal pointer. :)
dsjang 2013/08/19 21:37:18 Done.
+ peer_ = new SiteIsolationPolicy(peer,
+ frame_origin_,
+ request_.url,
+ request_id_,
+ request_.resource_type);
+ }
// generate the request ID, and append it to the message
request_id_ = dispatcher_->AddPendingRequest(
@@ -346,6 +363,7 @@ void ResourceDispatcher::OnReceivedResponse(
ResourceResponseInfo renderer_response_info;
ToResourceResponseInfo(*request_info, response_head, &renderer_response_info);
+
Charlie Reis 2013/08/19 16:20:06 nit: Remove empty line.
dsjang 2013/08/19 21:37:18 Done.
request_info->peer->OnReceivedResponse(renderer_response_info);
}

Powered by Google App Engine
This is Rietveld 408576698