| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/browser/child_process_security_policy.h" | 5 #include "content/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/platform_file.h" | 9 #include "base/platform_file.h" |
| 10 #include "base/stl_util-inl.h" | 10 #include "base/stl_util.h" |
| 11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
| 12 #include "content/common/bindings_policy.h" | 12 #include "content/common/bindings_policy.h" |
| 13 #include "content/common/url_constants.h" | 13 #include "content/common/url_constants.h" |
| 14 #include "googleurl/src/gurl.h" | 14 #include "googleurl/src/gurl.h" |
| 15 #include "net/url_request/url_request.h" | 15 #include "net/url_request/url_request.h" |
| 16 | 16 |
| 17 static const int kReadFilePermissions = | 17 static const int kReadFilePermissions = |
| 18 base::PLATFORM_FILE_OPEN | | 18 base::PLATFORM_FILE_OPEN | |
| 19 base::PLATFORM_FILE_READ | | 19 base::PLATFORM_FILE_READ | |
| 20 base::PLATFORM_FILE_EXCLUSIVE_READ | | 20 base::PLATFORM_FILE_EXCLUSIVE_READ | |
| (...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 security_state_[child_id] = new SecurityState(); | 461 security_state_[child_id] = new SecurityState(); |
| 462 } | 462 } |
| 463 | 463 |
| 464 bool ChildProcessSecurityPolicy::ChildProcessHasPermissionsForFile( | 464 bool ChildProcessSecurityPolicy::ChildProcessHasPermissionsForFile( |
| 465 int child_id, const FilePath& file, int permissions) { | 465 int child_id, const FilePath& file, int permissions) { |
| 466 SecurityStateMap::iterator state = security_state_.find(child_id); | 466 SecurityStateMap::iterator state = security_state_.find(child_id); |
| 467 if (state == security_state_.end()) | 467 if (state == security_state_.end()) |
| 468 return false; | 468 return false; |
| 469 return state->second->HasPermissionsForFile(file, permissions); | 469 return state->second->HasPermissionsForFile(file, permissions); |
| 470 } | 470 } |
| OLD | NEW |