diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-05 22:52:35 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-05 22:52:35 +0000 |
commit | 9fe90b765b5500b3bc0ce5af44b9edf420fef97c (patch) | |
tree | 4db624130769a67400083372e0021f243e853a32 /webkit/glue/webframe_impl.cc | |
parent | 3fa4dc09b5897c11303a49fe5e893dbb0c21fc01 (diff) | |
download | chromium_src-9fe90b765b5500b3bc0ce5af44b9edf420fef97c.zip chromium_src-9fe90b765b5500b3bc0ce5af44b9edf420fef97c.tar.gz chromium_src-9fe90b765b5500b3bc0ce5af44b9edf420fef97c.tar.bz2 |
Enabled WebFrameTest, refactored some test shell functions.
Review URL: http://codereview.chromium.org/9391
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4834 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webframe_impl.cc')
-rw-r--r-- | webkit/glue/webframe_impl.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/webkit/glue/webframe_impl.cc b/webkit/glue/webframe_impl.cc index a84a104..6c1c897 100644 --- a/webkit/glue/webframe_impl.cc +++ b/webkit/glue/webframe_impl.cc @@ -125,6 +125,7 @@ MSVC_PUSH_WARNING_LEVEL(0); MSVC_POP_WARNING(); #undef LOG +#include "base/basictypes.h" #include "base/gfx/bitmap_platform_device.h" #include "base/gfx/platform_canvas.h" #include "base/gfx/rect.h" @@ -223,7 +224,7 @@ static void FrameContentAsPlainText(int max_chars, Frame* frame, // size and also copy the results directly into a wstring, avoiding the // string conversion. for (TextIterator it(range.get()); !it.atEnd(); it.advance()) { - const wchar_t* chars = reinterpret_cast<const wchar_t*>(it.characters()); + const uint16* chars = reinterpret_cast<const uint16*>(it.characters()); if (!chars) { if (it.length() != 0) { // It appears from crash reports that an iterator can get into a state @@ -246,7 +247,9 @@ static void FrameContentAsPlainText(int max_chars, Frame* frame, } int to_append = std::min(it.length(), max_chars - static_cast<int>(output->size())); - output->append(chars, to_append); + std::wstring wstr; + UTF16ToWide(reinterpret_cast<const char16*>(chars), to_append, &wstr); + output->append(wstr.c_str(), to_append); if (output->size() >= static_cast<size_t>(max_chars)) return; // Filled up the buffer. } |