| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/file_util.h" | 5 #include "base/file_util.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 #include <stdio.h> | 10 #include <stdio.h> |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 bool MemoryMappedFile::IsValid() const { | 335 bool MemoryMappedFile::IsValid() const { |
| 336 return data_ != NULL; | 336 return data_ != NULL; |
| 337 } | 337 } |
| 338 | 338 |
| 339 bool MemoryMappedFile::MapFileToMemory(const FilePath& file_name) { | 339 bool MemoryMappedFile::MapFileToMemory(const FilePath& file_name) { |
| 340 file_ = base::CreatePlatformFile( | 340 file_ = base::CreatePlatformFile( |
| 341 file_name, base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ, | 341 file_name, base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ, |
| 342 NULL, NULL); | 342 NULL, NULL); |
| 343 | 343 |
| 344 if (file_ == base::kInvalidPlatformFileValue) { | 344 if (file_ == base::kInvalidPlatformFileValue) { |
| 345 LOG(ERROR) << "Couldn't open " << file_name.value(); | 345 DLOG(ERROR) << "Couldn't open " << file_name.value(); |
| 346 return false; | 346 return false; |
| 347 } | 347 } |
| 348 | 348 |
| 349 return MapFileToMemoryInternal(); | 349 return MapFileToMemoryInternal(); |
| 350 } | 350 } |
| 351 | 351 |
| 352 // Deprecated functions ---------------------------------------------------- | 352 // Deprecated functions ---------------------------------------------------- |
| 353 | 353 |
| 354 #if defined(OS_WIN) | 354 #if defined(OS_WIN) |
| 355 void AppendToPath(std::wstring* path, const std::wstring& new_ending) { | 355 void AppendToPath(std::wstring* path, const std::wstring& new_ending) { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 // FileEnumerator | 393 // FileEnumerator |
| 394 // | 394 // |
| 395 // Note: the main logic is in file_util_<platform>.cc | 395 // Note: the main logic is in file_util_<platform>.cc |
| 396 | 396 |
| 397 bool FileEnumerator::ShouldSkip(const FilePath& path) { | 397 bool FileEnumerator::ShouldSkip(const FilePath& path) { |
| 398 FilePath::StringType basename = path.BaseName().value(); | 398 FilePath::StringType basename = path.BaseName().value(); |
| 399 return IsDot(path) || (IsDotDot(path) && !(INCLUDE_DOT_DOT & file_type_)); | 399 return IsDot(path) || (IsDotDot(path) && !(INCLUDE_DOT_DOT & file_type_)); |
| 400 } | 400 } |
| 401 | 401 |
| 402 } // namespace | 402 } // namespace |
| OLD | NEW |