blob: 90dc00dfe7b23a50b70dec6ac3cedb6ec45281f4 (
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
// Copyright (c) 2009 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 CHROME_BROWSER_RENDERER_HOST_DATABASE_DISPATCHER_HOST_H_
#define CHROME_BROWSER_RENDERER_HOST_DATABASE_DISPATCHER_HOST_H_
#include "base/file_path.h"
#include "base/ref_counted.h"
class MessageLoop;
class ResourceMessageFilter;
namespace IPC {
class Message;
}
class DatabaseDispatcherHost {
public:
DatabaseDispatcherHost(const FilePath& profile_path,
ResourceMessageFilter* resource_message_filter);
~DatabaseDispatcherHost();
// Returns true iff the message is HTML5 DB related and was processed.
bool OnMessageReceived(const IPC::Message& message, bool* message_was_ok);
// Processes the request to return a handle to the given DB file.
void OnDatabaseOpenFile(const FilePath& file_name,
int desired_flags, int32 message_id);
// Processes the request to delete the given DB file.
void OnDatabaseDeleteFile(const FilePath& file_name,
int32 message_id);
// Processes the request to return the attributes of the given DB file.
void OnDatabaseGetFileAttributes(const FilePath& file_name,
int32 message_id);
// Processes the request to return the size of the given file.
void OnDatabaseGetFileSize(const FilePath& file_name,
int32 message_id);
private:
// Determines if the message is HTML5 DB related.
bool IsDBMessage(const IPC::Message& message);
// Returns the directory where all DB files are stored.
FilePath GetDBDir();
// Returns the absolute name of the given DB file.
FilePath GetDBFileFullPath(const FilePath& file_name);
// The user data directory.
FilePath profile_path_;
// The ResourceMessageFilter instance of this renderer process.
ResourceMessageFilter* resource_message_filter_;
// The message loop of the file thread.
MessageLoop* file_thread_message_loop_;
};
#endif // CHROME_BROWSER_RENDERER_HOST_DATABASE_DISPATCHER_HOST_H_
|