Changeset 81362 in webkit
- Timestamp:
- Mar 17, 2011 10:03:07 AM (13 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r81309 r81362 1 2011-03-17 Oleg Romashin <oleg.romashin@nokia.com> 2 3 Reviewed by Anders Carlsson. 4 5 Teach WebKit2 messages.py generator to ifdef headers include 6 which are related to ifdef-ed methods/types 7 https://bugs.webkit.org/show_bug.cgi?id=55658 8 9 * Scripts/webkit2/messages.py: 10 * Scripts/webkit2/messages_unittest.py: 11 1 12 2011-03-16 Joseph Pecoraro <joepeck@webkit.org> 2 13 -
trunk/Source/WebKit2/Scripts/webkit2/messages.py
r81208 r81362 90 90 parameters = [] 91 91 92 for parameter in parameters: 93 parameter.condition = condition 94 92 95 delayed = delayed_string == 'delayed' 93 96 … … 121 124 122 125 class Parameter(object): 123 def __init__(self, type, name ):126 def __init__(self, type, name, condition=None): 124 127 self.type = type 125 128 self.name = name 129 self.condition = condition 126 130 127 131 … … 452 456 def generate_message_handler(file): 453 457 receiver = MessageReceiver.parse(file) 454 headers = set([ 455 '"%s"' % messages_header_filename(receiver), 456 '"HandleMessage.h"', 457 '"ArgumentDecoder.h"', 458 ]) 459 458 headers = { 459 '"%s"' % messages_header_filename(receiver): None, 460 '"HandleMessage.h"': None, 461 '"ArgumentDecoder.h"': None, 462 } 463 464 type_conditions = {} 460 465 for parameter in receiver.iterparameters(): 461 466 type = parameter.type 467 condition = parameter.condition 468 469 if type in type_conditions: 470 if not type_conditions[type]: 471 condition = type_conditions[type] 472 else: 473 if not condition: 474 type_conditions[type] = condition 475 else: 476 type_conditions[type] = condition 477 462 478 argument_encoder_headers = argument_coder_headers_for_type(parameter.type) 463 479 if argument_encoder_headers: 464 headers.update(argument_encoder_headers) 480 for header in argument_encoder_headers: 481 headers[header] = condition 465 482 continue 466 483 467 484 type_headers = headers_for_type(type) 468 headers.update(type_headers) 485 for header in type_headers: 486 headers[header] = condition 469 487 470 488 for message in receiver.messages: … … 474 492 argument_encoder_headers = argument_coder_headers_for_type(type) 475 493 if argument_encoder_headers: 476 headers.update(argument_encoder_headers) 494 for header in argument_encoder_headers: 495 headers[header] = message.condition 477 496 continue 478 497 479 498 type_headers = headers_for_type(type) 480 headers.update(type_headers) 499 for header in type_headers: 500 headers[header] = message.condition 481 501 482 502 result = [] … … 490 510 491 511 result.append('#include "%s.h"\n\n' % receiver.name) 492 result += ['#include %s\n' % header for header in sorted(headers)] 512 for headercondition in sorted(headers): 513 if headers[headercondition]: 514 result.append('#if %s\n' % headers[headercondition]) 515 result += ['#include %s\n' % headercondition] 516 result.append('#endif\n') 517 else: 518 result += ['#include %s\n' % headercondition] 493 519 result.append('\n') 494 520 -
trunk/Source/WebKit2/Scripts/webkit2/messages_unittest.py
r77000 r81362 69 69 GetPluginProcessConnection(WTF::String pluginPath) -> (CoreIPC::Connection::Handle connectionHandle) delayed 70 70 71 #if PLATFORM(MAC) 71 72 DidCreateWebProcessConnection(CoreIPC::MachPort connectionIdentifier) 73 #endif 72 74 73 75 #if PLATFORM(MAC) … … 180 182 ('CoreIPC::MachPort', 'connectionIdentifier'), 181 183 ), 182 'condition': None,184 'condition': 'PLATFORM(MAC)', 183 185 }, 184 186 { … … 292 294 GetPluginsID, 293 295 GetPluginProcessConnectionID, 296 #if PLATFORM(MAC) 294 297 DidCreateWebProcessConnectionID, 298 #endif 295 299 #if PLATFORM(MAC) 296 300 InterpretKeyEventID, … … 419 423 }; 420 424 425 #if PLATFORM(MAC) 421 426 struct DidCreateWebProcessConnection : CoreIPC::Arguments1<const CoreIPC::MachPort&> { 422 427 static const Kind messageID = DidCreateWebProcessConnectionID; … … 427 432 } 428 433 }; 434 #endif 429 435 430 436 #if PLATFORM(MAC) … … 487 493 #include "WebPage.h" 488 494 495 #if PLATFORM(MAC) 489 496 #include "ArgumentCoders.h" 497 #endif 490 498 #include "ArgumentDecoder.h" 491 499 #include "Connection.h" 492 500 #include "HandleMessage.h" 501 #if PLATFORM(MAC) 493 502 #include "MachPort.h" 503 #endif 494 504 #include "Plugin.h" 505 #if PLATFORM(MAC) 495 506 #include "WebCoreArgumentCoders.h" 507 #endif 508 #if ENABLE(TOUCH_EVENTS) 496 509 #include "WebEvent.h" 510 #endif 497 511 #include "WebPageMessages.h" 498 512 #include "WebPreferencesStore.h" … … 526 540 CoreIPC::handleMessage<Messages::WebPage::SendInts>(arguments, this, &WebPage::sendInts); 527 541 return; 542 #if PLATFORM(MAC) 528 543 case Messages::WebPage::DidCreateWebProcessConnectionID: 529 544 CoreIPC::handleMessage<Messages::WebPage::DidCreateWebProcessConnection>(arguments, this, &WebPage::didCreateWebProcessConnection); 530 545 return; 546 #endif 531 547 default: 532 548 break;
Note: See TracChangeset
for help on using the changeset viewer.