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

Side by Side Diff: webkit/fileapi/file_system_usage_cache.cc

Issue 7639011: Force updating file usage cache to make sure it reflects the recent pepper quota change (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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 | Annotate | Revision Log
« 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 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 "webkit/fileapi/file_system_usage_cache.h" 5 #include "webkit/fileapi/file_system_usage_cache.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/pickle.h" 9 #include "base/pickle.h"
10 10
11 namespace fileapi { 11 namespace fileapi {
12 12
13 const char FileSystemUsageCache::kUsageFileName[] = ".usage"; 13 const char FileSystemUsageCache::kUsageFileName[] = ".usage";
14 const char FileSystemUsageCache::kUsageFileHeader[] = "FSU2"; 14 const char FileSystemUsageCache::kUsageFileHeader[] = "FSU3";
15 const int FileSystemUsageCache::kUsageFileHeaderSize = 4; 15 const int FileSystemUsageCache::kUsageFileHeaderSize = 4;
16 const int FileSystemUsageCache::kUsageFileSize = 16 const int FileSystemUsageCache::kUsageFileSize =
17 sizeof(Pickle::Header) + 17 sizeof(Pickle::Header) +
18 FileSystemUsageCache::kUsageFileHeaderSize + 18 FileSystemUsageCache::kUsageFileHeaderSize +
19 sizeof(int32) + sizeof(int64); 19 sizeof(int32) + sizeof(int64);
20 20
21 // static 21 // static
22 int64 FileSystemUsageCache::GetUsage(const FilePath& usage_file_path) { 22 int64 FileSystemUsageCache::GetUsage(const FilePath& usage_file_path) {
23 uint32 dirty = 0; 23 uint32 dirty = 0;
24 int64 fs_usage; 24 int64 fs_usage;
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 if (bytes_written != kUsageFileSize) 138 if (bytes_written != kUsageFileSize)
139 return -1; 139 return -1;
140 140
141 if (file_util::ReplaceFile(temporary_usage_file_path, usage_file_path)) 141 if (file_util::ReplaceFile(temporary_usage_file_path, usage_file_path))
142 return bytes_written; 142 return bytes_written;
143 else 143 else
144 return -1; 144 return -1;
145 } 145 }
146 146
147 } 147 }
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