summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-03 02:19:49 +0000
committeragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-03 02:19:49 +0000
commit8cf3f1dae79db8cfbf9dc6b75c140eabad918a6e (patch)
tree89e93505cc275c0a22b5ca7d95c5f03cfacff6a1
parent343b7211ff31670cded0f85fa8a056fa6cf7a9f3 (diff)
downloadchromium_src-8cf3f1dae79db8cfbf9dc6b75c140eabad918a6e.zip
chromium_src-8cf3f1dae79db8cfbf9dc6b75c140eabad918a6e.tar.gz
chromium_src-8cf3f1dae79db8cfbf9dc6b75c140eabad918a6e.tar.bz2
Move IPC code to ipc/
(No review URL: Rietvelt couldn't cope) git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13062 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--DEPS2
-rw-r--r--base/base_switches.cc5
-rw-r--r--base/base_switches.h1
-rw-r--r--base/file_descriptor_posix.h4
-rw-r--r--build/all.gyp1
-rw-r--r--chrome/DEPS1
-rw-r--r--chrome/browser/automation/automation_provider.h4
-rw-r--r--chrome/browser/automation/automation_resource_tracker.h2
-rw-r--r--chrome/browser/jsmessage_box_handler.h2
-rw-r--r--chrome/browser/jsmessage_box_handler_win.h2
-rw-r--r--chrome/browser/net/resolve_proxy_msg_helper.h2
-rw-r--r--chrome/browser/renderer_host/audio_renderer_host.h2
-rw-r--r--chrome/browser/renderer_host/mock_render_process_host.h2
-rw-r--r--chrome/browser/renderer_host/render_process_host.h2
-rw-r--r--chrome/browser/renderer_host/render_widget_host.h2
-rw-r--r--chrome/browser/renderer_host/resource_dispatcher_host.h2
-rw-r--r--chrome/browser/renderer_host/resource_message_filter.h2
-rw-r--r--chrome/browser/sandbox_policy.cc2
-rw-r--r--chrome/browser/tab_contents/web_contents_unittest.cc2
-rw-r--r--chrome/browser/views/about_ipc_dialog.cc2
-rw-r--r--chrome/browser/views/about_ipc_dialog.h2
-rw-r--r--chrome/browser/worker_host/worker_process_host.h2
-rw-r--r--chrome/chrome.gyp60
-rw-r--r--chrome/chrome.sln24
-rw-r--r--chrome/common/child_process_host.cc3
-rw-r--r--chrome/common/child_process_host.h2
-rw-r--r--chrome/common/child_thread.cc3
-rw-r--r--chrome/common/child_thread.h2
-rw-r--r--chrome/common/chrome_counters.cc5
-rw-r--r--chrome/common/chrome_counters.h3
-rw-r--r--chrome/common/chrome_switches.cc13
-rw-r--r--chrome/common/chrome_switches.h6
-rw-r--r--chrome/common/common.vcproj64
-rw-r--r--chrome/common/common_message_utils.cc (renamed from chrome/common/ipc_message_utils.cc)75
-rw-r--r--chrome/common/common_message_utils.h138
-rw-r--r--chrome/common/gurl_serialisation_unittest.cc (renamed from chrome/common/ipc_message_unittest.cc)6
-rw-r--r--chrome/common/ipc_maybe.h19
-rw-r--r--chrome/common/ipc_tests.vcproj165
-rw-r--r--chrome/common/logging_chrome.cc21
-rw-r--r--chrome/common/message_router.h2
-rw-r--r--chrome/common/plugin_messages.h11
-rw-r--r--chrome/common/plugin_messages_internal.h2
-rw-r--r--chrome/common/render_messages.h10
-rw-r--r--chrome/common/render_messages_internal.h2
-rw-r--r--chrome/common/resource_dispatcher.h2
-rw-r--r--chrome/common/webkit_param_traits.h2
-rw-r--r--chrome/common/worker_messages.h11
-rw-r--r--chrome/common/worker_messages_internal.h2
-rw-r--r--chrome/plugin/npobject_proxy.h2
-rw-r--r--chrome/plugin/npobject_stub.h2
-rw-r--r--chrome/plugin/plugin_channel_base.cc2
-rw-r--r--chrome/plugin/plugin_channel_base.h2
-rw-r--r--chrome/plugin/webplugin_delegate_stub.h2
-rw-r--r--chrome/plugin/webplugin_proxy.h2
-rw-r--r--chrome/renderer/automation/dom_automation_controller.h2
-rw-r--r--chrome/renderer/debug_message_handler.h2
-rw-r--r--chrome/renderer/devtools_agent.h2
-rw-r--r--chrome/renderer/devtools_messages.h7
-rw-r--r--chrome/renderer/devtools_messages_internal.h2
-rw-r--r--chrome/renderer/dom_ui_bindings.h2
-rw-r--r--chrome/renderer/external_host_bindings.h2
-rw-r--r--chrome/renderer/mock_render_thread.cc2
-rw-r--r--chrome/renderer/mock_render_thread.h2
-rw-r--r--chrome/renderer/render_process.cc4
-rw-r--r--chrome/renderer/render_thread_unittest.cc2
-rw-r--r--chrome/renderer/render_widget.h2
-rw-r--r--chrome/renderer/renderer_main_unittest.cc2
-rw-r--r--chrome/renderer/webplugin_delegate_proxy.h2
-rw-r--r--chrome/renderer/webworker_proxy.h2
-rw-r--r--chrome/test/automation/autocomplete_edit_proxy.h5
-rw-r--r--chrome/test/automation/automation_messages.h10
-rw-r--r--chrome/test/automation/automation_messages_internal.h2
-rw-r--r--chrome/test/automation/automation_proxy.h6
-rw-r--r--chrome/test/data/purify/ipc_tests.exe_UMR.txt134
-rw-r--r--chrome/test/unit/unittests.vcproj20
-rw-r--r--chrome/worker/webworkerclient_proxy.cc2
-rw-r--r--chrome/worker/webworkerclient_proxy.h2
-rw-r--r--ipc/file_descriptor_set_posix.cc (renamed from chrome/common/file_descriptor_set_posix.cc)2
-rw-r--r--ipc/file_descriptor_set_posix.h (renamed from chrome/common/file_descriptor_set_posix.h)6
-rw-r--r--ipc/file_descriptor_set_unittest.cc (renamed from chrome/common/file_descriptor_set_unittest.cc)2
-rw-r--r--ipc/ipc.gyp82
-rw-r--r--ipc/ipc_channel.h (renamed from chrome/common/ipc_channel.h)8
-rw-r--r--ipc/ipc_channel_posix.cc (renamed from chrome/common/ipc_channel_posix.cc)14
-rw-r--r--ipc/ipc_channel_posix.h (renamed from chrome/common/ipc_channel_posix.h)10
-rw-r--r--ipc/ipc_channel_proxy.cc (renamed from chrome/common/ipc_channel_proxy.cc)6
-rw-r--r--ipc/ipc_channel_proxy.h (renamed from chrome/common/ipc_channel_proxy.h)8
-rw-r--r--ipc/ipc_channel_win.cc (renamed from chrome/common/ipc_channel_win.cc)10
-rw-r--r--ipc/ipc_channel_win.h (renamed from chrome/common/ipc_channel_win.h)8
-rw-r--r--ipc/ipc_counters.cc27
-rw-r--r--ipc/ipc_counters.h22
-rw-r--r--ipc/ipc_fuzzing_tests.cc (renamed from chrome/common/ipc_fuzzing_tests.cc)17
-rw-r--r--ipc/ipc_logging.cc (renamed from chrome/common/ipc_logging.cc)31
-rw-r--r--ipc/ipc_logging.h (renamed from chrome/common/ipc_logging.h)16
-rw-r--r--ipc/ipc_message.cc (renamed from chrome/common/ipc_message.cc)4
-rw-r--r--ipc/ipc_message.h (renamed from chrome/common/ipc_message.h)6
-rw-r--r--ipc/ipc_message_macros.h (renamed from chrome/common/ipc_message_macros.h)14
-rw-r--r--ipc/ipc_message_utils.cc76
-rw-r--r--ipc/ipc_message_utils.h (renamed from chrome/common/ipc_message_utils.h)135
-rw-r--r--ipc/ipc_send_fds_test.cc (renamed from chrome/common/ipc_send_fds_test.cc)6
-rw-r--r--ipc/ipc_switches.cc17
-rw-r--r--ipc/ipc_switches.h19
-rw-r--r--ipc/ipc_sync_channel.cc (renamed from chrome/common/ipc_sync_channel.cc)4
-rw-r--r--ipc/ipc_sync_channel.h (renamed from chrome/common/ipc_sync_channel.h)8
-rw-r--r--ipc/ipc_sync_channel_unittest.cc (renamed from chrome/common/ipc_sync_channel_unittest.cc)18
-rw-r--r--ipc/ipc_sync_message.cc (renamed from chrome/common/ipc_sync_message.cc)2
-rw-r--r--ipc/ipc_sync_message.h (renamed from chrome/common/ipc_sync_message.h)8
-rw-r--r--ipc/ipc_sync_message_unittest.cc (renamed from chrome/common/ipc_sync_message_unittest.cc)14
-rw-r--r--ipc/ipc_sync_message_unittest.h (renamed from chrome/common/ipc_sync_message_unittest.h)2
-rw-r--r--ipc/ipc_test_sink.cc (renamed from chrome/common/ipc_test_sink.cc)2
-rw-r--r--ipc/ipc_test_sink.h (renamed from chrome/common/ipc_test_sink.h)8
-rw-r--r--ipc/ipc_tests.cc (renamed from chrome/common/ipc_tests.cc)9
-rw-r--r--ipc/ipc_tests.h (renamed from chrome/common/ipc_tests.h)6
112 files changed, 730 insertions, 828 deletions
diff --git a/DEPS b/DEPS
index 3e3a96e..f2313c0 100644
--- a/DEPS
+++ b/DEPS
@@ -65,6 +65,7 @@ include_rules = [
# Everybody can use some things.
"+base",
"+build",
+ "+ipc",
# For now, we allow ICU to be included by specifying "unicode/...", although
# this should probably change.
@@ -81,6 +82,7 @@ include_rules = [
skip_child_includes = [
"breakpad",
"gears",
+ "ipc",
"sdch",
"skia",
"testing",
diff --git a/base/base_switches.cc b/base/base_switches.cc
index 77d263c..d54d458 100644
--- a/base/base_switches.cc
+++ b/base/base_switches.cc
@@ -40,4 +40,9 @@ const wchar_t kEnableDCHECK[] = L"enable-dcheck";
// Available at http://www.adambarth.com/papers/2008/jackson-barth.pdf
const wchar_t kForceHTTPS[] = L"force-https";
+// Will add kDebugOnStart to every child processes. If a value is passed, it
+// will be used as a filter to determine if the child process should have the
+// kDebugOnStart flag passed on or not.
+const wchar_t kDebugChildren[] = L"debug-children";
+
} // namespace switches
diff --git a/base/base_switches.h b/base/base_switches.h
index 97a3691..1ca56f4 100644
--- a/base/base_switches.h
+++ b/base/base_switches.h
@@ -17,6 +17,7 @@ extern const wchar_t kNoErrorDialogs[];
extern const wchar_t kProcessType[];
extern const wchar_t kEnableDCHECK[];
extern const wchar_t kForceHTTPS[];
+extern const wchar_t kDebugChildren[];
} // namespace switches
diff --git a/base/file_descriptor_posix.h b/base/file_descriptor_posix.h
index 0bcd4b6..5d6cbc6 100644
--- a/base/file_descriptor_posix.h
+++ b/base/file_descriptor_posix.h
@@ -12,8 +12,8 @@ namespace base {
// able to use template specialisation to special-case their handling.
//
// WARNING: (Chromium only) There are subtleties to consider if serialising
-// these objects over IPC. See comments in chrome/common/ipc_message_utils.h
-// above the template specialisation for this structure.
+// these objects over IPC. See comments in ipc_message_utils.h above the
+// template specialisation for this structure.
// -----------------------------------------------------------------------------
struct FileDescriptor {
FileDescriptor()
diff --git a/build/all.gyp b/build/all.gyp
index 2d9ddff..9c95a8b 100644
--- a/build/all.gyp
+++ b/build/all.gyp
@@ -22,6 +22,7 @@
'type': 'none',
'dependencies': [
'../base/base.gyp:*',
+ '../ipc/ipc.gyp:*',
'../media/media.gyp:*',
'../net/net.gyp:*',
'../printing/printing.gyp:*',
diff --git a/chrome/DEPS b/chrome/DEPS
index 0f6969f..b457d6a 100644
--- a/chrome/DEPS
+++ b/chrome/DEPS
@@ -1,4 +1,5 @@
include_rules = [
+ "+ipc",
"+net",
"+printing",
diff --git a/chrome/browser/automation/automation_provider.h b/chrome/browser/automation/automation_provider.h
index 1bf0892..77625e3 100644
--- a/chrome/browser/automation/automation_provider.h
+++ b/chrome/browser/automation/automation_provider.h
@@ -21,11 +21,11 @@
#include "chrome/browser/browser_list.h"
#include "chrome/browser/history/history.h"
#include "chrome/browser/tab_contents/navigation_entry.h"
-#include "chrome/common/ipc_message.h"
-#include "chrome/common/ipc_sync_channel.h"
#include "chrome/common/notification_observer.h"
#include "chrome/test/automation/automation_messages.h"
#include "chrome/views/event.h"
+#include "ipc/ipc_message.h"
+#include "ipc/ipc_sync_channel.h"
#if defined(OS_WIN)
// TODO(port): enable these.
diff --git a/chrome/browser/automation/automation_resource_tracker.h b/chrome/browser/automation/automation_resource_tracker.h
index 53d80b9..3e626c3 100644
--- a/chrome/browser/automation/automation_resource_tracker.h
+++ b/chrome/browser/automation/automation_resource_tracker.h
@@ -8,8 +8,8 @@
#include <map>
#include "base/basictypes.h"
-#include "chrome/common/ipc_message.h"
#include "chrome/common/notification_service.h"
+#include "ipc/ipc_message.h"
// Template trick so that AutomationResourceTracker can be used with non-pointer
// types.
diff --git a/chrome/browser/jsmessage_box_handler.h b/chrome/browser/jsmessage_box_handler.h
index 149bfd7..3055e06 100644
--- a/chrome/browser/jsmessage_box_handler.h
+++ b/chrome/browser/jsmessage_box_handler.h
@@ -7,7 +7,7 @@
#include <string>
-#include "chrome/common/ipc_message.h"
+#include "ipc/ipc_message.h"
class GURL;
class WebContents;
diff --git a/chrome/browser/jsmessage_box_handler_win.h b/chrome/browser/jsmessage_box_handler_win.h
index ff2b152..04793e4 100644
--- a/chrome/browser/jsmessage_box_handler_win.h
+++ b/chrome/browser/jsmessage_box_handler_win.h
@@ -6,11 +6,11 @@
#define CHROME_BROWSER_JSMESSAGE_BOX_HANDLER_WIN_H_
#include "chrome/browser/jsmessage_box_handler.h"
-#include "chrome/common/ipc_message.h"
#include "chrome/common/notification_observer.h"
#include "chrome/common/notification_registrar.h"
#include "chrome/views/window/app_modal_dialog_delegate.h"
#include "googleurl/src/gurl.h"
+#include "ipc/ipc_message.h"
class MessageBoxView;
class WebContents;
diff --git a/chrome/browser/net/resolve_proxy_msg_helper.h b/chrome/browser/net/resolve_proxy_msg_helper.h
index ee6f4af..99ef416 100644
--- a/chrome/browser/net/resolve_proxy_msg_helper.h
+++ b/chrome/browser/net/resolve_proxy_msg_helper.h
@@ -8,7 +8,7 @@
#include <deque>
#include <string>
-#include "chrome/common/ipc_message.h"
+#include "ipc/ipc_message.h"
#include "net/base/completion_callback.h"
#include "googleurl/src/gurl.h"
#include "net/proxy/proxy_service.h"
diff --git a/chrome/browser/renderer_host/audio_renderer_host.h b/chrome/browser/renderer_host/audio_renderer_host.h
index 9ddeada0..abc3e88 100644
--- a/chrome/browser/renderer_host/audio_renderer_host.h
+++ b/chrome/browser/renderer_host/audio_renderer_host.h
@@ -42,7 +42,7 @@
#include "base/ref_counted.h"
#include "base/shared_memory.h"
#include "base/waitable_event.h"
-#include "chrome/common/ipc_message.h"
+#include "ipc/ipc_message.h"
#include "media/audio/audio_output.h"
class AudioManager;
diff --git a/chrome/browser/renderer_host/mock_render_process_host.h b/chrome/browser/renderer_host/mock_render_process_host.h
index 9b63653..7571097 100644
--- a/chrome/browser/renderer_host/mock_render_process_host.h
+++ b/chrome/browser/renderer_host/mock_render_process_host.h
@@ -7,7 +7,7 @@
#include "base/basictypes.h"
#include "chrome/browser/renderer_host/render_process_host.h"
-#include "chrome/common/ipc_test_sink.h"
+#include "ipc/ipc_test_sink.h"
class TransportDIB;
diff --git a/chrome/browser/renderer_host/render_process_host.h b/chrome/browser/renderer_host/render_process_host.h
index 6e59166..346213b 100644
--- a/chrome/browser/renderer_host/render_process_host.h
+++ b/chrome/browser/renderer_host/render_process_host.h
@@ -10,8 +10,8 @@
#include "base/id_map.h"
#include "base/process.h"
#include "base/scoped_ptr.h"
-#include "chrome/common/ipc_sync_channel.h"
#include "chrome/common/transport_dib.h"
+#include "ipc/ipc_sync_channel.h"
class Profile;
diff --git a/chrome/browser/renderer_host/render_widget_host.h b/chrome/browser/renderer_host/render_widget_host.h
index cac1f4e..f09c829 100644
--- a/chrome/browser/renderer_host/render_widget_host.h
+++ b/chrome/browser/renderer_host/render_widget_host.h
@@ -11,8 +11,8 @@
#include "base/gfx/size.h"
#include "base/scoped_ptr.h"
#include "base/timer.h"
-#include "chrome/common/ipc_channel.h"
#include "chrome/common/native_web_keyboard_event.h"
+#include "ipc/ipc_channel.h"
#include "testing/gtest/include/gtest/gtest_prod.h"
#include "webkit/glue/webtextdirection.h"
diff --git a/chrome/browser/renderer_host/resource_dispatcher_host.h b/chrome/browser/renderer_host/resource_dispatcher_host.h
index 07c532c..7e08f89 100644
--- a/chrome/browser/renderer_host/resource_dispatcher_host.h
+++ b/chrome/browser/renderer_host/resource_dispatcher_host.h
@@ -24,7 +24,7 @@
#include "chrome/browser/renderer_host/resource_handler.h"
#include "chrome/common/child_process_info.h"
#include "chrome/common/filter_policy.h"
-#include "chrome/common/ipc_message.h"
+#include "ipc/ipc_message.h"
#include "net/url_request/url_request.h"
#include "webkit/glue/resource_type.h"
diff --git a/chrome/browser/renderer_host/resource_message_filter.h b/chrome/browser/renderer_host/resource_message_filter.h
index db7c60b..5b25f63 100644
--- a/chrome/browser/renderer_host/resource_message_filter.h
+++ b/chrome/browser/renderer_host/resource_message_filter.h
@@ -19,10 +19,10 @@
#include "chrome/browser/net/resolve_proxy_msg_helper.h"
#include "chrome/browser/renderer_host/render_widget_helper.h"
#include "chrome/browser/renderer_host/resource_dispatcher_host.h"
-#include "chrome/common/ipc_channel_proxy.h"
#include "chrome/common/modal_dialog_event.h"
#include "chrome/common/notification_observer.h"
#include "chrome/common/transport_dib.h"
+#include "ipc/ipc_channel_proxy.h"
#include "third_party/WebKit/WebKit/chromium/public/WebCache.h"
#if defined(OS_WIN)
diff --git a/chrome/browser/sandbox_policy.cc b/chrome/browser/sandbox_policy.cc
index 24d3c2e..f44707c 100644
--- a/chrome/browser/sandbox_policy.cc
+++ b/chrome/browser/sandbox_policy.cc
@@ -19,9 +19,9 @@
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/debug_flags.h"
-#include "chrome/common/ipc_logging.h"
#include "chrome/common/notification_service.h"
#include "chrome/common/win_util.h"
+#include "ipc/ipc_logging.h"
#include "sandbox/src/sandbox.h"
#include "webkit/glue/plugins/plugin_list.h"
diff --git a/chrome/browser/tab_contents/web_contents_unittest.cc b/chrome/browser/tab_contents/web_contents_unittest.cc
index 8dab8c6..a1ed0c8 100644
--- a/chrome/browser/tab_contents/web_contents_unittest.cc
+++ b/chrome/browser/tab_contents/web_contents_unittest.cc
@@ -11,10 +11,10 @@
#include "chrome/browser/tab_contents/navigation_entry.h"
#include "chrome/browser/tab_contents/test_web_contents.h"
#include "chrome/common/chrome_paths.h"
-#include "chrome/common/ipc_channel.h"
#include "chrome/common/pref_service.h"
#include "chrome/common/render_messages.h"
#include "chrome/test/testing_profile.h"
+#include "ipc/ipc_channel.h"
#include "testing/gtest/include/gtest/gtest.h"
static void InitNavigateParams(ViewHostMsg_FrameNavigate_Params* params,
diff --git a/chrome/browser/views/about_ipc_dialog.cc b/chrome/browser/views/about_ipc_dialog.cc
index 6bbd356..be6cb26 100644
--- a/chrome/browser/views/about_ipc_dialog.cc
+++ b/chrome/browser/views/about_ipc_dialog.cc
@@ -6,7 +6,7 @@
// IPC_MESSAGE_LOG_ENABLED. We need to use it to define
// IPC_MESSAGE_MACROS_LOG_ENABLED so render_messages.h will generate the
// ViewMsgLog et al. functions.
-#include "chrome/common/ipc_message.h"
+#include "ipc/ipc_message.h"
#ifdef IPC_MESSAGE_LOG_ENABLED
#define IPC_MESSAGE_MACROS_LOG_ENABLED
diff --git a/chrome/browser/views/about_ipc_dialog.h b/chrome/browser/views/about_ipc_dialog.h
index 92cc284..ff9f3df 100644
--- a/chrome/browser/views/about_ipc_dialog.h
+++ b/chrome/browser/views/about_ipc_dialog.h
@@ -6,7 +6,7 @@
#define CHROME_BROWSER_VIEWS_ABOUT_IPC_DIALOG_H_
#include "base/singleton.h"
-#include "chrome/common/ipc_logging.h"
+#include "ipc/ipc_logging.h"
#include "chrome/views/controls/button/button.h"
#include "chrome/views/controls/table/table_view.h"
#include "chrome/views/window/dialog_delegate.h"
diff --git a/chrome/browser/worker_host/worker_process_host.h b/chrome/browser/worker_host/worker_process_host.h
index cf8072c..0438076 100644
--- a/chrome/browser/worker_host/worker_process_host.h
+++ b/chrome/browser/worker_host/worker_process_host.h
@@ -9,8 +9,8 @@
#include "base/basictypes.h"
#include "chrome/common/child_process_host.h"
-#include "chrome/common/ipc_channel.h"
#include "googleurl/src/gurl.h"
+#include "ipc/ipc_channel.h"
class ResourceMessageFilter;
diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp
index 199a69d3..b7e858f 100644
--- a/chrome/chrome.gyp
+++ b/chrome/chrome.gyp
@@ -83,6 +83,7 @@
'../base/base.gyp:base',
'../base/base.gyp:base_gfx',
'../build/temp_gyp/googleurl.gyp:googleurl',
+ '../ipc/ipc.gyp:ipc',
'../net/net.gyp:net',
'../skia/skia.gyp:skia',
'../third_party/icu38/icu38.gyp:icui18n',
@@ -163,34 +164,15 @@
'common/classfactory.h',
'common/clipboard_service.h',
'common/common_glue.cc',
+ 'common/common_message_utils.cc',
'common/debug_flags.cc',
'common/debug_flags.h',
'common/drag_drop_types.cc',
'common/drag_drop_types.h',
'common/env_vars.cc',
'common/env_vars.h',
- 'common/file_descriptor_set_posix.cc',
- 'common/file_descriptor_set_posix.h',
'common/filter_policy.h',
'common/gears_api.h',
- 'common/ipc_channel.h',
- 'common/ipc_channel_posix.cc',
- 'common/ipc_channel_posix.h',
- 'common/ipc_channel_proxy.cc',
- 'common/ipc_channel_proxy.h',
- 'common/ipc_channel_win.cc',
- 'common/ipc_channel_win.h',
- 'common/ipc_logging.cc',
- 'common/ipc_logging.h',
- 'common/ipc_message.cc',
- 'common/ipc_message.h',
- 'common/ipc_message_macros.h',
- 'common/ipc_message_utils.cc',
- 'common/ipc_message_utils.h',
- 'common/ipc_sync_channel.cc',
- 'common/ipc_sync_channel.h',
- 'common/ipc_sync_message.cc',
- 'common/ipc_sync_message.h',
'common/json_value_serializer.cc',
'common/json_value_serializer.h',
'common/jstemplate_builder.cc',
@@ -1739,8 +1721,8 @@
'browser/renderer_host/test_render_view_host.h',
'browser/tab_contents/test_web_contents.cc',
'browser/tab_contents/test_web_contents.h',
- 'common/ipc_test_sink.cc',
- 'common/ipc_test_sink.h',
+ '../ipc/ipc_test_sink.cc',
+ '../ipc/ipc_test_sink.h',
'renderer/mock_render_process.h',
'renderer/mock_render_thread.cc',
'renderer/mock_render_thread.h',
@@ -1838,37 +1820,6 @@
],
},
{
- 'target_name': 'ipc_tests',
- 'type': 'executable',
- 'dependencies': [
- 'browser',
- 'common',
- 'renderer',
- 'test_support_unit',
- '../base/base.gyp:base',
- '../testing/gtest.gyp:gtest',
- ],
- 'sources': [
- 'common/ipc_fuzzing_tests.cc',
- 'common/ipc_message_unittest.cc',
- 'common/ipc_send_fds_test.cc',
- 'common/ipc_sync_channel_unittest.cc',
- 'common/ipc_sync_channel_unittest.h',
- 'common/ipc_sync_message_unittest.cc',
- 'common/ipc_sync_message_unittest.h',
- 'common/ipc_tests.cc',
- 'common/ipc_tests.h',
- ],
- 'conditions': [
- ['OS=="linux"', {
- 'dependencies': [
- 'views',
- '../build/linux/system.gyp:gtk',
- ],
- }],
- ],
- },
- {
'target_name': 'ui_tests',
'type': 'executable',
'dependencies': [
@@ -2158,11 +2109,11 @@
'common/chrome_plugin_unittest.cc',
'common/extensions/url_pattern_unittest.cc',
'common/extensions/user_script_unittest.cc',
- 'common/file_descriptor_set_unittest.cc',
'common/gfx/chrome_font_unittest.cc',
'common/gfx/emf_unittest.cc',
'common/gfx/icon_util_unittest.cc',
'common/gfx/text_elider_unittest.cc',
+ 'common/gurl_serialisation_unittest.cc',
'common/json_value_serializer_unittest.cc',
'common/l10n_util_unittest.cc',
'common/mru_cache_unittest.cc',
@@ -2244,7 +2195,6 @@
'third_party/wtl/include',
],
'sources!': [
- 'common/file_descriptor_set_unittest.cc',
'common/net/url_util_unittest.cc',
],
'dependencies': [
diff --git a/chrome/chrome.sln b/chrome/chrome.sln
index c1002d1..f6f1946 100644
--- a/chrome/chrome.sln
+++ b/chrome/chrome.sln
@@ -20,16 +20,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "renderer", "renderer\render
{D9DDAF60-663F-49CC-90DC-3D08CC3D1B28} = {D9DDAF60-663F-49CC-90DC-3D08CC3D1B28}
EndProjectSection
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ipc_tests", "common\ipc_tests.vcproj", "{B92AE829-E1CD-4781-824A-DCB1603A1672}"
- ProjectSection(ProjectDependencies) = postProject
- {1832A374-8A74-4F9E-B536-69A699B3E165} = {1832A374-8A74-4F9E-B536-69A699B3E165}
- {899F1280-3441-4D1F-BA04-CCD6208D9146} = {899F1280-3441-4D1F-BA04-CCD6208D9146}
- {8C27D792-2648-4F5E-9ED0-374276327308} = {8C27D792-2648-4F5E-9ED0-374276327308}
- {BFE8E2A7-3B3B-43B0-A994-3058B852DB8B} = {BFE8E2A7-3B3B-43B0-A994-3058B852DB8B}
- EndProjectSection
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "common", "common\common.vcproj", "{899F1280-3441-4D1F-BA04-CCD6208D9146}"
ProjectSection(ProjectDependencies) = postProject
+ {3476F599-9139-8A7F-8043-1345F4D9571D} = {3476F599-9139-8A7F-8043-1345F4D9571D}
{B95AB527-F7DB-41E9-AD91-EB51EE0F56BE} = {B95AB527-F7DB-41E9-AD91-EB51EE0F56BE}
{D9DDAF60-663F-49CC-90DC-3D08CC3D1B28} = {D9DDAF60-663F-49CC-90DC-3D08CC3D1B28}
EndProjectSection
@@ -600,6 +593,19 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "media_unittests", "..\media
{BFE8E2A7-3B3B-43B0-A994-3058B852DB8B} = {BFE8E2A7-3B3B-43B0-A994-3058B852DB8B}
EndProjectSection
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ipc", "..\ipc\ipc.vcproj", "{3476F599-9139-8A7F-8043-1345F4D9571D}"
+ ProjectSection(ProjectDependencies) = postProject
+ {1832A374-8A74-4F9E-B536-69A699B3E165} = {1832A374-8A74-4F9E-B536-69A699B3E165}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ipc_tests", "..\ipc\ipc_tests.vcproj", "{9EFCEB4B-067F-C8F0-790F-6F698DC2E248}"
+ ProjectSection(ProjectDependencies) = postProject
+ {1832A374-8A74-4F9E-B536-69A699B3E165} = {1832A374-8A74-4F9E-B536-69A699B3E165}
+ {3476F599-9139-8A7F-8043-1345F4D9571D} = {3476F599-9139-8A7F-8043-1345F4D9571D}
+ {8C27D792-2648-4F5E-9ED0-374276327308} = {8C27D792-2648-4F5E-9ED0-374276327308}
+ {BFE8E2A7-3B3B-43B0-A994-3058B852DB8B} = {BFE8E2A7-3B3B-43B0-A994-3058B852DB8B}
+ EndProjectSection
+EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "base", "..\base\base.vcproj", "{1832A374-8A74-4F9E-B536-69A699B3E165}"
ProjectSection(ProjectDependencies) = postProject
{8C27D792-2648-4F5E-9ED0-374276327308} = {8C27D792-2648-4F5E-9ED0-374276327308}
@@ -3085,6 +3091,8 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
+ {9EFCEB4B-067F-C8F0-790F-6F698DC2E248} = {1174D37F-6ABB-45DA-81B3-C631281273B7}
+ {3476F599-9139-8A7F-8043-1345F4D9571D} = {EF78C1F9-AA17-4CA5-B6CB-39B37A73A3DA}
{0026A376-C4F1-4575-A1BA-578C69F07013} = {EB684A4B-98F7-4E68-8EA7-EA74ACF7060B}
{018D4F38-6272-448F-A864-976DA09F05D0} = {1174D37F-6ABB-45DA-81B3-C631281273B7}
{0557BC3C-DE87-4127-BDAA-9BD9BDB13FB4} = {2325D8C4-8EF5-42AC-8900-492225750DE4}
diff --git a/chrome/common/child_process_host.cc b/chrome/common/child_process_host.cc
index 7f934b0..dc7f1e5 100644
--- a/chrome/common/child_process_host.cc
+++ b/chrome/common/child_process_host.cc
@@ -11,12 +11,13 @@
#include "base/singleton.h"
#include "base/waitable_event.h"
#include "chrome/browser/chrome_thread.h"
-#include "chrome/common/ipc_logging.h"
+#include "chrome/common/common_message_utils.h"
#include "chrome/common/notification_service.h"
#include "chrome/common/notification_type.h"
#include "chrome/common/plugin_messages.h"
#include "chrome/common/process_watcher.h"
#include "chrome/common/result_codes.h"
+#include "ipc/ipc_logging.h"
namespace {
diff --git a/chrome/common/child_process_host.h b/chrome/common/child_process_host.h
index d4d2dd9..1aef54c 100644
--- a/chrome/common/child_process_host.h
+++ b/chrome/common/child_process_host.h
@@ -14,7 +14,7 @@
#include "base/waitable_event_watcher.h"
#include "chrome/browser/renderer_host/resource_dispatcher_host.h"
#include "chrome/common/child_process_info.h"
-#include "chrome/common/ipc_channel.h"
+#include "ipc/ipc_channel.h"
class NotificationType;
diff --git a/chrome/common/child_thread.cc b/chrome/common/child_thread.cc
index 94b3186..527c58f 100644
--- a/chrome/common/child_thread.cc
+++ b/chrome/common/child_thread.cc
@@ -6,10 +6,11 @@
#include "base/string_util.h"
#include "base/command_line.h"
+#include "chrome/common/common_message_utils.h"
#include "chrome/common/child_process.h"
#include "chrome/common/chrome_switches.h"
-#include "chrome/common/ipc_logging.h"
#include "chrome/common/plugin_messages.h"
+#include "ipc/ipc_logging.h"
#include "webkit/glue/webkit_glue.h"
diff --git a/chrome/common/child_thread.h b/chrome/common/child_thread.h
index 66fcc09..a4f8603 100644
--- a/chrome/common/child_thread.h
+++ b/chrome/common/child_thread.h
@@ -6,7 +6,7 @@
#define CHROME_COMMON_CHILD_THREAD_H_
#include "base/thread.h"
-#include "chrome/common/ipc_sync_channel.h"
+#include "ipc/ipc_sync_channel.h"
#include "chrome/common/message_router.h"
#include "chrome/common/resource_dispatcher.h"
diff --git a/chrome/common/chrome_counters.cc b/chrome/common/chrome_counters.cc
index 98a977b..fea0906 100644
--- a/chrome/common/chrome_counters.cc
+++ b/chrome/common/chrome_counters.cc
@@ -19,11 +19,6 @@ namespace chrome {
// we'd leak the extraneous StatsCounter object once, and that
// would be it. But these are small objects, so this is ok.
-StatsCounter& Counters::ipc_send_counter() {
- static StatsCounter* ctr = new StatsCounter("IPC.SendMsgCount");
- return *ctr;
-}
-
StatsCounterTimer& Counters::chrome_main() {
static StatsCounterTimer* ctr = new StatsCounterTimer("Chrome.Init");
return *ctr;
diff --git a/chrome/common/chrome_counters.h b/chrome/common/chrome_counters.h
index c7975f85..14cfa21 100644
--- a/chrome/common/chrome_counters.h
+++ b/chrome/common/chrome_counters.h
@@ -15,9 +15,6 @@ namespace chrome {
class Counters {
public:
- // The number of messages sent on IPC channels.
- static StatsCounter& ipc_send_counter();
-
// The amount of time spent in chrome initialization.
static StatsCounterTimer& chrome_main();
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index c32cbb5..350b2a0 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -50,10 +50,6 @@ const wchar_t kTestShellStartupDialog[] = L"testshell-startup-dialog";
// --plugin-launcher="path\to\purify /Run=yes"
const wchar_t kPluginLauncher[] = L"plugin-launcher";
-// The value of this switch tells the child process which
-// IPC channel the browser expects to use to communicate with it.
-const wchar_t kProcessChannelID[] = L"channel";
-
// The value of this switch tells the app to listen for and broadcast
// testing-related messages on IPC channel with the given ID.
const wchar_t kTestingChannelID[] = L"testing-channel";
@@ -156,11 +152,6 @@ const wchar_t kCountry[] = L"country";
// language[-country] where language is the 2 letter code from ISO-639.
const wchar_t kLang[] = L"lang";
-// Will add kDebugOnStart to every child processes. If a value is passed, it
-// will be used as a filter to determine if the child process should have the
-// kDebugOnStart flag passed on or not.
-const wchar_t kDebugChildren[] = L"debug-children";
-
// Will add kWaitForDebugger to every child processes. If a value is passed, it
// will be used as a filter to determine if the child process should have the
// kWaitForDebugger flag passed on or not.
@@ -391,10 +382,6 @@ const wchar_t kRendererCmdPrefix[] = L"renderer-cmd-prefix";
// Temparary option for new ftp implemetation.
const wchar_t kNewFtp[] = L"new-ftp";
-// On POSIX only: use FIFO for IPC channels so that "unrelated" process
-// can connect to a channel, provided it knows its name. For debugging purposes.
-const wchar_t kIPCUseFIFO[] = L"ipc-use-fifo";
-
// If this flag is set open out of process developer tools window instead of
// Console Debugger when user clicks "Debug JavaScript".
const wchar_t kEnableOutOfProcessDevTools[] = L"enable-oop-devtools";
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 8b51a7d..f6d085b 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -7,7 +7,7 @@
#ifndef CHROME_COMMON_CHROME_SWITCHES_H__
#define CHROME_COMMON_CHROME_SWITCHES_H__
-#include "base/base_switches.h"
+#include "ipc/ipc_switches.h"
namespace switches {
@@ -23,7 +23,6 @@ extern const wchar_t kPluginStartupDialog[];
extern const wchar_t kTestShellStartupDialog[];
extern const wchar_t kPluginLauncher[];
-extern const wchar_t kProcessChannelID[];
extern const wchar_t kTestingChannelID[];
extern const wchar_t kHomePage[];
extern const wchar_t kRendererProcess[];
@@ -51,7 +50,6 @@ extern const wchar_t kUserAgent[];
extern const wchar_t kJavaScriptFlags[];
extern const wchar_t kCountry[];
extern const wchar_t kLang[];
-extern const wchar_t kDebugChildren[];
extern const wchar_t kWaitForDebuggerChildren[];
extern const wchar_t kLogFilterPrefix[];
@@ -150,8 +148,6 @@ extern const wchar_t kRendererCmdPrefix[];
extern const wchar_t kNewFtp[];
-extern const wchar_t kIPCUseFIFO[];
-
extern const wchar_t kEnableOutOfProcessDevTools[];
extern const wchar_t kEnableWebWorkers[];
diff --git a/chrome/common/common.vcproj b/chrome/common/common.vcproj
index f392f7d..5f3837a 100644
--- a/chrome/common/common.vcproj
+++ b/chrome/common/common.vcproj
@@ -225,66 +225,6 @@
Name="ipc"
>
<File
- RelativePath=".\ipc_channel.h"
- >
- </File>
- <File
- RelativePath=".\ipc_channel_proxy.cc"
- >
- </File>
- <File
- RelativePath=".\ipc_channel_proxy.h"
- >
- </File>
- <File
- RelativePath=".\ipc_channel_win.cc"
- >
- </File>
- <File
- RelativePath=".\ipc_logging.cc"
- >
- </File>
- <File
- RelativePath=".\ipc_logging.h"
- >
- </File>
- <File
- RelativePath=".\ipc_message.cc"
- >
- </File>
- <File
- RelativePath=".\ipc_message.h"
- >
- </File>
- <File
- RelativePath=".\ipc_message_macros.h"
- >
- </File>
- <File
- RelativePath=".\ipc_message_utils.cc"
- >
- </File>
- <File
- RelativePath=".\ipc_message_utils.h"
- >
- </File>
- <File
- RelativePath=".\ipc_sync_channel.cc"
- >
- </File>
- <File
- RelativePath=".\ipc_sync_channel.h"
- >
- </File>
- <File
- RelativePath=".\ipc_sync_message.cc"
- >
- </File>
- <File
- RelativePath=".\ipc_sync_message.h"
- >
- </File>
- <File
RelativePath=".\plugin_messages.h"
>
</File>
@@ -458,6 +398,10 @@
>
</File>
<File
+ RelativePath=".\common_message_utils.cc"
+ >
+ </File>
+ <File
RelativePath=".\debug_flags.cc"
>
</File>
diff --git a/chrome/common/ipc_message_utils.cc b/chrome/common/common_message_utils.cc
index 36e8052..e12edae 100644
--- a/chrome/common/ipc_message_utils.cc
+++ b/chrome/common/common_message_utils.cc
@@ -1,10 +1,9 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 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/ipc_message_utils.h"
+#include "chrome/common/common_message_utils.h"
-#include "base/gfx/rect.h"
#include "googleurl/src/gurl.h"
#include "SkBitmap.h"
#include "webkit/glue/dom_operations.h"
@@ -45,7 +44,6 @@ struct SkBitmap_Data {
} // namespace
-
void ParamTraits<SkBitmap>::Write(Message* m, const SkBitmap& p) {
size_t fixed_size = sizeof(SkBitmap_Data);
SkBitmap_Data bmp_data;
@@ -86,7 +84,6 @@ void ParamTraits<SkBitmap>::Log(const SkBitmap& p, std::wstring* l) {
l->append(StringPrintf(L"<SkBitmap>"));
}
-
void ParamTraits<GURL>::Write(Message* m, const GURL& p) {
m->WriteString(p.possibly_invalid_spec());
// TODO(brettw) bug 684583: Add encoding for query params.
@@ -106,74 +103,6 @@ void ParamTraits<GURL>::Log(const GURL& p, std::wstring* l) {
l->append(UTF8ToWide(p.spec()));
}
-
-void ParamTraits<gfx::Point>::Write(Message* m, const gfx::Point& p) {
- m->WriteInt(p.x());
- m->WriteInt(p.y());
-}
-
-bool ParamTraits<gfx::Point>::Read(const Message* m, void** iter,
- gfx::Point* r) {
- int x, y;
- if (!m->ReadInt(iter, &x) ||
- !m->ReadInt(iter, &y))
- return false;
- r->set_x(x);
- r->set_y(y);
- return true;
-}
-
-void ParamTraits<gfx::Point>::Log(const gfx::Point& p, std::wstring* l) {
- l->append(StringPrintf(L"(%d, %d)", p.x(), p.y()));
-}
-
-
-void ParamTraits<gfx::Rect>::Write(Message* m, const gfx::Rect& p) {
- m->WriteInt(p.x());
- m->WriteInt(p.y());
- m->WriteInt(p.width());
- m->WriteInt(p.height());
-}
-
-bool ParamTraits<gfx::Rect>::Read(const Message* m, void** iter, gfx::Rect* r) {
- int x, y, w, h;
- if (!m->ReadInt(iter, &x) ||
- !m->ReadInt(iter, &y) ||
- !m->ReadInt(iter, &w) ||
- !m->ReadInt(iter, &h))
- return false;
- r->set_x(x);
- r->set_y(y);
- r->set_width(w);
- r->set_height(h);
- return true;
-}
-
-void ParamTraits<gfx::Rect>::Log(const gfx::Rect& p, std::wstring* l) {
- l->append(StringPrintf(L"(%d, %d, %d, %d)", p.x(), p.y(),
- p.width(), p.height()));
-}
-
-
-void ParamTraits<gfx::Size>::Write(Message* m, const gfx::Size& p) {
- m->WriteInt(p.width());
- m->WriteInt(p.height());
-}
-
-bool ParamTraits<gfx::Size>::Read(const Message* m, void** iter, gfx::Size* r) {
- int w, h;
- if (!m->ReadInt(iter, &w) ||
- !m->ReadInt(iter, &h))
- return false;
- r->set_width(w);
- r->set_height(h);
- return true;
-}
-
-void ParamTraits<gfx::Size>::Log(const gfx::Size& p, std::wstring* l) {
- l->append(StringPrintf(L"(%d, %d)", p.width(), p.height()));
-}
-
void ParamTraits<webkit_glue::WebApplicationInfo>::Write(
Message* m, const webkit_glue::WebApplicationInfo& p) {
WriteParam(m, p.title);
diff --git a/chrome/common/common_message_utils.h b/chrome/common/common_message_utils.h
new file mode 100644
index 0000000..81178db
--- /dev/null
+++ b/chrome/common/common_message_utils.h
@@ -0,0 +1,138 @@
+// Copyright (c) 2006-2008 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_COMMON_MESSAGE_UTILS_H_
+#define CHROME_COMMON_COMMON_MESSAGE_UTILS_H_
+
+#include "chrome/common/thumbnail_score.h"
+#include "chrome/common/transport_dib.h"
+#include "ipc/ipc_message_utils.h"
+#include "webkit/glue/webcursor.h"
+#include "webkit/glue/window_open_disposition.h"
+
+// Forward declarations.
+class GURL;
+class SkBitmap;
+
+namespace webkit_glue {
+struct WebApplicationInfo;
+} // namespace webkit_glue
+
+namespace IPC {
+
+template <>
+struct ParamTraits<SkBitmap> {
+ typedef SkBitmap param_type;
+ static void Write(Message* m, const param_type& p);
+
+ // Note: This function expects parameter |r| to be of type &SkBitmap since
+ // r->SetConfig() and r->SetPixels() are called.
+ static bool Read(const Message* m, void** iter, param_type* r);
+
+ static void Log(const param_type& p, std::wstring* l);
+};
+
+template<>
+struct ParamTraits<ThumbnailScore> {
+ typedef ThumbnailScore param_type;
+ static void Write(Message* m, const param_type& p) {
+ IPC::ParamTraits<double>::Write(m, p.boring_score);
+ IPC::ParamTraits<bool>::Write(m, p.good_clipping);
+ IPC::ParamTraits<bool>::Write(m, p.at_top);
+ IPC::ParamTraits<base::Time>::Write(m, p.time_at_snapshot);
+ }
+ static bool Read(const Message* m, void** iter, param_type* r) {
+ double boring_score;
+ bool good_clipping, at_top;
+ base::Time time_at_snapshot;
+ if (!IPC::ParamTraits<double>::Read(m, iter, &boring_score) ||
+ !IPC::ParamTraits<bool>::Read(m, iter, &good_clipping) ||
+ !IPC::ParamTraits<bool>::Read(m, iter, &at_top) ||
+ !IPC::ParamTraits<base::Time>::Read(m, iter, &time_at_snapshot))
+ return false;
+
+ r->boring_score = boring_score;
+ r->good_clipping = good_clipping;
+ r->at_top = at_top;
+ r->time_at_snapshot = time_at_snapshot;
+ return true;
+ }
+ static void Log(const param_type& p, std::wstring* l) {
+ l->append(StringPrintf(L"(%f, %d, %d)",
+ p.boring_score, p.good_clipping, p.at_top));
+ }
+};
+
+template <>
+struct ParamTraits<GURL> {
+ typedef GURL param_type;
+ static void Write(Message* m, const param_type& p);
+ static bool Read(const Message* m, void** iter, param_type* p);
+ static void Log(const param_type& p, std::wstring* l);
+};
+
+template <>
+struct ParamTraits<WindowOpenDisposition> {
+ typedef WindowOpenDisposition param_type;
+ static void Write(Message* m, const param_type& p) {
+ m->WriteInt(p);
+ }
+ static bool Read(const Message* m, void** iter, param_type* r) {
+ int temp;
+ bool res = m->ReadInt(iter, &temp);
+ *r = static_cast<WindowOpenDisposition>(temp);
+ return res;
+ }
+ static void Log(const param_type& p, std::wstring* l) {
+ l->append(StringPrintf(L"%d", p));
+ }
+};
+
+template <>
+struct ParamTraits<WebCursor> {
+ typedef WebCursor param_type;
+ static void Write(Message* m, const param_type& p) {
+ p.Serialize(m);
+ }
+ static bool Read(const Message* m, void** iter, param_type* r) {
+ return r->Deserialize(m, iter);
+ }
+ static void Log(const param_type& p, std::wstring* l) {
+ l->append(L"<WebCursor>");
+ }
+};
+
+template <>
+struct ParamTraits<webkit_glue::WebApplicationInfo> {
+ typedef webkit_glue::WebApplicationInfo param_type;
+ static void Write(Message* m, const param_type& p);
+ static bool Read(const Message* m, void** iter, param_type* r);
+ static void Log(const param_type& p, std::wstring* l);
+};
+
+#if defined(OS_WIN)
+template<>
+struct ParamTraits<TransportDIB::Id> {
+ typedef TransportDIB::Id param_type;
+ static void Write(Message* m, const param_type& p) {
+ WriteParam(m, p.handle);
+ WriteParam(m, p.sequence_num);
+ }
+ static bool Read(const Message* m, void** iter, param_type* r) {
+ return (ReadParam(m, iter, &r->handle) &&
+ ReadParam(m, iter, &r->sequence_num));
+ }
+ static void Log(const param_type& p, std::wstring* l) {
+ l->append(L"TransportDIB(");
+ LogParam(p.handle, l);
+ l->append(L", ");
+ LogParam(p.sequence_num, l);
+ l->append(L")");
+ }
+};
+#endif
+
+} // namespace IPC
+
+#endif // CHROME_COMMON_COMMON_MESSAGE_UTILS_H_
diff --git a/chrome/common/ipc_message_unittest.cc b/chrome/common/gurl_serialisation_unittest.cc
index 643626e..9fdd59d 100644
--- a/chrome/common/ipc_message_unittest.cc
+++ b/chrome/common/gurl_serialisation_unittest.cc
@@ -4,13 +4,13 @@
#include <string.h>
-#include "chrome/common/ipc_message.h"
-#include "chrome/common/ipc_message_utils.h"
#include "googleurl/src/gurl.h"
+#include "chrome/common/common_message_utils.h"
+#include "ipc/ipc_message.h"
#include "testing/gtest/include/gtest/gtest.h"
// Tests that serialize/deserialize correctly understand each other
-TEST(IPCMessageTest, Serialize) {
+TEST(GURLSerialisation, Serialize) {
const char* serialize_cases[] = {
"http://www.google.com/",
"http://user:pass@host.com:888/foo;bar?baz#nop",
diff --git a/chrome/common/ipc_maybe.h b/chrome/common/ipc_maybe.h
deleted file mode 100644
index de45dc0..0000000
--- a/chrome/common/ipc_maybe.h
+++ /dev/null
@@ -1,19 +0,0 @@
-#ifndef CHROME_COMMON_MAYBE_H_
-#define CHROME_COMMON_MAYBE_H_
-
-namespace IPC {
-
-// The Maybe type can be used to avoid serialising a type when it's invalid.
-// This is most useful in conjunction with FileDescriptor, as there's no
-// possible invalid value which can be serialised (one can type to use -1, but
-// the IPC channel will fail). It may also be useful if the invalid value is
-// otherwise expensive to serialise.
-template<typename A>
-struct Maybe {
- bool valid;
- A value;
-};
-
-} // namespace IPC
-
-#endif // CHROME_COMMON_MAYBE_H_
diff --git a/chrome/common/ipc_tests.vcproj b/chrome/common/ipc_tests.vcproj
deleted file mode 100644
index 78fae65..0000000
--- a/chrome/common/ipc_tests.vcproj
+++ /dev/null
@@ -1,165 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="ipc_tests"
- ProjectGUID="{B92AE829-E1CD-4781-824A-DCB1603A1672}"
- RootNamespace="ipc_tests"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- ConfigurationType="1"
- InheritedPropertySheets="$(SolutionDir)..\build\common.vsprops;$(SolutionDir)..\build\debug.vsprops;$(SolutionDir)..\skia\using_skia.vsprops;$(SolutionDir)..\testing\using_gtest.vsprops"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="shlwapi.lib rpcrt4.lib winmm.lib"
- SubSystem="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- ConfigurationType="1"
- InheritedPropertySheets="$(SolutionDir)..\build\common.vsprops;$(SolutionDir)..\build\release.vsprops;$(SolutionDir)..\skia\using_skia.vsprops;$(SolutionDir)..\testing\using_gtest.vsprops"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="shlwapi.lib rpcrt4.lib winmm.lib"
- SubSystem="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <File
- RelativePath=".\ipc_fuzzing_tests.cc"
- >
- </File>
- <File
- RelativePath=".\ipc_tests.cc"
- >
- </File>
- <File
- RelativePath=".\ipc_tests.h"
- >
- </File>
- <File
- RelativePath="..\..\base\perftimer.cc"
- >
- </File>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/chrome/common/logging_chrome.cc b/chrome/common/logging_chrome.cc
index 66a49cf..a68b4d6 100644
--- a/chrome/common/logging_chrome.cc
+++ b/chrome/common/logging_chrome.cc
@@ -25,6 +25,23 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/common/env_vars.h"
+#if defined(OS_POSIX)
+// On POSIX, this file also handles IPC logging
+
+#include "ipc/ipc_logging.h"
+#include "ipc/ipc_message.h"
+
+#ifdef IPC_MESSAGE_LOG_ENABLED
+// This will cause render_messages.h etc to define ViewMsgLog and friends.
+#define IPC_MESSAGE_MACROS_LOG_ENABLED
+// This include list should contain all _messages.h header files so that they
+// can get *MsgLog function etc. This makes ipc logs much more informative.
+#include "chrome/common/render_messages.h"
+#include "chrome/test/automation/automation_messages.h"
+#endif
+
+#endif
+
// When true, this means that error dialogs should not be shown.
static bool dialogs_are_suppressed_ = false;
@@ -72,6 +89,10 @@ void InitChromeLogging(const CommandLine& command_line,
DCHECK(!chrome_logging_initialized_) <<
"Attempted to initialize logging when it was already initialized.";
+#if defined(OS_POSIX) && defined(IPC_MESSAGE_LOG_ENABLED)
+ IPC::Logging::SetLoggerFunctions(g_log_function_mapping);
+#endif
+
// only use OutputDebugString in debug mode
#ifdef NDEBUG
bool enable_logging = false;
diff --git a/chrome/common/message_router.h b/chrome/common/message_router.h
index d23e2f3..ef18aaa 100644
--- a/chrome/common/message_router.h
+++ b/chrome/common/message_router.h
@@ -6,7 +6,7 @@
#define CHROME_COMMON_MESSAGE_ROUTER_H__
#include "base/id_map.h"
-#include "chrome/common/ipc_channel.h"
+#include "ipc/ipc_channel.h"
// The MessageRouter handles all incoming messages sent to it by routing them
// to the correct listener. Routing is based on the Message's routing ID.
diff --git a/chrome/common/plugin_messages.h b/chrome/common/plugin_messages.h
index 7b5ce73..ecd012a 100644
--- a/chrome/common/plugin_messages.h
+++ b/chrome/common/plugin_messages.h
@@ -16,7 +16,8 @@
#include "base/gfx/native_widget_types.h"
#include "base/gfx/rect.h"
#include "base/basictypes.h"
-#include "chrome/common/ipc_message_utils.h"
+#include "chrome/common/common_message_utils.h"
+#include "ipc/ipc_message_utils.h"
#include "googleurl/src/gurl.h"
#include "third_party/npapi/bindings/npapi.h"
#include "webkit/glue/npruntime_util.h"
@@ -447,8 +448,12 @@ struct ParamTraits<NPVariant_Param> {
} // namespace IPC
-
+#if 0
+// This for tools which parse #include lines, but cannot process when we
+// include via a macro name.
+#include "chrome/common/plugin_messages_internal.h"
+#endif
#define MESSAGES_INTERNAL_FILE "chrome/common/plugin_messages_internal.h"
-#include "chrome/common/ipc_message_macros.h"
+#include "ipc/ipc_message_macros.h"
#endif // CHROME_COMMON_PLUGIN_MESSAGES_H__
diff --git a/chrome/common/plugin_messages_internal.h b/chrome/common/plugin_messages_internal.h
index 11a0365..cafc4b0 100644
--- a/chrome/common/plugin_messages_internal.h
+++ b/chrome/common/plugin_messages_internal.h
@@ -3,7 +3,7 @@
// found in the LICENSE file.
#include "base/shared_memory.h"
-#include "chrome/common/ipc_message_macros.h"
+#include "ipc/ipc_message_macros.h"
#include "webkit/glue/webcursor.h"
//-----------------------------------------------------------------------------
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h
index 38af203..b2e289f 100644
--- a/chrome/common/render_messages.h
+++ b/chrome/common/render_messages.h
@@ -15,12 +15,13 @@
#include "base/shared_memory.h"
#include "chrome/browser/renderer_host/resource_handler.h"
#include "chrome/common/filter_policy.h"
-#include "chrome/common/ipc_message_utils.h"
+#include "chrome/common/common_message_utils.h"
#include "chrome/common/modal_dialog_event.h"
#include "chrome/common/page_transition_types.h"
#include "chrome/common/transport_dib.h"
#include "chrome/common/webkit_param_traits.h"
#include "googleurl/src/gurl.h"
+#include "ipc/ipc_message_utils.h"
#include "media/audio/audio_output.h"
#include "net/base/upload_data.h"
#include "net/http/http_response_headers.h"
@@ -1771,7 +1772,12 @@ struct ParamTraits<AudioOutputStream::State> {
} // namespace IPC
+#if 0
+// This for tools which parse #include lines, but cannot process when we
+// include via a macro name.
+#include "chrome/common/render_messages_internal.h"
+#endif
#define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h"
-#include "chrome/common/ipc_message_macros.h"
+#include "ipc/ipc_message_macros.h"
#endif // CHROME_COMMON_RENDER_MESSAGES_H_
diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h
index ece0cd1..8a81d74 100644
--- a/chrome/common/render_messages_internal.h
+++ b/chrome/common/render_messages_internal.h
@@ -15,8 +15,8 @@
#include "base/gfx/rect.h"
#include "base/gfx/native_widget_types.h"
#include "base/shared_memory.h"
-#include "chrome/common/ipc_message_macros.h"
#include "chrome/common/transport_dib.h"
+#include "ipc/ipc_message_macros.h"
#include "skia/include/SkBitmap.h"
#include "webkit/glue/dom_operations.h"
#include "webkit/glue/webcursor.h"
diff --git a/chrome/common/resource_dispatcher.h b/chrome/common/resource_dispatcher.h
index 73d0a8b3..f494aff 100644
--- a/chrome/common/resource_dispatcher.h
+++ b/chrome/common/resource_dispatcher.h
@@ -15,7 +15,7 @@
#include "base/shared_memory.h"
#include "base/task.h"
#include "chrome/common/filter_policy.h"
-#include "chrome/common/ipc_channel.h"
+#include "ipc/ipc_channel.h"
#include "webkit/glue/resource_loader_bridge.h"
struct ResourceResponseHead;
diff --git a/chrome/common/webkit_param_traits.h b/chrome/common/webkit_param_traits.h
index d41bccc..0f48ef3 100644
--- a/chrome/common/webkit_param_traits.h
+++ b/chrome/common/webkit_param_traits.h
@@ -8,7 +8,7 @@
#ifndef CHROME_COMMON_WEBKIT_PARAM_TRAITS_H_
#define CHROME_COMMON_WEBKIT_PARAM_TRAITS_H_
-#include "chrome/common/ipc_message_utils.h"
+#include "chrome/common/common_message_utils.h"
#include "third_party/WebKit/WebKit/chromium/public/WebCache.h"
#include "third_party/WebKit/WebKit/chromium/public/WebConsoleMessage.h"
#include "third_party/WebKit/WebKit/chromium/public/WebFindInPageRequest.h"
diff --git a/chrome/common/worker_messages.h b/chrome/common/worker_messages.h
index c1fde97..50bc69b 100644
--- a/chrome/common/worker_messages.h
+++ b/chrome/common/worker_messages.h
@@ -11,10 +11,15 @@
#include <string>
#include "base/basictypes.h"
-#include "chrome/common/ipc_message_utils.h"
-
+#include "ipc/ipc_message_utils.h"
+#include "chrome/common/common_message_utils.h"
+#if 0
+// This for tools which parse #include lines, but cannot process when we
+// include via a macro name.
+#include "chrome/common/worker_messages_internal.h"
+#endif
#define MESSAGES_INTERNAL_FILE "chrome/common/worker_messages_internal.h"
-#include "chrome/common/ipc_message_macros.h"
+#include "ipc/ipc_message_macros.h"
#endif // CHROME_COMMON_WORKER_MESSAGES_H_
diff --git a/chrome/common/worker_messages_internal.h b/chrome/common/worker_messages_internal.h
index 7691c79..ba9bb4c 100644
--- a/chrome/common/worker_messages_internal.h
+++ b/chrome/common/worker_messages_internal.h
@@ -3,7 +3,7 @@
// found in the LICENSE file.
#include "base/string16.h"
-#include "chrome/common/ipc_message_macros.h"
+#include "ipc/ipc_message_macros.h"
#include "googleurl/src/gurl.h"
diff --git a/chrome/plugin/npobject_proxy.h b/chrome/plugin/npobject_proxy.h
index bb0ec2c..14892f8a 100644
--- a/chrome/plugin/npobject_proxy.h
+++ b/chrome/plugin/npobject_proxy.h
@@ -9,7 +9,7 @@
#define CHROME_PLUGIN_NPOBJECT_PROXY_H_
#include "base/ref_counted.h"
-#include "chrome/common/ipc_channel.h"
+#include "ipc/ipc_channel.h"
#include "third_party/npapi/bindings/npruntime.h"
class PluginChannelBase;
diff --git a/chrome/plugin/npobject_stub.h b/chrome/plugin/npobject_stub.h
index cd75853..98be7da 100644
--- a/chrome/plugin/npobject_stub.h
+++ b/chrome/plugin/npobject_stub.h
@@ -11,7 +11,7 @@
#include <vector>
#include "base/ref_counted.h"
-#include "chrome/common/ipc_channel.h"
+#include "ipc/ipc_channel.h"
namespace base {
class WaitableEvent;
diff --git a/chrome/plugin/plugin_channel_base.cc b/chrome/plugin/plugin_channel_base.cc
index 0e26e86..066610a 100644
--- a/chrome/plugin/plugin_channel_base.cc
+++ b/chrome/plugin/plugin_channel_base.cc
@@ -8,7 +8,7 @@
#include "base/hash_tables.h"
#include "chrome/common/child_process.h"
-#include "chrome/common/ipc_sync_message.h"
+#include "ipc/ipc_sync_message.h"
typedef base::hash_map<std::wstring, scoped_refptr<PluginChannelBase> >
PluginChannelMap;
diff --git a/chrome/plugin/plugin_channel_base.h b/chrome/plugin/plugin_channel_base.h
index dd70cba..e36db71 100644
--- a/chrome/plugin/plugin_channel_base.h
+++ b/chrome/plugin/plugin_channel_base.h
@@ -12,7 +12,7 @@
#include "base/message_loop.h"
#include "base/ref_counted.h"
#include "base/scoped_ptr.h"
-#include "chrome/common/ipc_sync_channel.h"
+#include "ipc/ipc_sync_channel.h"
#include "chrome/common/message_router.h"
// Encapsulates an IPC channel between a renderer and a plugin process.
diff --git a/chrome/plugin/webplugin_delegate_stub.h b/chrome/plugin/webplugin_delegate_stub.h
index 995d318..b121b14 100644
--- a/chrome/plugin/webplugin_delegate_stub.h
+++ b/chrome/plugin/webplugin_delegate_stub.h
@@ -11,7 +11,7 @@
#include "base/ref_counted.h"
#include "base/shared_memory.h"
#include "base/task.h"
-#include "chrome/common/ipc_channel.h"
+#include "ipc/ipc_channel.h"
#include "third_party/npapi/bindings/npapi.h"
class GURL;
diff --git a/chrome/plugin/webplugin_proxy.h b/chrome/plugin/webplugin_proxy.h
index 8c4629d..1d5f72e 100644
--- a/chrome/plugin/webplugin_proxy.h
+++ b/chrome/plugin/webplugin_proxy.h
@@ -11,8 +11,8 @@
#include "base/scoped_ptr.h"
#include "base/shared_memory.h"
#include "base/timer.h"
-#include "chrome/common/ipc_message.h"
#include "chrome/common/chrome_plugin_api.h"
+#include "ipc/ipc_message.h"
#include "webkit/glue/webplugin.h"
namespace base {
diff --git a/chrome/renderer/automation/dom_automation_controller.h b/chrome/renderer/automation/dom_automation_controller.h
index 33e6111..e886165 100644
--- a/chrome/renderer/automation/dom_automation_controller.h
+++ b/chrome/renderer/automation/dom_automation_controller.h
@@ -5,7 +5,7 @@
#ifndef CHROME_RENDERER_AUTOMATION_DOM_AUTOMATION_CONTROLLER_H__
#define CHROME_RENDERER_AUTOMATION_DOM_AUTOMATION_CONTROLLER_H__
-#include "chrome/common/ipc_message.h"
+#include "ipc/ipc_message.h"
#include "webkit/glue/cpp_bound_class.h"
/* DomAutomationController class:
diff --git a/chrome/renderer/debug_message_handler.h b/chrome/renderer/debug_message_handler.h
index 76abd60..cc35227 100644
--- a/chrome/renderer/debug_message_handler.h
+++ b/chrome/renderer/debug_message_handler.h
@@ -9,7 +9,7 @@
#ifndef CHROME_RENDERER_DEBUG_MESSAGE_HANDLER_H_
#define CHROME_RENDERER_DEBUG_MESSAGE_HANDLER_H_
-#include "chrome/common/ipc_channel_proxy.h"
+#include "ipc/ipc_channel_proxy.h"
#include "webkit/glue/debugger_bridge.h"
class RenderView;
diff --git a/chrome/renderer/devtools_agent.h b/chrome/renderer/devtools_agent.h
index 9059542..e1938c2 100644
--- a/chrome/renderer/devtools_agent.h
+++ b/chrome/renderer/devtools_agent.h
@@ -10,8 +10,8 @@
#include "base/basictypes.h"
#include "base/ref_counted.h"
#include "base/scoped_ptr.h"
-#include "chrome/common/ipc_channel_proxy.h"
#include "chrome/renderer/devtools_messages.h"
+#include "ipc/ipc_channel_proxy.h"
#include "webkit/glue/webdevtoolsagent_delegate.h"
class MessageLoop;
diff --git a/chrome/renderer/devtools_messages.h b/chrome/renderer/devtools_messages.h
index 709d51f..26afac6 100644
--- a/chrome/renderer/devtools_messages.h
+++ b/chrome/renderer/devtools_messages.h
@@ -5,7 +5,12 @@
#ifndef CHROME_RENDERER_DEVTOOLS_MESSAGES_H_
#define CHROME_RENDERER_DEVTOOLS_MESSAGES_H_
+#if 0
+// This for tools which parse #include lines, but cannot process when we
+// include via a macro name.
+#include "chrome/renderer/devtools_messages_internal.h"
+#endif
#define MESSAGES_INTERNAL_FILE "chrome/renderer/devtools_messages_internal.h"
-#include "chrome/common/ipc_message_macros.h"
+#include "ipc/ipc_message_macros.h"
#endif // CHROME_RENDERER_DEVTOOLS_MESSAGES_H_
diff --git a/chrome/renderer/devtools_messages_internal.h b/chrome/renderer/devtools_messages_internal.h
index b0e0a8a..e3fa28e 100644
--- a/chrome/renderer/devtools_messages_internal.h
+++ b/chrome/renderer/devtools_messages_internal.h
@@ -42,7 +42,7 @@
//
// This file describes developer tools message types.
-#include "chrome/common/ipc_message_macros.h"
+#include "ipc/ipc_message_macros.h"
// These are messages sent from DevToolsAgent to DevToolsClient through the
// browser.
diff --git a/chrome/renderer/dom_ui_bindings.h b/chrome/renderer/dom_ui_bindings.h
index 23b2d35..b4ad992 100644
--- a/chrome/renderer/dom_ui_bindings.h
+++ b/chrome/renderer/dom_ui_bindings.h
@@ -5,7 +5,7 @@
#ifndef CHROME_RENDERER_DOM_UI_BINDINGS_H__
#define CHROME_RENDERER_DOM_UI_BINDINGS_H__
-#include "chrome/common/ipc_message.h"
+#include "ipc/ipc_message.h"
#include "webkit/glue/cpp_bound_class.h"
// A DOMBoundBrowserObject is a backing for some object bound to the window
diff --git a/chrome/renderer/external_host_bindings.h b/chrome/renderer/external_host_bindings.h
index cd8bcdb..d995975 100644
--- a/chrome/renderer/external_host_bindings.h
+++ b/chrome/renderer/external_host_bindings.h
@@ -5,8 +5,8 @@
#ifndef CHROME_RENDERER_EXTERNAL_HOST_BINDINGS_H_
#define CHROME_RENDERER_EXTERNAL_HOST_BINDINGS_H_
-#include "chrome/common/ipc_message.h"
#include "chrome/renderer/dom_ui_bindings.h"
+#include "ipc/ipc_message.h"
// ExternalHostBindings is the class backing the "externalHost" object
// accessible from Javascript
diff --git a/chrome/renderer/mock_render_thread.cc b/chrome/renderer/mock_render_thread.cc
index 19fdd48..0a7618e 100644
--- a/chrome/renderer/mock_render_thread.cc
+++ b/chrome/renderer/mock_render_thread.cc
@@ -4,8 +4,8 @@
#include "chrome/renderer/mock_render_thread.h"
-#include "chrome/common/ipc_message_utils.h"
#include "chrome/common/render_messages.h"
+#include "ipc/ipc_message_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
MockRenderThread::MockRenderThread()
diff --git a/chrome/renderer/mock_render_thread.h b/chrome/renderer/mock_render_thread.h
index a89822a6..65543eb 100644
--- a/chrome/renderer/mock_render_thread.h
+++ b/chrome/renderer/mock_render_thread.h
@@ -7,7 +7,7 @@
#include <vector>
-#include "chrome/common/ipc_test_sink.h"
+#include "ipc/ipc_test_sink.h"
#include "chrome/renderer/render_thread.h"
// This class is very simple mock of RenderThread. It simulates an IPC channel
diff --git a/chrome/renderer/render_process.cc b/chrome/renderer/render_process.cc
index e8af233..dca03c7 100644
--- a/chrome/renderer/render_process.cc
+++ b/chrome/renderer/render_process.cc
@@ -23,11 +23,11 @@
#include "chrome/browser/net/dns_global.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/chrome_paths.h"
-#include "chrome/common/ipc_channel.h"
-#include "chrome/common/ipc_message_utils.h"
#include "chrome/common/render_messages.h"
#include "chrome/common/transport_dib.h"
#include "chrome/renderer/render_view.h"
+#include "ipc/ipc_channel.h"
+#include "ipc/ipc_message_utils.h"
#include "webkit/glue/webkit_glue.h"
// Attempts to load FFmpeg before engaging the sandbox. Returns true if all
diff --git a/chrome/renderer/render_thread_unittest.cc b/chrome/renderer/render_thread_unittest.cc
index 808bedf..c03f889 100644
--- a/chrome/renderer/render_thread_unittest.cc
+++ b/chrome/renderer/render_thread_unittest.cc
@@ -3,10 +3,10 @@
// found in the LICENSE file.
#include "base/waitable_event.h"
-#include "chrome/common/ipc_sync_channel.h"
#include "chrome/common/render_messages.h"
#include "chrome/renderer/mock_render_process.h"
#include "chrome/renderer/render_thread.h"
+#include "ipc/ipc_sync_channel.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
diff --git a/chrome/renderer/render_widget.h b/chrome/renderer/render_widget.h
index 7ee2c04..3e58790 100644
--- a/chrome/renderer/render_widget.h
+++ b/chrome/renderer/render_widget.h
@@ -13,8 +13,8 @@
#include "base/gfx/size.h"
#include "base/ref_counted.h"
#include "base/shared_memory.h"
-#include "chrome/common/ipc_channel.h"
#include "chrome/renderer/render_process.h"
+#include "ipc/ipc_channel.h"
#include "skia/ext/platform_canvas.h"
#include "webkit/glue/webwidget_delegate.h"
diff --git a/chrome/renderer/renderer_main_unittest.cc b/chrome/renderer/renderer_main_unittest.cc
index c938f5b..6bb21bd 100644
--- a/chrome/renderer/renderer_main_unittest.cc
+++ b/chrome/renderer/renderer_main_unittest.cc
@@ -6,8 +6,8 @@
#include "base/multiprocess_test.h"
#include "base/process_util.h"
#include "chrome/common/chrome_switches.h"
-#include "chrome/common/ipc_channel.h"
#include "chrome/common/main_function_params.h"
+#include "ipc/ipc_channel.h"
#include "testing/gtest/include/gtest/gtest.h"
// TODO(port): Bring up this test this on other platforms.
diff --git a/chrome/renderer/webplugin_delegate_proxy.h b/chrome/renderer/webplugin_delegate_proxy.h
index 8af9733..2c20a4f 100644
--- a/chrome/renderer/webplugin_delegate_proxy.h
+++ b/chrome/renderer/webplugin_delegate_proxy.h
@@ -10,8 +10,8 @@
#include "base/gfx/rect.h"
#include "base/gfx/native_widget_types.h"
#include "base/ref_counted.h"
-#include "chrome/common/ipc_message.h"
#include "chrome/renderer/plugin_channel_host.h"
+#include "ipc/ipc_message.h"
#include "webkit/glue/webplugin.h"
#include "webkit/glue/webplugin_delegate.h"
diff --git a/chrome/renderer/webworker_proxy.h b/chrome/renderer/webworker_proxy.h
index 94c199d..c18d3bd 100644
--- a/chrome/renderer/webworker_proxy.h
+++ b/chrome/renderer/webworker_proxy.h
@@ -8,7 +8,7 @@
#include <vector>
#include "base/basictypes.h"
-#include "chrome/common/ipc_channel.h"
+#include "ipc/ipc_channel.h"
#include "webkit/glue/webworker.h"
class GURL;
diff --git a/chrome/test/automation/autocomplete_edit_proxy.h b/chrome/test/automation/autocomplete_edit_proxy.h
index 79d8975..b14cb6a 100644
--- a/chrome/test/automation/autocomplete_edit_proxy.h
+++ b/chrome/test/automation/autocomplete_edit_proxy.h
@@ -9,9 +9,10 @@
#include <vector>
#include "chrome/browser/autocomplete/autocomplete.h"
-#include "chrome/common/ipc_message.h"
-#include "chrome/common/ipc_message_utils.h"
+#include "chrome/common/common_message_utils.h"
#include "chrome/test/automation/automation_handle_tracker.h"
+#include "ipc/ipc_message.h"
+#include "ipc/ipc_message_utils.h"
#include "googleurl/src/gurl.h"
// The purpose of this class is to act as a serializable version of
diff --git a/chrome/test/automation/automation_messages.h b/chrome/test/automation/automation_messages.h
index 5968f78..9b24acc 100644
--- a/chrome/test/automation/automation_messages.h
+++ b/chrome/test/automation/automation_messages.h
@@ -10,8 +10,9 @@
#include "base/basictypes.h"
#include "chrome/browser/tab_contents/navigation_entry.h"
#include "chrome/browser/tab_contents/security_style.h"
-#include "chrome/common/ipc_message_utils.h"
+#include "chrome/common/common_message_utils.h"
#include "chrome/test/automation/automation_constants.h"
+#include "ipc/ipc_message_utils.h"
struct AutomationMsg_Find_Params {
// Unused value, which exists only for backwards compat.
@@ -215,8 +216,13 @@ struct ParamTraits<Reposition_Params> {
} // namespace IPC
+#if 0
+// This for tools which parse #include lines, but cannot process when we
+// include via a macro name.
+#include "chrome/test/automation/automation_messages_internal.h"
+#endif
#define MESSAGES_INTERNAL_FILE \
"chrome/test/automation/automation_messages_internal.h"
-#include "chrome/common/ipc_message_macros.h"
+#include "ipc/ipc_message_macros.h"
#endif // CHROME_TEST_AUTOMATION_AUTOMATION_MESSAGES_H__
diff --git a/chrome/test/automation/automation_messages_internal.h b/chrome/test/automation/automation_messages_internal.h
index 59599b1..cc7d644 100644
--- a/chrome/test/automation/automation_messages_internal.h
+++ b/chrome/test/automation/automation_messages_internal.h
@@ -14,9 +14,9 @@
#include "base/basictypes.h"
#include "base/gfx/rect.h"
#include "base/string16.h"
-#include "chrome/common/ipc_message_macros.h"
#include "chrome/common/navigation_types.h"
#include "chrome/test/automation/autocomplete_edit_proxy.h"
+#include "ipc/ipc_message_macros.h"
#include "googleurl/src/gurl.h"
// NOTE: All IPC messages have either a routing_id of 0 (for asynchronous
diff --git a/chrome/test/automation/automation_proxy.h b/chrome/test/automation/automation_proxy.h
index 138edd0..f31205d 100644
--- a/chrome/test/automation/automation_proxy.h
+++ b/chrome/test/automation/automation_proxy.h
@@ -13,11 +13,11 @@
#include "base/time.h"
#include "base/thread.h"
#include "base/waitable_event.h"
-#include "chrome/common/ipc_channel_proxy.h"
-#include "chrome/common/ipc_message.h"
-#include "chrome/common/ipc_sync_channel.h"
#include "chrome/test/automation/automation_handle_tracker.h"
#include "chrome/test/automation/automation_messages.h"
+#include "ipc/ipc_channel_proxy.h"
+#include "ipc/ipc_message.h"
+#include "ipc/ipc_sync_channel.h"
#if defined(OS_WIN)
// TODO(port): Enable this or equivalent.
diff --git a/chrome/test/data/purify/ipc_tests.exe_UMR.txt b/chrome/test/data/purify/ipc_tests.exe_UMR.txt
index 6f7d34f..16ee86e 100644
--- a/chrome/test/data/purify/ipc_tests.exe_UMR.txt
+++ b/chrome/test/data/purify/ipc_tests.exe_UMR.txt
@@ -1,34 +1,34 @@
Uninitialized memory read in strlen
Error Location
...
- chrome/common/ipc_tests.cc Send
- chrome/common/ipc_tests.cc MyChannelListener::OnMessageReceived(Message::IPC const&)
- chrome/common/ipc_channel.cc IPC::Channel::ProcessIncomingMessages(void)
- chrome/common/ipc_channel.cc IPC::Channel::OnObjectSignaled(void *)
+ ipc/ipc_tests.cc Send
+ ipc/ipc_tests.cc MyChannelListener::OnMessageReceived(Message::IPC const&)
+ ipc/ipc_channel.cc IPC::Channel::ProcessIncomingMessages(void)
+ ipc/ipc_channel.cc IPC::Channel::OnObjectSignaled(void *)
base/message_loop.cc MessageLoop::SignalWatcher(DWORD)
base/message_loop.cc MessageLoop::ProcessNextObject(void)
base/message_loop.cc MessageLoop::Run(Dispatcher::MessageLoop *)
base/message_loop.cc MessageLoop::Run(void)
- chrome/common/ipc_tests.cc RunTestClient
- chrome/common/ipc_tests.cc main
+ ipc/ipc_tests.cc RunTestClient
+ ipc/ipc_tests.cc main
...
Uninitialized memory read in WriteFile
Error Location
...
- chrome/common/ipc_channel.cc IPC::Channel::ProcessOutgoingMessages(void)
- chrome/common/ipc_channel.cc IPC::Channel::OnObjectSignaled(void *)
- chrome/common/ipc_channel.cc IPC::Channel::Send(Message::IPC *)
- chrome/common/ipc_tests.cc Send
- chrome/common/ipc_tests.cc MyChannelListener::OnMessageReceived(Message::IPC const&)
- chrome/common/ipc_channel.cc IPC::Channel::ProcessIncomingMessages(void)
- chrome/common/ipc_channel.cc IPC::Channel::OnObjectSignaled(void *)
+ ipc/ipc_channel.cc IPC::Channel::ProcessOutgoingMessages(void)
+ ipc/ipc_channel.cc IPC::Channel::OnObjectSignaled(void *)
+ ipc/ipc_channel.cc IPC::Channel::Send(Message::IPC *)
+ ipc/ipc_tests.cc Send
+ ipc/ipc_tests.cc MyChannelListener::OnMessageReceived(Message::IPC const&)
+ ipc/ipc_channel.cc IPC::Channel::ProcessIncomingMessages(void)
+ ipc/ipc_channel.cc IPC::Channel::OnObjectSignaled(void *)
base/message_loop.cc MessageLoop::SignalWatcher(DWORD)
base/message_loop.cc MessageLoop::ProcessNextObject(void)
base/message_loop.cc MessageLoop::Run(Dispatcher::MessageLoop *)
base/message_loop.cc MessageLoop::Run(void)
- chrome/common/ipc_tests.cc RunTestClient
- chrome/common/ipc_tests.cc main
+ ipc/ipc_tests.cc RunTestClient
+ ipc/ipc_tests.cc main
...
Alloc Location
...
@@ -36,47 +36,47 @@ Alloc Location
base/pickle.cc Pickle::BeginWrite(UINT)
base/pickle.cc Pickle::WriteBytes(void const*,int)
base/pickle.cc Pickle::WriteString(basic_string::std const&)
- chrome/common/ipc_tests.cc Send
- chrome/common/ipc_tests.cc MyChannelListener::OnMessageReceived(Message::IPC const&)
- chrome/common/ipc_channel.cc IPC::Channel::ProcessIncomingMessages(void)
- chrome/common/ipc_channel.cc IPC::Channel::OnObjectSignaled(void *)
+ ipc/ipc_tests.cc Send
+ ipc/ipc_tests.cc MyChannelListener::OnMessageReceived(Message::IPC const&)
+ ipc/ipc_channel.cc IPC::Channel::ProcessIncomingMessages(void)
+ ipc/ipc_channel.cc IPC::Channel::OnObjectSignaled(void *)
base/message_loop.cc MessageLoop::SignalWatcher(DWORD)
base/message_loop.cc MessageLoop::ProcessNextObject(void)
base/message_loop.cc MessageLoop::Run(Dispatcher::MessageLoop *)
base/message_loop.cc MessageLoop::Run(void)
- chrome/common/ipc_tests.cc RunTestClient
- chrome/common/ipc_tests.cc main
+ ipc/ipc_tests.cc RunTestClient
+ ipc/ipc_tests.cc main
...
Uninitialized memory read in strlen
Error Location
...
- chrome/common/ipc_tests.cc Send
- chrome/common/ipc_tests.cc MyChannelListener::OnMessageReceived(Message::IPC const&)
- chrome/common/ipc_channel.cc IPC::Channel::ProcessIncomingMessages(void)
- chrome/common/ipc_channel.cc IPC::Channel::OnObjectSignaled(void *)
+ ipc/ipc_tests.cc Send
+ ipc/ipc_tests.cc MyChannelListener::OnMessageReceived(Message::IPC const&)
+ ipc/ipc_channel.cc IPC::Channel::ProcessIncomingMessages(void)
+ ipc/ipc_channel.cc IPC::Channel::OnObjectSignaled(void *)
base/message_loop.cc MessageLoop::SignalWatcher(DWORD)
base/message_loop.cc MessageLoop::Run(Dispatcher::MessageLoop *)
base/message_loop.cc MessageLoop::Run(void)
- chrome/common/ipc_tests.cc RunTestClient
- chrome/common/ipc_tests.cc main
+ ipc/ipc_tests.cc RunTestClient
+ ipc/ipc_tests.cc main
...
Uninitialized memory read in WriteFile
Error Location
...
- chrome/common/ipc_channel.cc IPC::Channel::ProcessOutgoingMessages(void)
- chrome/common/ipc_channel.cc IPC::Channel::OnObjectSignaled(void *)
- chrome/common/ipc_channel.cc IPC::Channel::Send(Message::IPC *)
- chrome/common/ipc_tests.cc Send
- chrome/common/ipc_tests.cc MyChannelListener::OnMessageReceived(Message::IPC const&)
- chrome/common/ipc_channel.cc IPC::Channel::ProcessIncomingMessages(void)
- chrome/common/ipc_channel.cc IPC::Channel::OnObjectSignaled(void *)
+ ipc/ipc_channel.cc IPC::Channel::ProcessOutgoingMessages(void)
+ ipc/ipc_channel.cc IPC::Channel::OnObjectSignaled(void *)
+ ipc/ipc_channel.cc IPC::Channel::Send(Message::IPC *)
+ ipc/ipc_tests.cc Send
+ ipc/ipc_tests.cc MyChannelListener::OnMessageReceived(Message::IPC const&)
+ ipc/ipc_channel.cc IPC::Channel::ProcessIncomingMessages(void)
+ ipc/ipc_channel.cc IPC::Channel::OnObjectSignaled(void *)
base/message_loop.cc MessageLoop::SignalWatcher(DWORD)
base/message_loop.cc MessageLoop::Run(Dispatcher::MessageLoop *)
base/message_loop.cc MessageLoop::Run(void)
- chrome/common/ipc_tests.cc RunTestClient
- chrome/common/ipc_tests.cc main
+ ipc/ipc_tests.cc RunTestClient
+ ipc/ipc_tests.cc main
...
Alloc Location
...
@@ -84,31 +84,31 @@ Alloc Location
base/pickle.cc Pickle::BeginWrite(UINT)
base/pickle.cc Pickle::WriteBytes(void const*,int)
base/pickle.cc Pickle::WriteString(basic_string::std const&)
- chrome/common/ipc_tests.cc Send
- chrome/common/ipc_tests.cc MyChannelListener::OnMessageReceived(Message::IPC const&)
- chrome/common/ipc_channel.cc IPC::Channel::ProcessIncomingMessages(void)
- chrome/common/ipc_channel.cc IPC::Channel::OnObjectSignaled(void *)
+ ipc/ipc_tests.cc Send
+ ipc/ipc_tests.cc MyChannelListener::OnMessageReceived(Message::IPC const&)
+ ipc/ipc_channel.cc IPC::Channel::ProcessIncomingMessages(void)
+ ipc/ipc_channel.cc IPC::Channel::OnObjectSignaled(void *)
base/message_loop.cc MessageLoop::SignalWatcher(DWORD)
base/message_loop.cc MessageLoop::Run(Dispatcher::MessageLoop *)
base/message_loop.cc MessageLoop::Run(void)
- chrome/common/ipc_tests.cc RunTestClient
- chrome/common/ipc_tests.cc main
+ ipc/ipc_tests.cc RunTestClient
+ ipc/ipc_tests.cc main
...
Uninitialized memory read in WriteFile
Error Location
...
- chrome/common/ipc_channel.cc IPC::Channel::ProcessOutgoingMessages(void)
- chrome/common/ipc_channel.cc IPC::Channel::Send(Message::IPC *)
- chrome/common/ipc_tests.cc Send
- chrome/common/ipc_tests.cc MyChannelListener::OnMessageReceived(Message::IPC const&)
- chrome/common/ipc_channel.cc IPC::Channel::ProcessIncomingMessages(void)
- chrome/common/ipc_channel.cc IPC::Channel::OnObjectSignaled(void *)
+ ipc/ipc_channel.cc IPC::Channel::ProcessOutgoingMessages(void)
+ ipc/ipc_channel.cc IPC::Channel::Send(Message::IPC *)
+ ipc/ipc_tests.cc Send
+ ipc/ipc_tests.cc MyChannelListener::OnMessageReceived(Message::IPC const&)
+ ipc/ipc_channel.cc IPC::Channel::ProcessIncomingMessages(void)
+ ipc/ipc_channel.cc IPC::Channel::OnObjectSignaled(void *)
base/message_loop.cc MessageLoop::SignalWatcher(DWORD)
base/message_loop.cc MessageLoop::Run(Dispatcher::MessageLoop *)
base/message_loop.cc MessageLoop::Run(void)
- chrome/common/ipc_tests.cc RunTestClient
- chrome/common/ipc_tests.cc main
+ ipc/ipc_tests.cc RunTestClient
+ ipc/ipc_tests.cc main
...
Alloc Location
...
@@ -116,33 +116,33 @@ Alloc Location
base/pickle.cc Pickle::BeginWrite(UINT)
base/pickle.cc Pickle::WriteBytes(void const*,int)
base/pickle.cc Pickle::WriteString(basic_string::std const&)
- chrome/common/ipc_tests.cc Send
- chrome/common/ipc_tests.cc MyChannelListener::OnMessageReceived(Message::IPC const&)
- chrome/common/ipc_channel.cc IPC::Channel::ProcessIncomingMessages(void)
- chrome/common/ipc_channel.cc IPC::Channel::OnObjectSignaled(void *)
+ ipc/ipc_tests.cc Send
+ ipc/ipc_tests.cc MyChannelListener::OnMessageReceived(Message::IPC const&)
+ ipc/ipc_channel.cc IPC::Channel::ProcessIncomingMessages(void)
+ ipc/ipc_channel.cc IPC::Channel::OnObjectSignaled(void *)
base/message_loop.cc MessageLoop::SignalWatcher(DWORD)
base/message_loop.cc MessageLoop::Run(Dispatcher::MessageLoop *)
base/message_loop.cc MessageLoop::Run(void)
- chrome/common/ipc_tests.cc RunTestClient
- chrome/common/ipc_tests.cc main
+ ipc/ipc_tests.cc RunTestClient
+ ipc/ipc_tests.cc main
...
Uninitialized memory read in strlen
Error Location
...
- chrome/common/ipc_tests.cc Send
- chrome/common/ipc_tests.cc RunTestClient
- chrome/common/ipc_tests.cc main
+ ipc/ipc_tests.cc Send
+ ipc/ipc_tests.cc RunTestClient
+ ipc/ipc_tests.cc main
...
Uninitialized memory read in WriteFile
Error Location
...
- chrome/common/ipc_channel.cc IPC::Channel::ProcessOutgoingMessages(void)
- chrome/common/ipc_channel.cc IPC::Channel::Send(Message::IPC *)
- chrome/common/ipc_tests.cc Send
- chrome/common/ipc_tests.cc RunTestClient
- chrome/common/ipc_tests.cc main
+ ipc/ipc_channel.cc IPC::Channel::ProcessOutgoingMessages(void)
+ ipc/ipc_channel.cc IPC::Channel::Send(Message::IPC *)
+ ipc/ipc_tests.cc Send
+ ipc/ipc_tests.cc RunTestClient
+ ipc/ipc_tests.cc main
...
Alloc Location
...
@@ -150,8 +150,8 @@ Alloc Location
base/pickle.cc Pickle::BeginWrite(UINT)
base/pickle.cc Pickle::WriteBytes(void const*,int)
base/pickle.cc Pickle::WriteString(basic_string::std const&)
- chrome/common/ipc_tests.cc Send
- chrome/common/ipc_tests.cc RunTestClient
- chrome/common/ipc_tests.cc main
+ ipc/ipc_tests.cc Send
+ ipc/ipc_tests.cc RunTestClient
+ ipc/ipc_tests.cc main
...
diff --git a/chrome/test/unit/unittests.vcproj b/chrome/test/unit/unittests.vcproj
index 46f501b..508470d 100644
--- a/chrome/test/unit/unittests.vcproj
+++ b/chrome/test/unit/unittests.vcproj
@@ -884,26 +884,6 @@
>
</File>
<File
- RelativePath="..\..\common\ipc_message_unittest.cc"
- >
- </File>
- <File
- RelativePath="..\..\common\ipc_sync_channel_unittest.cc"
- >
- </File>
- <File
- RelativePath="..\..\common\ipc_sync_channel_unittest.h"
- >
- </File>
- <File
- RelativePath="..\..\common\ipc_sync_message_unittest.cc"
- >
- </File>
- <File
- RelativePath="..\..\common\ipc_sync_message_unittest.h"
- >
- </File>
- <File
RelativePath="..\..\common\json_value_serializer_unittest.cc"
>
</File>
diff --git a/chrome/worker/webworkerclient_proxy.cc b/chrome/worker/webworkerclient_proxy.cc
index 33bcbc8..da489a2 100644
--- a/chrome/worker/webworkerclient_proxy.cc
+++ b/chrome/worker/webworkerclient_proxy.cc
@@ -5,7 +5,7 @@
#include "chrome/worker/webworkerclient_proxy.h"
#include "chrome/common/child_process.h"
-#include "chrome/common/ipc_logging.h"
+#include "ipc/ipc_logging.h"
#include "chrome/common/worker_messages.h"
#include "chrome/worker/worker_thread.h"
#include "webkit/glue/webworker.h"
diff --git a/chrome/worker/webworkerclient_proxy.h b/chrome/worker/webworkerclient_proxy.h
index 31ee56d..5845d0b 100644
--- a/chrome/worker/webworkerclient_proxy.h
+++ b/chrome/worker/webworkerclient_proxy.h
@@ -7,7 +7,7 @@
#include "base/basictypes.h"
#include "base/ref_counted.h"
-#include "chrome/common/ipc_channel.h"
+#include "ipc/ipc_channel.h"
#include "googleurl/src/gurl.h"
#include "webkit/glue/webworkerclient.h"
diff --git a/chrome/common/file_descriptor_set_posix.cc b/ipc/file_descriptor_set_posix.cc
index b57c007..3b04553 100644
--- a/chrome/common/file_descriptor_set_posix.cc
+++ b/ipc/file_descriptor_set_posix.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/common/file_descriptor_set_posix.h"
+#include "ipc/file_descriptor_set_posix.h"
#include "base/logging.h"
diff --git a/chrome/common/file_descriptor_set_posix.h b/ipc/file_descriptor_set_posix.h
index 342e6d9..c3d26ba8 100644
--- a/chrome/common/file_descriptor_set_posix.h
+++ b/ipc/file_descriptor_set_posix.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_COMMON_FILE_DESCRIPTOR_SET_POSIX_H_
-#define CHROME_COMMON_FILE_DESCRIPTOR_SET_POSIX_H_
+#ifndef IPC_FILE_DESCRIPTOR_SET_POSIX_H_
+#define IPC_FILE_DESCRIPTOR_SET_POSIX_H_
#include <vector>
@@ -105,4 +105,4 @@ class FileDescriptorSet : public base::RefCountedThreadSafe<FileDescriptorSet> {
DISALLOW_COPY_AND_ASSIGN(FileDescriptorSet);
};
-#endif // CHROME_COMMON_FILE_DESCRIPTOR_SET_POSIX_H_
+#endif // IPC_FILE_DESCRIPTOR_SET_POSIX_H_
diff --git a/chrome/common/file_descriptor_set_unittest.cc b/ipc/file_descriptor_set_unittest.cc
index 89144a5..0d158b2 100644
--- a/chrome/common/file_descriptor_set_unittest.cc
+++ b/ipc/file_descriptor_set_unittest.cc
@@ -8,7 +8,7 @@
#include <fcntl.h>
#include "base/basictypes.h"
-#include "chrome/common/file_descriptor_set_posix.h"
+#include "ipc/file_descriptor_set_posix.h"
#include "testing/gtest/include/gtest/gtest.h"
// The FileDescriptorSet will try and close some of the descriptor numbers
diff --git a/ipc/ipc.gyp b/ipc/ipc.gyp
new file mode 100644
index 0000000..a2c1adc
--- /dev/null
+++ b/ipc/ipc.gyp
@@ -0,0 +1,82 @@
+# Copyright (c) 2009 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.
+
+{
+ 'variables': {
+ 'chromium_code': 1,
+ },
+ 'includes': [
+ '../build/common.gypi',
+ ],
+
+ 'targets': [
+ {
+ 'target_name': 'ipc',
+ 'type': 'static_library',
+ 'dependencies': [
+ '../base/base.gyp:base',
+ '../base/base.gyp:base_gfx',
+ ],
+ 'sources': [
+ 'ipc_channel.h',
+ 'ipc_channel_proxy.cc',
+ 'ipc_channel_proxy.h',
+ 'ipc_counters.cc',
+ 'ipc_logging.cc',
+ 'ipc_logging.h',
+ 'ipc_message.cc',
+ 'ipc_message.h',
+ 'ipc_message_macros.h',
+ 'ipc_message_utils.cc',
+ 'ipc_message_utils.h',
+ 'ipc_sync_channel.cc',
+ 'ipc_sync_channel.h',
+ 'ipc_sync_message.cc',
+ 'ipc_sync_message.h',
+ 'ipc_switches.cc',
+ ],
+
+ 'conditions': [
+ ['OS=="linux"', {'sources': [
+ 'ipc_channel_posix.cc',
+ 'ipc_channel_posix.h',
+ 'file_descriptor_set_posix.cc',
+ ]}],
+ ['OS=="mac"', {'sources': [
+ 'ipc_channel_posix.cc',
+ 'ipc_channel_posix.h',
+ ]}],
+ ['OS=="win"', {'sources': [
+ 'ipc_channel_win.cc',
+ 'ipc_channel_win.h',
+ ]}],
+ ],
+ },
+ {
+ 'target_name': 'ipc_tests',
+ 'type': 'executable',
+ 'dependencies': [
+ 'ipc',
+ '../base/base.gyp:base',
+ '../testing/gtest.gyp:gtest',
+ ],
+ 'sources': [
+ 'ipc_fuzzing_tests.cc',
+ 'ipc_sync_channel_unittest.cc',
+ 'ipc_sync_message_unittest.cc',
+ 'ipc_sync_message_unittest.h',
+ 'ipc_tests.cc',
+ 'ipc_tests.h',
+ ],
+ 'conditions': [
+ ['OS=="linux"', {'sources': [
+ 'ipc_send_fds_test.cc',
+ ]}],
+ ['OS=="mac"', {'sources': [
+ 'ipc_send_fds_test.cc',
+ ]}],
+ ],
+ },
+ ],
+}
diff --git a/chrome/common/ipc_channel.h b/ipc/ipc_channel.h
index 9b7f8b2..1ecffdf 100644
--- a/chrome/common/ipc_channel.h
+++ b/ipc/ipc_channel.h
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_COMMON_IPC_CHANNEL_H_
-#define CHROME_COMMON_IPC_CHANNEL_H_
+#ifndef IPC_IPC_CHANNEL_H_
+#define IPC_IPC_CHANNEL_H_
-#include "chrome/common/ipc_message.h"
+#include "ipc/ipc_message.h"
namespace IPC {
@@ -120,4 +120,4 @@ class Channel : public Message::Sender {
} // namespace IPC
-#endif // CHROME_COMMON_IPC_CHANNEL_H_
+#endif // IPC_IPC_CHANNEL_H_
diff --git a/chrome/common/ipc_channel_posix.cc b/ipc/ipc_channel_posix.cc
index 23c008a..96209a0 100644
--- a/chrome/common/ipc_channel_posix.cc
+++ b/ipc/ipc_channel_posix.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/common/ipc_channel_posix.h"
+#include "ipc/ipc_channel_posix.h"
#include <errno.h>
#include <fcntl.h>
@@ -22,11 +22,11 @@
#include "base/scoped_ptr.h"
#include "base/string_util.h"
#include "base/singleton.h"
-#include "chrome/common/chrome_counters.h"
-#include "chrome/common/chrome_switches.h"
-#include "chrome/common/file_descriptor_set_posix.h"
-#include "chrome/common/ipc_logging.h"
-#include "chrome/common/ipc_message_utils.h"
+#include "ipc/ipc_counters.h"
+#include "ipc/ipc_switches.h"
+#include "ipc/file_descriptor_set_posix.h"
+#include "ipc/ipc_logging.h"
+#include "ipc/ipc_message_utils.h"
namespace IPC {
@@ -634,7 +634,7 @@ bool Channel::ChannelImpl::ProcessOutgoingMessages() {
}
bool Channel::ChannelImpl::Send(Message* message) {
- chrome::Counters::ipc_send_counter().Increment();
+ Counters::ipc_send_counter().Increment();
#ifdef IPC_MESSAGE_DEBUG_EXTRA
DLOG(INFO) << "sending message @" << message << " on channel @" << this
<< " with type " << message->type()
diff --git a/chrome/common/ipc_channel_posix.h b/ipc/ipc_channel_posix.h
index fbdd59b..53fba1b9 100644
--- a/chrome/common/ipc_channel_posix.h
+++ b/ipc/ipc_channel_posix.h
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_COMMON_IPC_CHANNEL_POSIX_H_
-#define CHROME_COMMON_IPC_CHANNEL_POSIX_H_
+#ifndef IPC_IPC_CHANNEL_POSIX_H_
+#define IPC_IPC_CHANNEL_POSIX_H_
-#include "chrome/common/ipc_channel.h"
+#include "ipc/ipc_channel.h"
#include <sys/socket.h> // for CMSG macros
@@ -14,7 +14,7 @@
#include <vector>
#include "base/message_loop.h"
-#include "chrome/common/file_descriptor_set_posix.h"
+#include "ipc/file_descriptor_set_posix.h"
namespace IPC {
@@ -109,4 +109,4 @@ class Channel::ChannelImpl : public MessageLoopForIO::Watcher {
} // namespace IPC
-#endif // CHROME_COMMON_IPC_CHANNEL_POSIX_H_
+#endif // IPC_IPC_CHANNEL_POSIX_H_
diff --git a/chrome/common/ipc_channel_proxy.cc b/ipc/ipc_channel_proxy.cc
index a9def01..a07c677 100644
--- a/chrome/common/ipc_channel_proxy.cc
+++ b/ipc/ipc_channel_proxy.cc
@@ -4,9 +4,9 @@
#include "base/message_loop.h"
#include "base/thread.h"
-#include "chrome/common/ipc_channel_proxy.h"
-#include "chrome/common/ipc_logging.h"
-#include "chrome/common/ipc_message_utils.h"
+#include "ipc/ipc_channel_proxy.h"
+#include "ipc/ipc_logging.h"
+#include "ipc/ipc_message_utils.h"
namespace IPC {
diff --git a/chrome/common/ipc_channel_proxy.h b/ipc/ipc_channel_proxy.h
index 80a9807..7f78a7e 100644
--- a/chrome/common/ipc_channel_proxy.h
+++ b/ipc/ipc_channel_proxy.h
@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_COMMON_IPC_CHANNEL_PROXY_H__
-#define CHROME_COMMON_IPC_CHANNEL_PROXY_H__
+#ifndef IPC_IPC_CHANNEL_PROXY_H__
+#define IPC_IPC_CHANNEL_PROXY_H__
#include <vector>
#include "base/lock.h"
#include "base/ref_counted.h"
-#include "chrome/common/ipc_channel.h"
+#include "ipc/ipc_channel.h"
class MessageLoop;
@@ -203,4 +203,4 @@ class ChannelProxy : public Message::Sender {
} // namespace IPC
-#endif // CHROME_COMMON_IPC_CHANNEL_PROXY_H__
+#endif // IPC_IPC_CHANNEL_PROXY_H__
diff --git a/chrome/common/ipc_channel_win.cc b/ipc/ipc_channel_win.cc
index 38e442a..950b140 100644
--- a/chrome/common/ipc_channel_win.cc
+++ b/ipc/ipc_channel_win.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/common/ipc_channel_win.h"
+#include "ipc/ipc_channel_win.h"
#include <windows.h>
#include <sstream>
@@ -11,9 +11,9 @@
#include "base/logging.h"
#include "base/non_thread_safe.h"
#include "base/win_util.h"
-#include "chrome/common/chrome_counters.h"
-#include "chrome/common/ipc_logging.h"
-#include "chrome/common/ipc_message_utils.h"
+#include "ipc/ipc_counters.h"
+#include "ipc/ipc_logging.h"
+#include "ipc/ipc_message_utils.h"
namespace IPC {
//------------------------------------------------------------------------------
@@ -83,7 +83,7 @@ void Channel::ChannelImpl::Close() {
bool Channel::ChannelImpl::Send(Message* message) {
DCHECK(thread_check_->CalledOnValidThread());
- chrome::Counters::ipc_send_counter().Increment();
+ Counters::ipc_send_counter().Increment();
#ifdef IPC_MESSAGE_DEBUG_EXTRA
DLOG(INFO) << "sending message @" << message << " on channel @" << this
<< " with type " << message->type()
diff --git a/chrome/common/ipc_channel_win.h b/ipc/ipc_channel_win.h
index 2a601e1..998b7f8 100644
--- a/chrome/common/ipc_channel_win.h
+++ b/ipc/ipc_channel_win.h
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_COMMON_IPC_CHANNEL_WIN_H_
-#define CHROME_COMMON_IPC_CHANNEL_WIN_H_
+#ifndef IPC_IPC_CHANNEL_WIN_H_
+#define IPC_IPC_CHANNEL_WIN_H_
-#include "chrome/common/ipc_channel.h"
+#include "ipc/ipc_channel.h"
#include <queue>
#include <string>
@@ -82,4 +82,4 @@ class Channel::ChannelImpl : public MessageLoopForIO::IOHandler {
} // namespace IPC
-#endif // CHROME_COMMON_IPC_CHANNEL_WIN_H_
+#endif // IPC_IPC_CHANNEL_WIN_H_
diff --git a/ipc/ipc_counters.cc b/ipc/ipc_counters.cc
new file mode 100644
index 0000000..29bf3b5
--- /dev/null
+++ b/ipc/ipc_counters.cc
@@ -0,0 +1,27 @@
+// Copyright (c) 2009 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 "ipc/ipc_counters.h"
+
+#include "base/stats_counters.h"
+
+namespace IPC {
+
+// Note: We use the construct-on-first-use pattern here, because we don't
+// want to fight with any static initializer ordering problems later.
+// The downside of this is that the objects don't ever get cleaned up.
+// But they are small and this is okay.
+
+// Note: Because these are constructed on-first-use, there is a slight
+// race condition - two threads could initialize the same counter.
+// If this happened, the stats table would still work just fine;
+// we'd leak the extraneous StatsCounter object once, and that
+// would be it. But these are small objects, so this is ok.
+
+StatsCounter& Counters::ipc_send_counter() {
+ static StatsCounter* ctr = new StatsCounter("IPC.SendMsgCount");
+ return *ctr;
+}
+
+} // namespace IPC
diff --git a/ipc/ipc_counters.h b/ipc/ipc_counters.h
new file mode 100644
index 0000000..647632a
--- /dev/null
+++ b/ipc/ipc_counters.h
@@ -0,0 +1,22 @@
+// Copyright (c) 2009 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.
+
+// Counters used within the browser.
+
+#ifndef IPC_COMMON_IPC_COUNTERS_H_
+#define IPC_COMMON_IPC_COUNTERS_H_
+
+class StatsCounter;
+
+namespace IPC {
+
+class Counters {
+ public:
+ // The number of messages sent on IPC channels.
+ static StatsCounter& ipc_send_counter();
+};
+
+} // namespace IPC
+
+#endif // IPC_COMMON_IPC_COUNTERS_H_
diff --git a/chrome/common/ipc_fuzzing_tests.cc b/ipc/ipc_fuzzing_tests.cc
index 8148723..6b4f899 100644
--- a/chrome/common/ipc_fuzzing_tests.cc
+++ b/ipc/ipc_fuzzing_tests.cc
@@ -10,10 +10,10 @@
#include "base/message_loop.h"
#include "base/platform_thread.h"
#include "base/process_util.h"
-#include "chrome/common/ipc_channel.h"
-#include "chrome/common/ipc_channel_proxy.h"
-#include "chrome/common/ipc_message_utils.h"
-#include "chrome/common/ipc_tests.h"
+#include "ipc/ipc_channel.h"
+#include "ipc/ipc_channel_proxy.h"
+#include "ipc/ipc_message_utils.h"
+#include "ipc/ipc_tests.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/multiprocess_func_list.h"
@@ -98,8 +98,13 @@ TEST(IPCMessageIntegrity, ReadVectorTooLarge2) {
// We don't actually use the messages defined in this file, but we do this
// to get to the IPC macros.
-#define MESSAGES_INTERNAL_FILE "chrome/common/ipc_sync_message_unittest.h"
-#include "chrome/common/ipc_message_macros.h"
+#if 0
+// This for tools which parse #include lines, but cannot process when we
+// include via a macro name.
+#include "ipc/ipc_sync_message_unittest.h"
+#endif
+#define MESSAGES_INTERNAL_FILE "ipc/ipc_sync_message_unittest.h"
+#include "ipc/ipc_message_macros.h"
enum IPCMessageIds {
UNUSED_IPC_TYPE,
diff --git a/chrome/common/ipc_logging.cc b/ipc/ipc_logging.cc
index cb63533..baa9cc30f 100644
--- a/chrome/common/ipc_logging.cc
+++ b/ipc/ipc_logging.cc
@@ -2,14 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/common/ipc_logging.h"
-
-#if defined(OS_POSIX)
-#ifdef IPC_MESSAGE_LOG_ENABLED
-// This will cause render_messages.h etc to define ViewMsgLog and friends.
-#define IPC_MESSAGE_MACROS_LOG_ENABLED
-#endif
-#endif
+#include "ipc/ipc_logging.h"
#include "base/command_line.h"
#include "base/logging.h"
@@ -19,21 +12,9 @@
#include "base/time.h"
#include "base/waitable_event.h"
#include "base/waitable_event_watcher.h"
-#include "chrome/common/chrome_switches.h"
-#include "chrome/common/ipc_sync_message.h"
-#include "chrome/common/ipc_message_utils.h"
-
-// This include list should contain all _messages.h header files so that they
-// can get *MsgLog function etc. This makes ipc logs much more informative.
-#include "chrome/common/render_messages.h"
-#include "chrome/test/automation/automation_messages.h"
-
-#if defined(OS_WIN)
-// Pulling this file in Mac/Linux causes a lot of binaries to need to bring in
-// WebKit and all the dependencies, which results in a very large number of
-// linker errors.
-#include "chrome/common/plugin_messages.h"
-#endif
+#include "ipc/ipc_sync_message.h"
+#include "ipc/ipc_switches.h"
+#include "ipc/ipc_message_utils.h"
#if defined(OS_POSIX)
#include "base/string_util.h"
@@ -101,7 +82,6 @@ Logging::Logging()
#elif defined(OS_POSIX)
if (getenv("CHROME_IPC_LOGGING"))
enabled_ = true;
- SetLoggerFunctions(g_log_function_mapping);
#endif
MessageLoop::current()->AddDestructionObserver(this);
@@ -129,6 +109,7 @@ void Logging::WillDestroyCurrentMessageLoop() {
watcher_.StopWatching();
}
+// static
void Logging::SetLoggerFunctions(LogFunction *functions) {
log_function_mapping_ = functions;
}
@@ -315,6 +296,6 @@ void GenerateLogData(const std::wstring& channel, const Message& message,
}
}
-}
+} // namespace IPC
#endif // IPC_MESSAGE_LOG_ENABLED
diff --git a/chrome/common/ipc_logging.h b/ipc/ipc_logging.h
index cfdcf21..4d8f81d4d 100644
--- a/chrome/common/ipc_logging.h
+++ b/ipc/ipc_logging.h
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_COMMON_IPC_LOGGING_H_
-#define CHROME_COMMON_IPC_LOGGING_H_
+#ifndef IPC_IPC_LOGGING_H_
+#define IPC_IPC_LOGGING_H_
-#include "chrome/common/ipc_message.h" // For IPC_MESSAGE_LOG_ENABLED.
+#include "ipc/ipc_message.h" // For IPC_MESSAGE_LOG_ENABLED.
#ifdef IPC_MESSAGE_LOG_ENABLED
@@ -13,7 +13,7 @@
#include "base/message_loop.h"
#include "base/singleton.h"
#include "base/waitable_event_watcher.h"
-#include "chrome/common/ipc_message_utils.h"
+#include "ipc/ipc_message_utils.h"
class MessageLoop;
@@ -73,9 +73,9 @@ class Logging : public base::WaitableEventWatcher::Delegate,
void WillDestroyCurrentMessageLoop();
typedef void (*LogFunction)(uint16 type,
- std::wstring* name,
- const Message* msg,
- std::wstring* params);
+ std::wstring* name,
+ const Message* msg,
+ std::wstring* params);
static void SetLoggerFunctions(LogFunction *functions);
@@ -110,4 +110,4 @@ class Logging : public base::WaitableEventWatcher::Delegate,
#endif // IPC_MESSAGE_LOG_ENABLED
-#endif // CHROME_COMMON_IPC_LOGGING_H_
+#endif // IPC_IPC_LOGGING_H_
diff --git a/chrome/common/ipc_message.cc b/ipc/ipc_message.cc
index d7cc49d..7a2b5cd 100644
--- a/chrome/common/ipc_message.cc
+++ b/ipc/ipc_message.cc
@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/common/ipc_message.h"
+#include "ipc/ipc_message.h"
#include "base/logging.h"
#include "build/build_config.h"
#if defined(OS_POSIX)
-#include "chrome/common/file_descriptor_set_posix.h"
+#include "ipc/file_descriptor_set_posix.h"
#endif
namespace IPC {
diff --git a/chrome/common/ipc_message.h b/ipc/ipc_message.h
index af4a0df..6357c0b 100644
--- a/chrome/common/ipc_message.h
+++ b/ipc/ipc_message.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_COMMON_IPC_MESSAGE_H__
-#define CHROME_COMMON_IPC_MESSAGE_H__
+#ifndef IPC_IPC_MESSAGE_H__
+#define IPC_IPC_MESSAGE_H__
#include <string>
@@ -276,4 +276,4 @@ enum SpecialRoutingIDs {
#define IPC_REPLY_ID 0xFFF0 // Special message id for replies
#define IPC_LOGGING_ID 0xFFF1 // Special message id for logging
-#endif // CHROME_COMMON_IPC_MESSAGE_H__
+#endif // IPC_IPC_MESSAGE_H__
diff --git a/chrome/common/ipc_message_macros.h b/ipc/ipc_message_macros.h
index 7cba911..8bddb7f 100644
--- a/chrome/common/ipc_message_macros.h
+++ b/ipc/ipc_message_macros.h
@@ -40,24 +40,12 @@
// ViewHostMsg_SyncMessageName::WriteReplyParams(reply_msg, out1, out2);
// Send(reply_msg);
-#include "chrome/common/ipc_message_utils.h"
-
+#include "ipc/ipc_message_utils.h"
#ifndef MESSAGES_INTERNAL_FILE
#error This file should only be included by X_messages.h, which needs to define MESSAGES_INTERNAL_FILE first.
#endif
-// Trick scons and xcode into seeing the possible real dependencies since they
-// don't understand #include MESSAGES_INTERNAL_FILE. See http://crbug.com/7828
-#if 0
-#include "chrome/common/ipc_sync_message_unittest.h"
-#include "chrome/common/plugin_messages_internal.h"
-#include "chrome/common/render_messages_internal.h"
-#include "chrome/renderer/devtools_messages_internal.h"
-#include "chrome/test/automation/automation_messages_internal.h"
-#include "chrome/common/worker_messages_internal.h"
-#endif
-
#ifndef IPC_MESSAGE_MACROS_INCLUDE_BLOCK
#define IPC_MESSAGE_MACROS_INCLUDE_BLOCK
diff --git a/ipc/ipc_message_utils.cc b/ipc/ipc_message_utils.cc
new file mode 100644
index 0000000..2ee7025
--- /dev/null
+++ b/ipc/ipc_message_utils.cc
@@ -0,0 +1,76 @@
+// Copyright (c) 2006-2008 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 "ipc/ipc_message_utils.h"
+
+#include "base/gfx/rect.h"
+
+namespace IPC {
+
+void ParamTraits<gfx::Point>::Write(Message* m, const gfx::Point& p) {
+ m->WriteInt(p.x());
+ m->WriteInt(p.y());
+}
+
+bool ParamTraits<gfx::Point>::Read(const Message* m, void** iter,
+ gfx::Point* r) {
+ int x, y;
+ if (!m->ReadInt(iter, &x) ||
+ !m->ReadInt(iter, &y))
+ return false;
+ r->set_x(x);
+ r->set_y(y);
+ return true;
+}
+
+void ParamTraits<gfx::Point>::Log(const gfx::Point& p, std::wstring* l) {
+ l->append(StringPrintf(L"(%d, %d)", p.x(), p.y()));
+}
+
+void ParamTraits<gfx::Rect>::Write(Message* m, const gfx::Rect& p) {
+ m->WriteInt(p.x());
+ m->WriteInt(p.y());
+ m->WriteInt(p.width());
+ m->WriteInt(p.height());
+}
+
+bool ParamTraits<gfx::Rect>::Read(const Message* m, void** iter, gfx::Rect* r) {
+ int x, y, w, h;
+ if (!m->ReadInt(iter, &x) ||
+ !m->ReadInt(iter, &y) ||
+ !m->ReadInt(iter, &w) ||
+ !m->ReadInt(iter, &h))
+ return false;
+ r->set_x(x);
+ r->set_y(y);
+ r->set_width(w);
+ r->set_height(h);
+ return true;
+}
+
+void ParamTraits<gfx::Rect>::Log(const gfx::Rect& p, std::wstring* l) {
+ l->append(StringPrintf(L"(%d, %d, %d, %d)", p.x(), p.y(),
+ p.width(), p.height()));
+}
+
+void ParamTraits<gfx::Size>::Write(Message* m, const gfx::Size& p) {
+ m->WriteInt(p.width());
+ m->WriteInt(p.height());
+}
+
+bool ParamTraits<gfx::Size>::Read(const Message* m, void** iter, gfx::Size* r) {
+ int w, h;
+ if (!m->ReadInt(iter, &w) ||
+ !m->ReadInt(iter, &h))
+ return false;
+ r->set_width(w);
+ r->set_height(h);
+ return true;
+}
+
+void ParamTraits<gfx::Size>::Log(const gfx::Size& p, std::wstring* l) {
+ l->append(StringPrintf(L"(%d, %d)", p.width(), p.height()));
+}
+
+} // namespace IPC
diff --git a/chrome/common/ipc_message_utils.h b/ipc/ipc_message_utils.h
index 6e82d40..582b491 100644
--- a/chrome/common/ipc_message_utils.h
+++ b/ipc/ipc_message_utils.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_COMMON_IPC_MESSAGE_UTILS_H_
-#define CHROME_COMMON_IPC_MESSAGE_UTILS_H_
+#ifndef IPC_IPC_MESSAGE_UTILS_H_
+#define IPC_IPC_MESSAGE_UTILS_H_
#include <string>
#include <vector>
@@ -12,30 +12,20 @@
#include "base/file_path.h"
#include "base/string_util.h"
#include "base/string16.h"
+#include "base/time.h"
#include "base/tuple.h"
#if defined(OS_POSIX)
-#include "chrome/common/file_descriptor_set_posix.h"
+#include "ipc/file_descriptor_set_posix.h"
#endif
-#include "chrome/common/ipc_sync_message.h"
-#include "chrome/common/thumbnail_score.h"
-#include "chrome/common/transport_dib.h"
-#include "webkit/glue/webcursor.h"
-#include "webkit/glue/window_open_disposition.h"
+#include "ipc/ipc_sync_message.h"
// Forward declarations.
-class GURL;
-class SkBitmap;
-
namespace gfx {
class Point;
class Rect;
class Size;
} // namespace gfx
-namespace webkit_glue {
-struct WebApplicationInfo;
-} // namespace webkit_glue
-
// Used by IPC_BEGIN_MESSAGES so that each message class starts from a unique
// base. Messages have unique IDs across channels in order for the IPC logging
// code to figure out the message class from its ID.
@@ -346,18 +336,6 @@ struct ParamTraits<MSG> {
#endif // defined(OS_WIN)
template <>
-struct ParamTraits<SkBitmap> {
- typedef SkBitmap param_type;
- static void Write(Message* m, const param_type& p);
-
- // Note: This function expects parameter |r| to be of type &SkBitmap since
- // r->SetConfig() and r->SetPixels() are called.
- static bool Read(const Message* m, void** iter, param_type* r);
-
- static void Log(const param_type& p, std::wstring* l);
-};
-
-template <>
struct ParamTraits<std::string> {
typedef std::string param_type;
static void Write(Message* m, const param_type& p) {
@@ -526,14 +504,6 @@ struct ParamTraits<string16> {
};
#endif
-template <>
-struct ParamTraits<GURL> {
- typedef GURL param_type;
- static void Write(Message* m, const param_type& p);
- static bool Read(const Message* m, void** iter, param_type* p);
- static void Log(const param_type& p, std::wstring* l);
-};
-
// and, a few more useful types...
#if defined(OS_WIN)
template <>
@@ -740,54 +710,6 @@ struct ParamTraits<base::FileDescriptor> {
};
#endif // defined(OS_POSIX)
-template<>
-struct ParamTraits<ThumbnailScore> {
- typedef ThumbnailScore param_type;
- static void Write(Message* m, const param_type& p) {
- IPC::ParamTraits<double>::Write(m, p.boring_score);
- IPC::ParamTraits<bool>::Write(m, p.good_clipping);
- IPC::ParamTraits<bool>::Write(m, p.at_top);
- IPC::ParamTraits<base::Time>::Write(m, p.time_at_snapshot);
- }
- static bool Read(const Message* m, void** iter, param_type* r) {
- double boring_score;
- bool good_clipping, at_top;
- base::Time time_at_snapshot;
- if (!IPC::ParamTraits<double>::Read(m, iter, &boring_score) ||
- !IPC::ParamTraits<bool>::Read(m, iter, &good_clipping) ||
- !IPC::ParamTraits<bool>::Read(m, iter, &at_top) ||
- !IPC::ParamTraits<base::Time>::Read(m, iter, &time_at_snapshot))
- return false;
-
- r->boring_score = boring_score;
- r->good_clipping = good_clipping;
- r->at_top = at_top;
- r->time_at_snapshot = time_at_snapshot;
- return true;
- }
- static void Log(const param_type& p, std::wstring* l) {
- l->append(StringPrintf(L"(%f, %d, %d)",
- p.boring_score, p.good_clipping, p.at_top));
- }
-};
-
-template <>
-struct ParamTraits<WindowOpenDisposition> {
- typedef WindowOpenDisposition param_type;
- static void Write(Message* m, const param_type& p) {
- m->WriteInt(p);
- }
- static bool Read(const Message* m, void** iter, param_type* r) {
- int temp;
- bool res = m->ReadInt(iter, &temp);
- *r = static_cast<WindowOpenDisposition>(temp);
- return res;
- }
- static void Log(const param_type& p, std::wstring* l) {
- l->append(StringPrintf(L"%d", p));
- }
-};
-
#if defined(OS_WIN)
template <>
struct ParamTraits<XFORM> {
@@ -814,20 +736,6 @@ struct ParamTraits<XFORM> {
};
#endif // defined(OS_WIN)
-template <>
-struct ParamTraits<WebCursor> {
- typedef WebCursor param_type;
- static void Write(Message* m, const param_type& p) {
- p.Serialize(m);
- }
- static bool Read(const Message* m, void** iter, param_type* r) {
- return r->Deserialize(m, iter);
- }
- static void Log(const param_type& p, std::wstring* l) {
- l->append(L"<WebCursor>");
- }
-};
-
struct LogData {
std::wstring channel;
uint16 type;
@@ -873,37 +781,6 @@ struct ParamTraits<LogData> {
template <>
-struct ParamTraits<webkit_glue::WebApplicationInfo> {
- typedef webkit_glue::WebApplicationInfo param_type;
- static void Write(Message* m, const param_type& p);
- static bool Read(const Message* m, void** iter, param_type* r);
- static void Log(const param_type& p, std::wstring* l);
-};
-
-
-#if defined(OS_WIN)
-template<>
-struct ParamTraits<TransportDIB::Id> {
- typedef TransportDIB::Id param_type;
- static void Write(Message* m, const param_type& p) {
- WriteParam(m, p.handle);
- WriteParam(m, p.sequence_num);
- }
- static bool Read(const Message* m, void** iter, param_type* r) {
- return (ReadParam(m, iter, &r->handle) &&
- ReadParam(m, iter, &r->sequence_num));
- }
- static void Log(const param_type& p, std::wstring* l) {
- l->append(L"TransportDIB(");
- LogParam(p.handle, l);
- l->append(L", ");
- LogParam(p.sequence_num, l);
- l->append(L")");
- }
-};
-#endif
-
-template <>
struct ParamTraits<Message> {
static void Write(Message* m, const Message& p) {
m->WriteInt(p.size());
@@ -1378,4 +1255,4 @@ class MessageWithReply : public SyncMessage {
} // namespace IPC
-#endif // CHROME_COMMON_IPC_MESSAGE_UTILS_H_
+#endif // IPC_IPC_MESSAGE_UTILS_H_
diff --git a/chrome/common/ipc_send_fds_test.cc b/ipc/ipc_send_fds_test.cc
index 747892d..ff32afc 100644
--- a/chrome/common/ipc_send_fds_test.cc
+++ b/ipc/ipc_send_fds_test.cc
@@ -4,7 +4,7 @@
#include "build/build_config.h"
-#include "chrome/common/ipc_tests.h"
+#include "ipc/ipc_tests.h"
#if defined(OS_MACOSX)
extern "C" {
@@ -15,8 +15,8 @@ extern "C" {
#include <sys/stat.h>
#include "base/message_loop.h"
-#include "chrome/common/ipc_channel.h"
-#include "chrome/common/ipc_message_utils.h"
+#include "ipc/ipc_channel.h"
+#include "ipc/ipc_message_utils.h"
#if defined(OS_POSIX)
diff --git a/ipc/ipc_switches.cc b/ipc/ipc_switches.cc
new file mode 100644
index 0000000..9d45f7b
--- /dev/null
+++ b/ipc/ipc_switches.cc
@@ -0,0 +1,17 @@
+// Copyright (c) 2009 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 "ipc/ipc_switches.h"
+
+namespace switches {
+
+// On POSIX only: use FIFO for IPC channels so that "unrelated" process
+// can connect to a channel, provided it knows its name. For debugging purposes.
+const wchar_t kIPCUseFIFO[] = L"ipc-use-fifo";
+
+// The value of this switch tells the child process which
+// IPC channel the browser expects to use to communicate with it.
+const wchar_t kProcessChannelID[] = L"channel";
+
+} // namespace switches
diff --git a/ipc/ipc_switches.h b/ipc/ipc_switches.h
new file mode 100644
index 0000000..7dbc746
--- /dev/null
+++ b/ipc/ipc_switches.h
@@ -0,0 +1,19 @@
+// Copyright (c) 2009 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.
+
+// Defines command line switches used by the IPC system
+
+#ifndef IPC_IPC_SWITCHES_H__
+#define IPC_IPC_SWITCHES_H__
+
+#include "base/base_switches.h"
+
+namespace switches {
+
+extern const wchar_t kIPCUseFIFO[];
+extern const wchar_t kProcessChannelID[];
+
+} // namespace switches
+
+#endif // IPC_IPC_SWITCHES_H__
diff --git a/chrome/common/ipc_sync_channel.cc b/ipc/ipc_sync_channel.cc
index 842678c..137d9fa 100644
--- a/chrome/common/ipc_sync_channel.cc
+++ b/ipc/ipc_sync_channel.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/common/ipc_sync_channel.h"
+#include "ipc/ipc_sync_channel.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
@@ -10,7 +10,7 @@
#include "base/message_loop.h"
#include "base/waitable_event.h"
#include "base/waitable_event_watcher.h"
-#include "chrome/common/ipc_sync_message.h"
+#include "ipc/ipc_sync_message.h"
using base::TimeDelta;
using base::TimeTicks;
diff --git a/chrome/common/ipc_sync_channel.h b/ipc/ipc_sync_channel.h
index 1b192f6..d802d91 100644
--- a/chrome/common/ipc_sync_channel.h
+++ b/ipc/ipc_sync_channel.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_COMMON_IPC_SYNC_SENDER_H__
-#define CHROME_COMMON_IPC_SYNC_SENDER_H__
+#ifndef COMMON_IPC_SYNC_SENDER_H__
+#define COMMON_IPC_SYNC_SENDER_H__
#include <string>
#include <deque>
@@ -13,7 +13,7 @@
#include "base/scoped_handle.h"
#include "base/waitable_event.h"
#include "base/waitable_event_watcher.h"
-#include "chrome/common/ipc_channel_proxy.h"
+#include "ipc/ipc_channel_proxy.h"
namespace IPC {
@@ -156,4 +156,4 @@ class SyncChannel : public ChannelProxy,
} // namespace IPC
-#endif // CHROME_COMMON_IPC_SYNC_SENDER_H__
+#endif // COMMON_IPC_SYNC_SENDER_H__
diff --git a/chrome/common/ipc_sync_channel_unittest.cc b/ipc/ipc_sync_channel_unittest.cc
index 6e00fca..056a084 100644
--- a/chrome/common/ipc_sync_channel_unittest.cc
+++ b/ipc/ipc_sync_channel_unittest.cc
@@ -14,14 +14,17 @@
#include "base/string_util.h"
#include "base/thread.h"
#include "base/waitable_event.h"
-#include "chrome/common/ipc_message.h"
-#include "chrome/common/ipc_sync_channel.h"
-#include "chrome/common/stl_util-inl.h"
+#include "ipc/ipc_message.h"
+#include "ipc/ipc_sync_channel.h"
#include "testing/gtest/include/gtest/gtest.h"
-
-#define MESSAGES_INTERNAL_FILE "chrome/common/ipc_sync_message_unittest.h"
-#include "chrome/common/ipc_message_macros.h"
+#if 0
+// This for tools which parse #include lines, but cannot process when we
+// include via a macro name.
+#include "ipc/ipc_sync_message_unittest.h"
+#endif
+#define MESSAGES_INTERNAL_FILE "ipc/ipc_sync_message_unittest.h"
+#include "ipc/ipc_message_macros.h"
using namespace IPC;
using base::WaitableEvent;
@@ -224,7 +227,8 @@ void RunTest(std::vector<Worker*> workers) {
for (size_t i = 0; i < workers.size(); ++i)
workers[i]->done_event()->Wait();
- STLDeleteContainerPointers(workers.begin(), workers.end());
+ for (size_t i = 0; i < workers.size(); ++i)
+ delete workers[i];
}
} // namespace
diff --git a/chrome/common/ipc_sync_message.cc b/ipc/ipc_sync_message.cc
index a7407e4..519adb1 100644
--- a/chrome/common/ipc_sync_message.cc
+++ b/ipc/ipc_sync_message.cc
@@ -11,7 +11,7 @@
#include "base/logging.h"
#include "base/waitable_event.h"
-#include "chrome/common/ipc_sync_message.h"
+#include "ipc/ipc_sync_message.h"
namespace IPC {
diff --git a/chrome/common/ipc_sync_message.h b/ipc/ipc_sync_message.h
index b03007e..3006736 100644
--- a/chrome/common/ipc_sync_message.h
+++ b/ipc/ipc_sync_message.h
@@ -2,15 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_COMMON_IPC_SYNC_MESSAGE_H__
-#define CHROME_COMMON_IPC_SYNC_MESSAGE_H__
+#ifndef COMMON_IPC_SYNC_MESSAGE_H__
+#define COMMON_IPC_SYNC_MESSAGE_H__
#if defined(OS_WIN)
#include <windows.h>
#endif
#include <string>
#include "base/basictypes.h"
-#include "chrome/common/ipc_message.h"
+#include "ipc/ipc_message.h"
namespace base {
class WaitableEvent;
@@ -93,4 +93,4 @@ class MessageReplyDeserializer {
} // namespace IPC
-#endif // CHROME_COMMON_IPC_SYNC_MESSAGE_H__
+#endif // COMMON_IPC_SYNC_MESSAGE_H__
diff --git a/chrome/common/ipc_sync_message_unittest.cc b/ipc/ipc_sync_message_unittest.cc
index b4f86a2..9e3de1f 100644
--- a/chrome/common/ipc_sync_message_unittest.cc
+++ b/ipc/ipc_sync_message_unittest.cc
@@ -9,14 +9,18 @@
#include <string.h>
#include "base/basictypes.h"
-#include "chrome/common/ipc_message.h"
-#include "chrome/common/ipc_message_utils.h"
+#include "ipc/ipc_message.h"
+#include "ipc/ipc_message_utils.h"
#include "base/logging.h"
#include "testing/gtest/include/gtest/gtest.h"
-
-#define MESSAGES_INTERNAL_FILE "chrome/common/ipc_sync_message_unittest.h"
-#include "chrome/common/ipc_message_macros.h"
+#if 0
+// This for tools which parse #include lines, but cannot process when we
+// include via a macro name.
+#include "ipc/ipc_sync_message_unittest.h"
+#endif
+#define MESSAGES_INTERNAL_FILE "ipc/ipc_sync_message_unittest.h"
+#include "ipc/ipc_message_macros.h"
static IPC::Message* g_reply;
diff --git a/chrome/common/ipc_sync_message_unittest.h b/ipc/ipc_sync_message_unittest.h
index 4ac9099..7b252b5 100644
--- a/chrome/common/ipc_sync_message_unittest.h
+++ b/ipc/ipc_sync_message_unittest.h
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/common/ipc_message_macros.h"
+#include "ipc/ipc_message_macros.h"
IPC_BEGIN_MESSAGES(Test)
IPC_SYNC_MESSAGE_CONTROL0_0(SyncChannelTestMsg_NoArgs)
diff --git a/chrome/common/ipc_test_sink.cc b/ipc/ipc_test_sink.cc
index c278902..1f1ce3f 100644
--- a/chrome/common/ipc_test_sink.cc
+++ b/ipc/ipc_test_sink.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/common/ipc_test_sink.h"
+#include "ipc/ipc_test_sink.h"
namespace IPC {
diff --git a/chrome/common/ipc_test_sink.h b/ipc/ipc_test_sink.h
index fd9faee..851ed8e 100644
--- a/chrome/common/ipc_test_sink.h
+++ b/ipc/ipc_test_sink.h
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_COMMON_IPC_TEST_SINK_H_
-#define CHROME_COMMON_IPC_TEST_SINK_H_
+#ifndef COMMON_IPC_TEST_SINK_H_
+#define COMMON_IPC_TEST_SINK_H_
#include <utility>
#include <vector>
#include "base/basictypes.h"
-#include "chrome/common/ipc_message.h"
+#include "ipc/ipc_message.h"
namespace IPC {
@@ -81,4 +81,4 @@ class TestSink {
} // namespace IPC
-#endif // CHROME_COMMON_IPC_TEST_SINK_H_
+#endif // COMMON_IPC_TEST_SINK_H_
diff --git a/chrome/common/ipc_tests.cc b/ipc/ipc_tests.cc
index ae88659..506b888 100644
--- a/chrome/common/ipc_tests.cc
+++ b/ipc/ipc_tests.cc
@@ -15,7 +15,7 @@
#include <iostream>
#include <string>
-#include "chrome/common/ipc_tests.h"
+#include "ipc/ipc_tests.h"
#include "base/at_exit.h"
#include "base/base_switches.h"
@@ -25,10 +25,9 @@
#include "base/perf_test_suite.h"
#include "base/test_suite.h"
#include "base/thread.h"
-#include "chrome/common/chrome_switches.h"
-#include "chrome/common/ipc_channel.h"
-#include "chrome/common/ipc_channel_proxy.h"
-#include "chrome/common/ipc_message_utils.h"
+#include "ipc/ipc_channel.h"
+#include "ipc/ipc_channel_proxy.h"
+#include "ipc/ipc_message_utils.h"
#include "testing/multiprocess_func_list.h"
// Define to enable IPC performance testing instead of the regular unit tests
diff --git a/chrome/common/ipc_tests.h b/ipc/ipc_tests.h
index 3cefafe..5005eb3 100644
--- a/chrome/common/ipc_tests.h
+++ b/ipc/ipc_tests.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_COMMON_IPC_TESTS_H__
-#define CHROME_COMMON_IPC_TESTS_H__
+#ifndef COMMON_IPC_TESTS_H__
+#define COMMON_IPC_TESTS_H__
#include "base/multiprocess_test.h"
#include "base/process.h"
@@ -44,4 +44,4 @@ class IPCChannelTest : public MultiProcessTest {
MessageLoopForIO *message_loop_;
};
-#endif // CHROME_COMMON_IPC_TESTS_H__
+#endif // COMMON_IPC_TESTS_H__