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

Unified Diff: content/browser/tab_contents/tab_contents.cc

Issue 9360014: Create a content public browser API around the ChildProcessSecurityPolicy class. The implementati... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 8 years, 10 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/browser/tab_contents/navigation_controller_impl.cc ('k') | content/browser/webui/web_ui_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/tab_contents/tab_contents.cc
===================================================================
--- content/browser/tab_contents/tab_contents.cc (revision 120814)
+++ content/browser/tab_contents/tab_contents.cc (working copy)
@@ -13,7 +13,7 @@
#include "base/string_util.h"
#include "base/time.h"
#include "base/utf_string_conversions.h"
-#include "content/browser/child_process_security_policy.h"
+#include "content/browser/child_process_security_policy_impl.h"
#include "content/browser/debugger/devtools_manager_impl.h"
#include "content/browser/download/download_stats.h"
#include "content/browser/download/save_package.h"
@@ -423,7 +423,7 @@
}
}
- if (ChildProcessSecurityPolicy::GetInstance()->HasWebUIBindings(
+ if (ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings(
rvh->process()->GetID())) {
prefs.loads_images_automatically = true;
prefs.javascript_enabled = true;
@@ -1343,7 +1343,7 @@
const GURL& url) {
bool is_error_page = (url.spec() == chrome::kUnreachableWebDataURL);
GURL validated_url(url);
- GetRenderViewHost()->FilterURL(ChildProcessSecurityPolicy::GetInstance(),
+ GetRenderViewHost()->FilterURL(ChildProcessSecurityPolicyImpl::GetInstance(),
GetRenderProcessHost()->GetID(), &validated_url);
RenderViewHost* rvh =
@@ -1392,7 +1392,7 @@
params.showing_repost_interstitial
<< ", frame_id: " << params.frame_id;
GURL validated_url(params.url);
- GetRenderViewHost()->FilterURL(ChildProcessSecurityPolicy::GetInstance(),
+ GetRenderViewHost()->FilterURL(ChildProcessSecurityPolicyImpl::GetInstance(),
GetRenderProcessHost()->GetID(), &validated_url);
if (net::ERR_ABORTED == params.error_code) {
@@ -1571,7 +1571,10 @@
void TabContents::OnEnumerateDirectory(int request_id,
const FilePath& path) {
- delegate_->EnumerateDirectory(this, request_id, path);
+ ChildProcessSecurityPolicyImpl* policy =
+ ChildProcessSecurityPolicyImpl::GetInstance();
+ if (policy->CanReadDirectory(GetRenderProcessHost()->GetID(), path))
+ delegate_->EnumerateDirectory(this, request_id, path);
}
void TabContents::OnJSOutOfMemory() {
@@ -1581,6 +1584,10 @@
void TabContents::OnRegisterProtocolHandler(const std::string& protocol,
const GURL& url,
const string16& title) {
+ ChildProcessSecurityPolicyImpl* policy =
+ ChildProcessSecurityPolicyImpl::GetInstance();
+ if (policy->IsPseudoScheme(protocol) || policy->IsDisabledScheme(protocol))
+ return;
delegate_->RegisterProtocolHandler(this, protocol, url, title);
}
« no previous file with comments | « content/browser/tab_contents/navigation_controller_impl.cc ('k') | content/browser/webui/web_ui_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698