| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2011 Google Inc. All rights reserved. | 2 # Copyright (c) 2011 Google Inc. All rights reserved. |
| 3 # | 3 # |
| 4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
| 5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
| 6 # met: | 6 # met: |
| 7 # | 7 # |
| 8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
| 9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
| 10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 load_json(input_path)["domains"], load_json(baseline_path)["domains"
], True) | 428 load_json(input_path)["domains"], load_json(baseline_path)["domains"
], True) |
| 429 if len(changes) > 0: | 429 if len(changes) > 0: |
| 430 print " Public changes since %s:" % version | 430 print " Public changes since %s:" % version |
| 431 for change in changes: | 431 for change in changes: |
| 432 print " %s" % change | 432 print " %s" % change |
| 433 | 433 |
| 434 output_file.write(""" | 434 output_file.write(""" |
| 435 #ifndef InspectorProtocolVersion_h | 435 #ifndef InspectorProtocolVersion_h |
| 436 #define InspectorProtocolVersion_h | 436 #define InspectorProtocolVersion_h |
| 437 | 437 |
| 438 #include "wtf/Vector.h" | |
| 439 #include "wtf/text/WTFString.h" | 438 #include "wtf/text/WTFString.h" |
| 440 | 439 |
| 441 namespace blink { | 440 namespace blink { |
| 442 | 441 |
| 443 String inspectorProtocolVersion() { return "%s"; } | 442 String inspectorProtocolVersion() { return "%s"; } |
| 444 | 443 |
| 445 int inspectorProtocolVersionMajor() { return %s; } | 444 int inspectorProtocolVersionMajor() { return %s; } |
| 446 | 445 |
| 447 int inspectorProtocolVersionMinor() { return %s; } | 446 int inspectorProtocolVersionMinor() { return %s; } |
| 448 | 447 |
| 449 bool supportsInspectorProtocolVersion(const String& version) | |
| 450 { | |
| 451 Vector<String> tokens; | |
| 452 version.split(".", tokens); | |
| 453 if (tokens.size() != 2) | |
| 454 return false; | |
| 455 | |
| 456 bool ok = true; | |
| 457 int major = tokens[0].toInt(&ok); | |
| 458 if (!ok || major != %s) | |
| 459 return false; | |
| 460 | |
| 461 int minor = tokens[1].toInt(&ok); | |
| 462 if (!ok || minor > %s) | |
| 463 return false; | |
| 464 | |
| 465 return true; | |
| 466 } | |
| 467 | |
| 468 } | 448 } |
| 469 | 449 |
| 470 #endif // !defined(InspectorProtocolVersion_h) | 450 #endif // !defined(InspectorProtocolVersion_h) |
| 471 """ % (version, major, minor, major, minor)) | 451 """ % (version, major, minor)) |
| 472 | 452 |
| 473 output_file.close() | 453 output_file.close() |
| 474 | 454 |
| 475 if __name__ == '__main__': | 455 if __name__ == '__main__': |
| 476 sys.exit(main()) | 456 sys.exit(main()) |
| OLD | NEW |