Changeset 104623 in webkit
- Timestamp:
- Jan 10, 2012, 1:14:16 PM (14 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r104622 r104623 1 2012-01-10 Anders Carlsson <andersca@apple.com> 2 3 DispatchOnConnectionQueue messages should have a Connection parameter 4 https://bugs.webkit.org/show_bug.cgi?id=75986 5 6 Reviewed by Adam Roben. 7 8 Message handlers for messages with the DispatchOnConnectionQueue should have a CoreIPC::Connection 9 parameter, making it easier to send messages back over that connection. 10 11 * Platform/CoreIPC/HandleMessage.h: 12 (CoreIPC::callMemberFunction): 13 (CoreIPC::handleMessageOnConnectionQueue): 14 * Scripts/webkit2/messages.py: 15 (async_case_statement): 16 (generate_message_handler): 17 * Scripts/webkit2/messages_unittest.py: 18 * WebProcess/WebPage/EventDispatcher.cpp: 19 (WebKit::EventDispatcher::wheelEvent): 20 (WebKit::EventDispatcher::gestureEvent): 21 * WebProcess/WebPage/EventDispatcher.h: 22 * WebProcess/WebProcess.cpp: 23 (WebKit::WebProcess::pluginProcessCrashed): 24 * WebProcess/WebProcess.h: 25 1 26 2012-01-10 Chris Marrin <cmarrin@apple.com> 2 27 -
trunk/Source/WebKit2/Platform/CoreIPC/HandleMessage.h
r95901 r104623 197 197 } 198 198 199 // Dispatch functions with connection parameter. 200 template<typename C, typename MF, typename P1> 201 void callMemberFunction(Connection* connection, const Arguments1<P1>& args, C* object, MF function) 202 { 203 (object->*function)(connection, args.argument1); 204 } 205 206 template<typename C, typename MF, typename P1, typename P2> 207 void callMemberFunction(Connection* connection, const Arguments2<P1, P2>& args, C* object, MF function) 208 { 209 (object->*function)(connection, args.argument1, args.argument2); 210 } 211 199 212 // Variadic dispatch functions. 200 213 … … 291 304 292 305 template<typename T, typename C, typename MF> 306 void handleMessageOnConnectionQueue(Connection* connection, ArgumentDecoder* argumentDecoder, C* object, MF function) 307 { 308 typename T::DecodeType::ValueType arguments; 309 if (!argumentDecoder->decode(arguments)) 310 return; 311 callMemberFunction(connection, arguments, object, function); 312 } 313 314 template<typename T, typename C, typename MF> 293 315 void handleMessageVariadic(ArgumentDecoder* argumentDecoder, C* object, MF function) 294 316 { -
trunk/Source/WebKit2/Scripts/webkit2/messages.py
r102615 r104623 312 312 313 313 314 def async_case_statement(receiver, message, statement_before_return=None): 314 def async_case_statement(receiver, message): 315 dispatch_function_args = ['arguments', 'this', '&%s' % handler_function(receiver, message)] 315 316 dispatch_function = 'handleMessage' 316 317 if message_is_variadic(message): 317 318 dispatch_function += 'Variadic' 318 319 if message.has_attribute(DISPATCH_ON_CONNECTION_QUEUE_ATTRIBUTE): 320 dispatch_function += 'OnConnectionQueue' 321 dispatch_function_args.insert(0, 'connection') 322 319 323 result = [] 320 324 result.append(' case Messages::%s::%s:\n' % (receiver.name, message.id())) 321 result.append(' CoreIPC::%s<Messages::%s::%s>(arguments, this, &%s);\n' % (dispatch_function, receiver.name, message.name, handler_function(receiver, message))) 322 if statement_before_return: 323 result.append(' %s\n' % statement_before_return) 325 326 result.append(' CoreIPC::%s<Messages::%s::%s>(%s);\n' % (dispatch_function, receiver.name, message.name, ', '.join(dispatch_function_args))) 327 if message.has_attribute(DISPATCH_ON_CONNECTION_QUEUE_ATTRIBUTE): 328 result.append(' didHandleMessage = true;\n') 324 329 result.append(' return;\n') 325 330 return surround_in_condition(''.join(result), message.condition) … … 534 539 535 540 if async_dispatch_on_connection_queue_messages: 536 result.append('void %s::didReceive%sMessageOnConnectionWorkQueue(CoreIPC::Connection* , CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, bool& didHandleMessage)\n' % (receiver.name, receiver.name))541 result.append('void %s::didReceive%sMessageOnConnectionWorkQueue(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, bool& didHandleMessage)\n' % (receiver.name, receiver.name)) 537 542 result.append('{\n') 538 543 result.append('#if COMPILER(MSVC)\n') … … 541 546 result.append('#endif\n') 542 547 result.append(' switch (messageID.get<Messages::%s::Kind>()) {\n' % receiver.name) 543 result += [async_case_statement(receiver, message , 'didHandleMessage = true;') for message in async_dispatch_on_connection_queue_messages]548 result += [async_case_statement(receiver, message) for message in async_dispatch_on_connection_queue_messages] 544 549 result.append(' default:\n') 545 550 result.append(' return;\n') -
trunk/Source/WebKit2/Scripts/webkit2/messages_unittest.py
r102615 r104623 686 686 namespace WebKit { 687 687 688 void WebPage::didReceiveWebPageMessageOnConnectionWorkQueue(CoreIPC::Connection* , CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, bool& didHandleMessage)688 void WebPage::didReceiveWebPageMessageOnConnectionWorkQueue(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, bool& didHandleMessage) 689 689 { 690 690 #if COMPILER(MSVC) … … 694 694 switch (messageID.get<Messages::WebPage::Kind>()) { 695 695 case Messages::WebPage::TestConnectionQueueID: 696 CoreIPC::handleMessage <Messages::WebPage::TestConnectionQueue>(arguments, this, &WebPage::testConnectionQueue);696 CoreIPC::handleMessageOnConnectionQueue<Messages::WebPage::TestConnectionQueue>(connection, arguments, this, &WebPage::testConnectionQueue); 697 697 didHandleMessage = true; 698 698 return; -
trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp
r103277 r104623 79 79 } 80 80 81 void EventDispatcher::wheelEvent( uint64_t pageID, const WebWheelEvent& wheelEvent)81 void EventDispatcher::wheelEvent(CoreIPC::Connection*, uint64_t pageID, const WebWheelEvent& wheelEvent) 82 82 { 83 83 #if ENABLE(THREADED_SCROLLING) … … 97 97 98 98 #if ENABLE(GESTURE_EVENTS) 99 void EventDispatcher::gestureEvent( uint64_t pageID, const WebGestureEvent& gestureEvent)99 void EventDispatcher::gestureEvent(CoreIPC::Connection*, uint64_t pageID, const WebGestureEvent& gestureEvent) 100 100 { 101 101 #if ENABLE(THREADED_SCROLLING) -
trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.h
r103277 r104623 67 67 68 68 // Message handlers 69 void wheelEvent( uint64_t pageID, const WebWheelEvent&);69 void wheelEvent(CoreIPC::Connection*, uint64_t pageID, const WebWheelEvent&); 70 70 #if ENABLE(GESTURE_EVENTS) 71 void gestureEvent( uint64_t pageID, const WebGestureEvent&);71 void gestureEvent(CoreIPC::Connection*, uint64_t pageID, const WebGestureEvent&); 72 72 #endif 73 73 -
trunk/Source/WebKit2/WebProcess/WebProcess.cpp
r103686 r104623 950 950 951 951 #if ENABLE(PLUGIN_PROCESS) 952 void WebProcess::pluginProcessCrashed( const String& pluginPath)952 void WebProcess::pluginProcessCrashed(CoreIPC::Connection*, const String& pluginPath) 953 953 { 954 954 m_pluginProcessConnectionManager.pluginProcessCrashed(pluginPath); -
trunk/Source/WebKit2/WebProcess/WebProcess.h
r103179 r104623 183 183 184 184 #if ENABLE(PLUGIN_PROCESS) 185 void pluginProcessCrashed( const String& pluginPath);185 void pluginProcessCrashed(CoreIPC::Connection*, const String& pluginPath); 186 186 #endif 187 187
Note:
See TracChangeset
for help on using the changeset viewer.