summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-13 21:51:42 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-13 21:51:42 +0000
commit37666cf5cff20be16e5636654d3a751f26e31122 (patch)
tree2fbfe6996da69be9d3bdb4c42be853dd0b497b5b /chrome
parentce557b68925e65ba5a705f9fce60d062df68bf40 (diff)
downloadchromium_src-37666cf5cff20be16e5636654d3a751f26e31122.zip
chromium_src-37666cf5cff20be16e5636654d3a751f26e31122.tar.gz
chromium_src-37666cf5cff20be16e5636654d3a751f26e31122.tar.bz2
Move database files from chrome\commmon to content\common, in preparation for moving the worker code.
TBR=avi Review URL: http://codereview.chromium.org/6683034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77975 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/chrome_common.gypi5
-rw-r--r--chrome/common/common_message_generator.h1
-rw-r--r--chrome/common/database_messages.h76
-rw-r--r--chrome/common/database_util.cc53
-rw-r--r--chrome/common/database_util.h23
-rw-r--r--chrome/common/db_message_filter.cc38
-rw-r--r--chrome/common/db_message_filter.h28
-rw-r--r--chrome/common/web_database_observer_impl.cc2
-rw-r--r--chrome/renderer/render_thread.cc4
-rw-r--r--chrome/renderer/render_view.cc2
-rw-r--r--chrome/renderer/renderer_webkitclient_impl.cc2
-rw-r--r--chrome/worker/worker_thread.cc2
-rw-r--r--chrome/worker/worker_webkitclient_impl.cc2
13 files changed, 7 insertions, 231 deletions
diff --git a/chrome/chrome_common.gypi b/chrome/chrome_common.gypi
index f8b6584..648a28c 100644
--- a/chrome/chrome_common.gypi
+++ b/chrome/chrome_common.gypi
@@ -50,7 +50,6 @@
'common/content_settings_helper.cc',
'common/content_settings_helper.h',
'common/content_settings_types.h',
- 'common/database_messages.h',
'common/devtools_messages.cc',
'common/devtools_messages.h',
'common/devtools_messages_internal.h',
@@ -192,10 +191,6 @@
'common/chrome_descriptors.h',
'common/common_glue.cc',
'common/css_colors.h',
- 'common/database_util.cc',
- 'common/database_util.h',
- 'common/db_message_filter.cc',
- 'common/db_message_filter.h',
'common/default_plugin.cc',
'common/default_plugin.h',
'common/deprecated/event_sys-inl.h',
diff --git a/chrome/common/common_message_generator.h b/chrome/common/common_message_generator.h
index bd1fffb..cbd4bca 100644
--- a/chrome/common/common_message_generator.h
+++ b/chrome/common/common_message_generator.h
@@ -6,7 +6,6 @@
#include "chrome/common/autofill_messages.h"
#include "chrome/common/clipboard_messages.h"
-#include "chrome/common/database_messages.h"
#include "chrome/common/indexed_db_messages.h"
#include "chrome/common/safebrowsing_messages.h"
#include "chrome/common/speech_input_messages.h"
diff --git a/chrome/common/database_messages.h b/chrome/common/database_messages.h
deleted file mode 100644
index 7cf64a1..0000000
--- a/chrome/common/database_messages.h
+++ /dev/null
@@ -1,76 +0,0 @@
-// Copyright (c) 2010 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.
-
-// Multiply-included message file, no include guard.
-
-#include "ipc/ipc_message_macros.h"
-#include "ipc/ipc_param_traits.h"
-#include "ipc/ipc_platform_file.h"
-
-#define IPC_MESSAGE_START DatabaseMsgStart
-
-// Database messages sent from the browser to the renderer.
-
-// Notifies the child process of the new database size
-IPC_MESSAGE_CONTROL4(DatabaseMsg_UpdateSize,
- string16 /* the origin */,
- string16 /* the database name */,
- int64 /* the new database size */,
- int64 /* space available to origin */)
-
-// Asks the child process to close a database immediately
-IPC_MESSAGE_CONTROL2(DatabaseMsg_CloseImmediately,
- string16 /* the origin */,
- string16 /* the database name */)
-
-// Database messages sent from the renderer to the browser.
-
-// Sent by the renderer process to check whether access to web databases is
-// granted by content settings. This may block and trigger a cookie prompt.
-IPC_SYNC_MESSAGE_ROUTED4_1(DatabaseHostMsg_Allow,
- std::string /* origin_url */,
- string16 /* database name */,
- string16 /* database display name */,
- unsigned long /* estimated size */,
- bool /* result */)
-
-// Asks the browser process to open a DB file with the given name.
-IPC_SYNC_MESSAGE_CONTROL2_1(DatabaseHostMsg_OpenFile,
- string16 /* vfs file name */,
- int /* desired flags */,
- IPC::PlatformFileForTransit /* file_handle */)
-
-// Asks the browser process to delete a DB file
-IPC_SYNC_MESSAGE_CONTROL2_1(DatabaseHostMsg_DeleteFile,
- string16 /* vfs file name */,
- bool /* whether or not to sync the directory */,
- int /* SQLite error code */)
-
-// Asks the browser process to return the attributes of a DB file
-IPC_SYNC_MESSAGE_CONTROL1_1(DatabaseHostMsg_GetFileAttributes,
- string16 /* vfs file name */,
- int32 /* the attributes for the given DB file */)
-
-// Asks the browser process to return the size of a DB file
-IPC_SYNC_MESSAGE_CONTROL1_1(DatabaseHostMsg_GetFileSize,
- string16 /* vfs file name */,
- int64 /* the size of the given DB file */)
-
-// Notifies the browser process that a new database has been opened
-IPC_MESSAGE_CONTROL4(DatabaseHostMsg_Opened,
- string16 /* origin identifier */,
- string16 /* database name */,
- string16 /* database description */,
- int64 /* estimated size */)
-
-// Notifies the browser process that a database might have been modified
-IPC_MESSAGE_CONTROL2(DatabaseHostMsg_Modified,
- string16 /* origin identifier */,
- string16 /* database name */)
-
-// Notifies the browser process that a database is about to close
-IPC_MESSAGE_CONTROL2(DatabaseHostMsg_Closed,
- string16 /* origin identifier */,
- string16 /* database name */)
-
diff --git a/chrome/common/database_util.cc b/chrome/common/database_util.cc
deleted file mode 100644
index 2a985d3..0000000
--- a/chrome/common/database_util.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (c) 2010 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.
-
-#include "chrome/common/database_util.h"
-
-#include "chrome/common/database_messages.h"
-#include "content/common/child_thread.h"
-#include "ipc/ipc_sync_message_filter.h"
-#include "third_party/sqlite/sqlite3.h"
-#include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h"
-
-using WebKit::WebKitClient;
-using WebKit::WebString;
-
-WebKitClient::FileHandle DatabaseUtil::databaseOpenFile(
- const WebString& vfs_file_name, int desired_flags) {
- IPC::PlatformFileForTransit file_handle =
- IPC::InvalidPlatformFileForTransit();
-
- scoped_refptr<IPC::SyncMessageFilter> filter(
- ChildThread::current()->sync_message_filter());
- filter->Send(new DatabaseHostMsg_OpenFile(
- vfs_file_name, desired_flags, &file_handle));
-
- return IPC::PlatformFileForTransitToPlatformFile(file_handle);
-}
-
-int DatabaseUtil::databaseDeleteFile(
- const WebString& vfs_file_name, bool sync_dir) {
- int rv = SQLITE_IOERR_DELETE;
- scoped_refptr<IPC::SyncMessageFilter> filter(
- ChildThread::current()->sync_message_filter());
- filter->Send(new DatabaseHostMsg_DeleteFile(
- vfs_file_name, sync_dir, &rv));
- return rv;
-}
-
-long DatabaseUtil::databaseGetFileAttributes(const WebString& vfs_file_name) {
- int32 rv = -1;
- scoped_refptr<IPC::SyncMessageFilter> filter(
- ChildThread::current()->sync_message_filter());
- filter->Send(new DatabaseHostMsg_GetFileAttributes(vfs_file_name, &rv));
- return rv;
-}
-
-long long DatabaseUtil::databaseGetFileSize(const WebString& vfs_file_name) {
- int64 rv = 0LL;
- scoped_refptr<IPC::SyncMessageFilter> filter(
- ChildThread::current()->sync_message_filter());
- filter->Send(new DatabaseHostMsg_GetFileSize(vfs_file_name, &rv));
- return rv;
-}
diff --git a/chrome/common/database_util.h b/chrome/common/database_util.h
deleted file mode 100644
index b297044..0000000
--- a/chrome/common/database_util.h
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright (c) 2010 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_COMMON_DATABASE_UTIL_H_
-#define CHROME_COMMON_DATABASE_UTIL_H_
-#pragma once
-
-#include "webkit/glue/webkitclient_impl.h"
-
-// A class of utility functions used by RendererWebKitClientImpl and
-// WorkerWebKitClientImpl to handle database file accesses.
-class DatabaseUtil {
- public:
- static WebKit::WebKitClient::FileHandle databaseOpenFile(
- const WebKit::WebString& vfs_file_name, int desired_flags);
- static int databaseDeleteFile(const WebKit::WebString& vfs_file_name,
- bool sync_dir);
- static long databaseGetFileAttributes(const WebKit::WebString& vfs_file_name);
- static long long databaseGetFileSize(const WebKit::WebString& vfs_file_name);
-};
-
-#endif // CHROME_COMMON_DATABASE_UTIL_H_
diff --git a/chrome/common/db_message_filter.cc b/chrome/common/db_message_filter.cc
deleted file mode 100644
index 50cad70..0000000
--- a/chrome/common/db_message_filter.cc
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (c) 2010 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.
-
-#include "chrome/common/db_message_filter.h"
-
-#include "chrome/common/database_messages.h"
-#include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabase.h"
-#include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h"
-
-DBMessageFilter::DBMessageFilter() {
-}
-
-bool DBMessageFilter::OnMessageReceived(const IPC::Message& message) {
- bool handled = true;
- IPC_BEGIN_MESSAGE_MAP(DBMessageFilter, message)
- IPC_MESSAGE_HANDLER(DatabaseMsg_UpdateSize, OnDatabaseUpdateSize)
- IPC_MESSAGE_HANDLER(DatabaseMsg_CloseImmediately,
- OnDatabaseCloseImmediately)
- IPC_MESSAGE_UNHANDLED(handled = false)
- IPC_END_MESSAGE_MAP()
- return handled;
-}
-
-void DBMessageFilter::OnDatabaseUpdateSize(const string16& origin_identifier,
- const string16& database_name,
- int64 database_size,
- int64 space_available) {
- WebKit::WebDatabase::updateDatabaseSize(
- origin_identifier, database_name, database_size, space_available);
-}
-
-void DBMessageFilter::OnDatabaseCloseImmediately(
- const string16& origin_identifier,
- const string16& database_name) {
- WebKit::WebDatabase::closeDatabaseImmediately(
- origin_identifier, database_name);
-}
diff --git a/chrome/common/db_message_filter.h b/chrome/common/db_message_filter.h
deleted file mode 100644
index 1eb0d5c..0000000
--- a/chrome/common/db_message_filter.h
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright (c) 2010 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_COMMON_DB_MESSAGE_FILTER_H_
-#define CHROME_COMMON_DB_MESSAGE_FILTER_H_
-#pragma once
-
-#include "ipc/ipc_channel_proxy.h"
-
-// Receives database messages from the browser process and processes them on the
-// IO thread.
-class DBMessageFilter : public IPC::ChannelProxy::MessageFilter {
- public:
- DBMessageFilter();
-
- private:
- virtual bool OnMessageReceived(const IPC::Message& message);
-
- void OnDatabaseUpdateSize(const string16& origin_identifier,
- const string16& database_name,
- int64 database_size,
- int64 space_available);
- void OnDatabaseCloseImmediately(const string16& origin_identifier,
- const string16& database_name);
-};
-
-#endif // CHROME_COMMON_DB_MESSAGE_FILTER_H_
diff --git a/chrome/common/web_database_observer_impl.cc b/chrome/common/web_database_observer_impl.cc
index bc027d0..a026838 100644
--- a/chrome/common/web_database_observer_impl.cc
+++ b/chrome/common/web_database_observer_impl.cc
@@ -7,7 +7,7 @@
#include "base/auto_reset.h"
#include "base/message_loop.h"
#include "base/string16.h"
-#include "chrome/common/database_messages.h"
+#include "content/common/database_messages.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabase.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h"
diff --git a/chrome/renderer/render_thread.cc b/chrome/renderer/render_thread.cc
index 3a59fdb..7940718 100644
--- a/chrome/renderer/render_thread.cc
+++ b/chrome/renderer/render_thread.cc
@@ -25,8 +25,6 @@
#include "chrome/common/appcache/appcache_dispatcher.h"
#include "chrome/common/child_process_logging.h"
#include "chrome/common/chrome_switches.h"
-#include "chrome/common/database_messages.h"
-#include "chrome/common/db_message_filter.h"
#include "chrome/common/dom_storage_messages.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_localization_peer.h"
@@ -66,6 +64,8 @@
#include "chrome/renderer/security_filter_peer.h"
#include "chrome/renderer/spellchecker/spellcheck.h"
#include "chrome/renderer/user_script_slave.h"
+#include "content/common/database_messages.h"
+#include "content/common/db_message_filter.h"
#include "content/common/gpu_messages.h"
#include "content/common/resource_dispatcher.h"
#include "content/common/resource_messages.h"
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index fa75844..a4789ee 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -30,7 +30,6 @@
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/clipboard_messages.h"
-#include "chrome/common/database_messages.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/extensions/extension_set.h"
@@ -102,6 +101,7 @@
#include "chrome/renderer/websharedworker_proxy.h"
#include "chrome/renderer/webworker_proxy.h"
#include "content/common/content_constants.h"
+#include "content/common/database_messages.h"
#include "content/common/file_system/file_system_dispatcher.h"
#include "content/common/file_system/webfilesystem_callback_dispatcher.h"
#include "content/common/notification_service.h"
diff --git a/chrome/renderer/renderer_webkitclient_impl.cc b/chrome/renderer/renderer_webkitclient_impl.cc
index a818fc35..6d24871 100644
--- a/chrome/renderer/renderer_webkitclient_impl.cc
+++ b/chrome/renderer/renderer_webkitclient_impl.cc
@@ -10,7 +10,6 @@
#include "base/shared_memory.h"
#include "base/utf_string_conversions.h"
#include "chrome/common/chrome_switches.h"
-#include "chrome/common/database_util.h"
#include "chrome/common/render_messages.h"
#include "chrome/common/webblobregistry_impl.h"
#include "chrome/common/webmessageportchannel_impl.h"
@@ -24,6 +23,7 @@
#include "chrome/renderer/visitedlink_slave.h"
#include "chrome/renderer/webgraphicscontext3d_command_buffer_impl.h"
#include "chrome/renderer/websharedworkerrepository_impl.h"
+#include "content/common/database_util.h"
#include "content/common/file_system/webfilesystem_impl.h"
#include "content/common/file_utilities_messages.h"
#include "content/common/mime_registry_messages.h"
diff --git a/chrome/worker/worker_thread.cc b/chrome/worker/worker_thread.cc
index ef57cce..885c750 100644
--- a/chrome/worker/worker_thread.cc
+++ b/chrome/worker/worker_thread.cc
@@ -8,12 +8,12 @@
#include "base/lazy_instance.h"
#include "base/threading/thread_local.h"
#include "chrome/common/appcache/appcache_dispatcher.h"
-#include "chrome/common/db_message_filter.h"
#include "chrome/common/web_database_observer_impl.h"
#include "chrome/worker/webworker_stub.h"
#include "chrome/worker/websharedworker_stub.h"
#include "chrome/worker/worker_webkitclient_impl.h"
#include "content/common/content_switches.h"
+#include "content/common/db_message_filter.h"
#include "content/common/worker_messages.h"
#include "ipc/ipc_sync_channel.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebBlobRegistry.h"
diff --git a/chrome/worker/worker_webkitclient_impl.cc b/chrome/worker/worker_webkitclient_impl.cc
index f0f5a6d..14eca31 100644
--- a/chrome/worker/worker_webkitclient_impl.cc
+++ b/chrome/worker/worker_webkitclient_impl.cc
@@ -6,12 +6,12 @@
#include "base/logging.h"
#include "base/utf_string_conversions.h"
-#include "chrome/common/database_util.h"
#include "chrome/common/render_messages.h"
#include "chrome/common/render_messages_params.h"
#include "chrome/common/webblobregistry_impl.h"
#include "chrome/common/webmessageportchannel_impl.h"
#include "chrome/worker/worker_thread.h"
+#include "content/common/database_util.h"
#include "content/common/file_system/webfilesystem_impl.h"
#include "content/common/file_utilities_messages.h"
#include "content/common/mime_registry_messages.h"