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

Side by Side Diff: ppapi/shared_impl/file_ref_util.cc

Issue 1548813002: Switch to standard integer types in ppapi/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes 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 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 "ppapi/shared_impl/file_ref_util.h" 5 #include "ppapi/shared_impl/file_ref_util.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/strings/string_util.h" 10 #include "base/strings/string_util.h"
9 #include "base/strings/utf_string_conversions.h" 11 #include "base/strings/utf_string_conversions.h"
12 #include "build/build_config.h"
10 13
11 namespace ppapi { 14 namespace ppapi {
12 15
13 std::string GetNameForInternalFilePath(const std::string& path) { 16 std::string GetNameForInternalFilePath(const std::string& path) {
14 if (path == "/") 17 if (path == "/")
15 return path; 18 return path;
16 size_t pos = path.rfind('/'); 19 size_t pos = path.rfind('/');
17 CHECK(pos != std::string::npos); 20 CHECK(pos != std::string::npos);
18 return path.substr(pos + 1); 21 return path.substr(pos + 1);
19 } 22 }
(...skipping 27 matching lines...) Expand all
47 bool IsValidExternalPath(const base::FilePath& path) { 50 bool IsValidExternalPath(const base::FilePath& path) {
48 return !path.empty() && !path.ReferencesParent(); 51 return !path.empty() && !path.ReferencesParent();
49 } 52 }
50 53
51 void NormalizeInternalPath(std::string* path) { 54 void NormalizeInternalPath(std::string* path) {
52 if (path->size() > 1 && path->at(path->size() - 1) == '/') 55 if (path->size() > 1 && path->at(path->size() - 1) == '/')
53 path->erase(path->size() - 1, 1); 56 path->erase(path->size() - 1, 1);
54 } 57 }
55 58
56 } // namespace ppapi 59 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/shared_impl/file_ref_create_info.cc ('k') | ppapi/shared_impl/flash_clipboard_format_registry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698