1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "content/common/db_message_filter.h"
7 #include "content/common/database_messages.h"
8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabase.h"
9 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h"
13 DBMessageFilter::DBMessageFilter() {
16 bool DBMessageFilter::OnMessageReceived(const IPC::Message
& message
) {
18 IPC_BEGIN_MESSAGE_MAP(DBMessageFilter
, message
)
19 IPC_MESSAGE_HANDLER(DatabaseMsg_UpdateSize
, OnDatabaseUpdateSize
)
20 IPC_MESSAGE_HANDLER(DatabaseMsg_UpdateSpaceAvailable
,
21 OnDatabaseUpdateSpaceAvailable
)
22 IPC_MESSAGE_HANDLER(DatabaseMsg_ResetSpaceAvailable
,
23 OnDatabaseResetSpaceAvailable
)
24 IPC_MESSAGE_HANDLER(DatabaseMsg_CloseImmediately
,
25 OnDatabaseCloseImmediately
)
26 IPC_MESSAGE_UNHANDLED(handled
= false)
31 void DBMessageFilter::OnDatabaseUpdateSize(const string16
& origin_identifier
,
32 const string16
& database_name
,
33 int64 database_size
) {
34 WebKit::WebDatabase::updateDatabaseSize(
35 origin_identifier
, database_name
, database_size
);
38 void DBMessageFilter::OnDatabaseUpdateSpaceAvailable(
39 const string16
& origin_identifier
,
40 int64 space_available
) {
41 WebKit::WebDatabase::updateSpaceAvailable(
42 origin_identifier
, space_available
);
45 void DBMessageFilter::OnDatabaseResetSpaceAvailable(
46 const string16
& origin_identifier
) {
47 WebKit::WebDatabase::resetSpaceAvailable(origin_identifier
);
50 void DBMessageFilter::OnDatabaseCloseImmediately(
51 const string16
& origin_identifier
,
52 const string16
& database_name
) {
53 WebKit::WebDatabase::closeDatabaseImmediately(
54 origin_identifier
, database_name
);
57 } // namespace content