From c3ba22415e82f2e91101939394c0690de0835826 Mon Sep 17 00:00:00 2001 From: "darin@chromium.org" Date: Tue, 31 Mar 2009 18:29:15 +0000 Subject: Fix unit test failures caused by bad ParamTraits for WebString. TBR=agl Review URL: http://codereview.chromium.org/57067 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12884 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/common/render_messages.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'chrome') diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h index e144a3a..530e311 100644 --- a/chrome/common/render_messages.h +++ b/chrome/common/render_messages.h @@ -375,15 +375,15 @@ struct ParamTraits { typedef WebKit::WebString param_type; static void Write(Message* m, const param_type& p) { m->WriteData(reinterpret_cast(p.data()), - static_cast(p.length())); + static_cast(p.length() * sizeof(WebKit::WebUChar))); } static bool Read(const Message* m, void** iter, param_type* p) { const char* data; - int length; - if (!m->ReadData(iter, &data, &length)) + int data_len; + if (!m->ReadData(iter, &data, &data_len)) return false; p->assign(reinterpret_cast(data), - static_cast(length)); + static_cast(data_len / sizeof(WebKit::WebUChar))); return true; } static void Log(const param_type& p, std::wstring* l) { -- cgit v1.1