diff options
Diffstat (limited to 'chrome/common/ipc_message_utils.cc')
-rw-r--r-- | chrome/common/ipc_message_utils.cc | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/chrome/common/ipc_message_utils.cc b/chrome/common/ipc_message_utils.cc index 8a29ccd..2512ff4 100644 --- a/chrome/common/ipc_message_utils.cc +++ b/chrome/common/ipc_message_utils.cc @@ -8,7 +8,6 @@ #include "googleurl/src/gurl.h" #include "SkBitmap.h" #include "webkit/glue/dom_operations.h" -#include "webkit/glue/webcursor.h" namespace IPC { @@ -44,13 +43,6 @@ struct SkBitmap_Data { } }; -struct WebCursor_Data { - WebCursor::Type cursor_type; - int hotspot_x; - int hotspot_y; - SkBitmap_Data bitmap_info; -}; - } // namespace @@ -182,73 +174,6 @@ void ParamTraits<gfx::Size>::Log(const gfx::Size& p, std::wstring* l) { l->append(StringPrintf(L"(%d, %d)", p.width(), p.height())); } - -void ParamTraits<WebCursor>::Write(Message* m, const WebCursor& p) { - const SkBitmap& src_bitmap = p.bitmap(); - WebCursor_Data web_cursor_info; - web_cursor_info.cursor_type = p.type(); - web_cursor_info.hotspot_x = p.hotspot_x(); - web_cursor_info.hotspot_y = p.hotspot_y(); - web_cursor_info.bitmap_info.InitSkBitmapDataForTransfer(src_bitmap); - - size_t fixed_data = sizeof(web_cursor_info); - m->WriteData(reinterpret_cast<const char*>(&web_cursor_info), - static_cast<int>(fixed_data)); - size_t pixel_size = src_bitmap.getSize(); - m->WriteBool(pixel_size != 0); - if (pixel_size) { - SkAutoLockPixels src_bitmap_lock(src_bitmap); - m->WriteData(reinterpret_cast<const char*>(src_bitmap.getPixels()), - static_cast<int>(pixel_size)); - } -} - -bool ParamTraits<WebCursor>::Read(const Message* m, void** iter, WebCursor* r) { - const char* fixed_data = NULL; - int fixed_data_size = 0; - if (!m->ReadData(iter, &fixed_data, &fixed_data_size) || - (fixed_data_size <= 0)) { - NOTREACHED(); - return false; - } - DCHECK(fixed_data_size == sizeof(WebCursor_Data)); - - const WebCursor_Data* web_cursor_info = - reinterpret_cast<const WebCursor_Data*>(fixed_data); - - bool variable_data_avail; - if (!m->ReadBool(iter, &variable_data_avail)) { - NOTREACHED(); - return false; - } - - // No variable data indicates that this is not a custom cursor. - if (variable_data_avail) { - const char* variable_data = NULL; - int variable_data_size = 0; - if (!m->ReadData(iter, &variable_data, &variable_data_size) || - variable_data_size <= 0) { - NOTREACHED(); - return false; - } - - SkBitmap dest_bitmap; - web_cursor_info->bitmap_info.InitSkBitmapFromData(&dest_bitmap, - variable_data, - variable_data_size); - r->set_bitmap(dest_bitmap); - r->set_hotspot(web_cursor_info->hotspot_x, web_cursor_info->hotspot_y); - } - - r->set_type(web_cursor_info->cursor_type); - return true; -} - -void ParamTraits<WebCursor>::Log(const WebCursor& p, std::wstring* l) { - l->append(L"<WebCursor>"); -} - - void ParamTraits<webkit_glue::WebApplicationInfo>::Write( Message* m, const webkit_glue::WebApplicationInfo& p) { WriteParam(m, p.title); |