diff options
-rw-r--r-- | base/pickle.cc | 14 | ||||
-rw-r--r-- | base/pickle.h | 4 | ||||
-rw-r--r-- | chrome/chrome.xcodeproj/project.pbxproj | 4 | ||||
-rw-r--r-- | chrome/common/common.scons | 4 | ||||
-rw-r--r-- | chrome/common/ipc_message_utils.h | 18 | ||||
-rw-r--r-- | webkit/glue/webinputevent.h | 6 | ||||
-rw-r--r-- | webkit/glue/webinputevent_mac.mm | 6 |
7 files changed, 42 insertions, 14 deletions
diff --git a/base/pickle.cc b/base/pickle.cc index f6ed4cc..aac59df 100644 --- a/base/pickle.cc +++ b/base/pickle.cc @@ -144,6 +144,20 @@ bool Pickle::ReadSize(void** iter, size_t* result) const { return true; } +bool Pickle::ReadUInt32(void** iter, uint32* result) const { + DCHECK(iter); + if (!*iter) + *iter = const_cast<char*>(payload()); + + if (!IteratorHasRoomFor(*iter, sizeof(*result))) + return false; + + memcpy(result, *iter, sizeof(*result)); + + UpdateIter(iter, sizeof(*result)); + return true; +} + bool Pickle::ReadInt64(void** iter, int64* result) const { DCHECK(iter); if (!*iter) diff --git a/base/pickle.h b/base/pickle.h index 3a17007..66340ca 100644 --- a/base/pickle.h +++ b/base/pickle.h @@ -67,6 +67,7 @@ class Pickle { bool ReadInt(void** iter, int* result) const; bool ReadLong(void** iter, long* result) const; bool ReadSize(void** iter, size_t* result) const; + bool ReadUInt32(void** iter, uint32* result) const; bool ReadInt64(void** iter, int64* result) const; bool ReadIntPtr(void** iter, intptr_t* result) const; bool ReadString(void** iter, std::string* result) const; @@ -94,6 +95,9 @@ class Pickle { bool WriteSize(size_t value) { return WriteBytes(&value, sizeof(value)); } + bool WriteUInt32(uint32 value) { + return WriteBytes(&value, sizeof(value)); + } bool WriteInt64(int64 value) { return WriteBytes(&value, sizeof(value)); } diff --git a/chrome/chrome.xcodeproj/project.pbxproj b/chrome/chrome.xcodeproj/project.pbxproj index e414777..8a3e1c9 100644 --- a/chrome/chrome.xcodeproj/project.pbxproj +++ b/chrome/chrome.xcodeproj/project.pbxproj @@ -164,7 +164,9 @@ B562E2D50F05834500FB1A4F /* chrome_canvas.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D7BFCA90E9D4D5D009A6919 /* chrome_canvas.cc */; }; B562E2F80F05843C00FB1A4F /* property_bag.cc in Sources */ = {isa = PBXBuildFile; fileRef = B562E2F60F05843C00FB1A4F /* property_bag.cc */; }; B562E2FC0F05845100FB1A4F /* property_bag_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = B562E2F40F05843C00FB1A4F /* property_bag_unittest.cc */; }; + B56E281B0F057F2800447108 /* message_router.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D7BFBD10E9D4C9F009A6919 /* message_router.cc */; }; B5DBEA900EFC60E200C95176 /* ipc_channel_proxy.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D7BFBAB0E9D4C9F009A6919 /* ipc_channel_proxy.cc */; }; + B5E98B140F0574A8000A37D6 /* render_messages.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D7BFBF10E9D4C9F009A6919 /* render_messages.cc */; }; B5FDC0580EE488E500BEC6E6 /* ipc_channel_posix.cc in Sources */ = {isa = PBXBuildFile; fileRef = B5FDC0570EE488E500BEC6E6 /* ipc_channel_posix.cc */; }; B5FDC1CA0EE48ADB00BEC6E6 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D7BFDD10E9D5295009A6919 /* CoreFoundation.framework */; }; B5FDC1CC0EE48ADB00BEC6E6 /* libbase.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D7BFDC70E9D525B009A6919 /* libbase.a */; }; @@ -3282,11 +3284,13 @@ E4F3242C0EE5CBBF002533CE /* logging_chrome.cc in Sources */, B562C8430ED49C830077A23F /* mach_ipc_mac.mm in Sources */, B54BD8FC0ED622C00093FD54 /* mach_message_source_mac.cc in Sources */, + B56E281B0F057F2800447108 /* message_router.cc in Sources */, E4F324300EE5CBEB002533CE /* notification_registrar.cc in Sources */, 4D7BFC5C0E9D4D24009A6919 /* notification_service.cc in Sources */, 4D7BFC710E9D4D28009A6919 /* pref_member.cc in Sources */, 4D7BFC7A0E9D4D2B009A6919 /* pref_names.cc in Sources */, B562E2F80F05843C00FB1A4F /* property_bag.cc in Sources */, + B5E98B140F0574A8000A37D6 /* render_messages.cc in Sources */, 4D7BFC7F0E9D4D2E009A6919 /* slide_animation.cc in Sources */, 4D7BFC840E9D4D32009A6919 /* sqlite_compiled_statement.cc in Sources */, 4D7BFC8B0E9D4D35009A6919 /* sqlite_utils.cc in Sources */, diff --git a/chrome/common/common.scons b/chrome/common/common.scons index 8edc509..a86aa6b 100644 --- a/chrome/common/common.scons +++ b/chrome/common/common.scons @@ -60,12 +60,14 @@ input_files.extend([ 'json_value_serializer.cc', 'libxml_utils.cc', 'logging_chrome.cc', + 'message_router.cc', 'net/cookie_monster_sqlite.cc', 'notification_registrar.cc', 'notification_service.cc', 'pref_member.cc', 'pref_names.cc', 'property_bag.cc', + 'render_messages.cc', 'slide_animation.cc', 'sqlite_compiled_statement.cc', 'sqlite_utils.cc', @@ -100,12 +102,10 @@ if env.Bit('windows'): 'ipc_sync_channel.cc', 'jstemplate_builder.cc', 'l10n_util.cc', - 'message_router.cc', 'net/url_request_intercept_job.cc', 'os_exchange_data.cc', 'plugin_messages.cc', 'process_watcher.cc', - 'render_messages.cc', 'resource_bundle.cc', 'resource_dispatcher.cc', 'security_filter_peer.cc', diff --git a/chrome/common/ipc_message_utils.h b/chrome/common/ipc_message_utils.h index b01d037..4234737 100644 --- a/chrome/common/ipc_message_utils.h +++ b/chrome/common/ipc_message_utils.h @@ -161,6 +161,24 @@ struct ParamTraits<size_t> { } }; +#if defined(OS_MACOSX) +// On Linux size_t & uint32 can be the same type. +// TODO(playmobil): Fix compilation if this is not the case. +template <> +struct ParamTraits<uint32> { + typedef uint32 param_type; + static void Write(Message* m, const param_type& p) { + m->WriteUInt32(p); + } + static bool Read(const Message* m, void** iter, param_type* r) { + return m->ReadUInt32(iter, r); + } + static void Log(const param_type& p, std::wstring* l) { + l->append(StringPrintf(L"%u", p)); + } +}; +#endif // defined(OS_MACOSX) + template <> struct ParamTraits<int64> { typedef int64 param_type; diff --git a/webkit/glue/webinputevent.h b/webkit/glue/webinputevent.h index e347cda..9a1c84d 100644 --- a/webkit/glue/webinputevent.h +++ b/webkit/glue/webinputevent.h @@ -11,7 +11,6 @@ #include <windows.h> #elif defined(OS_MACOSX) #include <vector> -#include <wtf/RetainPtr.h> #ifdef __OBJC__ @class NSEvent; @class NSView; @@ -70,11 +69,6 @@ class WebInputEvent { Type type; int modifiers; -#if defined(OS_MACOSX) - // For now, good enough for the test shell. TODO(avi): Revisit when we need - // to start sending this over an IPC pipe. - RetainPtr<NSEvent> mac_event; -#endif }; // WebMouseEvent -------------------------------------------------------------- diff --git a/webkit/glue/webinputevent_mac.mm b/webkit/glue/webinputevent_mac.mm index e3f6af6..3090d96 100644 --- a/webkit/glue/webinputevent_mac.mm +++ b/webkit/glue/webinputevent_mac.mm @@ -89,8 +89,6 @@ WebMouseEvent::WebMouseEvent(NSEvent *event, NSView* view) { timestamp_sec = [event timestamp]; layout_test_click_count = 0; - - mac_event = event; // retains |event| } // WebMouseWheelEvent --------------------------------------------------------- @@ -130,8 +128,6 @@ WebMouseWheelEvent::WebMouseWheelEvent(NSEvent *event, NSView* view) { modifiers |= SHIFT_KEY; if ([event modifierFlags] & NSAlternateKeyMask) modifiers |= ALT_KEY; - - mac_event = event; // retains |event| } // WebKeyboardEvent ----------------------------------------------------------- @@ -964,6 +960,4 @@ WebKeyboardEvent::WebKeyboardEvent(NSEvent *event) { FillVectorFromNSString(&key_identifier, identStr); key_code = WebCore::windowsKeyCodeForKeyEvent(event); - - mac_event = event; // retains |event| } |