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

Side by Side Diff: chrome/browser/nacl_host/nacl_browser_delegate_impl.cc

Issue 1240183002: Update SplitString calls in chrome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/nacl_host/nacl_browser_delegate_impl.h" 5 #include "chrome/browser/nacl_host/nacl_browser_delegate_impl.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/strings/string_split.h" 10 #include "base/strings/string_split.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 const std::string& debug_patterns) { 145 const std::string& debug_patterns) {
146 #if defined(ENABLE_EXTENSIONS) 146 #if defined(ENABLE_EXTENSIONS)
147 if (debug_patterns.empty()) { 147 if (debug_patterns.empty()) {
148 return; 148 return;
149 } 149 }
150 std::vector<std::string> patterns; 150 std::vector<std::string> patterns;
151 if (debug_patterns[0] == '!') { 151 if (debug_patterns[0] == '!') {
152 std::string negated_patterns = debug_patterns; 152 std::string negated_patterns = debug_patterns;
153 inverse_debug_patterns_ = true; 153 inverse_debug_patterns_ = true;
154 negated_patterns.erase(0, 1); 154 negated_patterns.erase(0, 1);
155 base::SplitString(negated_patterns, ',', &patterns); 155 patterns = base::SplitString(
156 negated_patterns, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
156 } else { 157 } else {
157 base::SplitString(debug_patterns, ',', &patterns); 158 patterns = base::SplitString(
159 debug_patterns, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
158 } 160 }
159 for (std::vector<std::string>::iterator iter = patterns.begin(); 161 for (const std::string& pattern_str : patterns) {
160 iter != patterns.end(); ++iter) {
161 // Allow chrome:// schema, which is used to filter out the internal 162 // Allow chrome:// schema, which is used to filter out the internal
162 // PNaCl translator. Also allow chrome-extension:// schema (which 163 // PNaCl translator. Also allow chrome-extension:// schema (which
163 // can have NaCl modules). The default is to disallow these schema 164 // can have NaCl modules). The default is to disallow these schema
164 // since they can be dangerous in the context of chrome extension 165 // since they can be dangerous in the context of chrome extension
165 // permissions, but they are okay here, for NaCl GDB avoidance. 166 // permissions, but they are okay here, for NaCl GDB avoidance.
166 URLPattern pattern(URLPattern::SCHEME_ALL); 167 URLPattern pattern(URLPattern::SCHEME_ALL);
167 if (pattern.Parse(*iter) == URLPattern::PARSE_SUCCESS) { 168 if (pattern.Parse(pattern_str) == URLPattern::PARSE_SUCCESS) {
168 // If URL pattern has scheme equal to *, Parse method resets valid 169 // If URL pattern has scheme equal to *, Parse method resets valid
169 // schemes mask to http and https only, so we need to reset it after 170 // schemes mask to http and https only, so we need to reset it after
170 // Parse to re-include chrome-extension and chrome schema. 171 // Parse to re-include chrome-extension and chrome schema.
171 pattern.SetValidSchemes(URLPattern::SCHEME_ALL); 172 pattern.SetValidSchemes(URLPattern::SCHEME_ALL);
172 debug_patterns_.push_back(pattern); 173 debug_patterns_.push_back(pattern);
173 } 174 }
174 } 175 }
175 #endif // defined(ENABLE_EXTENSIONS) 176 #endif // defined(ENABLE_EXTENSIONS)
176 } 177 }
177 178
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 const base::FilePath& profile_directory) { 241 const base::FilePath& profile_directory) {
241 // Get the profile associated with the renderer. 242 // Get the profile associated with the renderer.
242 Profile* profile = profile_manager_->GetProfileByPath(profile_directory); 243 Profile* profile = profile_manager_->GetProfileByPath(profile_directory);
243 DCHECK(profile); 244 DCHECK(profile);
244 scoped_refptr<extensions::InfoMap> extension_info_map = 245 scoped_refptr<extensions::InfoMap> extension_info_map =
245 extensions::ExtensionSystem::Get(profile)->info_map(); 246 extensions::ExtensionSystem::Get(profile)->info_map();
246 DCHECK(extension_info_map.get()); 247 DCHECK(extension_info_map.get());
247 return extension_info_map; 248 return extension_info_map;
248 } 249 }
249 #endif 250 #endif
OLDNEW
« no previous file with comments | « chrome/browser/metrics/variations/variations_service_unittest.cc ('k') | chrome/browser/net/predictor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698