summaryrefslogtreecommitdiffstats
path: root/webkit/glue/weburlloader_impl.cc
diff options
context:
space:
mode:
authorjaphet@chromium.org <japhet@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-04 18:30:09 +0000
committerjaphet@chromium.org <japhet@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-04 18:30:09 +0000
commit85cc78c5489a2925214a02aef4baf716d74bb1cc (patch)
treea9945e2369606d83d2977e94636fa35a8f45a765 /webkit/glue/weburlloader_impl.cc
parentae90f252d04c941f8ff9e7a7cfdd20b64c98cd83 (diff)
downloadchromium_src-85cc78c5489a2925214a02aef4baf716d74bb1cc.zip
chromium_src-85cc78c5489a2925214a02aef4baf716d74bb1cc.tar.gz
chromium_src-85cc78c5489a2925214a02aef4baf716d74bb1cc.tar.bz2
Site isolation metrics: Sniff the actual type of cross origin text/html
responses, and take access control headers into account. Also, moved the actual logic of site isolation metrics into a separate file. BUG=none TEST=none Review URL: http://codereview.chromium.org/1699028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46370 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/weburlloader_impl.cc')
-rw-r--r--webkit/glue/weburlloader_impl.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/webkit/glue/weburlloader_impl.cc b/webkit/glue/weburlloader_impl.cc
index 710a84b..0b5697a 100644
--- a/webkit/glue/weburlloader_impl.cc
+++ b/webkit/glue/weburlloader_impl.cc
@@ -26,6 +26,7 @@
#include "webkit/glue/ftp_directory_listing_response_delegate.h"
#include "webkit/glue/multipart_response_delegate.h"
#include "webkit/glue/resource_loader_bridge.h"
+#include "webkit/glue/site_isolation_metrics.h"
#include "webkit/glue/webkit_glue.h"
using base::Time;
@@ -249,6 +250,9 @@ class WebURLLoaderImpl::Context : public base::RefCounted<Context>,
scoped_ptr<ResourceLoaderBridge> bridge_;
scoped_ptr<FtpDirectoryListingResponseDelegate> ftp_listing_delegate_;
scoped_ptr<MultipartResponseDelegate> multipart_delegate_;
+
+ // TODO(japhet): Storing this is a temporary hack for site isolation logging.
+ WebURL response_url_;
};
WebURLLoaderImpl::Context::Context(WebURLLoaderImpl* loader)
@@ -506,12 +510,17 @@ void WebURLLoaderImpl::Context::OnReceivedResponse(
ftp_listing_delegate_.reset(
new FtpDirectoryListingResponseDelegate(client_, loader_, response));
}
+
+ response_url_ = response.url();
}
void WebURLLoaderImpl::Context::OnReceivedData(const char* data, int len) {
if (!client_)
return;
+ // Temporary logging, see site_isolation_metrics.h/cc.
+ SiteIsolationMetrics::SniffCrossOriginHTML(response_url_, data, len);
+
if (ftp_listing_delegate_.get()) {
// The FTP listing delegate will make the appropriate calls to
// client_->didReceiveData and client_->didReceiveResponse.
@@ -559,6 +568,9 @@ void WebURLLoaderImpl::Context::OnCompletedRequest(
}
}
+ // Temporary logging, see site_isolation_metrics.h/cc
+ SiteIsolationMetrics::RemoveCompletedResponse(response_url_);
+
// We are done with the bridge now, and so we need to release the reference
// to ourselves that we took on behalf of the bridge. This may cause our
// destruction.