diff options
22 files changed, 47 insertions, 45 deletions
diff --git a/webkit/fileapi/file_system_directory_database.cc b/webkit/fileapi/file_system_directory_database.cc index 4023c5a..05a401a 100644 --- a/webkit/fileapi/file_system_directory_database.cc +++ b/webkit/fileapi/file_system_directory_database.cc @@ -4,8 +4,10 @@ #include "webkit/fileapi/file_system_directory_database.h" -#include <algorithm> #include <math.h> +#include <algorithm> +#include <set> +#include <stack> #include "base/file_util.h" #include "base/location.h" @@ -256,8 +258,8 @@ bool DatabaseCheckHelper::ScanDatabase() { } bool DatabaseCheckHelper::ScanDirectory() { - // Scans all local file system entries to verify each of them has a database - // entry. + // TODO(kinuko): Scans all local file system entries to verify each of them + // has a database entry. const FilePath kExcludes[] = { FilePath(kDirectoryDatabaseName), FilePath(fileapi::FileSystemUsageCache::kUsageFileName), @@ -535,8 +537,8 @@ bool FileSystemDirectoryDatabase::RemoveFileInfo(FileId file_id) { bool FileSystemDirectoryDatabase::UpdateFileInfo( FileId file_id, const FileInfo& new_info) { - // TODO: We should also check to see that this doesn't create a loop, but - // perhaps only in a debug build. + // TODO(ericu): We should also check to see that this doesn't create a loop, + // but perhaps only in a debug build. if (!Init(REPAIR_ON_CORRUPTION)) return false; DCHECK(file_id); // You can't remove the root, ever. Just delete the DB. diff --git a/webkit/fileapi/file_system_directory_database_unittest.cc b/webkit/fileapi/file_system_directory_database_unittest.cc index fc52bc6..ab708fd 100644 --- a/webkit/fileapi/file_system_directory_database_unittest.cc +++ b/webkit/fileapi/file_system_directory_database_unittest.cc @@ -5,6 +5,7 @@ #include "webkit/fileapi/file_system_directory_database.h" #include <math.h> +#include <limits> #include "base/file_util.h" #include "base/platform_file.h" diff --git a/webkit/fileapi/file_system_file_stream_reader_unittest.cc b/webkit/fileapi/file_system_file_stream_reader_unittest.cc index f1f8ae3..f95a1d5 100644 --- a/webkit/fileapi/file_system_file_stream_reader_unittest.cc +++ b/webkit/fileapi/file_system_file_stream_reader_unittest.cc @@ -4,6 +4,7 @@ #include "webkit/fileapi/file_system_file_stream_reader.h" +#include <limits> #include <string> #include "base/memory/scoped_ptr.h" @@ -55,7 +56,7 @@ void ReadFromReader(FileSystemFileStreamReader* reader, } } -void NeverCalled(int) { ADD_FAILURE(); } +void NeverCalled(int unused) { ADD_FAILURE(); } } // namespace diff --git a/webkit/fileapi/file_system_file_util_proxy.h b/webkit/fileapi/file_system_file_util_proxy.h index 9798542..f7beea4 100644 --- a/webkit/fileapi/file_system_file_util_proxy.h +++ b/webkit/fileapi/file_system_file_util_proxy.h @@ -148,7 +148,8 @@ class FileSystemFileUtilProxy { // Reads the filenames in |url| by calling |file_util|'s // ReadDirectory method on the given context's task_runner. - // TODO: this should support returning entries in multiple chunks. + // TODO(kinuko): this should support returning entries in multiple chunks. + // (http://crbug.com/145908) static bool ReadDirectory( FileSystemOperationContext* context, FileSystemFileUtil* file_util, diff --git a/webkit/fileapi/file_system_url_request_job_unittest.cc b/webkit/fileapi/file_system_url_request_job_unittest.cc index dde4fd5..2e93374 100644 --- a/webkit/fileapi/file_system_url_request_job_unittest.cc +++ b/webkit/fileapi/file_system_url_request_job_unittest.cc @@ -14,6 +14,7 @@ #include "base/message_loop.h" #include "base/message_loop_proxy.h" #include "base/platform_file.h" +#include "base/rand_util.h" #include "base/scoped_temp_dir.h" #include "base/string_piece.h" #include "base/stringprintf.h" @@ -43,18 +44,7 @@ const char kFileSystemURLPrefix[] = "filesystem:http://remote/temporary/"; const char kTestFileData[] = "0123456789"; void FillBuffer(char* buffer, size_t len) { - static bool called = false; - if (!called) { - called = true; - int seed = static_cast<int>(base::Time::Now().ToInternalValue()); - srand(seed); - } - - for (size_t i = 0; i < len; i++) { - buffer[i] = static_cast<char>(rand()); - if (!buffer[i]) - buffer[i] = 'g'; - } + base::RandBytes(buffer, len); } } // namespace diff --git a/webkit/fileapi/file_system_url_unittest.cc b/webkit/fileapi/file_system_url_unittest.cc index 0d478cf..c6608cc 100644 --- a/webkit/fileapi/file_system_url_unittest.cc +++ b/webkit/fileapi/file_system_url_unittest.cc @@ -19,7 +19,7 @@ namespace fileapi { namespace { FileSystemURL CreateFileSystemURL(const std::string& url_string) { - return FileSystemURL(GURL(url_string)); + return FileSystemURL(GURL(url_string)); } std::string NormalizedUTF8Path(const FilePath& path) { diff --git a/webkit/fileapi/file_util_helper.cc b/webkit/fileapi/file_util_helper.cc index b2e0c08..c95fffd 100644 --- a/webkit/fileapi/file_util_helper.cc +++ b/webkit/fileapi/file_util_helper.cc @@ -5,6 +5,7 @@ #include "webkit/fileapi/file_util_helper.h" #include <stack> +#include <utility> #include "webkit/fileapi/file_system_file_util.h" #include "webkit/fileapi/file_system_operation_context.h" diff --git a/webkit/fileapi/file_writer_delegate.h b/webkit/fileapi/file_writer_delegate.h index 372ea5a..2e78cc6 100644 --- a/webkit/fileapi/file_writer_delegate.h +++ b/webkit/fileapi/file_writer_delegate.h @@ -32,10 +32,10 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE FileWriterDelegate ERROR_WRITE_NOT_STARTED, }; - typedef base::Callback<void( - base::PlatformFileError result, - int64 bytes, - WriteProgressStatus write_status)> DelegateWriteCallback; + typedef base::Callback<void(base::PlatformFileError result, + int64 bytes, + WriteProgressStatus write_status)> + DelegateWriteCallback; FileWriterDelegate( const DelegateWriteCallback& write_callback, diff --git a/webkit/fileapi/file_writer_delegate_unittest.cc b/webkit/fileapi/file_writer_delegate_unittest.cc index ebecd5b..345f1ee 100644 --- a/webkit/fileapi/file_writer_delegate_unittest.cc +++ b/webkit/fileapi/file_writer_delegate_unittest.cc @@ -221,9 +221,11 @@ void FileWriterDelegateTest::TearDown() { // FileWriterDelegateTest.WriteSuccessWithoutQuotaLimit is flaky on windows // http://crbug.com/130401 #if defined(OS_WIN) -#define MAYBE_WriteSuccessWithoutQuotaLimit DISABLED_WriteSuccessWithoutQuotaLimit +#define MAYBE_WriteSuccessWithoutQuotaLimit \ + DISABLED_WriteSuccessWithoutQuotaLimit #else -#define MAYBE_WriteSuccessWithoutQuotaLimit WriteSuccessWithoutQuotaLimit +#define MAYBE_WriteSuccessWithoutQuotaLimit \ + WriteSuccessWithoutQuotaLimit #endif TEST_F(FileWriterDelegateTest, MAYBE_WriteSuccessWithoutQuotaLimit) { const GURL kBlobURL("blob:nolimit"); diff --git a/webkit/fileapi/isolated_context.cc b/webkit/fileapi/isolated_context.cc index 73af35f..057d508 100644 --- a/webkit/fileapi/isolated_context.cc +++ b/webkit/fileapi/isolated_context.cc @@ -57,7 +57,7 @@ bool IsSinglePathIsolatedFileSystem(FileSystemType type) { return true; } -} +} // namespace static base::LazyInstance<IsolatedContext>::Leaky g_isolated_context = LAZY_INSTANCE_INITIALIZER; @@ -307,7 +307,7 @@ void IsolatedContext::RemoveReference(const std::string& filesystem_id) { if (found == instance_map_.end()) return; Instance* instance = found->second; - DCHECK(instance->ref_counts() > 0); + DCHECK_GT(instance->ref_counts(), 0); instance->RemoveRef(); if (instance->ref_counts() == 0 && instance->mount_type() != kFileSystemTypeExternal) { diff --git a/webkit/fileapi/isolated_context_unittest.cc b/webkit/fileapi/isolated_context_unittest.cc index a66ff75..78efd16 100644 --- a/webkit/fileapi/isolated_context_unittest.cc +++ b/webkit/fileapi/isolated_context_unittest.cc @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/fileapi/isolated_context.h" - #include <string> #include "base/basictypes.h" diff --git a/webkit/fileapi/local_file_stream_writer_unittest.cc b/webkit/fileapi/local_file_stream_writer_unittest.cc index 69c5ce3..e26eed9 100644 --- a/webkit/fileapi/local_file_stream_writer_unittest.cc +++ b/webkit/fileapi/local_file_stream_writer_unittest.cc @@ -70,7 +70,7 @@ class LocalFileStreamWriterTest : public testing::Test { ScopedTempDir temp_dir_; }; -void NeverCalled(int) { +void NeverCalled(int unused) { ADD_FAILURE(); } diff --git a/webkit/fileapi/local_file_system_operation_write_unittest.cc b/webkit/fileapi/local_file_system_operation_write_unittest.cc index d39895c..eb51b8b 100644 --- a/webkit/fileapi/local_file_system_operation_write_unittest.cc +++ b/webkit/fileapi/local_file_system_operation_write_unittest.cc @@ -163,11 +163,11 @@ class LocalFileSystemOperationWriteTest MockBlobURLRequestContext url_request_context_; - DISALLOW_COPY_AND_ASSIGN(LocalFileSystemOperationWriteTest); - private: MockFileChangeObserver change_observer_; ChangeObserverList change_observers_; + + DISALLOW_COPY_AND_ASSIGN(LocalFileSystemOperationWriteTest); }; void LocalFileSystemOperationWriteTest::SetUp() { diff --git a/webkit/fileapi/obfuscated_file_util.cc b/webkit/fileapi/obfuscated_file_util.cc index 54aff48..87f5bc8 100644 --- a/webkit/fileapi/obfuscated_file_util.cc +++ b/webkit/fileapi/obfuscated_file_util.cc @@ -1242,8 +1242,9 @@ FilePath ObfuscatedFileUtil::DataPathToLocalPath( return root.Append(data_path); } -// TODO: How to do the whole validation-without-creation thing? We may not have -// quota even to create the database. Ah, in that case don't even get here? +// TODO(ericu): How to do the whole validation-without-creation thing? +// We may not have quota even to create the database. +// Ah, in that case don't even get here? // Still doesn't answer the quota issue, though. FileSystemDirectoryDatabase* ObfuscatedFileUtil::GetDirectoryDatabase( const GURL& origin, FileSystemType type, bool create) { diff --git a/webkit/fileapi/obfuscated_file_util_unittest.cc b/webkit/fileapi/obfuscated_file_util_unittest.cc index a7f9c4b..df2ad66 100644 --- a/webkit/fileapi/obfuscated_file_util_unittest.cc +++ b/webkit/fileapi/obfuscated_file_util_unittest.cc @@ -163,7 +163,8 @@ class ObfuscatedFileUtilTest : public testing::Test { context = helper->NewOperationContext(); else context = test_helper_.NewOperationContext(); - context->set_allowed_bytes_growth(1024 * 1024); // Big enough for all tests. + // Setting allowed_bytes_growth big enough for all tests. + context->set_allowed_bytes_growth(1024 * 1024); context->set_change_observers(change_observers()); return context; } diff --git a/webkit/fileapi/sandbox_mount_point_provider.cc b/webkit/fileapi/sandbox_mount_point_provider.cc index 1c4e5903..040f267 100644 --- a/webkit/fileapi/sandbox_mount_point_provider.cc +++ b/webkit/fileapi/sandbox_mount_point_provider.cc @@ -341,7 +341,6 @@ SandboxMountPointProvider::SandboxMountPointProvider( file_task_runner, ALLOW_THIS_IN_INITIALIZER_LIST(this))), weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { - // Set quota observers. UpdateObserverList::Source update_observers_src; AccessObserverList::Source access_observers_src; diff --git a/webkit/fileapi/syncable/canned_syncable_file_system.cc b/webkit/fileapi/syncable/canned_syncable_file_system.cc index 24e51d7..374a1f9 100644 --- a/webkit/fileapi/syncable/canned_syncable_file_system.cc +++ b/webkit/fileapi/syncable/canned_syncable_file_system.cc @@ -67,8 +67,8 @@ void RunOnThread(base::SingleThreadTaskRunner* task_runner, location, task, base::Bind(base::IgnoreResult( base::Bind(&base::MessageLoopProxy::PostTask, - base::MessageLoopProxy::current(), - FROM_HERE, base::Bind(&Quit))))); + base::MessageLoopProxy::current(), + FROM_HERE, base::Bind(&Quit))))); MessageLoop::current()->Run(); } @@ -100,7 +100,7 @@ class WriteHelper { MessageLoop::current()->DeleteSoon(FROM_HERE, request_context_.release()); } - void DidWrite(const base::Callback<void(int64)>& completion_callback, + void DidWrite(const base::Callback<void(int64 result)>& completion_callback, PlatformFileError error, int64 bytes, bool complete) { if (error == base::PLATFORM_FILE_OK) { bytes_written_ += bytes; diff --git a/webkit/fileapi/syncable/canned_syncable_file_system.h b/webkit/fileapi/syncable/canned_syncable_file_system.h index f2cd504..9e8ef68 100644 --- a/webkit/fileapi/syncable/canned_syncable_file_system.h +++ b/webkit/fileapi/syncable/canned_syncable_file_system.h @@ -6,6 +6,7 @@ #define WEBKIT_FILEAPI_SYNCABLE_CANNED_SYNCABLE_FILE_SYSTEM_H_ #include <string> +#include <vector> #include "base/callback_forward.h" #include "base/message_loop.h" diff --git a/webkit/fileapi/syncable/local_file_sync_context.h b/webkit/fileapi/syncable/local_file_sync_context.h index 6f0cc07..e6d1447 100644 --- a/webkit/fileapi/syncable/local_file_sync_context.h +++ b/webkit/fileapi/syncable/local_file_sync_context.h @@ -43,10 +43,10 @@ class WEBKIT_STORAGE_EXPORT LocalFileSyncContext : public base::RefCountedThreadSafe<LocalFileSyncContext>, public LocalFileSyncStatus::Observer { public: - typedef base::Callback<void( - SyncStatusCode status, - SyncFileType file_type, - const FileChangeList& changes)> ChangeListCallback; + typedef base::Callback<void(SyncStatusCode status, + SyncFileType file_type, + const FileChangeList& changes)> + ChangeListCallback; LocalFileSyncContext(base::SingleThreadTaskRunner* ui_task_runner, base::SingleThreadTaskRunner* io_task_runner); diff --git a/webkit/fileapi/syncable/local_file_sync_status.h b/webkit/fileapi/syncable/local_file_sync_status.h index f0ce581..a089b56 100644 --- a/webkit/fileapi/syncable/local_file_sync_status.h +++ b/webkit/fileapi/syncable/local_file_sync_status.h @@ -31,6 +31,7 @@ class WEBKIT_STORAGE_EXPORT LocalFileSyncStatus : public base::NonThreadSafe { class WEBKIT_STORAGE_EXPORT Observer { public: Observer() {} + virtual ~Observer() {} virtual void OnSyncEnabled(const FileSystemURL& url) = 0; virtual void OnWriteEnabled(const FileSystemURL& url) = 0; private: diff --git a/webkit/fileapi/syncable/sync_callbacks.h b/webkit/fileapi/syncable/sync_callbacks.h index 5865b06..b1e8d20 100644 --- a/webkit/fileapi/syncable/sync_callbacks.h +++ b/webkit/fileapi/syncable/sync_callbacks.h @@ -9,10 +9,11 @@ #include "webkit/fileapi/syncable/sync_status_code.h" namespace fileapi { + class FileSystemURL; typedef base::Callback<void(SyncStatusCode status)> StatusCallback; -typedef base::Callback<void(SyncStatusCode, const FileSystemURL& url)> +typedef base::Callback<void(SyncStatusCode status, const FileSystemURL& url)> SyncCompletionCallback; } // namespace fileapi diff --git a/webkit/fileapi/syncable/syncable_file_operation_runner_unittest.cc b/webkit/fileapi/syncable/syncable_file_operation_runner_unittest.cc index f3e8e99..dfa00f1 100644 --- a/webkit/fileapi/syncable/syncable_file_operation_runner_unittest.cc +++ b/webkit/fileapi/syncable/syncable_file_operation_runner_unittest.cc @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <string> + #include "base/basictypes.h" #include "base/location.h" #include "base/memory/scoped_ptr.h" |