diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-31 18:29:15 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-31 18:29:15 +0000 |
commit | c3ba22415e82f2e91101939394c0690de0835826 (patch) | |
tree | f62620e69a0f52a5b77056bf6fdc088e61232b65 /chrome | |
parent | 27a09bc3738310cc791335f37ab1bf1fc43dec5b (diff) | |
download | chromium_src-c3ba22415e82f2e91101939394c0690de0835826.zip chromium_src-c3ba22415e82f2e91101939394c0690de0835826.tar.gz chromium_src-c3ba22415e82f2e91101939394c0690de0835826.tar.bz2 |
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
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/common/render_messages.h | 8 |
1 files changed, 4 insertions, 4 deletions
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<WebKit::WebString> { typedef WebKit::WebString param_type; static void Write(Message* m, const param_type& p) { m->WriteData(reinterpret_cast<const char*>(p.data()), - static_cast<int>(p.length())); + static_cast<int>(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<const WebKit::WebUChar*>(data), - static_cast<size_t>(length)); + static_cast<size_t>(data_len / sizeof(WebKit::WebUChar))); return true; } static void Log(const param_type& p, std::wstring* l) { |