| 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 "net/disk_cache/file.h" | 5 #include "net/disk_cache/file.h" |
| 6 | 6 |
| 7 #include <fcntl.h> | 7 #include <fcntl.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 } | 238 } |
| 239 | 239 |
| 240 } // namespace | 240 } // namespace |
| 241 | 241 |
| 242 namespace disk_cache { | 242 namespace disk_cache { |
| 243 | 243 |
| 244 File::File(base::PlatformFile file) | 244 File::File(base::PlatformFile file) |
| 245 : init_(true), mixed_(true), platform_file_(file) { | 245 : init_(true), mixed_(true), platform_file_(file) { |
| 246 } | 246 } |
| 247 | 247 |
| 248 bool File::Init(const std::wstring& name) { | 248 bool File::Init(const FilePath& name) { |
| 249 if (init_) | 249 if (init_) |
| 250 return false; | 250 return false; |
| 251 | 251 |
| 252 int flags = base::PLATFORM_FILE_OPEN | | 252 int flags = base::PLATFORM_FILE_OPEN | |
| 253 base::PLATFORM_FILE_READ | | 253 base::PLATFORM_FILE_READ | |
| 254 base::PLATFORM_FILE_WRITE; | 254 base::PLATFORM_FILE_WRITE; |
| 255 platform_file_ = base::CreatePlatformFile(name, flags, NULL); | 255 platform_file_ = base::CreatePlatformFile(name, flags, NULL); |
| 256 if (platform_file_ < 0) { | 256 if (platform_file_ < 0) { |
| 257 platform_file_ = 0; | 257 platform_file_ = 0; |
| 258 return false; | 258 return false; |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 return ret; | 362 return ret; |
| 363 } | 363 } |
| 364 | 364 |
| 365 // Static. | 365 // Static. |
| 366 void File::WaitForPendingIO(int* num_pending_io) { | 366 void File::WaitForPendingIO(int* num_pending_io) { |
| 367 if (*num_pending_io) | 367 if (*num_pending_io) |
| 368 Singleton<InFlightIO>::get()->WaitForPendingIO(); | 368 Singleton<InFlightIO>::get()->WaitForPendingIO(); |
| 369 } | 369 } |
| 370 | 370 |
| 371 } // namespace disk_cache | 371 } // namespace disk_cache |
| OLD | NEW |