diff options
author | dumi@chromium.org <dumi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-28 21:58:28 +0000 |
---|---|---|
committer | dumi@chromium.org <dumi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-28 21:58:28 +0000 |
commit | ee8d4c8656fc8a8723e91e44d05fba4027c77b66 (patch) | |
tree | 7ed5dd75b40690657edd1e41b1aa78a980fd43d2 /chrome/renderer/renderer_webkitclient_impl.cc | |
parent | 0189bc72c90fab03afab623d0b2d8be3d35af3e7 (diff) | |
download | chromium_src-ee8d4c8656fc8a8723e91e44d05fba4027c77b66.zip chromium_src-ee8d4c8656fc8a8723e91e44d05fba4027c77b66.tar.gz chromium_src-ee8d4c8656fc8a8723e91e44d05fba4027c77b66.tar.bz2 |
Chromium side patch for DB support on Linux.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/174232
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24807 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/renderer_webkitclient_impl.cc')
-rw-r--r-- | chrome/renderer/renderer_webkitclient_impl.cc | 52 |
1 files changed, 43 insertions, 9 deletions
diff --git a/chrome/renderer/renderer_webkitclient_impl.cc b/chrome/renderer/renderer_webkitclient_impl.cc index 4ae32a34..b6f3228 100644 --- a/chrome/renderer/renderer_webkitclient_impl.cc +++ b/chrome/renderer/renderer_webkitclient_impl.cc @@ -4,6 +4,12 @@ #include "chrome/renderer/renderer_webkitclient_impl.h" +#if defined(USE_SYSTEM_SQLITE) +#include <sqlite3.h> +#else +#include "third_party/sqlite/preprocessed/sqlite3.h" +#endif + #include "base/command_line.h" #include "base/file_path.h" #include "base/platform_file.h" @@ -27,6 +33,10 @@ #include "chrome/renderer/renderer_sandbox_support_linux.h" #endif +#if defined(OS_POSIX) +#include "base/file_descriptor_posix.h" +#endif + using WebKit::WebApplicationCacheHost; using WebKit::WebApplicationCacheHostClient; using WebKit::WebStorageArea; @@ -226,24 +236,48 @@ WebString RendererWebKitClientImpl::SandboxSupport::getFontFamilyForCharacters( //------------------------------------------------------------------------------ base::PlatformFile RendererWebKitClientImpl::databaseOpenFile( - const WebString& file_name, int desired_flags) { + const WebString& file_name, int desired_flags, + base::PlatformFile* dir_handle) { DBMessageFilter* db_message_filter = DBMessageFilter::GetInstance(); int message_id = db_message_filter->GetUniqueID(); - return db_message_filter->SendAndWait( - new ViewHostMsg_DatabaseOpenFile( - FilePath(webkit_glue::WebStringToFilePathString(file_name)), - desired_flags, message_id), - message_id, base::kInvalidPlatformFileValue); + + ViewMsg_DatabaseOpenFileResponse_Params default_response = +#if defined(OS_WIN) + { base::kInvalidPlatformFileValue }; +#elif defined(OS_POSIX) + { base::FileDescriptor(base::kInvalidPlatformFileValue, true), + base::FileDescriptor(base::kInvalidPlatformFileValue, true) }; +#endif + + ViewMsg_DatabaseOpenFileResponse_Params result = + db_message_filter->SendAndWait( + new ViewHostMsg_DatabaseOpenFile( + FilePath(webkit_glue::WebStringToFilePathString(file_name)), + desired_flags, message_id), + message_id, default_response); + +#if defined(OS_WIN) + if (dir_handle) { + *dir_handle = base::kInvalidPlatformFileValue; + } + return result.file_handle; +#elif defined(OS_POSIX) + if (dir_handle) { + *dir_handle = result.dir_handle.fd; + } + return result.file_handle.fd; +#endif } -bool RendererWebKitClientImpl::databaseDeleteFile(const WebString& file_name) { +int RendererWebKitClientImpl::databaseDeleteFile( + const WebString& file_name, bool sync_dir) { DBMessageFilter* db_message_filter = DBMessageFilter::GetInstance(); int message_id = db_message_filter->GetUniqueID(); return db_message_filter->SendAndWait( new ViewHostMsg_DatabaseDeleteFile( - FilePath(webkit_glue::WebStringToFilePathString(file_name)), + FilePath(webkit_glue::WebStringToFilePathString(file_name)), sync_dir, message_id), - message_id, false); + message_id, SQLITE_IOERR_DELETE); } long RendererWebKitClientImpl::databaseGetFileAttributes( |