| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #include <stdio.h> | 7 #include <stdio.h> |
| 8 | 8 |
| 9 #include <fstream> | 9 #include <fstream> |
| 10 | 10 |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 | 288 |
| 289 bool GetFileSize(const std::wstring& file_path, int64* file_size) { | 289 bool GetFileSize(const std::wstring& file_path, int64* file_size) { |
| 290 FileInfo info; | 290 FileInfo info; |
| 291 if (!GetFileInfo(file_path, &info)) | 291 if (!GetFileInfo(file_path, &info)) |
| 292 return false; | 292 return false; |
| 293 *file_size = info.size; | 293 *file_size = info.size; |
| 294 return true; | 294 return true; |
| 295 } | 295 } |
| 296 | 296 |
| 297 bool CloseFile(FILE* file) { | 297 bool CloseFile(FILE* file) { |
| 298 if (file == NULL) |
| 299 return true; |
| 298 return fclose(file) == 0; | 300 return fclose(file) == 0; |
| 299 } | 301 } |
| 300 | 302 |
| 301 } // namespace | 303 } // namespace |
| 302 | 304 |
| OLD | NEW |