summaryrefslogtreecommitdiffstats
path: root/content/child/database_util.h
blob: 1449d6bf0e83e162b8dc8ea8640d288b408c7f2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright (c) 2012 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 CONTENT_CHILD_DATABASE_UTIL_H_
#define CONTENT_CHILD_DATABASE_UTIL_H_

#include "content/child/blink_platform_impl.h"

namespace IPC {
class SyncMessageFilter;
}

namespace content {

// A class of utility functions used by RendererBlinkPlatformImpl to handle
// database file accesses.
class DatabaseUtil {
 public:
  static blink::Platform::FileHandle DatabaseOpenFile(
      const blink::WebString& vfs_file_name,
      int desired_flags,
      IPC::SyncMessageFilter* sync_message_filter);
  static int DatabaseDeleteFile(
      const blink::WebString& vfs_file_name,
      bool sync_dir,
      IPC::SyncMessageFilter* sync_message_filter);
  static long DatabaseGetFileAttributes(
      const blink::WebString& vfs_file_name,
      IPC::SyncMessageFilter* sync_message_filter);
  static long long DatabaseGetFileSize(
      const blink::WebString& vfs_file_name,
      IPC::SyncMessageFilter* sync_message_filter);
  static long long DatabaseGetSpaceAvailable(
      const blink::WebString& origin_identifier,
      IPC::SyncMessageFilter* sync_message_filter);
  static bool DatabaseSetFileSize(
      const blink::WebString& vfs_file_name,
      int64 size,
      IPC::SyncMessageFilter* sync_message_filter);
};

}  // namespace content

#endif  // CONTENT_CHILD_DATABASE_UTIL_H_