diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-17 18:38:24 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-17 18:38:24 +0000 |
commit | 7a4de7a6cefa6c56d42e6abe17f815b048269354 (patch) | |
tree | ee80ec60dfb6853c323238e714cc970297ee70ab /chrome | |
parent | 17e5f7d53a09582719e9e0a942643463944fb749 (diff) | |
download | chromium_src-7a4de7a6cefa6c56d42e6abe17f815b048269354.zip chromium_src-7a4de7a6cefa6c56d42e6abe17f815b048269354.tar.gz chromium_src-7a4de7a6cefa6c56d42e6abe17f815b048269354.tar.bz2 |
Reapplies all the IPC system work (reverts the revert r56272).
That patch wasn't what caused the regression in the page cycler.
BUG=51411,52103
TEST=still compiles
Review URL: http://codereview.chromium.org/3106018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56390 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
44 files changed, 1401 insertions, 982 deletions
diff --git a/chrome/browser/extensions/extension_messages_unittest.cc b/chrome/browser/extensions/extension_messages_unittest.cc index b90e92f..3b3c273 100644 --- a/chrome/browser/extensions/extension_messages_unittest.cc +++ b/chrome/browser/extensions/extension_messages_unittest.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/values.h" #include "chrome/browser/extensions/extension_message_service.h" #include "chrome/common/render_messages.h" #include "chrome/renderer/extensions/event_bindings.h" diff --git a/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc b/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc index c20940f4..859811e 100644 --- a/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc +++ b/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc @@ -16,11 +16,16 @@ #include "ipc/ipc_switches.h" #include "testing/multiprocess_func_list.h" -// Definition of IPC Messages used for this test. +// Declaration of IPC Messages used for this test. #define MESSAGES_INTERNAL_FILE \ "chrome/browser/importer/firefox_importer_unittest_messages_internal.h" #include "ipc/ipc_message_macros.h" +// Definition of IPC Messages used for this test. +#define MESSAGES_INTERNAL_IMPL_FILE \ + "chrome/browser/importer/firefox_importer_unittest_messages_internal.h" +#include "ipc/ipc_message_impl_macros.h" + namespace { // Name of IPC Channel to use for Server<-> Child Communications. diff --git a/chrome/browser/importer/importer_messages.cc b/chrome/browser/importer/importer_messages.cc new file mode 100644 index 0000000..d20452a --- /dev/null +++ b/chrome/browser/importer/importer_messages.cc @@ -0,0 +1,11 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/importer/importer_messages.h" + +#include "base/values.h" + +#define MESSAGES_INTERNAL_IMPL_FILE \ + "chrome/browser/importer/importer_messages_internal.h" +#include "ipc/ipc_message_impl_macros.h" diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc index a9af09a..e2a7fba 100644 --- a/chrome/browser/renderer_host/browser_render_process_host.cc +++ b/chrome/browser/renderer_host/browser_render_process_host.cc @@ -18,6 +18,7 @@ #include "app/app_switches.h" #include "base/command_line.h" #include "base/field_trial.h" +#include "base/histogram.h" #include "base/logging.h" #include "base/stl_util-inl.h" #include "base/string_util.h" diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc index b5bb1cb..51a0e29 100644 --- a/chrome/browser/renderer_host/render_view_host.cc +++ b/chrome/browser/renderer_host/render_view_host.cc @@ -44,6 +44,8 @@ #include "net/base/net_util.h" #include "third_party/skia/include/core/SkBitmap.h" #include "third_party/WebKit/WebKit/chromium/public/WebFindOptions.h" +#include "webkit/glue/context_menu.h" +#include "webkit/glue/dom_operations.h" #include "webkit/glue/form_data.h" #include "webkit/glue/form_field.h" #include "webkit/glue/password_form_dom_manager.h" diff --git a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc index 93b57e2..2d2eee0 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc +++ b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc @@ -22,6 +22,7 @@ #include "app/x11_util.h" #include "base/command_line.h" #include "base/logging.h" +#include "base/histogram.h" #include "base/message_loop.h" #include "base/string_number_conversions.h" #include "base/task.h" diff --git a/chrome/browser/renderer_host/resource_message_filter.cc b/chrome/browser/renderer_host/resource_message_filter.cc index 1a489de..70e75d4 100644 --- a/chrome/browser/renderer_host/resource_message_filter.cc +++ b/chrome/browser/renderer_host/resource_message_filter.cc @@ -85,8 +85,10 @@ #include "net/http/http_transaction_factory.h" #include "net/url_request/url_request_context.h" #include "third_party/WebKit/WebKit/chromium/public/WebNotificationPresenter.h" +#include "webkit/glue/context_menu.h" #include "webkit/glue/plugins/plugin_list.h" #include "webkit/glue/plugins/webplugin.h" +#include "webkit/glue/webcookie.h" #include "webkit/glue/webkit_glue.h" using net::CookieStore; diff --git a/chrome/browser/renderer_host/resource_message_filter_win.cc b/chrome/browser/renderer_host/resource_message_filter_win.cc index aa53422..4a8c46e 100644 --- a/chrome/browser/renderer_host/resource_message_filter_win.cc +++ b/chrome/browser/renderer_host/resource_message_filter_win.cc @@ -4,6 +4,7 @@ #include "chrome/browser/renderer_host/resource_message_filter.h" #include "chrome/common/render_messages.h" +#include "third_party/WebKit/WebKit/chromium/public/WebScreenInfo.h" #include "third_party/WebKit/WebKit/chromium/public/win/WebScreenInfoFactory.h" using WebKit::WebScreenInfo; diff --git a/chrome/browser/renderer_host/sync_resource_handler.cc b/chrome/browser/renderer_host/sync_resource_handler.cc index 7e88754..86bc899 100644 --- a/chrome/browser/renderer_host/sync_resource_handler.cc +++ b/chrome/browser/renderer_host/sync_resource_handler.cc @@ -3,6 +3,7 @@ // found in the LICENSE file. #include "chrome/browser/renderer_host/sync_resource_handler.h" + #include "base/logging.h" #include "chrome/common/render_messages.h" #include "net/base/io_buffer.h" diff --git a/chrome/browser/visitedlink_event_listener.cc b/chrome/browser/visitedlink_event_listener.cc index 9003fcc..ad43ba0 100644 --- a/chrome/browser/visitedlink_event_listener.cc +++ b/chrome/browser/visitedlink_event_listener.cc @@ -6,7 +6,6 @@ #include "base/shared_memory.h" #include "chrome/browser/renderer_host/render_process_host.h" -#include "chrome/common/render_messages.h" using base::Time; using base::TimeDelta; diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp index ec82bf3..81b723e 100644 --- a/chrome/chrome.gyp +++ b/chrome/chrome.gyp @@ -1711,6 +1711,7 @@ 'test/automation/automation_constants.h', 'test/automation/automation_handle_tracker.cc', 'test/automation/automation_handle_tracker.h', + 'test/automation/automation_messages.cc', 'test/automation/automation_messages.h', 'test/automation/automation_messages_internal.h', 'test/automation/automation_proxy.cc', diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index 8456a52..4400764 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -1850,6 +1850,7 @@ 'browser/importer/importer_data_types.h', 'browser/importer/importer_list.cc', 'browser/importer/importer_list.h', + 'browser/importer/importer_messages.cc', 'browser/importer/importer_messages.h', 'browser/importer/importer_messages_internal.h', 'browser/importer/mork_reader.cc', @@ -2973,6 +2974,12 @@ 'browser/zygote_host_linux.cc', 'browser/zygote_main_linux.cc', + # TODO(erg): http://crbug.com/51409 These files are also specified as + # part of the automation project, but we need these definitions here, + # too, due to usage in our automation provider. + 'test/automation/automation_messages.cc', + 'test/automation/automation_messages.h', + # These files are generated by GRIT. '<(grit_out_dir)/grit/bookmark_manager_resources_map.cc', '<(grit_out_dir)/grit/shared_resources_map.cc', diff --git a/chrome/chrome_common.gypi b/chrome/chrome_common.gypi index 68d1414..3c6eb5a 100644 --- a/chrome/chrome_common.gypi +++ b/chrome/chrome_common.gypi @@ -49,6 +49,7 @@ 'common/content_settings_types.h', 'common/debug_flags.cc', 'common/debug_flags.h', + 'common/devtools_messages.cc', 'common/devtools_messages.h', 'common/devtools_messages_internal.h', 'common/font_descriptor_mac.h', @@ -57,6 +58,7 @@ 'common/geoposition.h', 'common/gpu_info.h', 'common/gpu_info.cc', + 'common/gpu_messages.cc', 'common/gpu_messages.h', 'common/gpu_messages_internal.h', 'common/gpu_video_common.cc', @@ -72,9 +74,10 @@ 'common/metrics_helpers.h', 'common/nacl_cmd_line.cc', 'common/nacl_cmd_line.h', + 'common/nacl_messages.cc', 'common/nacl_messages.h', - 'common/nacl_types.h', 'common/nacl_messages_internal.h', + 'common/nacl_types.h', 'common/notification_details.cc', 'common/notification_details.h', 'common/notification_observer.h', @@ -248,8 +251,10 @@ 'common/pepper_plugin_registry.h', 'common/plugin_carbon_interpose_constants_mac.h', 'common/plugin_carbon_interpose_constants_mac.cc', + 'common/plugin_messages.cc', 'common/plugin_messages.h', 'common/plugin_messages_internal.h', + 'common/render_messages.cc', 'common/render_messages.h', 'common/render_messages_internal.h', 'common/renderer_preferences.h', @@ -257,11 +262,12 @@ 'common/resource_dispatcher.h', 'common/security_filter_peer.cc', 'common/security_filter_peer.h', + 'common/service_messages.cc', 'common/service_messages.h', 'common/services_messages_internal.h', - 'common/service_process_type.h', - 'common/service_process_util.cc', - 'common/service_process_util.h', + 'common/service_process_type.h', + 'common/service_process_util.cc', + 'common/service_process_util.h', 'common/socket_stream_dispatcher.cc', 'common/socket_stream_dispatcher.h', 'common/spellcheck_common.cc', @@ -274,6 +280,7 @@ 'common/thumbnail_score.h', 'common/url_constants.cc', 'common/url_constants.h', + 'common/utility_messages.cc', 'common/utility_messages.h', 'common/utility_messages_internal.h', 'common/view_types.cc', @@ -282,11 +289,13 @@ 'common/visitedlink_common.h', 'common/web_database_observer_impl.cc', 'common/web_database_observer_impl.h', + 'common/webkit_param_traits.cc', 'common/webkit_param_traits.h', 'common/webmessageportchannel_impl.cc', 'common/webmessageportchannel_impl.h', 'common/window_container_type.cc', 'common/window_container_type.h', + 'common/worker_messages.cc', 'common/worker_messages.h', 'common/worker_messages_internal.h', 'common/worker_thread_ticker.cc', diff --git a/chrome/common/common_param_traits.cc b/chrome/common/common_param_traits.cc index e655435..d6eb2cc 100644 --- a/chrome/common/common_param_traits.cc +++ b/chrome/common/common_param_traits.cc @@ -407,6 +407,45 @@ void ParamTraits<Geoposition>::Log(const Geoposition& p, std::wstring* l) { LogParam(p.error_code, l); } +void ParamTraits<webkit_glue::PasswordForm>::Write(Message* m, + const param_type& p) { + WriteParam(m, p.signon_realm); + WriteParam(m, p.origin); + WriteParam(m, p.action); + WriteParam(m, p.submit_element); + WriteParam(m, p.username_element); + WriteParam(m, p.username_value); + WriteParam(m, p.password_element); + WriteParam(m, p.password_value); + WriteParam(m, p.old_password_element); + WriteParam(m, p.old_password_value); + WriteParam(m, p.ssl_valid); + WriteParam(m, p.preferred); + WriteParam(m, p.blacklisted_by_user); +} + +bool ParamTraits<webkit_glue::PasswordForm>::Read(const Message* m, void** iter, + param_type* p) { + return + ReadParam(m, iter, &p->signon_realm) && + ReadParam(m, iter, &p->origin) && + ReadParam(m, iter, &p->action) && + ReadParam(m, iter, &p->submit_element) && + ReadParam(m, iter, &p->username_element) && + ReadParam(m, iter, &p->username_value) && + ReadParam(m, iter, &p->password_element) && + ReadParam(m, iter, &p->password_value) && + ReadParam(m, iter, &p->old_password_element) && + ReadParam(m, iter, &p->old_password_value) && + ReadParam(m, iter, &p->ssl_valid) && + ReadParam(m, iter, &p->preferred) && + ReadParam(m, iter, &p->blacklisted_by_user); +} +void ParamTraits<webkit_glue::PasswordForm>::Log(const param_type& p, + std::wstring* l) { + l->append(L"<PasswordForm>"); +} + void ParamTraits<printing::PageRange>::Write(Message* m, const param_type& p) { WriteParam(m, p.from); WriteParam(m, p.to); diff --git a/chrome/common/common_param_traits.h b/chrome/common/common_param_traits.h index 0ca6bed..4df6536 100644 --- a/chrome/common/common_param_traits.h +++ b/chrome/common/common_param_traits.h @@ -23,7 +23,6 @@ #include "net/base/upload_data.h" #include "net/url_request/url_request_status.h" #include "printing/native_metafile.h" -#include "webkit/glue/password_form.h" #include "webkit/glue/webcursor.h" #include "webkit/glue/window_open_disposition.h" @@ -34,6 +33,7 @@ class DictionaryValue; class ListValue; struct ThumbnailScore; class URLRequestStatus; +class WebCursor; namespace gfx { class Point; @@ -210,7 +210,7 @@ struct ParamTraits<WebCursor> { static void Write(Message* m, const param_type& p) { p.Serialize(m); } - static bool Read(const Message* m, void** iter, param_type* r) { + 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) { @@ -368,49 +368,16 @@ struct ParamTraits<Geoposition::ErrorCode> { template <> struct ParamTraits<webkit_glue::PasswordForm> { typedef webkit_glue::PasswordForm param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.signon_realm); - WriteParam(m, p.origin); - WriteParam(m, p.action); - WriteParam(m, p.submit_element); - WriteParam(m, p.username_element); - WriteParam(m, p.username_value); - WriteParam(m, p.password_element); - WriteParam(m, p.password_value); - WriteParam(m, p.old_password_element); - WriteParam(m, p.old_password_value); - WriteParam(m, p.ssl_valid); - WriteParam(m, p.preferred); - WriteParam(m, p.blacklisted_by_user); - } - static bool Read(const Message* m, void** iter, param_type* p) { - return - ReadParam(m, iter, &p->signon_realm) && - ReadParam(m, iter, &p->origin) && - ReadParam(m, iter, &p->action) && - ReadParam(m, iter, &p->submit_element) && - ReadParam(m, iter, &p->username_element) && - ReadParam(m, iter, &p->username_value) && - ReadParam(m, iter, &p->password_element) && - ReadParam(m, iter, &p->password_value) && - ReadParam(m, iter, &p->old_password_element) && - ReadParam(m, iter, &p->old_password_value) && - ReadParam(m, iter, &p->ssl_valid) && - ReadParam(m, iter, &p->preferred) && - ReadParam(m, iter, &p->blacklisted_by_user); - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"<PasswordForm>"); - } + 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<printing::PageRange> { typedef printing::PageRange 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); }; @@ -418,9 +385,7 @@ template <> struct ParamTraits<printing::NativeMetafile> { typedef printing::NativeMetafile 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); }; diff --git a/chrome/common/devtools_messages.cc b/chrome/common/devtools_messages.cc new file mode 100644 index 0000000..8ea923e --- /dev/null +++ b/chrome/common/devtools_messages.cc @@ -0,0 +1,9 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/common/devtools_messages.h" + +#define MESSAGES_INTERNAL_IMPL_FILE \ + "chrome/common/devtools_messages_internal.h" +#include "ipc/ipc_message_impl_macros.h" diff --git a/chrome/common/gpu_messages.cc b/chrome/common/gpu_messages.cc new file mode 100644 index 0000000..4ba5776 --- /dev/null +++ b/chrome/common/gpu_messages.cc @@ -0,0 +1,9 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/common/gpu_messages.h" + +#define MESSAGES_INTERNAL_IMPL_FILE \ + "chrome/common/gpu_messages_internal.h" +#include "ipc/ipc_message_impl_macros.h" diff --git a/chrome/common/nacl_messages.cc b/chrome/common/nacl_messages.cc new file mode 100644 index 0000000..291ed5a --- /dev/null +++ b/chrome/common/nacl_messages.cc @@ -0,0 +1,9 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/common/nacl_messages.h" + +#define MESSAGES_INTERNAL_IMPL_FILE \ + "chrome/common/nacl_messages_internal.h" +#include "ipc/ipc_message_impl_macros.h" diff --git a/chrome/common/nacl_messages_internal.h b/chrome/common/nacl_messages_internal.h index 8d95cc7..e302118 100644 --- a/chrome/common/nacl_messages_internal.h +++ b/chrome/common/nacl_messages_internal.h @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/process.h" #include "chrome/common/nacl_types.h" #include "ipc/ipc_message_macros.h" diff --git a/chrome/common/plugin_messages.cc b/chrome/common/plugin_messages.cc new file mode 100644 index 0000000..3079dcc --- /dev/null +++ b/chrome/common/plugin_messages.cc @@ -0,0 +1,11 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/common/plugin_messages.h" + +#include "ipc/ipc_channel_handle.h" + +#define MESSAGES_INTERNAL_IMPL_FILE \ + "chrome/common/plugin_messages_internal.h" +#include "ipc/ipc_message_impl_macros.h" diff --git a/chrome/common/render_messages.cc b/chrome/common/render_messages.cc new file mode 100644 index 0000000..e3aec79 --- /dev/null +++ b/chrome/common/render_messages.cc @@ -0,0 +1,923 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/common/render_messages.h" + +#include "base/values.h" +#include "chrome/common/edit_command.h" +#include "chrome/common/extensions/extension_extent.h" +#include "chrome/common/extensions/url_pattern.h" +#include "chrome/common/indexed_db_key.h" +#include "chrome/common/serialized_script_value.h" +#include "chrome/common/thumbnail_score.h" +#include "gfx/rect.h" +#include "ipc/ipc_channel_handle.h" +#include "net/http/http_response_headers.h" +#include "third_party/skia/include/core/SkBitmap.h" +#include "third_party/WebKit/WebKit/chromium/public/WebCompositionUnderline.h" +#include "third_party/WebKit/WebKit/chromium/public/WebFindOptions.h" +#include "third_party/WebKit/WebKit/chromium/public/WebMediaPlayerAction.h" +#include "third_party/WebKit/WebKit/chromium/public/WebScreenInfo.h" +#include "webkit/appcache/appcache_interfaces.h" +#include "webkit/glue/context_menu.h" +#include "webkit/glue/form_data.h" +#include "webkit/glue/form_field.h" +#include "webkit/glue/password_form_dom_manager.h" +#include "webkit/glue/password_form.h" +#include "webkit/glue/webaccessibility.h" +#include "webkit/glue/webcookie.h" +#include "webkit/glue/webcursor.h" +#include "webkit/glue/webdropdata.h" +#include "webkit/glue/plugins/webplugin.h" +#include "webkit/glue/plugins/webplugininfo.h" +#include "webkit/glue/dom_operations.h" + +#define MESSAGES_INTERNAL_IMPL_FILE \ + "chrome/common/render_messages_internal.h" +#include "ipc/ipc_message_impl_macros.h" + +namespace IPC { + +void ParamTraits<ViewMsg_Navigate_Params>::Write(Message* m, + const param_type& p) { + WriteParam(m, p.page_id); + WriteParam(m, p.pending_history_list_offset); + WriteParam(m, p.current_history_list_offset); + WriteParam(m, p.current_history_list_length); + WriteParam(m, p.url); + WriteParam(m, p.referrer); + WriteParam(m, p.transition); + WriteParam(m, p.state); + WriteParam(m, p.navigation_type); + WriteParam(m, p.request_time); +} + +bool ParamTraits<ViewMsg_Navigate_Params>::Read(const Message* m, void** iter, + param_type* p) { + return + ReadParam(m, iter, &p->page_id) && + ReadParam(m, iter, &p->pending_history_list_offset) && + ReadParam(m, iter, &p->current_history_list_offset) && + ReadParam(m, iter, &p->current_history_list_length) && + ReadParam(m, iter, &p->url) && + ReadParam(m, iter, &p->referrer) && + ReadParam(m, iter, &p->transition) && + ReadParam(m, iter, &p->state) && + ReadParam(m, iter, &p->navigation_type) && + ReadParam(m, iter, &p->request_time); +} + +void ParamTraits<ViewMsg_Navigate_Params>::Log(const param_type& p, + std::wstring* l) { + l->append(L"("); + LogParam(p.page_id, l); + l->append(L", "); + LogParam(p.url, l); + l->append(L", "); + LogParam(p.transition, l); + l->append(L", "); + LogParam(p.state, l); + l->append(L", "); + LogParam(p.navigation_type, l); + l->append(L", "); + LogParam(p.request_time, l); + l->append(L")"); +} + +void ParamTraits<webkit_glue::FormField>::Write(Message* m, + const param_type& p) { + WriteParam(m, p.label()); + WriteParam(m, p.name()); + WriteParam(m, p.value()); + WriteParam(m, p.form_control_type()); + WriteParam(m, p.size()); + WriteParam(m, p.option_strings()); +} + +bool ParamTraits<webkit_glue::FormField>::Read(const Message* m, void** iter, + param_type* p) { + string16 label, name, value, form_control_type; + int size = 0; + std::vector<string16> options; + bool result = ReadParam(m, iter, &label); + result = result && ReadParam(m, iter, &name); + result = result && ReadParam(m, iter, &value); + result = result && ReadParam(m, iter, &form_control_type); + result = result && ReadParam(m, iter, &size); + result = result && ReadParam(m, iter, &options); + if (!result) + return false; + + p->set_label(label); + p->set_name(name); + p->set_value(value); + p->set_form_control_type(form_control_type); + p->set_size(size); + p->set_option_strings(options); + return true; +} + +void ParamTraits<webkit_glue::FormField>::Log(const param_type& p, + std::wstring* l) { + l->append(L"<FormField>"); +} + +void ParamTraits<ContextMenuParams>::Write(Message* m, const param_type& p) { + WriteParam(m, p.media_type); + WriteParam(m, p.x); + WriteParam(m, p.y); + WriteParam(m, p.link_url); + WriteParam(m, p.unfiltered_link_url); + WriteParam(m, p.src_url); + WriteParam(m, p.is_image_blocked); + WriteParam(m, p.page_url); + WriteParam(m, p.frame_url); + WriteParam(m, p.media_flags); + WriteParam(m, p.selection_text); + WriteParam(m, p.misspelled_word); + WriteParam(m, p.dictionary_suggestions); + WriteParam(m, p.spellcheck_enabled); + WriteParam(m, p.is_editable); +#if defined(OS_MACOSX) + WriteParam(m, p.writing_direction_default); + WriteParam(m, p.writing_direction_left_to_right); + WriteParam(m, p.writing_direction_right_to_left); +#endif // OS_MACOSX + WriteParam(m, p.edit_flags); + WriteParam(m, p.security_info); + WriteParam(m, p.frame_charset); + WriteParam(m, p.custom_items); +} + +bool ParamTraits<ContextMenuParams>::Read(const Message* m, void** iter, + param_type* p) { + return + ReadParam(m, iter, &p->media_type) && + ReadParam(m, iter, &p->x) && + ReadParam(m, iter, &p->y) && + ReadParam(m, iter, &p->link_url) && + ReadParam(m, iter, &p->unfiltered_link_url) && + ReadParam(m, iter, &p->src_url) && + ReadParam(m, iter, &p->is_image_blocked) && + ReadParam(m, iter, &p->page_url) && + ReadParam(m, iter, &p->frame_url) && + ReadParam(m, iter, &p->media_flags) && + ReadParam(m, iter, &p->selection_text) && + ReadParam(m, iter, &p->misspelled_word) && + ReadParam(m, iter, &p->dictionary_suggestions) && + ReadParam(m, iter, &p->spellcheck_enabled) && + ReadParam(m, iter, &p->is_editable) && +#if defined(OS_MACOSX) + ReadParam(m, iter, &p->writing_direction_default) && + ReadParam(m, iter, &p->writing_direction_left_to_right) && + ReadParam(m, iter, &p->writing_direction_right_to_left) && +#endif // OS_MACOSX + ReadParam(m, iter, &p->edit_flags) && + ReadParam(m, iter, &p->security_info) && + ReadParam(m, iter, &p->frame_charset) && + ReadParam(m, iter, &p->custom_items); +} + +void ParamTraits<ContextMenuParams>::Log(const param_type& p, + std::wstring* l) { + l->append(L"<ContextMenuParams>"); +} + +void ParamTraits<ViewHostMsg_UpdateRect_Params>::Write( + Message* m, const param_type& p) { + WriteParam(m, p.bitmap); + WriteParam(m, p.bitmap_rect); + WriteParam(m, p.dx); + WriteParam(m, p.dy); + WriteParam(m, p.scroll_rect); + WriteParam(m, p.copy_rects); + WriteParam(m, p.view_size); + WriteParam(m, p.plugin_window_moves); + WriteParam(m, p.flags); +} + +bool ParamTraits<ViewHostMsg_UpdateRect_Params>::Read( + const Message* m, void** iter, param_type* p) { + return + ReadParam(m, iter, &p->bitmap) && + ReadParam(m, iter, &p->bitmap_rect) && + ReadParam(m, iter, &p->dx) && + ReadParam(m, iter, &p->dy) && + ReadParam(m, iter, &p->scroll_rect) && + ReadParam(m, iter, &p->copy_rects) && + ReadParam(m, iter, &p->view_size) && + ReadParam(m, iter, &p->plugin_window_moves) && + ReadParam(m, iter, &p->flags); +} + +void ParamTraits<ViewHostMsg_UpdateRect_Params>::Log(const param_type& p, + std::wstring* l) { + l->append(L"("); + LogParam(p.bitmap, l); + l->append(L", "); + LogParam(p.bitmap_rect, l); + l->append(L", "); + LogParam(p.dx, l); + l->append(L", "); + LogParam(p.dy, l); + l->append(L", "); + LogParam(p.scroll_rect, l); + l->append(L", "); + LogParam(p.copy_rects, l); + l->append(L", "); + LogParam(p.view_size, l); + l->append(L", "); + LogParam(p.plugin_window_moves, l); + l->append(L", "); + LogParam(p.flags, l); + l->append(L")"); +} + +void ParamTraits<webkit_glue::WebPluginGeometry>::Write(Message* m, + const param_type& p) { + WriteParam(m, p.window); + WriteParam(m, p.window_rect); + WriteParam(m, p.clip_rect); + WriteParam(m, p.cutout_rects); + WriteParam(m, p.rects_valid); + WriteParam(m, p.visible); +} + +bool ParamTraits<webkit_glue::WebPluginGeometry>::Read( + const Message* m, void** iter, param_type* p) { + return + ReadParam(m, iter, &p->window) && + ReadParam(m, iter, &p->window_rect) && + ReadParam(m, iter, &p->clip_rect) && + ReadParam(m, iter, &p->cutout_rects) && + ReadParam(m, iter, &p->rects_valid) && + ReadParam(m, iter, &p->visible); +} + +void ParamTraits<webkit_glue::WebPluginGeometry>::Log(const param_type& p, + std::wstring* l) { + l->append(L"("); + LogParam(p.window, l); + l->append(L", "); + LogParam(p.window_rect, l); + l->append(L", "); + LogParam(p.clip_rect, l); + l->append(L", "); + LogParam(p.cutout_rects, l); + l->append(L", "); + LogParam(p.rects_valid, l); + l->append(L", "); + LogParam(p.visible, l); + l->append(L")"); +} + +void ParamTraits<WebPluginMimeType>::Write(Message* m, const param_type& p) { + WriteParam(m, p.mime_type); + WriteParam(m, p.file_extensions); + WriteParam(m, p.description); +} + +bool ParamTraits<WebPluginMimeType>::Read(const Message* m, void** iter, + param_type* r) { + return + ReadParam(m, iter, &r->mime_type) && + ReadParam(m, iter, &r->file_extensions) && + ReadParam(m, iter, &r->description); +} + +void ParamTraits<WebPluginMimeType>::Log(const param_type& p, std::wstring* l) { + l->append(L"("); + LogParam(p.mime_type, l); + l->append(L", "); + LogParam(p.file_extensions, l); + l->append(L", "); + LogParam(p.description, l); + l->append(L")"); +} + +void ParamTraits<WebPluginInfo>::Write(Message* m, const param_type& p) { + WriteParam(m, p.name); + WriteParam(m, p.path); + WriteParam(m, p.version); + WriteParam(m, p.desc); + WriteParam(m, p.mime_types); + WriteParam(m, p.enabled); +} + +bool ParamTraits<WebPluginInfo>::Read(const Message* m, void** iter, + param_type* r) { + return + ReadParam(m, iter, &r->name) && + ReadParam(m, iter, &r->path) && + ReadParam(m, iter, &r->version) && + ReadParam(m, iter, &r->desc) && + ReadParam(m, iter, &r->mime_types) && + ReadParam(m, iter, &r->enabled); +} + +void ParamTraits<WebPluginInfo>::Log(const param_type& p, std::wstring* l) { + l->append(L"("); + LogParam(p.name, l); + l->append(L", "); + l->append(L", "); + LogParam(p.path, l); + l->append(L", "); + LogParam(p.version, l); + l->append(L", "); + LogParam(p.desc, l); + l->append(L", "); + LogParam(p.mime_types, l); + l->append(L", "); + LogParam(p.enabled, l); + l->append(L")"); +} + +void ParamTraits<webkit_glue::PasswordFormFillData>::Write( + Message* m, const param_type& p) { + WriteParam(m, p.basic_data); + WriteParam(m, p.additional_logins); + WriteParam(m, p.wait_for_username); +} + +bool ParamTraits<webkit_glue::PasswordFormFillData>::Read( + const Message* m, void** iter, param_type* r) { + return + ReadParam(m, iter, &r->basic_data) && + ReadParam(m, iter, &r->additional_logins) && + ReadParam(m, iter, &r->wait_for_username); +} + +void ParamTraits<webkit_glue::PasswordFormFillData>::Log(const param_type& p, + std::wstring* l) { + l->append(L"<PasswordFormFillData>"); +} + +void ParamTraits<scoped_refptr<net::HttpResponseHeaders> >::Write( + Message* m, const param_type& p) { + WriteParam(m, p.get() != NULL); + if (p) { + // Do not disclose Set-Cookie headers over IPC. + p->Persist(m, net::HttpResponseHeaders::PERSIST_SANS_COOKIES); + } +} + +bool ParamTraits<scoped_refptr<net::HttpResponseHeaders> >::Read( + const Message* m, void** iter, param_type* r) { + bool has_object; + if (!ReadParam(m, iter, &has_object)) + return false; + if (has_object) + *r = new net::HttpResponseHeaders(*m, iter); + return true; +} + +void ParamTraits<scoped_refptr<net::HttpResponseHeaders> >::Log( + const param_type& p, std::wstring* l) { + l->append(L"<HttpResponseHeaders>"); +} + +void ParamTraits<SerializedScriptValue>::Write(Message* m, const param_type& p) { + WriteParam(m, p.is_null()); + WriteParam(m, p.is_invalid()); + WriteParam(m, p.data()); +} + +bool ParamTraits<SerializedScriptValue>::Read(const Message* m, void** iter, + param_type* r) { + bool is_null; + bool is_invalid; + string16 data; + bool ok = + ReadParam(m, iter, &is_null) && + ReadParam(m, iter, &is_invalid) && + ReadParam(m, iter, &data); + if (!ok) + return false; + r->set_is_null(is_null); + r->set_is_invalid(is_invalid); + r->set_data(data); + return true; +} + +void ParamTraits<SerializedScriptValue>::Log(const param_type& p, + std::wstring* l) { + l->append(L"<SerializedScriptValue>("); + LogParam(p.is_null(), l); + l->append(L", "); + LogParam(p.is_invalid(), l); + l->append(L", "); + LogParam(p.data(), l); + l->append(L")"); +} + +void ParamTraits<IndexedDBKey>::Write(Message* m, const param_type& p) { + WriteParam(m, int(p.type())); + // TODO(jorlow): Technically, we only need to pack the type being used. + WriteParam(m, p.string()); + WriteParam(m, p.number()); +} + +bool ParamTraits<IndexedDBKey>::Read(const Message* m, void** iter, + param_type* r) { + int type; + string16 string; + int32 number; + bool ok = + ReadParam(m, iter, &type) && + ReadParam(m, iter, &string) && + ReadParam(m, iter, &number); + if (!ok) + return false; + switch (type) { + case WebKit::WebIDBKey::NullType: + r->SetNull(); + return true; + case WebKit::WebIDBKey::StringType: + r->Set(string); + return true; + case WebKit::WebIDBKey::NumberType: + r->Set(number); + return true; + case WebKit::WebIDBKey::InvalidType: + r->SetInvalid(); + return true; + } + NOTREACHED(); + return false; +} + +void ParamTraits<IndexedDBKey>::Log(const param_type& p, std::wstring* l) { + l->append(L"<IndexedDBKey>("); + LogParam(int(p.type()), l); + l->append(L", "); + LogParam(p.string(), l); + l->append(L", "); + LogParam(p.number(), l); + l->append(L")"); +} + +void ParamTraits<webkit_glue::FormData>::Write(Message* m, + const param_type& p) { + WriteParam(m, p.name); + WriteParam(m, p.method); + WriteParam(m, p.origin); + WriteParam(m, p.action); + WriteParam(m, p.user_submitted); + WriteParam(m, p.fields); +} + +bool ParamTraits<webkit_glue::FormData>::Read(const Message* m, void** iter, + param_type* p) { + return + ReadParam(m, iter, &p->name) && + ReadParam(m, iter, &p->method) && + ReadParam(m, iter, &p->origin) && + ReadParam(m, iter, &p->action) && + ReadParam(m, iter, &p->user_submitted) && + ReadParam(m, iter, &p->fields); +} + +void ParamTraits<webkit_glue::FormData>::Log(const param_type& p, + std::wstring* l) { + l->append(L"<FormData>"); +} + +void ParamTraits<RendererPreferences>::Write(Message* m, const param_type& p) { + WriteParam(m, p.can_accept_load_drops); + WriteParam(m, p.should_antialias_text); + WriteParam(m, static_cast<int>(p.hinting)); + WriteParam(m, static_cast<int>(p.subpixel_rendering)); + WriteParam(m, p.focus_ring_color); + WriteParam(m, p.thumb_active_color); + WriteParam(m, p.thumb_inactive_color); + WriteParam(m, p.track_color); + WriteParam(m, p.active_selection_bg_color); + WriteParam(m, p.active_selection_fg_color); + WriteParam(m, p.inactive_selection_bg_color); + WriteParam(m, p.inactive_selection_fg_color); + WriteParam(m, p.browser_handles_top_level_requests); + WriteParam(m, p.caret_blink_interval); +} + +bool ParamTraits<RendererPreferences>::Read(const Message* m, void** iter, + param_type* p) { + if (!ReadParam(m, iter, &p->can_accept_load_drops)) + return false; + if (!ReadParam(m, iter, &p->should_antialias_text)) + return false; + + int hinting = 0; + if (!ReadParam(m, iter, &hinting)) + return false; + p->hinting = static_cast<RendererPreferencesHintingEnum>(hinting); + + int subpixel_rendering = 0; + if (!ReadParam(m, iter, &subpixel_rendering)) + return false; + p->subpixel_rendering = + static_cast<RendererPreferencesSubpixelRenderingEnum>( + subpixel_rendering); + + int focus_ring_color; + if (!ReadParam(m, iter, &focus_ring_color)) + return false; + p->focus_ring_color = focus_ring_color; + + int thumb_active_color, thumb_inactive_color, track_color; + int active_selection_bg_color, active_selection_fg_color; + int inactive_selection_bg_color, inactive_selection_fg_color; + if (!ReadParam(m, iter, &thumb_active_color) || + !ReadParam(m, iter, &thumb_inactive_color) || + !ReadParam(m, iter, &track_color) || + !ReadParam(m, iter, &active_selection_bg_color) || + !ReadParam(m, iter, &active_selection_fg_color) || + !ReadParam(m, iter, &inactive_selection_bg_color) || + !ReadParam(m, iter, &inactive_selection_fg_color)) + return false; + p->thumb_active_color = thumb_active_color; + p->thumb_inactive_color = thumb_inactive_color; + p->track_color = track_color; + p->active_selection_bg_color = active_selection_bg_color; + p->active_selection_fg_color = active_selection_fg_color; + p->inactive_selection_bg_color = inactive_selection_bg_color; + p->inactive_selection_fg_color = inactive_selection_fg_color; + + if (!ReadParam(m, iter, &p->browser_handles_top_level_requests)) + return false; + + if (!ReadParam(m, iter, &p->caret_blink_interval)) + return false; + + return true; +} + +void ParamTraits<RendererPreferences>::Log(const param_type& p, + std::wstring* l) { + l->append(L"<RendererPreferences>"); +} + +void ParamTraits<WebPreferences>::Write(Message* m, const param_type& p) { + WriteParam(m, p.standard_font_family); + WriteParam(m, p.fixed_font_family); + WriteParam(m, p.serif_font_family); + WriteParam(m, p.sans_serif_font_family); + WriteParam(m, p.cursive_font_family); + WriteParam(m, p.fantasy_font_family); + WriteParam(m, p.default_font_size); + WriteParam(m, p.default_fixed_font_size); + WriteParam(m, p.minimum_font_size); + WriteParam(m, p.minimum_logical_font_size); + WriteParam(m, p.default_encoding); + WriteParam(m, p.javascript_enabled); + WriteParam(m, p.web_security_enabled); + WriteParam(m, p.javascript_can_open_windows_automatically); + WriteParam(m, p.loads_images_automatically); + WriteParam(m, p.plugins_enabled); + WriteParam(m, p.dom_paste_enabled); + WriteParam(m, p.developer_extras_enabled); + WriteParam(m, p.inspector_settings); + WriteParam(m, p.site_specific_quirks_enabled); + WriteParam(m, p.shrinks_standalone_images_to_fit); + WriteParam(m, p.uses_universal_detector); + WriteParam(m, p.text_areas_are_resizable); + WriteParam(m, p.java_enabled); + WriteParam(m, p.allow_scripts_to_close_windows); + WriteParam(m, p.uses_page_cache); + WriteParam(m, p.remote_fonts_enabled); + WriteParam(m, p.javascript_can_access_clipboard); + WriteParam(m, p.xss_auditor_enabled); + WriteParam(m, p.local_storage_enabled); + WriteParam(m, p.databases_enabled); + WriteParam(m, p.application_cache_enabled); + WriteParam(m, p.tabs_to_links); + WriteParam(m, p.user_style_sheet_enabled); + WriteParam(m, p.user_style_sheet_location); + WriteParam(m, p.author_and_user_styles_enabled); + WriteParam(m, p.allow_universal_access_from_file_urls); + WriteParam(m, p.allow_file_access_from_file_urls); + WriteParam(m, p.experimental_webgl_enabled); + WriteParam(m, p.show_composited_layer_borders); + WriteParam(m, p.accelerated_compositing_enabled); + WriteParam(m, p.accelerated_2d_canvas_enabled); + WriteParam(m, p.memory_info_enabled); +} + +bool ParamTraits<WebPreferences>::Read(const Message* m, void** iter, + param_type* p) { + return + ReadParam(m, iter, &p->standard_font_family) && + ReadParam(m, iter, &p->fixed_font_family) && + ReadParam(m, iter, &p->serif_font_family) && + ReadParam(m, iter, &p->sans_serif_font_family) && + ReadParam(m, iter, &p->cursive_font_family) && + ReadParam(m, iter, &p->fantasy_font_family) && + ReadParam(m, iter, &p->default_font_size) && + ReadParam(m, iter, &p->default_fixed_font_size) && + ReadParam(m, iter, &p->minimum_font_size) && + ReadParam(m, iter, &p->minimum_logical_font_size) && + ReadParam(m, iter, &p->default_encoding) && + ReadParam(m, iter, &p->javascript_enabled) && + ReadParam(m, iter, &p->web_security_enabled) && + ReadParam(m, iter, &p->javascript_can_open_windows_automatically) && + ReadParam(m, iter, &p->loads_images_automatically) && + ReadParam(m, iter, &p->plugins_enabled) && + ReadParam(m, iter, &p->dom_paste_enabled) && + ReadParam(m, iter, &p->developer_extras_enabled) && + ReadParam(m, iter, &p->inspector_settings) && + ReadParam(m, iter, &p->site_specific_quirks_enabled) && + ReadParam(m, iter, &p->shrinks_standalone_images_to_fit) && + ReadParam(m, iter, &p->uses_universal_detector) && + ReadParam(m, iter, &p->text_areas_are_resizable) && + ReadParam(m, iter, &p->java_enabled) && + ReadParam(m, iter, &p->allow_scripts_to_close_windows) && + ReadParam(m, iter, &p->uses_page_cache) && + ReadParam(m, iter, &p->remote_fonts_enabled) && + ReadParam(m, iter, &p->javascript_can_access_clipboard) && + ReadParam(m, iter, &p->xss_auditor_enabled) && + ReadParam(m, iter, &p->local_storage_enabled) && + ReadParam(m, iter, &p->databases_enabled) && + ReadParam(m, iter, &p->application_cache_enabled) && + ReadParam(m, iter, &p->tabs_to_links) && + ReadParam(m, iter, &p->user_style_sheet_enabled) && + ReadParam(m, iter, &p->user_style_sheet_location) && + ReadParam(m, iter, &p->author_and_user_styles_enabled) && + ReadParam(m, iter, &p->allow_universal_access_from_file_urls) && + ReadParam(m, iter, &p->allow_file_access_from_file_urls) && + ReadParam(m, iter, &p->experimental_webgl_enabled) && + ReadParam(m, iter, &p->show_composited_layer_borders) && + ReadParam(m, iter, &p->accelerated_compositing_enabled) && + ReadParam(m, iter, &p->accelerated_2d_canvas_enabled) && + ReadParam(m, iter, &p->memory_info_enabled); +} + +void ParamTraits<WebPreferences>::Log(const param_type& p, std::wstring* l) { + l->append(L"<WebPreferences>"); +} + +void ParamTraits<WebDropData>::Write(Message* m, const param_type& p) { + WriteParam(m, p.identity); + WriteParam(m, p.url); + WriteParam(m, p.url_title); + WriteParam(m, p.download_metadata); + WriteParam(m, p.file_extension); + WriteParam(m, p.filenames); + WriteParam(m, p.plain_text); + WriteParam(m, p.text_html); + WriteParam(m, p.html_base_url); + WriteParam(m, p.file_description_filename); + WriteParam(m, p.file_contents); +} + +bool ParamTraits<WebDropData>::Read(const Message* m, void** iter, + param_type* p) { + return + ReadParam(m, iter, &p->identity) && + ReadParam(m, iter, &p->url) && + ReadParam(m, iter, &p->url_title) && + ReadParam(m, iter, &p->download_metadata) && + ReadParam(m, iter, &p->file_extension) && + ReadParam(m, iter, &p->filenames) && + ReadParam(m, iter, &p->plain_text) && + ReadParam(m, iter, &p->text_html) && + ReadParam(m, iter, &p->html_base_url) && + ReadParam(m, iter, &p->file_description_filename) && + ReadParam(m, iter, &p->file_contents); +} + +void ParamTraits<WebDropData>::Log(const param_type& p, std::wstring* l) { + l->append(L"<WebDropData>"); +} + +void ParamTraits<URLPattern>::Write(Message* m, const param_type& p) { + WriteParam(m, p.valid_schemes()); + WriteParam(m, p.GetAsString()); +} + +bool ParamTraits<URLPattern>::Read(const Message* m, void** iter, + param_type* p) { + int valid_schemes; + std::string spec; + if (!ReadParam(m, iter, &valid_schemes) || + !ReadParam(m, iter, &spec)) + return false; + + p->set_valid_schemes(valid_schemes); + return p->Parse(spec); +} + +void ParamTraits<URLPattern>::Log(const param_type& p, std::wstring* l) { + LogParam(p.GetAsString(), l); +} + +void ParamTraits<EditCommand>::Write(Message* m, const param_type& p) { + WriteParam(m, p.name); + WriteParam(m, p.value); +} + +bool ParamTraits<EditCommand>::Read(const Message* m, void** iter, + param_type* p) { + return ReadParam(m, iter, &p->name) && ReadParam(m, iter, &p->value); +} + +void ParamTraits<EditCommand>::Log(const param_type& p, std::wstring* l) { + l->append(L"("); + LogParam(p.name, l); + l->append(L":"); + LogParam(p.value, l); + l->append(L")"); +} + +void ParamTraits<webkit_glue::WebCookie>::Write(Message* m, + const param_type& p) { + WriteParam(m, p.name); + WriteParam(m, p.value); + WriteParam(m, p.domain); + WriteParam(m, p.path); + WriteParam(m, p.expires); + WriteParam(m, p.http_only); + WriteParam(m, p.secure); + WriteParam(m, p.session); +} + +bool ParamTraits<webkit_glue::WebCookie>::Read(const Message* m, void** iter, + param_type* p) { + return + ReadParam(m, iter, &p->name) && + ReadParam(m, iter, &p->value) && + ReadParam(m, iter, &p->domain) && + ReadParam(m, iter, &p->path) && + ReadParam(m, iter, &p->expires) && + ReadParam(m, iter, &p->http_only) && + ReadParam(m, iter, &p->secure) && + ReadParam(m, iter, &p->session); +} + +void ParamTraits<webkit_glue::WebCookie>::Log(const param_type& p, + std::wstring* l) { + l->append(L"<WebCookie>"); +} + +void ParamTraits<ExtensionExtent>::Write(Message* m, const param_type& p) { + WriteParam(m, p.patterns()); +} + +bool ParamTraits<ExtensionExtent>::Read(const Message* m, void** iter, + param_type* p) { + std::vector<URLPattern> patterns; + bool success = + ReadParam(m, iter, &patterns); + if (!success) + return false; + + for (size_t i = 0; i < patterns.size(); ++i) + p->AddPattern(patterns[i]); + return true; +} + +void ParamTraits<ExtensionExtent>::Log(const param_type& p, std::wstring* l) { + LogParam(p.patterns(), l); +} + +void ParamTraits<appcache::AppCacheResourceInfo>::Write(Message* m, + const param_type& p) { + WriteParam(m, p.url); + WriteParam(m, p.size); + WriteParam(m, p.is_manifest); + WriteParam(m, p.is_master); + WriteParam(m, p.is_fallback); + WriteParam(m, p.is_foreign); + WriteParam(m, p.is_explicit); +} + +bool ParamTraits<appcache::AppCacheResourceInfo>::Read( + const Message* m, void** iter, param_type* p) { + return ReadParam(m, iter, &p->url) && + ReadParam(m, iter, &p->size) && + ReadParam(m, iter, &p->is_manifest) && + ReadParam(m, iter, &p->is_master) && + ReadParam(m, iter, &p->is_fallback) && + ReadParam(m, iter, &p->is_foreign) && + ReadParam(m, iter, &p->is_explicit); +} + +void ParamTraits<appcache::AppCacheResourceInfo>::Log(const param_type& p, + std::wstring* l) { + l->append(L"("); + LogParam(p.url, l); + l->append(L", "); + LogParam(p.size, l); + l->append(L", "); + LogParam(p.is_manifest, l); + l->append(L", "); + LogParam(p.is_master, l); + l->append(L", "); + LogParam(p.is_fallback, l); + l->append(L", "); + LogParam(p.is_foreign, l); + l->append(L", "); + LogParam(p.is_explicit, l); + l->append(L")"); +} + +void ParamTraits<appcache::AppCacheInfo>::Write(Message* m, + const param_type& p) { + WriteParam(m, p.manifest_url); + WriteParam(m, p.creation_time); + WriteParam(m, p.last_update_time); + WriteParam(m, p.last_access_time); + WriteParam(m, p.cache_id); + WriteParam(m, p.status); + WriteParam(m, p.size); + WriteParam(m, p.is_complete); +} + +bool ParamTraits<appcache::AppCacheInfo>::Read(const Message* m, void** iter, + param_type* p) { + return ReadParam(m, iter, &p->manifest_url) && + ReadParam(m, iter, &p->creation_time) && + ReadParam(m, iter, &p->last_update_time) && + ReadParam(m, iter, &p->last_access_time) && + ReadParam(m, iter, &p->cache_id) && + ReadParam(m, iter, &p->status) && + ReadParam(m, iter, &p->size) && + ReadParam(m, iter, &p->is_complete); +} + +void ParamTraits<appcache::AppCacheInfo>::Log(const param_type& p, + std::wstring* l) { + l->append(L"("); + LogParam(p.manifest_url, l); + l->append(L", "); + LogParam(p.creation_time, l); + l->append(L", "); + LogParam(p.last_update_time, l); + l->append(L", "); + LogParam(p.last_access_time, l); + l->append(L", "); + LogParam(p.cache_id, l); + l->append(L", "); + LogParam(p.status, l); + l->append(L", "); + LogParam(p.size, l); + l->append(L")"); + LogParam(p.is_complete, l); + l->append(L", "); +} + +void ParamTraits<webkit_glue::WebAccessibility>::Write(Message* m, + const param_type& p) { + WriteParam(m, p.id); + WriteParam(m, p.name); + WriteParam(m, p.value); + WriteParam(m, static_cast<int>(p.role)); + WriteParam(m, static_cast<int>(p.state)); + WriteParam(m, p.location); + WriteParam(m, p.attributes); + WriteParam(m, p.children); +} + +bool ParamTraits<webkit_glue::WebAccessibility>::Read( + const Message* m, void** iter, param_type* p) { + bool ret = ReadParam(m, iter, &p->id); + ret = ret && ReadParam(m, iter, &p->name); + ret = ret && ReadParam(m, iter, &p->value); + int role = -1; + ret = ret && ReadParam(m, iter, &role); + if (role >= webkit_glue::WebAccessibility::ROLE_NONE && + role < webkit_glue::WebAccessibility::NUM_ROLES) { + p->role = static_cast<webkit_glue::WebAccessibility::Role>(role); + } else { + p->role = webkit_glue::WebAccessibility::ROLE_NONE; + } + int state = 0; + ret = ret && ReadParam(m, iter, &state); + p->state = static_cast<webkit_glue::WebAccessibility::State>(state); + ret = ret && ReadParam(m, iter, &p->location); + ret = ret && ReadParam(m, iter, &p->attributes); + ret = ret && ReadParam(m, iter, &p->children); + return ret; +} + +void ParamTraits<webkit_glue::WebAccessibility>::Log(const param_type& p, + std::wstring* l) { + l->append(L"("); + LogParam(p.id, l); + l->append(L", "); + LogParam(p.name, l); + l->append(L", "); + LogParam(p.value, l); + l->append(L", "); + LogParam(static_cast<int>(p.role), l); + l->append(L", "); + LogParam(static_cast<int>(p.state), l); + l->append(L", "); + LogParam(p.location, l); + l->append(L", "); + LogParam(p.attributes, l); + l->append(L", "); + LogParam(p.children, l); + l->append(L")"); +} + +} // namespace IPC diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h index 0bea305..2a516ed 100644 --- a/chrome/common/render_messages.h +++ b/chrome/common/render_messages.h @@ -9,6 +9,8 @@ #include <string> #include <vector> +// TODO(erg): This list has been temporarily annotated by erg while doing work +// on which headers to pull out. #include "app/clipboard/clipboard.h" #include "app/surface/transport_dib.h" #include "base/basictypes.h" @@ -19,43 +21,37 @@ #include "chrome/common/common_param_traits.h" #include "chrome/common/css_colors.h" #include "chrome/common/dom_storage_common.h" -#include "chrome/common/edit_command.h" -#include "chrome/common/extensions/extension_extent.h" -#include "chrome/common/extensions/url_pattern.h" +#include "chrome/common/extensions/extension_extent.h" // used in struct #include "chrome/common/font_descriptor_mac.h" -#include "chrome/common/indexed_db_key.h" +#include "chrome/common/indexed_db_key.h" // used in struct #include "chrome/common/navigation_gesture.h" #include "chrome/common/page_transition_types.h" -#include "chrome/common/renderer_preferences.h" +#include "chrome/common/renderer_preferences.h" // used in struct #include "chrome/common/resource_response.h" #include "chrome/common/translate_errors.h" #include "chrome/common/view_types.h" -#include "chrome/common/serialized_script_value.h" #include "chrome/common/webkit_param_traits.h" #include "chrome/common/window_container_type.h" #include "gfx/native_widget_types.h" +#include "gfx/rect.h" #include "googleurl/src/gurl.h" #include "ipc/ipc_message_utils.h" #include "ipc/ipc_platform_file.h" #include "media/audio/audio_io.h" #include "net/base/upload_data.h" -#include "net/http/http_response_headers.h" #include "third_party/WebKit/WebKit/chromium/public/WebStorageArea.h" #include "third_party/WebKit/WebKit/chromium/public/WebTextDirection.h" -#include "webkit/appcache/appcache_interfaces.h" -#include "webkit/glue/context_menu.h" -#include "webkit/glue/form_data.h" -#include "webkit/glue/form_field.h" -#include "webkit/glue/password_form.h" -#include "webkit/glue/password_form_dom_manager.h" +#include "webkit/appcache/appcache_interfaces.h" // enum appcache::Status +#include "webkit/glue/password_form.h" // used in struct #include "webkit/glue/plugins/webplugin.h" -#include "webkit/glue/plugins/webplugininfo.h" #include "webkit/glue/resource_loader_bridge.h" -#include "webkit/glue/webaccessibility.h" -#include "webkit/glue/webcookie.h" -#include "webkit/glue/webdropdata.h" #include "webkit/glue/webmenuitem.h" -#include "webkit/glue/webpreferences.h" +#include "webkit/glue/webpreferences.h" // used in struct + +namespace appcache { +struct AppCacheInfo; +struct AppCacheResourceInfo; +} namespace base { class Time; @@ -83,6 +79,11 @@ class IndexedDBKey; class SerializedScriptValue; class SkBitmap; +class URLPattern; +struct ContextMenuParams; +struct WebDropData; +struct WebPluginInfo; +struct WebPluginMimeType; // Parameters structure for ViewMsg_Navigate, which has too many data // parameters to be reasonably put in a predefined IPC message. @@ -914,46 +915,9 @@ struct ParamTraits<ResourceType::Type> { template <> struct ParamTraits<ViewMsg_Navigate_Params> { typedef ViewMsg_Navigate_Params param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.page_id); - WriteParam(m, p.pending_history_list_offset); - WriteParam(m, p.current_history_list_offset); - WriteParam(m, p.current_history_list_length); - WriteParam(m, p.url); - WriteParam(m, p.referrer); - WriteParam(m, p.transition); - WriteParam(m, p.state); - WriteParam(m, p.navigation_type); - WriteParam(m, p.request_time); - } - static bool Read(const Message* m, void** iter, param_type* p) { - return - ReadParam(m, iter, &p->page_id) && - ReadParam(m, iter, &p->pending_history_list_offset) && - ReadParam(m, iter, &p->current_history_list_offset) && - ReadParam(m, iter, &p->current_history_list_length) && - ReadParam(m, iter, &p->url) && - ReadParam(m, iter, &p->referrer) && - ReadParam(m, iter, &p->transition) && - ReadParam(m, iter, &p->state) && - ReadParam(m, iter, &p->navigation_type) && - ReadParam(m, iter, &p->request_time); - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"("); - LogParam(p.page_id, l); - l->append(L", "); - LogParam(p.url, l); - l->append(L", "); - LogParam(p.transition, l); - l->append(L", "); - LogParam(p.state, l); - l->append(L", "); - LogParam(p.navigation_type, l); - l->append(L", "); - LogParam(p.request_time, l); - l->append(L")"); - } + 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<> @@ -976,7 +940,7 @@ struct ParamTraits<ViewMsg_Navigate_Params::NavigationType> { event = L"NavigationType_RELOAD"; break; - case ViewMsg_Navigate_Params::RELOAD_IGNORING_CACHE: + case ViewMsg_Navigate_Params::RELOAD_IGNORING_CACHE: event = L"NavigationType_RELOAD_IGNORING_CACHE"; break; @@ -1000,38 +964,9 @@ struct ParamTraits<ViewMsg_Navigate_Params::NavigationType> { template <> struct ParamTraits<webkit_glue::FormField> { typedef webkit_glue::FormField param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.label()); - WriteParam(m, p.name()); - WriteParam(m, p.value()); - WriteParam(m, p.form_control_type()); - WriteParam(m, p.size()); - WriteParam(m, p.option_strings()); - } - static bool Read(const Message* m, void** iter, param_type* p) { - string16 label, name, value, form_control_type; - int size = 0; - std::vector<string16> options; - bool result = ReadParam(m, iter, &label); - result = result && ReadParam(m, iter, &name); - result = result && ReadParam(m, iter, &value); - result = result && ReadParam(m, iter, &form_control_type); - result = result && ReadParam(m, iter, &size); - result = result && ReadParam(m, iter, &options); - if (!result) - return false; - - p->set_label(label); - p->set_name(name); - p->set_value(value); - p->set_form_control_type(form_control_type); - p->set_size(size); - p->set_option_strings(options); - return true; - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"<FormField>"); - } + 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); }; // Traits for FontDescriptor structure to pack/unpack. @@ -1172,234 +1107,52 @@ struct ParamTraits<ViewHostMsg_FrameNavigate_Params> { template <> struct ParamTraits<ContextMenuParams> { typedef ContextMenuParams param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.media_type); - WriteParam(m, p.x); - WriteParam(m, p.y); - WriteParam(m, p.link_url); - WriteParam(m, p.unfiltered_link_url); - WriteParam(m, p.src_url); - WriteParam(m, p.is_image_blocked); - WriteParam(m, p.page_url); - WriteParam(m, p.frame_url); - WriteParam(m, p.media_flags); - WriteParam(m, p.selection_text); - WriteParam(m, p.misspelled_word); - WriteParam(m, p.dictionary_suggestions); - WriteParam(m, p.spellcheck_enabled); - WriteParam(m, p.is_editable); -#if defined(OS_MACOSX) - WriteParam(m, p.writing_direction_default); - WriteParam(m, p.writing_direction_left_to_right); - WriteParam(m, p.writing_direction_right_to_left); -#endif // OS_MACOSX - WriteParam(m, p.edit_flags); - WriteParam(m, p.security_info); - WriteParam(m, p.frame_charset); - WriteParam(m, p.custom_items); - } - static bool Read(const Message* m, void** iter, param_type* p) { - return - ReadParam(m, iter, &p->media_type) && - ReadParam(m, iter, &p->x) && - ReadParam(m, iter, &p->y) && - ReadParam(m, iter, &p->link_url) && - ReadParam(m, iter, &p->unfiltered_link_url) && - ReadParam(m, iter, &p->src_url) && - ReadParam(m, iter, &p->is_image_blocked) && - ReadParam(m, iter, &p->page_url) && - ReadParam(m, iter, &p->frame_url) && - ReadParam(m, iter, &p->media_flags) && - ReadParam(m, iter, &p->selection_text) && - ReadParam(m, iter, &p->misspelled_word) && - ReadParam(m, iter, &p->dictionary_suggestions) && - ReadParam(m, iter, &p->spellcheck_enabled) && - ReadParam(m, iter, &p->is_editable) && -#if defined(OS_MACOSX) - ReadParam(m, iter, &p->writing_direction_default) && - ReadParam(m, iter, &p->writing_direction_left_to_right) && - ReadParam(m, iter, &p->writing_direction_right_to_left) && -#endif // OS_MACOSX - ReadParam(m, iter, &p->edit_flags) && - ReadParam(m, iter, &p->security_info) && - ReadParam(m, iter, &p->frame_charset) && - ReadParam(m, iter, &p->custom_items); - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"<ContextMenuParams>"); - } + 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); }; // Traits for ViewHostMsg_UpdateRect_Params structure to pack/unpack. template <> struct ParamTraits<ViewHostMsg_UpdateRect_Params> { typedef ViewHostMsg_UpdateRect_Params param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.bitmap); - WriteParam(m, p.bitmap_rect); - WriteParam(m, p.dx); - WriteParam(m, p.dy); - WriteParam(m, p.scroll_rect); - WriteParam(m, p.copy_rects); - WriteParam(m, p.view_size); - WriteParam(m, p.plugin_window_moves); - WriteParam(m, p.flags); - } - static bool Read(const Message* m, void** iter, param_type* p) { - return - ReadParam(m, iter, &p->bitmap) && - ReadParam(m, iter, &p->bitmap_rect) && - ReadParam(m, iter, &p->dx) && - ReadParam(m, iter, &p->dy) && - ReadParam(m, iter, &p->scroll_rect) && - ReadParam(m, iter, &p->copy_rects) && - ReadParam(m, iter, &p->view_size) && - ReadParam(m, iter, &p->plugin_window_moves) && - ReadParam(m, iter, &p->flags); - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"("); - LogParam(p.bitmap, l); - l->append(L", "); - LogParam(p.bitmap_rect, l); - l->append(L", "); - LogParam(p.dx, l); - l->append(L", "); - LogParam(p.dy, l); - l->append(L", "); - LogParam(p.scroll_rect, l); - l->append(L", "); - LogParam(p.copy_rects, l); - l->append(L", "); - LogParam(p.view_size, l); - l->append(L", "); - LogParam(p.plugin_window_moves, l); - l->append(L", "); - LogParam(p.flags, l); - l->append(L")"); - } + 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<webkit_glue::WebPluginGeometry> { typedef webkit_glue::WebPluginGeometry param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.window); - WriteParam(m, p.window_rect); - WriteParam(m, p.clip_rect); - WriteParam(m, p.cutout_rects); - WriteParam(m, p.rects_valid); - WriteParam(m, p.visible); - } - static bool Read(const Message* m, void** iter, param_type* p) { - return - ReadParam(m, iter, &p->window) && - ReadParam(m, iter, &p->window_rect) && - ReadParam(m, iter, &p->clip_rect) && - ReadParam(m, iter, &p->cutout_rects) && - ReadParam(m, iter, &p->rects_valid) && - ReadParam(m, iter, &p->visible); - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"("); - LogParam(p.window, l); - l->append(L", "); - LogParam(p.window_rect, l); - l->append(L", "); - LogParam(p.clip_rect, l); - l->append(L", "); - LogParam(p.cutout_rects, l); - l->append(L", "); - LogParam(p.rects_valid, l); - l->append(L", "); - LogParam(p.visible, l); - l->append(L")"); - } + 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); }; // Traits for ViewMsg_GetPlugins_Reply structure to pack/unpack. template <> struct ParamTraits<WebPluginMimeType> { typedef WebPluginMimeType param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.mime_type); - WriteParam(m, p.file_extensions); - WriteParam(m, p.description); - } - static bool Read(const Message* m, void** iter, param_type* r) { - return - ReadParam(m, iter, &r->mime_type) && - ReadParam(m, iter, &r->file_extensions) && - ReadParam(m, iter, &r->description); - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"("); - LogParam(p.mime_type, l); - l->append(L", "); - LogParam(p.file_extensions, l); - l->append(L", "); - LogParam(p.description, l); - l->append(L")"); - } + 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<WebPluginInfo> { typedef WebPluginInfo param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.name); - WriteParam(m, p.path); - WriteParam(m, p.version); - WriteParam(m, p.desc); - WriteParam(m, p.mime_types); - WriteParam(m, p.enabled); - } - static bool Read(const Message* m, void** iter, param_type* r) { - return - ReadParam(m, iter, &r->name) && - ReadParam(m, iter, &r->path) && - ReadParam(m, iter, &r->version) && - ReadParam(m, iter, &r->desc) && - ReadParam(m, iter, &r->mime_types) && - ReadParam(m, iter, &r->enabled); - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"("); - LogParam(p.name, l); - l->append(L", "); - l->append(L", "); - LogParam(p.path, l); - l->append(L", "); - LogParam(p.version, l); - l->append(L", "); - LogParam(p.desc, l); - l->append(L", "); - LogParam(p.mime_types, l); - l->append(L", "); - LogParam(p.enabled, l); - l->append(L")"); - } + 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); }; // Traits for webkit_glue::PasswordFormDomManager::FillData. template <> struct ParamTraits<webkit_glue::PasswordFormFillData> { typedef webkit_glue::PasswordFormFillData param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.basic_data); - WriteParam(m, p.additional_logins); - WriteParam(m, p.wait_for_username); - } - static bool Read(const Message* m, void** iter, param_type* r) { - return - ReadParam(m, iter, &r->basic_data) && - ReadParam(m, iter, &r->additional_logins) && - ReadParam(m, iter, &r->wait_for_username); - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"<PasswordFormFillData>"); - } + 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<> @@ -1542,24 +1295,9 @@ struct ParamTraits<ViewHostMsg_Resource_Request> { template <> struct ParamTraits<scoped_refptr<net::HttpResponseHeaders> > { typedef scoped_refptr<net::HttpResponseHeaders> param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.get() != NULL); - if (p) { - // Do not disclose Set-Cookie headers over IPC. - p->Persist(m, net::HttpResponseHeaders::PERSIST_SANS_COOKIES); - } - } - static bool Read(const Message* m, void** iter, param_type* r) { - bool has_object; - if (!ReadParam(m, iter, &has_object)) - return false; - if (has_object) - *r = new net::HttpResponseHeaders(*m, iter); - return true; - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"<HttpResponseHeaders>"); - } + 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); }; // Traits for webkit_glue::ResourceLoaderBridge::LoadTimingInfo @@ -1762,108 +1500,26 @@ struct ParamTraits<SyncLoadResult> { template <> struct ParamTraits<SerializedScriptValue> { typedef SerializedScriptValue param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.is_null()); - WriteParam(m, p.is_invalid()); - WriteParam(m, p.data()); - } - static bool Read(const Message* m, void** iter, param_type* r) { - bool is_null; - bool is_invalid; - string16 data; - bool ok = - ReadParam(m, iter, &is_null) && - ReadParam(m, iter, &is_invalid) && - ReadParam(m, iter, &data); - if (!ok) - return false; - r->set_is_null(is_null); - r->set_is_invalid(is_invalid); - r->set_data(data); - return true; - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"<SerializedScriptValue>("); - LogParam(p.is_null(), l); - l->append(L", "); - LogParam(p.is_invalid(), l); - l->append(L", "); - LogParam(p.data(), l); - l->append(L")"); - } + 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<IndexedDBKey> { typedef IndexedDBKey param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, int(p.type())); - // TODO(jorlow): Technically, we only need to pack the type being used. - WriteParam(m, p.string()); - WriteParam(m, p.number()); - } - static bool Read(const Message* m, void** iter, param_type* r) { - int type; - string16 string; - int32 number; - bool ok = - ReadParam(m, iter, &type) && - ReadParam(m, iter, &string) && - ReadParam(m, iter, &number); - if (!ok) - return false; - switch (type) { - case WebKit::WebIDBKey::NullType: - r->SetNull(); - return true; - case WebKit::WebIDBKey::StringType: - r->Set(string); - return true; - case WebKit::WebIDBKey::NumberType: - r->Set(number); - return true; - case WebKit::WebIDBKey::InvalidType: - r->SetInvalid(); - return true; - } - NOTREACHED(); - return false; - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"<IndexedDBKey>("); - LogParam(int(p.type()), l); - l->append(L", "); - LogParam(p.string(), l); - l->append(L", "); - LogParam(p.number(), l); - l->append(L")"); - } + 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); }; // Traits for FormData structure to pack/unpack. template <> struct ParamTraits<webkit_glue::FormData> { typedef webkit_glue::FormData param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.name); - WriteParam(m, p.method); - WriteParam(m, p.origin); - WriteParam(m, p.action); - WriteParam(m, p.user_submitted); - WriteParam(m, p.fields); - } - static bool Read(const Message* m, void** iter, param_type* p) { - return - ReadParam(m, iter, &p->name) && - ReadParam(m, iter, &p->method) && - ReadParam(m, iter, &p->origin) && - ReadParam(m, iter, &p->action) && - ReadParam(m, iter, &p->user_submitted) && - ReadParam(m, iter, &p->fields); - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"<FormData>"); - } + 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); }; // Traits for ViewMsg_Print_Params @@ -1982,211 +1638,27 @@ struct ParamTraits<CSSColors::CSSColorName> { template <> struct ParamTraits<RendererPreferences> { typedef RendererPreferences param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.can_accept_load_drops); - WriteParam(m, p.should_antialias_text); - WriteParam(m, static_cast<int>(p.hinting)); - WriteParam(m, static_cast<int>(p.subpixel_rendering)); - WriteParam(m, p.focus_ring_color); - WriteParam(m, p.thumb_active_color); - WriteParam(m, p.thumb_inactive_color); - WriteParam(m, p.track_color); - WriteParam(m, p.active_selection_bg_color); - WriteParam(m, p.active_selection_fg_color); - WriteParam(m, p.inactive_selection_bg_color); - WriteParam(m, p.inactive_selection_fg_color); - WriteParam(m, p.browser_handles_top_level_requests); - WriteParam(m, p.caret_blink_interval); - } - static bool Read(const Message* m, void** iter, param_type* p) { - if (!ReadParam(m, iter, &p->can_accept_load_drops)) - return false; - if (!ReadParam(m, iter, &p->should_antialias_text)) - return false; - - int hinting = 0; - if (!ReadParam(m, iter, &hinting)) - return false; - p->hinting = static_cast<RendererPreferencesHintingEnum>(hinting); - - int subpixel_rendering = 0; - if (!ReadParam(m, iter, &subpixel_rendering)) - return false; - p->subpixel_rendering = - static_cast<RendererPreferencesSubpixelRenderingEnum>( - subpixel_rendering); - - int focus_ring_color; - if (!ReadParam(m, iter, &focus_ring_color)) - return false; - p->focus_ring_color = focus_ring_color; - - int thumb_active_color, thumb_inactive_color, track_color; - int active_selection_bg_color, active_selection_fg_color; - int inactive_selection_bg_color, inactive_selection_fg_color; - if (!ReadParam(m, iter, &thumb_active_color) || - !ReadParam(m, iter, &thumb_inactive_color) || - !ReadParam(m, iter, &track_color) || - !ReadParam(m, iter, &active_selection_bg_color) || - !ReadParam(m, iter, &active_selection_fg_color) || - !ReadParam(m, iter, &inactive_selection_bg_color) || - !ReadParam(m, iter, &inactive_selection_fg_color)) - return false; - p->thumb_active_color = thumb_active_color; - p->thumb_inactive_color = thumb_inactive_color; - p->track_color = track_color; - p->active_selection_bg_color = active_selection_bg_color; - p->active_selection_fg_color = active_selection_fg_color; - p->inactive_selection_bg_color = inactive_selection_bg_color; - p->inactive_selection_fg_color = inactive_selection_fg_color; - - if (!ReadParam(m, iter, &p->browser_handles_top_level_requests)) - return false; - - if (!ReadParam(m, iter, &p->caret_blink_interval)) - return false; - - return true; - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"<RendererPreferences>"); - } + 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); }; // Traits for WebPreferences structure to pack/unpack. template <> struct ParamTraits<WebPreferences> { typedef WebPreferences param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.standard_font_family); - WriteParam(m, p.fixed_font_family); - WriteParam(m, p.serif_font_family); - WriteParam(m, p.sans_serif_font_family); - WriteParam(m, p.cursive_font_family); - WriteParam(m, p.fantasy_font_family); - WriteParam(m, p.default_font_size); - WriteParam(m, p.default_fixed_font_size); - WriteParam(m, p.minimum_font_size); - WriteParam(m, p.minimum_logical_font_size); - WriteParam(m, p.default_encoding); - WriteParam(m, p.javascript_enabled); - WriteParam(m, p.web_security_enabled); - WriteParam(m, p.javascript_can_open_windows_automatically); - WriteParam(m, p.loads_images_automatically); - WriteParam(m, p.plugins_enabled); - WriteParam(m, p.dom_paste_enabled); - WriteParam(m, p.developer_extras_enabled); - WriteParam(m, p.inspector_settings); - WriteParam(m, p.site_specific_quirks_enabled); - WriteParam(m, p.shrinks_standalone_images_to_fit); - WriteParam(m, p.uses_universal_detector); - WriteParam(m, p.text_areas_are_resizable); - WriteParam(m, p.java_enabled); - WriteParam(m, p.allow_scripts_to_close_windows); - WriteParam(m, p.uses_page_cache); - WriteParam(m, p.remote_fonts_enabled); - WriteParam(m, p.javascript_can_access_clipboard); - WriteParam(m, p.xss_auditor_enabled); - WriteParam(m, p.local_storage_enabled); - WriteParam(m, p.databases_enabled); - WriteParam(m, p.application_cache_enabled); - WriteParam(m, p.tabs_to_links); - WriteParam(m, p.user_style_sheet_enabled); - WriteParam(m, p.user_style_sheet_location); - WriteParam(m, p.author_and_user_styles_enabled); - WriteParam(m, p.allow_universal_access_from_file_urls); - WriteParam(m, p.allow_file_access_from_file_urls); - WriteParam(m, p.experimental_webgl_enabled); - WriteParam(m, p.show_composited_layer_borders); - WriteParam(m, p.accelerated_compositing_enabled); - WriteParam(m, p.accelerated_2d_canvas_enabled); - WriteParam(m, p.memory_info_enabled); - } - static bool Read(const Message* m, void** iter, param_type* p) { - return - ReadParam(m, iter, &p->standard_font_family) && - ReadParam(m, iter, &p->fixed_font_family) && - ReadParam(m, iter, &p->serif_font_family) && - ReadParam(m, iter, &p->sans_serif_font_family) && - ReadParam(m, iter, &p->cursive_font_family) && - ReadParam(m, iter, &p->fantasy_font_family) && - ReadParam(m, iter, &p->default_font_size) && - ReadParam(m, iter, &p->default_fixed_font_size) && - ReadParam(m, iter, &p->minimum_font_size) && - ReadParam(m, iter, &p->minimum_logical_font_size) && - ReadParam(m, iter, &p->default_encoding) && - ReadParam(m, iter, &p->javascript_enabled) && - ReadParam(m, iter, &p->web_security_enabled) && - ReadParam(m, iter, &p->javascript_can_open_windows_automatically) && - ReadParam(m, iter, &p->loads_images_automatically) && - ReadParam(m, iter, &p->plugins_enabled) && - ReadParam(m, iter, &p->dom_paste_enabled) && - ReadParam(m, iter, &p->developer_extras_enabled) && - ReadParam(m, iter, &p->inspector_settings) && - ReadParam(m, iter, &p->site_specific_quirks_enabled) && - ReadParam(m, iter, &p->shrinks_standalone_images_to_fit) && - ReadParam(m, iter, &p->uses_universal_detector) && - ReadParam(m, iter, &p->text_areas_are_resizable) && - ReadParam(m, iter, &p->java_enabled) && - ReadParam(m, iter, &p->allow_scripts_to_close_windows) && - ReadParam(m, iter, &p->uses_page_cache) && - ReadParam(m, iter, &p->remote_fonts_enabled) && - ReadParam(m, iter, &p->javascript_can_access_clipboard) && - ReadParam(m, iter, &p->xss_auditor_enabled) && - ReadParam(m, iter, &p->local_storage_enabled) && - ReadParam(m, iter, &p->databases_enabled) && - ReadParam(m, iter, &p->application_cache_enabled) && - ReadParam(m, iter, &p->tabs_to_links) && - ReadParam(m, iter, &p->user_style_sheet_enabled) && - ReadParam(m, iter, &p->user_style_sheet_location) && - ReadParam(m, iter, &p->author_and_user_styles_enabled) && - ReadParam(m, iter, &p->allow_universal_access_from_file_urls) && - ReadParam(m, iter, &p->allow_file_access_from_file_urls) && - ReadParam(m, iter, &p->experimental_webgl_enabled) && - ReadParam(m, iter, &p->show_composited_layer_borders) && - ReadParam(m, iter, &p->accelerated_compositing_enabled) && - ReadParam(m, iter, &p->accelerated_2d_canvas_enabled) && - ReadParam(m, iter, &p->memory_info_enabled); - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"<WebPreferences>"); - } + 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); }; // Traits for WebDropData template <> struct ParamTraits<WebDropData> { typedef WebDropData param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.identity); - WriteParam(m, p.url); - WriteParam(m, p.url_title); - WriteParam(m, p.download_metadata); - WriteParam(m, p.file_extension); - WriteParam(m, p.filenames); - WriteParam(m, p.plain_text); - WriteParam(m, p.text_html); - WriteParam(m, p.html_base_url); - WriteParam(m, p.file_description_filename); - WriteParam(m, p.file_contents); - } - static bool Read(const Message* m, void** iter, param_type* p) { - return - ReadParam(m, iter, &p->identity) && - ReadParam(m, iter, &p->url) && - ReadParam(m, iter, &p->url_title) && - ReadParam(m, iter, &p->download_metadata) && - ReadParam(m, iter, &p->file_extension) && - ReadParam(m, iter, &p->filenames) && - ReadParam(m, iter, &p->plain_text) && - ReadParam(m, iter, &p->text_html) && - ReadParam(m, iter, &p->html_base_url) && - ReadParam(m, iter, &p->file_description_filename) && - ReadParam(m, iter, &p->file_contents); - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"<WebDropData>"); - } + 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); }; // Traits for AudioManager::Format. @@ -2592,23 +2064,9 @@ struct SimilarTypeTraits<ViewType::Type> { template <> struct ParamTraits<URLPattern> { typedef URLPattern param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.valid_schemes()); - WriteParam(m, p.GetAsString()); - } - static bool Read(const Message* m, void** iter, param_type* p) { - int valid_schemes; - std::string spec; - if (!ReadParam(m, iter, &valid_schemes) || - !ReadParam(m, iter, &spec)) - return false; - - p->set_valid_schemes(valid_schemes); - return p->Parse(spec); - } - static void Log(const param_type& p, std::wstring* l) { - LogParam(p.GetAsString(), l); - } + 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 <> @@ -2651,20 +2109,9 @@ struct ParamTraits<Clipboard::Buffer> { template <> struct ParamTraits<EditCommand> { typedef EditCommand param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.name); - WriteParam(m, p.value); - } - static bool Read(const Message* m, void** iter, param_type* p) { - return ReadParam(m, iter, &p->name) && ReadParam(m, iter, &p->value); - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"("); - LogParam(p.name, l); - l->append(L":"); - LogParam(p.value, l); - l->append(L")"); - } + 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); }; // Traits for DOMStorageType enum. @@ -3012,30 +2459,9 @@ struct ParamTraits<ViewHostMsg_ShowNotification_Params> { template <> struct ParamTraits<webkit_glue::WebCookie> { typedef webkit_glue::WebCookie param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.name); - WriteParam(m, p.value); - WriteParam(m, p.domain); - WriteParam(m, p.path); - WriteParam(m, p.expires); - WriteParam(m, p.http_only); - WriteParam(m, p.secure); - WriteParam(m, p.session); - } - static bool Read(const Message* m, void** iter, param_type* p) { - return - ReadParam(m, iter, &p->name) && - ReadParam(m, iter, &p->value) && - ReadParam(m, iter, &p->domain) && - ReadParam(m, iter, &p->path) && - ReadParam(m, iter, &p->expires) && - ReadParam(m, iter, &p->http_only) && - ReadParam(m, iter, &p->secure) && - ReadParam(m, iter, &p->session); - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"<WebCookie>"); - } + 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<> @@ -3183,23 +2609,9 @@ struct ParamTraits<ViewHostMsg_CreateWindow_Params> { template <> struct ParamTraits<ExtensionExtent> { typedef ExtensionExtent param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.patterns()); - } - static bool Read(const Message* m, void** iter, param_type* p) { - std::vector<URLPattern> patterns; - bool success = - ReadParam(m, iter, &patterns); - if (!success) - return false; - - for (size_t i = 0; i < patterns.size(); ++i) - p->AddPattern(patterns[i]); - return true; - } - static void Log(const param_type& p, std::wstring* l) { - LogParam(p.patterns(), l); - } + 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 <> @@ -3237,86 +2649,18 @@ struct ParamTraits<ViewMsg_ExtensionExtentsUpdated_Params> { template<> struct ParamTraits<appcache::AppCacheResourceInfo> { typedef appcache::AppCacheResourceInfo param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.url); - WriteParam(m, p.size); - WriteParam(m, p.is_manifest); - WriteParam(m, p.is_master); - WriteParam(m, p.is_fallback); - WriteParam(m, p.is_foreign); - WriteParam(m, p.is_explicit); - } - static bool Read(const Message* m, void** iter, param_type* p) { - return ReadParam(m, iter, &p->url) && - ReadParam(m, iter, &p->size) && - ReadParam(m, iter, &p->is_manifest) && - ReadParam(m, iter, &p->is_master) && - ReadParam(m, iter, &p->is_fallback) && - ReadParam(m, iter, &p->is_foreign) && - ReadParam(m, iter, &p->is_explicit); - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"("); - LogParam(p.url, l); - l->append(L", "); - LogParam(p.size, l); - l->append(L", "); - LogParam(p.is_manifest, l); - l->append(L", "); - LogParam(p.is_master, l); - l->append(L", "); - LogParam(p.is_fallback, l); - l->append(L", "); - LogParam(p.is_foreign, l); - l->append(L", "); - LogParam(p.is_explicit, l); - l->append(L")"); - } + 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<appcache::AppCacheInfo> { - typedef appcache::AppCacheInfo param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.manifest_url); - WriteParam(m, p.creation_time); - WriteParam(m, p.last_update_time); - WriteParam(m, p.last_access_time); - WriteParam(m, p.cache_id); - WriteParam(m, p.status); - WriteParam(m, p.size); - WriteParam(m, p.is_complete); - } - static bool Read(const Message* m, void** iter, param_type* p) { - return ReadParam(m, iter, &p->manifest_url) && - ReadParam(m, iter, &p->creation_time) && - ReadParam(m, iter, &p->last_update_time) && - ReadParam(m, iter, &p->last_access_time) && - ReadParam(m, iter, &p->cache_id) && - ReadParam(m, iter, &p->status) && - ReadParam(m, iter, &p->size) && - ReadParam(m, iter, &p->is_complete); - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"("); - LogParam(p.manifest_url, l); - l->append(L", "); - LogParam(p.creation_time, l); - l->append(L", "); - LogParam(p.last_update_time, l); - l->append(L", "); - LogParam(p.last_access_time, l); - l->append(L", "); - LogParam(p.cache_id, l); - l->append(L", "); - LogParam(p.status, l); - l->append(L", "); - LogParam(p.size, l); - l->append(L")"); - LogParam(p.is_complete, l); - l->append(L", "); - } - }; +struct ParamTraits<appcache::AppCacheInfo> { + typedef appcache::AppCacheInfo 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<WindowContainerType> { @@ -3335,62 +2679,16 @@ struct ParamTraits<WindowContainerType> { return true; } static void Log(const param_type& p, std::wstring* l) { - LogParam(p, l); + ParamTraits<int>::Log(static_cast<int>(p), l); } }; template <> struct ParamTraits<webkit_glue::WebAccessibility> { typedef webkit_glue::WebAccessibility param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.id); - WriteParam(m, p.name); - WriteParam(m, p.value); - WriteParam(m, static_cast<int>(p.role)); - WriteParam(m, static_cast<int>(p.state)); - WriteParam(m, p.location); - WriteParam(m, p.attributes); - WriteParam(m, p.children); - } - static bool Read(const Message* m, void** iter, param_type* p) { - bool ret = ReadParam(m, iter, &p->id); - ret = ret && ReadParam(m, iter, &p->name); - ret = ret && ReadParam(m, iter, &p->value); - int role = -1; - ret = ret && ReadParam(m, iter, &role); - if (role >= webkit_glue::WebAccessibility::ROLE_NONE && - role < webkit_glue::WebAccessibility::NUM_ROLES) { - p->role = static_cast<webkit_glue::WebAccessibility::Role>(role); - } else { - p->role = webkit_glue::WebAccessibility::ROLE_NONE; - } - int state = 0; - ret = ret && ReadParam(m, iter, &state); - p->state = static_cast<webkit_glue::WebAccessibility::State>(state); - ret = ret && ReadParam(m, iter, &p->location); - ret = ret && ReadParam(m, iter, &p->attributes); - ret = ret && ReadParam(m, iter, &p->children); - return ret; - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"("); - LogParam(p.id, l); - l->append(L", "); - LogParam(p.name, l); - l->append(L", "); - LogParam(p.value, l); - l->append(L", "); - LogParam(static_cast<int>(p.role), l); - l->append(L", "); - LogParam(static_cast<int>(p.state), l); - l->append(L", "); - LogParam(p.location, l); - l->append(L", "); - LogParam(p.attributes, l); - l->append(L", "); - LogParam(p.children, l); - l->append(L")"); - } + 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); }; // Traits for ViewMsg_DeviceOrientationUpdated_Params diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h index 2838579..4aeb137 100644 --- a/chrome/common/render_messages_internal.h +++ b/chrome/common/render_messages_internal.h @@ -16,25 +16,14 @@ #include "base/nullable_string16.h" #include "base/platform_file.h" #include "base/sync_socket.h" -#include "base/time.h" -#include "base/values.h" #include "chrome/common/content_settings.h" -#include "chrome/common/extensions/update_manifest.h" #include "chrome/common/geoposition.h" #include "chrome/common/nacl_types.h" #include "chrome/common/notification_type.h" #include "chrome/common/page_zoom.h" -#include "chrome/common/thumbnail_score.h" #include "chrome/common/translate_errors.h" #include "chrome/common/window_container_type.h" -#include "gfx/rect.h" -#include "ipc/ipc_channel_handle.h" -#include "ipc/ipc_message.h" #include "ipc/ipc_message_macros.h" -#include "third_party/skia/include/core/SkBitmap.h" -#include "webkit/glue/dom_operations.h" -#include "webkit/glue/form_field.h" -#include "webkit/glue/webcursor.h" #if defined(OS_POSIX) #include "base/file_descriptor_posix.h" @@ -52,6 +41,15 @@ // Substitution map for l10n messages. typedef std::map<std::string, std::string> SubstitutionMap; +class SkBitmap; +struct ThumbnailScore; +class WebCursor; + +namespace IPC { +struct ChannelHandle; +class Message; +} + //----------------------------------------------------------------------------- // RenderView messages // These are messages sent from the browser to the renderer process. @@ -190,7 +188,7 @@ IPC_BEGIN_MESSAGES(View) // // This message must be sent just before sending a key event. IPC_MESSAGE_ROUTED1(ViewMsg_SetEditCommandsForNextKeyEvent, - EditCommands /* edit_commands */) + std::vector<EditCommand> /* edit_commands */) // Message payload is the name/value of a WebCore edit command to execute. IPC_MESSAGE_ROUTED2(ViewMsg_ExecuteEditCommand, diff --git a/chrome/common/render_messages_unittest.cc b/chrome/common/render_messages_unittest.cc index ccfc898..4fc0aab 100644 --- a/chrome/common/render_messages_unittest.cc +++ b/chrome/common/render_messages_unittest.cc @@ -7,6 +7,8 @@ #include "base/utf_string_conversions.h" #include "chrome/common/render_messages.h" #include "testing/gtest/include/gtest/gtest.h" +#include "webkit/glue/webaccessibility.h" +#include "third_party/WebKit/WebKit/chromium/public/WebRect.h" TEST(RenderMessagesUnittest, WebAccessibility) { // Test a simple case. diff --git a/chrome/common/resource_dispatcher.cc b/chrome/common/resource_dispatcher.cc index f97f4ef..6e672dd 100644 --- a/chrome/common/resource_dispatcher.cc +++ b/chrome/common/resource_dispatcher.cc @@ -17,6 +17,7 @@ #include "chrome/common/security_filter_peer.h" #include "net/base/net_errors.h" #include "net/base/net_util.h" +#include "net/http/http_response_headers.h" #include "webkit/glue/resource_type.h" #include "webkit/glue/webkit_glue.h" diff --git a/chrome/common/resource_dispatcher_unittest.cc b/chrome/common/resource_dispatcher_unittest.cc index 3e76678..177fea9 100644 --- a/chrome/common/resource_dispatcher_unittest.cc +++ b/chrome/common/resource_dispatcher_unittest.cc @@ -11,6 +11,7 @@ #include "base/scoped_ptr.h" #include "chrome/common/render_messages.h" #include "chrome/common/resource_dispatcher.h" +#include "net/http/http_response_headers.h" #include "testing/gtest/include/gtest/gtest.h" #include "webkit/appcache/appcache_interfaces.h" diff --git a/chrome/common/service_messages.cc b/chrome/common/service_messages.cc new file mode 100644 index 0000000..97a10fd --- /dev/null +++ b/chrome/common/service_messages.cc @@ -0,0 +1,9 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/common/service_messages.h" + +#define MESSAGES_INTERNAL_IMPL_FILE \ + "chrome/common/service_messages_internal.h" +#include "ipc/ipc_message_impl_macros.h" diff --git a/chrome/common/utility_messages.cc b/chrome/common/utility_messages.cc new file mode 100644 index 0000000..4c8e567 --- /dev/null +++ b/chrome/common/utility_messages.cc @@ -0,0 +1,9 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/common/utility_messages.h" + +#define MESSAGES_INTERNAL_IMPL_FILE \ + "chrome/common/utility_messages_internal.h" +#include "ipc/ipc_message_impl_macros.h" diff --git a/chrome/common/webkit_param_traits.cc b/chrome/common/webkit_param_traits.cc new file mode 100644 index 0000000..4a81d46 --- /dev/null +++ b/chrome/common/webkit_param_traits.cc @@ -0,0 +1,170 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/common/webkit_param_traits.h" + +#include "third_party/WebKit/WebKit/chromium/public/WebCompositionUnderline.h" +#include "third_party/WebKit/WebKit/chromium/public/WebFindOptions.h" +#include "third_party/WebKit/WebKit/chromium/public/WebMediaPlayerAction.h" +#include "third_party/WebKit/WebKit/chromium/public/WebScreenInfo.h" + +namespace IPC { + +void ParamTraits<WebKit::WebRect>::Write(Message* m, const param_type& p) { + WriteParam(m, p.x); + WriteParam(m, p.y); + WriteParam(m, p.width); + WriteParam(m, p.height); + } + +bool ParamTraits<WebKit::WebRect>::Read(const Message* m, void** iter, + param_type* p) { + return + ReadParam(m, iter, &p->x) && + ReadParam(m, iter, &p->y) && + ReadParam(m, iter, &p->width) && + ReadParam(m, iter, &p->height); +} + +void ParamTraits<WebKit::WebRect>::Log(const param_type& p, std::wstring* l) { + l->append(L"("); + LogParam(p.x, l); + l->append(L", "); + LogParam(p.y, l); + l->append(L", "); + LogParam(p.width, l); + l->append(L", "); + LogParam(p.height, l); + l->append(L")"); +} + +void ParamTraits<WebKit::WebScreenInfo>::Write(Message* m, const param_type& p) { + WriteParam(m, p.depth); + WriteParam(m, p.depthPerComponent); + WriteParam(m, p.isMonochrome); + WriteParam(m, p.rect); + WriteParam(m, p.availableRect); +} + +bool ParamTraits<WebKit::WebScreenInfo>::Read(const Message* m, void** iter, + param_type* p) { + return + ReadParam(m, iter, &p->depth) && + ReadParam(m, iter, &p->depthPerComponent) && + ReadParam(m, iter, &p->isMonochrome) && + ReadParam(m, iter, &p->rect) && + ReadParam(m, iter, &p->availableRect); +} + +void ParamTraits<WebKit::WebScreenInfo>::Log(const param_type& p, + std::wstring* l) { + l->append(L"("); + LogParam(p.depth, l); + l->append(L", "); + LogParam(p.depthPerComponent, l); + l->append(L", "); + LogParam(p.isMonochrome, l); + l->append(L", "); + LogParam(p.rect, l); + l->append(L", "); + LogParam(p.availableRect, l); + l->append(L")"); +} + +void ParamTraits<WebKit::WebFindOptions>::Write(Message* m, + const param_type& p) { + WriteParam(m, p.forward); + WriteParam(m, p.matchCase); + WriteParam(m, p.findNext); +} + +bool ParamTraits<WebKit::WebFindOptions>::Read(const Message* m, void** iter, + param_type* p) { + return + ReadParam(m, iter, &p->forward) && + ReadParam(m, iter, &p->matchCase) && + ReadParam(m, iter, &p->findNext); +} + +void ParamTraits<WebKit::WebFindOptions>::Log(const param_type& p, + std::wstring* l) { + l->append(L"("); + LogParam(p.forward, l); + l->append(L", "); + LogParam(p.matchCase, l); + l->append(L", "); + LogParam(p.findNext, l); + l->append(L")"); +} + +void ParamTraits<WebKit::WebMediaPlayerAction>::Write(Message* m, + const param_type& p) { + WriteParam(m, static_cast<int>(p.type)); + WriteParam(m, p.enable); +} + +bool ParamTraits<WebKit::WebMediaPlayerAction>::Read(const Message* m, + void** iter, + param_type* r) { + int temp; + if (!ReadParam(m, iter, &temp)) + return false; + r->type = static_cast<param_type::Type>(temp); + return ReadParam(m, iter, &r->enable); +} + +void ParamTraits<WebKit::WebMediaPlayerAction>::Log(const param_type& p, + std::wstring* l) { + l->append(L"("); + switch (p.type) { + case WebKit::WebMediaPlayerAction::Play: + l->append(L"Play"); + break; + case WebKit::WebMediaPlayerAction::Mute: + l->append(L"Mute"); + break; + case WebKit::WebMediaPlayerAction::Loop: + l->append(L"Loop"); + break; + default: + l->append(L"Unknown"); + break; + } + l->append(L", "); + LogParam(p.enable, l); + l->append(L")"); +} + +void ParamTraits<WebKit::WebCompositionUnderline>::Write(Message* m, + const param_type& p) { + WriteParam(m, p.startOffset); + WriteParam(m, p.endOffset); + WriteParam(m, p.color); + WriteParam(m, p.thick); +} + +bool ParamTraits<WebKit::WebCompositionUnderline>::Read( + const Message* m, void** iter, + param_type* p) { + return + ReadParam(m, iter, &p->startOffset) && + ReadParam(m, iter, &p->endOffset) && + ReadParam(m, iter, &p->color) && + ReadParam(m, iter, &p->thick); +} + +void ParamTraits<WebKit::WebCompositionUnderline>::Log(const param_type& p, + std::wstring* l) { + l->append(L"("); + LogParam(p.startOffset, l); + l->append(L","); + LogParam(p.endOffset, l); + l->append(L":"); + LogParam(p.color, l); + l->append(L":"); + LogParam(p.thick, l); + l->append(L")"); +} + +} // namespace IPC diff --git a/chrome/common/webkit_param_traits.h b/chrome/common/webkit_param_traits.h index 748c26b..63cb10b 100644 --- a/chrome/common/webkit_param_traits.h +++ b/chrome/common/webkit_param_traits.h @@ -26,80 +26,38 @@ #include "ipc/ipc_message_utils.h" #include "third_party/WebKit/WebKit/chromium/public/WebCache.h" -#include "third_party/WebKit/WebKit/chromium/public/WebCompositionUnderline.h" #include "third_party/WebKit/WebKit/chromium/public/WebConsoleMessage.h" #include "third_party/WebKit/WebKit/chromium/public/WebContextMenuData.h" #include "third_party/WebKit/WebKit/chromium/public/WebDragOperation.h" -#include "third_party/WebKit/WebKit/chromium/public/WebFindOptions.h" #include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h" -#include "third_party/WebKit/WebKit/chromium/public/WebMediaPlayerAction.h" #include "third_party/WebKit/WebKit/chromium/public/WebPopupType.h" -#include "third_party/WebKit/WebKit/chromium/public/WebScreenInfo.h" #include "third_party/WebKit/WebKit/chromium/public/WebTextDirection.h" #include "third_party/WebKit/WebKit/chromium/public/WebTextInputType.h" +namespace WebKit { +struct WebCompositionUnderline; +struct WebFindOptions; +struct WebMediaPlayerAction; +struct WebRect; +struct WebScreenInfo; +} + namespace IPC { template <> struct ParamTraits<WebKit::WebRect> { typedef WebKit::WebRect param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.x); - WriteParam(m, p.y); - WriteParam(m, p.width); - WriteParam(m, p.height); - } - static bool Read(const Message* m, void** iter, param_type* p) { - return - ReadParam(m, iter, &p->x) && - ReadParam(m, iter, &p->y) && - ReadParam(m, iter, &p->width) && - ReadParam(m, iter, &p->height); - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"("); - LogParam(p.x, l); - l->append(L", "); - LogParam(p.y, l); - l->append(L", "); - LogParam(p.width, l); - l->append(L", "); - LogParam(p.height, l); - l->append(L")"); - } + 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<WebKit::WebScreenInfo> { typedef WebKit::WebScreenInfo param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.depth); - WriteParam(m, p.depthPerComponent); - WriteParam(m, p.isMonochrome); - WriteParam(m, p.rect); - WriteParam(m, p.availableRect); - } - static bool Read(const Message* m, void** iter, param_type* p) { - return - ReadParam(m, iter, &p->depth) && - ReadParam(m, iter, &p->depthPerComponent) && - ReadParam(m, iter, &p->isMonochrome) && - ReadParam(m, iter, &p->rect) && - ReadParam(m, iter, &p->availableRect); - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"("); - LogParam(p.depth, l); - l->append(L", "); - LogParam(p.depthPerComponent, l); - l->append(L", "); - LogParam(p.isMonochrome, l); - l->append(L", "); - LogParam(p.rect, l); - l->append(L", "); - LogParam(p.availableRect, l); - l->append(L")"); - } + 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 <> @@ -141,26 +99,9 @@ struct ParamTraits<WebKit::WebPopupType> { template <> struct ParamTraits<WebKit::WebFindOptions> { typedef WebKit::WebFindOptions param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.forward); - WriteParam(m, p.matchCase); - WriteParam(m, p.findNext); - } - static bool Read(const Message* m, void** iter, param_type* p) { - return - ReadParam(m, iter, &p->forward) && - ReadParam(m, iter, &p->matchCase) && - ReadParam(m, iter, &p->findNext); - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"("); - LogParam(p.forward, l); - l->append(L", "); - LogParam(p.matchCase, l); - l->append(L", "); - LogParam(p.findNext, l); - l->append(L")"); - } + 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 <> @@ -328,37 +269,9 @@ struct ParamTraits<WebKit::WebDragOperation> { template <> struct ParamTraits<WebKit::WebMediaPlayerAction> { typedef WebKit::WebMediaPlayerAction param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, static_cast<int>(p.type)); - WriteParam(m, p.enable); - } - static bool Read(const Message* m, void** iter, param_type* r) { - int temp; - if (!ReadParam(m, iter, &temp)) - return false; - r->type = static_cast<param_type::Type>(temp); - return ReadParam(m, iter, &r->enable); - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"("); - switch (p.type) { - case WebKit::WebMediaPlayerAction::Play: - l->append(L"Play"); - break; - case WebKit::WebMediaPlayerAction::Mute: - l->append(L"Mute"); - break; - case WebKit::WebMediaPlayerAction::Loop: - l->append(L"Loop"); - break; - default: - l->append(L"Unknown"); - break; - } - l->append(L", "); - LogParam(p.enable, l); - l->append(L")"); - } + 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 <> @@ -378,30 +291,9 @@ template <> template <> struct ParamTraits<WebKit::WebCompositionUnderline> { typedef WebKit::WebCompositionUnderline param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.startOffset); - WriteParam(m, p.endOffset); - WriteParam(m, p.color); - WriteParam(m, p.thick); - } - static bool Read(const Message* m, void** iter, param_type* p) { - return - ReadParam(m, iter, &p->startOffset) && - ReadParam(m, iter, &p->endOffset) && - ReadParam(m, iter, &p->color) && - ReadParam(m, iter, &p->thick); - } - static void Log(const param_type& p, std::wstring* l) { - l->append(L"("); - LogParam(p.startOffset, l); - l->append(L","); - LogParam(p.endOffset, l); - l->append(L":"); - LogParam(p.color, l); - l->append(L":"); - LogParam(p.thick, l); - l->append(L")"); - } + 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 <> diff --git a/chrome/common/worker_messages.cc b/chrome/common/worker_messages.cc new file mode 100644 index 0000000..437e030 --- /dev/null +++ b/chrome/common/worker_messages.cc @@ -0,0 +1,9 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/common/worker_messages.h" + +#define MESSAGES_INTERNAL_IMPL_FILE \ + "chrome/common/worker_messages_internal.h" +#include "ipc/ipc_message_impl_macros.h" diff --git a/chrome/plugin/plugin_thread.cc b/chrome/plugin/plugin_thread.cc index 1ae410e..1bd9903 100644 --- a/chrome/plugin/plugin_thread.cc +++ b/chrome/plugin/plugin_thread.cc @@ -27,6 +27,7 @@ #include "chrome/plugin/chrome_plugin_host.h" #include "chrome/plugin/npobject_util.h" #include "chrome/renderer/render_thread.h" +#include "ipc/ipc_channel_handle.h" #include "net/base/net_errors.h" #include "webkit/glue/plugins/plugin_lib.h" #include "webkit/glue/webkit_glue.h" diff --git a/chrome/renderer/blocked_plugin.cc b/chrome/renderer/blocked_plugin.cc index b2b9aee..6383612 100644 --- a/chrome/renderer/blocked_plugin.cc +++ b/chrome/renderer/blocked_plugin.cc @@ -8,6 +8,7 @@ #include "app/resource_bundle.h" #include "base/file_path.h" #include "base/string_piece.h" +#include "base/values.h" #include "chrome/common/jstemplate_builder.h" #include "chrome/common/notification_service.h" #include "chrome/common/plugin_group.h" diff --git a/chrome/renderer/indexed_db_dispatcher.cc b/chrome/renderer/indexed_db_dispatcher.cc index 83f7f49..1087eec 100644 --- a/chrome/renderer/indexed_db_dispatcher.cc +++ b/chrome/renderer/indexed_db_dispatcher.cc @@ -4,6 +4,7 @@ #include "chrome/renderer/indexed_db_dispatcher.h" +#include "chrome/common/indexed_db_key.h" #include "chrome/common/render_messages.h" #include "chrome/common/serialized_script_value.h" #include "chrome/renderer/render_thread.h" diff --git a/chrome/renderer/pepper_devices.cc b/chrome/renderer/pepper_devices.cc index e140727..8d0e403 100644 --- a/chrome/renderer/pepper_devices.cc +++ b/chrome/renderer/pepper_devices.cc @@ -6,9 +6,9 @@ #include "chrome/renderer/render_thread.h" #include "chrome/renderer/webplugin_delegate_pepper.h" #include "skia/ext/platform_canvas.h" +#include "third_party/skia/include/core/SkBitmap.h" #include "webkit/glue/plugins/plugin_instance.h" #include "webkit/glue/plugins/webplugin.h" -#include "third_party/skia/include/core/SkBitmap.h" namespace { diff --git a/chrome/renderer/render_thread.cc b/chrome/renderer/render_thread.cc index 3b72e6a..631e5b4 100644 --- a/chrome/renderer/render_thread.cc +++ b/chrome/renderer/render_thread.cc @@ -22,6 +22,7 @@ #include "base/thread_local.h" #include "base/trace_event.h" #include "base/utf_string_conversions.h" +#include "base/values.h" #include "chrome/common/appcache/appcache_dispatcher.h" #include "chrome/common/child_process_logging.h" #include "chrome/common/chrome_switches.h" diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index de74c88..22aef07 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -95,6 +95,7 @@ #include "third_party/WebKit/WebKit/chromium/public/WebDocument.h" #include "third_party/WebKit/WebKit/chromium/public/WebDragData.h" #include "third_party/WebKit/WebKit/chromium/public/WebFileChooserParams.h" +#include "third_party/WebKit/WebKit/chromium/public/WebFindOptions.h" #include "third_party/WebKit/WebKit/chromium/public/WebFormControlElement.h" #include "third_party/WebKit/WebKit/chromium/public/WebFormElement.h" #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" @@ -126,6 +127,7 @@ #include "third_party/WebKit/WebKit/chromium/public/WebView.h" #include "third_party/WebKit/WebKit/chromium/public/WebWindowFeatures.h" #include "webkit/appcache/web_application_cache_host_impl.h" +#include "webkit/glue/context_menu.h" #include "webkit/glue/dom_operations.h" #include "webkit/glue/form_data.h" #include "webkit/glue/form_field.h" @@ -144,6 +146,7 @@ #include "webkit/glue/plugins/webplugin_impl.h" #include "webkit/glue/plugins/webview_plugin.h" #include "webkit/glue/site_isolation_metrics.h" +#include "webkit/glue/webaccessibility.h" #include "webkit/glue/webdropdata.h" #include "webkit/glue/webkit_glue.h" #include "webkit/glue/webmediaplayer_impl.h" diff --git a/chrome/renderer/render_widget.cc b/chrome/renderer/render_widget.cc index 0ca11f1..e91efe1 100644 --- a/chrome/renderer/render_widget.cc +++ b/chrome/renderer/render_widget.cc @@ -7,6 +7,7 @@ #include "app/surface/transport_dib.h" #include "base/command_line.h" #include "base/logging.h" +#include "base/histogram.h" #include "base/message_loop.h" #include "base/scoped_ptr.h" #include "build/build_config.h" @@ -24,6 +25,7 @@ #include "third_party/WebKit/WebKit/chromium/public/WebRect.h" #include "third_party/WebKit/WebKit/chromium/public/WebScreenInfo.h" #include "third_party/WebKit/WebKit/chromium/public/WebSize.h" +#include "webkit/glue/plugins/webplugin.h" #include "webkit/glue/webkit_glue.h" #if defined(OS_POSIX) diff --git a/chrome/renderer/renderer_webcookiejar_impl.cc b/chrome/renderer/renderer_webcookiejar_impl.cc index 53a7794..711338b 100644 --- a/chrome/renderer/renderer_webcookiejar_impl.cc +++ b/chrome/renderer/renderer_webcookiejar_impl.cc @@ -7,6 +7,7 @@ #include "chrome/common/render_messages.h" #include "chrome/renderer/render_thread.h" #include "third_party/WebKit/WebKit/chromium/public/WebCookie.h" +#include "webkit/glue/webcookie.h" using WebKit::WebCookie; using WebKit::WebString; diff --git a/chrome/renderer/safe_browsing/phishing_dom_feature_extractor_unittest.cc b/chrome/renderer/safe_browsing/phishing_dom_feature_extractor_unittest.cc index a841963..c90af60 100644 --- a/chrome/renderer/safe_browsing/phishing_dom_feature_extractor_unittest.cc +++ b/chrome/renderer/safe_browsing/phishing_dom_feature_extractor_unittest.cc @@ -24,6 +24,7 @@ #include "chrome/renderer/safe_browsing/features.h" #include "googleurl/src/gurl.h" #include "ipc/ipc_channel.h" +#include "net/http/http_response_headers.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" diff --git a/chrome/renderer/webplugin_delegate_pepper.cc b/chrome/renderer/webplugin_delegate_pepper.cc index 645473d..a5053e4 100644 --- a/chrome/renderer/webplugin_delegate_pepper.cc +++ b/chrome/renderer/webplugin_delegate_pepper.cc @@ -15,6 +15,7 @@ #include "base/file_path.h" #include "base/file_util.h" +#include "base/histogram.h" #if defined(OS_MACOSX) #include "base/mac_util.h" #endif diff --git a/chrome/renderer/webplugin_delegate_pepper.h b/chrome/renderer/webplugin_delegate_pepper.h index 6f53f1c..f85d2a9d0 100644 --- a/chrome/renderer/webplugin_delegate_pepper.h +++ b/chrome/renderer/webplugin_delegate_pepper.h @@ -19,6 +19,7 @@ #include "gfx/native_widget_types.h" #include "gfx/rect.h" #include "third_party/npapi/bindings/npapi.h" +#include "third_party/skia/include/core/SkBitmap.h" #include "third_party/WebKit/WebKit/chromium/public/WebFileChooserCompletion.h" #include "webkit/glue/plugins/webplugin_delegate.h" diff --git a/chrome/renderer/webplugin_delegate_proxy.cc b/chrome/renderer/webplugin_delegate_proxy.cc index 04103a1..f1019cb 100644 --- a/chrome/renderer/webplugin_delegate_proxy.cc +++ b/chrome/renderer/webplugin_delegate_proxy.cc @@ -36,6 +36,7 @@ #include "gfx/size.h" #include "grit/generated_resources.h" #include "grit/renderer_resources.h" +#include "ipc/ipc_channel_handle.h" #include "net/base/mime_util.h" #include "printing/native_metafile.h" #include "skia/ext/platform_canvas.h" diff --git a/chrome/test/automation/automation_messages.cc b/chrome/test/automation/automation_messages.cc new file mode 100644 index 0000000..8c26327 --- /dev/null +++ b/chrome/test/automation/automation_messages.cc @@ -0,0 +1,9 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/test/automation/automation_messages.h" + +#define MESSAGES_INTERNAL_IMPL_FILE \ + "chrome/test/automation/automation_messages_internal.h" +#include "ipc/ipc_message_impl_macros.h" |