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

Side by Side Diff: components/resource_provider/file_utils.cc

Issue 1551433002: Switch to standard integer types in components/, part 3 of 4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more Created 4 years, 12 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/resource_provider/file_utils.h" 5 #include "components/resource_provider/file_utils.h"
6 6
7 #include <stddef.h>
8
7 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
8 #include "base/path_service.h" 10 #include "base/path_service.h"
9 #include "base/strings/string_split.h" 11 #include "base/strings/string_split.h"
10 #include "base/strings/string_util.h" 12 #include "base/strings/string_util.h"
13 #include "build/build_config.h"
11 14
12 namespace resource_provider { 15 namespace resource_provider {
13 namespace { 16 namespace {
14 17
15 bool IsPathNameValid(const std::string& name) { 18 bool IsPathNameValid(const std::string& name) {
16 if (name.empty() || name == "." || name == "..") 19 if (name.empty() || name == "." || name == "..")
17 return false; 20 return false;
18 21
19 for (auto c : name) { 22 for (auto c : name) {
20 if (!base::IsAsciiAlpha(c) && !base::IsAsciiDigit(c) && 23 if (!base::IsAsciiAlpha(c) && !base::IsAsciiDigit(c) &&
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 base::FilePath result(app_path); 92 base::FilePath result(app_path);
90 for (const auto& path_component : path_components) { 93 for (const auto& path_component : path_components) {
91 if (!IsPathNameValid(path_component)) 94 if (!IsPathNameValid(path_component))
92 return base::FilePath(); 95 return base::FilePath();
93 result = result.AppendASCII(path_component); 96 result = result.AppendASCII(path_component);
94 } 97 }
95 return result; 98 return result;
96 } 99 }
97 100
98 } // namespace resource_provider 101 } // namespace resource_provider
OLDNEW
« no previous file with comments | « components/renderer_context_menu/views/toolkit_delegate_views.h ('k') | components/resource_provider/file_utils_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698