Commit 87a8296b authored by oleg@chromium.org's avatar oleg@chromium.org

Add a debug check to verify that FileSystemCallbackDispatcher is not NULL in FileSystemOperation.

Review URL: http://codereview.chromium.org/8390046

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107601 0039d316-1c4b-4281-b951-d872f2087c98
parent 03d62140
...@@ -80,6 +80,7 @@ FileSystemOperation::~FileSystemOperation() { ...@@ -80,6 +80,7 @@ FileSystemOperation::~FileSystemOperation() {
void FileSystemOperation::OpenFileSystem( void FileSystemOperation::OpenFileSystem(
const GURL& origin_url, fileapi::FileSystemType type, bool create) { const GURL& origin_url, fileapi::FileSystemType type, bool create) {
#ifndef NDEBUG #ifndef NDEBUG
DCHECK(dispatcher_.get());
DCHECK(kOperationNone == pending_operation_); DCHECK(kOperationNone == pending_operation_);
pending_operation_ = static_cast<FileSystemOperation::OperationType>( pending_operation_ = static_cast<FileSystemOperation::OperationType>(
kOperationOpenFileSystem); kOperationOpenFileSystem);
...@@ -103,6 +104,7 @@ void FileSystemOperation::OpenFileSystem( ...@@ -103,6 +104,7 @@ void FileSystemOperation::OpenFileSystem(
void FileSystemOperation::CreateFile(const GURL& path, void FileSystemOperation::CreateFile(const GURL& path,
bool exclusive) { bool exclusive) {
#ifndef NDEBUG #ifndef NDEBUG
DCHECK(dispatcher_.get());
DCHECK(kOperationNone == pending_operation_); DCHECK(kOperationNone == pending_operation_);
pending_operation_ = kOperationCreateFile; pending_operation_ = kOperationCreateFile;
#endif #endif
...@@ -141,6 +143,7 @@ void FileSystemOperation::CreateDirectory(const GURL& path, ...@@ -141,6 +143,7 @@ void FileSystemOperation::CreateDirectory(const GURL& path,
bool exclusive, bool exclusive,
bool recursive) { bool recursive) {
#ifndef NDEBUG #ifndef NDEBUG
DCHECK(dispatcher_.get());
DCHECK(kOperationNone == pending_operation_); DCHECK(kOperationNone == pending_operation_);
pending_operation_ = kOperationCreateDirectory; pending_operation_ = kOperationCreateDirectory;
#endif #endif
...@@ -176,6 +179,7 @@ void FileSystemOperation::DelayedCreateDirectoryForQuota( ...@@ -176,6 +179,7 @@ void FileSystemOperation::DelayedCreateDirectoryForQuota(
void FileSystemOperation::Copy(const GURL& src_path, void FileSystemOperation::Copy(const GURL& src_path,
const GURL& dest_path) { const GURL& dest_path) {
#ifndef NDEBUG #ifndef NDEBUG
DCHECK(dispatcher_.get());
DCHECK(kOperationNone == pending_operation_); DCHECK(kOperationNone == pending_operation_);
pending_operation_ = kOperationCopy; pending_operation_ = kOperationCopy;
#endif #endif
...@@ -210,6 +214,7 @@ void FileSystemOperation::DelayedCopyForQuota(quota::QuotaStatusCode status, ...@@ -210,6 +214,7 @@ void FileSystemOperation::DelayedCopyForQuota(quota::QuotaStatusCode status,
void FileSystemOperation::Move(const GURL& src_path, void FileSystemOperation::Move(const GURL& src_path,
const GURL& dest_path) { const GURL& dest_path) {
#ifndef NDEBUG #ifndef NDEBUG
DCHECK(dispatcher_.get());
DCHECK(kOperationNone == pending_operation_); DCHECK(kOperationNone == pending_operation_);
pending_operation_ = kOperationMove; pending_operation_ = kOperationMove;
#endif #endif
...@@ -243,6 +248,7 @@ void FileSystemOperation::DelayedMoveForQuota(quota::QuotaStatusCode status, ...@@ -243,6 +248,7 @@ void FileSystemOperation::DelayedMoveForQuota(quota::QuotaStatusCode status,
void FileSystemOperation::DirectoryExists(const GURL& path) { void FileSystemOperation::DirectoryExists(const GURL& path) {
#ifndef NDEBUG #ifndef NDEBUG
DCHECK(dispatcher_.get());
DCHECK(kOperationNone == pending_operation_); DCHECK(kOperationNone == pending_operation_);
pending_operation_ = kOperationDirectoryExists; pending_operation_ = kOperationDirectoryExists;
#endif #endif
...@@ -259,6 +265,7 @@ void FileSystemOperation::DirectoryExists(const GURL& path) { ...@@ -259,6 +265,7 @@ void FileSystemOperation::DirectoryExists(const GURL& path) {
void FileSystemOperation::FileExists(const GURL& path) { void FileSystemOperation::FileExists(const GURL& path) {
#ifndef NDEBUG #ifndef NDEBUG
DCHECK(dispatcher_.get());
DCHECK(kOperationNone == pending_operation_); DCHECK(kOperationNone == pending_operation_);
pending_operation_ = kOperationFileExists; pending_operation_ = kOperationFileExists;
#endif #endif
...@@ -275,6 +282,7 @@ void FileSystemOperation::FileExists(const GURL& path) { ...@@ -275,6 +282,7 @@ void FileSystemOperation::FileExists(const GURL& path) {
void FileSystemOperation::GetMetadata(const GURL& path) { void FileSystemOperation::GetMetadata(const GURL& path) {
#ifndef NDEBUG #ifndef NDEBUG
DCHECK(dispatcher_.get());
DCHECK(kOperationNone == pending_operation_); DCHECK(kOperationNone == pending_operation_);
pending_operation_ = kOperationGetMetadata; pending_operation_ = kOperationGetMetadata;
#endif #endif
...@@ -291,6 +299,7 @@ void FileSystemOperation::GetMetadata(const GURL& path) { ...@@ -291,6 +299,7 @@ void FileSystemOperation::GetMetadata(const GURL& path) {
void FileSystemOperation::ReadDirectory(const GURL& path) { void FileSystemOperation::ReadDirectory(const GURL& path) {
#ifndef NDEBUG #ifndef NDEBUG
DCHECK(dispatcher_.get());
DCHECK(kOperationNone == pending_operation_); DCHECK(kOperationNone == pending_operation_);
pending_operation_ = kOperationReadDirectory; pending_operation_ = kOperationReadDirectory;
#endif #endif
...@@ -307,6 +316,7 @@ void FileSystemOperation::ReadDirectory(const GURL& path) { ...@@ -307,6 +316,7 @@ void FileSystemOperation::ReadDirectory(const GURL& path) {
void FileSystemOperation::Remove(const GURL& path, bool recursive) { void FileSystemOperation::Remove(const GURL& path, bool recursive) {
#ifndef NDEBUG #ifndef NDEBUG
DCHECK(dispatcher_.get());
DCHECK(kOperationNone == pending_operation_); DCHECK(kOperationNone == pending_operation_);
pending_operation_ = kOperationRemove; pending_operation_ = kOperationRemove;
#endif #endif
...@@ -327,6 +337,7 @@ void FileSystemOperation::Write( ...@@ -327,6 +337,7 @@ void FileSystemOperation::Write(
const GURL& blob_url, const GURL& blob_url,
int64 offset) { int64 offset) {
#ifndef NDEBUG #ifndef NDEBUG
DCHECK(dispatcher_.get());
DCHECK(kOperationNone == pending_operation_); DCHECK(kOperationNone == pending_operation_);
pending_operation_ = kOperationWrite; pending_operation_ = kOperationWrite;
#endif #endif
...@@ -367,6 +378,7 @@ void FileSystemOperation::DelayedWriteForQuota(quota::QuotaStatusCode status, ...@@ -367,6 +378,7 @@ void FileSystemOperation::DelayedWriteForQuota(quota::QuotaStatusCode status,
void FileSystemOperation::Truncate(const GURL& path, int64 length) { void FileSystemOperation::Truncate(const GURL& path, int64 length) {
#ifndef NDEBUG #ifndef NDEBUG
DCHECK(dispatcher_.get());
DCHECK(kOperationNone == pending_operation_); DCHECK(kOperationNone == pending_operation_);
pending_operation_ = kOperationTruncate; pending_operation_ = kOperationTruncate;
#endif #endif
...@@ -401,6 +413,7 @@ void FileSystemOperation::TouchFile(const GURL& path, ...@@ -401,6 +413,7 @@ void FileSystemOperation::TouchFile(const GURL& path,
const base::Time& last_access_time, const base::Time& last_access_time,
const base::Time& last_modified_time) { const base::Time& last_modified_time) {
#ifndef NDEBUG #ifndef NDEBUG
DCHECK(dispatcher_.get());
DCHECK(kOperationNone == pending_operation_); DCHECK(kOperationNone == pending_operation_);
pending_operation_ = kOperationTouchFile; pending_operation_ = kOperationTouchFile;
#endif #endif
...@@ -420,6 +433,7 @@ void FileSystemOperation::OpenFile(const GURL& path, ...@@ -420,6 +433,7 @@ void FileSystemOperation::OpenFile(const GURL& path,
int file_flags, int file_flags,
base::ProcessHandle peer_handle) { base::ProcessHandle peer_handle) {
#ifndef NDEBUG #ifndef NDEBUG
DCHECK(dispatcher_.get());
DCHECK(kOperationNone == pending_operation_); DCHECK(kOperationNone == pending_operation_);
pending_operation_ = kOperationOpenFile; pending_operation_ = kOperationOpenFile;
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment