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

Side by Side Diff: third_party/leveldatabase/env_chromium.cc

Issue 631163002: Clean up ifdef around FilePath creation in /src/third_party (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « no previous file | no next file » | 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) 2011 The LevelDB Authors. All rights reserved. 1 // Copyright (c) 2011 The LevelDB 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. See the AUTHORS file for names of contributors. 3 // found in the LICENSE file. See the AUTHORS file for names of contributors.
4 4
5 #include "third_party/leveldatabase/env_chromium.h" 5 #include "third_party/leveldatabase/env_chromium.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <io.h> 8 #include <io.h>
9 #endif 9 #endif
10 10
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 331
332 std::string FilePathToString(const base::FilePath& file_path) { 332 std::string FilePathToString(const base::FilePath& file_path) {
333 #if defined(OS_WIN) 333 #if defined(OS_WIN)
334 return base::UTF16ToUTF8(file_path.value()); 334 return base::UTF16ToUTF8(file_path.value());
335 #else 335 #else
336 return file_path.value(); 336 return file_path.value();
337 #endif 337 #endif
338 } 338 }
339 339
340 base::FilePath ChromiumEnv::CreateFilePath(const std::string& file_path) { 340 base::FilePath ChromiumEnv::CreateFilePath(const std::string& file_path) {
341 #if defined(OS_WIN) 341 return base::FilePath::FromUTF8Unsafe(file_path);
342 return base::FilePath(base::UTF8ToUTF16(file_path));
343 #else
344 return base::FilePath(file_path);
345 #endif
346 } 342 }
347 343
348 bool ChromiumEnv::MakeBackup(const std::string& fname) { 344 bool ChromiumEnv::MakeBackup(const std::string& fname) {
349 base::FilePath original_table_name = CreateFilePath(fname); 345 base::FilePath original_table_name = CreateFilePath(fname);
350 base::FilePath backup_table_name = 346 base::FilePath backup_table_name =
351 original_table_name.ReplaceExtension(backup_table_extension); 347 original_table_name.ReplaceExtension(backup_table_extension);
352 return base::CopyFile(original_table_name, backup_table_name); 348 return base::CopyFile(original_table_name, backup_table_name);
353 } 349 }
354 350
355 bool ChromiumEnv::HasTableExtension(const base::FilePath& path) { 351 bool ChromiumEnv::HasTableExtension(const base::FilePath& path) {
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
852 848
853 Env* IDBEnv() { 849 Env* IDBEnv() {
854 return leveldb_env::idb_env.Pointer(); 850 return leveldb_env::idb_env.Pointer();
855 } 851 }
856 852
857 Env* Env::Default() { 853 Env* Env::Default() {
858 return leveldb_env::default_env.Pointer(); 854 return leveldb_env::default_env.Pointer();
859 } 855 }
860 856
861 } // namespace leveldb 857 } // namespace leveldb
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698