OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/common/db_message_filter.h" | 5 #include "chrome/common/db_message_filter.h" |
6 | 6 |
7 #include "chrome/common/render_messages.h" | 7 #include "chrome/common/database_messages.h" |
8 #include "third_party/WebKit/WebKit/chromium/public/WebDatabase.h" | 8 #include "third_party/WebKit/WebKit/chromium/public/WebDatabase.h" |
| 9 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" |
9 | 10 |
10 DBMessageFilter::DBMessageFilter() { | 11 DBMessageFilter::DBMessageFilter() { |
11 } | 12 } |
12 | 13 |
13 bool DBMessageFilter::OnMessageReceived(const IPC::Message& message) { | 14 bool DBMessageFilter::OnMessageReceived(const IPC::Message& message) { |
14 bool handled = true; | 15 bool handled = true; |
15 IPC_BEGIN_MESSAGE_MAP(DBMessageFilter, message) | 16 IPC_BEGIN_MESSAGE_MAP(DBMessageFilter, message) |
16 IPC_MESSAGE_HANDLER(ViewMsg_DatabaseUpdateSize, OnDatabaseUpdateSize) | 17 IPC_MESSAGE_HANDLER(DatabaseMsg_UpdateSize, OnDatabaseUpdateSize) |
17 IPC_MESSAGE_HANDLER(ViewMsg_DatabaseCloseImmediately, | 18 IPC_MESSAGE_HANDLER(DatabaseMsg_CloseImmediately, |
18 OnDatabaseCloseImmediately) | 19 OnDatabaseCloseImmediately) |
19 IPC_MESSAGE_UNHANDLED(handled = false) | 20 IPC_MESSAGE_UNHANDLED(handled = false) |
20 IPC_END_MESSAGE_MAP() | 21 IPC_END_MESSAGE_MAP() |
21 return handled; | 22 return handled; |
22 } | 23 } |
23 | 24 |
24 void DBMessageFilter::OnDatabaseUpdateSize(const string16& origin_identifier, | 25 void DBMessageFilter::OnDatabaseUpdateSize(const string16& origin_identifier, |
25 const string16& database_name, | 26 const string16& database_name, |
26 int64 database_size, | 27 int64 database_size, |
27 int64 space_available) { | 28 int64 space_available) { |
28 WebKit::WebDatabase::updateDatabaseSize( | 29 WebKit::WebDatabase::updateDatabaseSize( |
29 origin_identifier, database_name, database_size, space_available); | 30 origin_identifier, database_name, database_size, space_available); |
30 } | 31 } |
31 | 32 |
32 void DBMessageFilter::OnDatabaseCloseImmediately( | 33 void DBMessageFilter::OnDatabaseCloseImmediately( |
33 const string16& origin_identifier, | 34 const string16& origin_identifier, |
34 const string16& database_name) { | 35 const string16& database_name) { |
35 WebKit::WebDatabase::closeDatabaseImmediately( | 36 WebKit::WebDatabase::closeDatabaseImmediately( |
36 origin_identifier, database_name); | 37 origin_identifier, database_name); |
37 } | 38 } |
OLD | NEW |