diff options
128 files changed, 945 insertions, 745 deletions
@@ -101,6 +101,7 @@ include_rules = [ # Everybody can use some things. "+base", "+build", + "+ipc", # For now, we allow ICU to be included by specifying "unicode/...", although # this should probably change. @@ -70,7 +70,7 @@ 'filepath': 'media|Media|^third_party/ffmpeg/', }, 'ipc': { - 'filepath': 'chrome/common/ipc.*', + 'filepath': 'ipc/ipc.*', }, 'linux-sandboxing': { 'filepath': 'sandbox/linux/.*', diff --git a/base/file_descriptor_posix.h b/base/file_descriptor_posix.h index 0bcd4b6..e9199eda 100644 --- a/base/file_descriptor_posix.h +++ b/base/file_descriptor_posix.h @@ -12,7 +12,7 @@ namespace base { // able to use template specialisation to special-case their handling. // // WARNING: (Chromium only) There are subtleties to consider if serialising -// these objects over IPC. See comments in chrome/common/ipc_message_utils.h +// these objects over IPC. See comments in ipc/ipc_message_utils.h // above the template specialisation for this structure. // ----------------------------------------------------------------------------- struct FileDescriptor { diff --git a/build/all.gyp b/build/all.gyp index 14befd5..d33d1f6 100644 --- a/build/all.gyp +++ b/build/all.gyp @@ -15,6 +15,7 @@ '../app/app.gyp:*', '../base/base.gyp:*', '../chrome/chrome.gyp:*', + '../ipc/ipc.gyp:*', '../media/media.gyp:*', '../net/net.gyp:*', '../printing/printing.gyp:*', diff --git a/chrome/app/breakpad_linux.cc b/chrome/app/breakpad_linux.cc index d9c41fd..199371e 100644 --- a/chrome/app/breakpad_linux.cc +++ b/chrome/app/breakpad_linux.cc @@ -25,8 +25,8 @@ #include "breakpad/linux/linux_libc_support.h" #include "breakpad/linux/linux_syscall_support.h" #include "breakpad/linux/memory.h" -#include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_descriptors.h" +#include "chrome/common/chrome_switches.h" #include "chrome/installer/util/google_update_settings.h" static const char kUploadURL[] = diff --git a/chrome/browser/app_modal_dialog.cc b/chrome/browser/app_modal_dialog.cc index aa876cc..8385626 100644 --- a/chrome/browser/app_modal_dialog.cc +++ b/chrome/browser/app_modal_dialog.cc @@ -8,7 +8,7 @@ #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/common/notification_service.h" #include "chrome/common/notification_type.h" -#include "chrome/common/ipc_message.h" +#include "ipc/ipc_message.h" AppModalDialog::AppModalDialog(TabContents* tab_contents, const std::wstring& title, diff --git a/chrome/browser/automation/automation_provider.h b/chrome/browser/automation/automation_provider.h index ed23671..c28cb1c 100644 --- a/chrome/browser/automation/automation_provider.h +++ b/chrome/browser/automation/automation_provider.h @@ -25,10 +25,10 @@ #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_channel.h" #include "chrome/common/notification_registrar.h" #include "chrome/test/automation/automation_constants.h" +#include "ipc/ipc_message.h" +#include "ipc/ipc_channel.h" #if defined(OS_WIN) #include "views/event.h" #endif // defined(OS_WIN) diff --git a/chrome/browser/automation/automation_resource_message_filter.h b/chrome/browser/automation/automation_resource_message_filter.h index 7bec5ca..240bafb 100644 --- a/chrome/browser/automation/automation_resource_message_filter.h +++ b/chrome/browser/automation/automation_resource_message_filter.h @@ -9,7 +9,7 @@ #include "base/lock.h" #include "base/platform_thread.h" -#include "chrome/common/ipc_channel_proxy.h" +#include "ipc/ipc_channel_proxy.h" class URLRequestAutomationJob; class MessageLoop; diff --git a/chrome/browser/automation/automation_resource_tracker.h b/chrome/browser/automation/automation_resource_tracker.h index 859a179..9d3d137 100644 --- a/chrome/browser/automation/automation_resource_tracker.h +++ b/chrome/browser/automation/automation_resource_tracker.h @@ -8,10 +8,10 @@ #include <map> #include "base/basictypes.h" -#include "chrome/common/ipc_message.h" #include "chrome/common/notification_observer.h" #include "chrome/common/notification_registrar.h" #include "chrome/common/notification_type.h" +#include "ipc/ipc_message.h" template <class T> class Source; diff --git a/chrome/browser/automation/extension_port_container.h b/chrome/browser/automation/extension_port_container.h index 8eedd09..ae86dae 100644 --- a/chrome/browser/automation/extension_port_container.h +++ b/chrome/browser/automation/extension_port_container.h @@ -9,7 +9,7 @@ #include "base/basictypes.h" #include "base/ref_counted.h" -#include "chrome/common/ipc_message.h" +#include "ipc/ipc_message.h" class AutomationProvider; class ExtensionMessageService; diff --git a/chrome/browser/extensions/extension_message_service.h b/chrome/browser/extensions/extension_message_service.h index 832451d..3b4e367 100644 --- a/chrome/browser/extensions/extension_message_service.h +++ b/chrome/browser/extensions/extension_message_service.h @@ -12,8 +12,8 @@ #include "base/linked_ptr.h" #include "base/lock.h" #include "base/ref_counted.h" -#include "chrome/common/ipc_message.h" #include "chrome/common/notification_registrar.h" +#include "ipc/ipc_message.h" class MessageLoop; class Profile; diff --git a/chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h b/chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h index a495d97..edc8822 100644 --- a/chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h +++ b/chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_IN_PROCESS_WEBKIT_DOM_STORAGE_DISPATCHER_HOST_H_ #include "base/ref_counted.h" -#include "chrome/common/ipc_message.h" +#include "ipc/ipc_message.h" class WebKitContext; class WebKitThread; diff --git a/chrome/browser/jsmessage_box_handler.h b/chrome/browser/jsmessage_box_handler.h index a4c0bdb..856c1c5 100644 --- a/chrome/browser/jsmessage_box_handler.h +++ b/chrome/browser/jsmessage_box_handler.h @@ -7,7 +7,7 @@ #include <string> -#include "chrome/common/ipc_message.h" +#include "ipc/ipc_message.h" class GURL; class TabContents; diff --git a/chrome/browser/modal_html_dialog_delegate.h b/chrome/browser/modal_html_dialog_delegate.h index 17c2d7d..bcd5361 100644 --- a/chrome/browser/modal_html_dialog_delegate.h +++ b/chrome/browser/modal_html_dialog_delegate.h @@ -9,8 +9,8 @@ #include "base/gfx/size.h" #include "chrome/browser/dom_ui/html_dialog_ui.h" -#include "chrome/common/ipc_message.h" #include "chrome/common/notification_registrar.h" +#include "ipc/ipc_message.h" // This class can only be used on the UI thread. class ModalHtmlDialogDelegate diff --git a/chrome/browser/net/resolve_proxy_msg_helper.h b/chrome/browser/net/resolve_proxy_msg_helper.h index ee6f4af..81d2e7e 100644 --- a/chrome/browser/net/resolve_proxy_msg_helper.h +++ b/chrome/browser/net/resolve_proxy_msg_helper.h @@ -8,9 +8,9 @@ #include <deque> #include <string> -#include "chrome/common/ipc_message.h" -#include "net/base/completion_callback.h" #include "googleurl/src/gurl.h" +#include "ipc/ipc_message.h" +#include "net/base/completion_callback.h" #include "net/proxy/proxy_service.h" // This class holds the common logic used to respond to the messages: diff --git a/chrome/browser/plugin_process_host.cc b/chrome/browser/plugin_process_host.cc index bfe5ea8..b3b3756 100644 --- a/chrome/browser/plugin_process_host.cc +++ b/chrome/browser/plugin_process_host.cc @@ -34,14 +34,14 @@ #include "chrome/browser/renderer_host/browser_render_process_host.h" #include "chrome/browser/renderer_host/render_process_host.h" #include "chrome/browser/renderer_host/resource_dispatcher_host.h" -#include "chrome/common/chrome_descriptors.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_plugin_lib.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/logging_chrome.h" #include "chrome/common/plugin_messages.h" #include "chrome/common/render_messages.h" -#include "chrome/common/ipc_channel_handle.h" +#include "ipc/ipc_channel_handle.h" +#include "ipc/ipc_descriptors.h" #include "net/base/cookie_monster.h" #include "net/base/file_stream.h" #include "net/base/io_buffer.h" @@ -56,7 +56,7 @@ #endif #if defined(OS_POSIX) -#include "chrome/common/ipc_channel_posix.h" +#include "ipc/ipc_channel_posix.h" #endif #if defined(OS_LINUX) diff --git a/chrome/browser/plugin_process_host.h b/chrome/browser/plugin_process_host.h index 62efdbd..8c3a948 100644 --- a/chrome/browser/plugin_process_host.h +++ b/chrome/browser/plugin_process_host.h @@ -18,7 +18,7 @@ #include "chrome/browser/net/resolve_proxy_msg_helper.h" #include "chrome/browser/renderer_host/resource_message_filter.h" #include "chrome/common/child_process_host.h" -#include "chrome/common/ipc_channel_handle.h" +#include "ipc/ipc_channel_handle.h" #include "webkit/glue/webplugininfo.h" class URLRequestContext; diff --git a/chrome/browser/renderer_host/audio_renderer_host.cc b/chrome/browser/renderer_host/audio_renderer_host.cc index 4ba0a24..495a8ea 100644 --- a/chrome/browser/renderer_host/audio_renderer_host.cc +++ b/chrome/browser/renderer_host/audio_renderer_host.cc @@ -9,8 +9,8 @@ #include "base/shared_memory.h" #include "base/waitable_event.h" #include "chrome/browser/renderer_host/audio_renderer_host.h" -#include "chrome/common/ipc_logging.h" #include "chrome/common/render_messages.h" +#include "ipc/ipc_logging.h" namespace { diff --git a/chrome/browser/renderer_host/audio_renderer_host.h b/chrome/browser/renderer_host/audio_renderer_host.h index 01a3545..9326cf7 100644 --- a/chrome/browser/renderer_host/audio_renderer_host.h +++ b/chrome/browser/renderer_host/audio_renderer_host.h @@ -75,7 +75,7 @@ #include "base/ref_counted.h" #include "base/shared_memory.h" #include "base/waitable_event.h" -#include "chrome/common/ipc_message.h" +#include "ipc/ipc_message.h" #include "media/audio/audio_output.h" #include "media/audio/simple_sources.h" #include "testing/gtest/include/gtest/gtest_prod.h" diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc index f8142f5..2370fd3 100644 --- a/chrome/browser/renderer_host/browser_render_process_host.cc +++ b/chrome/browser/renderer_host/browser_render_process_host.cc @@ -46,8 +46,8 @@ #include "chrome/browser/spellchecker.h" #include "chrome/browser/visitedlink_master.h" #include "chrome/common/chrome_switches.h" -#include "chrome/common/chrome_descriptors.h" #include "chrome/common/child_process_info.h" +#include "chrome/common/chrome_descriptors.h" #include "chrome/common/logging_chrome.h" #include "chrome/common/notification_service.h" #include "chrome/common/process_watcher.h" diff --git a/chrome/browser/renderer_host/render_process_host.h b/chrome/browser/renderer_host/render_process_host.h index 93d94cdc..4ce3741 100644 --- a/chrome/browser/renderer_host/render_process_host.h +++ b/chrome/browser/renderer_host/render_process_host.h @@ -11,9 +11,9 @@ #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 "chrome/common/visitedlink_common.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 b1e6e8a..edace90 100644 --- a/chrome/browser/renderer_host/render_widget_host.h +++ b/chrome/browser/renderer_host/render_widget_host.h @@ -13,9 +13,9 @@ #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 "chrome/common/property_bag.h" +#include "ipc/ipc_channel.h" #include "testing/gtest/include/gtest/gtest_prod.h" #include "webkit/api/public/WebTextDirection.h" diff --git a/chrome/browser/renderer_host/resource_dispatcher_host.h b/chrome/browser/renderer_host/resource_dispatcher_host.h index 9a19249..7a0d4220 100644 --- a/chrome/browser/renderer_host/resource_dispatcher_host.h +++ b/chrome/browser/renderer_host/resource_dispatcher_host.h @@ -24,7 +24,7 @@ #include "chrome/browser/renderer_host/resource_handler.h" #include "chrome/common/child_process_info.h" #include "chrome/common/filter_policy.h" -#include "chrome/common/ipc_message.h" +#include "ipc/ipc_message.h" #include "net/url_request/url_request.h" #include "webkit/glue/resource_type.h" diff --git a/chrome/browser/renderer_host/resource_message_filter.h b/chrome/browser/renderer_host/resource_message_filter.h index 7ac5b85..379cfdb 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_registrar.h" #include "chrome/common/transport_dib.h" +#include "ipc/ipc_channel_proxy.h" #include "webkit/api/public/WebCache.h" #if defined(OS_WIN) diff --git a/chrome/browser/sandbox_policy.cc b/chrome/browser/sandbox_policy.cc index 8789c66..a447650 100644 --- a/chrome/browser/sandbox_policy.cc +++ b/chrome/browser/sandbox_policy.cc @@ -20,8 +20,8 @@ #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 "ipc/ipc_logging.h" #include "sandbox/src/sandbox.h" #include "webkit/glue/plugins/plugin_list.h" diff --git a/chrome/browser/tab_contents/render_view_host_manager_unittest.cc b/chrome/browser/tab_contents/render_view_host_manager_unittest.cc index 6cf549e..699b9e0 100644 --- a/chrome/browser/tab_contents/render_view_host_manager_unittest.cc +++ b/chrome/browser/tab_contents/render_view_host_manager_unittest.cc @@ -6,10 +6,10 @@ #include "chrome/browser/tab_contents/navigation_controller.h" #include "chrome/browser/tab_contents/navigation_entry.h" #include "chrome/browser/tab_contents/render_view_host_manager.h" -#include "chrome/common/ipc_message.h" #include "chrome/common/render_messages.h" #include "chrome/common/url_constants.h" #include "chrome/test/test_notification_tracker.h" +#include "ipc/ipc_message.h" #include "testing/gtest/include/gtest/gtest.h" class RenderViewHostManagerTest : public RenderViewHostTestHarness { diff --git a/chrome/browser/tab_contents/web_contents_unittest.cc b/chrome/browser/tab_contents/web_contents_unittest.cc index 15229a1..47426c4 100644 --- a/chrome/browser/tab_contents/web_contents_unittest.cc +++ b/chrome/browser/tab_contents/web_contents_unittest.cc @@ -12,10 +12,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" using webkit_glue::PasswordForm; diff --git a/chrome/browser/utility_process_host.cc b/chrome/browser/utility_process_host.cc index 0b33d90..d919b4c 100644 --- a/chrome/browser/utility_process_host.cc +++ b/chrome/browser/utility_process_host.cc @@ -18,7 +18,7 @@ #include "chrome/browser/sandbox_policy.h" #elif defined(OS_POSIX) #include "base/global_descriptors_posix.h" -#include "chrome/common/chrome_descriptors.h" +#include "ipc/ipc_descriptors.h" #endif UtilityProcessHost::UtilityProcessHost(ResourceDispatcherHost* rdh, diff --git a/chrome/browser/utility_process_host.h b/chrome/browser/utility_process_host.h index ba87a3e..329f856 100644 --- a/chrome/browser/utility_process_host.h +++ b/chrome/browser/utility_process_host.h @@ -11,7 +11,7 @@ #include "base/ref_counted.h" #include "base/task.h" #include "chrome/common/child_process_host.h" -#include "chrome/common/ipc_channel.h" +#include "ipc/ipc_channel.h" class CommandLine; class DictionaryValue; diff --git a/chrome/browser/views/about_ipc_dialog.cc b/chrome/browser/views/about_ipc_dialog.cc index f616855..75be114 100644 --- a/chrome/browser/views/about_ipc_dialog.cc +++ b/chrome/browser/views/about_ipc_dialog.cc @@ -6,7 +6,7 @@ // IPC_MESSAGE_LOG_ENABLED. We need to use it to define // IPC_MESSAGE_MACROS_LOG_ENABLED so render_messages.h will generate the // ViewMsgLog et al. functions. -#include "chrome/common/ipc_message.h" +#include "ipc/ipc_message.h" #ifdef IPC_MESSAGE_LOG_ENABLED #define IPC_MESSAGE_MACROS_LOG_ENABLED diff --git a/chrome/browser/views/about_ipc_dialog.h b/chrome/browser/views/about_ipc_dialog.h index d111eac..0ba6090 100644 --- a/chrome/browser/views/about_ipc_dialog.h +++ b/chrome/browser/views/about_ipc_dialog.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_VIEWS_ABOUT_IPC_DIALOG_H_ #include "base/singleton.h" -#include "chrome/common/ipc_logging.h" +#include "ipc/ipc_logging.h" #include "views/controls/button/button.h" #include "views/controls/table/table_view.h" #include "views/window/dialog_delegate.h" diff --git a/chrome/browser/worker_host/worker_process_host.cc b/chrome/browser/worker_host/worker_process_host.cc index d76fecb..c8ce3b1 100644 --- a/chrome/browser/worker_host/worker_process_host.cc +++ b/chrome/browser/worker_host/worker_process_host.cc @@ -19,12 +19,12 @@ #include "chrome/browser/child_process_security_policy.h" #include "chrome/browser/renderer_host/render_view_host.h" #include "chrome/browser/worker_host/worker_service.h" -#include "chrome/common/chrome_descriptors.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/debug_flags.h" #include "chrome/common/process_watcher.h" #include "chrome/common/render_messages.h" #include "chrome/common/worker_messages.h" +#include "ipc/ipc_descriptors.h" #include "net/base/registry_controlled_domain.h" #if defined(OS_WIN) diff --git a/chrome/browser/worker_host/worker_process_host.h b/chrome/browser/worker_host/worker_process_host.h index fca046e..00a6642 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 WorkerProcessHost : public ChildProcessHost { public: diff --git a/chrome/browser/worker_host/worker_service.h b/chrome/browser/worker_host/worker_service.h index ba5760f..45e8248 100644 --- a/chrome/browser/worker_host/worker_service.h +++ b/chrome/browser/worker_host/worker_service.h @@ -10,9 +10,9 @@ #include "base/basictypes.h" #include "base/singleton.h" #include "chrome/browser/worker_host/worker_process_host.h" -#include "chrome/common/ipc_message.h" #include "chrome/common/notification_registrar.h" #include "googleurl/src/gurl.h" +#include "ipc/ipc_message.h" class MessageLoop; diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp index 8adc0f7..d4f1810 100644 --- a/chrome/chrome.gyp +++ b/chrome/chrome.gyp @@ -300,6 +300,7 @@ '../base/base.gyp:base', '../base/base.gyp:base_gfx', '../build/temp_gyp/googleurl.gyp:googleurl', + '../ipc/ipc.gyp:ipc', '../net/net.gyp:net', '../skia/skia.gyp:skia', '../third_party/icu38/icu38.gyp:icui18n', @@ -361,6 +362,7 @@ 'common/chrome_constants.h', 'common/chrome_counters.cc', 'common/chrome_counters.h', + 'common/chrome_descriptors.h', 'common/chrome_paths.cc', 'common/chrome_paths.h', 'common/chrome_paths_internal.h', @@ -377,14 +379,14 @@ 'common/classfactory.cc', 'common/classfactory.h', 'common/common_glue.cc', + 'common/common_param_traits.cc', + 'common/common_param_traits.h', 'common/debug_flags.cc', 'common/debug_flags.h', 'common/devtools_messages.h', 'common/devtools_messages_internal.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/gtk_util.cc', @@ -393,25 +395,6 @@ 'common/histogram_synchronizer.h', 'common/important_file_writer.cc', 'common/important_file_writer.h', - 'common/ipc_channel.h', - 'common/ipc_channel_handle.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', @@ -3479,35 +3462,6 @@ ], }, { - 'target_name': 'ipc_tests', - 'type': 'executable', - 'msvs_guid': 'B92AE829-E1CD-4781-824A-DCB1603A1672', - 'dependencies': [ - 'common', - 'test_support_unit', - '../base/base.gyp:base', - '../testing/gtest.gyp:gtest', - ], - 'sources': [ - 'common/ipc_fuzzing_tests.cc', - 'common/ipc_send_fds_test.cc', - 'common/ipc_tests.cc', - 'common/ipc_tests.h', - ], - 'conditions': [ - ['OS=="linux"', { - 'dependencies': [ - '../build/linux/system.gyp:gtk', - ], - }], - ['OS=="linux" and toolkit_views==1', { - 'dependencies': [ - '../views/views.gyp:views', - ], - }], - ], - }, - { 'target_name': 'ui_tests', 'type': 'executable', 'msvs_guid': '76235B67-1C27-4627-8A33-4B2E1EF93EDE', @@ -3660,6 +3614,7 @@ 'test_support_unit', 'utility', '../app/app.gyp:app_resources', + '../ipc/ipc.gyp:ipc', '../net/net.gyp:net_resources', '../net/net.gyp:net_test_support', '../printing/printing.gyp:printing', @@ -3883,15 +3838,11 @@ 'common/bzip2_unittest.cc', 'common/child_process_logging_mac_unittest.mm', 'common/chrome_plugin_unittest.cc', + 'common/common_param_traits_unittest.cc', 'common/extensions/extension_unittest.cc', 'common/extensions/url_pattern_unittest.cc', 'common/extensions/user_script_unittest.cc', - 'common/file_descriptor_set_unittest.cc', 'common/important_file_writer_unittest.cc', - 'common/ipc_message_unittest.cc', - 'common/ipc_sync_channel_unittest.cc', - 'common/ipc_sync_message_unittest.cc', - 'common/ipc_sync_message_unittest.h', 'common/json_value_serializer_unittest.cc', 'common/mru_cache_unittest.cc', 'common/net/url_util_unittest.cc', @@ -4029,7 +3980,6 @@ ], 'sources!': [ 'browser/gtk/tabs/tab_renderer_gtk_unittest.cc', - 'common/file_descriptor_set_unittest.cc', 'common/net/url_util_unittest.cc', ], 'link_settings': { diff --git a/chrome/common/app_cache/app_cache_context_impl.h b/chrome/common/app_cache/app_cache_context_impl.h index dadf99d..ec2f25f 100644 --- a/chrome/common/app_cache/app_cache_context_impl.h +++ b/chrome/common/app_cache/app_cache_context_impl.h @@ -6,7 +6,7 @@ #define CHROME_COMMON_APP_CACHE_APP_CACHE_CONTEXT_IMPL_H_ #include "base/id_map.h" -#include "chrome/common/ipc_message.h" +#include "ipc/ipc_message.h" #include "webkit/glue/webappcachecontext.h" // A concrete implemenation of WebAppCacheContext for use in a child process. diff --git a/chrome/common/app_cache/app_cache_dispatcher.h b/chrome/common/app_cache/app_cache_dispatcher.h index c8baf28..3d4cbbd 100644 --- a/chrome/common/app_cache/app_cache_dispatcher.h +++ b/chrome/common/app_cache/app_cache_dispatcher.h @@ -6,7 +6,7 @@ #define CHROME_COMMON_APP_CACHE_APP_CACHE_DISPATCHER_H_ #include "base/basictypes.h" -#include "chrome/common/ipc_message.h" +#include "ipc/ipc_message.h" // Dispatches app cache related messages sent to a child process from the // main browser process. There is one instance per child process. Messages diff --git a/chrome/common/app_cache/app_cache_dispatcher_host.h b/chrome/common/app_cache/app_cache_dispatcher_host.h index e84a7fd..749e74a 100644 --- a/chrome/common/app_cache/app_cache_dispatcher_host.h +++ b/chrome/common/app_cache/app_cache_dispatcher_host.h @@ -6,7 +6,7 @@ #define CHROME_COMMON_APP_CACHE_APP_CACHE_DISPATCHER_HOST_H_ #include "base/id_map.h" -#include "chrome/common/ipc_message.h" +#include "ipc/ipc_message.h" #include "webkit/glue/webappcachecontext.h" class GURL; diff --git a/chrome/common/child_process_host.cc b/chrome/common/child_process_host.cc index 67d9a5a..b7cab7f 100644 --- a/chrome/common/child_process_host.cc +++ b/chrome/common/child_process_host.cc @@ -11,12 +11,12 @@ #include "base/singleton.h" #include "base/waitable_event.h" #include "chrome/browser/chrome_thread.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 3b97200..926bdd2 100644 --- a/chrome/common/child_process_host.h +++ b/chrome/common/child_process_host.h @@ -11,7 +11,7 @@ #include "base/basictypes.h" #include "base/scoped_ptr.h" #include "chrome/browser/renderer_host/resource_dispatcher_host.h" -#include "chrome/common/ipc_channel.h" +#include "ipc/ipc_channel.h" class NotificationType; diff --git a/chrome/common/child_thread.cc b/chrome/common/child_thread.cc index 4c97b72..15a98b3 100644 --- a/chrome/common/child_thread.cc +++ b/chrome/common/child_thread.cc @@ -8,8 +8,8 @@ #include "base/command_line.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 cc4abaa..1affe25 100644 --- a/chrome/common/child_thread.h +++ b/chrome/common/child_thread.h @@ -8,9 +8,9 @@ #include "base/basictypes.h" #include "base/scoped_ptr.h" #include "base/thread.h" -#include "chrome/common/ipc_sync_channel.h" #include "chrome/common/message_router.h" #include "chrome/common/resource_dispatcher.h" +#include "ipc/ipc_sync_channel.h" // Child processes's background thread should derive from this class. class ChildThread : public IPC::Channel::Listener, diff --git a/chrome/common/chrome_counters.cc b/chrome/common/chrome_counters.cc index 98a977b..fea0906 100644 --- a/chrome/common/chrome_counters.cc +++ b/chrome/common/chrome_counters.cc @@ -19,11 +19,6 @@ namespace chrome { // we'd leak the extraneous StatsCounter object once, and that // would be it. But these are small objects, so this is ok. -StatsCounter& Counters::ipc_send_counter() { - static StatsCounter* ctr = new StatsCounter("IPC.SendMsgCount"); - return *ctr; -} - StatsCounterTimer& Counters::chrome_main() { static StatsCounterTimer* ctr = new StatsCounterTimer("Chrome.Init"); return *ctr; diff --git a/chrome/common/chrome_counters.h b/chrome/common/chrome_counters.h index c7975f85..14cfa21 100644 --- a/chrome/common/chrome_counters.h +++ b/chrome/common/chrome_counters.h @@ -15,9 +15,6 @@ namespace chrome { class Counters { public: - // The number of messages sent on IPC channels. - static StatsCounter& ipc_send_counter(); - // The amount of time spent in chrome initialization. static StatsCounterTimer& chrome_main(); diff --git a/chrome/common/chrome_descriptors.h b/chrome/common/chrome_descriptors.h index c86eee5..8a4f6ee 100644 --- a/chrome/common/chrome_descriptors.h +++ b/chrome/common/chrome_descriptors.h @@ -5,12 +5,12 @@ #ifndef CHROME_COMMON_CHROME_DESCRIPTORS_H_ #define CHROME_COMMON_CHROME_DESCRIPTORS_H_ +#include "ipc/ipc_descriptors.h" // This is a list of global descriptor keys to be used with the // base::GlobalDescriptors object (see base/global_descriptors_posix.h) enum { - kPrimaryIPCChannel = 0, - kCrashDumpSignal = 1, - kSandboxIPCChannel = 2, // http://code.google.com/p/chromium/LinuxSandboxIPC + kCrashDumpSignal = kPrimaryIPCChannel + 1, + kSandboxIPCChannel = kPrimaryIPCChannel + 2, // http://code.google.com/p/chromium/LinuxSandboxIPC }; #endif // CHROME_COMMON_CHROME_DESCRIPTORS_H_ diff --git a/chrome/common/ipc_message_utils.cc b/chrome/common/common_param_traits.cc index e7ff956..38682ba 100644 --- a/chrome/common/ipc_message_utils.cc +++ b/chrome/common/common_param_traits.cc @@ -2,12 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/common/ipc_message_utils.h" +#include "chrome/common/common_param_traits.h" #include "base/gfx/rect.h" -#include "base/json_writer.h" -#include "base/scoped_ptr.h" -#include "base/values.h" #include "googleurl/src/gurl.h" #ifndef EXCLUDE_SKIA_DEPENDENCIES #include "third_party/skia/include/core/SkBitmap.h" @@ -16,8 +13,6 @@ namespace IPC { -const int kMaxRecursionDepth = 100; - #ifndef EXCLUDE_SKIA_DEPENDENCIES namespace { @@ -226,223 +221,5 @@ void ParamTraits<webkit_glue::WebApplicationInfo>::Log( l->append(L"<WebApplicationInfo>"); } -// Value serialization - -static bool ReadValue(const Message* m, void** iter, Value** value, - int recursion); - -static void WriteValue(Message* m, const Value* value, int recursion) { - if (recursion > kMaxRecursionDepth) { - LOG(WARNING) << "Max recursion depth hit in WriteValue."; - return; - } - - m->WriteInt(value->GetType()); - - switch (value->GetType()) { - case Value::TYPE_NULL: - break; - case Value::TYPE_BOOLEAN: { - bool val; - value->GetAsBoolean(&val); - WriteParam(m, val); - break; - } - case Value::TYPE_INTEGER: { - int val; - value->GetAsInteger(&val); - WriteParam(m, val); - break; - } - case Value::TYPE_REAL: { - double val; - value->GetAsReal(&val); - WriteParam(m, val); - break; - } - case Value::TYPE_STRING: { - std::string val; - value->GetAsString(&val); - WriteParam(m, val); - break; - } - case Value::TYPE_BINARY: { - NOTREACHED() << "Don't send BinaryValues over IPC."; - } - case Value::TYPE_DICTIONARY: { - const DictionaryValue* dict = static_cast<const DictionaryValue*>(value); - - WriteParam(m, static_cast<int>(dict->GetSize())); - - for (DictionaryValue::key_iterator it = dict->begin_keys(); - it != dict->end_keys(); ++it) { - Value* subval; - if (dict->Get(*it, &subval)) { - WriteParam(m, *it); - WriteValue(m, subval, recursion + 1); - } else { - NOTREACHED() << "DictionaryValue iterators are filthy liars."; - } - } - break; - } - case Value::TYPE_LIST: { - const ListValue* list = static_cast<const ListValue*>(value); - WriteParam(m, static_cast<int>(list->GetSize())); - for (size_t i = 0; i < list->GetSize(); ++i) { - Value* subval; - if (list->Get(i, &subval)) { - WriteValue(m, subval, recursion + 1); - } else { - NOTREACHED() << "ListValue::GetSize is a filthy liar."; - } - } - break; - } - } -} - -// Helper for ReadValue that reads a DictionaryValue into a pre-allocated -// object. -static bool ReadDictionaryValue(const Message* m, void** iter, - DictionaryValue* value, int recursion) { - int size; - if (!ReadParam(m, iter, &size)) - return false; - - for (int i = 0; i < size; ++i) { - std::wstring key; - Value* subval; - if (!ReadParam(m, iter, &key) || - !ReadValue(m, iter, &subval, recursion + 1)) - return false; - value->Set(key, subval); - } - - return true; -} - -// Helper for ReadValue that reads a ReadListValue into a pre-allocated -// object. -static bool ReadListValue(const Message* m, void** iter, - ListValue* value, int recursion) { - int size; - if (!ReadParam(m, iter, &size)) - return false; - - for (int i = 0; i < size; ++i) { - Value* subval; - if (!ReadValue(m, iter, &subval, recursion + 1)) - return false; - value->Set(i, subval); - } - - return true; -} - -static bool ReadValue(const Message* m, void** iter, Value** value, - int recursion) { - if (recursion > kMaxRecursionDepth) { - LOG(WARNING) << "Max recursion depth hit in ReadValue."; - return false; - } - - int type; - if (!ReadParam(m, iter, &type)) - return false; - - switch (type) { - case Value::TYPE_NULL: - *value = Value::CreateNullValue(); - break; - case Value::TYPE_BOOLEAN: { - bool val; - if (!ReadParam(m, iter, &val)) - return false; - *value = Value::CreateBooleanValue(val); - break; - } - case Value::TYPE_INTEGER: { - int val; - if (!ReadParam(m, iter, &val)) - return false; - *value = Value::CreateIntegerValue(val); - break; - } - case Value::TYPE_REAL: { - double val; - if (!ReadParam(m, iter, &val)) - return false; - *value = Value::CreateRealValue(val); - break; - } - case Value::TYPE_STRING: { - std::string val; - if (!ReadParam(m, iter, &val)) - return false; - *value = Value::CreateStringValue(val); - break; - } - case Value::TYPE_BINARY: { - NOTREACHED() << "Don't send BinaryValues over IPC."; - break; - } - case Value::TYPE_DICTIONARY: { - scoped_ptr<DictionaryValue> val(new DictionaryValue()); - if (!ReadDictionaryValue(m, iter, val.get(), recursion)) - return false; - *value = val.release(); - break; - } - case Value::TYPE_LIST: { - scoped_ptr<ListValue> val(new ListValue()); - if (!ReadListValue(m, iter, val.get(), recursion)) - return false; - *value = val.release(); - break; - } - default: - return false; - } - - return true; -} - -void ParamTraits<DictionaryValue>::Write(Message* m, const param_type& p) { - WriteValue(m, &p, 0); -} - -bool ParamTraits<DictionaryValue>::Read( - const Message* m, void** iter, param_type* r) { - int type; - if (!ReadParam(m, iter, &type) || type != Value::TYPE_DICTIONARY) - return false; - - return ReadDictionaryValue(m, iter, r, 0); -} - -void ParamTraits<DictionaryValue>::Log(const param_type& p, std::wstring* l) { - std::string json; - JSONWriter::Write(&p, false, &json); - l->append(UTF8ToWide(json)); -} - -void ParamTraits<ListValue>::Write(Message* m, const param_type& p) { - WriteValue(m, &p, 0); -} - -bool ParamTraits<ListValue>::Read( - const Message* m, void** iter, param_type* r) { - int type; - if (!ReadParam(m, iter, &type) || type != Value::TYPE_LIST) - return false; - - return ReadListValue(m, iter, r, 0); -} - -void ParamTraits<ListValue>::Log(const param_type& p, std::wstring* l) { - std::string json; - JSONWriter::Write(&p, false, &json); - l->append(UTF8ToWide(json)); -} } // namespace IPC + diff --git a/chrome/common/common_param_traits.h b/chrome/common/common_param_traits.h new file mode 100644 index 0000000..c34d55f --- /dev/null +++ b/chrome/common/common_param_traits.h @@ -0,0 +1,251 @@ +// 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. + +// This file is used to define IPC::ParamTraits<> specializations for a number +// of types so that they can be serialized over IPC. IPC::ParamTraits<> +// specializations for basic types (like int and std::string) and types in the +// 'base' project can be found in ipc/ipc_message_utils.h. This file contains +// specializations for types that are shared by more than one child process. + +#ifndef CHROME_COMMON_COMMON_PARAM_TRAITS_H_ +#define CHROME_COMMON_COMMON_PARAM_TRAITS_H_ + +#include "base/gfx/native_widget_types.h" +#include "chrome/common/thumbnail_score.h" +#include "chrome/common/transport_dib.h" +#include "ipc/ipc_message_utils.h" +#include "net/url_request/url_request_status.h" +#include "webkit/glue/webcursor.h" +#include "webkit/glue/window_open_disposition.h" + +// Forward declarations. +class GURL; +class SkBitmap; +class DictionaryValue; +class ListValue; + +namespace gfx { +class Point; +class Rect; +class Size; +} // namespace gfx + +namespace webkit_glue { +struct WebApplicationInfo; +} // namespace webkit_glue + +namespace IPC { + +template <> +struct ParamTraits<SkBitmap> { + typedef SkBitmap param_type; + static void Write(Message* m, const param_type& p); + + // Note: This function expects parameter |r| to be of type &SkBitmap since + // r->SetConfig() and r->SetPixels() are called. + static bool Read(const Message* m, void** iter, param_type* r); + + static void Log(const param_type& p, std::wstring* l); +}; + + +template <> +struct ParamTraits<GURL> { + typedef GURL param_type; + static void Write(Message* m, const param_type& p); + static bool Read(const Message* m, void** iter, param_type* p); + static void Log(const param_type& p, std::wstring* l); +}; + + +template <> +struct ParamTraits<gfx::Point> { + typedef gfx::Point 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); +}; + +template <> +struct ParamTraits<gfx::Rect> { + typedef gfx::Rect 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); +}; + +template <> +struct ParamTraits<gfx::Size> { + typedef gfx::Size 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); +}; + +template <> +struct ParamTraits<gfx::NativeWindow> { + typedef gfx::NativeWindow param_type; + static void Write(Message* m, const param_type& p) { + m->WriteIntPtr(reinterpret_cast<intptr_t>(p)); + } + static bool Read(const Message* m, void** iter, param_type* r) { + DCHECK_EQ(sizeof(param_type), sizeof(intptr_t)); + return m->ReadIntPtr(iter, reinterpret_cast<intptr_t*>(r)); + } + static void Log(const param_type& p, std::wstring* l) { + l->append(StringPrintf(L"0x%X", p)); + } +}; + + +template <> +struct ParamTraits<WindowOpenDisposition> { + typedef WindowOpenDisposition param_type; + static void Write(Message* m, const param_type& p) { + m->WriteInt(p); + } + static bool Read(const Message* m, void** iter, param_type* r) { + int temp; + bool res = m->ReadInt(iter, &temp); + *r = static_cast<WindowOpenDisposition>(temp); + return res; + } + static void Log(const param_type& p, std::wstring* l) { + l->append(StringPrintf(L"%d", p)); + } +}; + + +template <> +struct ParamTraits<WebCursor> { + typedef WebCursor param_type; + static void Write(Message* m, const param_type& p) { + p.Serialize(m); + } + static bool Read(const Message* m, void** iter, param_type* r) { + return r->Deserialize(m, iter); + } + static void Log(const param_type& p, std::wstring* l) { + l->append(L"<WebCursor>"); + } +}; + + +template <> +struct ParamTraits<webkit_glue::WebApplicationInfo> { + typedef webkit_glue::WebApplicationInfo param_type; + static void Write(Message* m, const param_type& p); + static bool Read(const Message* m, void** iter, param_type* r); + static void Log(const param_type& p, std::wstring* l); +}; + + +#if defined(OS_WIN) +template<> +struct ParamTraits<TransportDIB::Id> { + typedef TransportDIB::Id param_type; + static void Write(Message* m, const param_type& p) { + WriteParam(m, p.handle); + WriteParam(m, p.sequence_num); + } + static bool Read(const Message* m, void** iter, param_type* r) { + return (ReadParam(m, iter, &r->handle) && + ReadParam(m, iter, &r->sequence_num)); + } + static void Log(const param_type& p, std::wstring* l) { + l->append(L"TransportDIB("); + LogParam(p.handle, l); + l->append(L", "); + LogParam(p.sequence_num, l); + l->append(L")"); + } +}; +#endif + +// Traits for URLRequestStatus +template <> +struct ParamTraits<URLRequestStatus> { + typedef URLRequestStatus param_type; + static void Write(Message* m, const param_type& p) { + WriteParam(m, static_cast<int>(p.status())); + WriteParam(m, p.os_error()); + } + static bool Read(const Message* m, void** iter, param_type* r) { + int status, os_error; + if (!ReadParam(m, iter, &status) || + !ReadParam(m, iter, &os_error)) + return false; + r->set_status(static_cast<URLRequestStatus::Status>(status)); + r->set_os_error(os_error); + return true; + } + static void Log(const param_type& p, std::wstring* l) { + std::wstring status; + switch (p.status()) { + case URLRequestStatus::SUCCESS: + status = L"SUCCESS"; + break; + case URLRequestStatus::IO_PENDING: + status = L"IO_PENDING "; + break; + case URLRequestStatus::HANDLED_EXTERNALLY: + status = L"HANDLED_EXTERNALLY"; + break; + case URLRequestStatus::CANCELED: + status = L"CANCELED"; + break; + case URLRequestStatus::FAILED: + status = L"FAILED"; + break; + default: + status = L"UNKNOWN"; + break; + } + if (p.status() == URLRequestStatus::FAILED) + l->append(L"("); + + LogParam(status, l); + + if (p.status() == URLRequestStatus::FAILED) { + l->append(L", "); + LogParam(p.os_error(), l); + l->append(L")"); + } + } +}; + +template<> +struct ParamTraits<ThumbnailScore> { + typedef ThumbnailScore param_type; + static void Write(Message* m, const param_type& p) { + IPC::ParamTraits<double>::Write(m, p.boring_score); + IPC::ParamTraits<bool>::Write(m, p.good_clipping); + IPC::ParamTraits<bool>::Write(m, p.at_top); + IPC::ParamTraits<base::Time>::Write(m, p.time_at_snapshot); + } + static bool Read(const Message* m, void** iter, param_type* r) { + double boring_score; + bool good_clipping, at_top; + base::Time time_at_snapshot; + if (!IPC::ParamTraits<double>::Read(m, iter, &boring_score) || + !IPC::ParamTraits<bool>::Read(m, iter, &good_clipping) || + !IPC::ParamTraits<bool>::Read(m, iter, &at_top) || + !IPC::ParamTraits<base::Time>::Read(m, iter, &time_at_snapshot)) + return false; + + r->boring_score = boring_score; + r->good_clipping = good_clipping; + r->at_top = at_top; + r->time_at_snapshot = time_at_snapshot; + return true; + } + static void Log(const param_type& p, std::wstring* l) { + l->append(StringPrintf(L"(%f, %d, %d)", + p.boring_score, p.good_clipping, p.at_top)); + } +}; + +} // namespace IPC + +#endif // CHROME_COMMON_COMMON_PARAM_TRAITS_H_ diff --git a/chrome/common/ipc_message_unittest.cc b/chrome/common/common_param_traits_unittest.cc index 332f529..f3a7e92 100644 --- a/chrome/common/ipc_message_unittest.cc +++ b/chrome/common/common_param_traits_unittest.cc @@ -6,9 +6,10 @@ #include "base/scoped_ptr.h" #include "base/values.h" -#include "chrome/common/ipc_message.h" -#include "chrome/common/ipc_message_utils.h" +#include "chrome/common/common_param_traits.h" #include "googleurl/src/gurl.h" +#include "ipc/ipc_message.h" +#include "ipc/ipc_message_utils.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/skia/include/core/SkBitmap.h" diff --git a/chrome/common/devtools_messages.h b/chrome/common/devtools_messages.h index 3321240e..abb740d 100644 --- a/chrome/common/devtools_messages.h +++ b/chrome/common/devtools_messages.h @@ -6,6 +6,6 @@ #define CHROME_COMMON_DEVTOOLS_MESSAGES_H_ #define MESSAGES_INTERNAL_FILE "chrome/common/devtools_messages_internal.h" -#include "chrome/common/ipc_message_macros.h" +#include "ipc/ipc_message_macros.h" #endif // CHROME_COMMON_DEVTOOLS_MESSAGES_H_ diff --git a/chrome/common/devtools_messages_internal.h b/chrome/common/devtools_messages_internal.h index 3778497..4411a21 100644 --- a/chrome/common/devtools_messages_internal.h +++ b/chrome/common/devtools_messages_internal.h @@ -42,7 +42,7 @@ // // This file describes developer tools message types. -#include "chrome/common/ipc_message_macros.h" +#include "ipc/ipc_message_macros.h" // These are messages sent from DevToolsAgent to DevToolsClient through the // browser. diff --git a/chrome/common/extensions/extension_unpacker.cc b/chrome/common/extensions/extension_unpacker.cc index 06957de..d3839a9 100644 --- a/chrome/common/extensions/extension_unpacker.cc +++ b/chrome/common/extensions/extension_unpacker.cc @@ -11,13 +11,14 @@ #include "base/thread.h" #include "base/values.h" #include "net/base/file_stream.h" +#include "chrome/common/common_param_traits.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/extensions/extension_constants.h" -#include "chrome/common/ipc_message_utils.h" #include "chrome/common/json_value_serializer.h" #include "chrome/common/notification_service.h" #include "chrome/common/url_constants.h" #include "chrome/common/zip.h" +#include "ipc/ipc_message_utils.h" #include "third_party/skia/include/core/SkBitmap.h" #include "webkit/glue/image_decoder.h" diff --git a/chrome/common/ipc_maybe.h b/chrome/common/ipc_maybe.h deleted file mode 100644 index de45dc0..0000000 --- a/chrome/common/ipc_maybe.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef CHROME_COMMON_MAYBE_H_ -#define CHROME_COMMON_MAYBE_H_ - -namespace IPC { - -// The Maybe type can be used to avoid serialising a type when it's invalid. -// This is most useful in conjunction with FileDescriptor, as there's no -// possible invalid value which can be serialised (one can type to use -1, but -// the IPC channel will fail). It may also be useful if the invalid value is -// otherwise expensive to serialise. -template<typename A> -struct Maybe { - bool valid; - A value; -}; - -} // namespace IPC - -#endif // CHROME_COMMON_MAYBE_H_ diff --git a/chrome/common/ipc_test_sink.h b/chrome/common/ipc_test_sink.h index fd9faee..995ae38 100644 --- a/chrome/common/ipc_test_sink.h +++ b/chrome/common/ipc_test_sink.h @@ -9,7 +9,7 @@ #include <vector> #include "base/basictypes.h" -#include "chrome/common/ipc_message.h" +#include "ipc/ipc_message.h" namespace IPC { diff --git a/chrome/common/logging_chrome.cc b/chrome/common/logging_chrome.cc index 66a49cf..3bcfd23 100644 --- a/chrome/common/logging_chrome.cc +++ b/chrome/common/logging_chrome.cc @@ -72,6 +72,10 @@ void InitChromeLogging(const CommandLine& command_line, DCHECK(!chrome_logging_initialized_) << "Attempted to initialize logging when it was already initialized."; +#if defined(OS_POSIX) && defined(IPC_MESSAGE_LOG_ENABLED) + IPC::Logging::SetLoggerFunctions(g_log_function_mapping); +#endif + // only use OutputDebugString in debug mode #ifdef NDEBUG bool enable_logging = false; diff --git a/chrome/common/message_router.h b/chrome/common/message_router.h index d23e2f3..ef18aaa 100644 --- a/chrome/common/message_router.h +++ b/chrome/common/message_router.h @@ -6,7 +6,7 @@ #define CHROME_COMMON_MESSAGE_ROUTER_H__ #include "base/id_map.h" -#include "chrome/common/ipc_channel.h" +#include "ipc/ipc_channel.h" // The MessageRouter handles all incoming messages sent to it by routing them // to the correct listener. Routing is based on the Message's routing ID. diff --git a/chrome/common/plugin_messages.h b/chrome/common/plugin_messages.h index 3b43b8b..dd1ee18 100644 --- a/chrome/common/plugin_messages.h +++ b/chrome/common/plugin_messages.h @@ -16,9 +16,10 @@ #include "base/gfx/native_widget_types.h" #include "base/gfx/rect.h" #include "base/basictypes.h" -#include "chrome/common/ipc_message_utils.h" +#include "chrome/common/common_param_traits.h" #include "chrome/common/webkit_param_traits.h" #include "googleurl/src/gurl.h" +#include "ipc/ipc_message_utils.h" #include "third_party/npapi/bindings/npapi.h" #include "webkit/api/public/WebInputEvent.h" #include "webkit/glue/npruntime_util.h" @@ -408,6 +409,6 @@ struct ParamTraits<NPVariant_Param> { #define MESSAGES_INTERNAL_FILE "chrome/common/plugin_messages_internal.h" -#include "chrome/common/ipc_message_macros.h" +#include "ipc/ipc_message_macros.h" #endif // CHROME_COMMON_PLUGIN_MESSAGES_H__ diff --git a/chrome/common/plugin_messages_internal.h b/chrome/common/plugin_messages_internal.h index 974de00..8631973 100644 --- a/chrome/common/plugin_messages_internal.h +++ b/chrome/common/plugin_messages_internal.h @@ -5,7 +5,7 @@ #include "base/gfx/native_widget_types.h" #include "base/shared_memory.h" #include "build/build_config.h" -#include "chrome/common/ipc_message_macros.h" +#include "ipc/ipc_message_macros.h" #include "webkit/glue/webcursor.h" #if defined(OS_POSIX) diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h index 2b621456..d3faea0 100644 --- a/chrome/common/render_messages.h +++ b/chrome/common/render_messages.h @@ -14,14 +14,15 @@ #include "base/ref_counted.h" #include "base/shared_memory.h" #include "chrome/browser/renderer_host/resource_handler.h" +#include "chrome/common/common_param_traits.h" #include "chrome/common/filter_policy.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/renderer_preferences.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" @@ -1949,6 +1950,6 @@ struct ParamTraits<ViewHostMsg_ScriptedPrint_Params> { #define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h" -#include "chrome/common/ipc_message_macros.h" +#include "ipc/ipc_message_macros.h" #endif // CHROME_COMMON_RENDER_MESSAGES_H_ diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h index 040cd11..5080116 100644 --- a/chrome/common/render_messages_internal.h +++ b/chrome/common/render_messages_internal.h @@ -17,9 +17,9 @@ #include "base/gfx/native_widget_types.h" #include "base/shared_memory.h" #include "base/values.h" -#include "chrome/common/ipc_channel_handle.h" -#include "chrome/common/ipc_message_macros.h" #include "chrome/common/transport_dib.h" +#include "ipc/ipc_channel_handle.h" +#include "ipc/ipc_message_macros.h" #include "third_party/skia/include/core/SkBitmap.h" #include "webkit/glue/dom_operations.h" #include "webkit/glue/webappcachecontext.h" diff --git a/chrome/common/resource_dispatcher.h b/chrome/common/resource_dispatcher.h index 1ba1fa5..2424e2d 100644 --- a/chrome/common/resource_dispatcher.h +++ b/chrome/common/resource_dispatcher.h @@ -14,7 +14,7 @@ #include "base/shared_memory.h" #include "base/task.h" #include "chrome/common/filter_policy.h" -#include "chrome/common/ipc_channel.h" +#include "ipc/ipc_channel.h" #include "webkit/glue/resource_loader_bridge.h" struct ResourceResponseHead; diff --git a/chrome/common/webkit_param_traits.h b/chrome/common/webkit_param_traits.h index 1263285..b7e7e0b 100644 --- a/chrome/common/webkit_param_traits.h +++ b/chrome/common/webkit_param_traits.h @@ -23,7 +23,7 @@ #ifndef CHROME_COMMON_WEBKIT_PARAM_TRAITS_H_ #define CHROME_COMMON_WEBKIT_PARAM_TRAITS_H_ -#include "chrome/common/ipc_message_utils.h" +#include "ipc/ipc_message_utils.h" #include "webkit/api/public/WebCache.h" #include "webkit/api/public/WebCompositionCommand.h" #include "webkit/api/public/WebConsoleMessage.h" diff --git a/chrome/common/worker_messages.h b/chrome/common/worker_messages.h index f7a7c9cc..80004e5 100644 --- a/chrome/common/worker_messages.h +++ b/chrome/common/worker_messages.h @@ -11,7 +11,8 @@ #include <string> #include "base/basictypes.h" -#include "chrome/common/ipc_message_utils.h" +#include "chrome/common/common_param_traits.h" +#include "ipc/ipc_message_utils.h" // Parameters structure for WorkerHostMsg_PostConsoleMessageToWorkerObject, // which has too many data parameters to be reasonably put in a predefined @@ -75,6 +76,6 @@ struct ParamTraits<WorkerHostMsg_PostConsoleMessageToWorkerObject_Params> { } // namespace IPC #define MESSAGES_INTERNAL_FILE "chrome/common/worker_messages_internal.h" -#include "chrome/common/ipc_message_macros.h" +#include "ipc/ipc_message_macros.h" #endif // CHROME_COMMON_WORKER_MESSAGES_H_ diff --git a/chrome/common/worker_messages_internal.h b/chrome/common/worker_messages_internal.h index 74063c1..9059719 100644 --- a/chrome/common/worker_messages_internal.h +++ b/chrome/common/worker_messages_internal.h @@ -3,8 +3,8 @@ // found in the LICENSE file. #include "base/string16.h" -#include "chrome/common/ipc_message_macros.h" #include "googleurl/src/gurl.h" +#include "ipc/ipc_message_macros.h" //----------------------------------------------------------------------------- diff --git a/chrome/plugin/npobject_proxy.h b/chrome/plugin/npobject_proxy.h index afeb207..8858a1b 100644 --- a/chrome/plugin/npobject_proxy.h +++ b/chrome/plugin/npobject_proxy.h @@ -9,8 +9,8 @@ #define CHROME_PLUGIN_NPOBJECT_PROXY_H_ #include "base/ref_counted.h" -#include "chrome/common/ipc_channel.h" #include "googleurl/src/gurl.h" +#include "ipc/ipc_channel.h" #include "third_party/npapi/bindings/npruntime.h" class PluginChannelBase; diff --git a/chrome/plugin/npobject_stub.h b/chrome/plugin/npobject_stub.h index acfd7727..da0745c 100644 --- a/chrome/plugin/npobject_stub.h +++ b/chrome/plugin/npobject_stub.h @@ -11,8 +11,8 @@ #include <vector> #include "base/ref_counted.h" -#include "chrome/common/ipc_channel.h" #include "googleurl/src/gurl.h" +#include "ipc/ipc_channel.h" namespace base { class WaitableEvent; diff --git a/chrome/plugin/plugin_channel.cc b/chrome/plugin/plugin_channel.cc index 7977218..7f6f7d6 100644 --- a/chrome/plugin/plugin_channel.cc +++ b/chrome/plugin/plugin_channel.cc @@ -14,7 +14,7 @@ #include "chrome/plugin/plugin_thread.h" #if defined(OS_POSIX) -#include "chrome/common/ipc_channel_posix.h" +#include "ipc/ipc_channel_posix.h" #endif PluginChannel* PluginChannel::GetPluginChannel( diff --git a/chrome/plugin/plugin_channel_base.cc b/chrome/plugin/plugin_channel_base.cc index c05321b..4ef42ae 100644 --- a/chrome/plugin/plugin_channel_base.cc +++ b/chrome/plugin/plugin_channel_base.cc @@ -6,7 +6,7 @@ #include "base/hash_tables.h" #include "chrome/common/child_process.h" -#include "chrome/common/ipc_sync_message.h" +#include "ipc/ipc_sync_message.h" typedef base::hash_map<std::string, scoped_refptr<PluginChannelBase> > PluginChannelMap; diff --git a/chrome/plugin/plugin_channel_base.h b/chrome/plugin/plugin_channel_base.h index 877ce70..9c72294 100644 --- a/chrome/plugin/plugin_channel_base.h +++ b/chrome/plugin/plugin_channel_base.h @@ -12,8 +12,8 @@ #include "base/message_loop.h" #include "base/ref_counted.h" #include "base/scoped_ptr.h" -#include "chrome/common/ipc_sync_channel.h" #include "chrome/common/message_router.h" +#include "ipc/ipc_sync_channel.h" // Encapsulates an IPC channel between a renderer and a plugin process. class PluginChannelBase : public IPC::Channel::Listener, diff --git a/chrome/plugin/plugin_main.cc b/chrome/plugin/plugin_main.cc index 375831a..7361d64 100644 --- a/chrome/plugin/plugin_main.cc +++ b/chrome/plugin/plugin_main.cc @@ -23,8 +23,8 @@ #include "chrome/test/injection_test_dll.h" #include "sandbox/src/sandbox.h" #elif defined(OS_LINUX) -#include "chrome/common/chrome_descriptors.h" #include "base/global_descriptors_posix.h" +#include "ipc/ipc_descriptors.h" #endif // main() routine for running as the plugin process. diff --git a/chrome/plugin/webplugin_delegate_stub.h b/chrome/plugin/webplugin_delegate_stub.h index 15b88a8..2def46c 100644 --- a/chrome/plugin/webplugin_delegate_stub.h +++ b/chrome/plugin/webplugin_delegate_stub.h @@ -11,9 +11,9 @@ #include "base/ref_counted.h" #include "base/shared_memory.h" #include "base/task.h" -#include "chrome/common/ipc_channel.h" #include "chrome/common/transport_dib.h" #include "googleurl/src/gurl.h" +#include "ipc/ipc_channel.h" #include "third_party/npapi/bindings/npapi.h" class PluginChannel; diff --git a/chrome/plugin/webplugin_proxy.h b/chrome/plugin/webplugin_proxy.h index b27e95b..1b1468e 100644 --- a/chrome/plugin/webplugin_proxy.h +++ b/chrome/plugin/webplugin_proxy.h @@ -16,10 +16,10 @@ #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 "chrome/common/transport_dib.h" #include "googleurl/src/gurl.h" +#include "ipc/ipc_message.h" #include "webkit/glue/webplugin.h" namespace base { diff --git a/chrome/renderer/audio_message_filter.cc b/chrome/renderer/audio_message_filter.cc index 0714b71..b875f92 100644 --- a/chrome/renderer/audio_message_filter.cc +++ b/chrome/renderer/audio_message_filter.cc @@ -4,9 +4,9 @@ #include "base/histogram.h" #include "base/message_loop.h" -#include "chrome/common/ipc_logging.h" #include "chrome/common/render_messages.h" #include "chrome/renderer/audio_message_filter.h" +#include "ipc/ipc_logging.h" namespace { diff --git a/chrome/renderer/audio_message_filter.h b/chrome/renderer/audio_message_filter.h index 7626b3c..7fa17cb 100644 --- a/chrome/renderer/audio_message_filter.h +++ b/chrome/renderer/audio_message_filter.h @@ -12,7 +12,7 @@ #include "base/id_map.h" #include "base/shared_memory.h" -#include "chrome/common/ipc_channel_proxy.h" +#include "ipc/ipc_channel_proxy.h" #include "media/audio/audio_output.h" #include "testing/gtest/include/gtest/gtest_prod.h" diff --git a/chrome/renderer/automation/dom_automation_controller.h b/chrome/renderer/automation/dom_automation_controller.h index 94720f7..bc6f5fe 100644 --- a/chrome/renderer/automation/dom_automation_controller.h +++ b/chrome/renderer/automation/dom_automation_controller.h @@ -5,7 +5,7 @@ #ifndef CHROME_RENDERER_AUTOMATION_DOM_AUTOMATION_CONTROLLER_H__ #define CHROME_RENDERER_AUTOMATION_DOM_AUTOMATION_CONTROLLER_H__ -#include "chrome/common/ipc_message.h" +#include "ipc/ipc_message.h" #include "webkit/glue/cpp_bound_class.h" /* DomAutomationController class: diff --git a/chrome/renderer/devtools_agent_filter.h b/chrome/renderer/devtools_agent_filter.h index 91872e4..c04a44a4 100644 --- a/chrome/renderer/devtools_agent_filter.h +++ b/chrome/renderer/devtools_agent_filter.h @@ -8,7 +8,7 @@ #include <set> #include <string> -#include "chrome/common/ipc_channel_proxy.h" +#include "ipc/ipc_channel_proxy.h" class WebDevToolsAgent; diff --git a/chrome/renderer/dom_ui_bindings.h b/chrome/renderer/dom_ui_bindings.h index 23b2d35..b4ad992 100644 --- a/chrome/renderer/dom_ui_bindings.h +++ b/chrome/renderer/dom_ui_bindings.h @@ -5,7 +5,7 @@ #ifndef CHROME_RENDERER_DOM_UI_BINDINGS_H__ #define CHROME_RENDERER_DOM_UI_BINDINGS_H__ -#include "chrome/common/ipc_message.h" +#include "ipc/ipc_message.h" #include "webkit/glue/cpp_bound_class.h" // A DOMBoundBrowserObject is a backing for some object bound to the window diff --git a/chrome/renderer/external_host_bindings.h b/chrome/renderer/external_host_bindings.h index cd8bcdb..d995975 100644 --- a/chrome/renderer/external_host_bindings.h +++ b/chrome/renderer/external_host_bindings.h @@ -5,8 +5,8 @@ #ifndef CHROME_RENDERER_EXTERNAL_HOST_BINDINGS_H_ #define CHROME_RENDERER_EXTERNAL_HOST_BINDINGS_H_ -#include "chrome/common/ipc_message.h" #include "chrome/renderer/dom_ui_bindings.h" +#include "ipc/ipc_message.h" // ExternalHostBindings is the class backing the "externalHost" object // accessible from Javascript diff --git a/chrome/renderer/mock_printer.cc b/chrome/renderer/mock_printer.cc index 4462ce7..2da66ae 100644 --- a/chrome/renderer/mock_printer.cc +++ b/chrome/renderer/mock_printer.cc @@ -7,8 +7,8 @@ #include "base/file_util.h" #include "base/logging.h" #include "base/shared_memory.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" MockPrinter::MockPrinter() diff --git a/chrome/renderer/mock_render_thread.cc b/chrome/renderer/mock_render_thread.cc index 17dab52..e99c618 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/plugin_channel_host.cc b/chrome/renderer/plugin_channel_host.cc index 0befaab..04d7b4f 100644 --- a/chrome/renderer/plugin_channel_host.cc +++ b/chrome/renderer/plugin_channel_host.cc @@ -7,7 +7,7 @@ #include "chrome/common/plugin_messages.h" #if defined(OS_POSIX) -#include "chrome/common/ipc_channel_posix.h" +#include "ipc/ipc_channel_posix.h" #endif // A simple MessageFilter that will ignore all messages and respond to sync diff --git a/chrome/renderer/render_process.cc b/chrome/renderer/render_process.cc index fd06081..1b8509f 100644 --- a/chrome/renderer/render_process.cc +++ b/chrome/renderer/render_process.cc @@ -24,11 +24,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 "media/base/media.h" #include "webkit/glue/webkit_glue.h" diff --git a/chrome/renderer/render_thread_unittest.cc b/chrome/renderer/render_thread_unittest.cc index bb2e297..76491fe 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 005b4b6..7c6e592 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 "third_party/skia/include/core/SkBitmap.h" #include "webkit/api/public/WebCompositionCommand.h" diff --git a/chrome/renderer/renderer_main_unittest.cc b/chrome/renderer/renderer_main_unittest.cc index 605101e..598277a 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.cc b/chrome/renderer/webplugin_delegate_proxy.cc index 524b908..34a728d 100644 --- a/chrome/renderer/webplugin_delegate_proxy.cc +++ b/chrome/renderer/webplugin_delegate_proxy.cc @@ -41,7 +41,7 @@ #include "webkit/glue/webview.h" #if defined(OS_POSIX) -#include "chrome/common/ipc_channel_posix.h" +#include "ipc/ipc_channel_posix.h" #endif #if defined(OS_MACOSX) diff --git a/chrome/renderer/webplugin_delegate_proxy.h b/chrome/renderer/webplugin_delegate_proxy.h index a772384..17ce1d1 100644 --- a/chrome/renderer/webplugin_delegate_proxy.h +++ b/chrome/renderer/webplugin_delegate_proxy.h @@ -12,10 +12,10 @@ #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/common/transport_dib.h" #include "chrome/renderer/plugin_channel_host.h" #include "googleurl/src/gurl.h" +#include "ipc/ipc_message.h" #include "skia/ext/platform_canvas.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 b56cf8e..7567060 100644 --- a/chrome/renderer/webworker_proxy.h +++ b/chrome/renderer/webworker_proxy.h @@ -8,7 +8,7 @@ #include <vector> #include "base/basictypes.h" -#include "chrome/common/ipc_channel.h" +#include "ipc/ipc_channel.h" #include "webkit/api/public/WebWorker.h" class ChildThread; diff --git a/chrome/test/automation/autocomplete_edit_proxy.h b/chrome/test/automation/autocomplete_edit_proxy.h index 79d8975..b0594d8 100644 --- a/chrome/test/automation/autocomplete_edit_proxy.h +++ b/chrome/test/automation/autocomplete_edit_proxy.h @@ -9,10 +9,10 @@ #include <vector> #include "chrome/browser/autocomplete/autocomplete.h" -#include "chrome/common/ipc_message.h" -#include "chrome/common/ipc_message_utils.h" #include "chrome/test/automation/automation_handle_tracker.h" #include "googleurl/src/gurl.h" +#include "ipc/ipc_message.h" +#include "ipc/ipc_message_utils.h" // The purpose of this class is to act as a serializable version of // AutocompleteMatch. The reason for this class is because we don't want to diff --git a/chrome/test/automation/automation_messages.h b/chrome/test/automation/automation_messages.h index dd17017..710b170 100644 --- a/chrome/test/automation/automation_messages.h +++ b/chrome/test/automation/automation_messages.h @@ -11,8 +11,9 @@ #include "base/gfx/rect.h" #include "chrome/browser/tab_contents/navigation_entry.h" #include "chrome/browser/tab_contents/security_style.h" -#include "chrome/common/ipc_message_utils.h" +#include "chrome/common/common_param_traits.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. @@ -341,6 +342,6 @@ struct ParamTraits<ExternalTabSettings> { #define MESSAGES_INTERNAL_FILE \ "chrome/test/automation/automation_messages_internal.h" -#include "chrome/common/ipc_message_macros.h" +#include "ipc/ipc_message_macros.h" #endif // CHROME_TEST_AUTOMATION_AUTOMATION_MESSAGES_H__ diff --git a/chrome/test/automation/automation_messages_internal.h b/chrome/test/automation/automation_messages_internal.h index 15528c2..b899139 100644 --- a/chrome/test/automation/automation_messages_internal.h +++ b/chrome/test/automation/automation_messages_internal.h @@ -14,10 +14,10 @@ #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 "googleurl/src/gurl.h" +#include "ipc/ipc_message_macros.h" // NOTE: All IPC messages have either a routing_id of 0 (for asynchronous // messages), or one that's been assigned by the proxy (for calls diff --git a/chrome/test/automation/automation_proxy.cc b/chrome/test/automation/automation_proxy.cc index a1df2d8..dc94c18 100644 --- a/chrome/test/automation/automation_proxy.cc +++ b/chrome/test/automation/automation_proxy.cc @@ -13,12 +13,12 @@ #include "base/process_util.h" #include "base/ref_counted.h" #include "base/waitable_event.h" -#include "chrome/common/chrome_descriptors.h" #include "chrome/test/automation/automation_constants.h" #include "chrome/test/automation/automation_messages.h" #include "chrome/test/automation/browser_proxy.h" #include "chrome/test/automation/tab_proxy.h" #include "chrome/test/automation/window_proxy.h" +#include "ipc/ipc_descriptors.h" #if defined(OS_WIN) // TODO(port): Enable when dialog_delegate is ported. #include "views/window/dialog_delegate.h" diff --git a/chrome/test/automation/automation_proxy.h b/chrome/test/automation/automation_proxy.h index ffbf39d..186d7bf 100644 --- a/chrome/test/automation/automation_proxy.h +++ b/chrome/test/automation/automation_proxy.h @@ -14,11 +14,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" class BrowserProxy; class TabProxy; diff --git a/chrome/worker/webworkerclient_proxy.cc b/chrome/worker/webworkerclient_proxy.cc index b22428c..79ba379 100644 --- a/chrome/worker/webworkerclient_proxy.cc +++ b/chrome/worker/webworkerclient_proxy.cc @@ -7,11 +7,11 @@ #include "base/command_line.h" #include "chrome/common/child_process.h" #include "chrome/common/chrome_switches.h" -#include "chrome/common/ipc_logging.h" #include "chrome/common/worker_messages.h" #include "chrome/renderer/webworker_proxy.h" #include "chrome/worker/worker_thread.h" #include "chrome/worker/nativewebworker_impl.h" +#include "ipc/ipc_logging.h" #include "webkit/api/public/WebString.h" #include "webkit/api/public/WebURL.h" #include "webkit/api/public/WebWorker.h" diff --git a/chrome/worker/webworkerclient_proxy.h b/chrome/worker/webworkerclient_proxy.h index 341c15a..0e74e41 100644 --- a/chrome/worker/webworkerclient_proxy.h +++ b/chrome/worker/webworkerclient_proxy.h @@ -6,8 +6,8 @@ #define CHROME_WORKER_WEBWORKERCLIENT_PROXY_H_ #include "base/basictypes.h" -#include "chrome/common/ipc_channel.h" #include "googleurl/src/gurl.h" +#include "ipc/ipc_channel.h" #include "webkit/api/public/WebWorkerClient.h" namespace WebKit { diff --git a/chrome/common/file_descriptor_set_posix.cc b/ipc/file_descriptor_set_posix.cc index 1be7aa8..519e6e7 100644 --- a/chrome/common/file_descriptor_set_posix.cc +++ b/ipc/file_descriptor_set_posix.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/common/file_descriptor_set_posix.h" +#include "ipc/file_descriptor_set_posix.h" #include "base/eintr_wrapper.h" #include "base/logging.h" diff --git a/chrome/common/file_descriptor_set_posix.h b/ipc/file_descriptor_set_posix.h index 342e6d9..c3d26ba8 100644 --- a/chrome/common/file_descriptor_set_posix.h +++ b/ipc/file_descriptor_set_posix.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_COMMON_FILE_DESCRIPTOR_SET_POSIX_H_ -#define CHROME_COMMON_FILE_DESCRIPTOR_SET_POSIX_H_ +#ifndef IPC_FILE_DESCRIPTOR_SET_POSIX_H_ +#define IPC_FILE_DESCRIPTOR_SET_POSIX_H_ #include <vector> @@ -105,4 +105,4 @@ class FileDescriptorSet : public base::RefCountedThreadSafe<FileDescriptorSet> { DISALLOW_COPY_AND_ASSIGN(FileDescriptorSet); }; -#endif // CHROME_COMMON_FILE_DESCRIPTOR_SET_POSIX_H_ +#endif // IPC_FILE_DESCRIPTOR_SET_POSIX_H_ diff --git a/chrome/common/file_descriptor_set_unittest.cc b/ipc/file_descriptor_set_unittest.cc index f412fdd..243d29e 100644 --- a/chrome/common/file_descriptor_set_unittest.cc +++ b/ipc/file_descriptor_set_unittest.cc @@ -9,7 +9,7 @@ #include "base/basictypes.h" #include "base/eintr_wrapper.h" -#include "chrome/common/file_descriptor_set_posix.h" +#include "ipc/file_descriptor_set_posix.h" #include "testing/gtest/include/gtest/gtest.h" namespace { diff --git a/ipc/ipc.gyp b/ipc/ipc.gyp new file mode 100644 index 0000000..2371ece --- /dev/null +++ b/ipc/ipc.gyp @@ -0,0 +1,108 @@ +# 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. + +{ + 'includes': [ + '../build/common.gypi', + ], + 'target_defaults': { + 'sources/': [ + ['exclude', '/win/'], + ['exclude', '_(posix|win)(_unittest)?\\.(cc|mm?)$'], + ['exclude', '/win_[^/]*\\.cc$'], + ], + 'conditions': [ + ['OS=="linux"', {'sources/': [ + ['include', '_posix(_unittest)?\\.cc$'], + ]}], + ['OS=="mac"', {'sources/': [ + ['include', '_posix(_unittest)?\\.(cc|mm?)$'], + ]}], + ['OS=="win"', {'sources/': [ + ['include', '_win(_unittest)?\\.cc$'], + ['include', '/win/'], + ['include', '/win_[^/]*\\.cc$'], + ]}], + ], + }, + 'targets': [ + { + 'target_name': 'ipc', + 'type': '<(library)', + 'dependencies': [ + '../base/base.gyp:base', + ], + 'include_dirs': [ + '..', + ], + 'sources': [ + 'file_descriptor_set_posix.cc', + 'file_descriptor_set_posix.h', + 'ipc_channel.h', + 'ipc_channel_handle.h', + 'ipc_channel_posix.cc', + 'ipc_channel_posix.h', + 'ipc_channel_proxy.cc', + 'ipc_channel_proxy.h', + 'ipc_channel_win.cc', + 'ipc_channel_win.h', + 'ipc_descriptors.h', + '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_switches.cc', + 'ipc_switches.h', + 'ipc_sync_channel.cc', + 'ipc_sync_channel.h', + 'ipc_sync_message.cc', + 'ipc_sync_message.h', + ], + 'direct_dependent_settings': { + 'include_dirs': [ + '..', + ], + }, + }, + { + 'target_name': 'ipc_tests', + 'type': 'executable', + 'msvs_guid': 'B92AE829-E1CD-4781-824A-DCB1603A1672', + 'dependencies': [ + 'ipc', + '../base/base.gyp:base', + '../testing/gtest.gyp:gtest', + ], + 'include_dirs': [ + '..' + ], + 'sources': [ + 'file_descriptor_set_unittest.cc', + 'ipc_fuzzing_tests.cc', + 'ipc_message_unittest.cc', + 'ipc_send_fds_test.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"', { + 'dependencies': [ + '../build/linux/system.gyp:gtk', + ], + }], + ['OS=="linux" and toolkit_views==1', { + 'dependencies': [ + '../views/views.gyp:views', + ], + }], + ], + }, + ] +} diff --git a/chrome/common/ipc_channel.h b/ipc/ipc_channel.h index 85b35fa..a7a9a34 100644 --- a/chrome/common/ipc_channel.h +++ b/ipc/ipc_channel.h @@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_COMMON_IPC_CHANNEL_H_ -#define CHROME_COMMON_IPC_CHANNEL_H_ +#ifndef IPC_IPC_CHANNEL_H_ +#define IPC_IPC_CHANNEL_H_ -#include "chrome/common/ipc_message.h" +#include "ipc/ipc_message.h" namespace IPC { @@ -115,4 +115,4 @@ class Channel : public Message::Sender { } // namespace IPC -#endif // CHROME_COMMON_IPC_CHANNEL_H_ +#endif // IPC_IPC_CHANNEL_H_ diff --git a/chrome/common/ipc_channel_handle.h b/ipc/ipc_channel_handle.h index 2bb6380..e3b2f3e 100644 --- a/chrome/common/ipc_channel_handle.h +++ b/ipc/ipc_channel_handle.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_COMMON_IPC_CHANNEL_HANDLE_H_ -#define CHROME_COMMON_IPC_CHANNEL_HANDLE_H_ +#ifndef IPC_IPC_CHANNEL_HANDLE_H_ +#define IPC_IPC_CHANNEL_HANDLE_H_ #include "build/build_config.h" @@ -42,4 +42,4 @@ struct ChannelHandle { } // namespace IPC -#endif // CHROME_COMMON_IPC_CHANNEL_HANDLE_H_ +#endif // IPC_IPC_CHANNEL_HANDLE_H_ diff --git a/chrome/common/ipc_channel_posix.cc b/ipc/ipc_channel_posix.cc index 16ae02c..22b9241 100644 --- a/chrome/common/ipc_channel_posix.cc +++ b/ipc/ipc_channel_posix.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/common/ipc_channel_posix.h" +#include "ipc/ipc_channel_posix.h" #include <errno.h> #include <fcntl.h> @@ -22,15 +22,14 @@ #include "base/logging.h" #include "base/process_util.h" #include "base/scoped_ptr.h" -#include "base/string_util.h" #include "base/singleton.h" #include "base/stats_counters.h" -#include "chrome/common/chrome_counters.h" -#include "chrome/common/chrome_descriptors.h" -#include "chrome/common/chrome_switches.h" -#include "chrome/common/file_descriptor_set_posix.h" -#include "chrome/common/ipc_logging.h" -#include "chrome/common/ipc_message_utils.h" +#include "base/string_util.h" +#include "ipc/ipc_descriptors.h" +#include "ipc/ipc_switches.h" +#include "ipc/file_descriptor_set_posix.h" +#include "ipc/ipc_logging.h" +#include "ipc/ipc_message_utils.h" namespace IPC { @@ -682,7 +681,6 @@ bool Channel::ChannelImpl::ProcessOutgoingMessages() { } bool Channel::ChannelImpl::Send(Message* message) { - 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/chrome/common/ipc_channel_posix.h b/ipc/ipc_channel_posix.h index 9b4157e..aa69d4f 100644 --- a/chrome/common/ipc_channel_posix.h +++ b/ipc/ipc_channel_posix.h @@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_COMMON_IPC_CHANNEL_POSIX_H_ -#define CHROME_COMMON_IPC_CHANNEL_POSIX_H_ +#ifndef IPC_IPC_CHANNEL_POSIX_H_ +#define IPC_IPC_CHANNEL_POSIX_H_ -#include "chrome/common/ipc_channel.h" +#include "ipc/ipc_channel.h" #include <sys/socket.h> // for CMSG macros @@ -14,7 +14,7 @@ #include <vector> #include "base/message_loop.h" -#include "chrome/common/file_descriptor_set_posix.h" +#include "ipc/file_descriptor_set_posix.h" namespace IPC { @@ -132,4 +132,4 @@ class Channel::ChannelImpl : public MessageLoopForIO::Watcher { } // namespace IPC -#endif // CHROME_COMMON_IPC_CHANNEL_POSIX_H_ +#endif // IPC_IPC_CHANNEL_POSIX_H_ diff --git a/chrome/common/ipc_channel_proxy.cc b/ipc/ipc_channel_proxy.cc index c97e6f5..d96e413 100644 --- a/chrome/common/ipc_channel_proxy.cc +++ b/ipc/ipc_channel_proxy.cc @@ -4,9 +4,9 @@ #include "base/message_loop.h" #include "base/thread.h" -#include "chrome/common/ipc_channel_proxy.h" -#include "chrome/common/ipc_logging.h" -#include "chrome/common/ipc_message_utils.h" +#include "ipc/ipc_channel_proxy.h" +#include "ipc/ipc_logging.h" +#include "ipc/ipc_message_utils.h" namespace IPC { diff --git a/chrome/common/ipc_channel_proxy.h b/ipc/ipc_channel_proxy.h index 8adcb5b..1aed33e 100644 --- a/chrome/common/ipc_channel_proxy.h +++ b/ipc/ipc_channel_proxy.h @@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_COMMON_IPC_CHANNEL_PROXY_H__ -#define CHROME_COMMON_IPC_CHANNEL_PROXY_H__ +#ifndef IPC_IPC_CHANNEL_PROXY_H__ +#define IPC_IPC_CHANNEL_PROXY_H__ #include <vector> #include "base/ref_counted.h" -#include "chrome/common/ipc_channel.h" +#include "ipc/ipc_channel.h" class MessageLoop; @@ -206,4 +206,4 @@ class ChannelProxy : public Message::Sender { } // namespace IPC -#endif // CHROME_COMMON_IPC_CHANNEL_PROXY_H__ +#endif // IPC_IPC_CHANNEL_PROXY_H__ diff --git a/chrome/common/ipc_channel_win.cc b/ipc/ipc_channel_win.cc index 9d1de29..9296ea4 100644 --- a/chrome/common/ipc_channel_win.cc +++ b/ipc/ipc_channel_win.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/common/ipc_channel_win.h" +#include "ipc/ipc_channel_win.h" #include <windows.h> #include <sstream> @@ -12,9 +12,8 @@ #include "base/non_thread_safe.h" #include "base/stats_counters.h" #include "base/win_util.h" -#include "chrome/common/chrome_counters.h" -#include "chrome/common/ipc_logging.h" -#include "chrome/common/ipc_message_utils.h" +#include "ipc/ipc_logging.h" +#include "ipc/ipc_message_utils.h" namespace IPC { //------------------------------------------------------------------------------ @@ -84,7 +83,6 @@ void Channel::ChannelImpl::Close() { bool Channel::ChannelImpl::Send(Message* message) { DCHECK(thread_check_->CalledOnValidThread()); - 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/chrome/common/ipc_channel_win.h b/ipc/ipc_channel_win.h index f521431..7610d02 100644 --- a/chrome/common/ipc_channel_win.h +++ b/ipc/ipc_channel_win.h @@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_COMMON_IPC_CHANNEL_WIN_H_ -#define CHROME_COMMON_IPC_CHANNEL_WIN_H_ +#ifndef IPC_IPC_CHANNEL_WIN_H_ +#define IPC_IPC_CHANNEL_WIN_H_ -#include "chrome/common/ipc_channel.h" +#include "ipc/ipc_channel.h" #include <queue> #include <string> @@ -82,4 +82,4 @@ class Channel::ChannelImpl : public MessageLoopForIO::IOHandler { } // namespace IPC -#endif // CHROME_COMMON_IPC_CHANNEL_WIN_H_ +#endif // IPC_IPC_CHANNEL_WIN_H_ diff --git a/ipc/ipc_descriptors.h b/ipc/ipc_descriptors.h new file mode 100644 index 0000000..5717aa4 --- /dev/null +++ b/ipc/ipc_descriptors.h @@ -0,0 +1,14 @@ +// 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. + +#ifndef IPC_IPC_DESCRIPTORS_H_ +#define IPC_IPC_DESCRIPTORS_H_ + +// This is a list of global descriptor keys to be used with the +// base::GlobalDescriptors object (see base/global_descriptors_posix.h) +enum { + kPrimaryIPCChannel = 0, +}; + +#endif // IPC_IPC_DESCRIPTORS_H_ diff --git a/chrome/common/ipc_fuzzing_tests.cc b/ipc/ipc_fuzzing_tests.cc index 5d1f13b..c79d05a 100644 --- a/chrome/common/ipc_fuzzing_tests.cc +++ b/ipc/ipc_fuzzing_tests.cc @@ -10,10 +10,10 @@ #include "base/message_loop.h" #include "base/platform_thread.h" #include "base/process_util.h" -#include "chrome/common/ipc_channel.h" -#include "chrome/common/ipc_channel_proxy.h" -#include "chrome/common/ipc_message_utils.h" -#include "chrome/common/ipc_tests.h" +#include "ipc/ipc_channel.h" +#include "ipc/ipc_channel_proxy.h" +#include "ipc/ipc_message_utils.h" +#include "ipc/ipc_tests.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/multiprocess_func_list.h" @@ -98,8 +98,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. -#define MESSAGES_INTERNAL_FILE "chrome/common/ipc_sync_message_unittest.h" -#include "chrome/common/ipc_message_macros.h" +#define MESSAGES_INTERNAL_FILE "ipc/ipc_sync_message_unittest.h" +#include "ipc/ipc_message_macros.h" enum IPCMessageIds { UNUSED_IPC_TYPE, diff --git a/chrome/common/ipc_logging.cc b/ipc/ipc_logging.cc index 7ff1681..4ecb7d9 100644 --- a/chrome/common/ipc_logging.cc +++ b/ipc/ipc_logging.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/common/ipc_logging.h" +#include "ipc/ipc_logging.h" #if defined(OS_POSIX) #ifdef IPC_MESSAGE_LOG_ENABLED @@ -19,16 +19,9 @@ #include "base/time.h" #include "base/waitable_event.h" #include "base/waitable_event_watcher.h" -#include "chrome/common/chrome_switches.h" -#include "chrome/common/ipc_sync_message.h" -#include "chrome/common/ipc_message_utils.h" - -// This include list should contain all _messages.h header files so that they -// can get *MsgLog function etc. This makes ipc logs much more informative. -#include "chrome/common/plugin_messages.h" -#include "chrome/common/render_messages.h" -#include "chrome/common/worker_messages.h" -#include "chrome/test/automation/automation_messages.h" +#include "ipc/ipc_switches.h" +#include "ipc/ipc_sync_message.h" +#include "ipc/ipc_message_utils.h" #if defined(OS_POSIX) #include "base/string_util.h" @@ -96,7 +89,6 @@ Logging::Logging() #elif defined(OS_POSIX) if (getenv("CHROME_IPC_LOGGING")) enabled_ = true; - SetLoggerFunctions(g_log_function_mapping); #endif MessageLoop::current()->AddDestructionObserver(this); diff --git a/chrome/common/ipc_logging.h b/ipc/ipc_logging.h index fea0034..364ad79 100644 --- a/chrome/common/ipc_logging.h +++ b/ipc/ipc_logging.h @@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_COMMON_IPC_LOGGING_H_ -#define CHROME_COMMON_IPC_LOGGING_H_ +#ifndef IPC_IPC_LOGGING_H_ +#define IPC_IPC_LOGGING_H_ -#include "chrome/common/ipc_message.h" // For IPC_MESSAGE_LOG_ENABLED. +#include "ipc/ipc_message.h" // For IPC_MESSAGE_LOG_ENABLED. #ifdef IPC_MESSAGE_LOG_ENABLED @@ -109,4 +109,4 @@ class Logging : public base::WaitableEventWatcher::Delegate, #endif // IPC_MESSAGE_LOG_ENABLED -#endif // CHROME_COMMON_IPC_LOGGING_H_ +#endif // IPC_IPC_LOGGING_H_ diff --git a/chrome/common/ipc_message.cc b/ipc/ipc_message.cc index 6b9ded0..84db00c 100644 --- a/chrome/common/ipc_message.cc +++ b/ipc/ipc_message.cc @@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/common/ipc_message.h" +#include "ipc/ipc_message.h" #include "base/logging.h" #include "build/build_config.h" #if defined(OS_POSIX) -#include "chrome/common/file_descriptor_set_posix.h" +#include "ipc/file_descriptor_set_posix.h" #endif namespace IPC { diff --git a/chrome/common/ipc_message.h b/ipc/ipc_message.h index af4a0df..6357c0b 100644 --- a/chrome/common/ipc_message.h +++ b/ipc/ipc_message.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_COMMON_IPC_MESSAGE_H__ -#define CHROME_COMMON_IPC_MESSAGE_H__ +#ifndef IPC_IPC_MESSAGE_H__ +#define IPC_IPC_MESSAGE_H__ #include <string> @@ -276,4 +276,4 @@ enum SpecialRoutingIDs { #define IPC_REPLY_ID 0xFFF0 // Special message id for replies #define IPC_LOGGING_ID 0xFFF1 // Special message id for logging -#endif // CHROME_COMMON_IPC_MESSAGE_H__ +#endif // IPC_IPC_MESSAGE_H__ diff --git a/chrome/common/ipc_message_macros.h b/ipc/ipc_message_macros.h index f3c9278..ba2a10a 100644 --- a/chrome/common/ipc_message_macros.h +++ b/ipc/ipc_message_macros.h @@ -40,7 +40,7 @@ // ViewHostMsg_SyncMessageName::WriteReplyParams(reply_msg, out1, out2); // Send(reply_msg); -#include "chrome/common/ipc_message_utils.h" +#include "ipc/ipc_message_utils.h" #ifndef MESSAGES_INTERNAL_FILE @@ -50,7 +50,7 @@ // 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 "ipc/ipc_sync_message_unittest.h" #include "chrome/common/plugin_messages_internal.h" #include "chrome/common/render_messages_internal.h" #include "chrome/common/devtools_messages_internal.h" diff --git a/ipc/ipc_message_unittest.cc b/ipc/ipc_message_unittest.cc new file mode 100644 index 0000000..36a3229 --- /dev/null +++ b/ipc/ipc_message_unittest.cc @@ -0,0 +1,67 @@ +// 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 <string.h> + +#include "base/scoped_ptr.h" +#include "base/values.h" +#include "ipc/ipc_message.h" +#include "ipc/ipc_message_utils.h" +#include "testing/gtest/include/gtest/gtest.h" + +TEST(IPCMessageTest, ListValue) { + ListValue input; + input.Set(0, Value::CreateRealValue(42.42)); + input.Set(1, Value::CreateStringValue("forty")); + input.Set(2, Value::CreateNullValue()); + + IPC::Message msg(1, 2, IPC::Message::PRIORITY_NORMAL); + IPC::WriteParam(&msg, input); + + ListValue output; + void* iter = NULL; + EXPECT_TRUE(IPC::ReadParam(&msg, &iter, &output)); + + EXPECT_TRUE(input.Equals(&output)); + + // Also test the corrupt case. + IPC::Message bad_msg(1, 2, IPC::Message::PRIORITY_NORMAL); + bad_msg.WriteInt(99); + iter = NULL; + EXPECT_FALSE(IPC::ReadParam(&bad_msg, &iter, &output)); +} + +TEST(IPCMessageTest, DictionaryValue) { + DictionaryValue input; + input.Set(L"null", Value::CreateNullValue()); + input.Set(L"bool", Value::CreateBooleanValue(true)); + input.Set(L"int", Value::CreateIntegerValue(42)); + + scoped_ptr<DictionaryValue> subdict(new DictionaryValue()); + subdict->Set(L"str", Value::CreateStringValue("forty two")); + subdict->Set(L"bool", Value::CreateBooleanValue(false)); + + scoped_ptr<ListValue> sublist(new ListValue()); + sublist->Set(0, Value::CreateRealValue(42.42)); + sublist->Set(1, Value::CreateStringValue("forty")); + sublist->Set(2, Value::CreateStringValue("two")); + subdict->Set(L"list", sublist.release()); + + input.Set(L"dict", subdict.release()); + + IPC::Message msg(1, 2, IPC::Message::PRIORITY_NORMAL); + IPC::WriteParam(&msg, input); + + DictionaryValue output; + void* iter = NULL; + EXPECT_TRUE(IPC::ReadParam(&msg, &iter, &output)); + + EXPECT_TRUE(input.Equals(&output)); + + // Also test the corrupt case. + IPC::Message bad_msg(1, 2, IPC::Message::PRIORITY_NORMAL); + bad_msg.WriteInt(99); + iter = NULL; + EXPECT_FALSE(IPC::ReadParam(&bad_msg, &iter, &output)); +} diff --git a/ipc/ipc_message_utils.cc b/ipc/ipc_message_utils.cc new file mode 100644 index 0000000..ac188bf --- /dev/null +++ b/ipc/ipc_message_utils.cc @@ -0,0 +1,235 @@ +// 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/json_writer.h" +#include "base/scoped_ptr.h" +#include "base/time.h" +#include "base/values.h" + +namespace IPC { + +const int kMaxRecursionDepth = 100; + +// Value serialization + +static bool ReadValue(const Message* m, void** iter, Value** value, + int recursion); + +static void WriteValue(Message* m, const Value* value, int recursion) { + if (recursion > kMaxRecursionDepth) { + LOG(WARNING) << "Max recursion depth hit in WriteValue."; + return; + } + + m->WriteInt(value->GetType()); + + switch (value->GetType()) { + case Value::TYPE_NULL: + break; + case Value::TYPE_BOOLEAN: { + bool val; + value->GetAsBoolean(&val); + WriteParam(m, val); + break; + } + case Value::TYPE_INTEGER: { + int val; + value->GetAsInteger(&val); + WriteParam(m, val); + break; + } + case Value::TYPE_REAL: { + double val; + value->GetAsReal(&val); + WriteParam(m, val); + break; + } + case Value::TYPE_STRING: { + std::string val; + value->GetAsString(&val); + WriteParam(m, val); + break; + } + case Value::TYPE_BINARY: { + NOTREACHED() << "Don't send BinaryValues over IPC."; + } + case Value::TYPE_DICTIONARY: { + const DictionaryValue* dict = static_cast<const DictionaryValue*>(value); + + WriteParam(m, static_cast<int>(dict->GetSize())); + + for (DictionaryValue::key_iterator it = dict->begin_keys(); + it != dict->end_keys(); ++it) { + Value* subval; + if (dict->Get(*it, &subval)) { + WriteParam(m, *it); + WriteValue(m, subval, recursion + 1); + } else { + NOTREACHED() << "DictionaryValue iterators are filthy liars."; + } + } + break; + } + case Value::TYPE_LIST: { + const ListValue* list = static_cast<const ListValue*>(value); + WriteParam(m, static_cast<int>(list->GetSize())); + for (size_t i = 0; i < list->GetSize(); ++i) { + Value* subval; + if (list->Get(i, &subval)) { + WriteValue(m, subval, recursion + 1); + } else { + NOTREACHED() << "ListValue::GetSize is a filthy liar."; + } + } + break; + } + } +} + +// Helper for ReadValue that reads a DictionaryValue into a pre-allocated +// object. +static bool ReadDictionaryValue(const Message* m, void** iter, + DictionaryValue* value, int recursion) { + int size; + if (!ReadParam(m, iter, &size)) + return false; + + for (int i = 0; i < size; ++i) { + std::wstring key; + Value* subval; + if (!ReadParam(m, iter, &key) || + !ReadValue(m, iter, &subval, recursion + 1)) + return false; + value->Set(key, subval); + } + + return true; +} + +// Helper for ReadValue that reads a ReadListValue into a pre-allocated +// object. +static bool ReadListValue(const Message* m, void** iter, + ListValue* value, int recursion) { + int size; + if (!ReadParam(m, iter, &size)) + return false; + + for (int i = 0; i < size; ++i) { + Value* subval; + if (!ReadValue(m, iter, &subval, recursion + 1)) + return false; + value->Set(i, subval); + } + + return true; +} + +static bool ReadValue(const Message* m, void** iter, Value** value, + int recursion) { + if (recursion > kMaxRecursionDepth) { + LOG(WARNING) << "Max recursion depth hit in ReadValue."; + return false; + } + + int type; + if (!ReadParam(m, iter, &type)) + return false; + + switch (type) { + case Value::TYPE_NULL: + *value = Value::CreateNullValue(); + break; + case Value::TYPE_BOOLEAN: { + bool val; + if (!ReadParam(m, iter, &val)) + return false; + *value = Value::CreateBooleanValue(val); + break; + } + case Value::TYPE_INTEGER: { + int val; + if (!ReadParam(m, iter, &val)) + return false; + *value = Value::CreateIntegerValue(val); + break; + } + case Value::TYPE_REAL: { + double val; + if (!ReadParam(m, iter, &val)) + return false; + *value = Value::CreateRealValue(val); + break; + } + case Value::TYPE_STRING: { + std::string val; + if (!ReadParam(m, iter, &val)) + return false; + *value = Value::CreateStringValue(val); + break; + } + case Value::TYPE_BINARY: { + NOTREACHED() << "Don't send BinaryValues over IPC."; + break; + } + case Value::TYPE_DICTIONARY: { + scoped_ptr<DictionaryValue> val(new DictionaryValue()); + if (!ReadDictionaryValue(m, iter, val.get(), recursion)) + return false; + *value = val.release(); + break; + } + case Value::TYPE_LIST: { + scoped_ptr<ListValue> val(new ListValue()); + if (!ReadListValue(m, iter, val.get(), recursion)) + return false; + *value = val.release(); + break; + } + default: + return false; + } + + return true; +} + +void ParamTraits<DictionaryValue>::Write(Message* m, const param_type& p) { + WriteValue(m, &p, 0); +} + +bool ParamTraits<DictionaryValue>::Read( + const Message* m, void** iter, param_type* r) { + int type; + if (!ReadParam(m, iter, &type) || type != Value::TYPE_DICTIONARY) + return false; + + return ReadDictionaryValue(m, iter, r, 0); +} + +void ParamTraits<DictionaryValue>::Log(const param_type& p, std::wstring* l) { + std::string json; + JSONWriter::Write(&p, false, &json); + l->append(UTF8ToWide(json)); +} + +void ParamTraits<ListValue>::Write(Message* m, const param_type& p) { + WriteValue(m, &p, 0); +} + +bool ParamTraits<ListValue>::Read( + const Message* m, void** iter, param_type* r) { + int type; + if (!ReadParam(m, iter, &type) || type != Value::TYPE_LIST) + return false; + + return ReadListValue(m, iter, r, 0); +} + +void ParamTraits<ListValue>::Log(const param_type& p, std::wstring* l) { + std::string json; + JSONWriter::Write(&p, false, &json); + l->append(UTF8ToWide(json)); +} +} // namespace IPC diff --git a/chrome/common/ipc_message_utils.h b/ipc/ipc_message_utils.h index c6222e8..3fd8123 100644 --- a/chrome/common/ipc_message_utils.h +++ b/ipc/ipc_message_utils.h @@ -1,9 +1,9 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2006-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. -#ifndef CHROME_COMMON_IPC_MESSAGE_UTILS_H_ -#define CHROME_COMMON_IPC_MESSAGE_UTILS_H_ +#ifndef IPC_IPC_MESSAGE_UTILS_H_ +#define IPC_IPC_MESSAGE_UTILS_H_ #include <string> #include <vector> @@ -11,36 +11,16 @@ #include "base/file_path.h" #include "base/format_macros.h" -#include "base/gfx/native_widget_types.h" #include "base/string16.h" #include "base/string_util.h" +#include "base/time.h" #include "base/tuple.h" +#include "base/values.h" #if defined(OS_POSIX) -#include "chrome/common/file_descriptor_set_posix.h" +#include "ipc/file_descriptor_set_posix.h" #endif -#include "chrome/common/ipc_channel_handle.h" -#include "chrome/common/ipc_sync_message.h" -#include "chrome/common/thumbnail_score.h" -#include "chrome/common/transport_dib.h" -#include "net/url_request/url_request_status.h" -#include "webkit/glue/webcursor.h" -#include "webkit/glue/window_open_disposition.h" - -// Forward declarations. -class GURL; -class SkBitmap; -class DictionaryValue; -class ListValue; - -namespace gfx { -class Point; -class Rect; -class Size; -} // namespace gfx - -namespace webkit_glue { -struct WebApplicationInfo; -} // namespace webkit_glue +#include "ipc/ipc_channel_handle.h" +#include "ipc/ipc_sync_message.h" // 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 @@ -73,6 +53,7 @@ enum IPCMessageStart { COMPILE_ASSERT(LastMsgIndex <= 16, need_to_update_IPC_MESSAGE_MACRO); + namespace IPC { //----------------------------------------------------------------------------- @@ -376,18 +357,6 @@ struct ParamTraits<MSG> { #endif // defined(OS_WIN) template <> -struct ParamTraits<SkBitmap> { - typedef SkBitmap param_type; - static void Write(Message* m, const param_type& p); - - // Note: This function expects parameter |r| to be of type &SkBitmap since - // r->SetConfig() and r->SetPixels() are called. - static bool Read(const Message* m, void** iter, param_type* r); - - static void Log(const param_type& p, std::wstring* l); -}; - -template <> struct ParamTraits<DictionaryValue> { typedef DictionaryValue param_type; static void Write(Message* m, const param_type& p); @@ -572,14 +541,6 @@ struct ParamTraits<string16> { }; #endif -template <> -struct ParamTraits<GURL> { - typedef GURL param_type; - static void Write(Message* m, const param_type& p); - static bool Read(const Message* m, void** iter, param_type* p); - static void Log(const param_type& p, std::wstring* l); -}; - // and, a few more useful types... #if defined(OS_WIN) template <> @@ -663,45 +624,6 @@ struct ParamTraits<FilePath> { } }; -template <> -struct ParamTraits<gfx::Point> { - typedef gfx::Point 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); -}; - -template <> -struct ParamTraits<gfx::Rect> { - typedef gfx::Rect 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); -}; - -template <> -struct ParamTraits<gfx::Size> { - typedef gfx::Size 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); -}; - -template <> -struct ParamTraits<gfx::NativeWindow> { - typedef gfx::NativeWindow param_type; - static void Write(Message* m, const param_type& p) { - m->WriteIntPtr(reinterpret_cast<intptr_t>(p)); - } - static bool Read(const Message* m, void** iter, param_type* r) { - DCHECK_EQ(sizeof(param_type), sizeof(intptr_t)); - return m->ReadIntPtr(iter, reinterpret_cast<intptr_t*>(r)); - } - static void Log(const param_type& p, std::wstring* l) { - l->append(StringPrintf(L"0x%X", p)); - } -}; - #if defined(OS_POSIX) // FileDescriptors may be serialised over IPC channels on POSIX. On the // receiving side, the FileDescriptor is a valid duplicate of the file @@ -781,54 +703,6 @@ struct ParamTraits<IPC::ChannelHandle> { } }; -template<> -struct ParamTraits<ThumbnailScore> { - typedef ThumbnailScore param_type; - static void Write(Message* m, const param_type& p) { - IPC::ParamTraits<double>::Write(m, p.boring_score); - IPC::ParamTraits<bool>::Write(m, p.good_clipping); - IPC::ParamTraits<bool>::Write(m, p.at_top); - IPC::ParamTraits<base::Time>::Write(m, p.time_at_snapshot); - } - static bool Read(const Message* m, void** iter, param_type* r) { - double boring_score; - bool good_clipping, at_top; - base::Time time_at_snapshot; - if (!IPC::ParamTraits<double>::Read(m, iter, &boring_score) || - !IPC::ParamTraits<bool>::Read(m, iter, &good_clipping) || - !IPC::ParamTraits<bool>::Read(m, iter, &at_top) || - !IPC::ParamTraits<base::Time>::Read(m, iter, &time_at_snapshot)) - return false; - - r->boring_score = boring_score; - r->good_clipping = good_clipping; - r->at_top = at_top; - r->time_at_snapshot = time_at_snapshot; - return true; - } - static void Log(const param_type& p, std::wstring* l) { - l->append(StringPrintf(L"(%f, %d, %d)", - p.boring_score, p.good_clipping, p.at_top)); - } -}; - -template <> -struct ParamTraits<WindowOpenDisposition> { - typedef WindowOpenDisposition param_type; - static void Write(Message* m, const param_type& p) { - m->WriteInt(p); - } - static bool Read(const Message* m, void** iter, param_type* r) { - int temp; - bool res = m->ReadInt(iter, &temp); - *r = static_cast<WindowOpenDisposition>(temp); - return res; - } - static void Log(const param_type& p, std::wstring* l) { - l->append(StringPrintf(L"%d", p)); - } -}; - #if defined(OS_WIN) template <> struct ParamTraits<XFORM> { @@ -855,20 +729,6 @@ struct ParamTraits<XFORM> { }; #endif // defined(OS_WIN) -template <> -struct ParamTraits<WebCursor> { - typedef WebCursor param_type; - static void Write(Message* m, const param_type& p) { - p.Serialize(m); - } - static bool Read(const Message* m, void** iter, param_type* r) { - return r->Deserialize(m, iter); - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"<WebCursor>"); - } -}; - struct LogData { std::string channel; int32 routing_id; @@ -917,89 +777,6 @@ struct ParamTraits<LogData> { template <> -struct ParamTraits<webkit_glue::WebApplicationInfo> { - typedef webkit_glue::WebApplicationInfo param_type; - static void Write(Message* m, const param_type& p); - static bool Read(const Message* m, void** iter, param_type* r); - static void Log(const param_type& p, std::wstring* l); -}; - - -#if defined(OS_WIN) -template<> -struct ParamTraits<TransportDIB::Id> { - typedef TransportDIB::Id param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.handle); - WriteParam(m, p.sequence_num); - } - static bool Read(const Message* m, void** iter, param_type* r) { - return (ReadParam(m, iter, &r->handle) && - ReadParam(m, iter, &r->sequence_num)); - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"TransportDIB("); - LogParam(p.handle, l); - l->append(L", "); - LogParam(p.sequence_num, l); - l->append(L")"); - } -}; -#endif - -// Traits for URLRequestStatus -template <> -struct ParamTraits<URLRequestStatus> { - typedef URLRequestStatus param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, static_cast<int>(p.status())); - WriteParam(m, p.os_error()); - } - static bool Read(const Message* m, void** iter, param_type* r) { - int status, os_error; - if (!ReadParam(m, iter, &status) || - !ReadParam(m, iter, &os_error)) - return false; - r->set_status(static_cast<URLRequestStatus::Status>(status)); - r->set_os_error(os_error); - return true; - } - static void Log(const param_type& p, std::wstring* l) { - std::wstring status; - switch (p.status()) { - case URLRequestStatus::SUCCESS: - status = L"SUCCESS"; - break; - case URLRequestStatus::IO_PENDING: - status = L"IO_PENDING "; - break; - case URLRequestStatus::HANDLED_EXTERNALLY: - status = L"HANDLED_EXTERNALLY"; - break; - case URLRequestStatus::CANCELED: - status = L"CANCELED"; - break; - case URLRequestStatus::FAILED: - status = L"FAILED"; - break; - default: - status = L"UNKNOWN"; - break; - } - if (p.status() == URLRequestStatus::FAILED) - l->append(L"("); - - LogParam(status, l); - - if (p.status() == URLRequestStatus::FAILED) { - l->append(L", "); - LogParam(p.os_error(), l); - l->append(L")"); - } - } -}; - -template <> struct ParamTraits<Message> { static void Write(Message* m, const Message& p) { m->WriteInt(p.size()); @@ -1441,4 +1218,4 @@ class MessageWithReply : public SyncMessage { } // namespace IPC -#endif // CHROME_COMMON_IPC_MESSAGE_UTILS_H_ +#endif // IPC_IPC_MESSAGE_UTILS_H_ diff --git a/chrome/common/ipc_send_fds_test.cc b/ipc/ipc_send_fds_test.cc index 24cc870e..5f399da 100644 --- a/chrome/common/ipc_send_fds_test.cc +++ b/ipc/ipc_send_fds_test.cc @@ -4,7 +4,7 @@ #include "build/build_config.h" -#include "chrome/common/ipc_tests.h" +#include "ipc/ipc_tests.h" #if defined(OS_MACOSX) extern "C" { @@ -16,8 +16,8 @@ extern "C" { #include "base/eintr_wrapper.h" #include "base/message_loop.h" -#include "chrome/common/ipc_channel.h" -#include "chrome/common/ipc_message_utils.h" +#include "ipc/ipc_channel.h" +#include "ipc/ipc_message_utils.h" #if defined(OS_POSIX) diff --git a/ipc/ipc_switches.cc b/ipc/ipc_switches.cc new file mode 100644 index 0000000..18f7c27 --- /dev/null +++ b/ipc/ipc_switches.cc @@ -0,0 +1,28 @@ +// Copyright (c) 2006-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" + +#include "base/base_switches.h" + +namespace switches { + +// Can't find the switch you are looking for? try looking in +// base/base_switches.cc instead. + +// 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"; + +// 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/ipc/ipc_switches.h b/ipc/ipc_switches.h new file mode 100644 index 0000000..1468432 --- /dev/null +++ b/ipc/ipc_switches.h @@ -0,0 +1,20 @@ +// Copyright (c) 2006-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 all the command-line switches used by the IPC infrastructure. + +#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[]; +extern const wchar_t kDebugChildren[]; + +} // namespace switches + +#endif // IPC_IPC_SWITCHES_H_ diff --git a/chrome/common/ipc_sync_channel.cc b/ipc/ipc_sync_channel.cc index 6b5179c..de9b434a 100644 --- a/chrome/common/ipc_sync_channel.cc +++ b/ipc/ipc_sync_channel.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/common/ipc_sync_channel.h" +#include "ipc/ipc_sync_channel.h" #include "base/lazy_instance.h" #include "base/logging.h" @@ -10,7 +10,7 @@ #include "base/message_loop.h" #include "base/waitable_event.h" #include "base/waitable_event_watcher.h" -#include "chrome/common/ipc_sync_message.h" +#include "ipc/ipc_sync_message.h" using base::TimeDelta; using base::TimeTicks; diff --git a/chrome/common/ipc_sync_channel.h b/ipc/ipc_sync_channel.h index 3b2c671..f5d2add 100644 --- a/chrome/common/ipc_sync_channel.h +++ b/ipc/ipc_sync_channel.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_COMMON_IPC_SYNC_SENDER_H__ -#define CHROME_COMMON_IPC_SYNC_SENDER_H__ +#ifndef IPC_IPC_SYNC_SENDER_H__ +#define IPC_IPC_SYNC_SENDER_H__ #include <string> #include <deque> @@ -12,7 +12,7 @@ #include "base/lock.h" #include "base/ref_counted.h" #include "base/waitable_event_watcher.h" -#include "chrome/common/ipc_channel_proxy.h" +#include "ipc/ipc_channel_proxy.h" namespace base { class WaitableEvent; @@ -159,4 +159,4 @@ class SyncChannel : public ChannelProxy, } // namespace IPC -#endif // CHROME_COMMON_IPC_SYNC_SENDER_H__ +#endif // IPC_IPC_SYNC_SENDER_H__ diff --git a/chrome/common/ipc_sync_channel_unittest.cc b/ipc/ipc_sync_channel_unittest.cc index 8d4cd80..f20f788 100644 --- a/chrome/common/ipc_sync_channel_unittest.cc +++ b/ipc/ipc_sync_channel_unittest.cc @@ -15,13 +15,13 @@ #include "base/string_util.h" #include "base/thread.h" #include "base/waitable_event.h" -#include "chrome/common/ipc_message.h" -#include "chrome/common/ipc_sync_channel.h" +#include "ipc/ipc_message.h" +#include "ipc/ipc_sync_channel.h" #include "testing/gtest/include/gtest/gtest.h" -#define MESSAGES_INTERNAL_FILE "chrome/common/ipc_sync_message_unittest.h" -#include "chrome/common/ipc_message_macros.h" +#define MESSAGES_INTERNAL_FILE "ipc/ipc_sync_message_unittest.h" +#include "ipc/ipc_message_macros.h" using namespace IPC; using base::WaitableEvent; diff --git a/chrome/common/ipc_sync_message.cc b/ipc/ipc_sync_message.cc index a7407e4..519adb1 100644 --- a/chrome/common/ipc_sync_message.cc +++ b/ipc/ipc_sync_message.cc @@ -11,7 +11,7 @@ #include "base/logging.h" #include "base/waitable_event.h" -#include "chrome/common/ipc_sync_message.h" +#include "ipc/ipc_sync_message.h" namespace IPC { diff --git a/chrome/common/ipc_sync_message.h b/ipc/ipc_sync_message.h index b03007e..5d072a7 100644 --- a/chrome/common/ipc_sync_message.h +++ b/ipc/ipc_sync_message.h @@ -2,15 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_COMMON_IPC_SYNC_MESSAGE_H__ -#define CHROME_COMMON_IPC_SYNC_MESSAGE_H__ +#ifndef IPC_IPC_SYNC_MESSAGE_H__ +#define IPC_IPC_SYNC_MESSAGE_H__ #if defined(OS_WIN) #include <windows.h> #endif #include <string> #include "base/basictypes.h" -#include "chrome/common/ipc_message.h" +#include "ipc/ipc_message.h" namespace base { class WaitableEvent; @@ -93,4 +93,4 @@ class MessageReplyDeserializer { } // namespace IPC -#endif // CHROME_COMMON_IPC_SYNC_MESSAGE_H__ +#endif // IPC_IPC_SYNC_MESSAGE_H__ diff --git a/chrome/common/ipc_sync_message_unittest.cc b/ipc/ipc_sync_message_unittest.cc index b4f86a2..1c92574 100644 --- a/chrome/common/ipc_sync_message_unittest.cc +++ b/ipc/ipc_sync_message_unittest.cc @@ -9,14 +9,14 @@ #include <string.h> #include "base/basictypes.h" -#include "chrome/common/ipc_message.h" -#include "chrome/common/ipc_message_utils.h" +#include "ipc/ipc_message.h" +#include "ipc/ipc_message_utils.h" #include "base/logging.h" #include "testing/gtest/include/gtest/gtest.h" -#define MESSAGES_INTERNAL_FILE "chrome/common/ipc_sync_message_unittest.h" -#include "chrome/common/ipc_message_macros.h" +#define MESSAGES_INTERNAL_FILE "ipc/ipc_sync_message_unittest.h" +#include "ipc/ipc_message_macros.h" static IPC::Message* g_reply; diff --git a/chrome/common/ipc_sync_message_unittest.h b/ipc/ipc_sync_message_unittest.h index 4ac9099..7b252b5 100644 --- a/chrome/common/ipc_sync_message_unittest.h +++ b/ipc/ipc_sync_message_unittest.h @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/common/ipc_message_macros.h" +#include "ipc/ipc_message_macros.h" IPC_BEGIN_MESSAGES(Test) IPC_SYNC_MESSAGE_CONTROL0_0(SyncChannelTestMsg_NoArgs) diff --git a/chrome/common/ipc_tests.cc b/ipc/ipc_tests.cc index c2e0baa..172284e 100644 --- a/chrome/common/ipc_tests.cc +++ b/ipc/ipc_tests.cc @@ -15,7 +15,7 @@ #include <iostream> #include <string> -#include "chrome/common/ipc_tests.h" +#include "ipc/ipc_tests.h" #include "base/at_exit.h" #include "base/base_switches.h" @@ -29,11 +29,11 @@ #include "base/perf_test_suite.h" #include "base/test_suite.h" #include "base/thread.h" -#include "chrome/common/chrome_switches.h" -#include "chrome/common/chrome_descriptors.h" -#include "chrome/common/ipc_channel.h" -#include "chrome/common/ipc_channel_proxy.h" -#include "chrome/common/ipc_message_utils.h" +#include "ipc/ipc_descriptors.h" +#include "ipc/ipc_channel.h" +#include "ipc/ipc_channel_proxy.h" +#include "ipc/ipc_message_utils.h" +#include "ipc/ipc_switches.h" #include "testing/multiprocess_func_list.h" // Define to enable IPC performance testing instead of the regular unit tests diff --git a/chrome/common/ipc_tests.h b/ipc/ipc_tests.h index 36026bf..e800883 100644 --- a/chrome/common/ipc_tests.h +++ b/ipc/ipc_tests.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_COMMON_IPC_TESTS_H__ -#define CHROME_COMMON_IPC_TESTS_H__ +#ifndef IPC_IPC_TESTS_H__ +#define IPC_IPC_TESTS_H__ #include "base/multiprocess_test.h" #include "base/process.h" @@ -44,4 +44,4 @@ class IPCChannelTest : public MultiProcessTest { MessageLoopForIO *message_loop_; }; -#endif // CHROME_COMMON_IPC_TESTS_H__ +#endif // IPC_IPC_TESTS_H__ |