// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef WEBKIT_FILEAPI_QUOTA_FILE_UTIL_H_
#define WEBKIT_FILEAPI_QUOTA_FILE_UTIL_H_

#include "webkit/fileapi/file_system_file_util.h"
#include "webkit/fileapi/file_system_operation_context.h"
#pragma once

namespace fileapi {

class QuotaFileUtil : public FileSystemFileUtil {
 public:
  static QuotaFileUtil* GetInstance();
  ~QuotaFileUtil() {}

  static const int64 kNoLimit;

  virtual base::PlatformFileError CopyOrMoveFile(
    FileSystemOperationContext* fs_context,
    const FilePath& src_file_path,
    const FilePath& dest_file_path,
    bool copy);

  // TODO(dmikurube): Charge some amount of quota for directories.

  virtual base::PlatformFileError Truncate(
      FileSystemOperationContext* fs_context,
      const FilePath& path,
      int64 length);

  friend struct DefaultSingletonTraits<QuotaFileUtil>;
  DISALLOW_COPY_AND_ASSIGN(QuotaFileUtil);

 protected:
  QuotaFileUtil() {}
};

}  // namespace fileapi

#endif  // WEBKIT_FILEAPI_QUOTA_FILE_UTIL_H_

// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef WEBKIT_FILEAPI_QUOTA_FILE_UTIL_H_
#define WEBKIT_FILEAPI_QUOTA_FILE_UTIL_H_

#include "webkit/fileapi/file_system_file_util.h"
#include "webkit/fileapi/file_system_operation_context.h"
#pragma once

namespace fileapi {

class QuotaFileUtil : public FileSystemFileUtil {
 public:
  static QuotaFileUtil* GetInstance();
  ~QuotaFileUtil() {}

  static const int64 kNoLimit;

  base::PlatformFileError CopyOrMoveFile(
    FileSystemOperationContext* fs_context,
    const FilePath& src_file_path,
    const FilePath& dest_file_path,
    bool copy);

  // TODO(dmikurube): Charge some amount of quota for directories.

  base::PlatformFileError Truncate(
      FileSystemOperationContext* fs_context,
      const FilePath& path,
      int64 length);

  friend struct DefaultSingletonTraits<QuotaFileUtil>;
  DISALLOW_COPY_AND_ASSIGN(QuotaFileUtil);

 protected:
  QuotaFileUtil() {}
};

}  // namespace fileapi

#endif  // WEBKIT_FILEAPI_QUOTA_FILE_UTIL_H_

--- 
+++ 
@@ -18,7 +18,7 @@
 
   static const int64 kNoLimit;
 
-  base::PlatformFileError CopyOrMoveFile(
+  virtual base::PlatformFileError CopyOrMoveFile(
     FileSystemOperationContext* fs_context,
     const FilePath& src_file_path,
     const FilePath& dest_file_path,
@@ -26,7 +26,7 @@
 
   // TODO(dmikurube): Charge some amount of quota for directories.
 
-  base::PlatformFileError Truncate(
+  virtual base::PlatformFileError Truncate(
       FileSystemOperationContext* fs_context,
       const FilePath& path,
       int64 length);
Add virtual in QuitaFileUtil to fix the compilation error in r82441.

TBR=dmikurube,kinuko
BUG=none
TEST=none

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

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@82445 0039d316-1c4b-4281-b951-d872f2087c98
