diff --git a/DEPS b/DEPS index f2313c0e1526..3e3a96e4bef3 100644 --- a/DEPS +++ b/DEPS @@ -65,7 +65,6 @@ 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. @@ -82,7 +81,6 @@ include_rules = [ skip_child_includes = [ "breakpad", "gears", - "ipc", "sdch", "skia", "testing", diff --git a/base/base_switches.cc b/base/base_switches.cc index d54d458b608f..77d263c4da60 100644 --- a/base/base_switches.cc +++ b/base/base_switches.cc @@ -40,9 +40,4 @@ 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 1ca56f4f491c..97a369132558 100644 --- a/base/base_switches.h +++ b/base/base_switches.h @@ -17,7 +17,6 @@ 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 5d6cbc65c15a..0bcd4b6c6955 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 ipc_message_utils.h above the -// template specialisation for this structure. +// these objects over IPC. See comments in chrome/common/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 9c95a8b1b027..2d9ddff83e1e 100644 --- a/build/all.gyp +++ b/build/all.gyp @@ -22,7 +22,6 @@ '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 b457d6a29664..0f6969f1d545 100644 --- a/chrome/DEPS +++ b/chrome/DEPS @@ -1,5 +1,4 @@ include_rules = [ - "+ipc", "+net", "+printing", diff --git a/chrome/browser/automation/automation_provider.h b/chrome/browser/automation/automation_provider.h index 77625e37c2b3..1bf0892aab62 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 3e626c3758b7..53d80b95c690 100644 --- a/chrome/browser/automation/automation_resource_tracker.h +++ b/chrome/browser/automation/automation_resource_tracker.h @@ -8,8 +8,8 @@ #include #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 3055e0642901..149bfd7cabec 100644 --- a/chrome/browser/jsmessage_box_handler.h +++ b/chrome/browser/jsmessage_box_handler.h @@ -7,7 +7,7 @@ #include -#include "ipc/ipc_message.h" +#include "chrome/common/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 04793e4694b4..ff2b152f449d 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 99ef416a32eb..ee6f4afe5615 100644 --- a/chrome/browser/net/resolve_proxy_msg_helper.h +++ b/chrome/browser/net/resolve_proxy_msg_helper.h @@ -8,7 +8,7 @@ #include #include -#include "ipc/ipc_message.h" +#include "chrome/common/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 abc3e88abdee..9ddeada0f580 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 "ipc/ipc_message.h" +#include "chrome/common/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 757109701c75..9b6365301aec 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 "ipc/ipc_test_sink.h" +#include "chrome/common/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 346213bfd198..6e59166ff594 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 f09c829f184b..cac1f4eabca7 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 7e08f8992d4e..07c532c47c37 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 "ipc/ipc_message.h" +#include "chrome/common/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 5b25f633e744..db7c60b36c79 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 f44707cea391..24d3c2e45989 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 a1ed0c87efe3..8dab8c68ec0d 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 be6cb2684ddb..6bbd3566075e 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 "ipc/ipc_message.h" +#include "chrome/common/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 ff9f3df32944..92cc284135ad 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 "ipc/ipc_logging.h" +#include "chrome/common/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 04380763563b..cf8072c26935 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 b7e858f5e78d..199a69d365a9 100644 --- a/chrome/chrome.gyp +++ b/chrome/chrome.gyp @@ -83,7 +83,6 @@ '../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', @@ -164,15 +163,34 @@ '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', @@ -1721,8 +1739,8 @@ 'browser/renderer_host/test_render_view_host.h', 'browser/tab_contents/test_web_contents.cc', 'browser/tab_contents/test_web_contents.h', - '../ipc/ipc_test_sink.cc', - '../ipc/ipc_test_sink.h', + 'common/ipc_test_sink.cc', + 'common/ipc_test_sink.h', 'renderer/mock_render_process.h', 'renderer/mock_render_thread.cc', 'renderer/mock_render_thread.h', @@ -1819,6 +1837,37 @@ }], ], }, + { + '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', @@ -2109,11 +2158,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', @@ -2195,6 +2244,7 @@ '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 f6f19467d6dd..c1002d18fdfd 100644 --- a/chrome/chrome.sln +++ b/chrome/chrome.sln @@ -20,9 +20,16 @@ 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 @@ -593,19 +600,6 @@ 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} @@ -3091,8 +3085,6 @@ 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 dc7f1e5872a5..7f934b0d69bf 100644 --- a/chrome/common/child_process_host.cc +++ b/chrome/common/child_process_host.cc @@ -11,13 +11,12 @@ #include "base/singleton.h" #include "base/waitable_event.h" #include "chrome/browser/chrome_thread.h" -#include "chrome/common/common_message_utils.h" +#include "chrome/common/ipc_logging.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 1aef54cf16c6..d4d2dd914457 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 "ipc/ipc_channel.h" +#include "chrome/common/ipc_channel.h" class NotificationType; diff --git a/chrome/common/child_thread.cc b/chrome/common/child_thread.cc index 527c58fd0375..94b318619ce8 100644 --- a/chrome/common/child_thread.cc +++ b/chrome/common/child_thread.cc @@ -6,11 +6,10 @@ #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 a4f86033055c..66fcc09283ae 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 "ipc/ipc_sync_channel.h" +#include "chrome/common/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 fea09065ad9c..98a977b6b9d8 100644 --- a/chrome/common/chrome_counters.cc +++ b/chrome/common/chrome_counters.cc @@ -19,6 +19,11 @@ 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 14cfa210b114..c7975f85a992 100644 --- a/chrome/common/chrome_counters.h +++ b/chrome/common/chrome_counters.h @@ -15,6 +15,9 @@ 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 350b2a0a1c64..c32cbb5a097d 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -50,6 +50,10 @@ 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"; @@ -152,6 +156,11 @@ 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. @@ -382,6 +391,10 @@ 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 f6d085b11874..8b51a7db0fab 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 "ipc/ipc_switches.h" +#include "base/base_switches.h" namespace switches { @@ -23,6 +23,7 @@ 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[]; @@ -50,6 +51,7 @@ 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[]; @@ -148,6 +150,8 @@ 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 5f3837a1938f..f392f7dd5e52 100644 --- a/chrome/common/common.vcproj +++ b/chrome/common/common.vcproj @@ -224,6 +224,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -397,10 +457,6 @@ RelativePath=".\common_glue.cc" > - - diff --git a/chrome/common/common_message_utils.h b/chrome/common/common_message_utils.h deleted file mode 100644 index 81178db2f920..000000000000 --- a/chrome/common/common_message_utils.h +++ /dev/null @@ -1,138 +0,0 @@ -// 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 { - 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 { - typedef ThumbnailScore param_type; - static void Write(Message* m, const param_type& p) { - IPC::ParamTraits::Write(m, p.boring_score); - IPC::ParamTraits::Write(m, p.good_clipping); - IPC::ParamTraits::Write(m, p.at_top); - IPC::ParamTraits::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::Read(m, iter, &boring_score) || - !IPC::ParamTraits::Read(m, iter, &good_clipping) || - !IPC::ParamTraits::Read(m, iter, &at_top) || - !IPC::ParamTraits::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 { - 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 { - 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(temp); - return res; - } - static void Log(const param_type& p, std::wstring* l) { - l->append(StringPrintf(L"%d", p)); - } -}; - -template <> -struct ParamTraits { - 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""); - } -}; - -template <> -struct ParamTraits { - 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 { - 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/ipc/file_descriptor_set_posix.cc b/chrome/common/file_descriptor_set_posix.cc similarity index 98% rename from ipc/file_descriptor_set_posix.cc rename to chrome/common/file_descriptor_set_posix.cc index 3b04553f2191..b57c0076e722 100644 --- a/ipc/file_descriptor_set_posix.cc +++ b/chrome/common/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 "ipc/file_descriptor_set_posix.h" +#include "chrome/common/file_descriptor_set_posix.h" #include "base/logging.h" diff --git a/ipc/file_descriptor_set_posix.h b/chrome/common/file_descriptor_set_posix.h similarity index 96% rename from ipc/file_descriptor_set_posix.h rename to chrome/common/file_descriptor_set_posix.h index c3d26ba8f607..342e6d932f89 100644 --- a/ipc/file_descriptor_set_posix.h +++ b/chrome/common/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 IPC_FILE_DESCRIPTOR_SET_POSIX_H_ -#define IPC_FILE_DESCRIPTOR_SET_POSIX_H_ +#ifndef CHROME_COMMON_FILE_DESCRIPTOR_SET_POSIX_H_ +#define CHROME_COMMON_FILE_DESCRIPTOR_SET_POSIX_H_ #include @@ -105,4 +105,4 @@ class FileDescriptorSet : public base::RefCountedThreadSafe { DISALLOW_COPY_AND_ASSIGN(FileDescriptorSet); }; -#endif // IPC_FILE_DESCRIPTOR_SET_POSIX_H_ +#endif // CHROME_COMMON_FILE_DESCRIPTOR_SET_POSIX_H_ diff --git a/ipc/file_descriptor_set_unittest.cc b/chrome/common/file_descriptor_set_unittest.cc similarity index 98% rename from ipc/file_descriptor_set_unittest.cc rename to chrome/common/file_descriptor_set_unittest.cc index 0d158b216ae6..89144a55983a 100644 --- a/ipc/file_descriptor_set_unittest.cc +++ b/chrome/common/file_descriptor_set_unittest.cc @@ -8,7 +8,7 @@ #include #include "base/basictypes.h" -#include "ipc/file_descriptor_set_posix.h" +#include "chrome/common/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_channel.h b/chrome/common/ipc_channel.h similarity index 96% rename from ipc/ipc_channel.h rename to chrome/common/ipc_channel.h index 1ecffdfda775..9b7f8b208c20 100644 --- a/ipc/ipc_channel.h +++ b/chrome/common/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 IPC_IPC_CHANNEL_H_ -#define IPC_IPC_CHANNEL_H_ +#ifndef CHROME_COMMON_IPC_CHANNEL_H_ +#define CHROME_COMMON_IPC_CHANNEL_H_ -#include "ipc/ipc_message.h" +#include "chrome/common/ipc_message.h" namespace IPC { @@ -120,4 +120,4 @@ class Channel : public Message::Sender { } // namespace IPC -#endif // IPC_IPC_CHANNEL_H_ +#endif // CHROME_COMMON_IPC_CHANNEL_H_ diff --git a/ipc/ipc_channel_posix.cc b/chrome/common/ipc_channel_posix.cc similarity index 98% rename from ipc/ipc_channel_posix.cc rename to chrome/common/ipc_channel_posix.cc index 96209a023b3c..23c008a74631 100644 --- a/ipc/ipc_channel_posix.cc +++ b/chrome/common/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 "ipc/ipc_channel_posix.h" +#include "chrome/common/ipc_channel_posix.h" #include #include @@ -22,11 +22,11 @@ #include "base/scoped_ptr.h" #include "base/string_util.h" #include "base/singleton.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" +#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" namespace IPC { @@ -634,7 +634,7 @@ bool Channel::ChannelImpl::ProcessOutgoingMessages() { } bool Channel::ChannelImpl::Send(Message* message) { - Counters::ipc_send_counter().Increment(); + chrome::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/ipc/ipc_channel_posix.h b/chrome/common/ipc_channel_posix.h similarity index 93% rename from ipc/ipc_channel_posix.h rename to chrome/common/ipc_channel_posix.h index 53fba1b9b988..fbdd59be982d 100644 --- a/ipc/ipc_channel_posix.h +++ b/chrome/common/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 IPC_IPC_CHANNEL_POSIX_H_ -#define IPC_IPC_CHANNEL_POSIX_H_ +#ifndef CHROME_COMMON_IPC_CHANNEL_POSIX_H_ +#define CHROME_COMMON_IPC_CHANNEL_POSIX_H_ -#include "ipc/ipc_channel.h" +#include "chrome/common/ipc_channel.h" #include // for CMSG macros @@ -14,7 +14,7 @@ #include #include "base/message_loop.h" -#include "ipc/file_descriptor_set_posix.h" +#include "chrome/common/file_descriptor_set_posix.h" namespace IPC { @@ -109,4 +109,4 @@ class Channel::ChannelImpl : public MessageLoopForIO::Watcher { } // namespace IPC -#endif // IPC_IPC_CHANNEL_POSIX_H_ +#endif // CHROME_COMMON_IPC_CHANNEL_POSIX_H_ diff --git a/ipc/ipc_channel_proxy.cc b/chrome/common/ipc_channel_proxy.cc similarity index 98% rename from ipc/ipc_channel_proxy.cc rename to chrome/common/ipc_channel_proxy.cc index a07c6775405d..a9def010b0ca 100644 --- a/ipc/ipc_channel_proxy.cc +++ b/chrome/common/ipc_channel_proxy.cc @@ -4,9 +4,9 @@ #include "base/message_loop.h" #include "base/thread.h" -#include "ipc/ipc_channel_proxy.h" -#include "ipc/ipc_logging.h" -#include "ipc/ipc_message_utils.h" +#include "chrome/common/ipc_channel_proxy.h" +#include "chrome/common/ipc_logging.h" +#include "chrome/common/ipc_message_utils.h" namespace IPC { diff --git a/ipc/ipc_channel_proxy.h b/chrome/common/ipc_channel_proxy.h similarity index 98% rename from ipc/ipc_channel_proxy.h rename to chrome/common/ipc_channel_proxy.h index 7f78a7e1f17b..80a980762ef8 100644 --- a/ipc/ipc_channel_proxy.h +++ b/chrome/common/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 IPC_IPC_CHANNEL_PROXY_H__ -#define IPC_IPC_CHANNEL_PROXY_H__ +#ifndef CHROME_COMMON_IPC_CHANNEL_PROXY_H__ +#define CHROME_COMMON_IPC_CHANNEL_PROXY_H__ #include #include "base/lock.h" #include "base/ref_counted.h" -#include "ipc/ipc_channel.h" +#include "chrome/common/ipc_channel.h" class MessageLoop; @@ -203,4 +203,4 @@ class ChannelProxy : public Message::Sender { } // namespace IPC -#endif // IPC_IPC_CHANNEL_PROXY_H__ +#endif // CHROME_COMMON_IPC_CHANNEL_PROXY_H__ diff --git a/ipc/ipc_channel_win.cc b/chrome/common/ipc_channel_win.cc similarity index 98% rename from ipc/ipc_channel_win.cc rename to chrome/common/ipc_channel_win.cc index 950b140a8ff6..38e442a8320f 100644 --- a/ipc/ipc_channel_win.cc +++ b/chrome/common/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 "ipc/ipc_channel_win.h" +#include "chrome/common/ipc_channel_win.h" #include #include @@ -11,9 +11,9 @@ #include "base/logging.h" #include "base/non_thread_safe.h" #include "base/win_util.h" -#include "ipc/ipc_counters.h" -#include "ipc/ipc_logging.h" -#include "ipc/ipc_message_utils.h" +#include "chrome/common/chrome_counters.h" +#include "chrome/common/ipc_logging.h" +#include "chrome/common/ipc_message_utils.h" namespace IPC { //------------------------------------------------------------------------------ @@ -83,7 +83,7 @@ void Channel::ChannelImpl::Close() { bool Channel::ChannelImpl::Send(Message* message) { DCHECK(thread_check_->CalledOnValidThread()); - Counters::ipc_send_counter().Increment(); + chrome::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/ipc/ipc_channel_win.h b/chrome/common/ipc_channel_win.h similarity index 93% rename from ipc/ipc_channel_win.h rename to chrome/common/ipc_channel_win.h index 998b7f8c53f8..2a601e1910b1 100644 --- a/ipc/ipc_channel_win.h +++ b/chrome/common/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 IPC_IPC_CHANNEL_WIN_H_ -#define IPC_IPC_CHANNEL_WIN_H_ +#ifndef CHROME_COMMON_IPC_CHANNEL_WIN_H_ +#define CHROME_COMMON_IPC_CHANNEL_WIN_H_ -#include "ipc/ipc_channel.h" +#include "chrome/common/ipc_channel.h" #include #include @@ -82,4 +82,4 @@ class Channel::ChannelImpl : public MessageLoopForIO::IOHandler { } // namespace IPC -#endif // IPC_IPC_CHANNEL_WIN_H_ +#endif // CHROME_COMMON_IPC_CHANNEL_WIN_H_ diff --git a/ipc/ipc_fuzzing_tests.cc b/chrome/common/ipc_fuzzing_tests.cc similarity index 97% rename from ipc/ipc_fuzzing_tests.cc rename to chrome/common/ipc_fuzzing_tests.cc index 6b4f899a57f5..8148723957b0 100644 --- a/ipc/ipc_fuzzing_tests.cc +++ b/chrome/common/ipc_fuzzing_tests.cc @@ -10,10 +10,10 @@ #include "base/message_loop.h" #include "base/platform_thread.h" #include "base/process_util.h" -#include "ipc/ipc_channel.h" -#include "ipc/ipc_channel_proxy.h" -#include "ipc/ipc_message_utils.h" -#include "ipc/ipc_tests.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 "testing/gtest/include/gtest/gtest.h" #include "testing/multiprocess_func_list.h" @@ -98,13 +98,8 @@ TEST(IPCMessageIntegrity, ReadVectorTooLarge2) { // We don't actually use the messages defined in this file, but we do this // to get to the IPC macros. -#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" +#define MESSAGES_INTERNAL_FILE "chrome/common/ipc_sync_message_unittest.h" +#include "chrome/common/ipc_message_macros.h" enum IPCMessageIds { UNUSED_IPC_TYPE, diff --git a/ipc/ipc_logging.cc b/chrome/common/ipc_logging.cc similarity index 90% rename from ipc/ipc_logging.cc rename to chrome/common/ipc_logging.cc index baa9cc30f01e..cb635337428d 100644 --- a/ipc/ipc_logging.cc +++ b/chrome/common/ipc_logging.cc @@ -2,7 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ipc/ipc_logging.h" +#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 "base/command_line.h" #include "base/logging.h" @@ -12,9 +19,21 @@ #include "base/time.h" #include "base/waitable_event.h" #include "base/waitable_event_watcher.h" -#include "ipc/ipc_sync_message.h" -#include "ipc/ipc_switches.h" -#include "ipc/ipc_message_utils.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 #if defined(OS_POSIX) #include "base/string_util.h" @@ -82,6 +101,7 @@ Logging::Logging() #elif defined(OS_POSIX) if (getenv("CHROME_IPC_LOGGING")) enabled_ = true; + SetLoggerFunctions(g_log_function_mapping); #endif MessageLoop::current()->AddDestructionObserver(this); @@ -109,7 +129,6 @@ void Logging::WillDestroyCurrentMessageLoop() { watcher_.StopWatching(); } -// static void Logging::SetLoggerFunctions(LogFunction *functions) { log_function_mapping_ = functions; } @@ -296,6 +315,6 @@ void GenerateLogData(const std::wstring& channel, const Message& message, } } -} // namespace IPC +} #endif // IPC_MESSAGE_LOG_ENABLED diff --git a/ipc/ipc_logging.h b/chrome/common/ipc_logging.h similarity index 89% rename from ipc/ipc_logging.h rename to chrome/common/ipc_logging.h index 4d8f81d4d795..cfdcf21528fd 100644 --- a/ipc/ipc_logging.h +++ b/chrome/common/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 IPC_IPC_LOGGING_H_ -#define IPC_IPC_LOGGING_H_ +#ifndef CHROME_COMMON_IPC_LOGGING_H_ +#define CHROME_COMMON_IPC_LOGGING_H_ -#include "ipc/ipc_message.h" // For IPC_MESSAGE_LOG_ENABLED. +#include "chrome/common/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 "ipc/ipc_message_utils.h" +#include "chrome/common/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 // IPC_IPC_LOGGING_H_ +#endif // CHROME_COMMON_IPC_LOGGING_H_ diff --git a/chrome/common/ipc_maybe.h b/chrome/common/ipc_maybe.h new file mode 100644 index 000000000000..de45dc02b43b --- /dev/null +++ b/chrome/common/ipc_maybe.h @@ -0,0 +1,19 @@ +#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 +struct Maybe { + bool valid; + A value; +}; + +} // namespace IPC + +#endif // CHROME_COMMON_MAYBE_H_ diff --git a/ipc/ipc_message.cc b/chrome/common/ipc_message.cc similarity index 97% rename from ipc/ipc_message.cc rename to chrome/common/ipc_message.cc index 7a2b5cdb1636..d7cc49d51a82 100644 --- a/ipc/ipc_message.cc +++ b/chrome/common/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 "ipc/ipc_message.h" +#include "chrome/common/ipc_message.h" #include "base/logging.h" #include "build/build_config.h" #if defined(OS_POSIX) -#include "ipc/file_descriptor_set_posix.h" +#include "chrome/common/file_descriptor_set_posix.h" #endif namespace IPC { diff --git a/ipc/ipc_message.h b/chrome/common/ipc_message.h similarity index 98% rename from ipc/ipc_message.h rename to chrome/common/ipc_message.h index 6357c0bc3175..af4a0df8d546 100644 --- a/ipc/ipc_message.h +++ b/chrome/common/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 IPC_IPC_MESSAGE_H__ -#define IPC_IPC_MESSAGE_H__ +#ifndef CHROME_COMMON_IPC_MESSAGE_H__ +#define CHROME_COMMON_IPC_MESSAGE_H__ #include @@ -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 // IPC_IPC_MESSAGE_H__ +#endif // CHROME_COMMON_IPC_MESSAGE_H__ diff --git a/ipc/ipc_message_macros.h b/chrome/common/ipc_message_macros.h similarity index 98% rename from ipc/ipc_message_macros.h rename to chrome/common/ipc_message_macros.h index 8bddb7fcace9..7cba9113e084 100644 --- a/ipc/ipc_message_macros.h +++ b/chrome/common/ipc_message_macros.h @@ -40,12 +40,24 @@ // ViewHostMsg_SyncMessageName::WriteReplyParams(reply_msg, out1, out2); // Send(reply_msg); -#include "ipc/ipc_message_utils.h" +#include "chrome/common/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/chrome/common/gurl_serialisation_unittest.cc b/chrome/common/ipc_message_unittest.cc similarity index 93% rename from chrome/common/gurl_serialisation_unittest.cc rename to chrome/common/ipc_message_unittest.cc index 9fdd59d639ab..643626e1d20b 100644 --- a/chrome/common/gurl_serialisation_unittest.cc +++ b/chrome/common/ipc_message_unittest.cc @@ -4,13 +4,13 @@ #include +#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(GURLSerialisation, Serialize) { +TEST(IPCMessageTest, Serialize) { const char* serialize_cases[] = { "http://www.google.com/", "http://user:pass@host.com:888/foo;bar?baz#nop", diff --git a/chrome/common/common_message_utils.cc b/chrome/common/ipc_message_utils.cc similarity index 69% rename from chrome/common/common_message_utils.cc rename to chrome/common/ipc_message_utils.cc index e12edaea3f17..36e8052f6095 100644 --- a/chrome/common/common_message_utils.cc +++ b/chrome/common/ipc_message_utils.cc @@ -1,9 +1,10 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// 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 "chrome/common/common_message_utils.h" +#include "chrome/common/ipc_message_utils.h" +#include "base/gfx/rect.h" #include "googleurl/src/gurl.h" #include "SkBitmap.h" #include "webkit/glue/dom_operations.h" @@ -44,6 +45,7 @@ struct SkBitmap_Data { } // namespace + void ParamTraits::Write(Message* m, const SkBitmap& p) { size_t fixed_size = sizeof(SkBitmap_Data); SkBitmap_Data bmp_data; @@ -84,6 +86,7 @@ void ParamTraits::Log(const SkBitmap& p, std::wstring* l) { l->append(StringPrintf(L"")); } + void ParamTraits::Write(Message* m, const GURL& p) { m->WriteString(p.possibly_invalid_spec()); // TODO(brettw) bug 684583: Add encoding for query params. @@ -103,6 +106,74 @@ void ParamTraits::Log(const GURL& p, std::wstring* l) { l->append(UTF8ToWide(p.spec())); } + +void ParamTraits::Write(Message* m, const gfx::Point& p) { + m->WriteInt(p.x()); + m->WriteInt(p.y()); +} + +bool ParamTraits::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::Log(const gfx::Point& p, std::wstring* l) { + l->append(StringPrintf(L"(%d, %d)", p.x(), p.y())); +} + + +void ParamTraits::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::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::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::Write(Message* m, const gfx::Size& p) { + m->WriteInt(p.width()); + m->WriteInt(p.height()); +} + +bool ParamTraits::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::Log(const gfx::Size& p, std::wstring* l) { + l->append(StringPrintf(L"(%d, %d)", p.width(), p.height())); +} + void ParamTraits::Write( Message* m, const webkit_glue::WebApplicationInfo& p) { WriteParam(m, p.title); diff --git a/ipc/ipc_message_utils.h b/chrome/common/ipc_message_utils.h similarity index 89% rename from ipc/ipc_message_utils.h rename to chrome/common/ipc_message_utils.h index 582b4910e3f3..6e82d408cfb2 100644 --- a/ipc/ipc_message_utils.h +++ b/chrome/common/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 IPC_IPC_MESSAGE_UTILS_H_ -#define IPC_IPC_MESSAGE_UTILS_H_ +#ifndef CHROME_COMMON_IPC_MESSAGE_UTILS_H_ +#define CHROME_COMMON_IPC_MESSAGE_UTILS_H_ #include #include @@ -12,20 +12,30 @@ #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 "ipc/file_descriptor_set_posix.h" +#include "chrome/common/file_descriptor_set_posix.h" #endif -#include "ipc/ipc_sync_message.h" +#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" // 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. @@ -335,6 +345,18 @@ struct ParamTraits { }; #endif // defined(OS_WIN) +template <> +struct ParamTraits { + 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 { typedef std::string param_type; @@ -504,6 +526,14 @@ struct ParamTraits { }; #endif +template <> +struct ParamTraits { + 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 <> @@ -710,6 +740,54 @@ struct ParamTraits { }; #endif // defined(OS_POSIX) +template<> +struct ParamTraits { + typedef ThumbnailScore param_type; + static void Write(Message* m, const param_type& p) { + IPC::ParamTraits::Write(m, p.boring_score); + IPC::ParamTraits::Write(m, p.good_clipping); + IPC::ParamTraits::Write(m, p.at_top); + IPC::ParamTraits::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::Read(m, iter, &boring_score) || + !IPC::ParamTraits::Read(m, iter, &good_clipping) || + !IPC::ParamTraits::Read(m, iter, &at_top) || + !IPC::ParamTraits::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 { + 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(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 { @@ -736,6 +814,20 @@ struct ParamTraits { }; #endif // defined(OS_WIN) +template <> +struct ParamTraits { + 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""); + } +}; + struct LogData { std::wstring channel; uint16 type; @@ -780,6 +872,37 @@ struct ParamTraits { }; +template <> +struct ParamTraits { + 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 { + 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 { static void Write(Message* m, const Message& p) { @@ -1255,4 +1378,4 @@ class MessageWithReply : public SyncMessage { } // namespace IPC -#endif // IPC_IPC_MESSAGE_UTILS_H_ +#endif // CHROME_COMMON_IPC_MESSAGE_UTILS_H_ diff --git a/ipc/ipc_send_fds_test.cc b/chrome/common/ipc_send_fds_test.cc similarity index 97% rename from ipc/ipc_send_fds_test.cc rename to chrome/common/ipc_send_fds_test.cc index ff32afc83f3b..747892d144fa 100644 --- a/ipc/ipc_send_fds_test.cc +++ b/chrome/common/ipc_send_fds_test.cc @@ -4,7 +4,7 @@ #include "build/build_config.h" -#include "ipc/ipc_tests.h" +#include "chrome/common/ipc_tests.h" #if defined(OS_MACOSX) extern "C" { @@ -15,8 +15,8 @@ extern "C" { #include #include "base/message_loop.h" -#include "ipc/ipc_channel.h" -#include "ipc/ipc_message_utils.h" +#include "chrome/common/ipc_channel.h" +#include "chrome/common/ipc_message_utils.h" #if defined(OS_POSIX) diff --git a/ipc/ipc_sync_channel.cc b/chrome/common/ipc_sync_channel.cc similarity index 99% rename from ipc/ipc_sync_channel.cc rename to chrome/common/ipc_sync_channel.cc index 137d9fa798e4..842678cfe8fc 100644 --- a/ipc/ipc_sync_channel.cc +++ b/chrome/common/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 "ipc/ipc_sync_channel.h" +#include "chrome/common/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 "ipc/ipc_sync_message.h" +#include "chrome/common/ipc_sync_message.h" using base::TimeDelta; using base::TimeTicks; diff --git a/ipc/ipc_sync_channel.h b/chrome/common/ipc_sync_channel.h similarity index 96% rename from ipc/ipc_sync_channel.h rename to chrome/common/ipc_sync_channel.h index d802d91906ec..1b192f6cf53b 100644 --- a/ipc/ipc_sync_channel.h +++ b/chrome/common/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 COMMON_IPC_SYNC_SENDER_H__ -#define COMMON_IPC_SYNC_SENDER_H__ +#ifndef CHROME_COMMON_IPC_SYNC_SENDER_H__ +#define CHROME_COMMON_IPC_SYNC_SENDER_H__ #include #include @@ -13,7 +13,7 @@ #include "base/scoped_handle.h" #include "base/waitable_event.h" #include "base/waitable_event_watcher.h" -#include "ipc/ipc_channel_proxy.h" +#include "chrome/common/ipc_channel_proxy.h" namespace IPC { @@ -156,4 +156,4 @@ class SyncChannel : public ChannelProxy, } // namespace IPC -#endif // COMMON_IPC_SYNC_SENDER_H__ +#endif // CHROME_COMMON_IPC_SYNC_SENDER_H__ diff --git a/ipc/ipc_sync_channel_unittest.cc b/chrome/common/ipc_sync_channel_unittest.cc similarity index 98% rename from ipc/ipc_sync_channel_unittest.cc rename to chrome/common/ipc_sync_channel_unittest.cc index 056a084117aa..6e00fca62aab 100644 --- a/ipc/ipc_sync_channel_unittest.cc +++ b/chrome/common/ipc_sync_channel_unittest.cc @@ -14,17 +14,14 @@ #include "base/string_util.h" #include "base/thread.h" #include "base/waitable_event.h" -#include "ipc/ipc_message.h" -#include "ipc/ipc_sync_channel.h" +#include "chrome/common/ipc_message.h" +#include "chrome/common/ipc_sync_channel.h" +#include "chrome/common/stl_util-inl.h" #include "testing/gtest/include/gtest/gtest.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" + +#define MESSAGES_INTERNAL_FILE "chrome/common/ipc_sync_message_unittest.h" +#include "chrome/common/ipc_message_macros.h" using namespace IPC; using base::WaitableEvent; @@ -227,8 +224,7 @@ void RunTest(std::vector workers) { for (size_t i = 0; i < workers.size(); ++i) workers[i]->done_event()->Wait(); - for (size_t i = 0; i < workers.size(); ++i) - delete workers[i]; + STLDeleteContainerPointers(workers.begin(), workers.end()); } } // namespace diff --git a/ipc/ipc_sync_message.cc b/chrome/common/ipc_sync_message.cc similarity index 98% rename from ipc/ipc_sync_message.cc rename to chrome/common/ipc_sync_message.cc index 519adb17555b..a7407e434533 100644 --- a/ipc/ipc_sync_message.cc +++ b/chrome/common/ipc_sync_message.cc @@ -11,7 +11,7 @@ #include "base/logging.h" #include "base/waitable_event.h" -#include "ipc/ipc_sync_message.h" +#include "chrome/common/ipc_sync_message.h" namespace IPC { diff --git a/ipc/ipc_sync_message.h b/chrome/common/ipc_sync_message.h similarity index 94% rename from ipc/ipc_sync_message.h rename to chrome/common/ipc_sync_message.h index 300673683457..b03007e343cc 100644 --- a/ipc/ipc_sync_message.h +++ b/chrome/common/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 COMMON_IPC_SYNC_MESSAGE_H__ -#define COMMON_IPC_SYNC_MESSAGE_H__ +#ifndef CHROME_COMMON_IPC_SYNC_MESSAGE_H__ +#define CHROME_COMMON_IPC_SYNC_MESSAGE_H__ #if defined(OS_WIN) #include #endif #include #include "base/basictypes.h" -#include "ipc/ipc_message.h" +#include "chrome/common/ipc_message.h" namespace base { class WaitableEvent; @@ -93,4 +93,4 @@ class MessageReplyDeserializer { } // namespace IPC -#endif // COMMON_IPC_SYNC_MESSAGE_H__ +#endif // CHROME_COMMON_IPC_SYNC_MESSAGE_H__ diff --git a/ipc/ipc_sync_message_unittest.cc b/chrome/common/ipc_sync_message_unittest.cc similarity index 95% rename from ipc/ipc_sync_message_unittest.cc rename to chrome/common/ipc_sync_message_unittest.cc index 9e3de1fec358..b4f86a27c1f0 100644 --- a/ipc/ipc_sync_message_unittest.cc +++ b/chrome/common/ipc_sync_message_unittest.cc @@ -9,18 +9,14 @@ #include #include "base/basictypes.h" -#include "ipc/ipc_message.h" -#include "ipc/ipc_message_utils.h" +#include "chrome/common/ipc_message.h" +#include "chrome/common/ipc_message_utils.h" #include "base/logging.h" #include "testing/gtest/include/gtest/gtest.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" + +#define MESSAGES_INTERNAL_FILE "chrome/common/ipc_sync_message_unittest.h" +#include "chrome/common/ipc_message_macros.h" static IPC::Message* g_reply; diff --git a/ipc/ipc_sync_message_unittest.h b/chrome/common/ipc_sync_message_unittest.h similarity index 98% rename from ipc/ipc_sync_message_unittest.h rename to chrome/common/ipc_sync_message_unittest.h index 7b252b56c5a5..4ac9099b9bde 100644 --- a/ipc/ipc_sync_message_unittest.h +++ b/chrome/common/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 "ipc/ipc_message_macros.h" +#include "chrome/common/ipc_message_macros.h" IPC_BEGIN_MESSAGES(Test) IPC_SYNC_MESSAGE_CONTROL0_0(SyncChannelTestMsg_NoArgs) diff --git a/ipc/ipc_test_sink.cc b/chrome/common/ipc_test_sink.cc similarity index 96% rename from ipc/ipc_test_sink.cc rename to chrome/common/ipc_test_sink.cc index 1f1ce3f8c626..c27890203fdc 100644 --- a/ipc/ipc_test_sink.cc +++ b/chrome/common/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 "ipc/ipc_test_sink.h" +#include "chrome/common/ipc_test_sink.h" namespace IPC { diff --git a/ipc/ipc_test_sink.h b/chrome/common/ipc_test_sink.h similarity index 94% rename from ipc/ipc_test_sink.h rename to chrome/common/ipc_test_sink.h index 851ed8ee103c..fd9faee2b483 100644 --- a/ipc/ipc_test_sink.h +++ b/chrome/common/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 COMMON_IPC_TEST_SINK_H_ -#define COMMON_IPC_TEST_SINK_H_ +#ifndef CHROME_COMMON_IPC_TEST_SINK_H_ +#define CHROME_COMMON_IPC_TEST_SINK_H_ #include #include #include "base/basictypes.h" -#include "ipc/ipc_message.h" +#include "chrome/common/ipc_message.h" namespace IPC { @@ -81,4 +81,4 @@ class TestSink { } // namespace IPC -#endif // COMMON_IPC_TEST_SINK_H_ +#endif // CHROME_COMMON_IPC_TEST_SINK_H_ diff --git a/ipc/ipc_tests.cc b/chrome/common/ipc_tests.cc similarity index 98% rename from ipc/ipc_tests.cc rename to chrome/common/ipc_tests.cc index 506b88832e3d..ae88659ae953 100644 --- a/ipc/ipc_tests.cc +++ b/chrome/common/ipc_tests.cc @@ -15,7 +15,7 @@ #include #include -#include "ipc/ipc_tests.h" +#include "chrome/common/ipc_tests.h" #include "base/at_exit.h" #include "base/base_switches.h" @@ -25,9 +25,10 @@ #include "base/perf_test_suite.h" #include "base/test_suite.h" #include "base/thread.h" -#include "ipc/ipc_channel.h" -#include "ipc/ipc_channel_proxy.h" -#include "ipc/ipc_message_utils.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 "testing/multiprocess_func_list.h" // Define to enable IPC performance testing instead of the regular unit tests diff --git a/ipc/ipc_tests.h b/chrome/common/ipc_tests.h similarity index 91% rename from ipc/ipc_tests.h rename to chrome/common/ipc_tests.h index 5005eb3cc4ff..3cefafe17f49 100644 --- a/ipc/ipc_tests.h +++ b/chrome/common/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 COMMON_IPC_TESTS_H__ -#define COMMON_IPC_TESTS_H__ +#ifndef CHROME_COMMON_IPC_TESTS_H__ +#define CHROME_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 // COMMON_IPC_TESTS_H__ +#endif // CHROME_COMMON_IPC_TESTS_H__ diff --git a/chrome/common/ipc_tests.vcproj b/chrome/common/ipc_tests.vcproj new file mode 100644 index 000000000000..78fae65ee3da --- /dev/null +++ b/chrome/common/ipc_tests.vcproj @@ -0,0 +1,165 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/chrome/common/logging_chrome.cc b/chrome/common/logging_chrome.cc index a68b4d65a29b..66a49cfceea7 100644 --- a/chrome/common/logging_chrome.cc +++ b/chrome/common/logging_chrome.cc @@ -25,23 +25,6 @@ #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; @@ -89,10 +72,6 @@ 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 ef18aaad807a..d23e2f306fce 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 "ipc/ipc_channel.h" +#include "chrome/common/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 ecd012a0ac3c..7b5ce7320d37 100644 --- a/chrome/common/plugin_messages.h +++ b/chrome/common/plugin_messages.h @@ -16,8 +16,7 @@ #include "base/gfx/native_widget_types.h" #include "base/gfx/rect.h" #include "base/basictypes.h" -#include "chrome/common/common_message_utils.h" -#include "ipc/ipc_message_utils.h" +#include "chrome/common/ipc_message_utils.h" #include "googleurl/src/gurl.h" #include "third_party/npapi/bindings/npapi.h" #include "webkit/glue/npruntime_util.h" @@ -448,12 +447,8 @@ struct ParamTraits { } // 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 "ipc/ipc_message_macros.h" +#include "chrome/common/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 cafc4b0310e7..11a0365e3033 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 "ipc/ipc_message_macros.h" +#include "chrome/common/ipc_message_macros.h" #include "webkit/glue/webcursor.h" //----------------------------------------------------------------------------- diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h index b2e289facdf1..38af2036f206 100644 --- a/chrome/common/render_messages.h +++ b/chrome/common/render_messages.h @@ -15,13 +15,12 @@ #include "base/shared_memory.h" #include "chrome/browser/renderer_host/resource_handler.h" #include "chrome/common/filter_policy.h" -#include "chrome/common/common_message_utils.h" +#include "chrome/common/ipc_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" @@ -1772,12 +1771,7 @@ struct ParamTraits { } // 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 "ipc/ipc_message_macros.h" +#include "chrome/common/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 8a81d744e5c0..ece0cd15394f 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 f494aff3051f..73d0a8b3fc15 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 "ipc/ipc_channel.h" +#include "chrome/common/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 0f48ef339199..d41bccc6f846 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/common_message_utils.h" +#include "chrome/common/ipc_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 50bc69b651a8..c1fde97e02e4 100644 --- a/chrome/common/worker_messages.h +++ b/chrome/common/worker_messages.h @@ -11,15 +11,10 @@ #include #include "base/basictypes.h" -#include "ipc/ipc_message_utils.h" -#include "chrome/common/common_message_utils.h" +#include "chrome/common/ipc_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 "ipc/ipc_message_macros.h" +#include "chrome/common/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 ba9bb4cc6ec4..7691c797143c 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 "ipc/ipc_message_macros.h" +#include "chrome/common/ipc_message_macros.h" #include "googleurl/src/gurl.h" diff --git a/chrome/plugin/npobject_proxy.h b/chrome/plugin/npobject_proxy.h index 14892f8a2ffd..bb0ec2c00f2c 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 "ipc/ipc_channel.h" +#include "chrome/common/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 98be7dacb62f..cd75853b1e80 100644 --- a/chrome/plugin/npobject_stub.h +++ b/chrome/plugin/npobject_stub.h @@ -11,7 +11,7 @@ #include #include "base/ref_counted.h" -#include "ipc/ipc_channel.h" +#include "chrome/common/ipc_channel.h" namespace base { class WaitableEvent; diff --git a/chrome/plugin/plugin_channel_base.cc b/chrome/plugin/plugin_channel_base.cc index 066610a9554b..0e26e864ae5e 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 "ipc/ipc_sync_message.h" +#include "chrome/common/ipc_sync_message.h" typedef base::hash_map > PluginChannelMap; diff --git a/chrome/plugin/plugin_channel_base.h b/chrome/plugin/plugin_channel_base.h index e36db71aa136..dd70cba97beb 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 "ipc/ipc_sync_channel.h" +#include "chrome/common/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 b121b144582b..995d3180f5d4 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 "ipc/ipc_channel.h" +#include "chrome/common/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 1d5f72edc9eb..8c4629d3c42f 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 e88616552772..33e61111c0b7 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 "ipc/ipc_message.h" +#include "chrome/common/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 cc35227a2fc2..76abd601f5b5 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 "ipc/ipc_channel_proxy.h" +#include "chrome/common/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 e1938c2f8eb8..9059542b86f6 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 26afac62c6b8..709d51f78d77 100644 --- a/chrome/renderer/devtools_messages.h +++ b/chrome/renderer/devtools_messages.h @@ -5,12 +5,7 @@ #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 "ipc/ipc_message_macros.h" +#include "chrome/common/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 e3fa28eef105..b0e0a8ab7870 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 "ipc/ipc_message_macros.h" +#include "chrome/common/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 b4ad992b3d27..23b2d3557cb8 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 "ipc/ipc_message.h" +#include "chrome/common/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 d9959754c06f..cd8bcdb6f09a 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 0a7618ed8772..19fdd48c3af9 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 65543eb2c9e4..a89822a6f25a 100644 --- a/chrome/renderer/mock_render_thread.h +++ b/chrome/renderer/mock_render_thread.h @@ -7,7 +7,7 @@ #include -#include "ipc/ipc_test_sink.h" +#include "chrome/common/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 dca03c70d1fb..e8af23350d09 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 c03f88963505..808bedf6eef6 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 3e587908ecee..7ee2c046e2b0 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 6bb21bd3b697..c938f5bbdda6 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 2c20a4f8f7df..8af9733ee261 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 c18d3bd4721b..94c199db23e1 100644 --- a/chrome/renderer/webworker_proxy.h +++ b/chrome/renderer/webworker_proxy.h @@ -8,7 +8,7 @@ #include #include "base/basictypes.h" -#include "ipc/ipc_channel.h" +#include "chrome/common/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 b14cb6aa48b5..79d89750a09b 100644 --- a/chrome/test/automation/autocomplete_edit_proxy.h +++ b/chrome/test/automation/autocomplete_edit_proxy.h @@ -9,10 +9,9 @@ #include #include "chrome/browser/autocomplete/autocomplete.h" -#include "chrome/common/common_message_utils.h" +#include "chrome/common/ipc_message.h" +#include "chrome/common/ipc_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 9b24acc25778..5968f78c02ca 100644 --- a/chrome/test/automation/automation_messages.h +++ b/chrome/test/automation/automation_messages.h @@ -10,9 +10,8 @@ #include "base/basictypes.h" #include "chrome/browser/tab_contents/navigation_entry.h" #include "chrome/browser/tab_contents/security_style.h" -#include "chrome/common/common_message_utils.h" +#include "chrome/common/ipc_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. @@ -216,13 +215,8 @@ struct ParamTraits { } // 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 "ipc/ipc_message_macros.h" +#include "chrome/common/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 cc7d64413c80..59599b19c881 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 f31205d86b42..138edd07ee9d 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 16ee86ef869f..6f7d34f425d6 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 ... - 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 *) + 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 *) 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) - ipc/ipc_tests.cc RunTestClient - ipc/ipc_tests.cc main + chrome/common/ipc_tests.cc RunTestClient + chrome/common/ipc_tests.cc main ... Uninitialized memory read in WriteFile Error Location ... - 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 *) + 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 *) 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) - ipc/ipc_tests.cc RunTestClient - ipc/ipc_tests.cc main + chrome/common/ipc_tests.cc RunTestClient + chrome/common/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&) - 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 *) + 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 *) 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) - ipc/ipc_tests.cc RunTestClient - ipc/ipc_tests.cc main + chrome/common/ipc_tests.cc RunTestClient + chrome/common/ipc_tests.cc main ... Uninitialized memory read in strlen Error Location ... - 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 *) + 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 *) base/message_loop.cc MessageLoop::SignalWatcher(DWORD) base/message_loop.cc MessageLoop::Run(Dispatcher::MessageLoop *) base/message_loop.cc MessageLoop::Run(void) - ipc/ipc_tests.cc RunTestClient - ipc/ipc_tests.cc main + chrome/common/ipc_tests.cc RunTestClient + chrome/common/ipc_tests.cc main ... Uninitialized memory read in WriteFile Error Location ... - 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 *) + 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 *) base/message_loop.cc MessageLoop::SignalWatcher(DWORD) base/message_loop.cc MessageLoop::Run(Dispatcher::MessageLoop *) base/message_loop.cc MessageLoop::Run(void) - ipc/ipc_tests.cc RunTestClient - ipc/ipc_tests.cc main + chrome/common/ipc_tests.cc RunTestClient + chrome/common/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&) - 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 *) + 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 *) base/message_loop.cc MessageLoop::SignalWatcher(DWORD) base/message_loop.cc MessageLoop::Run(Dispatcher::MessageLoop *) base/message_loop.cc MessageLoop::Run(void) - ipc/ipc_tests.cc RunTestClient - ipc/ipc_tests.cc main + chrome/common/ipc_tests.cc RunTestClient + chrome/common/ipc_tests.cc main ... Uninitialized memory read in WriteFile Error Location ... - 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 *) + 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 *) base/message_loop.cc MessageLoop::SignalWatcher(DWORD) base/message_loop.cc MessageLoop::Run(Dispatcher::MessageLoop *) base/message_loop.cc MessageLoop::Run(void) - ipc/ipc_tests.cc RunTestClient - ipc/ipc_tests.cc main + chrome/common/ipc_tests.cc RunTestClient + chrome/common/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&) - 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 *) + 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 *) base/message_loop.cc MessageLoop::SignalWatcher(DWORD) base/message_loop.cc MessageLoop::Run(Dispatcher::MessageLoop *) base/message_loop.cc MessageLoop::Run(void) - ipc/ipc_tests.cc RunTestClient - ipc/ipc_tests.cc main + chrome/common/ipc_tests.cc RunTestClient + chrome/common/ipc_tests.cc main ... Uninitialized memory read in strlen Error Location ... - ipc/ipc_tests.cc Send - ipc/ipc_tests.cc RunTestClient - ipc/ipc_tests.cc main + chrome/common/ipc_tests.cc Send + chrome/common/ipc_tests.cc RunTestClient + chrome/common/ipc_tests.cc main ... Uninitialized memory read in WriteFile Error Location ... - 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 + 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 ... 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&) - ipc/ipc_tests.cc Send - ipc/ipc_tests.cc RunTestClient - ipc/ipc_tests.cc main + chrome/common/ipc_tests.cc Send + chrome/common/ipc_tests.cc RunTestClient + chrome/common/ipc_tests.cc main ... diff --git a/chrome/test/unit/unittests.vcproj b/chrome/test/unit/unittests.vcproj index 508470de417f..46f501bd02ce 100644 --- a/chrome/test/unit/unittests.vcproj +++ b/chrome/test/unit/unittests.vcproj @@ -883,6 +883,26 @@ RelativePath="..\..\common\gfx\icon_util_unittest.cc" > + + + + + + + + + + diff --git a/chrome/worker/webworkerclient_proxy.cc b/chrome/worker/webworkerclient_proxy.cc index da489a2b1367..33bcbc836d8f 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 "ipc/ipc_logging.h" +#include "chrome/common/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 5845d0bc15f4..31ee56dabcb9 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 "ipc/ipc_channel.h" +#include "chrome/common/ipc_channel.h" #include "googleurl/src/gurl.h" #include "webkit/glue/webworkerclient.h" diff --git a/ipc/ipc.gyp b/ipc/ipc.gyp deleted file mode 100644 index a2c1adc51923..000000000000 --- a/ipc/ipc.gyp +++ /dev/null @@ -1,82 +0,0 @@ -# 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/ipc/ipc_counters.cc b/ipc/ipc_counters.cc deleted file mode 100644 index 29bf3b5bd505..000000000000 --- a/ipc/ipc_counters.cc +++ /dev/null @@ -1,27 +0,0 @@ -// 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 deleted file mode 100644 index 647632a44b74..000000000000 --- a/ipc/ipc_counters.h +++ /dev/null @@ -1,22 +0,0 @@ -// 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/ipc/ipc_message_utils.cc b/ipc/ipc_message_utils.cc deleted file mode 100644 index 2ee70258b3ec..000000000000 --- a/ipc/ipc_message_utils.cc +++ /dev/null @@ -1,76 +0,0 @@ -// 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::Write(Message* m, const gfx::Point& p) { - m->WriteInt(p.x()); - m->WriteInt(p.y()); -} - -bool ParamTraits::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::Log(const gfx::Point& p, std::wstring* l) { - l->append(StringPrintf(L"(%d, %d)", p.x(), p.y())); -} - -void ParamTraits::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::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::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::Write(Message* m, const gfx::Size& p) { - m->WriteInt(p.width()); - m->WriteInt(p.height()); -} - -bool ParamTraits::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::Log(const gfx::Size& p, std::wstring* l) { - l->append(StringPrintf(L"(%d, %d)", p.width(), p.height())); -} - -} // namespace IPC diff --git a/ipc/ipc_switches.cc b/ipc/ipc_switches.cc deleted file mode 100644 index 9d45f7b6a4f7..000000000000 --- a/ipc/ipc_switches.cc +++ /dev/null @@ -1,17 +0,0 @@ -// 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 deleted file mode 100644 index 7dbc74619733..000000000000 --- a/ipc/ipc_switches.h +++ /dev/null @@ -1,19 +0,0 @@ -// 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__