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

Side by Side Diff: extensions/common/id_util.cc

Issue 382673002: Fixes for re-enabling more MSVC level 4 warnings: misc edition #2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 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 | Annotate | Revision Log
« no previous file with comments | « extensions/browser/extension_prefs.cc ('k') | google_apis/gaia/fake_gaia.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "extensions/common/id_util.h" 5 #include "extensions/common/id_util.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "crypto/sha2.h" 10 #include "crypto/sha2.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 return GenerateId(path_bytes); 53 return GenerateId(path_bytes);
54 } 54 }
55 55
56 base::FilePath MaybeNormalizePath(const base::FilePath& path) { 56 base::FilePath MaybeNormalizePath(const base::FilePath& path) {
57 #if defined(OS_WIN) 57 #if defined(OS_WIN)
58 // Normalize any drive letter to upper-case. We do this for consistency with 58 // Normalize any drive letter to upper-case. We do this for consistency with
59 // net_utils::FilePathToFileURL(), which does the same thing, to make string 59 // net_utils::FilePathToFileURL(), which does the same thing, to make string
60 // comparisons simpler. 60 // comparisons simpler.
61 base::FilePath::StringType path_str = path.value(); 61 base::FilePath::StringType path_str = path.value();
62 if (path_str.size() >= 2 && path_str[0] >= L'a' && path_str[0] <= L'z' && 62 if (path_str.size() >= 2 && path_str[0] >= L'a' && path_str[0] <= L'z' &&
63 path_str[1] == ':') 63 path_str[1] == L':')
64 path_str[0] += ('A' - 'a'); 64 path_str[0] = towupper(path_str[0]);
65 65
66 return base::FilePath(path_str); 66 return base::FilePath(path_str);
67 #else 67 #else
68 return path; 68 return path;
69 #endif 69 #endif
70 } 70 }
71 71
72 } // namespace id_util 72 } // namespace id_util
73 } // namespace extensions 73 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/extension_prefs.cc ('k') | google_apis/gaia/fake_gaia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698