summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-11 16:52:42 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-11 16:52:42 +0000
commit13d49eaf47a59c68f952b5470d11afdd7bdce396 (patch)
treedc0a665d456b121f81113f2377f7fcd6e42eb683 /chrome
parentaefa99e2b6abcb3e1b347d10d2b9a0e4110c68f7 (diff)
downloadchromium_src-13d49eaf47a59c68f952b5470d11afdd7bdce396.zip
chromium_src-13d49eaf47a59c68f952b5470d11afdd7bdce396.tar.gz
chromium_src-13d49eaf47a59c68f952b5470d11afdd7bdce396.tar.bz2
Revert "FBTF: Allow forward declaration of classes passed to sync IPC messages."
This reverts commit r55735. BUG=none TEST=none TBR=mirandac Review URL: http://codereview.chromium.org/3152007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55738 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/renderer_host/resource_message_filter_win.cc1
-rw-r--r--chrome/chrome_common.gypi1
-rw-r--r--chrome/common/render_messages.cc63
-rw-r--r--chrome/common/render_messages.h57
-rw-r--r--chrome/common/render_messages_unittest.cc2
-rw-r--r--chrome/common/webkit_param_traits.cc131
-rw-r--r--chrome/common/webkit_param_traits.h118
-rw-r--r--chrome/renderer/render_view.cc2
8 files changed, 149 insertions, 226 deletions
diff --git a/chrome/browser/renderer_host/resource_message_filter_win.cc b/chrome/browser/renderer_host/resource_message_filter_win.cc
index 4a8c46e..aa53422 100644
--- a/chrome/browser/renderer_host/resource_message_filter_win.cc
+++ b/chrome/browser/renderer_host/resource_message_filter_win.cc
@@ -4,7 +4,6 @@
#include "chrome/browser/renderer_host/resource_message_filter.h"
#include "chrome/common/render_messages.h"
-#include "third_party/WebKit/WebKit/chromium/public/WebScreenInfo.h"
#include "third_party/WebKit/WebKit/chromium/public/win/WebScreenInfoFactory.h"
using WebKit::WebScreenInfo;
diff --git a/chrome/chrome_common.gypi b/chrome/chrome_common.gypi
index 28135c5c3..c60359f 100644
--- a/chrome/chrome_common.gypi
+++ b/chrome/chrome_common.gypi
@@ -286,7 +286,6 @@
'common/visitedlink_common.h',
'common/web_database_observer_impl.cc',
'common/web_database_observer_impl.h',
- 'common/webkit_param_traits.cc',
'common/webkit_param_traits.h',
'common/webmessageportchannel_impl.cc',
'common/webmessageportchannel_impl.h',
diff --git a/chrome/common/render_messages.cc b/chrome/common/render_messages.cc
index 04a258c..68aa81d 100644
--- a/chrome/common/render_messages.cc
+++ b/chrome/common/render_messages.cc
@@ -5,71 +5,8 @@
#include "chrome/common/render_messages.h"
#include "chrome/common/thumbnail_score.h"
-#include "third_party/WebKit/WebKit/chromium/public/WebCompositionUnderline.h"
-#include "third_party/WebKit/WebKit/chromium/public/WebFindOptions.h"
-#include "third_party/WebKit/WebKit/chromium/public/WebScreenInfo.h"
-#include "webkit/glue/webaccessibility.h"
#include "webkit/glue/webcursor.h"
#define MESSAGES_INTERNAL_IMPL_FILE \
"chrome/common/render_messages_internal.h"
#include "ipc/ipc_message_impl_macros.h"
-
-namespace IPC {
-
-void ParamTraits<webkit_glue::WebAccessibility>::Write(Message* m,
- const param_type& p) {
- WriteParam(m, p.id);
- WriteParam(m, p.name);
- WriteParam(m, p.value);
- WriteParam(m, static_cast<int>(p.role));
- WriteParam(m, static_cast<int>(p.state));
- WriteParam(m, p.location);
- WriteParam(m, p.attributes);
- WriteParam(m, p.children);
-}
-
-bool ParamTraits<webkit_glue::WebAccessibility>::Read(
- const Message* m, void** iter, param_type* p) {
- bool ret = ReadParam(m, iter, &p->id);
- ret = ret && ReadParam(m, iter, &p->name);
- ret = ret && ReadParam(m, iter, &p->value);
- int role = -1;
- ret = ret && ReadParam(m, iter, &role);
- if (role >= webkit_glue::WebAccessibility::ROLE_NONE &&
- role < webkit_glue::WebAccessibility::NUM_ROLES) {
- p->role = static_cast<webkit_glue::WebAccessibility::Role>(role);
- } else {
- p->role = webkit_glue::WebAccessibility::ROLE_NONE;
- }
- int state = 0;
- ret = ret && ReadParam(m, iter, &state);
- p->state = static_cast<webkit_glue::WebAccessibility::State>(state);
- ret = ret && ReadParam(m, iter, &p->location);
- ret = ret && ReadParam(m, iter, &p->attributes);
- ret = ret && ReadParam(m, iter, &p->children);
- return ret;
-}
-
-void ParamTraits<webkit_glue::WebAccessibility>::Log(const param_type& p,
- std::wstring* l) {
- l->append(L"(");
- LogParam(p.id, l);
- l->append(L", ");
- LogParam(p.name, l);
- l->append(L", ");
- LogParam(p.value, l);
- l->append(L", ");
- LogParam(static_cast<int>(p.role), l);
- l->append(L", ");
- LogParam(static_cast<int>(p.state), l);
- l->append(L", ");
- LogParam(p.location, l);
- l->append(L", ");
- LogParam(p.attributes, l);
- l->append(L", ");
- LogParam(p.children, l);
- l->append(L")");
-}
-
-} // namespace IPC
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h
index 8dc63a9..e45d79d 100644
--- a/chrome/common/render_messages.h
+++ b/chrome/common/render_messages.h
@@ -52,6 +52,7 @@
#include "webkit/glue/plugins/webplugin.h"
#include "webkit/glue/plugins/webplugininfo.h"
#include "webkit/glue/resource_loader_bridge.h"
+#include "webkit/glue/webaccessibility.h"
#include "webkit/glue/webcookie.h"
#include "webkit/glue/webdropdata.h"
#include "webkit/glue/webmenuitem.h"
@@ -61,10 +62,6 @@ namespace base {
class Time;
}
-namespace webkit_glue {
-struct WebAccessibility;
-}
-
class SkBitmap;
// Parameters structure for ViewMsg_Navigate, which has too many data
@@ -3325,9 +3322,55 @@ struct ParamTraits<WindowContainerType> {
template <>
struct ParamTraits<webkit_glue::WebAccessibility> {
typedef webkit_glue::WebAccessibility param_type;
- static void Write(Message* m, const param_type& p);
- static bool Read(const Message* m, void** iter, param_type* p);
- static void Log(const param_type& p, std::wstring* l);
+ static void Write(Message* m, const param_type& p) {
+ WriteParam(m, p.id);
+ WriteParam(m, p.name);
+ WriteParam(m, p.value);
+ WriteParam(m, static_cast<int>(p.role));
+ WriteParam(m, static_cast<int>(p.state));
+ WriteParam(m, p.location);
+ WriteParam(m, p.attributes);
+ WriteParam(m, p.children);
+ }
+ static bool Read(const Message* m, void** iter, param_type* p) {
+ bool ret = ReadParam(m, iter, &p->id);
+ ret = ret && ReadParam(m, iter, &p->name);
+ ret = ret && ReadParam(m, iter, &p->value);
+ int role = -1;
+ ret = ret && ReadParam(m, iter, &role);
+ if (role >= webkit_glue::WebAccessibility::ROLE_NONE &&
+ role < webkit_glue::WebAccessibility::NUM_ROLES) {
+ p->role = static_cast<webkit_glue::WebAccessibility::Role>(role);
+ } else {
+ p->role = webkit_glue::WebAccessibility::ROLE_NONE;
+ }
+ int state = 0;
+ ret = ret && ReadParam(m, iter, &state);
+ p->state = static_cast<webkit_glue::WebAccessibility::State>(state);
+ ret = ret && ReadParam(m, iter, &p->location);
+ ret = ret && ReadParam(m, iter, &p->attributes);
+ ret = ret && ReadParam(m, iter, &p->children);
+ return ret;
+ }
+ static void Log(const param_type& p, std::wstring* l) {
+ l->append(L"(");
+ LogParam(p.id, l);
+ l->append(L", ");
+ LogParam(p.name, l);
+ l->append(L", ");
+ LogParam(p.value, l);
+ l->append(L", ");
+ LogParam(static_cast<int>(p.role), l);
+ l->append(L", ");
+ LogParam(static_cast<int>(p.state), l);
+ l->append(L", ");
+ LogParam(p.location, l);
+ l->append(L", ");
+ LogParam(p.attributes, l);
+ l->append(L", ");
+ LogParam(p.children, l);
+ l->append(L")");
+ }
};
// Traits for ViewMsg_DeviceOrientationUpdated_Params
diff --git a/chrome/common/render_messages_unittest.cc b/chrome/common/render_messages_unittest.cc
index 4fc0aab..ccfc898 100644
--- a/chrome/common/render_messages_unittest.cc
+++ b/chrome/common/render_messages_unittest.cc
@@ -7,8 +7,6 @@
#include "base/utf_string_conversions.h"
#include "chrome/common/render_messages.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "webkit/glue/webaccessibility.h"
-#include "third_party/WebKit/WebKit/chromium/public/WebRect.h"
TEST(RenderMessagesUnittest, WebAccessibility) {
// Test a simple case.
diff --git a/chrome/common/webkit_param_traits.cc b/chrome/common/webkit_param_traits.cc
deleted file mode 100644
index 06ee1e2..0000000
--- a/chrome/common/webkit_param_traits.cc
+++ /dev/null
@@ -1,131 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/common/webkit_param_traits.h"
-
-#include "third_party/WebKit/WebKit/chromium/public/WebCompositionUnderline.h"
-#include "third_party/WebKit/WebKit/chromium/public/WebFindOptions.h"
-#include "third_party/WebKit/WebKit/chromium/public/WebScreenInfo.h"
-
-namespace IPC {
-
-void ParamTraits<WebKit::WebRect>::Write(Message* m, const param_type& p) {
- WriteParam(m, p.x);
- WriteParam(m, p.y);
- WriteParam(m, p.width);
- WriteParam(m, p.height);
- }
-
-bool ParamTraits<WebKit::WebRect>::Read(const Message* m, void** iter,
- param_type* p) {
- return
- ReadParam(m, iter, &p->x) &&
- ReadParam(m, iter, &p->y) &&
- ReadParam(m, iter, &p->width) &&
- ReadParam(m, iter, &p->height);
-}
-
-void ParamTraits<WebKit::WebRect>::Log(const param_type& p, std::wstring* l) {
- l->append(L"(");
- LogParam(p.x, l);
- l->append(L", ");
- LogParam(p.y, l);
- l->append(L", ");
- LogParam(p.width, l);
- l->append(L", ");
- LogParam(p.height, l);
- l->append(L")");
-}
-
-void ParamTraits<WebKit::WebScreenInfo>::Write(Message* m, const param_type& p) {
- WriteParam(m, p.depth);
- WriteParam(m, p.depthPerComponent);
- WriteParam(m, p.isMonochrome);
- WriteParam(m, p.rect);
- WriteParam(m, p.availableRect);
-}
-
-bool ParamTraits<WebKit::WebScreenInfo>::Read(const Message* m, void** iter,
- param_type* p) {
- return
- ReadParam(m, iter, &p->depth) &&
- ReadParam(m, iter, &p->depthPerComponent) &&
- ReadParam(m, iter, &p->isMonochrome) &&
- ReadParam(m, iter, &p->rect) &&
- ReadParam(m, iter, &p->availableRect);
-}
-
-void ParamTraits<WebKit::WebScreenInfo>::Log(const param_type& p,
- std::wstring* l) {
- l->append(L"(");
- LogParam(p.depth, l);
- l->append(L", ");
- LogParam(p.depthPerComponent, l);
- l->append(L", ");
- LogParam(p.isMonochrome, l);
- l->append(L", ");
- LogParam(p.rect, l);
- l->append(L", ");
- LogParam(p.availableRect, l);
- l->append(L")");
-}
-
-void ParamTraits<WebKit::WebFindOptions>::Write(Message* m,
- const param_type& p) {
- WriteParam(m, p.forward);
- WriteParam(m, p.matchCase);
- WriteParam(m, p.findNext);
-}
-
-bool ParamTraits<WebKit::WebFindOptions>::Read(const Message* m, void** iter,
- param_type* p) {
- return
- ReadParam(m, iter, &p->forward) &&
- ReadParam(m, iter, &p->matchCase) &&
- ReadParam(m, iter, &p->findNext);
-}
-
-void ParamTraits<WebKit::WebFindOptions>::Log(const param_type& p,
- std::wstring* l) {
- l->append(L"(");
- LogParam(p.forward, l);
- l->append(L", ");
- LogParam(p.matchCase, l);
- l->append(L", ");
- LogParam(p.findNext, l);
- l->append(L")");
-}
-
-void ParamTraits<WebKit::WebCompositionUnderline>::Write(Message* m,
- const param_type& p) {
- WriteParam(m, p.startOffset);
- WriteParam(m, p.endOffset);
- WriteParam(m, p.color);
- WriteParam(m, p.thick);
-}
-
-bool ParamTraits<WebKit::WebCompositionUnderline>::Read(
- const Message* m, void** iter,
- param_type* p) {
- return
- ReadParam(m, iter, &p->startOffset) &&
- ReadParam(m, iter, &p->endOffset) &&
- ReadParam(m, iter, &p->color) &&
- ReadParam(m, iter, &p->thick);
-}
-
-void ParamTraits<WebKit::WebCompositionUnderline>::Log(const param_type& p,
- std::wstring* l) {
- l->append(L"(");
- LogParam(p.startOffset, l);
- l->append(L",");
- LogParam(p.endOffset, l);
- l->append(L":");
- LogParam(p.color, l);
- l->append(L":");
- LogParam(p.thick, l);
- l->append(L")");
-}
-
-} // namespace IPC
diff --git a/chrome/common/webkit_param_traits.h b/chrome/common/webkit_param_traits.h
index 4b0433a..748c26b 100644
--- a/chrome/common/webkit_param_traits.h
+++ b/chrome/common/webkit_param_traits.h
@@ -26,38 +26,80 @@
#include "ipc/ipc_message_utils.h"
#include "third_party/WebKit/WebKit/chromium/public/WebCache.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebCompositionUnderline.h"
#include "third_party/WebKit/WebKit/chromium/public/WebConsoleMessage.h"
#include "third_party/WebKit/WebKit/chromium/public/WebContextMenuData.h"
#include "third_party/WebKit/WebKit/chromium/public/WebDragOperation.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebFindOptions.h"
#include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h"
#include "third_party/WebKit/WebKit/chromium/public/WebMediaPlayerAction.h"
#include "third_party/WebKit/WebKit/chromium/public/WebPopupType.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebScreenInfo.h"
#include "third_party/WebKit/WebKit/chromium/public/WebTextDirection.h"
#include "third_party/WebKit/WebKit/chromium/public/WebTextInputType.h"
-namespace WebKit {
-struct WebCompositionUnderline;
-struct WebFindOptions;
-struct WebRect;
-struct WebScreenInfo;
-}
-
namespace IPC {
template <>
struct ParamTraits<WebKit::WebRect> {
typedef WebKit::WebRect param_type;
- static void Write(Message* m, const param_type& p);
- static bool Read(const Message* m, void** iter, param_type* p);
- static void Log(const param_type& p, std::wstring* l);
+ static void Write(Message* m, const param_type& p) {
+ WriteParam(m, p.x);
+ WriteParam(m, p.y);
+ WriteParam(m, p.width);
+ WriteParam(m, p.height);
+ }
+ static bool Read(const Message* m, void** iter, param_type* p) {
+ return
+ ReadParam(m, iter, &p->x) &&
+ ReadParam(m, iter, &p->y) &&
+ ReadParam(m, iter, &p->width) &&
+ ReadParam(m, iter, &p->height);
+ }
+ static void Log(const param_type& p, std::wstring* l) {
+ l->append(L"(");
+ LogParam(p.x, l);
+ l->append(L", ");
+ LogParam(p.y, l);
+ l->append(L", ");
+ LogParam(p.width, l);
+ l->append(L", ");
+ LogParam(p.height, l);
+ l->append(L")");
+ }
};
template <>
struct ParamTraits<WebKit::WebScreenInfo> {
typedef WebKit::WebScreenInfo param_type;
- static void Write(Message* m, const param_type& p);
- static bool Read(const Message* m, void** iter, param_type* p);
- static void Log(const param_type& p, std::wstring* l);
+ static void Write(Message* m, const param_type& p) {
+ WriteParam(m, p.depth);
+ WriteParam(m, p.depthPerComponent);
+ WriteParam(m, p.isMonochrome);
+ WriteParam(m, p.rect);
+ WriteParam(m, p.availableRect);
+ }
+ static bool Read(const Message* m, void** iter, param_type* p) {
+ return
+ ReadParam(m, iter, &p->depth) &&
+ ReadParam(m, iter, &p->depthPerComponent) &&
+ ReadParam(m, iter, &p->isMonochrome) &&
+ ReadParam(m, iter, &p->rect) &&
+ ReadParam(m, iter, &p->availableRect);
+ }
+ static void Log(const param_type& p, std::wstring* l) {
+ l->append(L"(");
+ LogParam(p.depth, l);
+ l->append(L", ");
+ LogParam(p.depthPerComponent, l);
+ l->append(L", ");
+ LogParam(p.isMonochrome, l);
+ l->append(L", ");
+ LogParam(p.rect, l);
+ l->append(L", ");
+ LogParam(p.availableRect, l);
+ l->append(L")");
+ }
};
template <>
@@ -99,9 +141,26 @@ struct ParamTraits<WebKit::WebPopupType> {
template <>
struct ParamTraits<WebKit::WebFindOptions> {
typedef WebKit::WebFindOptions param_type;
- static void Write(Message* m, const param_type& p);
- static bool Read(const Message* m, void** iter, param_type* p);
- static void Log(const param_type& p, std::wstring* l);
+ static void Write(Message* m, const param_type& p) {
+ WriteParam(m, p.forward);
+ WriteParam(m, p.matchCase);
+ WriteParam(m, p.findNext);
+ }
+ static bool Read(const Message* m, void** iter, param_type* p) {
+ return
+ ReadParam(m, iter, &p->forward) &&
+ ReadParam(m, iter, &p->matchCase) &&
+ ReadParam(m, iter, &p->findNext);
+ }
+ static void Log(const param_type& p, std::wstring* l) {
+ l->append(L"(");
+ LogParam(p.forward, l);
+ l->append(L", ");
+ LogParam(p.matchCase, l);
+ l->append(L", ");
+ LogParam(p.findNext, l);
+ l->append(L")");
+ }
};
template <>
@@ -319,9 +378,30 @@ template <>
template <>
struct ParamTraits<WebKit::WebCompositionUnderline> {
typedef WebKit::WebCompositionUnderline param_type;
- static void Write(Message* m, const param_type& p);
- static bool Read(const Message* m, void** iter, param_type* p);
- static void Log(const param_type& p, std::wstring* l);
+ static void Write(Message* m, const param_type& p) {
+ WriteParam(m, p.startOffset);
+ WriteParam(m, p.endOffset);
+ WriteParam(m, p.color);
+ WriteParam(m, p.thick);
+ }
+ static bool Read(const Message* m, void** iter, param_type* p) {
+ return
+ ReadParam(m, iter, &p->startOffset) &&
+ ReadParam(m, iter, &p->endOffset) &&
+ ReadParam(m, iter, &p->color) &&
+ ReadParam(m, iter, &p->thick);
+ }
+ static void Log(const param_type& p, std::wstring* l) {
+ l->append(L"(");
+ LogParam(p.startOffset, l);
+ l->append(L",");
+ LogParam(p.endOffset, l);
+ l->append(L":");
+ LogParam(p.color, l);
+ l->append(L":");
+ LogParam(p.thick, l);
+ l->append(L")");
+ }
};
template <>
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index d5b9b71..fbc73ed 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -95,7 +95,6 @@
#include "third_party/WebKit/WebKit/chromium/public/WebDocument.h"
#include "third_party/WebKit/WebKit/chromium/public/WebDragData.h"
#include "third_party/WebKit/WebKit/chromium/public/WebFileChooserParams.h"
-#include "third_party/WebKit/WebKit/chromium/public/WebFindOptions.h"
#include "third_party/WebKit/WebKit/chromium/public/WebFormControlElement.h"
#include "third_party/WebKit/WebKit/chromium/public/WebFormElement.h"
#include "third_party/WebKit/WebKit/chromium/public/WebFrame.h"
@@ -145,7 +144,6 @@
#include "webkit/glue/plugins/webplugin_impl.h"
#include "webkit/glue/plugins/webview_plugin.h"
#include "webkit/glue/site_isolation_metrics.h"
-#include "webkit/glue/webaccessibility.h"
#include "webkit/glue/webdropdata.h"
#include "webkit/glue/webkit_glue.h"
#include "webkit/glue/webmediaplayer_impl.h"