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

Side by Side Diff: content/browser/child_process_security_policy_impl.cc

Issue 2067493003: Moving (Can|Grant)AccessFilesOfPageState into RenderFrameHostImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@grant-file-access-after-transfer
Patch Set: Pulling in some changes that got removed from the dependent CL. Created 4 years, 6 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_impl.h" 5 #include "content/browser/child_process_security_policy_impl.h"
6 6
7 #include <algorithm>
7 #include <utility> 8 #include <utility>
8 9
9 #include "base/command_line.h" 10 #include "base/command_line.h"
10 #include "base/files/file_path.h" 11 #include "base/files/file_path.h"
11 #include "base/logging.h" 12 #include "base/logging.h"
12 #include "base/macros.h" 13 #include "base/macros.h"
13 #include "base/metrics/histogram.h" 14 #include "base/metrics/histogram.h"
14 #include "base/stl_util.h" 15 #include "base/stl_util.h"
15 #include "base/strings/string_util.h" 16 #include "base/strings/string_util.h"
16 #include "build/build_config.h" 17 #include "build/build_config.h"
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 web_safe_schemes_.insert(scheme); 360 web_safe_schemes_.insert(scheme);
360 } 361 }
361 362
362 bool ChildProcessSecurityPolicyImpl::IsWebSafeScheme( 363 bool ChildProcessSecurityPolicyImpl::IsWebSafeScheme(
363 const std::string& scheme) { 364 const std::string& scheme) {
364 base::AutoLock lock(lock_); 365 base::AutoLock lock(lock_);
365 366
366 return ContainsKey(web_safe_schemes_, scheme); 367 return ContainsKey(web_safe_schemes_, scheme);
367 } 368 }
368 369
370 bool ChildProcessSecurityPolicyImpl::CanReadAllFiles(
Charlie Reis 2016/06/17 07:07:39 Nit: This is in the wrong section of the file. Th
Łukasz Anforowicz 2016/06/17 16:21:09 Done.
371 int child_id,
372 const std::vector<base::FilePath>& files) {
373 return std::all_of(files.begin(), files.end(),
374 [this, child_id](const base::FilePath& file) {
375 return CanReadFile(child_id, file);
376 });
377 }
378
369 void ChildProcessSecurityPolicyImpl::RegisterPseudoScheme( 379 void ChildProcessSecurityPolicyImpl::RegisterPseudoScheme(
370 const std::string& scheme) { 380 const std::string& scheme) {
371 base::AutoLock lock(lock_); 381 base::AutoLock lock(lock_);
372 DCHECK_EQ(0U, pseudo_schemes_.count(scheme)) << "Add schemes at most once."; 382 DCHECK_EQ(0U, pseudo_schemes_.count(scheme)) << "Add schemes at most once.";
373 DCHECK_EQ(0U, web_safe_schemes_.count(scheme)) 383 DCHECK_EQ(0U, web_safe_schemes_.count(scheme))
374 << "Pseudo implies not web-safe."; 384 << "Pseudo implies not web-safe.";
375 385
376 pseudo_schemes_.insert(scheme); 386 pseudo_schemes_.insert(scheme);
377 } 387 }
378 388
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
848 base::AutoLock lock(lock_); 858 base::AutoLock lock(lock_);
849 859
850 SecurityStateMap::iterator state = security_state_.find(child_id); 860 SecurityStateMap::iterator state = security_state_.find(child_id);
851 if (state == security_state_.end()) 861 if (state == security_state_.end())
852 return false; 862 return false;
853 863
854 return state->second->can_send_midi_sysex(); 864 return state->second->can_send_midi_sysex();
855 } 865 }
856 866
857 } // namespace content 867 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/child_process_security_policy_impl.h ('k') | content/browser/frame_host/render_frame_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698