diff options
author | japhet@chromium.org <japhet@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-04 18:30:09 +0000 |
---|---|---|
committer | japhet@chromium.org <japhet@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-04 18:30:09 +0000 |
commit | 85cc78c5489a2925214a02aef4baf716d74bb1cc (patch) | |
tree | a9945e2369606d83d2977e94636fa35a8f45a765 /webkit/glue/site_isolation_metrics.h | |
parent | ae90f252d04c941f8ff9e7a7cfdd20b64c98cd83 (diff) | |
download | chromium_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/site_isolation_metrics.h')
-rw-r--r-- | webkit/glue/site_isolation_metrics.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/webkit/glue/site_isolation_metrics.h b/webkit/glue/site_isolation_metrics.h new file mode 100644 index 0000000..1148afb --- /dev/null +++ b/webkit/glue/site_isolation_metrics.h @@ -0,0 +1,39 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WEBKIT_GLUE_SITE_ISOLATION_METRICS_H_ +#define WEBKIT_GLUE_SITE_ISOLATION_METRICS_H_ + +#include "third_party/WebKit/WebKit/chromium/public/WebURLRequest.h" + +namespace WebKit { +class WebFrame; +class WebURL; +class WebURLResponse; +} + +namespace webkit_glue { + +// Metrics to check the feasability of blocking cross-site requests +// a renderer shouldn't be making (in case we try to move cross-site frames +// into their own process someday). We're erring on the side of counting more +// mime-types then we strictly need (we'd only consider blocking cross-site +// requests with types similar to HTML, XML, or JSON). +class SiteIsolationMetrics { + public: + static void AddRequest(unsigned identifier, + WebKit::WebURLRequest::TargetType target_type); + static void LogMimeTypeForCrossOriginRequest( + WebKit::WebFrame* frame, + unsigned identifier, + const WebKit::WebURLResponse& response); + static void SniffCrossOriginHTML(const WebKit::WebURL& response_url, + const char* data, + int len); + static void RemoveCompletedResponse(const WebKit::WebURL& response_url); +}; + +} // namespace webkit_glue + +#endif // WEBKIT_GLUE_SITE_ISOLATION_METRICS_H_ |