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

Side by Side Diff: net/disk_cache/file_posix.cc

Issue 270066: Step 2 in porting disk cache to using FilePath. (Closed)
Patch Set: deprecated Created 11 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 | « net/disk_cache/file.h ('k') | net/disk_cache/file_win.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) 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
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
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
OLDNEW
« no previous file with comments | « net/disk_cache/file.h ('k') | net/disk_cache/file_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698