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

Unified Diff: webkit/fileapi/sandbox_mount_point_provider.cc

Issue 7717020: Adding Size() to AbstractFileEnumerator (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/fileapi/obfuscated_file_system_file_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/sandbox_mount_point_provider.cc
diff --git a/webkit/fileapi/sandbox_mount_point_provider.cc b/webkit/fileapi/sandbox_mount_point_provider.cc
index dbef6c315307620fc222b286809a3706d250f4ad..3c0f1d3728074baa0c93ed1e44c844d4bb27027c 100644
--- a/webkit/fileapi/sandbox_mount_point_provider.cc
+++ b/webkit/fileapi/sandbox_mount_point_provider.cc
@@ -23,7 +23,6 @@
#include "webkit/fileapi/local_file_system_file_util.h"
#include "webkit/fileapi/obfuscated_file_system_file_util.h"
#include "webkit/fileapi/quota_file_util.h"
-#include "webkit/fileapi/sandbox_mount_point_provider.h"
#include "webkit/glue/webkit_glue.h"
#include "webkit/quota/quota_manager.h"
@@ -546,22 +545,10 @@ int64 SandboxMountPointProvider::GetOriginUsageOnFileThread(
FilePath file_path_each;
int64 usage = 0;
- // TODO(ericu): This could be made much more efficient if the
- // AbstractFileEnumerator also had an interface to tell you the size of the
- // file. ObfuscatedFileSystemFileEnumerator has already looked up the data,
- // and it's a big waste to look it up again. The other implementers could
- // easily add it on-demand, so as not to waste time when it's not needed.
while (!(file_path_each = enumerator->Next()).empty()) {
base::PlatformFileInfo file_info;
FilePath platform_file_path;
- if (!enumerator->IsDirectory()) {
- base::PlatformFileError error = sandbox_file_util_->GetFileInfo(
- &context, file_path_each, &file_info, &platform_file_path);
- if (error != base::PLATFORM_FILE_OK)
- NOTREACHED();
- else
- usage += file_info.size;
- }
+ usage += enumerator->Size();
usage += ObfuscatedFileSystemFileUtil::ComputeFilePathCost(file_path_each);
}
// This clears the dirty flag too.
« no previous file with comments | « webkit/fileapi/obfuscated_file_system_file_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698