summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/automation/automation_provider.cc11
-rw-r--r--chrome/browser/browser_accessibility.cc3
-rw-r--r--chrome/browser/browser_accessibility.h6
-rw-r--r--chrome/browser/browser_accessibility_manager.cc3
-rw-r--r--chrome/browser/browser_accessibility_manager.h3
-rw-r--r--chrome/browser/printing/print_view_manager.cc21
-rw-r--r--chrome/browser/printing/print_view_manager.h6
-rw-r--r--chrome/browser/renderer_host/render_view_host.cc23
-rw-r--r--chrome/browser/renderer_host/render_view_host.h4
-rw-r--r--chrome/browser/renderer_host/render_view_host_delegate.h12
-rw-r--r--chrome/browser/renderer_host/render_widget_host.cc3
-rw-r--r--chrome/browser/renderer_host/render_widget_host.h6
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view.h6
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_win.cc2
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_win.h3
-rw-r--r--chrome/browser/renderer_host/resource_dispatcher_host_unittest.cc6
-rw-r--r--chrome/browser/renderer_host/test_render_view_host.h3
-rw-r--r--chrome/browser/resource_message_filter.cc3
-rw-r--r--chrome/browser/resource_message_filter.h1
-rw-r--r--chrome/browser/ssl/ssl_uitest.cc1
-rw-r--r--chrome/browser/tab_contents/interstitial_page.h1
-rw-r--r--chrome/browser/tab_contents/ipc_status_view.cc33
-rw-r--r--chrome/browser/tab_contents/web_contents.cc1
-rw-r--r--chrome/common/common.scons3
-rw-r--r--chrome/common/common.vcproj8
-rw-r--r--chrome/common/ipc_fuzzing_tests.cc7
-rw-r--r--chrome/common/ipc_logging.cc30
-rw-r--r--chrome/common/ipc_logging.h17
-rw-r--r--chrome/common/ipc_message_macros.h54
-rw-r--r--chrome/common/ipc_message_unittest.cc6
-rw-r--r--chrome/common/ipc_message_utils.cc29
-rw-r--r--chrome/common/ipc_message_utils.h447
-rw-r--r--chrome/common/ipc_sync_channel_unittest.cc7
-rw-r--r--chrome/common/ipc_sync_channel_unittest.h19
-rw-r--r--chrome/common/ipc_sync_message_unittest.cc8
-rw-r--r--chrome/common/ipc_sync_message_unittest.h11
-rw-r--r--chrome/common/plugin_messages.cc23
-rw-r--r--chrome/common/plugin_messages.h352
-rw-r--r--chrome/common/plugin_messages_internal.h10
-rw-r--r--chrome/common/render_messages.cc22
-rw-r--r--chrome/common/render_messages.h1296
-rw-r--r--chrome/common/render_messages_internal.h14
-rw-r--r--chrome/common/resource_dispatcher_unittest.cc6
-rw-r--r--chrome/common/security_filter_peer.h2
-rw-r--r--chrome/common/temp_scaffolding_stubs.h14
-rw-r--r--chrome/plugin/chrome_plugin_host.cc1
-rw-r--r--chrome/plugin/webplugin_delegate_stub.h4
-rw-r--r--chrome/renderer/render_view.cc7
-rw-r--r--chrome/renderer/render_widget.cc21
-rw-r--r--chrome/renderer/render_widget.h26
-rw-r--r--chrome/renderer/webplugin_delegate_proxy.cc1
-rw-r--r--chrome/renderer/webplugin_delegate_proxy.h3
-rw-r--r--chrome/test/automation/autocomplete_edit_proxy.h7
-rw-r--r--chrome/test/automation/automation_messages.h23
-rw-r--r--chrome/test/automation/automation_messages_internal.h8
-rw-r--r--chrome/test/automation/automation_proxy.cc3
-rw-r--r--chrome/test/automation/tab_proxy.cc729
-rw-r--r--chrome/test/unit/unit_tests.scons1
-rw-r--r--chrome/test/unit/unittests.vcproj4
-rw-r--r--webkit/glue/glue_accessibility.cc1
-rw-r--r--webkit/glue/glue_accessibility.h4
61 files changed, 1535 insertions, 1854 deletions
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc
index a613f78..f3154a4 100644
--- a/chrome/browser/automation/automation_provider.cc
+++ b/chrome/browser/automation/automation_provider.cc
@@ -1071,7 +1071,9 @@ void AutomationProvider::GetRedirectsFrom(const IPC::Message& message,
IPC::Message* msg = new IPC::Message(
message.routing_id(), AutomationMsg_RedirectsFromResponse::ID,
IPC::Message::PRIORITY_NORMAL);
- msg->WriteInt(-1); // Negative string count indicates an error.
+ msg->WriteBool(false);
+ std::vector<GURL> empty;
+ ParamTraits<std::vector<GURL>>::Write(msg, empty);
Send(msg);
}
@@ -1554,14 +1556,17 @@ void AutomationProvider::OnRedirectQueryComplete(
IPC::Message* msg = new IPC::Message(redirect_query_routing_id_,
AutomationMsg_RedirectsFromResponse::ID,
IPC::Message::PRIORITY_NORMAL);
+ std::vector<GURL> redirects_gurl;
if (success) {
- msg->WriteInt(static_cast<int>(redirects->size()));
+ msg->WriteBool(true);
for (size_t i = 0; i < redirects->size(); i++)
- IPC::ParamTraits<GURL>::Write(msg, redirects->at(i));
+ redirects_gurl.push_back(redirects->at(i));
} else {
msg->WriteInt(-1); // Negative count indicates failure.
}
+ ParamTraits<std::vector<GURL>>::Write(msg, redirects_gurl);
+
Send(msg);
redirect_query_ = NULL;
}
diff --git a/chrome/browser/browser_accessibility.cc b/chrome/browser/browser_accessibility.cc
index fea5bf2..8dc85b4 100644
--- a/chrome/browser/browser_accessibility.cc
+++ b/chrome/browser/browser_accessibility.cc
@@ -6,6 +6,7 @@
#include "chrome/browser/browser_accessibility_manager.h"
#include "chrome/browser/iaccessible_function_ids.h"
+#include "chrome/common/render_messages.h"
BrowserAccessibility::BrowserAccessibility()
: iaccessible_id_(-1),
@@ -546,7 +547,7 @@ bool BrowserAccessibility::RequestAccessibilityInfo(int iaccessible_func_id,
input2);
}
-ViewHostMsg_Accessibility_Out_Params BrowserAccessibility::response() {
+const ViewHostMsg_Accessibility_Out_Params& BrowserAccessibility::response() {
return BrowserAccessibilityManager::GetInstance()->response();
}
diff --git a/chrome/browser/browser_accessibility.h b/chrome/browser/browser_accessibility.h
index 5032183..5f2b40d 100644
--- a/chrome/browser/browser_accessibility.h
+++ b/chrome/browser/browser_accessibility.h
@@ -10,7 +10,9 @@
#include <oleacc.h>
-#include "chrome/common/render_messages.h"
+#include "base/basictypes.h"
+
+struct ViewHostMsg_Accessibility_Out_Params;
////////////////////////////////////////////////////////////////////////////////
//
@@ -144,7 +146,7 @@ class ATL_NO_VTABLE BrowserAccessibility
LONG input1, LONG input2);
// Accessors.
- ViewHostMsg_Accessibility_Out_Params response();
+ const ViewHostMsg_Accessibility_Out_Params& response();
HWND parent_hwnd();
// Id to uniquely distinguish this instance in the render-side caching,
diff --git a/chrome/browser/browser_accessibility_manager.cc b/chrome/browser/browser_accessibility_manager.cc
index b71ecda..69255be 100644
--- a/chrome/browser/browser_accessibility_manager.cc
+++ b/chrome/browser/browser_accessibility_manager.cc
@@ -116,7 +116,8 @@ bool BrowserAccessibilityManager::RequestAccessibilityInfo(
return success;
}
-ViewHostMsg_Accessibility_Out_Params BrowserAccessibilityManager::response() {
+const ViewHostMsg_Accessibility_Out_Params&
+BrowserAccessibilityManager::response() {
return out_params_;
}
diff --git a/chrome/browser/browser_accessibility_manager.h b/chrome/browser/browser_accessibility_manager.h
index c9c5ad5..dcda60c 100644
--- a/chrome/browser/browser_accessibility_manager.h
+++ b/chrome/browser/browser_accessibility_manager.h
@@ -15,6 +15,7 @@
class BrowserAccessibility;
class RenderProcessHost;
class RenderWidgetHost;
+struct ViewHostMsg_Accessibility_Out_Params;
////////////////////////////////////////////////////////////////////////////////
//
@@ -52,7 +53,7 @@ class BrowserAccessibilityManager : public NotificationObserver {
LONG input2);
// Wrapper function, for cleaner code.
- ViewHostMsg_Accessibility_Out_Params response();
+ const ViewHostMsg_Accessibility_Out_Params& response();
// Retrieves the parent HWND connected to the provided id.
HWND parent_hwnd(int id);
diff --git a/chrome/browser/printing/print_view_manager.cc b/chrome/browser/printing/print_view_manager.cc
index bdc9da3..4e017e8 100644
--- a/chrome/browser/printing/print_view_manager.cc
+++ b/chrome/browser/printing/print_view_manager.cc
@@ -27,7 +27,6 @@ PrintViewManager::PrintViewManager(WebContents& owner)
waiting_to_print_(false),
inside_inner_message_loop_(false),
waiting_to_show_print_dialog_(false) {
- memset(&print_params_, 0, sizeof(print_params_));
}
PrintViewManager::~PrintViewManager() {
@@ -240,25 +239,6 @@ void PrintViewManager::OnNotifyPrintJobEvent(
void PrintViewManager::OnNotifyPrintJobInitEvent(
const JobEventDetails& event_details) {
- ViewMsg_Print_Params old_print_params(print_params_);
-
- // Backup the print settings relevant to the renderer.
- DCHECK_EQ(print_job_->document(), event_details.document());
- event_details.document()->settings().RenderParams(&print_params_);
- print_params_.document_cookie = event_details.document()->cookie();
- DCHECK_GT(print_params_.document_cookie, 0);
-
- // If settings changed
- DCHECK(owner_.render_view_host());
- // Equals() doesn't compare the cookie value.
- if (owner_.render_view_host() &&
- owner_.render_view_host()->IsRenderViewLive() &&
- (!old_print_params.Equals(print_params_) ||
- !event_details.document()->page_count())) {
- // TODO(maruel): Will never happen, this code is about to be deleted.
- NOTREACHED();
- }
-
// Continue even if owner_.render_view_host() is dead because we may already
// have buffered all the necessary pages.
switch (event_details.type()) {
@@ -460,7 +440,6 @@ void PrintViewManager::ReleasePrintJob() {
print_job_->DisconnectSource();
// Don't close the worker thread.
print_job_ = NULL;
- memset(&print_params_, 0, sizeof(print_params_));
}
void PrintViewManager::PrintNowInternal() {
diff --git a/chrome/browser/printing/print_view_manager.h b/chrome/browser/printing/print_view_manager.h
index 405b180..3cd0272 100644
--- a/chrome/browser/printing/print_view_manager.h
+++ b/chrome/browser/printing/print_view_manager.h
@@ -5,12 +5,13 @@
#ifndef CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_H_
#define CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_H_
+#include "base/ref_counted.h"
#include "chrome/browser/printing/printed_pages_source.h"
#include "chrome/common/notification_observer.h"
-#include "chrome/common/render_messages.h"
class RenderViewHost;
class WebContents;
+struct ViewHostMsg_DidPrintPage_Params;
namespace printing {
@@ -118,9 +119,6 @@ class PrintViewManager : public NotificationObserver,
// print_job_ is initialized.
bool OpportunisticallyCreatePrintJob(int cookie);
- // Cache the last print settings requested to the renderer.
- ViewMsg_Print_Params print_params_;
-
// Manages the low-level talk to the printer.
scoped_refptr<PrintJob> print_job_;
diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc
index b6629e9..1bd7c7f 100644
--- a/chrome/browser/renderer_host/render_view_host.cc
+++ b/chrome/browser/renderer_host/render_view_host.cc
@@ -664,7 +664,7 @@ void RenderViewHost::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateTitle, OnMsgUpdateTitle)
IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateEncoding, OnMsgUpdateEncoding)
IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateTargetURL, OnMsgUpdateTargetURL)
- IPC_MESSAGE_HANDLER_GENERIC(ViewHostMsg_Thumbnail, OnMsgThumbnail(msg))
+ IPC_MESSAGE_HANDLER(ViewHostMsg_Thumbnail, OnMsgThumbnail)
IPC_MESSAGE_HANDLER(ViewHostMsg_Close, OnMsgClose)
IPC_MESSAGE_HANDLER(ViewHostMsg_RequestMove, OnMsgRequestMove)
IPC_MESSAGE_HANDLER(ViewHostMsg_DidStartLoading, OnMsgDidStartLoading)
@@ -834,7 +834,7 @@ void RenderViewHost::OnMsgNavigate(const IPC::Message& msg) {
// copy when we filter the URLs.
void* iter = NULL;
ViewHostMsg_FrameNavigate_Params validated_params;
- if (!IPC::ParamTraits<ViewHostMsg_FrameNavigate_Params>::
+ if (!ParamTraits<ViewHostMsg_FrameNavigate_Params>::
Read(&msg, &iter, &validated_params))
return;
@@ -885,22 +885,9 @@ void RenderViewHost::OnMsgUpdateTargetURL(int32 page_id,
Send(new ViewMsg_UpdateTargetURL_ACK(routing_id()));
}
-void RenderViewHost::OnMsgThumbnail(const IPC::Message& msg) {
- // crack the message
- void* iter = NULL;
- GURL url;
- if (!IPC::ParamTraits<GURL>::Read(&msg, &iter, &url))
- return;
-
- ThumbnailScore score;
- if (!IPC::ParamTraits<ThumbnailScore>::Read(&msg, &iter, &score))
- return;
-
- // thumbnail data
- SkBitmap bitmap;
- if (!IPC::ParamTraits<SkBitmap>::Read(&msg, &iter, &bitmap))
- return;
-
+void RenderViewHost::OnMsgThumbnail(const GURL& url,
+ const ThumbnailScore& score,
+ const SkBitmap& bitmap) {
delegate_->UpdateThumbnail(url, bitmap, score);
}
diff --git a/chrome/browser/renderer_host/render_view_host.h b/chrome/browser/renderer_host/render_view_host.h
index 19bb424..49d1949 100644
--- a/chrome/browser/renderer_host/render_view_host.h
+++ b/chrome/browser/renderer_host/render_view_host.h
@@ -436,7 +436,9 @@ class RenderViewHost : public RenderWidgetHost {
void OnMsgUpdateTitle(int32 page_id, const std::wstring& title);
void OnMsgUpdateEncoding(const std::wstring& encoding);
void OnMsgUpdateTargetURL(int32 page_id, const GURL& url);
- void OnMsgThumbnail(const IPC::Message& msg);
+ void OnMsgThumbnail(const GURL& url,
+ const ThumbnailScore& score,
+ const SkBitmap& bitmap);
void OnMsgClose();
void OnMsgRequestMove(const gfx::Rect& pos);
void OnMsgDidRedirectProvisionalLoad(int32 page_id,
diff --git a/chrome/browser/renderer_host/render_view_host_delegate.h b/chrome/browser/renderer_host/render_view_host_delegate.h
index 5a39b91..709fde5 100644
--- a/chrome/browser/renderer_host/render_view_host_delegate.h
+++ b/chrome/browser/renderer_host/render_view_host_delegate.h
@@ -10,9 +10,9 @@
#include "base/basictypes.h"
#include "chrome/browser/autofill_manager.h"
-#include "chrome/common/render_messages.h"
#include "net/base/load_states.h"
#include "webkit/glue/webpreferences.h"
+#include "webkit/glue/window_open_disposition.h"
class NavigationEntry;
class Profile;
@@ -20,8 +20,12 @@ class RenderProcessHost;
class RenderViewHost;
class SkBitmap;
class WebContents;
+class WebKeyboardEvent;
+struct ThumbnailScore;
+struct ViewHostMsg_ContextMenu_Params;
+struct ViewHostMsg_DidPrintPage_Params;
+struct ViewHostMsg_FrameNavigate_Params;
struct WebDropData;
-enum WindowOpenDisposition;
namespace base {
class WaitableEvent;
@@ -35,6 +39,10 @@ namespace gfx {
class Rect;
}
+namespace webkit_glue {
+struct WebApplicationInfo;
+}
+
//
// RenderViewHostDelegate
//
diff --git a/chrome/browser/renderer_host/render_widget_host.cc b/chrome/browser/renderer_host/render_widget_host.cc
index 50a6ef3..a6d289b 100644
--- a/chrome/browser/renderer_host/render_widget_host.cc
+++ b/chrome/browser/renderer_host/render_widget_host.cc
@@ -11,6 +11,7 @@
#include "chrome/browser/renderer_host/render_widget_helper.h"
#include "chrome/browser/renderer_host/render_widget_host_view.h"
#include "chrome/common/notification_service.h"
+#include "chrome/common/render_messages.h"
#include "chrome/views/view.h"
#include "webkit/glue/webcursor.h"
#include "webkit/glue/webinputevent.h"
@@ -549,7 +550,7 @@ void RenderWidgetHost::OnMsgSetCursor(const WebCursor& cursor) {
view_->UpdateCursor(cursor);
}
-void RenderWidgetHost::OnMsgImeUpdateStatus(ViewHostMsg_ImeControl control,
+void RenderWidgetHost::OnMsgImeUpdateStatus(int control,
const gfx::Rect& caret_rect) {
if (view_) {
view_->IMEUpdateStatus(control, caret_rect);
diff --git a/chrome/browser/renderer_host/render_widget_host.h b/chrome/browser/renderer_host/render_widget_host.h
index 08f20f0..06b9fb0 100644
--- a/chrome/browser/renderer_host/render_widget_host.h
+++ b/chrome/browser/renderer_host/render_widget_host.h
@@ -11,7 +11,6 @@
#include "base/timer.h"
#include "chrome/common/bitmap_wire_data.h"
#include "chrome/common/ipc_channel.h"
-#include "chrome/common/render_messages.h"
#include "testing/gtest/include/gtest/gtest_prod.h"
namespace gfx {
@@ -255,8 +254,9 @@ class RenderWidgetHost : public IPC::Channel::Listener {
void OnMsgFocus();
void OnMsgBlur();
void OnMsgSetCursor(const WebCursor& cursor);
- void OnMsgImeUpdateStatus(ViewHostMsg_ImeControl control,
- const gfx::Rect& caret_rect);
+ // Using int instead of ViewHostMsg_ImeControl for control's type to avoid
+ // having to bring in render_messages.h in a header file.
+ void OnMsgImeUpdateStatus(int control, const gfx::Rect& caret_rect);
// Paints the given bitmap to the current backing store at the given location.
void PaintBackingStoreRect(BitmapWireData bitmap,
diff --git a/chrome/browser/renderer_host/render_widget_host_view.h b/chrome/browser/renderer_host/render_widget_host_view.h
index 76316b4..b2edf58 100644
--- a/chrome/browser/renderer_host/render_widget_host_view.h
+++ b/chrome/browser/renderer_host/render_widget_host_view.h
@@ -7,7 +7,7 @@
#include "base/gfx/native_widget_types.h"
#include "base/shared_memory.h"
-#include "chrome/common/render_messages.h"
+#include "webkit/glue/webplugin.h"
namespace gfx {
class Rect;
@@ -20,7 +20,6 @@ class Message;
class RenderProcessHost;
class RenderWidgetHost;
class WebCursor;
-
// RenderWidgetHostView is an interface implemented by an object that acts as
// the "View" portion of a RenderWidgetHost. The RenderWidgetHost and its
// associated RenderProcessHost own the "Model" in this case which is the
@@ -85,8 +84,7 @@ class RenderWidgetHostView {
virtual void SetIsLoading(bool is_loading) = 0;
// Enable or disable IME for the view.
- virtual void IMEUpdateStatus(ViewHostMsg_ImeControl control,
- const gfx::Rect& caret_rect) = 0;
+ virtual void IMEUpdateStatus(int control, const gfx::Rect& caret_rect) = 0;
// Informs the view that a portion of the widget's backing store was painted.
// The view should copy the given rect from the backing store of the render
diff --git a/chrome/browser/renderer_host/render_widget_host_view_win.cc b/chrome/browser/renderer_host/render_widget_host_view_win.cc
index 2c19e7e..1d86045 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_win.cc
+++ b/chrome/browser/renderer_host/render_widget_host_view_win.cc
@@ -271,7 +271,7 @@ void RenderWidgetHostViewWin::SetIsLoading(bool is_loading) {
UpdateCursorIfOverSelf();
}
-void RenderWidgetHostViewWin::IMEUpdateStatus(ViewHostMsg_ImeControl control,
+void RenderWidgetHostViewWin::IMEUpdateStatus(int control,
const gfx::Rect& caret_rect) {
if (control == IME_DISABLE) {
ime_input_.DisableIME(m_hWnd);
diff --git a/chrome/browser/renderer_host/render_widget_host_view_win.h b/chrome/browser/renderer_host/render_widget_host_view_win.h
index 0c8e6c3..c4d08d3 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_win.h
+++ b/chrome/browser/renderer_host/render_widget_host_view_win.h
@@ -136,8 +136,7 @@ class RenderWidgetHostViewWin :
virtual void UpdateCursor(const WebCursor& cursor);
virtual void UpdateCursorIfOverSelf();
virtual void SetIsLoading(bool is_loading);
- virtual void IMEUpdateStatus(ViewHostMsg_ImeControl control,
- const gfx::Rect& caret_rect);
+ virtual void IMEUpdateStatus(int control, const gfx::Rect& caret_rect);
virtual void DidPaintRect(const gfx::Rect& rect);
virtual void DidScrollRect(const gfx::Rect& rect, int dx, int dy);
virtual void RendererGone();
diff --git a/chrome/browser/renderer_host/resource_dispatcher_host_unittest.cc b/chrome/browser/renderer_host/resource_dispatcher_host_unittest.cc
index ae8ae7d..f09a5af 100644
--- a/chrome/browser/renderer_host/resource_dispatcher_host_unittest.cc
+++ b/chrome/browser/renderer_host/resource_dispatcher_host_unittest.cc
@@ -173,11 +173,11 @@ void CheckSuccessfulRequest(const std::vector<IPC::Message>& messages,
void* iter = NULL;
int request_id;
- ASSERT_TRUE(IPC::ReadParam(&messages[1], &iter, &request_id));
+ ASSERT_TRUE(ReadParam(&messages[1], &iter, &request_id));
base::SharedMemoryHandle shm_handle;
- ASSERT_TRUE(IPC::ReadParam(&messages[1], &iter, &shm_handle));
+ ASSERT_TRUE(ReadParam(&messages[1], &iter, &shm_handle));
int data_len;
- ASSERT_TRUE(IPC::ReadParam(&messages[1], &iter, &data_len));
+ ASSERT_TRUE(ReadParam(&messages[1], &iter, &data_len));
ASSERT_EQ(reference_data.size(), data_len);
base::SharedMemory shared_mem(shm_handle, true); // read only
diff --git a/chrome/browser/renderer_host/test_render_view_host.h b/chrome/browser/renderer_host/test_render_view_host.h
index 8618ea9..b74a56f 100644
--- a/chrome/browser/renderer_host/test_render_view_host.h
+++ b/chrome/browser/renderer_host/test_render_view_host.h
@@ -54,8 +54,7 @@ class TestRenderWidgetHostView : public RenderWidgetHostView {
virtual void SetIsLoading(bool is_loading) {}
virtual void UpdateCursor(const WebCursor& cursor) {}
virtual void UpdateCursorIfOverSelf() {}
- virtual void IMEUpdateStatus(ViewHostMsg_ImeControl control,
- const gfx::Rect& caret_rect) {}
+ virtual void IMEUpdateStatus(int control, const gfx::Rect& caret_rect) {}
virtual void DidPaintRect(const gfx::Rect& rect) {}
virtual void DidScrollRect(const gfx::Rect& rect, int dx, int dy) {}
virtual void RendererGone() {}
diff --git a/chrome/browser/resource_message_filter.cc b/chrome/browser/resource_message_filter.cc
index 02e6230..89c2bf8 100644
--- a/chrome/browser/resource_message_filter.cc
+++ b/chrome/browser/resource_message_filter.cc
@@ -24,7 +24,6 @@
#include "chrome/common/notification_service.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/pref_service.h"
-#include "chrome/common/ipc_message_macros.h"
#include "chrome/common/render_messages.h"
#include "net/base/cookie_monster.h"
#include "net/base/mime_util.h"
@@ -233,7 +232,7 @@ bool ResourceMessageFilter::OnMessageReceived(const IPC::Message& message) {
void ResourceMessageFilter::OnReceiveContextMenuMsg(const IPC::Message& msg) {
void* iter = NULL;
ViewHostMsg_ContextMenu_Params params;
- if (!IPC::ParamTraits<ViewHostMsg_ContextMenu_Params>::
+ if (!ParamTraits<ViewHostMsg_ContextMenu_Params>::
Read(&msg, &iter, &params))
return;
diff --git a/chrome/browser/resource_message_filter.h b/chrome/browser/resource_message_filter.h
index 43034b6..af9d604 100644
--- a/chrome/browser/resource_message_filter.h
+++ b/chrome/browser/resource_message_filter.h
@@ -28,6 +28,7 @@ class ClipboardService;
class Profile;
class RenderWidgetHelper;
class SpellChecker;
+struct ViewHostMsg_Resource_Request;
struct WebPluginInfo;
namespace printing {
diff --git a/chrome/browser/ssl/ssl_uitest.cc b/chrome/browser/ssl/ssl_uitest.cc
index 1819010..f31d8f2 100644
--- a/chrome/browser/ssl/ssl_uitest.cc
+++ b/chrome/browser/ssl/ssl_uitest.cc
@@ -7,6 +7,7 @@
#include <string>
+#include "chrome/common/filter_policy.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/automation/browser_proxy.h"
#include "chrome/test/automation/tab_proxy.h"
diff --git a/chrome/browser/tab_contents/interstitial_page.h b/chrome/browser/tab_contents/interstitial_page.h
index eb18b60..5d39546 100644
--- a/chrome/browser/tab_contents/interstitial_page.h
+++ b/chrome/browser/tab_contents/interstitial_page.h
@@ -7,6 +7,7 @@
#include <string>
+#include "base/gfx/size.h"
#include "chrome/browser/renderer_host/render_view_host_delegate.h"
#include "chrome/common/notification_registrar.h"
#include "googleurl/src/gurl.h"
diff --git a/chrome/browser/tab_contents/ipc_status_view.cc b/chrome/browser/tab_contents/ipc_status_view.cc
index cd85ee0..a317aac 100644
--- a/chrome/browser/tab_contents/ipc_status_view.cc
+++ b/chrome/browser/tab_contents/ipc_status_view.cc
@@ -2,6 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// Need to include this before any other file because it defines
+// IPC_MESSAGE_LOG_ENABLED.
+#include "chrome/common/ipc_message.h"
+
+#ifdef IPC_MESSAGE_LOG_ENABLED
+#define IPC_MESSAGE_MACROS_LOG_ENABLED
+
#include "chrome/browser/tab_contents/ipc_status_view.h"
#include <stdio.h>
@@ -17,8 +24,6 @@
#include "chrome/common/pref_service.h"
#include "chrome/common/render_messages.h"
-#ifdef IPC_MESSAGE_LOG_ENABLED
-
using base::Time;
namespace {
@@ -39,19 +44,6 @@ enum {
kParamsColumn,
};
-// This class ensures that we have a link dependency on render_messages.cc and
-// plugin_messages.cc, and at the same time sets up the message logger function
-// mappings.
-class RegisterLoggerFuncs {
- public:
- RegisterLoggerFuncs() {
- RenderMessagesInit();
- PluginMessagesInit();
- }
-};
-
-RegisterLoggerFuncs g_register_logger_funcs;
-
} // namespace
IPCStatusView* IPCStatusView::current_;
@@ -70,7 +62,16 @@ IPCStatusView::IPCStatusView()
plugin_process_ = NULL;
plugin_process_host_ = NULL;
- IPC::Logging::current()->SetConsumer(this);
+ IPC::Logging* log = IPC::Logging::current();
+ log->RegisterMessageLogger(ViewStart, ViewMsgLog);
+ log->RegisterMessageLogger(ViewHostStart, ViewHostMsgLog);
+ log->RegisterMessageLogger(PluginProcessStart, PluginProcessMsgLog);
+ log->RegisterMessageLogger(PluginProcessHostStart, PluginProcessHostMsgLog);
+ log->RegisterMessageLogger(PluginStart, PluginMsgLog);
+ log->RegisterMessageLogger(PluginHostStart, PluginHostMsgLog);
+ log->RegisterMessageLogger(NPObjectStart, NPObjectMsgLog);
+
+ log->SetConsumer(this);
}
IPCStatusView::~IPCStatusView() {
diff --git a/chrome/browser/tab_contents/web_contents.cc b/chrome/browser/tab_contents/web_contents.cc
index 849ba2a..f6a8666 100644
--- a/chrome/browser/tab_contents/web_contents.cc
+++ b/chrome/browser/tab_contents/web_contents.cc
@@ -24,6 +24,7 @@
#include "chrome/common/notification_service.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/pref_service.h"
+#include "chrome/common/render_messages.h"
#include "net/base/mime_util.h"
#include "net/base/net_errors.h"
#include "net/base/registry_controlled_domain.h"
diff --git a/chrome/common/common.scons b/chrome/common/common.scons
index ae4c0bf..7e5cc14 100644
--- a/chrome/common/common.scons
+++ b/chrome/common/common.scons
@@ -94,10 +94,8 @@ input_files = ChromeFileList([
'ipc_sync_channel.h',
'ipc_sync_message.cc',
'ipc_sync_message.h',
- 'plugin_messages.cc',
'plugin_messages.h',
'plugin_messages_internal.h',
- 'render_messages.cc',
'render_messages.h',
'render_messages_internal.h',
]),
@@ -229,7 +227,6 @@ if not env.Bit('windows'):
'gfx/path.cc',
'ipc_logging.cc',
'os_exchange_data.cc',
- 'plugin_messages.cc',
'process_watcher.cc',
)
diff --git a/chrome/common/common.vcproj b/chrome/common/common.vcproj
index c0f6af6..c3986d2b 100644
--- a/chrome/common/common.vcproj
+++ b/chrome/common/common.vcproj
@@ -285,10 +285,6 @@
>
</File>
<File
- RelativePath=".\plugin_messages.cc"
- >
- </File>
- <File
RelativePath=".\plugin_messages.h"
>
</File>
@@ -297,10 +293,6 @@
>
</File>
<File
- RelativePath=".\render_messages.cc"
- >
- </File>
- <File
RelativePath=".\render_messages.h"
>
</File>
diff --git a/chrome/common/ipc_fuzzing_tests.cc b/chrome/common/ipc_fuzzing_tests.cc
index cbd2bd3..6e67844 100644
--- a/chrome/common/ipc_fuzzing_tests.cc
+++ b/chrome/common/ipc_fuzzing_tests.cc
@@ -96,10 +96,9 @@ TEST(IPCMessageIntegrity, ReadVectorTooLarge2) {
EXPECT_FALSE(ReadParam(&m, &iter, &vec));
}
-// Typically the ipc_message_macros files is included twice but here we only
-// include it once in 'enum mode' because we want more control of the class
-// definitions.
-#define IPC_MESSAGE_MACROS_ENUMS
+// We don't actually use the messages defined in this fiel, but we do this
+// to get to the IPC macros.
+#define MESSAGES_INTERNAL_FILE "chrome/common/ipc_sync_message_unittest.h"
#include "chrome/common/ipc_message_macros.h"
enum IPCMessageIds {
diff --git a/chrome/common/ipc_logging.cc b/chrome/common/ipc_logging.cc
index ec2fe82..2946093 100644
--- a/chrome/common/ipc_logging.cc
+++ b/chrome/common/ipc_logging.cc
@@ -41,6 +41,8 @@ Logging::Logging()
consumer_(NULL),
queue_invoke_later_pending_(false),
main_thread_(MessageLoop::current()) {
+ memset(log_function_mapping_, sizeof(log_function_mapping_), 0);
+
// Create an event for this browser instance that's set when logging is
// enabled, so child processes can know when logging is enabled.
int browser_pid;
@@ -88,8 +90,18 @@ void Logging::OnObjectSignaled(HANDLE object) {
RegisterWaitForEvent(!enabled_);
}
+void Logging::RegisterMessageLogger(int msg_start, LogFunction* func) {
+ int msg_class = msg_start >> 12;
+ if (msg_class > arraysize(log_function_mapping_)) {
+ NOTREACHED();
+ return;
+ }
+
+ log_function_mapping_[msg_class] = func;
+}
+
std::wstring Logging::GetEventName(bool enabled) {
- return Logging::current()->GetEventName(GetCurrentProcessId(), enabled);
+ return current()->GetEventName(GetCurrentProcessId(), enabled);
}
std::wstring Logging::GetEventName(int browser_pid, bool enabled) {
@@ -188,24 +200,12 @@ void Logging::OnPostDispatchMessage(const Message& message,
}
}
-// static
-LogFunction* g_log_function_mapping[16];
-void RegisterMessageLogger(int msg_start, LogFunction* func) {
- int msg_class = msg_start >> 12;
- if (msg_class > arraysize(g_log_function_mapping)) {
- NOTREACHED();
- return;
- }
-
- g_log_function_mapping[msg_class] = func;
-}
-
void Logging::GetMessageText(uint16 type, std::wstring* name,
const Message* message,
std::wstring* params) {
int message_class = type >> 12;
- if (g_log_function_mapping[message_class] != NULL) {
- g_log_function_mapping[message_class](type, name, message, params);
+ if (current()->log_function_mapping_[message_class] != NULL) {
+ current()->log_function_mapping_[message_class](type, name, message, params);
} else {
DLOG(INFO) << "No logger function associated with message class " <<
message_class;
diff --git a/chrome/common/ipc_logging.h b/chrome/common/ipc_logging.h
index 567ba84..bf49595 100644
--- a/chrome/common/ipc_logging.h
+++ b/chrome/common/ipc_logging.h
@@ -12,6 +12,7 @@
#include "base/lock.h"
#include "base/object_watcher.h"
#include "base/singleton.h"
+#include "chrome/common/ipc_message_utils.h"
class MessageLoop;
@@ -27,7 +28,7 @@ class Logging : public base::ObjectWatcher::Delegate {
// Implemented by consumers of log messages.
class Consumer {
public:
- virtual void Log(const IPC::LogData& data) = 0;
+ virtual void Log(const LogData& data) = 0;
};
void SetConsumer(Consumer* consumer);
@@ -41,7 +42,7 @@ class Logging : public base::ObjectWatcher::Delegate {
// Called by child processes to give the logger object the channel to send
// logging data to the browser process.
- void SetIPCSender(IPC::Message::Sender* sender);
+ void SetIPCSender(Message::Sender* sender);
// Called in the browser process when logging data from a child process is
// received.
@@ -66,8 +67,14 @@ class Logging : public base::ObjectWatcher::Delegate {
// ObjectWatcher::Delegate implementation
void OnObjectSignaled(HANDLE object);
+ typedef void (LogFunction)(uint16 type,
+ std::wstring* name,
+ const Message* msg,
+ std::wstring* params);
+ void RegisterMessageLogger(int msg_start, LogFunction* func);
+
private:
- friend struct DefaultSingletonTraits<IPC::Logging>;
+ friend struct DefaultSingletonTraits<Logging>;
Logging();
std::wstring GetEventName(int browser_pid, bool enabled);
@@ -85,10 +92,12 @@ class Logging : public base::ObjectWatcher::Delegate {
std::vector<LogData> queued_logs_;
bool queue_invoke_later_pending_;
- IPC::Message::Sender* sender_;
+ Message::Sender* sender_;
MessageLoop* main_thread_;
Consumer* consumer_;
+
+ LogFunction* log_function_mapping_[LastMsgIndex];
};
} // namespace IPC
diff --git a/chrome/common/ipc_message_macros.h b/chrome/common/ipc_message_macros.h
index e724e2e..49c15b5 100644
--- a/chrome/common/ipc_message_macros.h
+++ b/chrome/common/ipc_message_macros.h
@@ -41,6 +41,33 @@
#include "chrome/common/ipc_message_utils.h"
+
+#ifndef MESSAGES_INTERNAL_FILE
+#error This file should only be included by X_messages.h, which needs to define MESSAGES_INTERNAL_FILE first.
+#endif
+
+#ifndef IPC_MESSAGE_MACROS_INCLUDE_BLOCK
+#define IPC_MESSAGE_MACROS_INCLUDE_BLOCK
+
+// Multi-pass include of X_messages_internal.h. Preprocessor magic allows
+// us to use 1 header to define the enums and classes for our render messages.
+#define IPC_MESSAGE_MACROS_ENUMS
+#include MESSAGES_INTERNAL_FILE
+
+#define IPC_MESSAGE_MACROS_CLASSES
+#include MESSAGES_INTERNAL_FILE
+
+#ifdef IPC_MESSAGE_MACROS_LOG_ENABLED
+#define IPC_MESSAGE_MACROS_LOG
+#include MESSAGES_INTERNAL_FILE
+#endif
+
+#undef MESSAGES_INTERNAL_FILE
+#undef IPC_MESSAGE_MACROS_INCLUDE_BLOCK
+
+#endif
+
+
// Undefine the macros from the previous pass (if any).
#undef IPC_BEGIN_MESSAGES
#undef IPC_END_MESSAGES
@@ -57,7 +84,6 @@
#undef IPC_MESSAGE_ROUTED4
#undef IPC_MESSAGE_ROUTED5
#undef IPC_MESSAGE_ROUTED6
-#undef IPC_MESSAGE_EMPTY
#undef IPC_SYNC_MESSAGE_CONTROL0_0
#undef IPC_SYNC_MESSAGE_CONTROL0_1
#undef IPC_SYNC_MESSAGE_CONTROL0_2
@@ -94,6 +120,7 @@
#undef IPC_SYNC_MESSAGE_ROUTED4_0
#undef IPC_SYNC_MESSAGE_ROUTED4_1
+
#if defined(IPC_MESSAGE_MACROS_ENUMS)
#undef IPC_MESSAGE_MACROS_ENUMS
@@ -102,10 +129,11 @@
// 16 channel types (currently using 8) and 4K messages per type. Should
// really make type be 32 bits, but then we break automation with older Chrome
// builds..
-#define IPC_BEGIN_MESSAGES(label, start) \
+
+#define IPC_BEGIN_MESSAGES(label) \
enum label##MsgType { \
- label##Start = start << 12, \
- label##PreStart = (start << 12) - 1, // Do this so that automation messages keep the same id as before
+ label##Start = label##MsgStart << 12, \
+ label##PreStart = (label##MsgStart << 12) - 1, // Do this so that automation messages keep the same id as before
#define IPC_END_MESSAGES(label) \
label##End \
@@ -150,9 +178,6 @@
#define IPC_MESSAGE_ROUTED6(msg_class, type1, type2, type3, type4, type5, type6) \
msg_class##__ID,
-#define IPC_MESSAGE_EMPTY(msg_class) \
- msg_class##__ID,
-
#define IPC_SYNC_MESSAGE_CONTROL0_0(msg_class) \
msg_class##__ID,
@@ -341,7 +366,7 @@ void class_name::OnMessageReceived(const IPC::Message& msg) \
#elif defined(IPC_MESSAGE_MACROS_LOG)
#undef IPC_MESSAGE_MACROS_LOG
-#define IPC_BEGIN_MESSAGES(label, start) \
+#define IPC_BEGIN_MESSAGES(label) \
void label##MsgLog(uint16 type, std::wstring* name, const IPC::Message* msg, std::wstring* params) { \
switch (type) {
@@ -399,9 +424,6 @@ void class_name::OnMessageReceived(const IPC::Message& msg) \
#define IPC_MESSAGE_ROUTED6(msg_class, type1, type2, type3, type4, type5, type6) \
IPC_MESSAGE_LOG(msg_class)
-#define IPC_MESSAGE_EMPTY(msg_class) \
- IPC_MESSAGE_LOG(msg_class)
-
#define IPC_SYNC_MESSAGE_CONTROL0_0(msg_class) \
IPC_MESSAGE_LOG(msg_class)
@@ -510,7 +532,7 @@ void class_name::OnMessageReceived(const IPC::Message& msg) \
#elif defined(IPC_MESSAGE_MACROS_CLASSES)
#undef IPC_MESSAGE_MACROS_CLASSES
-#define IPC_BEGIN_MESSAGES(label, start)
+#define IPC_BEGIN_MESSAGES(label)
#define IPC_END_MESSAGES(label)
#define IPC_MESSAGE_CONTROL0(msg_class) \
@@ -655,14 +677,6 @@ void class_name::OnMessageReceived(const IPC::Message& msg) \
routing_id, ID, MakeTuple(arg1, arg2, arg3, arg4, arg5, arg6)) {} \
};
-// Dummy class for now, just to give us the ID field.
-#define IPC_MESSAGE_EMPTY(msg_class) \
- class msg_class { \
- public: \
- enum { ID = msg_class##__ID }; \
- static void Log(const IPC::Message* msg, std::wstring* l) {} \
- };
-
#define IPC_SYNC_MESSAGE_CONTROL0_0(msg_class) \
class msg_class : public IPC::MessageWithReply<Tuple0, Tuple0 > { \
public: \
diff --git a/chrome/common/ipc_message_unittest.cc b/chrome/common/ipc_message_unittest.cc
index 8596185..d6ff045 100644
--- a/chrome/common/ipc_message_unittest.cc
+++ b/chrome/common/ipc_message_unittest.cc
@@ -20,11 +20,11 @@ TEST(IPCMessageTest, Serialize) {
for (size_t i = 0; i < arraysize(serialize_cases); i++) {
GURL input(serialize_cases[i]);
IPC::Message msg(1, 2, IPC::Message::PRIORITY_NORMAL);
- IPC::ParamTraits<GURL>::Write(&msg, input);
+ ParamTraits<GURL>::Write(&msg, input);
GURL output;
void* iter = NULL;
- EXPECT_TRUE(IPC::ParamTraits<GURL>::Read(&msg, &iter, &output));
+ EXPECT_TRUE(ParamTraits<GURL>::Read(&msg, &iter, &output));
// We want to test each component individually to make sure its range was
// correctly serialized and deserialized, not just the spec.
@@ -45,6 +45,6 @@ TEST(IPCMessageTest, Serialize) {
msg.WriteInt(99);
GURL output;
void* iter = NULL;
- EXPECT_FALSE(IPC::ParamTraits<GURL>::Read(&msg, &iter, &output));
+ EXPECT_FALSE(ParamTraits<GURL>::Read(&msg, &iter, &output));
}
diff --git a/chrome/common/ipc_message_utils.cc b/chrome/common/ipc_message_utils.cc
index 2512ff4..cf82dc8 100644
--- a/chrome/common/ipc_message_utils.cc
+++ b/chrome/common/ipc_message_utils.cc
@@ -9,8 +9,6 @@
#include "SkBitmap.h"
#include "webkit/glue/dom_operations.h"
-namespace IPC {
-
namespace {
struct SkBitmap_Data {
@@ -46,7 +44,7 @@ struct SkBitmap_Data {
} // namespace
-void ParamTraits<SkBitmap>::Write(Message* m, const SkBitmap& p) {
+void ParamTraits<SkBitmap>::Write(IPC::Message* m, const SkBitmap& p) {
size_t fixed_size = sizeof(SkBitmap_Data);
SkBitmap_Data bmp_data;
bmp_data.InitSkBitmapDataForTransfer(p);
@@ -58,7 +56,7 @@ void ParamTraits<SkBitmap>::Write(Message* m, const SkBitmap& p) {
static_cast<int>(pixel_size));
}
-bool ParamTraits<SkBitmap>::Read(const Message* m, void** iter, SkBitmap* r) {
+bool ParamTraits<SkBitmap>::Read(const IPC::Message* m, void** iter, SkBitmap* r) {
const char* fixed_data;
int fixed_data_size = 0;
if (!m->ReadData(iter, &fixed_data, &fixed_data_size) ||
@@ -87,12 +85,12 @@ void ParamTraits<SkBitmap>::Log(const SkBitmap& p, std::wstring* l) {
}
-void ParamTraits<GURL>::Write(Message* m, const GURL& p) {
+void ParamTraits<GURL>::Write(IPC::Message* m, const GURL& p) {
m->WriteString(p.possibly_invalid_spec());
// TODO(brettw) bug 684583: Add encoding for query params.
}
-bool ParamTraits<GURL>::Read(const Message* m, void** iter, GURL* p) {
+bool ParamTraits<GURL>::Read(const IPC::Message* m, void** iter, GURL* p) {
std::string s;
if (!m->ReadString(iter, &s)) {
*p = GURL();
@@ -107,12 +105,12 @@ void ParamTraits<GURL>::Log(const GURL& p, std::wstring* l) {
}
-void ParamTraits<gfx::Point>::Write(Message* m, const gfx::Point& p) {
+void ParamTraits<gfx::Point>::Write(IPC::Message* m, const gfx::Point& p) {
m->WriteInt(p.x());
m->WriteInt(p.y());
}
-bool ParamTraits<gfx::Point>::Read(const Message* m, void** iter,
+bool ParamTraits<gfx::Point>::Read(const IPC::Message* m, void** iter,
gfx::Point* r) {
int x, y;
if (!m->ReadInt(iter, &x) ||
@@ -128,14 +126,14 @@ void ParamTraits<gfx::Point>::Log(const gfx::Point& p, std::wstring* l) {
}
-void ParamTraits<gfx::Rect>::Write(Message* m, const gfx::Rect& p) {
+void ParamTraits<gfx::Rect>::Write(IPC::Message* m, const gfx::Rect& p) {
m->WriteInt(p.x());
m->WriteInt(p.y());
m->WriteInt(p.width());
m->WriteInt(p.height());
}
-bool ParamTraits<gfx::Rect>::Read(const Message* m, void** iter, gfx::Rect* r) {
+bool ParamTraits<gfx::Rect>::Read(const IPC::Message* m, void** iter, gfx::Rect* r) {
int x, y, w, h;
if (!m->ReadInt(iter, &x) ||
!m->ReadInt(iter, &y) ||
@@ -155,12 +153,12 @@ void ParamTraits<gfx::Rect>::Log(const gfx::Rect& p, std::wstring* l) {
}
-void ParamTraits<gfx::Size>::Write(Message* m, const gfx::Size& p) {
+void ParamTraits<gfx::Size>::Write(IPC::Message* m, const gfx::Size& p) {
m->WriteInt(p.width());
m->WriteInt(p.height());
}
-bool ParamTraits<gfx::Size>::Read(const Message* m, void** iter, gfx::Size* r) {
+bool ParamTraits<gfx::Size>::Read(const IPC::Message* m, void** iter, gfx::Size* r) {
int w, h;
if (!m->ReadInt(iter, &w) ||
!m->ReadInt(iter, &h))
@@ -175,7 +173,7 @@ void ParamTraits<gfx::Size>::Log(const gfx::Size& p, std::wstring* l) {
}
void ParamTraits<webkit_glue::WebApplicationInfo>::Write(
- Message* m, const webkit_glue::WebApplicationInfo& p) {
+ IPC::Message* m, const webkit_glue::WebApplicationInfo& p) {
WriteParam(m, p.title);
WriteParam(m, p.description);
WriteParam(m, p.app_url);
@@ -188,7 +186,7 @@ void ParamTraits<webkit_glue::WebApplicationInfo>::Write(
}
bool ParamTraits<webkit_glue::WebApplicationInfo>::Read(
- const Message* m, void** iter, webkit_glue::WebApplicationInfo* r) {
+ const IPC::Message* m, void** iter, webkit_glue::WebApplicationInfo* r) {
size_t icon_count;
bool result =
ReadParam(m, iter, &r->title) &&
@@ -212,6 +210,3 @@ void ParamTraits<webkit_glue::WebApplicationInfo>::Log(
const webkit_glue::WebApplicationInfo& p, std::wstring* l) {
l->append(L"<WebApplicationInfo>");
}
-
-} // namespace IPC
-
diff --git a/chrome/common/ipc_message_utils.h b/chrome/common/ipc_message_utils.h
index 39bb231..35146ee 100644
--- a/chrome/common/ipc_message_utils.h
+++ b/chrome/common/ipc_message_utils.h
@@ -34,70 +34,43 @@ namespace webkit_glue {
struct WebApplicationInfo;
} // namespace webkit_glue
-namespace IPC {
-
-// Used by the message macros to register a logging function based on the
-// message class.
-typedef void (LogFunction)(uint16 type,
- std::wstring* name,
- const IPC::Message* msg,
- std::wstring* params);
-void RegisterMessageLogger(int msg_start, LogFunction* func);
-
-
-//-----------------------------------------------------------------------------
-// An iterator class for reading the fields contained within a Message.
-
-class MessageIterator {
- public:
- explicit MessageIterator(const Message& m) : msg_(m), iter_(NULL) {
- }
- int NextInt() const {
- int val;
- if (!msg_.ReadInt(&iter_, &val))
- NOTREACHED();
- return val;
- }
- intptr_t NextIntPtr() const {
- intptr_t val;
- if (!msg_.ReadIntPtr(&iter_, &val))
- NOTREACHED();
- return val;
- }
- const std::string NextString() const {
- std::string val;
- if (!msg_.ReadString(&iter_, &val))
- NOTREACHED();
- return val;
- }
- const std::wstring NextWString() const {
- std::wstring val;
- if (!msg_.ReadWString(&iter_, &val))
- NOTREACHED();
- return val;
- }
- const void NextData(const char** data, int* length) const {
- if (!msg_.ReadData(&iter_, data, length)) {
- NOTREACHED();
- }
- }
- private:
- const Message& msg_;
- mutable void* iter_;
+// Used by IPC_BEGIN_MESSAGES so that each message class starts from a unique
+// base. Messages have unique IDs across channels in order for the IPC logging
+// code to figure out the message class from its ID.
+enum IPCMessageStart {
+ // By using a start value of 0 for automation messages, we keep backward
+ // compatibility with old builds.
+ AutomationMsgStart = 0,
+ ViewMsgStart,
+ ViewHostMsgStart,
+ PluginProcessMsgStart,
+ PluginProcessHostMsgStart,
+ PluginMsgStart,
+ PluginHostMsgStart,
+ NPObjectMsgStart,
+ TestMsgStart,
+ // NOTE: When you add a new message class, also update
+ // IPCStatusView::IPCStatusView to ensure logging works.
+ // NOTE: this enum is used by IPC_MESSAGE_MACRO to generate a unique message
+ // id. Only 4 bits are used for the message type, so if this enum needs more
+ // than 16 entries, that code needs to be updated.
+ LastMsgIndex
};
+COMPILE_ASSERT(LastMsgIndex <= 16, need_to_update_IPC_MESSAGE_MACRO);
+
//-----------------------------------------------------------------------------
// ParamTraits specializations, etc.
template <class P> struct ParamTraits {};
template <class P>
-static inline void WriteParam(Message* m, const P& p) {
+static inline void WriteParam(IPC::Message* m, const P& p) {
ParamTraits<P>::Write(m, p);
}
template <class P>
-static inline bool ReadParam(const Message* m, void** iter, P* p) {
+static inline bool ReadParam(const IPC::Message* m, void** iter, P* p) {
return ParamTraits<P>::Read(m, iter, p);
}
@@ -109,10 +82,10 @@ static inline void LogParam(const P& p, std::wstring* l) {
template <>
struct ParamTraits<bool> {
typedef bool param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
m->WriteBool(p);
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
return m->ReadBool(iter, r);
}
static void Log(const param_type& p, std::wstring* l) {
@@ -123,10 +96,10 @@ struct ParamTraits<bool> {
template <>
struct ParamTraits<int> {
typedef int param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
m->WriteInt(p);
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
return m->ReadInt(iter, r);
}
static void Log(const param_type& p, std::wstring* l) {
@@ -137,10 +110,10 @@ struct ParamTraits<int> {
template <>
struct ParamTraits<long> {
typedef long param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
m->WriteLong(p);
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
return m->ReadLong(iter, r);
}
static void Log(const param_type& p, std::wstring* l) {
@@ -151,10 +124,10 @@ struct ParamTraits<long> {
template <>
struct ParamTraits<size_t> {
typedef size_t param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
m->WriteSize(p);
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
return m->ReadSize(iter, r);
}
static void Log(const param_type& p, std::wstring* l) {
@@ -168,10 +141,10 @@ struct ParamTraits<size_t> {
template <>
struct ParamTraits<uint32> {
typedef uint32 param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
m->WriteUInt32(p);
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
return m->ReadUInt32(iter, r);
}
static void Log(const param_type& p, std::wstring* l) {
@@ -183,10 +156,10 @@ struct ParamTraits<uint32> {
template <>
struct ParamTraits<int64> {
typedef int64 param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
m->WriteInt64(p);
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
return m->ReadInt64(iter, r);
}
static void Log(const param_type& p, std::wstring* l) {
@@ -197,10 +170,10 @@ struct ParamTraits<int64> {
template <>
struct ParamTraits<uint64> {
typedef uint64 param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
m->WriteInt64(static_cast<int64>(p));
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
return m->ReadInt64(iter, reinterpret_cast<int64*>(r));
}
static void Log(const param_type& p, std::wstring* l) {
@@ -211,10 +184,10 @@ struct ParamTraits<uint64> {
template <>
struct ParamTraits<double> {
typedef double param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
m->WriteData(reinterpret_cast<const char*>(&p), sizeof(param_type));
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
const char *data;
int data_size = 0;
bool result = m->ReadData(iter, &data, &data_size);
@@ -235,10 +208,10 @@ struct ParamTraits<double> {
template <>
struct ParamTraits<wchar_t> {
typedef wchar_t param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
m->WriteData(reinterpret_cast<const char*>(&p), sizeof(param_type));
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
const char *data;
int data_size = 0;
bool result = m->ReadData(iter, &data, &data_size);
@@ -259,10 +232,10 @@ struct ParamTraits<wchar_t> {
template <>
struct ParamTraits<base::Time> {
typedef base::Time param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
ParamTraits<int64>::Write(m, p.ToInternalValue());
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
int64 value;
if (!ParamTraits<int64>::Read(m, iter, &value))
return false;
@@ -278,10 +251,10 @@ struct ParamTraits<base::Time> {
template <>
struct ParamTraits<LOGFONT> {
typedef LOGFONT param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
m->WriteData(reinterpret_cast<const char*>(&p), sizeof(LOGFONT));
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
const char *data;
int data_size = 0;
bool result = m->ReadData(iter, &data, &data_size);
@@ -302,10 +275,10 @@ struct ParamTraits<LOGFONT> {
template <>
struct ParamTraits<MSG> {
typedef MSG param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
m->WriteData(reinterpret_cast<const char*>(&p), sizeof(MSG));
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
const char *data;
int data_size = 0;
bool result = m->ReadData(iter, &data, &data_size);
@@ -324,11 +297,11 @@ struct ParamTraits<MSG> {
template <>
struct ParamTraits<SkBitmap> {
typedef SkBitmap param_type;
- static void Write(Message* m, const param_type& p);
+ static void Write(IPC::Message* m, const param_type& p);
// Note: This function expects parameter |r| to be of type &SkBitmap since
// r->SetConfig() and r->SetPixels() are called.
- static bool Read(const Message* m, void** iter, param_type* r);
+ static bool Read(const IPC::Message* m, void** iter, param_type* r);
static void Log(const param_type& p, std::wstring* l);
};
@@ -336,10 +309,10 @@ struct ParamTraits<SkBitmap> {
template <>
struct ParamTraits<std::string> {
typedef std::string param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
m->WriteString(p);
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
return m->ReadString(iter, r);
}
static void Log(const param_type& p, std::wstring* l) {
@@ -350,7 +323,7 @@ struct ParamTraits<std::string> {
template <>
struct ParamTraits<std::vector<unsigned char> > {
typedef std::vector<unsigned char> param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
if (p.size() == 0) {
m->WriteData(NULL, 0);
} else {
@@ -358,7 +331,7 @@ struct ParamTraits<std::vector<unsigned char> > {
static_cast<int>(p.size()));
}
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
const char *data;
int data_size = 0;
if (!m->ReadData(iter, &data, &data_size) || data_size < 0)
@@ -377,14 +350,14 @@ struct ParamTraits<std::vector<unsigned char> > {
template <>
struct ParamTraits<std::vector<char> > {
typedef std::vector<char> param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
if (p.size() == 0) {
m->WriteData(NULL, 0);
} else {
m->WriteData(&p.front(), static_cast<int>(p.size()));
}
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
const char *data;
int data_size = 0;
if (!m->ReadData(iter, &data, &data_size) || data_size < 0)
@@ -403,12 +376,12 @@ struct ParamTraits<std::vector<char> > {
template <class P>
struct ParamTraits<std::vector<P> > {
typedef std::vector<P> param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
WriteParam(m, static_cast<int>(p.size()));
for (size_t i = 0; i < p.size(); i++)
WriteParam(m, p[i]);
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
int size;
if (!m->ReadLength(iter, &size))
return false;
@@ -442,7 +415,7 @@ struct ParamTraits<std::vector<P> > {
template <class K, class V>
struct ParamTraits<std::map<K, V> > {
typedef std::map<K, V> param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
WriteParam(m, static_cast<int>(p.size()));
typename param_type::const_iterator iter;
for (iter = p.begin(); iter != p.end(); ++iter) {
@@ -450,7 +423,7 @@ struct ParamTraits<std::map<K, V> > {
WriteParam(m, iter->second);
}
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
int size;
if (!ReadParam(m, iter, &size) || size < 0)
return false;
@@ -472,10 +445,10 @@ struct ParamTraits<std::map<K, V> > {
template <>
struct ParamTraits<std::wstring> {
typedef std::wstring param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
m->WriteWString(p);
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
return m->ReadWString(iter, r);
}
static void Log(const param_type& p, std::wstring* l) {
@@ -486,8 +459,8 @@ struct ParamTraits<std::wstring> {
template <>
struct ParamTraits<GURL> {
typedef GURL param_type;
- static void Write(Message* m, const param_type& p);
- static bool Read(const Message* m, void** iter, param_type* p);
+ static void Write(IPC::Message* m, const param_type& p);
+ static bool Read(const IPC::Message* m, void** iter, param_type* p);
static void Log(const param_type& p, std::wstring* l);
};
@@ -496,10 +469,10 @@ struct ParamTraits<GURL> {
template <>
struct ParamTraits<HANDLE> {
typedef HANDLE param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
m->WriteIntPtr(reinterpret_cast<intptr_t>(p));
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
DCHECK_EQ(sizeof(param_type), sizeof(intptr_t));
return m->ReadIntPtr(iter, reinterpret_cast<intptr_t*>(r));
}
@@ -511,10 +484,10 @@ struct ParamTraits<HANDLE> {
template <>
struct ParamTraits<HCURSOR> {
typedef HCURSOR param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
m->WriteIntPtr(reinterpret_cast<intptr_t>(p));
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
DCHECK_EQ(sizeof(param_type), sizeof(intptr_t));
return m->ReadIntPtr(iter, reinterpret_cast<intptr_t*>(r));
}
@@ -526,10 +499,10 @@ struct ParamTraits<HCURSOR> {
template <>
struct ParamTraits<HWND> {
typedef HWND param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
m->WriteIntPtr(reinterpret_cast<intptr_t>(p));
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
DCHECK_EQ(sizeof(param_type), sizeof(intptr_t));
return m->ReadIntPtr(iter, reinterpret_cast<intptr_t*>(r));
}
@@ -541,7 +514,7 @@ struct ParamTraits<HWND> {
template <>
struct ParamTraits<HRGN> {
typedef HRGN param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
int data_size = GetRegionData(p, 0, NULL);
if (data_size) {
char* bytes = new char[data_size];
@@ -552,7 +525,7 @@ struct ParamTraits<HRGN> {
m->WriteData(NULL, 0);
}
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
bool res = FALSE;
const char *data;
int data_size = 0;
@@ -574,10 +547,10 @@ struct ParamTraits<HRGN> {
template <>
struct ParamTraits<HACCEL> {
typedef HACCEL param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
m->WriteIntPtr(reinterpret_cast<intptr_t>(p));
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
DCHECK_EQ(sizeof(param_type), sizeof(intptr_t));
return m->ReadIntPtr(iter, reinterpret_cast<intptr_t*>(r));
}
@@ -586,11 +559,11 @@ struct ParamTraits<HACCEL> {
template <>
struct ParamTraits<POINT> {
typedef POINT param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
m->WriteInt(p.x);
m->WriteInt(p.y);
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
int x, y;
if (!m->ReadInt(iter, &x) || !m->ReadInt(iter, &y))
return false;
@@ -607,10 +580,10 @@ struct ParamTraits<POINT> {
template <>
struct ParamTraits<FilePath> {
typedef FilePath param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
ParamTraits<FilePath::StringType>::Write(m, p.value());
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
FilePath::StringType value;
if (!ParamTraits<FilePath::StringType>::Read(m, iter, &value))
return false;
@@ -625,44 +598,44 @@ struct ParamTraits<FilePath> {
template <>
struct ParamTraits<gfx::Point> {
typedef gfx::Point param_type;
- static void Write(Message* m, const param_type& p);
- static bool Read(const Message* m, void** iter, param_type* r);
+ static void Write(IPC::Message* m, const param_type& p);
+ static bool Read(const IPC::Message* m, void** iter, param_type* r);
static void Log(const param_type& p, std::wstring* l);
};
template <>
struct ParamTraits<gfx::Rect> {
typedef gfx::Rect param_type;
- static void Write(Message* m, const param_type& p);
- static bool Read(const Message* m, void** iter, param_type* r);
+ static void Write(IPC::Message* m, const param_type& p);
+ static bool Read(const IPC::Message* m, void** iter, param_type* r);
static void Log(const param_type& p, std::wstring* l);
};
template <>
struct ParamTraits<gfx::Size> {
typedef gfx::Size param_type;
- static void Write(Message* m, const param_type& p);
- static bool Read(const Message* m, void** iter, param_type* r);
+ static void Write(IPC::Message* m, const param_type& p);
+ static bool Read(const IPC::Message* m, void** iter, param_type* r);
static void Log(const param_type& p, std::wstring* l);
};
template<>
struct ParamTraits<ThumbnailScore> {
typedef ThumbnailScore param_type;
- static void Write(Message* m, const param_type& p) {
- IPC::ParamTraits<double>::Write(m, p.boring_score);
- IPC::ParamTraits<bool>::Write(m, p.good_clipping);
- IPC::ParamTraits<bool>::Write(m, p.at_top);
- IPC::ParamTraits<base::Time>::Write(m, p.time_at_snapshot);
+ static void Write(IPC::Message* m, const param_type& p) {
+ ParamTraits<double>::Write(m, p.boring_score);
+ ParamTraits<bool>::Write(m, p.good_clipping);
+ ParamTraits<bool>::Write(m, p.at_top);
+ ParamTraits<base::Time>::Write(m, p.time_at_snapshot);
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
double boring_score;
bool good_clipping, at_top;
base::Time time_at_snapshot;
- if (!IPC::ParamTraits<double>::Read(m, iter, &boring_score) ||
- !IPC::ParamTraits<bool>::Read(m, iter, &good_clipping) ||
- !IPC::ParamTraits<bool>::Read(m, iter, &at_top) ||
- !IPC::ParamTraits<base::Time>::Read(m, iter, &time_at_snapshot))
+ if (!ParamTraits<double>::Read(m, iter, &boring_score) ||
+ !ParamTraits<bool>::Read(m, iter, &good_clipping) ||
+ !ParamTraits<bool>::Read(m, iter, &at_top) ||
+ !ParamTraits<base::Time>::Read(m, iter, &time_at_snapshot))
return false;
r->boring_score = boring_score;
@@ -680,10 +653,10 @@ struct ParamTraits<ThumbnailScore> {
template <>
struct ParamTraits<WindowOpenDisposition> {
typedef WindowOpenDisposition param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
m->WriteInt(p);
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
int temp;
bool res = m->ReadInt(iter, &temp);
*r = static_cast<WindowOpenDisposition>(temp);
@@ -697,10 +670,10 @@ struct ParamTraits<WindowOpenDisposition> {
template <>
struct ParamTraits<ConsoleMessageLevel> {
typedef ConsoleMessageLevel param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
m->WriteInt(p);
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
int temp;
bool res = m->ReadInt(iter, &temp);
*r = static_cast<ConsoleMessageLevel>(temp);
@@ -714,13 +687,13 @@ struct ParamTraits<ConsoleMessageLevel> {
template <>
struct ParamTraits<CacheManager::ResourceTypeStat> {
typedef CacheManager::ResourceTypeStat param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
WriteParam(m, p.count);
WriteParam(m, p.size);
WriteParam(m, p.live_size);
WriteParam(m, p.decoded_size);
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
bool result =
ReadParam(m, iter, &r->count) &&
ReadParam(m, iter, &r->size) &&
@@ -737,14 +710,14 @@ struct ParamTraits<CacheManager::ResourceTypeStat> {
template <>
struct ParamTraits<CacheManager::ResourceTypeStats> {
typedef CacheManager::ResourceTypeStats param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
WriteParam(m, p.images);
WriteParam(m, p.css_stylesheets);
WriteParam(m, p.scripts);
WriteParam(m, p.xsl_stylesheets);
WriteParam(m, p.fonts);
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
bool result =
ReadParam(m, iter, &r->images) &&
ReadParam(m, iter, &r->css_stylesheets) &&
@@ -768,10 +741,10 @@ struct ParamTraits<CacheManager::ResourceTypeStats> {
template <>
struct ParamTraits<XFORM> {
typedef XFORM param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
m->WriteData(reinterpret_cast<const char*>(&p), sizeof(XFORM));
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
const char *data;
int data_size = 0;
bool result = m->ReadData(iter, &data, &data_size);
@@ -793,10 +766,10 @@ struct ParamTraits<XFORM> {
template <>
struct ParamTraits<WebCursor> {
typedef WebCursor param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
p.Serialize(m);
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
return r->Deserialize(m, iter);
}
static void Log(const param_type& p, std::wstring* l) {
@@ -804,6 +777,8 @@ struct ParamTraits<WebCursor> {
}
};
+namespace IPC {
+
struct LogData {
std::wstring channel;
uint16 type;
@@ -816,10 +791,12 @@ struct LogData {
std::wstring params;
};
+}
+
template <>
-struct ParamTraits<LogData> {
- typedef LogData param_type;
- static void Write(Message* m, const param_type& p) {
+struct ParamTraits<IPC::LogData> {
+ typedef IPC::LogData param_type;
+ static void Write(IPC::Message* m, const param_type& p) {
WriteParam(m, p.channel);
WriteParam(m, static_cast<int>(p.type));
WriteParam(m, p.flags);
@@ -828,7 +805,7 @@ struct ParamTraits<LogData> {
WriteParam(m, p.dispatch);
WriteParam(m, p.params);
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
int type;
bool result =
ReadParam(m, iter, &r->channel) &&
@@ -849,9 +826,9 @@ struct ParamTraits<LogData> {
template <>
struct ParamTraits<Tuple0> {
typedef Tuple0 param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
return true;
}
static void Log(const param_type& p, std::wstring* l) {
@@ -861,10 +838,10 @@ struct ParamTraits<Tuple0> {
template <class A>
struct ParamTraits< Tuple1<A> > {
typedef Tuple1<A> param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
WriteParam(m, p.a);
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
return ReadParam(m, iter, &r->a);
}
static void Log(const param_type& p, std::wstring* l) {
@@ -875,11 +852,11 @@ struct ParamTraits< Tuple1<A> > {
template <class A, class B>
struct ParamTraits< Tuple2<A, B> > {
typedef Tuple2<A, B> param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
WriteParam(m, p.a);
WriteParam(m, p.b);
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
return (ReadParam(m, iter, &r->a) &&
ReadParam(m, iter, &r->b));
}
@@ -893,12 +870,12 @@ struct ParamTraits< Tuple2<A, B> > {
template <class A, class B, class C>
struct ParamTraits< Tuple3<A, B, C> > {
typedef Tuple3<A, B, C> param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
WriteParam(m, p.a);
WriteParam(m, p.b);
WriteParam(m, p.c);
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
return (ReadParam(m, iter, &r->a) &&
ReadParam(m, iter, &r->b) &&
ReadParam(m, iter, &r->c));
@@ -915,13 +892,13 @@ struct ParamTraits< Tuple3<A, B, C> > {
template <class A, class B, class C, class D>
struct ParamTraits< Tuple4<A, B, C, D> > {
typedef Tuple4<A, B, C, D> param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
WriteParam(m, p.a);
WriteParam(m, p.b);
WriteParam(m, p.c);
WriteParam(m, p.d);
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
return (ReadParam(m, iter, &r->a) &&
ReadParam(m, iter, &r->b) &&
ReadParam(m, iter, &r->c) &&
@@ -941,14 +918,14 @@ struct ParamTraits< Tuple4<A, B, C, D> > {
template <class A, class B, class C, class D, class E>
struct ParamTraits< Tuple5<A, B, C, D, E> > {
typedef Tuple5<A, B, C, D, E> param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
WriteParam(m, p.a);
WriteParam(m, p.b);
WriteParam(m, p.c);
WriteParam(m, p.d);
WriteParam(m, p.e);
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
return (ReadParam(m, iter, &r->a) &&
ReadParam(m, iter, &r->b) &&
ReadParam(m, iter, &r->c) &&
@@ -971,7 +948,7 @@ struct ParamTraits< Tuple5<A, B, C, D, E> > {
template <class A, class B, class C, class D, class E, class F>
struct ParamTraits< Tuple6<A, B, C, D, E, F> > {
typedef Tuple6<A, B, C, D, E, F> param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
WriteParam(m, p.a);
WriteParam(m, p.b);
WriteParam(m, p.c);
@@ -979,7 +956,7 @@ struct ParamTraits< Tuple6<A, B, C, D, E, F> > {
WriteParam(m, p.e);
WriteParam(m, p.f);
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
return (ReadParam(m, iter, &r->a) &&
ReadParam(m, iter, &r->b) &&
ReadParam(m, iter, &r->c) &&
@@ -1005,11 +982,77 @@ struct ParamTraits< Tuple6<A, B, C, D, E, F> > {
template <>
struct ParamTraits<webkit_glue::WebApplicationInfo> {
typedef webkit_glue::WebApplicationInfo param_type;
- static void Write(Message* m, const param_type& p);
- static bool Read(const Message* m, void** iter, param_type* r);
+ static void Write(IPC::Message* m, const param_type& p);
+ static bool Read(const IPC::Message* m, void** iter, param_type* r);
static void Log(const param_type& p, std::wstring* l);
};
+// Traits for ViewMsg_FindInPageMsg_Request structure to pack/unpack.
+template <>
+struct ParamTraits<FindInPageRequest> {
+ typedef FindInPageRequest param_type;
+ static void Write(IPC::Message* m, const param_type& p) {
+ WriteParam(m, p.request_id);
+ WriteParam(m, p.search_string);
+ WriteParam(m, p.forward);
+ WriteParam(m, p.match_case);
+ WriteParam(m, p.find_next);
+ }
+ static bool Read(const IPC::Message* m, void** iter, param_type* p) {
+ return
+ ReadParam(m, iter, &p->request_id) &&
+ ReadParam(m, iter, &p->search_string) &&
+ ReadParam(m, iter, &p->forward) &&
+ ReadParam(m, iter, &p->match_case) &&
+ ReadParam(m, iter, &p->find_next);
+ }
+ static void Log(const param_type& p, std::wstring* l) {
+ l->append(L"<FindInPageRequest>");
+ }
+};
+
+namespace IPC {
+
+//-----------------------------------------------------------------------------
+// An iterator class for reading the fields contained within a Message.
+
+class MessageIterator {
+ public:
+ explicit MessageIterator(const Message& m) : msg_(m), iter_(NULL) {
+ }
+ int NextInt() const {
+ int val;
+ if (!msg_.ReadInt(&iter_, &val))
+ NOTREACHED();
+ return val;
+ }
+ intptr_t NextIntPtr() const {
+ intptr_t val;
+ if (!msg_.ReadIntPtr(&iter_, &val))
+ NOTREACHED();
+ return val;
+ }
+ const std::string NextString() const {
+ std::string val;
+ if (!msg_.ReadString(&iter_, &val))
+ NOTREACHED();
+ return val;
+ }
+ const std::wstring NextWString() const {
+ std::wstring val;
+ if (!msg_.ReadWString(&iter_, &val))
+ NOTREACHED();
+ return val;
+ }
+ const void NextData(const char** data, int* length) const {
+ if (!msg_.ReadData(&iter_, data, length)) {
+ NOTREACHED();
+ }
+ }
+ private:
+ const Message& msg_;
+ mutable void* iter_;
+};
//-----------------------------------------------------------------------------
// Generic message subclasses
@@ -1025,7 +1068,7 @@ class MessageWithTuple : public Message {
WriteParam(this, p);
}
- static bool Read(const Message* msg, Param* p) {
+ static bool Read(const IPC::Message* msg, Param* p) {
void* iter = NULL;
bool rv = ReadParam(msg, &iter, p);
DCHECK(rv) << "Error deserializing message " << msg->type();
@@ -1034,7 +1077,7 @@ class MessageWithTuple : public Message {
// Generic dispatcher. Should cover most cases.
template<class T, class Method>
- static bool Dispatch(const Message* msg, T* obj, Method func) {
+ static bool Dispatch(const IPC::Message* msg, T* obj, Method func) {
Param p;
if (Read(msg, &p)) {
DispatchToMethod(obj, func, p);
@@ -1047,7 +1090,7 @@ class MessageWithTuple : public Message {
// needs the message as well. They assume that "Param" is a type of Tuple
// (except the one arg case, as there is no Tuple1).
template<class T, typename TA>
- static bool Dispatch(const Message* msg, T* obj,
+ static bool Dispatch(const IPC::Message* msg, T* obj,
void (T::*func)(const Message&, TA)) {
Param p;
if (Read(msg, &p)) {
@@ -1058,7 +1101,7 @@ class MessageWithTuple : public Message {
}
template<class T, typename TA, typename TB>
- static bool Dispatch(const Message* msg, T* obj,
+ static bool Dispatch(const IPC::Message* msg, T* obj,
void (T::*func)(const Message&, TA, TB)) {
Param p;
if (Read(msg, &p)) {
@@ -1069,7 +1112,7 @@ class MessageWithTuple : public Message {
}
template<class T, typename TA, typename TB, typename TC>
- static bool Dispatch(const Message* msg, T* obj,
+ static bool Dispatch(const IPC::Message* msg, T* obj,
void (T::*func)(const Message&, TA, TB, TC)) {
Param p;
if (Read(msg, &p)) {
@@ -1080,7 +1123,7 @@ class MessageWithTuple : public Message {
}
template<class T, typename TA, typename TB, typename TC, typename TD>
- static bool Dispatch(const Message* msg, T* obj,
+ static bool Dispatch(const IPC::Message* msg, T* obj,
void (T::*func)(const Message&, TA, TB, TC, TD)) {
Param p;
if (Read(msg, &p)) {
@@ -1092,7 +1135,7 @@ class MessageWithTuple : public Message {
template<class T, typename TA, typename TB, typename TC, typename TD,
typename TE>
- static bool Dispatch(const Message* msg, T* obj,
+ static bool Dispatch(const IPC::Message* msg, T* obj,
void (T::*func)(const Message&, TA, TB, TC, TD, TE)) {
Param p;
if (Read(msg, &p)) {
@@ -1102,11 +1145,59 @@ class MessageWithTuple : public Message {
return false;
}
- static void Log(const Message* msg, std::wstring* l) {
+ static void Log(const IPC::Message* msg, std::wstring* l) {
Param p;
if (Read(msg, &p))
LogParam(p, l);
}
+
+ // Functions used to do manual unpacking. Only used by the automation code,
+ // these should go away once that code uses SyncChannel.
+ template<typename TA, typename TB>
+ static bool Read(const IPC::Message* msg, TA* a, TB* b) {
+ ParamType params;
+ if (!Read(msg, &params))
+ return false;
+ *a = params.a;
+ *b = params.b;
+ return true;
+ }
+
+ template<typename TA, typename TB, typename TC>
+ static bool Read(const IPC::Message* msg, TA* a, TB* b, TC* c) {
+ ParamType params;
+ if (!Read(msg, &params))
+ return false;
+ *a = params.a;
+ *b = params.b;
+ *c = params.c;
+ return true;
+ }
+
+ template<typename TA, typename TB, typename TC, typename TD>
+ static bool Read(const IPC::Message* msg, TA* a, TB* b, TC* c, TD* d) {
+ ParamType params;
+ if (!Read(msg, &params))
+ return false;
+ *a = params.a;
+ *b = params.b;
+ *c = params.c;
+ *d = params.d;
+ return true;
+ }
+
+ template<typename TA, typename TB, typename TC, typename TD, typename TE>
+ static bool Read(const IPC::Message* msg, TA* a, TB* b, TC* c, TD* d, TE* e) {
+ ParamType params;
+ if (!Read(msg, &params))
+ return false;
+ *a = params.a;
+ *b = params.b;
+ *c = params.c;
+ *d = params.d;
+ *e = params.e;
+ return true;
+ }
};
// This class assumes that its template argument is a RefTuple (a Tuple with
@@ -1138,7 +1229,7 @@ class MessageWithReply : public SyncMessage {
WriteParam(this, send);
}
- static void Log(const Message* msg, std::wstring* l) {
+ static void Log(const IPC::Message* msg, std::wstring* l) {
if (msg->is_sync()) {
SendParam p;
void* iter = SyncMessage::GetDataIterator(msg);
@@ -1163,7 +1254,7 @@ class MessageWithReply : public SyncMessage {
}
template<class T, class Method>
- static bool Dispatch(const Message* msg, T* obj, Method func) {
+ static bool Dispatch(const IPC::Message* msg, T* obj, Method func) {
SendParam send_params;
void* iter = GetDataIterator(msg);
Message* reply = GenerateReply(msg);
@@ -1191,7 +1282,7 @@ class MessageWithReply : public SyncMessage {
}
template<class T, class Method>
- static bool DispatchDelayReply(const Message* msg, T* obj, Method func) {
+ static bool DispatchDelayReply(const IPC::Message* msg, T* obj, Method func) {
SendParam send_params;
void* iter = GetDataIterator(msg);
Message* reply = GenerateReply(msg);
@@ -1252,32 +1343,6 @@ class MessageWithReply : public SyncMessage {
}
};
-// Traits for ViewMsg_FindInPageMsg_Request structure to pack/unpack.
-template <>
-struct ParamTraits<FindInPageRequest> {
- typedef FindInPageRequest param_type;
- static void Write(Message* m, const param_type& p) {
- WriteParam(m, p.request_id);
- WriteParam(m, p.search_string);
- WriteParam(m, p.forward);
- WriteParam(m, p.match_case);
- WriteParam(m, p.find_next);
- }
- static bool Read(const Message* m, void** iter, param_type* p) {
- return
- ReadParam(m, iter, &p->request_id) &&
- ReadParam(m, iter, &p->search_string) &&
- ReadParam(m, iter, &p->forward) &&
- ReadParam(m, iter, &p->match_case) &&
- ReadParam(m, iter, &p->find_next);
- }
- static void Log(const param_type& p, std::wstring* l) {
- l->append(L"<FindInPageRequest>");
- }
-};
-
-//-----------------------------------------------------------------------------
-
} // namespace IPC
#endif // CHROME_COMMON_IPC_MESSAGE_UTILS_H_
diff --git a/chrome/common/ipc_sync_channel_unittest.cc b/chrome/common/ipc_sync_channel_unittest.cc
index 53d3f2a..2ccbd96 100644
--- a/chrome/common/ipc_sync_channel_unittest.cc
+++ b/chrome/common/ipc_sync_channel_unittest.cc
@@ -20,12 +20,9 @@
#include "chrome/common/stl_util-inl.h"
#include "testing/gtest/include/gtest/gtest.h"
-#define IPC_MESSAGE_MACROS_ENUMS
-#include "chrome/common/ipc_sync_channel_unittest.h"
-// define the classes
-#define IPC_MESSAGE_MACROS_CLASSES
-#include "chrome/common/ipc_sync_channel_unittest.h"
+#define MESSAGES_INTERNAL_FILE "chrome/common/ipc_sync_message_unittest.h"
+#include "chrome/common/ipc_message_macros.h"
using namespace IPC;
using base::WaitableEvent;
diff --git a/chrome/common/ipc_sync_channel_unittest.h b/chrome/common/ipc_sync_channel_unittest.h
deleted file mode 100644
index c4d2354..0000000
--- a/chrome/common/ipc_sync_channel_unittest.h
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/common/ipc_message_macros.h"
-
-// Messages used for IPC::SyncChannel unit test
-IPC_BEGIN_MESSAGES(SyncChannelTest, 9)
- IPC_SYNC_MESSAGE_CONTROL0_0(SyncChannelTestMsg_NoArgs)
-
- IPC_SYNC_MESSAGE_CONTROL0_1(SyncChannelTestMsg_AnswerToLife,
- int /* answer */)
-
- IPC_SYNC_MESSAGE_CONTROL1_1(SyncChannelTestMsg_Double,
- int /* in */,
- int /* out */)
-
-IPC_END_MESSAGES(SyncChannelTest)
-
diff --git a/chrome/common/ipc_sync_message_unittest.cc b/chrome/common/ipc_sync_message_unittest.cc
index ae44acb..6508eaf 100644
--- a/chrome/common/ipc_sync_message_unittest.cc
+++ b/chrome/common/ipc_sync_message_unittest.cc
@@ -14,13 +14,9 @@
#include "base/logging.h"
#include "testing/gtest/include/gtest/gtest.h"
-#define IPC_MESSAGE_MACROS_ENUMS
-#include "chrome/common/ipc_sync_message_unittest.h"
-
-// define the classes
-#define IPC_MESSAGE_MACROS_CLASSES
-#include "chrome/common/ipc_sync_message_unittest.h"
+#define MESSAGES_INTERNAL_FILE "chrome/common/ipc_sync_message_unittest.h"
+#include "chrome/common/ipc_message_macros.h"
static IPC::Message* g_reply;
diff --git a/chrome/common/ipc_sync_message_unittest.h b/chrome/common/ipc_sync_message_unittest.h
index 8393533..3b32c10 100644
--- a/chrome/common/ipc_sync_message_unittest.h
+++ b/chrome/common/ipc_sync_message_unittest.h
@@ -4,7 +4,16 @@
#include "chrome/common/ipc_message_macros.h"
-IPC_BEGIN_MESSAGES(TestMsg, 8)
+IPC_BEGIN_MESSAGES(Test)
+ IPC_SYNC_MESSAGE_CONTROL0_0(SyncChannelTestMsg_NoArgs)
+
+ IPC_SYNC_MESSAGE_CONTROL0_1(SyncChannelTestMsg_AnswerToLife,
+ int /* answer */)
+
+ IPC_SYNC_MESSAGE_CONTROL1_1(SyncChannelTestMsg_Double,
+ int /* in */,
+ int /* out */)
+
// out1 is false
IPC_SYNC_MESSAGE_CONTROL0_1(Msg_C_0_1, bool)
diff --git a/chrome/common/plugin_messages.cc b/chrome/common/plugin_messages.cc
deleted file mode 100644
index cd5b00a..0000000
--- a/chrome/common/plugin_messages.cc
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/common/ipc_message.h"
-
-#ifdef IPC_MESSAGE_LOG_ENABLED
-
-#define IPC_MESSAGE_MACROS_LOG_ENABLED
-
-#endif // IPC_MESSAGE_LOG_ENABLED
-
-#include "chrome/common/plugin_messages.h"
-
-void PluginMessagesInit() {
-#ifdef IPC_MESSAGE_LOG_ENABLED
- IPC::RegisterMessageLogger(PluginProcessStart, PluginProcessMsgLog);
- IPC::RegisterMessageLogger(PluginProcessHostStart, PluginProcessHostMsgLog);
- IPC::RegisterMessageLogger(PluginStart, PluginMsgLog);
- IPC::RegisterMessageLogger(PluginHostStart, PluginHostMsgLog);
- IPC::RegisterMessageLogger(NPObjectStart, NPObjectMsgLog);
-#endif
-}
diff --git a/chrome/common/plugin_messages.h b/chrome/common/plugin_messages.h
index 025acc2..793dde3 100644
--- a/chrome/common/plugin_messages.h
+++ b/chrome/common/plugin_messages.h
@@ -15,14 +15,11 @@
#include "base/gfx/rect.h"
#include "base/basictypes.h"
-#include "chrome/common/ipc_message.h"
#include "chrome/common/ipc_message_utils.h"
#include "googleurl/src/gurl.h"
#include "third_party/npapi/bindings/npapi.h"
#include "webkit/glue/npruntime_util.h"
-void PluginMessagesInit();
-
// Name prefix of the event handle when a message box is displayed.
#define kMessageBoxEventPrefix L"message_box_active"
@@ -38,95 +35,11 @@ struct PluginMsg_Init_Params {
HANDLE modal_dialog_event;
};
-struct PluginHostMsg_URLRequest_Params {
- std::string method;
- bool is_javascript_url;
- std::string target;
- std::vector<char> buffer;
- bool is_file_data;
- bool notify;
- std::string url;
- HANDLE notify_data;
- bool popups_allowed;
-};
-
-struct PluginMsg_URLRequestReply_Params {
- int resource_id;
- std::string url;
- bool notify_needed;
- HANDLE notify_data;
- HANDLE stream;
-};
-
-struct PluginMsg_PrintResponse_Params {
- HANDLE shared_memory;
- size_t size;
-};
-
-struct PluginMsg_DidReceiveResponseParams {
- int id;
- std::string mime_type;
- std::string headers;
- uint32 expected_length;
- uint32 last_modified;
- bool request_is_seekable;
-};
-
-struct NPIdentifier_Param {
- NPIdentifier identifier;
-};
-
-enum NPVariant_ParamEnum {
- NPVARIANT_PARAM_VOID,
- NPVARIANT_PARAM_NULL,
- NPVARIANT_PARAM_BOOL,
- NPVARIANT_PARAM_INT,
- NPVARIANT_PARAM_DOUBLE,
- NPVARIANT_PARAM_STRING,
- // Used when when the NPObject is running in the caller's process, so we
- // create an NPObjectProxy in the other process.
- NPVARIANT_PARAM_OBJECT_ROUTING_ID,
- // Used when the NPObject we're sending is running in the callee's process
- // (i.e. we have an NPObjectProxy for it). In that case we want the callee
- // to just use the raw pointer.
- NPVARIANT_PARAM_OBJECT_POINTER,
-};
-
-struct NPVariant_Param {
- NPVariant_ParamEnum type;
- bool bool_value;
- int int_value;
- double double_value;
- std::string string_value;
- int npobject_routing_id;
- void* npobject_pointer;
-};
-
-
-#define IPC_MESSAGE_MACROS_ENUMS
-#include "chrome/common/plugin_messages_internal.h"
-
-#ifdef IPC_MESSAGE_MACROS_LOG_ENABLED
-# undef IPC_MESSAGE_MACROS_LOG
-# define IPC_MESSAGE_MACROS_CLASSES
-
-# include "chrome/common/plugin_messages_internal.h"
-# define IPC_MESSAGE_MACROS_LOG
-# undef IPC_MESSAGE_MACROS_CLASSES
-
-# include "chrome/common/plugin_messages_internal.h"
-#else
-# define IPC_MESSAGE_MACROS_CLASSES
-# include "chrome/common/plugin_messages_internal.h"
-#endif
-
-namespace IPC {
-
// Traits for PluginMsg_Init_Params structure to pack/unpack.
template <>
struct ParamTraits<PluginMsg_Init_Params> {
typedef PluginMsg_Init_Params param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
WriteParam(m, p.containing_window);
WriteParam(m, p.url);
DCHECK(p.arg_names.size() == p.arg_values.size());
@@ -135,7 +48,7 @@ struct ParamTraits<PluginMsg_Init_Params> {
WriteParam(m, p.load_manually);
WriteParam(m, p.modal_dialog_event);
}
- static bool Read(const Message* m, void** iter, param_type* p) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* p) {
return ReadParam(m, iter, &p->containing_window) &&
ReadParam(m, iter, &p->url) &&
ReadParam(m, iter, &p->arg_names) &&
@@ -160,10 +73,23 @@ struct ParamTraits<PluginMsg_Init_Params> {
}
};
+
+struct PluginHostMsg_URLRequest_Params {
+ std::string method;
+ bool is_javascript_url;
+ std::string target;
+ std::vector<char> buffer;
+ bool is_file_data;
+ bool notify;
+ std::string url;
+ HANDLE notify_data;
+ bool popups_allowed;
+};
+
template <>
struct ParamTraits<PluginHostMsg_URLRequest_Params> {
typedef PluginHostMsg_URLRequest_Params param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
WriteParam(m, p.method);
WriteParam(m, p.is_javascript_url);
WriteParam(m, p.target);
@@ -174,7 +100,7 @@ struct ParamTraits<PluginHostMsg_URLRequest_Params> {
WriteParam(m, p.notify_data);
WriteParam(m, p.popups_allowed);
}
- static bool Read(const Message* m, void** iter, param_type* p) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* p) {
return
ReadParam(m, iter, &p->method) &&
ReadParam(m, iter, &p->is_javascript_url) &&
@@ -209,17 +135,26 @@ struct ParamTraits<PluginHostMsg_URLRequest_Params> {
}
};
+
+struct PluginMsg_URLRequestReply_Params {
+ int resource_id;
+ std::string url;
+ bool notify_needed;
+ HANDLE notify_data;
+ HANDLE stream;
+};
+
template <>
struct ParamTraits<PluginMsg_URLRequestReply_Params> {
typedef PluginMsg_URLRequestReply_Params param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
WriteParam(m, p.resource_id);
WriteParam(m, p.url);
WriteParam(m, p.notify_needed);
WriteParam(m, p.notify_data);
WriteParam(m, p.stream);
}
- static bool Read(const Message* m, void** iter, param_type* p) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* p) {
return
ReadParam(m, iter, &p->resource_id) &&
ReadParam(m, iter, &p->url) &&
@@ -242,14 +177,20 @@ struct ParamTraits<PluginMsg_URLRequestReply_Params> {
}
};
+
+struct PluginMsg_PrintResponse_Params {
+ HANDLE shared_memory;
+ size_t size;
+};
+
template <>
struct ParamTraits<PluginMsg_PrintResponse_Params> {
typedef PluginMsg_PrintResponse_Params param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
WriteParam(m, p.shared_memory);
WriteParam(m, p.size);
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
return
ReadParam(m, iter, &r->shared_memory) &&
ReadParam(m, iter, &r->size);
@@ -258,10 +199,20 @@ struct ParamTraits<PluginMsg_PrintResponse_Params> {
}
};
+
+struct PluginMsg_DidReceiveResponseParams {
+ int id;
+ std::string mime_type;
+ std::string headers;
+ uint32 expected_length;
+ uint32 last_modified;
+ bool request_is_seekable;
+};
+
template <>
struct ParamTraits<PluginMsg_DidReceiveResponseParams> {
typedef PluginMsg_DidReceiveResponseParams param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
WriteParam(m, p.id);
WriteParam(m, p.mime_type);
WriteParam(m, p.headers);
@@ -269,7 +220,7 @@ struct ParamTraits<PluginMsg_DidReceiveResponseParams> {
WriteParam(m, p.last_modified);
WriteParam(m, p.request_is_seekable);
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
return
ReadParam(m, iter, &r->id) &&
ReadParam(m, iter, &r->mime_type) &&
@@ -295,97 +246,18 @@ struct ParamTraits<PluginMsg_DidReceiveResponseParams> {
}
};
-template <>
-struct ParamTraits<NPEvent> {
- typedef NPEvent param_type;
- static void Write(Message* m, const param_type& p) {
- m->WriteData(reinterpret_cast<const char*>(&p), sizeof(NPEvent));
- }
- static bool Read(const Message* m, void** iter, param_type* r) {
- const char *data;
- int data_size = 0;
- bool result = m->ReadData(iter, &data, &data_size);
- if (!result || data_size != sizeof(NPEvent)) {
- NOTREACHED();
- return false;
- }
- memcpy(r, data, sizeof(NPEvent));
- return true;
- }
- static void Log(const param_type& p, std::wstring* l) {
- std::wstring event, wparam, lparam;
- lparam = StringPrintf(L"(%d, %d)", LOWORD(p.lParam), HIWORD(p.lParam));
- switch(p.event) {
- case WM_KEYDOWN:
- event = L"WM_KEYDOWN";
- wparam = StringPrintf(L"%d", p.wParam);
- lparam = StringPrintf(L"%d", p.lParam);
- break;
- case WM_KEYUP:
- event = L"WM_KEYDOWN";
- wparam = StringPrintf(L"%d", p.wParam);
- lparam = StringPrintf(L"%x", p.lParam);
- break;
- case WM_MOUSEMOVE:
- event = L"WM_MOUSEMOVE";
- if (p.wParam & MK_LBUTTON) {
- wparam = L"MK_LBUTTON";
- } else if (p.wParam & MK_MBUTTON) {
- wparam = L"MK_MBUTTON";
- } else if (p.wParam & MK_RBUTTON) {
- wparam = L"MK_RBUTTON";
- }
- break;
- case WM_LBUTTONDOWN:
- event = L"WM_LBUTTONDOWN";
- break;
- case WM_MBUTTONDOWN:
- event = L"WM_MBUTTONDOWN";
- break;
- case WM_RBUTTONDOWN:
- event = L"WM_RBUTTONDOWN";
- break;
- case WM_LBUTTONUP:
- event = L"WM_LBUTTONUP";
- break;
- case WM_MBUTTONUP:
- event = L"WM_MBUTTONUP";
- break;
- case WM_RBUTTONUP:
- event = L"WM_RBUTTONUP";
- break;
- }
-
- if (p.wParam & MK_CONTROL) {
- if (!wparam.empty())
- wparam += L" ";
- wparam += L"MK_CONTROL";
- }
-
- if (p.wParam & MK_SHIFT) {
- if (!wparam.empty())
- wparam += L" ";
- wparam += L"MK_SHIFT";
- }
-
- l->append(L"(");
- LogParam(event, l);
- l->append(L", ");
- LogParam(wparam, l);
- l->append(L", ");
- LogParam(lparam, l);
- l->append(L")");
- }
+struct NPIdentifier_Param {
+ NPIdentifier identifier;
};
template <>
struct ParamTraits<NPIdentifier_Param> {
typedef NPIdentifier_Param param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
webkit_glue::SerializeNPIdentifier(p.identifier, m);
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
return webkit_glue::DeserializeNPIdentifier(*m, iter, &r->identifier);
}
static void Log(const param_type& p, std::wstring* l) {
@@ -399,10 +271,37 @@ struct ParamTraits<NPIdentifier_Param> {
}
};
+
+enum NPVariant_ParamEnum {
+ NPVARIANT_PARAM_VOID,
+ NPVARIANT_PARAM_NULL,
+ NPVARIANT_PARAM_BOOL,
+ NPVARIANT_PARAM_INT,
+ NPVARIANT_PARAM_DOUBLE,
+ NPVARIANT_PARAM_STRING,
+ // Used when when the NPObject is running in the caller's process, so we
+ // create an NPObjectProxy in the other process.
+ NPVARIANT_PARAM_OBJECT_ROUTING_ID,
+ // Used when the NPObject we're sending is running in the callee's process
+ // (i.e. we have an NPObjectProxy for it). In that case we want the callee
+ // to just use the raw pointer.
+ NPVARIANT_PARAM_OBJECT_POINTER,
+};
+
+struct NPVariant_Param {
+ NPVariant_ParamEnum type;
+ bool bool_value;
+ int int_value;
+ double double_value;
+ std::string string_value;
+ int npobject_routing_id;
+ void* npobject_pointer;
+};
+
template <>
struct ParamTraits<NPVariant_Param> {
typedef NPVariant_Param param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
WriteParam(m, static_cast<int>(p.type));
if (p.type == NPVARIANT_PARAM_BOOL) {
WriteParam(m, p.bool_value);
@@ -425,7 +324,7 @@ struct ParamTraits<NPVariant_Param> {
DCHECK(p.type == NPVARIANT_PARAM_VOID || p.type == NPVARIANT_PARAM_NULL);
}
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
int type;
if (!ReadParam(m, iter, &type))
return false;
@@ -473,7 +372,94 @@ struct ParamTraits<NPVariant_Param> {
}
};
-} // namespace IPC
+
+template <>
+struct ParamTraits<NPEvent> {
+ typedef NPEvent param_type;
+ static void Write(IPC::Message* m, const param_type& p) {
+ m->WriteData(reinterpret_cast<const char*>(&p), sizeof(NPEvent));
+ }
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
+ const char *data;
+ int data_size = 0;
+ bool result = m->ReadData(iter, &data, &data_size);
+ if (!result || data_size != sizeof(NPEvent)) {
+ NOTREACHED();
+ return false;
+ }
+
+ memcpy(r, data, sizeof(NPEvent));
+ return true;
+ }
+ static void Log(const param_type& p, std::wstring* l) {
+ std::wstring event, wparam, lparam;
+ lparam = StringPrintf(L"(%d, %d)", LOWORD(p.lParam), HIWORD(p.lParam));
+ switch(p.event) {
+ case WM_KEYDOWN:
+ event = L"WM_KEYDOWN";
+ wparam = StringPrintf(L"%d", p.wParam);
+ lparam = StringPrintf(L"%d", p.lParam);
+ break;
+ case WM_KEYUP:
+ event = L"WM_KEYDOWN";
+ wparam = StringPrintf(L"%d", p.wParam);
+ lparam = StringPrintf(L"%x", p.lParam);
+ break;
+ case WM_MOUSEMOVE:
+ event = L"WM_MOUSEMOVE";
+ if (p.wParam & MK_LBUTTON) {
+ wparam = L"MK_LBUTTON";
+ } else if (p.wParam & MK_MBUTTON) {
+ wparam = L"MK_MBUTTON";
+ } else if (p.wParam & MK_RBUTTON) {
+ wparam = L"MK_RBUTTON";
+ }
+ break;
+ case WM_LBUTTONDOWN:
+ event = L"WM_LBUTTONDOWN";
+ break;
+ case WM_MBUTTONDOWN:
+ event = L"WM_MBUTTONDOWN";
+ break;
+ case WM_RBUTTONDOWN:
+ event = L"WM_RBUTTONDOWN";
+ break;
+ case WM_LBUTTONUP:
+ event = L"WM_LBUTTONUP";
+ break;
+ case WM_MBUTTONUP:
+ event = L"WM_MBUTTONUP";
+ break;
+ case WM_RBUTTONUP:
+ event = L"WM_RBUTTONUP";
+ break;
+ }
+
+ if (p.wParam & MK_CONTROL) {
+ if (!wparam.empty())
+ wparam += L" ";
+ wparam += L"MK_CONTROL";
+ }
+
+ if (p.wParam & MK_SHIFT) {
+ if (!wparam.empty())
+ wparam += L" ";
+ wparam += L"MK_SHIFT";
+ }
+
+ l->append(L"(");
+ LogParam(event, l);
+ l->append(L", ");
+ LogParam(wparam, l);
+ l->append(L", ");
+ LogParam(lparam, l);
+ l->append(L")");
+ }
+};
+
+
+#define MESSAGES_INTERNAL_FILE "chrome/common/plugin_messages_internal.h"
+#include "chrome/common/ipc_message_macros.h"
#endif // CHROME_COMMON_PLUGIN_MESSAGES_H__
diff --git a/chrome/common/plugin_messages_internal.h b/chrome/common/plugin_messages_internal.h
index 85093d5..d8561d0 100644
--- a/chrome/common/plugin_messages_internal.h
+++ b/chrome/common/plugin_messages_internal.h
@@ -9,7 +9,7 @@
//-----------------------------------------------------------------------------
// PluginProcess messages
// These are messages sent from the browser to the plugin process.
-IPC_BEGIN_MESSAGES(PluginProcess, 3)
+IPC_BEGIN_MESSAGES(PluginProcess)
// Tells the plugin process to create a new channel for communication with a
// renderer. The channel name is returned in a
// PluginProcessHostMsg_ChannelCreated message.
@@ -35,7 +35,7 @@ IPC_END_MESSAGES(PluginProcess)
//-----------------------------------------------------------------------------
// PluginProcessHost messages
// These are messages sent from the plugin process to the browser process.
-IPC_BEGIN_MESSAGES(PluginProcessHost, 4)
+IPC_BEGIN_MESSAGES(PluginProcessHost)
// Response to a PluginProcessMsg_CreateChannel message.
IPC_MESSAGE_CONTROL2(PluginProcessHostMsg_ChannelCreated,
int /* process_id */,
@@ -92,7 +92,7 @@ IPC_END_MESSAGES(PluginProcessHost)
//-----------------------------------------------------------------------------
// Plugin messages
// These are messages sent from the renderer process to the plugin process.
-IPC_BEGIN_MESSAGES(Plugin, 5)
+IPC_BEGIN_MESSAGES(Plugin)
// Tells the plugin process to create a new plugin instance with the given
// id. A corresponding WebPluginDelegateStub is created which hosts the
// WebPluginDelegateImpl.
@@ -202,7 +202,7 @@ IPC_END_MESSAGES(Plugin)
// PluginHost messages
// These are messages sent from the plugin process to the renderer process.
// They all map to the corresponding WebPlugin methods.
-IPC_BEGIN_MESSAGES(PluginHost, 6)
+IPC_BEGIN_MESSAGES(PluginHost)
// Sends the plugin window information to the renderer.
// The window parameter is a handle to the window if the plugin is a windowed
// plugin. It is NULL for windowless plugins.
@@ -274,7 +274,7 @@ IPC_END_MESSAGES(PluginHost)
// NPObject messages
// These are messages used to marshall NPObjects. They are sent both from the
// plugin to the renderer and from the renderer to the plugin.
-IPC_BEGIN_MESSAGES(NPObject, 7)
+IPC_BEGIN_MESSAGES(NPObject)
IPC_SYNC_MESSAGE_ROUTED0_0(NPObjectMsg_Release)
IPC_SYNC_MESSAGE_ROUTED1_1(NPObjectMsg_HasMethod,
diff --git a/chrome/common/render_messages.cc b/chrome/common/render_messages.cc
deleted file mode 100644
index 55f21552..0000000
--- a/chrome/common/render_messages.cc
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/common/ipc_message.h"
-
-#ifdef IPC_MESSAGE_LOG_ENABLED
-
-// Preprocessor magic: render_messages.h defines the enums and debug string
-// functions if this define is set.
-#define IPC_MESSAGE_MACROS_LOG_ENABLED
-
-#endif // IPC_MESSAGE_LOG_ENABLED
-
-#include "chrome/common/render_messages.h"
-
-void RenderMessagesInit() {
-#ifdef IPC_MESSAGE_LOG_ENABLED
- IPC::RegisterMessageLogger(ViewStart, ViewMsgLog);
- IPC::RegisterMessageLogger(ViewHostStart, ViewHostMsgLog);
-#endif
-}
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h
index 95c7e6d..c33d63e 100644
--- a/chrome/common/render_messages.h
+++ b/chrome/common/render_messages.h
@@ -15,7 +15,6 @@
#include "base/shared_memory.h"
#include "chrome/common/bitmap_wire_data.h"
#include "chrome/common/filter_policy.h"
-#include "chrome/common/ipc_message.h"
#include "chrome/common/ipc_message_utils.h"
#include "chrome/common/modal_dialog_event.h"
#include "chrome/common/page_transition_types.h"
@@ -31,6 +30,7 @@
#include "webkit/glue/resource_loader_bridge.h"
#include "webkit/glue/screen_info.h"
#include "webkit/glue/webdropdata.h"
+#include "webkit/glue/webinputevent.h"
#include "webkit/glue/webplugin.h"
#include "webkit/glue/webpreferences.h"
#include "webkit/glue/webview_delegate.h"
@@ -66,8 +66,43 @@ struct ViewMsg_Navigate_Params {
bool reload;
};
-// Parameters structure for ViewHostMsg_FrameNavigate, which has too many data
-// parameters to be reasonably put in a predefined IPC message.
+// Traits for ViewMsg_Navigate_Params structure to pack/unpack.
+template <>
+struct ParamTraits<ViewMsg_Navigate_Params> {
+ typedef ViewMsg_Navigate_Params param_type;
+ static void Write(IPC::Message* m, const param_type& p) {
+ WriteParam(m, p.page_id);
+ WriteParam(m, p.url);
+ WriteParam(m, p.referrer);
+ WriteParam(m, p.transition);
+ WriteParam(m, p.state);
+ WriteParam(m, p.reload);
+ }
+ static bool Read(const IPC::Message* m, void** iter, param_type* p) {
+ return
+ ReadParam(m, iter, &p->page_id) &&
+ ReadParam(m, iter, &p->url) &&
+ ReadParam(m, iter, &p->referrer) &&
+ ReadParam(m, iter, &p->transition) &&
+ ReadParam(m, iter, &p->state) &&
+ ReadParam(m, iter, &p->reload);
+ }
+ 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.reload, l);
+ l->append(L")");
+ }
+};
+
+
struct ViewHostMsg_FrameNavigate_Params {
// Page ID of this navigation. The renderer creates a new unique page ID
// anytime a new session history entry is created. This means you'll get new
@@ -121,8 +156,80 @@ struct ViewHostMsg_FrameNavigate_Params {
bool is_content_filtered;
};
-// Parameters structure for ViewHostMsg_ContextMenu, which has too many data
-// parameters to be reasonably put in a predefined IPC message.
+template <>
+struct ParamTraits<ViewHostMsg_FrameNavigate_Params> {
+ typedef ViewHostMsg_FrameNavigate_Params param_type;
+ static void Write(IPC::Message* m, const param_type& p) {
+ WriteParam(m, p.page_id);
+ WriteParam(m, p.url);
+ WriteParam(m, p.referrer);
+ WriteParam(m, p.transition);
+ WriteParam(m, p.redirects);
+ WriteParam(m, p.should_update_history);
+ WriteParam(m, p.searchable_form_url);
+ WriteParam(m, p.searchable_form_element_name);
+ WriteParam(m, p.searchable_form_encoding);
+ WriteParam(m, p.password_form);
+ WriteParam(m, p.security_info);
+ WriteParam(m, p.gesture);
+ WriteParam(m, p.contents_mime_type);
+ WriteParam(m, p.is_post);
+ WriteParam(m, p.is_content_filtered);
+ }
+ static bool Read(const IPC::Message* m, void** iter, param_type* p) {
+ return
+ ReadParam(m, iter, &p->page_id) &&
+ ReadParam(m, iter, &p->url) &&
+ ReadParam(m, iter, &p->referrer) &&
+ ReadParam(m, iter, &p->transition) &&
+ ReadParam(m, iter, &p->redirects) &&
+ ReadParam(m, iter, &p->should_update_history) &&
+ ReadParam(m, iter, &p->searchable_form_url) &&
+ ReadParam(m, iter, &p->searchable_form_element_name) &&
+ ReadParam(m, iter, &p->searchable_form_encoding) &&
+ ReadParam(m, iter, &p->password_form) &&
+ ReadParam(m, iter, &p->security_info) &&
+ ReadParam(m, iter, &p->gesture) &&
+ ReadParam(m, iter, &p->contents_mime_type) &&
+ ReadParam(m, iter, &p->is_post) &&
+ ReadParam(m, iter, &p->is_content_filtered);
+ }
+ 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.referrer, l);
+ l->append(L", ");
+ LogParam(p.transition, l);
+ l->append(L", ");
+ LogParam(p.redirects, l);
+ l->append(L", ");
+ LogParam(p.should_update_history, l);
+ l->append(L", ");
+ LogParam(p.searchable_form_url, l);
+ l->append(L", ");
+ LogParam(p.searchable_form_element_name, l);
+ l->append(L", ");
+ LogParam(p.searchable_form_encoding, l);
+ l->append(L", ");
+ LogParam(p.password_form, l);
+ l->append(L", ");
+ LogParam(p.security_info, l);
+ l->append(L", ");
+ LogParam(p.gesture, l);
+ l->append(L", ");
+ LogParam(p.contents_mime_type, l);
+ l->append(L", ");
+ LogParam(p.is_post, l);
+ l->append(L", ");
+ LogParam(p.is_content_filtered, l);
+ l->append(L")");
+ }
+};
+
+
// FIXME(beng): This would be more useful in the future and more efficient
// if the parameters here weren't so literally mapped to what
// they contain for the ContextMenu task. It might be better
@@ -176,6 +283,45 @@ struct ViewHostMsg_ContextMenu_Params {
std::string security_info;
};
+template <>
+struct ParamTraits<ViewHostMsg_ContextMenu_Params> {
+ typedef ViewHostMsg_ContextMenu_Params param_type;
+ static void Write(IPC::Message* m, const param_type& p) {
+ WriteParam(m, p.node);
+ WriteParam(m, p.x);
+ WriteParam(m, p.y);
+ WriteParam(m, p.link_url);
+ WriteParam(m, p.image_url);
+ WriteParam(m, p.page_url);
+ WriteParam(m, p.frame_url);
+ WriteParam(m, p.selection_text);
+ WriteParam(m, p.misspelled_word);
+ WriteParam(m, p.dictionary_suggestions);
+ WriteParam(m, p.spellcheck_enabled);
+ WriteParam(m, p.edit_flags);
+ WriteParam(m, p.security_info);
+ }
+ static bool Read(const IPC::Message* m, void** iter, param_type* p) {
+ return
+ ReadParam(m, iter, &p->node) &&
+ ReadParam(m, iter, &p->x) &&
+ ReadParam(m, iter, &p->y) &&
+ ReadParam(m, iter, &p->link_url) &&
+ ReadParam(m, iter, &p->image_url) &&
+ ReadParam(m, iter, &p->page_url) &&
+ ReadParam(m, iter, &p->frame_url) &&
+ 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->edit_flags) &&
+ ReadParam(m, iter, &p->security_info);
+ }
+ static void Log(const param_type& p, std::wstring* l) {
+ l->append(L"<ViewHostMsg_ContextMenu_Params>");
+ }
+};
+
// Values that may be OR'd together to form the 'flags' parameter of a
// ViewHostMsg_PaintRect message.
struct ViewHostMsg_PaintRect_Flags {
@@ -227,8 +373,40 @@ struct ViewHostMsg_PaintRect_Params {
int flags;
};
-// Parameters structure for ViewHostMsg_ScrollRect, which has too many data
-// parameters to be reasonably put in a predefined IPC message.
+template <>
+struct ParamTraits<ViewHostMsg_PaintRect_Params> {
+ typedef ViewHostMsg_PaintRect_Params param_type;
+ static void Write(IPC::Message* m, const param_type& p) {
+ WriteParam(m, p.bitmap);
+ WriteParam(m, p.bitmap_rect);
+ WriteParam(m, p.view_size);
+ WriteParam(m, p.plugin_window_moves);
+ WriteParam(m, p.flags);
+ }
+ static bool Read(const IPC::Message* m, void** iter, param_type* p) {
+ return
+ ReadParam(m, iter, &p->bitmap) &&
+ ReadParam(m, iter, &p->bitmap_rect) &&
+ 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.view_size, l);
+ l->append(L", ");
+ LogParam(p.plugin_window_moves, l);
+ l->append(L", ");
+ LogParam(p.flags, l);
+ l->append(L")");
+ }
+};
+
+
struct ViewHostMsg_ScrollRect_Params {
// The bitmap to be painted into the rect exposed by scrolling.
BitmapWireData bitmap;
@@ -250,7 +428,48 @@ struct ViewHostMsg_ScrollRect_Params {
std::vector<WebPluginGeometry> plugin_window_moves;
};
-// Parameters structure for ViewMsg_UploadFile.
+template <>
+struct ParamTraits<ViewHostMsg_ScrollRect_Params> {
+ typedef ViewHostMsg_ScrollRect_Params param_type;
+ static void Write(IPC::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.clip_rect);
+ WriteParam(m, p.view_size);
+ WriteParam(m, p.plugin_window_moves);
+ }
+ static bool Read(const IPC::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->clip_rect) &&
+ ReadParam(m, iter, &p->view_size) &&
+ ReadParam(m, iter, &p->plugin_window_moves);
+ }
+ 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.clip_rect, l);
+ l->append(L", ");
+ LogParam(p.view_size, l);
+ l->append(L", ");
+ LogParam(p.plugin_window_moves, l);
+ l->append(L")");
+ }
+};
+
+
struct ViewMsg_UploadFile_Params {
// See WebContents::StartFileUpload for a description of these fields.
std::wstring file_path;
@@ -260,7 +479,30 @@ struct ViewMsg_UploadFile_Params {
std::wstring other_values;
};
-// Parameters for a resource request.
+template <>
+struct ParamTraits<ViewMsg_UploadFile_Params> {
+ typedef ViewMsg_UploadFile_Params param_type;
+ static void Write(IPC::Message* m, const param_type& p) {
+ WriteParam(m, p.file_path);
+ WriteParam(m, p.form);
+ WriteParam(m, p.file);
+ WriteParam(m, p.submit);
+ WriteParam(m, p.other_values);
+ }
+ static bool Read(const IPC::Message* m, void** iter, param_type* p) {
+ return
+ ReadParam(m, iter, &p->file_path) &&
+ ReadParam(m, iter, &p->form) &&
+ ReadParam(m, iter, &p->file) &&
+ ReadParam(m, iter, &p->submit) &&
+ ReadParam(m, iter, &p->other_values);
+ }
+ static void Log(const param_type& p, std::wstring* l) {
+ l->append(L"<ViewMsg_UploadFile_Params>");
+ }
+};
+
+
struct ViewHostMsg_Resource_Request {
// The request method: GET, POST, etc.
std::string method;
@@ -302,7 +544,58 @@ struct ViewHostMsg_Resource_Request {
std::vector<net::UploadData::Element> upload_content;
};
-// Parameters for a resource response header.
+template <>
+struct ParamTraits<ViewHostMsg_Resource_Request> {
+ typedef ViewHostMsg_Resource_Request param_type;
+ static void Write(IPC::Message* m, const param_type& p) {
+ WriteParam(m, p.method);
+ WriteParam(m, p.url);
+ WriteParam(m, p.policy_url);
+ WriteParam(m, p.referrer);
+ WriteParam(m, p.headers);
+ WriteParam(m, p.load_flags);
+ WriteParam(m, p.origin_pid);
+ WriteParam(m, p.resource_type);
+ WriteParam(m, p.mixed_content);
+ WriteParam(m, p.request_context);
+ WriteParam(m, p.upload_content);
+ }
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
+ return
+ ReadParam(m, iter, &r->method) &&
+ ReadParam(m, iter, &r->url) &&
+ ReadParam(m, iter, &r->policy_url) &&
+ ReadParam(m, iter, &r->referrer) &&
+ ReadParam(m, iter, &r->headers) &&
+ ReadParam(m, iter, &r->load_flags) &&
+ ReadParam(m, iter, &r->origin_pid) &&
+ ReadParam(m, iter, &r->resource_type) &&
+ ReadParam(m, iter, &r->mixed_content) &&
+ ReadParam(m, iter, &r->request_context) &&
+ ReadParam(m, iter, &r->upload_content);
+ }
+ static void Log(const param_type& p, std::wstring* l) {
+ l->append(L"(");
+ LogParam(p.method, l);
+ l->append(L", ");
+ LogParam(p.url, l);
+ l->append(L", ");
+ LogParam(p.referrer, l);
+ l->append(L", ");
+ LogParam(p.load_flags, l);
+ l->append(L", ");
+ LogParam(p.origin_pid, l);
+ l->append(L", ");
+ LogParam(p.resource_type, l);
+ l->append(L", ");
+ LogParam(p.mixed_content, l);
+ l->append(L", ");
+ LogParam(p.request_context, l);
+ l->append(L")");
+ }
+};
+
+
struct ViewMsg_Resource_ResponseHead
: webkit_glue::ResourceLoaderBridge::ResponseInfo {
// The response status.
@@ -313,7 +606,66 @@ struct ViewMsg_Resource_ResponseHead
FilterPolicy::Type filter_policy;
};
-// Parameters for a synchronous resource response.
+template <>
+struct ParamTraits<webkit_glue::ResourceLoaderBridge::ResponseInfo> {
+ typedef webkit_glue::ResourceLoaderBridge::ResponseInfo param_type;
+ static void Write(IPC::Message* m, const param_type& p) {
+ WriteParam(m, p.request_time);
+ WriteParam(m, p.response_time);
+ WriteParam(m, p.headers);
+ WriteParam(m, p.mime_type);
+ WriteParam(m, p.charset);
+ WriteParam(m, p.security_info);
+ WriteParam(m, p.content_length);
+ }
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
+ return
+ ReadParam(m, iter, &r->request_time) &&
+ ReadParam(m, iter, &r->response_time) &&
+ ReadParam(m, iter, &r->headers) &&
+ ReadParam(m, iter, &r->mime_type) &&
+ ReadParam(m, iter, &r->charset) &&
+ ReadParam(m, iter, &r->security_info) &&
+ ReadParam(m, iter, &r->content_length);
+ }
+ static void Log(const param_type& p, std::wstring* l) {
+ l->append(L"(");
+ LogParam(p.request_time, l);
+ l->append(L", ");
+ LogParam(p.response_time, l);
+ l->append(L", ");
+ LogParam(p.headers, l);
+ l->append(L", ");
+ LogParam(p.mime_type, l);
+ l->append(L", ");
+ LogParam(p.charset, l);
+ l->append(L", ");
+ LogParam(p.security_info, l);
+ l->append(L")");
+ }
+};
+
+template <>
+struct ParamTraits<ViewMsg_Resource_ResponseHead> {
+ typedef ViewMsg_Resource_ResponseHead param_type;
+ static void Write(IPC::Message* m, const param_type& p) {
+ ParamTraits<webkit_glue::ResourceLoaderBridge::ResponseInfo>::Write(m, p);
+ WriteParam(m, p.status);
+ WriteParam(m, p.filter_policy);
+ }
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
+ return
+ ParamTraits<webkit_glue::ResourceLoaderBridge::ResponseInfo>::Read(m, iter, r) &&
+ ReadParam(m, iter, &r->status) &&
+ ReadParam(m, iter, &r->filter_policy);
+ }
+ static void Log(const param_type& p, std::wstring* l) {
+ // log more?
+ ParamTraits<webkit_glue::ResourceLoaderBridge::ResponseInfo>::Log(p, l);
+ }
+};
+
+
struct ViewHostMsg_SyncLoad_Result : ViewMsg_Resource_ResponseHead {
// The final URL after any redirects.
GURL final_url;
@@ -322,7 +674,27 @@ struct ViewHostMsg_SyncLoad_Result : ViewMsg_Resource_ResponseHead {
std::string data;
};
-// Parameters for a render request.
+template <>
+struct ParamTraits<ViewHostMsg_SyncLoad_Result> {
+ typedef ViewHostMsg_SyncLoad_Result param_type;
+ static void Write(IPC::Message* m, const param_type& p) {
+ ParamTraits<ViewMsg_Resource_ResponseHead>::Write(m, p);
+ WriteParam(m, p.final_url);
+ WriteParam(m, p.data);
+ }
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
+ return
+ ParamTraits<ViewMsg_Resource_ResponseHead>::Read(m, iter, r) &&
+ ReadParam(m, iter, &r->final_url) &&
+ ReadParam(m, iter, &r->data);
+ }
+ static void Log(const param_type& p, std::wstring* l) {
+ // log more?
+ ParamTraits<webkit_glue::ResourceLoaderBridge::ResponseInfo>::Log(p, l);
+ }
+};
+
+
struct ViewMsg_Print_Params {
// In pixels according to dpi_x and dpi_y.
gfx::Size printable_size;
@@ -352,6 +724,31 @@ struct ViewMsg_Print_Params {
}
};
+template <>
+struct ParamTraits<ViewMsg_Print_Params> {
+ typedef ViewMsg_Print_Params param_type;
+ static void Write(IPC::Message* m, const param_type& p) {
+ WriteParam(m, p.printable_size);
+ WriteParam(m, p.dpi);
+ WriteParam(m, p.min_shrink);
+ WriteParam(m, p.max_shrink);
+ WriteParam(m, p.desired_dpi);
+ WriteParam(m, p.document_cookie);
+ }
+ static bool Read(const IPC::Message* m, void** iter, param_type* p) {
+ return ReadParam(m, iter, &p->printable_size) &&
+ ReadParam(m, iter, &p->dpi) &&
+ ReadParam(m, iter, &p->min_shrink) &&
+ ReadParam(m, iter, &p->max_shrink) &&
+ ReadParam(m, iter, &p->desired_dpi) &&
+ ReadParam(m, iter, &p->document_cookie);
+ }
+ static void Log(const param_type& p, std::wstring* l) {
+ l->append(L"<ViewMsg_Print_Params>");
+ }
+};
+
+
struct ViewMsg_PrintPage_Params {
// Parameters to render the page as a printed page. It must always be the same
// value for all the document.
@@ -362,6 +759,23 @@ struct ViewMsg_PrintPage_Params {
int page_number;
};
+template <>
+struct ParamTraits<ViewMsg_PrintPage_Params> {
+ typedef ViewMsg_PrintPage_Params param_type;
+ static void Write(IPC::Message* m, const param_type& p) {
+ WriteParam(m, p.params);
+ WriteParam(m, p.page_number);
+ }
+ static bool Read(const IPC::Message* m, void** iter, param_type* p) {
+ return ReadParam(m, iter, &p->params) &&
+ ReadParam(m, iter, &p->page_number);
+ }
+ static void Log(const param_type& p, std::wstring* l) {
+ l->append(L"<ViewMsg_PrintPage_Params>");
+ }
+};
+
+
struct ViewMsg_PrintPages_Params {
// Parameters to render the page as a printed page. It must always be the same
// value for all the document.
@@ -371,6 +785,23 @@ struct ViewMsg_PrintPages_Params {
std::vector<int> pages;
};
+template <>
+struct ParamTraits<ViewMsg_PrintPages_Params> {
+ typedef ViewMsg_PrintPages_Params param_type;
+ static void Write(IPC::Message* m, const param_type& p) {
+ WriteParam(m, p.params);
+ WriteParam(m, p.pages);
+ }
+ static bool Read(const IPC::Message* m, void** iter, param_type* p) {
+ return ReadParam(m, iter, &p->params) &&
+ ReadParam(m, iter, &p->pages);
+ }
+ static void Log(const param_type& p, std::wstring* l) {
+ l->append(L"<ViewMsg_PrintPages_Params>");
+ }
+};
+
+
// Parameters to describe a rendered page.
struct ViewHostMsg_DidPrintPage_Params {
// A shared memory handle to the EMF data. This data can be quite large so a
@@ -390,6 +821,29 @@ struct ViewHostMsg_DidPrintPage_Params {
double actual_shrink;
};
+template <>
+struct ParamTraits<ViewHostMsg_DidPrintPage_Params> {
+ typedef ViewHostMsg_DidPrintPage_Params param_type;
+ static void Write(IPC::Message* m, const param_type& p) {
+ WriteParam(m, p.emf_data_handle);
+ WriteParam(m, p.data_size);
+ WriteParam(m, p.document_cookie);
+ WriteParam(m, p.page_number);
+ WriteParam(m, p.actual_shrink);
+ }
+ static bool Read(const IPC::Message* m, void** iter, param_type* p) {
+ return ReadParam(m, iter, &p->emf_data_handle) &&
+ ReadParam(m, iter, &p->data_size) &&
+ ReadParam(m, iter, &p->document_cookie) &&
+ ReadParam(m, iter, &p->page_number) &&
+ ReadParam(m, iter, &p->actual_shrink);
+ }
+ static void Log(const param_type& p, std::wstring* l) {
+ l->append(L"<ViewHostMsg_DidPrintPage_Params>");
+ }
+};
+
+
// Parameters structure to hold a union of the possible IAccessible function
// INPUT variables, with the unused fields always set to default value. Used in
// ViewMsg_GetAccessibilityInfo, as only parameter.
@@ -410,6 +864,40 @@ struct ViewMsg_Accessibility_In_Params {
long input_long2;
};
+template <>
+struct ParamTraits<ViewMsg_Accessibility_In_Params> {
+ typedef ViewMsg_Accessibility_In_Params param_type;
+ static void Write(IPC::Message* m, const param_type& p) {
+ WriteParam(m, p.iaccessible_id);
+ WriteParam(m, p.iaccessible_function_id);
+ WriteParam(m, p.input_variant_lval);
+ WriteParam(m, p.input_long1);
+ WriteParam(m, p.input_long2);
+ }
+ static bool Read(const IPC::Message* m, void** iter, param_type* p) {
+ return
+ ReadParam(m, iter, &p->iaccessible_id) &&
+ ReadParam(m, iter, &p->iaccessible_function_id) &&
+ ReadParam(m, iter, &p->input_variant_lval) &&
+ ReadParam(m, iter, &p->input_long1) &&
+ ReadParam(m, iter, &p->input_long2);
+ }
+ static void Log(const param_type& p, std::wstring* l) {
+ l->append(L"(");
+ LogParam(p.iaccessible_id, l);
+ l->append(L", ");
+ LogParam(p.iaccessible_function_id, l);
+ l->append(L", ");
+ LogParam(p.input_variant_lval, l);
+ l->append(L", ");
+ LogParam(p.input_long1, l);
+ l->append(L", ");
+ LogParam(p.input_long2, l);
+ l->append(L")");
+ }
+};
+
+
// Parameters structure to hold a union of the possible IAccessible function
// OUTPUT variables, with the unused fields always set to default value. Used in
// ViewHostMsg_GetAccessibilityInfoResponse, as only parameter.
@@ -439,6 +927,52 @@ struct ViewHostMsg_Accessibility_Out_Params {
bool return_code;
};
+template <>
+struct ParamTraits<ViewHostMsg_Accessibility_Out_Params> {
+ typedef ViewHostMsg_Accessibility_Out_Params param_type;
+ static void Write(IPC::Message* m, const param_type& p) {
+ WriteParam(m, p.iaccessible_id);
+ WriteParam(m, p.output_variant_lval);
+ WriteParam(m, p.output_long1);
+ WriteParam(m, p.output_long2);
+ WriteParam(m, p.output_long3);
+ WriteParam(m, p.output_long4);
+ WriteParam(m, p.output_string);
+ WriteParam(m, p.return_code);
+ }
+ static bool Read(const IPC::Message* m, void** iter, param_type* p) {
+ return
+ ReadParam(m, iter, &p->iaccessible_id) &&
+ ReadParam(m, iter, &p->output_variant_lval) &&
+ ReadParam(m, iter, &p->output_long1) &&
+ ReadParam(m, iter, &p->output_long2) &&
+ ReadParam(m, iter, &p->output_long3) &&
+ ReadParam(m, iter, &p->output_long4) &&
+ ReadParam(m, iter, &p->output_string) &&
+ ReadParam(m, iter, &p->return_code);
+ }
+ static void Log(const param_type& p, std::wstring* l) {
+ l->append(L"(");
+ LogParam(p.iaccessible_id, l);
+ l->append(L", ");
+ LogParam(p.output_variant_lval, l);
+ l->append(L", ");
+ LogParam(p.output_long1, l);
+ l->append(L", ");
+ LogParam(p.output_long2, l);
+ l->append(L", ");
+ LogParam(p.output_long3, l);
+ l->append(L", ");
+ LogParam(p.output_long4, l);
+ l->append(L", ");
+ LogParam(p.output_string, l);
+ l->append(L", ");
+ LogParam(p.return_code, l);
+ l->append(L")");
+ }
+};
+
+
// The first parameter for the ViewHostMsg_ImeUpdateStatus message.
enum ViewHostMsg_ImeControl {
IME_DISABLE = 0,
@@ -446,38 +980,49 @@ enum ViewHostMsg_ImeControl {
IME_COMPLETE_COMPOSITION,
};
-// Multi-pass include of render_messages_internal. Preprocessor magic allows
-// us to use 1 header to define the enums and classes for our render messages.
-#define IPC_MESSAGE_MACROS_ENUMS
-#include "chrome/common/render_messages_internal.h"
-
-#ifdef IPC_MESSAGE_MACROS_LOG_ENABLED
-// When we are supposed to create debug strings, we run it through twice, once
-// with debug strings on, and once with only CLASSES on to generate both types
-// of messages.
-# undef IPC_MESSAGE_MACROS_LOG
-# define IPC_MESSAGE_MACROS_CLASSES
-# include "chrome/common/render_messages_internal.h"
-
-# undef IPC_MESSAGE_MACROS_CLASSES
-# define IPC_MESSAGE_MACROS_LOG
-# include "chrome/common/render_messages_internal.h"
-#else
-// No debug strings requested, just define the classes
-# define IPC_MESSAGE_MACROS_CLASSES
-# include "chrome/common/render_messages_internal.h"
-#endif
+template <>
+struct ParamTraits<ViewHostMsg_ImeControl> {
+ typedef ViewHostMsg_ImeControl param_type;
+ static void Write(IPC::Message* m, const param_type& p) {
+ m->WriteInt(p);
+ }
+ static bool Read(const IPC::Message* m, void** iter, param_type* p) {
+ int type;
+ if (!m->ReadInt(iter, &type))
+ return false;
+ *p = static_cast<ViewHostMsg_ImeControl>(type);
+ return true;
+ }
+ static void Log(const param_type& p, std::wstring* l) {
+ std::wstring control;
+ switch (p) {
+ case IME_DISABLE:
+ control = L"IME_DISABLE";
+ break;
+ case IME_MOVE_WINDOWS:
+ control = L"IME_MOVE_WINDOWS";
+ break;
+ case IME_COMPLETE_COMPOSITION:
+ control = L"IME_COMPLETE_COMPOSITION";
+ break;
+ default:
+ control = L"UNKNOWN";
+ break;
+ }
+ LogParam(control, l);
+ }
+};
-namespace IPC {
+// These traits are for structures that are defined outside of this file.
template <>
struct ParamTraits<ResourceType::Type> {
typedef ResourceType::Type param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
m->WriteInt(p);
}
- static bool Read(const Message* m, void** iter, param_type* p) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* p) {
int type;
if (!m->ReadInt(iter, &type) || !ResourceType::ValidType(type))
return false;
@@ -511,10 +1056,10 @@ struct ParamTraits<ResourceType::Type> {
template <>
struct ParamTraits<FilterPolicy::Type> {
typedef FilterPolicy::Type param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
m->WriteInt(p);
}
- static bool Read(const Message* m, void** iter, param_type* p) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* p) {
int type;
if (!m->ReadInt(iter, &type) || !FilterPolicy::ValidType(type))
return false;
@@ -545,10 +1090,10 @@ struct ParamTraits<FilterPolicy::Type> {
template <>
struct ParamTraits<ContextNode> {
typedef ContextNode param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
m->WriteInt(p.type);
}
- static bool Read(const Message* m, void** iter, param_type* p) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* p) {
int type;
if (!m->ReadInt(iter, &type))
return false;
@@ -586,10 +1131,10 @@ struct ParamTraits<ContextNode> {
template <>
struct ParamTraits<WebInputEvent::Type> {
typedef WebInputEvent::Type param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
m->WriteInt(p);
}
- static bool Read(const Message* m, void** iter, param_type* p) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* p) {
int type;
if (!m->ReadInt(iter, &type))
return false;
@@ -632,161 +1177,10 @@ struct ParamTraits<WebInputEvent::Type> {
}
};
-// Traits for ViewMsg_Accessibility_In_Params structure to pack/unpack.
-template <>
-struct ParamTraits<ViewMsg_Accessibility_In_Params> {
- typedef ViewMsg_Accessibility_In_Params param_type;
- static void Write(Message* m, const param_type& p) {
- WriteParam(m, p.iaccessible_id);
- WriteParam(m, p.iaccessible_function_id);
- WriteParam(m, p.input_variant_lval);
- WriteParam(m, p.input_long1);
- WriteParam(m, p.input_long2);
- }
- static bool Read(const Message* m, void** iter, param_type* p) {
- return
- ReadParam(m, iter, &p->iaccessible_id) &&
- ReadParam(m, iter, &p->iaccessible_function_id) &&
- ReadParam(m, iter, &p->input_variant_lval) &&
- ReadParam(m, iter, &p->input_long1) &&
- ReadParam(m, iter, &p->input_long2);
- }
- static void Log(const param_type& p, std::wstring* l) {
- l->append(L"(");
- LogParam(p.iaccessible_id, l);
- l->append(L", ");
- LogParam(p.iaccessible_function_id, l);
- l->append(L", ");
- LogParam(p.input_variant_lval, l);
- l->append(L", ");
- LogParam(p.input_long1, l);
- l->append(L", ");
- LogParam(p.input_long2, l);
- l->append(L")");
- }
-};
-
-// Traits for ViewHostMsg_Accessibility_Out_Params structure to pack/unpack.
-template <>
-struct ParamTraits<ViewHostMsg_Accessibility_Out_Params> {
- typedef ViewHostMsg_Accessibility_Out_Params param_type;
- static void Write(Message* m, const param_type& p) {
- WriteParam(m, p.iaccessible_id);
- WriteParam(m, p.output_variant_lval);
- WriteParam(m, p.output_long1);
- WriteParam(m, p.output_long2);
- WriteParam(m, p.output_long3);
- WriteParam(m, p.output_long4);
- WriteParam(m, p.output_string);
- WriteParam(m, p.return_code);
- }
- static bool Read(const Message* m, void** iter, param_type* p) {
- return
- ReadParam(m, iter, &p->iaccessible_id) &&
- ReadParam(m, iter, &p->output_variant_lval) &&
- ReadParam(m, iter, &p->output_long1) &&
- ReadParam(m, iter, &p->output_long2) &&
- ReadParam(m, iter, &p->output_long3) &&
- ReadParam(m, iter, &p->output_long4) &&
- ReadParam(m, iter, &p->output_string) &&
- ReadParam(m, iter, &p->return_code);
- }
- static void Log(const param_type& p, std::wstring* l) {
- l->append(L"(");
- LogParam(p.iaccessible_id, l);
- l->append(L", ");
- LogParam(p.output_variant_lval, l);
- l->append(L", ");
- LogParam(p.output_long1, l);
- l->append(L", ");
- LogParam(p.output_long2, l);
- l->append(L", ");
- LogParam(p.output_long3, l);
- l->append(L", ");
- LogParam(p.output_long4, l);
- l->append(L", ");
- LogParam(p.output_string, l);
- l->append(L", ");
- LogParam(p.return_code, l);
- l->append(L")");
- }
-};
-
-template <>
-struct ParamTraits<ViewHostMsg_ImeControl> {
- typedef ViewHostMsg_ImeControl param_type;
- static void Write(Message* m, const param_type& p) {
- m->WriteInt(p);
- }
- static bool Read(const Message* m, void** iter, param_type* p) {
- int type;
- if (!m->ReadInt(iter, &type))
- return false;
- *p = static_cast<ViewHostMsg_ImeControl>(type);
- return true;
- }
- static void Log(const param_type& p, std::wstring* l) {
- std::wstring control;
- switch (p) {
- case IME_DISABLE:
- control = L"IME_DISABLE";
- break;
- case IME_MOVE_WINDOWS:
- control = L"IME_MOVE_WINDOWS";
- break;
- case IME_COMPLETE_COMPOSITION:
- control = L"IME_COMPLETE_COMPOSITION";
- break;
- default:
- control = L"UNKNOWN";
- break;
- }
-
- LogParam(control, l);
- }
-};
-
-// Traits for ViewMsg_Navigate_Params structure to pack/unpack.
-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.url);
- WriteParam(m, p.referrer);
- WriteParam(m, p.transition);
- WriteParam(m, p.state);
- WriteParam(m, p.reload);
- }
- static bool Read(const Message* m, void** iter, param_type* p) {
- return
- ReadParam(m, iter, &p->page_id) &&
- ReadParam(m, iter, &p->url) &&
- ReadParam(m, iter, &p->referrer) &&
- ReadParam(m, iter, &p->transition) &&
- ReadParam(m, iter, &p->state) &&
- ReadParam(m, iter, &p->reload);
- }
- 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.reload, l);
- l->append(L")");
- }
-};
-
-// Traits for PasswordForm_Params structure to pack/unpack.
template <>
struct ParamTraits<PasswordForm> {
typedef PasswordForm param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
WriteParam(m, p.signon_realm);
WriteParam(m, p.origin);
WriteParam(m, p.action);
@@ -801,7 +1195,7 @@ struct ParamTraits<PasswordForm> {
WriteParam(m, p.preferred);
WriteParam(m, p.blacklisted_by_user);
}
- static bool Read(const Message* m, void** iter, param_type* p) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* p) {
return
ReadParam(m, iter, &p->signon_realm) &&
ReadParam(m, iter, &p->origin) &&
@@ -822,11 +1216,10 @@ struct ParamTraits<PasswordForm> {
}
};
-// Traits for AutofillForm_Params structure to pack/unpack.
template <>
struct ParamTraits<AutofillForm> {
typedef AutofillForm param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
WriteParam(m, p.elements.size());
for (std::vector<AutofillForm::Element>::const_iterator itr =
p.elements.begin();
@@ -836,7 +1229,7 @@ struct ParamTraits<AutofillForm> {
WriteParam(m, itr->value);
}
}
- static bool Read(const Message* m, void** iter, param_type* p) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* p) {
bool result = true;
size_t elements_size = 0;
result = result && ReadParam(m, iter, &elements_size);
@@ -853,207 +1246,18 @@ struct ParamTraits<AutofillForm> {
}
};
-// Traits for ViewHostMsg_FrameNavigate_Params structure to pack/unpack.
-template <>
-struct ParamTraits<ViewHostMsg_FrameNavigate_Params> {
- typedef ViewHostMsg_FrameNavigate_Params param_type;
- static void Write(Message* m, const param_type& p) {
- WriteParam(m, p.page_id);
- WriteParam(m, p.url);
- WriteParam(m, p.referrer);
- WriteParam(m, p.transition);
- WriteParam(m, p.redirects);
- WriteParam(m, p.should_update_history);
- WriteParam(m, p.searchable_form_url);
- WriteParam(m, p.searchable_form_element_name);
- WriteParam(m, p.searchable_form_encoding);
- WriteParam(m, p.password_form);
- WriteParam(m, p.security_info);
- WriteParam(m, p.gesture);
- WriteParam(m, p.contents_mime_type);
- WriteParam(m, p.is_post);
- WriteParam(m, p.is_content_filtered);
- }
- static bool Read(const Message* m, void** iter, param_type* p) {
- return
- ReadParam(m, iter, &p->page_id) &&
- ReadParam(m, iter, &p->url) &&
- ReadParam(m, iter, &p->referrer) &&
- ReadParam(m, iter, &p->transition) &&
- ReadParam(m, iter, &p->redirects) &&
- ReadParam(m, iter, &p->should_update_history) &&
- ReadParam(m, iter, &p->searchable_form_url) &&
- ReadParam(m, iter, &p->searchable_form_element_name) &&
- ReadParam(m, iter, &p->searchable_form_encoding) &&
- ReadParam(m, iter, &p->password_form) &&
- ReadParam(m, iter, &p->security_info) &&
- ReadParam(m, iter, &p->gesture) &&
- ReadParam(m, iter, &p->contents_mime_type) &&
- ReadParam(m, iter, &p->is_post) &&
- ReadParam(m, iter, &p->is_content_filtered);
- }
- 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.referrer, l);
- l->append(L", ");
- LogParam(p.transition, l);
- l->append(L", ");
- LogParam(p.redirects, l);
- l->append(L", ");
- LogParam(p.should_update_history, l);
- l->append(L", ");
- LogParam(p.searchable_form_url, l);
- l->append(L", ");
- LogParam(p.searchable_form_element_name, l);
- l->append(L", ");
- LogParam(p.searchable_form_encoding, l);
- l->append(L", ");
- LogParam(p.password_form, l);
- l->append(L", ");
- LogParam(p.security_info, l);
- l->append(L", ");
- LogParam(p.gesture, l);
- l->append(L", ");
- LogParam(p.contents_mime_type, l);
- l->append(L", ");
- LogParam(p.is_post, l);
- l->append(L", ");
- LogParam(p.is_content_filtered, l);
- l->append(L")");
- }
-};
-
-// Traits for ViewHostMsg_ContextMenu_Params structure to pack/unpack.
-template <>
-struct ParamTraits<ViewHostMsg_ContextMenu_Params> {
- typedef ViewHostMsg_ContextMenu_Params param_type;
- static void Write(Message* m, const param_type& p) {
- WriteParam(m, p.node);
- WriteParam(m, p.x);
- WriteParam(m, p.y);
- WriteParam(m, p.link_url);
- WriteParam(m, p.image_url);
- WriteParam(m, p.page_url);
- WriteParam(m, p.frame_url);
- WriteParam(m, p.selection_text);
- WriteParam(m, p.misspelled_word);
- WriteParam(m, p.dictionary_suggestions);
- WriteParam(m, p.spellcheck_enabled);
- WriteParam(m, p.edit_flags);
- WriteParam(m, p.security_info);
- }
- static bool Read(const Message* m, void** iter, param_type* p) {
- return
- ReadParam(m, iter, &p->node) &&
- ReadParam(m, iter, &p->x) &&
- ReadParam(m, iter, &p->y) &&
- ReadParam(m, iter, &p->link_url) &&
- ReadParam(m, iter, &p->image_url) &&
- ReadParam(m, iter, &p->page_url) &&
- ReadParam(m, iter, &p->frame_url) &&
- 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->edit_flags) &&
- ReadParam(m, iter, &p->security_info);
- }
- static void Log(const param_type& p, std::wstring* l) {
- l->append(L"<ViewHostMsg_ContextMenu_Params>");
- }
-};
-
-// Traits for ViewHostMsg_PaintRect_Params structure to pack/unpack.
-template <>
-struct ParamTraits<ViewHostMsg_PaintRect_Params> {
- typedef ViewHostMsg_PaintRect_Params param_type;
- static void Write(Message* m, const param_type& p) {
- WriteParam(m, p.bitmap);
- WriteParam(m, p.bitmap_rect);
- 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->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.view_size, l);
- l->append(L", ");
- LogParam(p.plugin_window_moves, l);
- l->append(L", ");
- LogParam(p.flags, l);
- l->append(L")");
- }
-};
-
-// Traits for ViewHostMsg_ScrollRect_Params structure to pack/unpack.
-template <>
-struct ParamTraits<ViewHostMsg_ScrollRect_Params> {
- typedef ViewHostMsg_ScrollRect_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.clip_rect);
- WriteParam(m, p.view_size);
- WriteParam(m, p.plugin_window_moves);
- }
- 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->clip_rect) &&
- ReadParam(m, iter, &p->view_size) &&
- ReadParam(m, iter, &p->plugin_window_moves);
- }
- 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.clip_rect, l);
- l->append(L", ");
- LogParam(p.view_size, l);
- l->append(L", ");
- LogParam(p.plugin_window_moves, l);
- l->append(L")");
- }
-};
template <>
struct ParamTraits<WebPluginGeometry> {
typedef WebPluginGeometry param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::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.visible);
}
- static bool Read(const Message* m, void** iter, param_type* p) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* p) {
return
ReadParam(m, iter, &p->window) &&
ReadParam(m, iter, &p->window_rect) &&
@@ -1076,16 +1280,16 @@ struct ParamTraits<WebPluginGeometry> {
}
};
-// 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) {
+ static void Write(IPC::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) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
return
ReadParam(m, iter, &r->mime_type) &&
ReadParam(m, iter, &r->file_extensions) &&
@@ -1106,14 +1310,14 @@ struct ParamTraits<WebPluginMimeType> {
template <>
struct ParamTraits<WebPluginInfo> {
typedef WebPluginInfo param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::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);
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
return
ReadParam(m, iter, &r->name) &&
ReadParam(m, iter, &r->path) &&
@@ -1137,35 +1341,10 @@ struct ParamTraits<WebPluginInfo> {
}
};
-// Traits for ViewMsg_UploadFile_Params structure to pack/unpack.
-template <>
-struct ParamTraits<ViewMsg_UploadFile_Params> {
- typedef ViewMsg_UploadFile_Params param_type;
- static void Write(Message* m, const param_type& p) {
- WriteParam(m, p.file_path);
- WriteParam(m, p.form);
- WriteParam(m, p.file);
- WriteParam(m, p.submit);
- WriteParam(m, p.other_values);
- }
- static bool Read(const Message* m, void** iter, param_type* p) {
- return
- ReadParam(m, iter, &p->file_path) &&
- ReadParam(m, iter, &p->form) &&
- ReadParam(m, iter, &p->file) &&
- ReadParam(m, iter, &p->submit) &&
- ReadParam(m, iter, &p->other_values);
- }
- static void Log(const param_type& p, std::wstring* l) {
- l->append(L"<ViewMsg_UploadFile_Params>");
- }
-};
-
-// Traits for net::UploadData::Element.
template <>
struct ParamTraits<net::UploadData::Element> {
typedef net::UploadData::Element param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
WriteParam(m, static_cast<int>(p.type()));
if (p.type() == net::UploadData::TYPE_BYTES) {
m->WriteData(&p.bytes()[0], static_cast<int>(p.bytes().size()));
@@ -1175,7 +1354,7 @@ struct ParamTraits<net::UploadData::Element> {
WriteParam(m, p.file_range_length());
}
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
int type;
if (!ReadParam(m, iter, &type))
return false;
@@ -1204,18 +1383,17 @@ struct ParamTraits<net::UploadData::Element> {
}
};
-// Traits for CacheManager::UsageStats
template <>
struct ParamTraits<CacheManager::UsageStats> {
typedef CacheManager::UsageStats param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
WriteParam(m, p.min_dead_capacity);
WriteParam(m, p.max_dead_capacity);
WriteParam(m, p.capacity);
WriteParam(m, p.live_size);
WriteParam(m, p.dead_size);
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
return
ReadParam(m, iter, &r->min_dead_capacity) &&
ReadParam(m, iter, &r->max_dead_capacity) &&
@@ -1228,16 +1406,15 @@ struct ParamTraits<CacheManager::UsageStats> {
}
};
-// Traits for PasswordFormDomManager::FillData.
template <>
struct ParamTraits<PasswordFormDomManager::FillData> {
typedef PasswordFormDomManager::FillData param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::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) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
return
ReadParam(m, iter, &r->basic_data) &&
ReadParam(m, iter, &r->additional_logins) &&
@@ -1251,10 +1428,10 @@ struct ParamTraits<PasswordFormDomManager::FillData> {
template<>
struct ParamTraits<NavigationGesture> {
typedef NavigationGesture param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
m->WriteInt(p);
}
- static bool Read(const Message* m, void** iter, param_type* p) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* p) {
int type;
if (!m->ReadInt(iter, &type))
return false;
@@ -1278,67 +1455,14 @@ struct ParamTraits<NavigationGesture> {
}
};
-// Traits for ViewHostMsg_Resource_Request
-template <>
-struct ParamTraits<ViewHostMsg_Resource_Request> {
- typedef ViewHostMsg_Resource_Request param_type;
- static void Write(Message* m, const param_type& p) {
- WriteParam(m, p.method);
- WriteParam(m, p.url);
- WriteParam(m, p.policy_url);
- WriteParam(m, p.referrer);
- WriteParam(m, p.headers);
- WriteParam(m, p.load_flags);
- WriteParam(m, p.origin_pid);
- WriteParam(m, p.resource_type);
- WriteParam(m, p.mixed_content);
- WriteParam(m, p.request_context);
- WriteParam(m, p.upload_content);
- }
- static bool Read(const Message* m, void** iter, param_type* r) {
- return
- ReadParam(m, iter, &r->method) &&
- ReadParam(m, iter, &r->url) &&
- ReadParam(m, iter, &r->policy_url) &&
- ReadParam(m, iter, &r->referrer) &&
- ReadParam(m, iter, &r->headers) &&
- ReadParam(m, iter, &r->load_flags) &&
- ReadParam(m, iter, &r->origin_pid) &&
- ReadParam(m, iter, &r->resource_type) &&
- ReadParam(m, iter, &r->mixed_content) &&
- ReadParam(m, iter, &r->request_context) &&
- ReadParam(m, iter, &r->upload_content);
- }
- static void Log(const param_type& p, std::wstring* l) {
- l->append(L"(");
- LogParam(p.method, l);
- l->append(L", ");
- LogParam(p.url, l);
- l->append(L", ");
- LogParam(p.referrer, l);
- l->append(L", ");
- LogParam(p.load_flags, l);
- l->append(L", ");
- LogParam(p.origin_pid, l);
- l->append(L", ");
- LogParam(p.resource_type, l);
- l->append(L", ");
- LogParam(p.mixed_content, l);
- l->append(L", ");
- LogParam(p.request_context, l);
- l->append(L")");
- }
-};
-
-// Traits for URLRequestStatus
template <>
struct ParamTraits<URLRequestStatus> {
typedef URLRequestStatus param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
WriteParam(m, static_cast<int>(p.status()));
WriteParam(m, p.os_error());
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
int status, os_error;
if (!ReadParam(m, iter, &status) ||
!ReadParam(m, iter, &os_error))
@@ -1385,14 +1509,14 @@ struct ParamTraits<URLRequestStatus> {
template <>
struct ParamTraits<scoped_refptr<net::HttpResponseHeaders> > {
typedef scoped_refptr<net::HttpResponseHeaders> param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::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) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
bool has_object;
if (!ReadParam(m, iter, &has_object))
return false;
@@ -1405,100 +1529,17 @@ struct ParamTraits<scoped_refptr<net::HttpResponseHeaders> > {
}
};
-// Traits for webkit_glue::ResourceLoaderBridge::ResponseInfo
-template <>
-struct ParamTraits<webkit_glue::ResourceLoaderBridge::ResponseInfo> {
- typedef webkit_glue::ResourceLoaderBridge::ResponseInfo param_type;
- static void Write(Message* m, const param_type& p) {
- WriteParam(m, p.request_time);
- WriteParam(m, p.response_time);
- WriteParam(m, p.headers);
- WriteParam(m, p.mime_type);
- WriteParam(m, p.charset);
- WriteParam(m, p.security_info);
- WriteParam(m, p.content_length);
- }
- static bool Read(const Message* m, void** iter, param_type* r) {
- return
- ReadParam(m, iter, &r->request_time) &&
- ReadParam(m, iter, &r->response_time) &&
- ReadParam(m, iter, &r->headers) &&
- ReadParam(m, iter, &r->mime_type) &&
- ReadParam(m, iter, &r->charset) &&
- ReadParam(m, iter, &r->security_info) &&
- ReadParam(m, iter, &r->content_length);
- }
- static void Log(const param_type& p, std::wstring* l) {
- l->append(L"(");
- LogParam(p.request_time, l);
- l->append(L", ");
- LogParam(p.response_time, l);
- l->append(L", ");
- LogParam(p.headers, l);
- l->append(L", ");
- LogParam(p.mime_type, l);
- l->append(L", ");
- LogParam(p.charset, l);
- l->append(L", ");
- LogParam(p.security_info, l);
- l->append(L")");
- }
-};
-
-// Traits for ViewMsg_Resource_ResponseHead
-template <>
-struct ParamTraits<ViewMsg_Resource_ResponseHead> {
- typedef ViewMsg_Resource_ResponseHead param_type;
- static void Write(Message* m, const param_type& p) {
- ParamTraits<webkit_glue::ResourceLoaderBridge::ResponseInfo>::Write(m, p);
- WriteParam(m, p.status);
- WriteParam(m, p.filter_policy);
- }
- static bool Read(const Message* m, void** iter, param_type* r) {
- return
- ParamTraits<webkit_glue::ResourceLoaderBridge::ResponseInfo>::Read(m, iter, r) &&
- ReadParam(m, iter, &r->status) &&
- ReadParam(m, iter, &r->filter_policy);
- }
- static void Log(const param_type& p, std::wstring* l) {
- // log more?
- ParamTraits<webkit_glue::ResourceLoaderBridge::ResponseInfo>::Log(p, l);
- }
-};
-
-// Traits for ViewHostMsg_Resource_SyncLoad_Response
-template <>
-struct ParamTraits<ViewHostMsg_SyncLoad_Result> {
- typedef ViewHostMsg_SyncLoad_Result param_type;
- static void Write(Message* m, const param_type& p) {
- ParamTraits<ViewMsg_Resource_ResponseHead>::Write(m, p);
- WriteParam(m, p.final_url);
- WriteParam(m, p.data);
- }
- static bool Read(const Message* m, void** iter, param_type* r) {
- return
- ParamTraits<ViewMsg_Resource_ResponseHead>::Read(m, iter, r) &&
- ReadParam(m, iter, &r->final_url) &&
- ReadParam(m, iter, &r->data);
- }
- static void Log(const param_type& p, std::wstring* l) {
- // log more?
- ParamTraits<webkit_glue::ResourceLoaderBridge::ResponseInfo>::Log(p, l);
- }
-};
-
-// Traits for FormData structure to pack/unpack.
template <>
struct ParamTraits<FormData> {
typedef FormData param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
WriteParam(m, p.origin);
WriteParam(m, p.action);
WriteParam(m, p.elements);
WriteParam(m, p.values);
WriteParam(m, p.submit);
}
- static bool Read(const Message* m, void** iter, param_type* p) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* p) {
return
ReadParam(m, iter, &p->origin) &&
ReadParam(m, iter, &p->action) &&
@@ -1511,93 +1552,10 @@ struct ParamTraits<FormData> {
}
};
-// Traits for ViewMsg_Print_Params
-template <>
-struct ParamTraits<ViewMsg_Print_Params> {
- typedef ViewMsg_Print_Params param_type;
- static void Write(Message* m, const param_type& p) {
- WriteParam(m, p.printable_size);
- WriteParam(m, p.dpi);
- WriteParam(m, p.min_shrink);
- WriteParam(m, p.max_shrink);
- WriteParam(m, p.desired_dpi);
- WriteParam(m, p.document_cookie);
- }
- static bool Read(const Message* m, void** iter, param_type* p) {
- return ReadParam(m, iter, &p->printable_size) &&
- ReadParam(m, iter, &p->dpi) &&
- ReadParam(m, iter, &p->min_shrink) &&
- ReadParam(m, iter, &p->max_shrink) &&
- ReadParam(m, iter, &p->desired_dpi) &&
- ReadParam(m, iter, &p->document_cookie);
- }
- static void Log(const param_type& p, std::wstring* l) {
- l->append(L"<ViewMsg_Print_Params>");
- }
-};
-
-// Traits for ViewMsg_PrintPage_Params
-template <>
-struct ParamTraits<ViewMsg_PrintPage_Params> {
- typedef ViewMsg_PrintPage_Params param_type;
- static void Write(Message* m, const param_type& p) {
- WriteParam(m, p.params);
- WriteParam(m, p.page_number);
- }
- static bool Read(const Message* m, void** iter, param_type* p) {
- return ReadParam(m, iter, &p->params) &&
- ReadParam(m, iter, &p->page_number);
- }
- static void Log(const param_type& p, std::wstring* l) {
- l->append(L"<ViewMsg_PrintPage_Params>");
- }
-};
-
-// Traits for ViewMsg_PrintPages_Params
-template <>
-struct ParamTraits<ViewMsg_PrintPages_Params> {
- typedef ViewMsg_PrintPages_Params param_type;
- static void Write(Message* m, const param_type& p) {
- WriteParam(m, p.params);
- WriteParam(m, p.pages);
- }
- static bool Read(const Message* m, void** iter, param_type* p) {
- return ReadParam(m, iter, &p->params) &&
- ReadParam(m, iter, &p->pages);
- }
- static void Log(const param_type& p, std::wstring* l) {
- l->append(L"<ViewMsg_PrintPages_Params>");
- }
-};
-
-// Traits for ViewHostMsg_DidPrintPage_Params
-template <>
-struct ParamTraits<ViewHostMsg_DidPrintPage_Params> {
- typedef ViewHostMsg_DidPrintPage_Params param_type;
- static void Write(Message* m, const param_type& p) {
- WriteParam(m, p.emf_data_handle);
- WriteParam(m, p.data_size);
- WriteParam(m, p.document_cookie);
- WriteParam(m, p.page_number);
- WriteParam(m, p.actual_shrink);
- }
- static bool Read(const Message* m, void** iter, param_type* p) {
- return ReadParam(m, iter, &p->emf_data_handle) &&
- ReadParam(m, iter, &p->data_size) &&
- ReadParam(m, iter, &p->document_cookie) &&
- ReadParam(m, iter, &p->page_number) &&
- ReadParam(m, iter, &p->actual_shrink);
- }
- static void Log(const param_type& p, std::wstring* l) {
- l->append(L"<ViewHostMsg_DidPrintPage_Params>");
- }
-};
-
-// Traits for WebPreferences structure to pack/unpack.
template <>
struct ParamTraits<WebPreferences> {
typedef WebPreferences param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
WriteParam(m, p.standard_font_family);
WriteParam(m, p.fixed_font_family);
WriteParam(m, p.serif_font_family);
@@ -1623,7 +1581,7 @@ struct ParamTraits<WebPreferences> {
WriteParam(m, p.user_style_sheet_location);
WriteParam(m, p.uses_page_cache);
}
- static bool Read(const Message* m, void** iter, param_type* p) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* p) {
return
ReadParam(m, iter, &p->standard_font_family) &&
ReadParam(m, iter, &p->fixed_font_family) &&
@@ -1655,11 +1613,10 @@ struct ParamTraits<WebPreferences> {
}
};
-// Traits for WebDropData
template <>
struct ParamTraits<WebDropData> {
typedef WebDropData param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
WriteParam(m, p.url);
WriteParam(m, p.url_title);
WriteParam(m, p.file_extension);
@@ -1670,7 +1627,7 @@ struct ParamTraits<WebDropData> {
WriteParam(m, p.file_description_filename);
WriteParam(m, p.file_contents);
}
- static bool Read(const Message* m, void** iter, param_type* p) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* p) {
return
ReadParam(m, iter, &p->url) &&
ReadParam(m, iter, &p->url_title) &&
@@ -1687,18 +1644,17 @@ struct ParamTraits<WebDropData> {
}
};
-// Traits for ScreenInfo
template <>
struct ParamTraits<webkit_glue::ScreenInfo> {
typedef webkit_glue::ScreenInfo param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
WriteParam(m, p.depth);
WriteParam(m, p.depth_per_component);
WriteParam(m, p.is_monochrome);
WriteParam(m, p.rect);
WriteParam(m, p.available_rect);
}
- static bool Read(const Message* m, void** iter, param_type* p) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* p) {
return
ReadParam(m, iter, &p->depth) &&
ReadParam(m, iter, &p->depth_per_component) &&
@@ -1715,16 +1671,16 @@ template<>
struct ParamTraits<ModalDialogEvent> {
typedef ModalDialogEvent param_type;
#if defined(OS_WIN)
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
WriteParam(m, p.event);
}
- static bool Read(const Message* m, void** iter, param_type* p) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* p) {
return ReadParam(m, iter, &p->event);
}
#else
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
}
- static bool Read(const Message* m, void** iter, param_type* p) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* p) {
return true;
}
#endif
@@ -1742,11 +1698,11 @@ struct ParamTraits<ModalDialogEvent> {
template <>
struct ParamTraits<gfx::NativeView> {
typedef gfx::NativeView param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
NOTIMPLEMENTED();
}
- static bool Read(const Message* m, void** iter, param_type* p) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* p) {
NOTIMPLEMENTED();
*p = NULL;
return true;
@@ -1759,6 +1715,8 @@ struct ParamTraits<gfx::NativeView> {
#endif // defined(OS_POSIX)
-} // namespace IPC
+
+#define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h"
+#include "chrome/common/ipc_message_macros.h"
#endif // CHROME_COMMON_RENDER_MESSAGES_H_
diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h
index 149dd53..30c23ba 100644
--- a/chrome/common/render_messages_internal.h
+++ b/chrome/common/render_messages_internal.h
@@ -25,8 +25,6 @@
#include "webkit/glue/webinputevent.h"
#include "webkit/glue/webplugin.h"
-void RenderMessagesInit();
-
// TODO(mpcomplete): rename ViewMsg and ViewHostMsg to something that makes
// more sense with our current design.
@@ -34,7 +32,7 @@ void RenderMessagesInit();
// RenderView messages
// These are messages sent from the browser to the renderer process.
-IPC_BEGIN_MESSAGES(View, 1)
+IPC_BEGIN_MESSAGES(View)
// Used typically when recovering from a crash. The new rendering process
// sets its global "next page id" counter to the given value.
IPC_MESSAGE_CONTROL1(ViewMsg_SetNextPageID,
@@ -486,7 +484,7 @@ IPC_END_MESSAGES(View)
// WebContents messages
// These are messages sent from the renderer to the browser process.
-IPC_BEGIN_MESSAGES(ViewHost, 2)
+IPC_BEGIN_MESSAGES(ViewHost)
// Sent by the renderer when it is creating a new window. The browser creates
// a tab for it and responds with a ViewMsg_CreatingNew_ACK. If route_id is
// MSG_ROUTING_NONE, the view couldn't be created. modal_dialog_event is set
@@ -738,9 +736,11 @@ IPC_BEGIN_MESSAGES(ViewHost, 2)
IPC_MESSAGE_CONTROL3(ViewHostMsg_PageContents, GURL, int32, std::wstring)
// Specifies the URL as the first parameter (a wstring) and thumbnail as
- // binary data as the second parameter. Our macros don't handle binary data,
- // so this is declared "empty," to be encoded by the caller/receiver.
- IPC_MESSAGE_EMPTY(ViewHostMsg_Thumbnail)
+ // binary data as the second parameter.
+ IPC_MESSAGE_ROUTED3(ViewHostMsg_Thumbnail,
+ GURL /* url */,
+ ThumbnailScore /* score */,
+ SkBitmap /* bitmap */)
// Notification that the url for the favicon of a site has been determined.
IPC_MESSAGE_ROUTED2(ViewHostMsg_UpdateFavIconURL,
diff --git a/chrome/common/resource_dispatcher_unittest.cc b/chrome/common/resource_dispatcher_unittest.cc
index bf9cc51..48cb178 100644
--- a/chrome/common/resource_dispatcher_unittest.cc
+++ b/chrome/common/resource_dispatcher_unittest.cc
@@ -84,10 +84,10 @@ class ResourceDispatcherTest : public testing::Test,
void* iter = NULL;
int request_id;
- ASSERT_TRUE(IPC::ReadParam(&message_queue_[0], &iter, &request_id));
+ ASSERT_TRUE(ReadParam(&message_queue_[0], &iter, &request_id));
ViewHostMsg_Resource_Request request;
- ASSERT_TRUE(IPC::ReadParam(&message_queue_[0], &iter, &request));
+ ASSERT_TRUE(ReadParam(&message_queue_[0], &iter, &request));
// check values
EXPECT_EQ(test_page_url, request.url.spec());
@@ -119,7 +119,7 @@ class ResourceDispatcherTest : public testing::Test,
// read the ack message.
iter = NULL;
int request_ack = -1;
- ASSERT_TRUE(IPC::ReadParam(&message_queue_[0], &iter, &request_ack));
+ ASSERT_TRUE(ReadParam(&message_queue_[0], &iter, &request_ack));
ASSERT_EQ(request_ack, request_id);
diff --git a/chrome/common/security_filter_peer.h b/chrome/common/security_filter_peer.h
index ef19b71..ef08426 100644
--- a/chrome/common/security_filter_peer.h
+++ b/chrome/common/security_filter_peer.h
@@ -6,7 +6,7 @@
#ifndef CHROME_COMMON_SECURITY_FILTER_PEER_H__
#define CHROME_COMMON_SECURITY_FILTER_PEER_H__
-#include "chrome/common/render_messages.h"
+#include "chrome/common/filter_policy.h"
#include "webkit/glue/resource_loader_bridge.h"
// The SecurityFilterPeer is a proxy to a
diff --git a/chrome/common/temp_scaffolding_stubs.h b/chrome/common/temp_scaffolding_stubs.h
index f3a57e4..350e29c 100644
--- a/chrome/common/temp_scaffolding_stubs.h
+++ b/chrome/common/temp_scaffolding_stubs.h
@@ -16,6 +16,7 @@
#include "base/logging.h"
#include "base/message_loop.h"
#include "base/ref_counted.h"
+#include "base/gfx/native_widget_types.h"
#include "base/gfx/rect.h"
#include "chrome/browser/bookmarks/bookmark_service.h"
#include "chrome/browser/browser_process.h"
@@ -26,12 +27,12 @@
#include "chrome/common/navigation_types.h"
#include "chrome/common/notification_service.h"
#include "chrome/common/page_transition_types.h"
-#include "chrome/common/render_messages.h"
#include "googleurl/src/gurl.h"
#include "skia/include/SkBitmap.h"
#include "webkit/glue/password_form.h"
#include "webkit/glue/window_open_disposition.h"
+class AutofillForm;
class Browser;
class BookmarkService;
class CommandLine;
@@ -60,6 +61,7 @@ class URLRequestContext;
class UserScriptMaster;
class VisitedLinkMaster;
class WebContents;
+class WebPreferences;
namespace IPC {
class Message;
@@ -291,11 +293,13 @@ class BrokerServices {
class IconManager {
};
-struct ViewHostMsg_Resource_Request;
+struct ViewHostMsg_DidPrintPage_Params;
+struct ViewHostMsg_FrameNavigate_Params;
class ResourceDispatcherHost {
public:
explicit ResourceDispatcherHost(MessageLoop* loop) {}
+
class Receiver {
public:
virtual bool Send(IPC::Message* message) = 0;
@@ -304,18 +308,22 @@ class ResourceDispatcherHost {
void CancelRequestsForRenderView(int, int);
void Initialize() { NOTIMPLEMENTED(); }
void Shutdown() { NOTIMPLEMENTED(); }
+
SafeBrowsingService* safe_browsing_service() {
NOTIMPLEMENTED();
return const_cast<SafeBrowsingService*>(&safe_browsing_service_);
}
+
DownloadFileManager* download_file_manager() {
NOTIMPLEMENTED();
return const_cast<DownloadFileManager*>(&download_file_manager_);
}
+
SaveFileManager* save_file_manager() {
NOTIMPLEMENTED();
return const_cast<SaveFileManager*>(&save_file_manager_);
}
+
private:
SafeBrowsingService safe_browsing_service_;
DownloadFileManager download_file_manager_;
@@ -622,7 +630,7 @@ class RenderViewHost : public RenderWidgetHost {
return true;
}
void SetAlternateErrorPageURL(const GURL&) { NOTIMPLEMENTED(); }
- void UpdateWebPreferences(WebPreferences) { NOTIMPLEMENTED(); }
+ void UpdateWebPreferences(const WebPreferences&) { NOTIMPLEMENTED(); }
void ReservePageIDRange(int) { NOTIMPLEMENTED(); }
};
diff --git a/chrome/plugin/chrome_plugin_host.cc b/chrome/plugin/chrome_plugin_host.cc
index 42d15ef..482a669 100644
--- a/chrome/plugin/chrome_plugin_host.cc
+++ b/chrome/plugin/chrome_plugin_host.cc
@@ -11,6 +11,7 @@
#include "chrome/common/chrome_plugin_lib.h"
#include "chrome/common/chrome_plugin_util.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/plugin_messages.h"
#include "chrome/plugin/plugin_process.h"
#include "chrome/plugin/plugin_thread.h"
#include "chrome/plugin/webplugin_proxy.h"
diff --git a/chrome/plugin/webplugin_delegate_stub.h b/chrome/plugin/webplugin_delegate_stub.h
index 1cc21631..d5e8270 100644
--- a/chrome/plugin/webplugin_delegate_stub.h
+++ b/chrome/plugin/webplugin_delegate_stub.h
@@ -9,9 +9,9 @@
#include "base/gfx/rect.h"
#include "base/ref_counted.h"
+#include "base/shared_memory.h"
#include "base/task.h"
#include "chrome/common/ipc_channel.h"
-#include "chrome/common/plugin_messages.h"
#include "third_party/npapi/bindings/npapi.h"
class GURL;
@@ -20,6 +20,8 @@ class WebPluginProxy;
class WebPluginDelegateImpl;
struct PluginMsg_Init_Params;
struct PluginMsg_DidReceiveResponseParams;
+struct PluginMsg_PrintResponse_Params;
+struct PluginMsg_URLRequestReply_Params;
class WebCursor;
// Converts the IPC messages from WebPluginDelegateProxy into calls to the
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index 932e042..8026718 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -454,12 +454,7 @@ void RenderView::SendThumbnail() {
return;
// send the thumbnail message to the browser process
- IPC::Message* thumbnail_msg = new IPC::Message(routing_id_,
- ViewHostMsg_Thumbnail::ID, IPC::Message::PRIORITY_NORMAL);
- IPC::ParamTraits<GURL>::Write(thumbnail_msg, url);
- IPC::ParamTraits<ThumbnailScore>::Write(thumbnail_msg, score);
- IPC::ParamTraits<SkBitmap>::Write(thumbnail_msg, thumbnail);
- Send(thumbnail_msg);
+ Send(new ViewHostMsg_Thumbnail(routing_id_, url, score, thumbnail));
}
int RenderView::SwitchFrameToPrintMediaType(const ViewMsg_Print_Params& params,
diff --git a/chrome/renderer/render_widget.cc b/chrome/renderer/render_widget.cc
index 1e14993..82ca86c 100644
--- a/chrome/renderer/render_widget.cc
+++ b/chrome/renderer/render_widget.cc
@@ -10,6 +10,7 @@
#include "base/message_loop.h"
#include "base/scoped_ptr.h"
#include "build/build_config.h"
+#include "chrome/common/render_messages.h"
#include "chrome/renderer/render_process.h"
#include "skia/ext/platform_canvas.h"
@@ -727,6 +728,26 @@ void RenderWidget::OnMsgRepaint(const gfx::Size& size_to_paint) {
DidInvalidateRect(webwidget_, repaint_rect);
}
+bool RenderWidget::next_paint_is_resize_ack() const {
+ return ViewHostMsg_PaintRect_Flags::is_resize_ack(next_paint_flags_);
+}
+
+bool RenderWidget::next_paint_is_restore_ack() const {
+ return ViewHostMsg_PaintRect_Flags::is_restore_ack(next_paint_flags_);
+}
+
+void RenderWidget::set_next_paint_is_resize_ack() {
+ next_paint_flags_ |= ViewHostMsg_PaintRect_Flags::IS_RESIZE_ACK;
+}
+
+void RenderWidget::set_next_paint_is_restore_ack() {
+ next_paint_flags_ |= ViewHostMsg_PaintRect_Flags::IS_RESTORE_ACK;
+}
+
+void RenderWidget::set_next_paint_is_repaint_ack() {
+ next_paint_flags_ |= ViewHostMsg_PaintRect_Flags::IS_REPAINT_ACK;
+}
+
void RenderWidget::UpdateIME() {
// If a browser process does not have IMEs, its IMEs are not active, or there
// are not any attached widgets.
diff --git a/chrome/renderer/render_widget.h b/chrome/renderer/render_widget.h
index df193bd..8e37b83 100644
--- a/chrome/renderer/render_widget.h
+++ b/chrome/renderer/render_widget.h
@@ -12,8 +12,8 @@
#include "base/gfx/rect.h"
#include "base/gfx/size.h"
#include "base/ref_counted.h"
+#include "base/shared_memory.h"
#include "chrome/common/ipc_channel.h"
-#include "chrome/common/render_messages.h"
#include "skia/ext/platform_canvas.h"
#include "webkit/glue/webwidget_delegate.h"
@@ -144,25 +144,11 @@ class RenderWidget : public IPC::Channel::Listener,
return current_scroll_buf_ != NULL;
}
- bool next_paint_is_resize_ack() const {
- return ViewHostMsg_PaintRect_Flags::is_resize_ack(next_paint_flags_);
- }
-
- bool next_paint_is_restore_ack() const {
- return ViewHostMsg_PaintRect_Flags::is_restore_ack(next_paint_flags_);
- }
-
- void set_next_paint_is_resize_ack() {
- next_paint_flags_ |= ViewHostMsg_PaintRect_Flags::IS_RESIZE_ACK;
- }
-
- void set_next_paint_is_restore_ack() {
- next_paint_flags_ |= ViewHostMsg_PaintRect_Flags::IS_RESTORE_ACK;
- }
-
- void set_next_paint_is_repaint_ack() {
- next_paint_flags_ |= ViewHostMsg_PaintRect_Flags::IS_REPAINT_ACK;
- }
+ bool next_paint_is_resize_ack() const;
+ bool next_paint_is_restore_ack() const;
+ void set_next_paint_is_resize_ack();
+ void set_next_paint_is_restore_ack();
+ void set_next_paint_is_repaint_ack();
// Called when a renderer process moves an input focus or updates the
// position of its caret.
diff --git a/chrome/renderer/webplugin_delegate_proxy.cc b/chrome/renderer/webplugin_delegate_proxy.cc
index 705a65d..94185d8 100644
--- a/chrome/renderer/webplugin_delegate_proxy.cc
+++ b/chrome/renderer/webplugin_delegate_proxy.cc
@@ -18,6 +18,7 @@
#include "chrome/common/gfx/chrome_canvas.h"
#include "chrome/common/gfx/emf.h"
#include "chrome/common/l10n_util.h"
+#include "chrome/common/plugin_messages.h"
#include "chrome/common/resource_bundle.h"
#include "chrome/common/win_util.h"
#include "chrome/plugin/npobject_proxy.h"
diff --git a/chrome/renderer/webplugin_delegate_proxy.h b/chrome/renderer/webplugin_delegate_proxy.h
index 65b1edb..745db46 100644
--- a/chrome/renderer/webplugin_delegate_proxy.h
+++ b/chrome/renderer/webplugin_delegate_proxy.h
@@ -12,7 +12,6 @@
#include "base/ref_counted.h"
#include "base/scoped_handle.h"
#include "chrome/common/ipc_message.h"
-#include "chrome/common/plugin_messages.h"
#include "chrome/plugin/npobject_stub.h"
#include "chrome/renderer/plugin_channel_host.h"
#include "webkit/glue/webplugin.h"
@@ -20,10 +19,12 @@
class GURL;
struct PluginHostMsg_RouteToFrame_Params;
+struct PluginHostMsg_URLRequest_Params;
class RenderView;
class SkBitmap;
namespace base {
+class SharedMemory;
class WaitableEvent;
}
diff --git a/chrome/test/automation/autocomplete_edit_proxy.h b/chrome/test/automation/autocomplete_edit_proxy.h
index 85172d3..bd7c87a 100644
--- a/chrome/test/automation/autocomplete_edit_proxy.h
+++ b/chrome/test/automation/autocomplete_edit_proxy.h
@@ -49,12 +49,10 @@ struct AutocompleteMatchData {
};
typedef std::vector<AutocompleteMatchData> Matches;
-namespace IPC {
-
template <>
struct ParamTraits<AutocompleteMatchData> {
typedef AutocompleteMatchData param_type;
- static void Write(Message* m, const param_type& p) {
+ static void Write(IPC::Message* m, const param_type& p) {
m->WriteString(p.provider_name);
m->WriteInt(p.relevance);
m->WriteBool(p.deletable);
@@ -68,7 +66,7 @@ struct ParamTraits<AutocompleteMatchData> {
m->WriteBool(p.starred);
}
- static bool Read(const Message* m, void** iter, param_type* r) {
+ static bool Read(const IPC::Message* m, void** iter, param_type* r) {
std::string destination_url;
if (!m->ReadString(iter, &r->provider_name) ||
!m->ReadInt(iter, &r->relevance) ||
@@ -112,7 +110,6 @@ struct ParamTraits<AutocompleteMatchData> {
l->append(L"]");
}
};
-} // namespace IPC
class AutocompleteEditProxy : public AutomationResourceProxy {
public:
diff --git a/chrome/test/automation/automation_messages.h b/chrome/test/automation/automation_messages.h
index e1fdf80..d4e916c 100644
--- a/chrome/test/automation/automation_messages.h
+++ b/chrome/test/automation/automation_messages.h
@@ -8,7 +8,6 @@
#include <string>
#include "base/basictypes.h"
-#include "chrome/common/ipc_message.h"
#include "chrome/common/ipc_message_utils.h"
enum AutomationMsg_NavigationResponseValues {
@@ -17,25 +16,9 @@ enum AutomationMsg_NavigationResponseValues {
AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED,
};
-// Two-pass include of render_messages_internal. Preprocessor magic allows
-// us to use 1 header to define the enums and classes for our render messages.
-#define IPC_MESSAGE_MACROS_ENUMS
-#include "chrome/test/automation/automation_messages_internal.h"
-
-#ifdef IPC_MESSAGE_MACROS_LOG_ENABLED
-# undef IPC_MESSAGE_MACROS_LOG
-# define IPC_MESSAGE_MACROS_CLASSES
-#include "chrome/test/automation/automation_messages_internal.h"
-
-# undef IPC_MESSAGE_MACROS_CLASSES
-# define IPC_MESSAGE_MACROS_LOG
-#include "chrome/test/automation/automation_messages_internal.h"
-#else
-// No debug strings requested, just define the classes
-# define IPC_MESSAGE_MACROS_CLASSES
-#include "chrome/test/automation/automation_messages_internal.h"
-#endif
-
+#define MESSAGES_INTERNAL_FILE \
+ "chrome/test/automation/automation_messages_internal.h"
+#include "chrome/common/ipc_message_macros.h"
#endif // CHROME_TEST_AUTOMATION_AUTOMATION_MESSAGES_H__
diff --git a/chrome/test/automation/automation_messages_internal.h b/chrome/test/automation/automation_messages_internal.h
index a22818c..05290d0d 100644
--- a/chrome/test/automation/automation_messages_internal.h
+++ b/chrome/test/automation/automation_messages_internal.h
@@ -31,9 +31,7 @@
// since the PageCyclerReferenceTest depends on the correctness of the
// message IDs across the builds.
-// By using a start value of 0 for automation messages, we keep backward
-// compatability with old builds.
-IPC_BEGIN_MESSAGES(Automation, 0)
+IPC_BEGIN_MESSAGES(Automation)
// This message is fired when the AutomationProvider is up and running
// in the app (the app is not fully up at this point).
@@ -206,7 +204,9 @@ IPC_BEGIN_MESSAGES(Automation, 0)
IPC_MESSAGE_ROUTED2(AutomationMsg_RedirectsFromRequest,
int, // tab handle
GURL) // source URL
- IPC_MESSAGE_EMPTY(AutomationMsg_RedirectsFromResponse)
+ IPC_MESSAGE_ROUTED2(AutomationMsg_RedirectsFromResponse,
+ bool /* succeeded */,
+ std::vector<GURL> /* redirects */)
// This message asks the AutomationProvider whether a tab is waiting for
// login info.
diff --git a/chrome/test/automation/automation_proxy.cc b/chrome/test/automation/automation_proxy.cc
index f8d4b93..d0a5d69 100644
--- a/chrome/test/automation/automation_proxy.cc
+++ b/chrome/test/automation/automation_proxy.cc
@@ -8,7 +8,6 @@
#include "base/logging.h"
#include "base/ref_counted.h"
-#include "chrome/common/ipc_message_macros.h"
#include "chrome/test/automation/automation_constants.h"
#include "chrome/test/automation/automation_messages.h"
#include "chrome/test/automation/browser_proxy.h"
@@ -554,7 +553,7 @@ TabProxy* AutomationProxy::CreateExternalTab(HWND parent,
void* iter = NULL;
int handle = 0;
TabProxy* tab_proxy = NULL;
- if (IPC::ReadParam(response, &iter, external_tab_container) &&
+ if (ReadParam(response, &iter, external_tab_container) &&
IsWindow(*external_tab_container)) {
if (response->ReadInt(&iter, &handle) &&
(handle >= 0)) {
diff --git a/chrome/test/automation/tab_proxy.cc b/chrome/test/automation/tab_proxy.cc
index 07a3488..6cfac07 100644
--- a/chrome/test/automation/tab_proxy.cc
+++ b/chrome/test/automation/tab_proxy.cc
@@ -24,23 +24,15 @@ bool TabProxy::GetTabTitle(std::wstring* title) const {
}
IPC::Message* response = NULL;
- bool succeeded = sender_->SendAndWaitForResponse(
- new AutomationMsg_TabTitleRequest(0, handle_), &response,
- AutomationMsg_TabTitleResponse::ID);
+ int tab_title_size_response;
- if (!succeeded)
- return false;
-
- void* iter = NULL;
- int tab_title_size_response = -1;
- if (response->ReadInt(&iter, &tab_title_size_response) &&
- (tab_title_size_response >= 0)) {
- response->ReadWString(&iter, title);
- } else {
- succeeded = false;
- }
+ bool succeeded = sender_->SendAndWaitForResponse(
+ new AutomationMsg_TabTitleRequest(0, handle_), &response,
+ AutomationMsg_TabTitleResponse::ID) &&
+ AutomationMsg_TabTitleResponse::Read(response, &tab_title_size_response, title) &&
+ tab_title_size_response >= 0;
+ scoped_ptr<IPC::Message> auto_deleter(response);
- delete response;
return succeeded;
}
@@ -55,24 +47,18 @@ bool TabProxy::IsShelfVisible(bool* is_visible) {
IPC::Message* response = NULL;
bool succeeded = sender_->SendAndWaitForResponse(
- new AutomationMsg_ShelfVisibilityRequest(0, handle_),
- &response,
- AutomationMsg_ShelfVisibilityResponse::ID);
- if (!succeeded)
- return false;
-
- void* iter = NULL;
- response->ReadBool(&iter, is_visible);
- delete response;
- return true;
+ new AutomationMsg_ShelfVisibilityRequest(0, handle_),
+ &response, AutomationMsg_ShelfVisibilityResponse::ID) &&
+ AutomationMsg_ShelfVisibilityResponse::Read(response, is_visible);
+ scoped_ptr<IPC::Message> auto_deleter(response);
+ return succeeded;
}
bool TabProxy::OpenFindInPage() {
if (!is_valid())
return false;
- return sender_->Send(
- new AutomationMsg_OpenFindInPageRequest(0, handle_));
+ return sender_->Send(new AutomationMsg_OpenFindInPageRequest(0, handle_));
// This message expects no response.
}
@@ -88,15 +74,10 @@ bool TabProxy::IsFindWindowFullyVisible(bool* is_visible) {
IPC::Message* response = NULL;
bool succeeded = sender_->SendAndWaitForResponse(
new AutomationMsg_FindWindowVisibilityRequest(0, handle_),
- &response,
- AutomationMsg_FindWindowVisibilityResponse::ID);
- if (!succeeded)
- return false;
-
- void* iter = NULL;
- response->ReadBool(&iter, is_visible);
- delete response;
- return true;
+ &response, AutomationMsg_FindWindowVisibilityResponse::ID) &&
+ AutomationMsg_FindWindowVisibilityResponse::Read(response, is_visible);
+ scoped_ptr<IPC::Message> auto_deleter(response);
+ return succeeded;
}
bool TabProxy::GetFindWindowLocation(int* x, int* y) {
@@ -106,23 +87,17 @@ bool TabProxy::GetFindWindowLocation(int* x, int* y) {
IPC::Message* response = NULL;
bool succeeded = sender_->SendAndWaitForResponse(
new AutomationMsg_FindWindowLocationRequest(0, handle_),
- &response,
- AutomationMsg_FindWindowLocationResponse::ID);
- if (!succeeded)
- return false;
-
- void* iter = NULL;
- response->ReadInt(&iter, x);
- response->ReadInt(&iter, y);
- delete response;
- return true;
+ &response, AutomationMsg_FindWindowLocationResponse::ID) &&
+ AutomationMsg_FindWindowLocationResponse::Read(response, x, y);
+ scoped_ptr<IPC::Message> auto_deleter(response);
+ return succeeded;
}
int TabProxy::FindInPage(const std::wstring& search_string,
FindInPageDirection forward,
FindInPageCase match_case,
bool find_next,
- int* active_ordinal) {
+ int* ordinal) {
if (!is_valid())
return -1;
@@ -134,22 +109,15 @@ int TabProxy::FindInPage(const std::wstring& search_string,
request.forward = forward == TRUE;
IPC::Message* response = NULL;
+ int matches;
bool succeeded = sender_->SendAndWaitForResponse(
new AutomationMsg_FindRequest(0, handle_, request),
- &response,
- AutomationMsg_FindInPageResponse2::ID);
+ &response, AutomationMsg_FindInPageResponse2::ID) &&
+ AutomationMsg_FindInPageResponse2::Read(response, ordinal, &matches);
+ scoped_ptr<IPC::Message> auto_deleter(response);
if (!succeeded)
return -1;
-
- void* iter = NULL;
- int ordinal;
- int matches_found;
- response->ReadInt(&iter, &ordinal);
- response->ReadInt(&iter, &matches_found);
- if (active_ordinal)
- *active_ordinal = ordinal;
- delete response;
- return matches_found;
+ return matches;
}
int TabProxy::NavigateToURL(const GURL& url) {
@@ -163,18 +131,13 @@ int TabProxy::NavigateToURLWithTimeout(const GURL& url,
return AUTOMATION_MSG_NAVIGATION_ERROR;
IPC::Message* response = NULL;
- bool succeeded = sender_->SendAndWaitForResponseWithTimeout(
- new AutomationMsg_NavigateToURLRequest(0, handle_, url), &response,
- AutomationMsg_NavigateToURLResponse::ID, timeout_ms, is_timeout);
-
- if (!succeeded)
- return AUTOMATION_MSG_NAVIGATION_ERROR;
-
- void* iter = NULL;
int navigate_response = AUTOMATION_MSG_NAVIGATION_ERROR;
- response->ReadInt(&iter, &navigate_response);
-
- delete response;
+ if (sender_->SendAndWaitForResponseWithTimeout(
+ new AutomationMsg_NavigateToURLRequest(0, handle_, url), &response,
+ AutomationMsg_NavigateToURLResponse::ID, timeout_ms, is_timeout)) {
+ AutomationMsg_NavigateToURLResponse::Read(response, &navigate_response);
+ }
+ scoped_ptr<IPC::Message> auto_deleter(response);
return navigate_response;
}
@@ -184,19 +147,15 @@ int TabProxy::NavigateInExternalTab(const GURL& url) {
IPC::Message* response = NULL;
bool is_timeout = false;
- bool succeeded = sender_->SendAndWaitForResponseWithTimeout(
- new AutomationMsg_NavigateInExternalTabRequest(0, handle_, url), &response,
- AutomationMsg_NavigateInExternalTabResponse::ID, INFINITE, &is_timeout);
-
- if (!succeeded)
- return AUTOMATION_MSG_NAVIGATION_ERROR;
-
- void* iter = NULL;
- int navigate_response = AUTOMATION_MSG_NAVIGATION_ERROR;
- response->ReadInt(&iter, &navigate_response);
-
- delete response;
- return navigate_response;
+ int rv = AUTOMATION_MSG_NAVIGATION_ERROR;
+ if (sender_->SendAndWaitForResponseWithTimeout(
+ new AutomationMsg_NavigateInExternalTabRequest(0, handle_, url),
+ &response, AutomationMsg_NavigateInExternalTabResponse::ID, INFINITE,
+ &is_timeout)) {
+ AutomationMsg_NavigateInExternalTabResponse::Read(response, &rv);
+ }
+ scoped_ptr<IPC::Message> auto_deleter(response);
+ return rv;
}
bool TabProxy::SetAuth(const std::wstring& username,
@@ -205,19 +164,13 @@ bool TabProxy::SetAuth(const std::wstring& username,
return false;
IPC::Message* response = NULL;
- bool succeeded = sender_->SendAndWaitForResponse(
- new AutomationMsg_SetAuthRequest(0, handle_, username, password), &response,
- AutomationMsg_SetAuthResponse::ID);
-
- if (!succeeded)
- return false;
-
- void* iter = NULL;
int navigate_response = -1;
- succeeded = (response->ReadInt(&iter, &navigate_response) &&
- navigate_response >= 0);
-
- delete response;
+ bool succeeded = sender_->SendAndWaitForResponse(
+ new AutomationMsg_SetAuthRequest(0, handle_, username, password),
+ &response, AutomationMsg_SetAuthResponse::ID) &&
+ AutomationMsg_SetAuthResponse::Read(response, &navigate_response) &&
+ navigate_response >= 0;
+ scoped_ptr<IPC::Message> auto_deleter(response);
return succeeded;
}
@@ -226,19 +179,13 @@ bool TabProxy::CancelAuth() {
return false;
IPC::Message* response = NULL;
- bool succeeded = sender_->SendAndWaitForResponse(
- new AutomationMsg_CancelAuthRequest(0, handle_), &response,
- AutomationMsg_CancelAuthResponse::ID);
-
- if (!succeeded)
- return false;
-
- void* iter = NULL;
int navigate_response = -1;
- succeeded = (response->ReadInt(&iter, &navigate_response) &&
- navigate_response >= 0);
-
- delete response;
+ bool succeeded = sender_->SendAndWaitForResponse(
+ new AutomationMsg_CancelAuthRequest(0, handle_), &response,
+ AutomationMsg_CancelAuthResponse::ID) &&
+ AutomationMsg_CancelAuthResponse::Read(response, &navigate_response) &&
+ navigate_response >= 0;
+ scoped_ptr<IPC::Message> auto_deleter(response);
return succeeded;
}
@@ -247,18 +194,12 @@ bool TabProxy::NeedsAuth() const {
return false;
IPC::Message* response = NULL;
- bool succeeded = sender_->SendAndWaitForResponse(
- new AutomationMsg_NeedsAuthRequest(0, handle_), &response,
- AutomationMsg_NeedsAuthResponse::ID);
-
- if (!succeeded)
- return false;
-
- void* iter = NULL;
bool needs_auth = false;
- response->ReadBool(&iter, &needs_auth);
-
- delete response;
+ bool succeeded = sender_->SendAndWaitForResponse(
+ new AutomationMsg_NeedsAuthRequest(0, handle_), &response,
+ AutomationMsg_NeedsAuthResponse::ID) &&
+ AutomationMsg_NeedsAuthResponse::Read(response, &needs_auth);
+ scoped_ptr<IPC::Message> auto_deleter(response);
return needs_auth;
}
@@ -267,18 +208,13 @@ int TabProxy::GoBack() {
return AUTOMATION_MSG_NAVIGATION_ERROR;
IPC::Message* response = NULL;
- bool succeeded = sender_->SendAndWaitForResponse(
- new AutomationMsg_GoBackRequest(0, handle_), &response,
- AutomationMsg_GoBackResponse::ID);
-
- if (!succeeded)
- return AUTOMATION_MSG_NAVIGATION_ERROR;
-
- void* iter = NULL;
int navigate_response = AUTOMATION_MSG_NAVIGATION_ERROR;
- response->ReadInt(&iter, &navigate_response);
-
- delete response;
+ if (sender_->SendAndWaitForResponse(
+ new AutomationMsg_GoBackRequest(0, handle_), &response,
+ AutomationMsg_GoBackResponse::ID)) {
+ AutomationMsg_GoBackResponse::Read(response, &navigate_response);
+ }
+ scoped_ptr<IPC::Message> auto_deleter(response);
return navigate_response;
}
@@ -287,18 +223,13 @@ int TabProxy::GoForward() {
return AUTOMATION_MSG_NAVIGATION_ERROR;
IPC::Message* response = NULL;
- bool succeeded = sender_->SendAndWaitForResponse(
- new AutomationMsg_GoForwardRequest(0, handle_), &response,
- AutomationMsg_GoForwardResponse::ID);
-
- if (!succeeded)
- return AUTOMATION_MSG_NAVIGATION_ERROR;
-
- void* iter = NULL;
int navigate_response = AUTOMATION_MSG_NAVIGATION_ERROR;
- response->ReadInt(&iter, &navigate_response);
-
- delete response;
+ if (sender_->SendAndWaitForResponse(
+ new AutomationMsg_GoForwardRequest(0, handle_), &response,
+ AutomationMsg_GoForwardResponse::ID)) {
+ AutomationMsg_GoForwardResponse::Read(response, &navigate_response);
+ }
+ scoped_ptr<IPC::Message> auto_deleter(response);
return navigate_response;
}
@@ -307,48 +238,30 @@ int TabProxy::Reload() {
return AUTOMATION_MSG_NAVIGATION_ERROR;
IPC::Message* response = NULL;
- bool succeeded = sender_->SendAndWaitForResponse(
- new AutomationMsg_ReloadRequest(0, handle_), &response,
- AutomationMsg_ReloadResponse::ID);
-
- if (!succeeded)
- return AUTOMATION_MSG_NAVIGATION_ERROR;
-
- void* iter = NULL;
int navigate_response = AUTOMATION_MSG_NAVIGATION_ERROR;
- response->ReadInt(&iter, &navigate_response);
-
- delete response;
+ if (sender_->SendAndWaitForResponse(
+ new AutomationMsg_ReloadRequest(0, handle_), &response,
+ AutomationMsg_ReloadResponse::ID)) {
+ AutomationMsg_ReloadResponse::Read(response, &navigate_response);
+ }
+ scoped_ptr<IPC::Message> auto_deleter(response);
return navigate_response;
}
bool TabProxy::GetRedirectsFrom(const GURL& source_url,
std::vector<GURL>* redirects) {
- std::vector<GURL> output;
-
IPC::Message* response = NULL;
bool succeeded = sender_->SendAndWaitForResponse(
new AutomationMsg_RedirectsFromRequest(0, handle_, source_url), &response,
AutomationMsg_RedirectsFromResponse::ID);
- if (!succeeded)
- return false;
scoped_ptr<IPC::Message> auto_deleter(response);
-
- void* iter = NULL;
- int num_redirects;
- if (!response->ReadInt(&iter, &num_redirects))
- return false;
- if (num_redirects < 0)
- return false; // Negative redirect counts indicate failure.
-
- for (int i = 0; i < num_redirects; i++) {
- GURL cur;
- if (!IPC::ParamTraits<GURL>::Read(response, &iter, &cur))
- return false;
- output.push_back(cur);
+ if (succeeded) {
+ succeeded = AutomationMsg_RedirectsFromResponse::Read(
+ response, &succeeded, redirects) &&
+ succeeded;
}
- redirects->swap(output);
- return true;
+
+ return succeeded;
}
bool TabProxy::GetCurrentURL(GURL* url) const {
@@ -361,23 +274,12 @@ bool TabProxy::GetCurrentURL(GURL* url) const {
}
IPC::Message* response = NULL;
- bool succeeded = sender_->SendAndWaitForResponse(
- new AutomationMsg_TabURLRequest(0, handle_), &response,
- AutomationMsg_TabURLResponse::ID);
-
- if (!succeeded)
- return false;
-
- void* iter = NULL;
- bool tab_url_success = false;
- if (response->ReadBool(&iter, &tab_url_success) && tab_url_success) {
- if (!IPC::ParamTraits<GURL>::Read(response, &iter, url))
- succeeded = false;
- } else {
- succeeded = false;
- }
-
- delete response;
+ bool succeeded;
+ succeeded = sender_->SendAndWaitForResponse(
+ new AutomationMsg_TabURLRequest(0, handle_), &response,
+ AutomationMsg_TabURLResponse::ID) &&
+ AutomationMsg_TabURLResponse::Read(response, &succeeded, url);
+ scoped_ptr<IPC::Message> auto_deleter(response);
return succeeded;
}
@@ -386,21 +288,14 @@ bool TabProxy::NavigateToURLAsync(const GURL& url) {
return false;
IPC::Message* response = NULL;
- bool succeeded = sender_->SendAndWaitForResponse(
- new AutomationMsg_NavigationAsyncRequest(0, handle_, url), &response,
- AutomationMsg_NavigationAsyncResponse::ID);
-
- if (!succeeded)
- return false;
-
- bool status;
- if (AutomationMsg_NavigationAsyncResponse::Read(response, &status) &&
- status) {
- succeeded = true;
+ bool status = false;
+ if (sender_->SendAndWaitForResponse(
+ new AutomationMsg_NavigationAsyncRequest(0, handle_, url), &response,
+ AutomationMsg_NavigationAsyncResponse::ID)) {
+ AutomationMsg_NavigationAsyncResponse::Read(response, &status);
}
-
- delete response;
- return succeeded;
+ scoped_ptr<IPC::Message> auto_deleter(response);
+ return status;
}
bool TabProxy::GetHWND(HWND* hwnd) const {
@@ -411,20 +306,14 @@ bool TabProxy::GetHWND(HWND* hwnd) const {
return false;
}
IPC::Message* response = NULL;
- bool succeeded = sender_->SendAndWaitForResponse(
- new AutomationMsg_TabHWNDRequest(0, handle_), &response,
- AutomationMsg_TabHWNDResponse::ID);
- if (!succeeded)
- return false;
- void* iter = NULL;
HWND tab_hwnd = NULL;
- if (AutomationMsg_TabHWNDResponse::Read(response, &tab_hwnd) && tab_hwnd) {
- *hwnd = tab_hwnd;
- } else {
- succeeded = false;
+ bool succeeded = false;
+ if (sender_->SendAndWaitForResponse(
+ new AutomationMsg_TabHWNDRequest(0, handle_), &response,
+ AutomationMsg_TabHWNDResponse::ID)) {
+ succeeded = AutomationMsg_TabHWNDResponse::Read(response, &tab_hwnd);
}
-
- delete response;
+ scoped_ptr<IPC::Message> auto_deleter(response);
return succeeded;
}
@@ -438,22 +327,13 @@ bool TabProxy::GetProcessID(int* process_id) const {
}
IPC::Message* response = NULL;
- bool succeeded = sender_->SendAndWaitForResponse(
- new AutomationMsg_TabProcessIDRequest(0, handle_), &response,
- AutomationMsg_TabProcessIDResponse::ID);
-
- if (!succeeded)
- return false;
-
- void* iter = NULL;
- int pid;
- if (AutomationMsg_TabProcessIDResponse::Read(response, &pid) && (pid >= 0)) {
- *process_id = pid;
- } else {
- succeeded = false;
+ bool succeeded = false;
+ if (sender_->SendAndWaitForResponse(
+ new AutomationMsg_TabProcessIDRequest(0, handle_), &response,
+ AutomationMsg_TabProcessIDResponse::ID)) {
+ succeeded = AutomationMsg_TabProcessIDResponse::Read(response, process_id);
}
-
- delete response;
+ scoped_ptr<IPC::Message> auto_deleter(response);
return succeeded;
}
@@ -541,14 +421,12 @@ bool TabProxy::ExecuteAndExtractValue(const std::wstring& frame_xpath,
bool succeeded = sender_->SendAndWaitForResponse(
new AutomationMsg_DomOperationRequest(0, handle_, frame_xpath, jscript),
&response, AutomationMsg_DomOperationResponse::ID);
-
- void* iter = NULL;
std::string json;
- succeeded = response->ReadString(&iter, &json);
- if (!succeeded) {
- delete response;
+ if (succeeded)
+ succeeded = AutomationMsg_DomOperationResponse::Read(response, &json);
+ scoped_ptr<IPC::Message> auto_deleter(response);
+ if (!succeeded)
return false;
- }
// Wrap |json| in an array before deserializing because valid JSON has an
// array or an object as the root.
json.insert(0, "[");
@@ -556,8 +434,6 @@ bool TabProxy::ExecuteAndExtractValue(const std::wstring& frame_xpath,
JSONStringValueSerializer deserializer(json);
*value = deserializer.Deserialize(NULL);
-
- delete response;
return *value != NULL;
}
@@ -572,19 +448,10 @@ bool TabProxy::GetConstrainedWindowCount(int* count) const {
IPC::Message* response = NULL;
bool succeeded = sender_->SendAndWaitForResponse(
- new AutomationMsg_ConstrainedWindowCountRequest(0, handle_),
- &response, AutomationMsg_ConstrainedWindowCountResponse::ID);
-
- void* iter = NULL;
- int count_response = -1;
- if (response->ReadInt(&iter, &count_response) &&
- (count_response >= 0)) {
- *count = count_response;
- } else {
- succeeded = false;
- }
-
- delete response;
+ new AutomationMsg_ConstrainedWindowCountRequest(0, handle_),
+ &response, AutomationMsg_ConstrainedWindowCountResponse::ID) &&
+ AutomationMsg_ConstrainedWindowCountResponse::Read(response, count);
+ scoped_ptr<IPC::Message> auto_deleter(response);
return succeeded;
}
@@ -594,18 +461,14 @@ ConstrainedWindowProxy* TabProxy::GetConstrainedWindow(
return NULL;
IPC::Message* response = NULL;
- bool succeeded = sender_->SendAndWaitForResponse(
- new AutomationMsg_ConstrainedWindowRequest(0, handle_, window_index),
- &response, AutomationMsg_ConstrainedWindowResponse::ID);
- if (!succeeded)
- return NULL;
-
- void* iter = NULL;
int handle;
-
- scoped_ptr<IPC::Message> response_deleter(response); // Ensure deleted.
- if (response->ReadInt(&iter, &handle) && (handle != 0))
- return new ConstrainedWindowProxy(sender_, tracker_, handle);
+ if (sender_->SendAndWaitForResponse(
+ new AutomationMsg_ConstrainedWindowRequest(0, handle_, window_index),
+ &response, AutomationMsg_ConstrainedWindowResponse::ID)) {
+ scoped_ptr<IPC::Message> response_deleter(response);
+ if (AutomationMsg_ConstrainedWindowResponse::Read(response, &handle))
+ return new ConstrainedWindowProxy(sender_, tracker_, handle);
+ }
return NULL;
}
@@ -627,25 +490,13 @@ bool TabProxy::GetCookies(const GURL& url, std::string* cookies) {
return false;
IPC::Message* response = NULL;
+ int size;
bool succeeded = sender_->SendAndWaitForResponse(
new AutomationMsg_GetCookiesRequest(0, url, handle_), &response,
- AutomationMsg_GetCookiesResponse::ID);
-
- if (succeeded) {
- void* iter = NULL;
- int size;
- std::string local_value;
-
- if (response->ReadInt(&iter, &size) && size >=0) {
- if (!response->ReadString(&iter, cookies)) {
- succeeded = false;
- }
- } else {
- succeeded = false;
- }
- }
-
- delete response;
+ AutomationMsg_GetCookiesResponse::ID) &&
+ AutomationMsg_GetCookiesResponse::Read(response, &size, cookies) &&
+ size >= 0;
+ scoped_ptr<IPC::Message> response_deleter(response);
return succeeded;
}
@@ -670,20 +521,13 @@ bool TabProxy::GetCookieByName(const GURL& url,
bool TabProxy::SetCookie(const GURL& url, const std::string& value) {
IPC::Message* response = NULL;
- bool succeeded = sender_->SendAndWaitForResponse(
- new AutomationMsg_SetCookieRequest(0, url, value, handle_), &response,
- AutomationMsg_SetCookieResponse::ID);
- if (!succeeded)
- return false;
-
- void* iter = NULL;
int response_value;
-
- if (!response->ReadInt(&iter, &response_value) || response_value < 0) {
- succeeded = false;
- }
-
- delete response;
+ bool succeeded = sender_->SendAndWaitForResponse(
+ new AutomationMsg_SetCookieRequest(0, url, value, handle_), &response,
+ AutomationMsg_SetCookieResponse::ID) &&
+ AutomationMsg_SetCookieResponse::Read(response, &response_value) &&
+ response_value >= 0;
+ scoped_ptr<IPC::Message> response_deleter(response);
return succeeded;
}
@@ -692,35 +536,28 @@ int TabProxy::InspectElement(int x, int y) {
return -1;
IPC::Message* response = NULL;
- bool succeeded = sender_->SendAndWaitForResponse(
+ int ret = -1;
+ if (sender_->SendAndWaitForResponse(
new AutomationMsg_InspectElementRequest(0, handle_, x, y),
- &response, AutomationMsg_InspectElementResponse::ID);
- if (!succeeded)
- return -1;
-
- int ret;
- AutomationMsg_InspectElementResponse::Read(response, &ret);
+ &response, AutomationMsg_InspectElementResponse::ID)) {
+ AutomationMsg_InspectElementResponse::Read(response, &ret);
+ }
+ scoped_ptr<IPC::Message> response_deleter(response);
return ret;
}
-bool TabProxy::GetDownloadDirectory(std::wstring* download_directory) {
- DCHECK(download_directory);
+bool TabProxy::GetDownloadDirectory(std::wstring* directory) {
+ DCHECK(directory);
if (!is_valid())
return false;
IPC::Message* response = NULL;
- bool succeeded =
- sender_->SendAndWaitForResponse(
- new AutomationMsg_DownloadDirectoryRequest(0, handle_),
- &response,
- AutomationMsg_DownloadDirectoryResponse::ID);
- if (!succeeded)
- return false;
-
- void* iter = NULL;
- response->ReadWString(&iter, download_directory);
- delete response;
- return true;
+ bool succeeded = sender_->SendAndWaitForResponse(
+ new AutomationMsg_DownloadDirectoryRequest(0, handle_), &response,
+ AutomationMsg_DownloadDirectoryResponse::ID) &&
+ AutomationMsg_DownloadDirectoryResponse::Read(response, directory);
+ scoped_ptr<IPC::Message> response_deleter(response);
+ return succeeded;
}
bool TabProxy::ShowInterstitialPage(const std::string& html_text,
@@ -732,18 +569,12 @@ bool TabProxy::ShowInterstitialPage(const std::string& html_text,
IPC::Message* response = NULL;
bool succeeded = sender_->SendAndWaitForResponseWithTimeout(
new AutomationMsg_ShowInterstitialPageRequest(0, handle_, html_text),
- &response,
- AutomationMsg_ShowInterstitialPageResponse::ID, timeout_ms, &is_timeout);
-
- if (!succeeded || !is_timeout)
- return false;
-
- void* iter = NULL;
- bool result = true;
- response->ReadBool(&iter, &result);
-
- delete response;
- return result;
+ &response, AutomationMsg_ShowInterstitialPageResponse::ID, timeout_ms,
+ &is_timeout) &&
+ AutomationMsg_ShowInterstitialPageResponse::Read(response, &succeeded) &&
+ succeeded;
+ scoped_ptr<IPC::Message> response_deleter(response);
+ return succeeded;
}
bool TabProxy::HideInterstitialPage() {
@@ -751,21 +582,14 @@ bool TabProxy::HideInterstitialPage() {
return false;
IPC::Message* response = NULL;
- bool succeeded =
- sender_->SendAndWaitForResponse(
- new AutomationMsg_HideInterstitialPageRequest(0, handle_),
- &response,
- AutomationMsg_HideInterstitialPageResponse::ID);
-
- if (!succeeded)
- return false;
-
- void* iter = NULL;
- bool result = true;
- response->ReadBool(&iter, &result);
-
- delete response;
- return result;
+ bool result;
+ bool succeeded = sender_->SendAndWaitForResponse(
+ new AutomationMsg_HideInterstitialPageRequest(0, handle_),
+ &response, AutomationMsg_HideInterstitialPageResponse::ID) &&
+ AutomationMsg_HideInterstitialPageResponse::Read(response, &result) &&
+ result;
+ scoped_ptr<IPC::Message> response_deleter(response);
+ return succeeded;
}
bool TabProxy::Close() {
@@ -777,21 +601,13 @@ bool TabProxy::Close(bool wait_until_closed) {
return false;
IPC::Message* response = NULL;
- bool succeeded =
- sender_->SendAndWaitForResponse(
- new AutomationMsg_CloseTabRequest(0, handle_, wait_until_closed),
- &response,
- AutomationMsg_CloseTabResponse::ID);
-
- if (!succeeded)
- return false;
-
- void* iter = NULL;
- bool result = true;
- response->ReadBool(&iter, &result);
-
- delete response;
- return result;
+ bool succeeded = sender_->SendAndWaitForResponse(
+ new AutomationMsg_CloseTabRequest(0, handle_, wait_until_closed),
+ &response, AutomationMsg_CloseTabResponse::ID) &&
+ AutomationMsg_CloseTabResponse::Read(response, &succeeded) &&
+ succeeded;
+ scoped_ptr<IPC::Message> response_deleter(response);
+ return succeeded;
}
bool TabProxy::SetAccelerators(HACCEL accel_table,
@@ -802,20 +618,14 @@ bool TabProxy::SetAccelerators(HACCEL accel_table,
IPC::Message* response = NULL;
bool is_timeout = false;
bool succeeded = sender_->SendAndWaitForResponseWithTimeout(
- new AutomationMsg_SetAcceleratorsForTab(0, handle_, accel_table,
- accel_table_entry_count),
- &response,
- AutomationMsg_SetAcceleratorsForTabResponse::ID, INFINITE, &is_timeout);
-
- if (!succeeded)
- return AUTOMATION_MSG_NAVIGATION_ERROR;
-
- void* iter = NULL;
- bool set_accel_response = false;
- response->ReadBool(&iter, &set_accel_response);
-
- delete response;
- return set_accel_response;
+ new AutomationMsg_SetAcceleratorsForTab(
+ 0, handle_, accel_table, accel_table_entry_count),
+ &response, AutomationMsg_SetAcceleratorsForTabResponse::ID, INFINITE,
+ &is_timeout) &&
+ AutomationMsg_SetAcceleratorsForTabResponse::Read(response, &succeeded) &&
+ succeeded;
+ scoped_ptr<IPC::Message> response_deleter(response);
+ return succeeded;
}
bool TabProxy::ProcessUnhandledAccelerator(const MSG& msg) {
@@ -831,9 +641,11 @@ bool TabProxy::WaitForTabToBeRestored(uint32 timeout_ms) {
return false;
IPC::Message* response = NULL;
bool is_timeout;
- return sender_->SendAndWaitForResponseWithTimeout(
+ bool succeeded = sender_->SendAndWaitForResponseWithTimeout(
new AutomationMsg_WaitForTabToBeRestored(0, handle_), &response,
AutomationMsg_TabFinishedRestoring::ID, timeout_ms, &is_timeout);
+ scoped_ptr<IPC::Message> response_deleter(response);
+ return succeeded;
}
bool TabProxy::GetSecurityState(SecurityStyle* security_style,
@@ -846,27 +658,18 @@ bool TabProxy::GetSecurityState(SecurityStyle* security_style,
IPC::Message* response = NULL;
bool is_timeout = false;
- bool succeeded = sender_->SendAndWaitForResponseWithTimeout(
+ int value;
+ bool succeeded;
+ succeeded = sender_->SendAndWaitForResponseWithTimeout(
new AutomationMsg_GetSecurityState(0, handle_),
&response,
- AutomationMsg_GetSecurityStateResponse::ID, INFINITE, &is_timeout);
+ AutomationMsg_GetSecurityStateResponse::ID, INFINITE, &is_timeout) &&
+ AutomationMsg_GetSecurityStateResponse::Read(
+ response, &succeeded, &value, ssl_cert_status, mixed_content_state);
+ if (succeeded)
+ *security_style = static_cast<SecurityStyle>(value);
scoped_ptr<IPC::Message> auto_deleter(response);
-
- if (!succeeded)
- return false;
-
- void* iter = NULL;
- int value;
-
- response->ReadBool(&iter, &succeeded);
- if (!succeeded)
- return false;
- response->ReadInt(&iter, &value);
- *security_style = static_cast<SecurityStyle>(value);
- response->ReadInt(&iter, ssl_cert_status);
- response->ReadInt(&iter, mixed_content_state);
-
- return true;
+ return succeeded;
}
bool TabProxy::GetPageType(NavigationEntry::PageType* page_type) {
@@ -877,23 +680,17 @@ bool TabProxy::GetPageType(NavigationEntry::PageType* page_type) {
IPC::Message* response = NULL;
bool is_timeout = false;
- bool succeeded = sender_->SendAndWaitForResponseWithTimeout(
+ int value;
+ bool succeeded;
+ succeeded = sender_->SendAndWaitForResponseWithTimeout(
new AutomationMsg_GetPageType(0, handle_),
&response,
- AutomationMsg_GetPageTypeResponse::ID, INFINITE, &is_timeout);
+ AutomationMsg_GetPageTypeResponse::ID, INFINITE, &is_timeout) &&
+ AutomationMsg_GetPageTypeResponse::Read(response, &succeeded, &value);
scoped_ptr<IPC::Message> auto_deleter(response);
-
- if (!succeeded)
- return false;
-
- void* iter = NULL;
- int value;
- response->ReadBool(&iter, &succeeded);
- if (!succeeded)
- return false;
- response->ReadInt(&iter, &value);
- *page_type = static_cast<NavigationEntry::PageType>(value);
- return true;
+ if (succeeded)
+ *page_type = static_cast<NavigationEntry::PageType>(value);
+ return succeeded;
}
bool TabProxy::TakeActionOnSSLBlockingPage(bool proceed) {
@@ -901,21 +698,15 @@ bool TabProxy::TakeActionOnSSLBlockingPage(bool proceed) {
return false;
IPC::Message* response = NULL;
- bool is_timeout = false;
- bool succeeded = sender_->SendAndWaitForResponseWithTimeout(
+ bool timeout = false;
+ bool success = sender_->SendAndWaitForResponseWithTimeout(
new AutomationMsg_ActionOnSSLBlockingPage(0, handle_, proceed),
&response,
- AutomationMsg_ActionOnSSLBlockingPageResponse::ID, INFINITE, &is_timeout);
+ AutomationMsg_ActionOnSSLBlockingPageResponse::ID, INFINITE, &timeout) &&
+ AutomationMsg_ActionOnSSLBlockingPageResponse::Read(response, &success) &&
+ success;
scoped_ptr<IPC::Message> auto_deleter(response);
-
- if (!succeeded)
- return false;
-
- void* iter = NULL;
- bool status = false;
- response->ReadBool(&iter, &status);
-
- return status;
+ return success;
}
bool TabProxy::PrintNow() {
@@ -924,15 +715,12 @@ bool TabProxy::PrintNow() {
IPC::Message* response = NULL;
bool succeeded = sender_->SendAndWaitForResponse(
- new AutomationMsg_PrintNowRequest(0, handle_), &response,
- AutomationMsg_PrintNowResponse::ID);
+ new AutomationMsg_PrintNowRequest(0, handle_), &response,
+ AutomationMsg_PrintNowResponse::ID) &&
+ AutomationMsg_PrintNowResponse::Read(response, &succeeded) &&
+ succeeded;
scoped_ptr<IPC::Message> auto_deleter(response);
- if (!succeeded)
- return false;
-
- void* iter = NULL;
- succeeded = false;
- return response->ReadBool(&iter, &succeeded) && succeeded;
+ return succeeded;
}
bool TabProxy::SavePage(const std::wstring& file_name,
@@ -943,18 +731,12 @@ bool TabProxy::SavePage(const std::wstring& file_name,
IPC::Message* response = NULL;
bool succeeded = sender_->SendAndWaitForResponse(
- new AutomationMsg_SavePageRequest(0, handle_, file_name,
- dir_path, static_cast<int>(type)),
- &response,
- AutomationMsg_SavePageResponse::ID);
-
- if (!succeeded)
- return false;
-
- void* iter = NULL;
- response->ReadBool(&iter, &succeeded);
- delete response;
-
+ new AutomationMsg_SavePageRequest(
+ 0, handle_, file_name, dir_path, static_cast<int>(type)),
+ &response, AutomationMsg_SavePageResponse::ID) &&
+ AutomationMsg_SavePageResponse::Read(response, &succeeded) &&
+ succeeded;
+ scoped_ptr<IPC::Message> auto_deleter(response);
return succeeded;
}
@@ -978,15 +760,11 @@ bool TabProxy::GetSSLInfoBarCount(int* count) {
IPC::Message* response = NULL;
bool success = sender_->SendAndWaitForResponse(
new AutomationMsg_GetSSLInfoBarCountRequest(0, handle_),
- &response,
- AutomationMsg_GetSSLInfoBarCountResponse::ID);
+ &response, AutomationMsg_GetSSLInfoBarCountResponse::ID) &&
+ AutomationMsg_GetSSLInfoBarCountResponse::Read(response, count) &&
+ count >= 0;
scoped_ptr<IPC::Message> auto_deleter(response);
- if (!success)
- return false;
-
- void* iter = NULL;
- response->ReadInt(&iter, count);
- return true;
+ return success;
}
bool TabProxy::ClickSSLInfoBarLink(int info_bar_index,
@@ -996,36 +774,26 @@ bool TabProxy::ClickSSLInfoBarLink(int info_bar_index,
IPC::Message* response = NULL;
bool success = sender_->SendAndWaitForResponse(
- new AutomationMsg_ClickSSLInfoBarLinkRequest(0, handle_,
- info_bar_index,
- wait_for_navigation),
- &response,
- AutomationMsg_ClickSSLInfoBarLinkResponse::ID);
+ new AutomationMsg_ClickSSLInfoBarLinkRequest(
+ 0, handle_, info_bar_index, wait_for_navigation),
+ &response, AutomationMsg_ClickSSLInfoBarLinkResponse::ID) &&
+ AutomationMsg_ClickSSLInfoBarLinkResponse::Read(response, &success) &&
+ success;
scoped_ptr<IPC::Message> auto_deleter(response);
- if (!success)
- return false;
-
- void* iter = NULL;
- response->ReadBool(&iter, &success);
return success;
}
-bool TabProxy::GetLastNavigationTime(int64* last_navigation_time) {
+bool TabProxy::GetLastNavigationTime(int64* nav_time) {
if (!is_valid())
return false;
IPC::Message* response = NULL;
bool success = sender_->SendAndWaitForResponse(
new AutomationMsg_GetLastNavigationTimeRequest(0, handle_),
- &response,
- AutomationMsg_GetLastNavigationTimeResponse::ID);
+ &response, AutomationMsg_GetLastNavigationTimeResponse::ID) &&
+ AutomationMsg_GetLastNavigationTimeResponse::Read(response, nav_time);
scoped_ptr<IPC::Message> auto_deleter(response);
- if (!success)
- return false;
-
- void* iter = NULL;
- response->ReadInt64(&iter, last_navigation_time);
- return true;
+ return success;
}
bool TabProxy::WaitForNavigation(int64 last_navigation_time) {
@@ -1034,17 +802,12 @@ bool TabProxy::WaitForNavigation(int64 last_navigation_time) {
IPC::Message* response = NULL;
bool success = sender_->SendAndWaitForResponse(
- new AutomationMsg_WaitForNavigationRequest(0,
- handle_,
- last_navigation_time),
- &response,
- AutomationMsg_WaitForNavigationResponse::ID);
+ new AutomationMsg_WaitForNavigationRequest(
+ 0, handle_, last_navigation_time),
+ &response, AutomationMsg_WaitForNavigationResponse::ID) &&
+ AutomationMsg_WaitForNavigationResponse::Read(response, &success) &&
+ success;
scoped_ptr<IPC::Message> auto_deleter(response);
- if (!success)
- return false;
-
- void* iter = NULL;
- response->ReadBool(&iter, &success);
return success;
}
@@ -1055,15 +818,9 @@ bool TabProxy::GetPageCurrentEncoding(std::wstring* encoding) {
IPC::Message* response;
bool succeeded = sender_->SendAndWaitForResponse(
new AutomationMsg_GetPageCurrentEncodingRequest(0, handle_),
- &response,
- AutomationMsg_GetPageCurrentEncodingResponse::ID);
-
- scoped_ptr<IPC::Message> response_deleter(response); // Delete on return.
- if (!succeeded)
- return false;
-
- void* iter = NULL;
- succeeded = response->ReadWString(&iter, encoding);
+ &response, AutomationMsg_GetPageCurrentEncodingResponse::ID) &&
+ AutomationMsg_GetPageCurrentEncodingResponse::Read(response, encoding);
+ scoped_ptr<IPC::Message> response_deleter(response);
return succeeded;
}
@@ -1074,15 +831,9 @@ bool TabProxy::OverrideEncoding(const std::wstring& encoding) {
IPC::Message* response;
bool succeeded = sender_->SendAndWaitForResponse(
new AutomationMsg_OverrideEncodingRequest(0, handle_, encoding),
- &response,
- AutomationMsg_OverrideEncodingResponse::ID);
-
- scoped_ptr<IPC::Message> response_deleter(response); // Delete on return.
- if (!succeeded)
- return false;
-
- void* iter = NULL;
- bool successed_set_value = false;
- succeeded = response->ReadBool(&iter, &successed_set_value);
- return succeeded && successed_set_value;
+ &response, AutomationMsg_OverrideEncodingResponse::ID) &&
+ AutomationMsg_OverrideEncodingResponse::Read(response, &succeeded) &&
+ succeeded;
+ scoped_ptr<IPC::Message> response_deleter(response);
+ return succeeded;
}
diff --git a/chrome/test/unit/unit_tests.scons b/chrome/test/unit/unit_tests.scons
index d51503b..d0a06fe 100644
--- a/chrome/test/unit/unit_tests.scons
+++ b/chrome/test/unit/unit_tests.scons
@@ -207,7 +207,6 @@ input_files = ChromeFileList([
'$CHROME_DIR/common/gfx/icon_util_unittest.cc',
'$CHROME_DIR/common/ipc_message_unittest.cc',
'$CHROME_DIR/common/ipc_sync_channel_unittest.cc',
- '$CHROME_DIR/common/ipc_sync_channel_unittest.h',
'$CHROME_DIR/common/ipc_sync_message_unittest.cc',
'$CHROME_DIR/common/ipc_sync_message_unittest.h',
'$CHROME_DIR/common/json_value_serializer_unittest.cc',
diff --git a/chrome/test/unit/unittests.vcproj b/chrome/test/unit/unittests.vcproj
index fbd1da5..0dfb9f3 100644
--- a/chrome/test/unit/unittests.vcproj
+++ b/chrome/test/unit/unittests.vcproj
@@ -879,10 +879,6 @@
>
</File>
<File
- RelativePath="..\..\common\ipc_sync_channel_unittest.h"
- >
- </File>
- <File
RelativePath="..\..\common\ipc_sync_message_unittest.cc"
>
</File>
diff --git a/webkit/glue/glue_accessibility.cc b/webkit/glue/glue_accessibility.cc
index 2d0c8f4..86c00f9 100644
--- a/webkit/glue/glue_accessibility.cc
+++ b/webkit/glue/glue_accessibility.cc
@@ -17,6 +17,7 @@
#include "webkit/glue/glue_accessibility.h"
#include "base/ref_counted.h"
+#include "chrome/common/render_messages.h"
#include "webkit/glue/webframe_impl.h"
#include "webkit/glue/webview_impl.h"
diff --git a/webkit/glue/glue_accessibility.h b/webkit/glue/glue_accessibility.h
index b801582..1a97857 100644
--- a/webkit/glue/glue_accessibility.h
+++ b/webkit/glue/glue_accessibility.h
@@ -14,9 +14,11 @@ class IAccessible;
#endif
#include "base/hash_tables.h"
-#include "chrome/common/render_messages.h"
+#include "base/ref_counted.h"
class WebView;
+struct ViewMsg_Accessibility_In_Params;
+struct ViewHostMsg_Accessibility_Out_Params;
template <typename T> class COMPtr;