| OLD | NEW |
| 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/child_process_security_policy.h" | 5 #include "chrome/browser/child_process_security_policy.h" |
| 6 | 6 |
| 7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/stl_util-inl.h" | 9 #include "base/stl_util-inl.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 | 225 |
| 226 SecurityStateMap::iterator state = security_state_.find(renderer_id); | 226 SecurityStateMap::iterator state = security_state_.find(renderer_id); |
| 227 if (state == security_state_.end()) | 227 if (state == security_state_.end()) |
| 228 return; | 228 return; |
| 229 | 229 |
| 230 state->second->GrantBindings(BindingsPolicy::DOM_UI); | 230 state->second->GrantBindings(BindingsPolicy::DOM_UI); |
| 231 | 231 |
| 232 // DOM UI bindings need the ability to request chrome: URLs. | 232 // DOM UI bindings need the ability to request chrome: URLs. |
| 233 state->second->GrantScheme(chrome::kChromeUIScheme); | 233 state->second->GrantScheme(chrome::kChromeUIScheme); |
| 234 | 234 |
| 235 // DOM UI bindings need the ability to request print: URLs. |
| 236 state->second->GrantScheme(chrome::kPrintScheme); |
| 237 |
| 235 // DOM UI pages can contain links to file:// URLs. | 238 // DOM UI pages can contain links to file:// URLs. |
| 236 state->second->GrantScheme(chrome::kFileScheme); | 239 state->second->GrantScheme(chrome::kFileScheme); |
| 237 } | 240 } |
| 238 | 241 |
| 239 void ChildProcessSecurityPolicy::GrantExtensionBindings(int renderer_id) { | 242 void ChildProcessSecurityPolicy::GrantExtensionBindings(int renderer_id) { |
| 240 AutoLock lock(lock_); | 243 AutoLock lock(lock_); |
| 241 | 244 |
| 242 SecurityStateMap::iterator state = security_state_.find(renderer_id); | 245 SecurityStateMap::iterator state = security_state_.find(renderer_id); |
| 243 if (state == security_state_.end()) | 246 if (state == security_state_.end()) |
| 244 return; | 247 return; |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 | 314 |
| 312 bool ChildProcessSecurityPolicy::HasExtensionBindings(int renderer_id) { | 315 bool ChildProcessSecurityPolicy::HasExtensionBindings(int renderer_id) { |
| 313 AutoLock lock(lock_); | 316 AutoLock lock(lock_); |
| 314 | 317 |
| 315 SecurityStateMap::iterator state = security_state_.find(renderer_id); | 318 SecurityStateMap::iterator state = security_state_.find(renderer_id); |
| 316 if (state == security_state_.end()) | 319 if (state == security_state_.end()) |
| 317 return false; | 320 return false; |
| 318 | 321 |
| 319 return state->second->has_extension_bindings(); | 322 return state->second->has_extension_bindings(); |
| 320 } | 323 } |
| OLD | NEW |