OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 "content/child/database_util.h" | 5 #include "content/child/database_util.h" |
6 | 6 |
7 #include "content/common/database_messages.h" | 7 #include "content/common/database_messages.h" |
8 #include "ipc/ipc_sync_message_filter.h" | 8 #include "ipc/ipc_sync_message_filter.h" |
| 9 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" |
9 #include "third_party/WebKit/public/platform/WebString.h" | 10 #include "third_party/WebKit/public/platform/WebString.h" |
10 #include "third_party/sqlite/sqlite3.h" | 11 #include "third_party/sqlite/sqlite3.h" |
11 | 12 |
12 using blink::Platform; | 13 using blink::Platform; |
| 14 using blink::WebSecurityOrigin; |
13 using blink::WebString; | 15 using blink::WebString; |
14 | 16 |
15 namespace content { | 17 namespace content { |
16 | 18 |
17 Platform::FileHandle DatabaseUtil::DatabaseOpenFile( | 19 Platform::FileHandle DatabaseUtil::DatabaseOpenFile( |
18 const WebString& vfs_file_name, | 20 const WebString& vfs_file_name, |
19 int desired_flags, | 21 int desired_flags, |
20 IPC::SyncMessageFilter* sync_message_filter) { | 22 IPC::SyncMessageFilter* sync_message_filter) { |
21 IPC::PlatformFileForTransit file_handle = | 23 IPC::PlatformFileForTransit file_handle = |
22 IPC::InvalidPlatformFileForTransit(); | 24 IPC::InvalidPlatformFileForTransit(); |
(...skipping 26 matching lines...) Expand all Loading... |
49 long long DatabaseUtil::DatabaseGetFileSize( | 51 long long DatabaseUtil::DatabaseGetFileSize( |
50 const WebString& vfs_file_name, | 52 const WebString& vfs_file_name, |
51 IPC::SyncMessageFilter* sync_message_filter) { | 53 IPC::SyncMessageFilter* sync_message_filter) { |
52 int64_t rv = 0LL; | 54 int64_t rv = 0LL; |
53 sync_message_filter->Send( | 55 sync_message_filter->Send( |
54 new DatabaseHostMsg_GetFileSize(vfs_file_name, &rv)); | 56 new DatabaseHostMsg_GetFileSize(vfs_file_name, &rv)); |
55 return rv; | 57 return rv; |
56 } | 58 } |
57 | 59 |
58 long long DatabaseUtil::DatabaseGetSpaceAvailable( | 60 long long DatabaseUtil::DatabaseGetSpaceAvailable( |
59 const WebString& origin_identifier, | 61 const WebSecurityOrigin& origin, |
60 IPC::SyncMessageFilter* sync_message_filter) { | 62 IPC::SyncMessageFilter* sync_message_filter) { |
61 int64_t rv = 0LL; | 63 int64_t rv = 0LL; |
62 sync_message_filter->Send( | 64 sync_message_filter->Send( |
63 new DatabaseHostMsg_GetSpaceAvailable(origin_identifier.utf8(), &rv)); | 65 new DatabaseHostMsg_GetSpaceAvailable(origin, &rv)); |
64 return rv; | 66 return rv; |
65 } | 67 } |
66 | 68 |
67 bool DatabaseUtil::DatabaseSetFileSize( | 69 bool DatabaseUtil::DatabaseSetFileSize( |
68 const WebString& vfs_file_name, | 70 const WebString& vfs_file_name, |
69 int64_t size, | 71 int64_t size, |
70 IPC::SyncMessageFilter* sync_message_filter) { | 72 IPC::SyncMessageFilter* sync_message_filter) { |
71 bool rv = false; | 73 bool rv = false; |
72 sync_message_filter->Send( | 74 sync_message_filter->Send( |
73 new DatabaseHostMsg_SetFileSize(vfs_file_name, size, &rv)); | 75 new DatabaseHostMsg_SetFileSize(vfs_file_name, size, &rv)); |
74 return rv; | 76 return rv; |
75 } | 77 } |
76 | 78 |
77 } // namespace content | 79 } // namespace content |
OLD | NEW |