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

Side by Side Diff: chrome/browser/renderer_security_policy.cc

Issue 3149: Porting changes in chrome/{browser,common}, also enabling more unit tests.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 12 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/renderer_security_policy.h" 5 #include "chrome/browser/renderer_security_policy.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #ifdef CHROME_PERSONALIZATION 9 #ifdef CHROME_PERSONALIZATION
10 #include "chrome/personalization/personalization.h" 10 #include "chrome/personalization/personalization.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 // |false| means the scheme has been revoked. 65 // |false| means the scheme has been revoked.
66 // If a scheme is not present in the map, then it has never been granted 66 // If a scheme is not present in the map, then it has never been granted
67 // or revoked. 67 // or revoked.
68 SchemeMap scheme_policy_; 68 SchemeMap scheme_policy_;
69 69
70 // The set of files the renderer is permited to upload to the web. 70 // The set of files the renderer is permited to upload to the web.
71 FileSet uploadable_files_; 71 FileSet uploadable_files_;
72 72
73 bool has_dom_ui_bindings_; 73 bool has_dom_ui_bindings_;
74 74
75 DISALLOW_EVIL_CONSTRUCTORS(RendererSecurityPolicy::SecurityState); 75 DISALLOW_COPY_AND_ASSIGN(SecurityState);
76 }; 76 };
77 77
78 RendererSecurityPolicy::RendererSecurityPolicy() { 78 RendererSecurityPolicy::RendererSecurityPolicy() {
79 // We know about these schemes and believe them to be safe. 79 // We know about these schemes and believe them to be safe.
80 RegisterWebSafeScheme("http"); 80 RegisterWebSafeScheme("http");
81 RegisterWebSafeScheme("https"); 81 RegisterWebSafeScheme("https");
82 RegisterWebSafeScheme("ftp"); 82 RegisterWebSafeScheme("ftp");
83 RegisterWebSafeScheme("data"); 83 RegisterWebSafeScheme("data");
84 RegisterWebSafeScheme("feed"); 84 RegisterWebSafeScheme("feed");
85 85
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 bool RendererSecurityPolicy::HasDOMUIBindings(int renderer_id) { 276 bool RendererSecurityPolicy::HasDOMUIBindings(int renderer_id) {
277 AutoLock lock(lock_); 277 AutoLock lock(lock_);
278 278
279 SecurityStateMap::iterator state = security_state_.find(renderer_id); 279 SecurityStateMap::iterator state = security_state_.find(renderer_id);
280 if (state == security_state_.end()) 280 if (state == security_state_.end())
281 return false; 281 return false;
282 282
283 return state->second->has_dom_ui_bindings(); 283 return state->second->has_dom_ui_bindings();
284 } 284 }
285 285
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698