OLD | NEW |
1 # Copyright (c) 2013 Google Inc. All rights reserved. | 1 # Copyright (c) 2013 Google Inc. All rights reserved. |
2 # | 2 # |
3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
5 # met: | 5 # met: |
6 # | 6 # |
7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 frontend_h = ( | 95 frontend_h = ( |
96 """#ifndef InspectorFrontend_h | 96 """#ifndef InspectorFrontend_h |
97 #define InspectorFrontend_h | 97 #define InspectorFrontend_h |
98 | 98 |
99 #include "InspectorTypeBuilder.h" | 99 #include "InspectorTypeBuilder.h" |
100 #include "core/inspector/InspectorFrontendChannel.h" | 100 #include "core/inspector/InspectorFrontendChannel.h" |
101 #include "platform/JSONValues.h" | 101 #include "platform/JSONValues.h" |
102 #include "wtf/PassRefPtr.h" | 102 #include "wtf/PassRefPtr.h" |
103 #include "wtf/text/WTFString.h" | 103 #include "wtf/text/WTFString.h" |
104 | 104 |
105 namespace WebCore { | 105 namespace blink { |
106 | 106 |
107 typedef String ErrorString; | 107 typedef String ErrorString; |
108 | 108 |
109 class InspectorFrontend { | 109 class InspectorFrontend { |
110 public: | 110 public: |
111 InspectorFrontend(InspectorFrontendChannel*); | 111 InspectorFrontend(InspectorFrontendChannel*); |
112 InspectorFrontendChannel* channel() { return m_inspectorFrontendChannel; } | 112 InspectorFrontendChannel* channel() { return m_inspectorFrontendChannel; } |
113 | 113 |
114 $domainClassList | 114 $domainClassList |
115 private: | 115 private: |
116 InspectorFrontendChannel* m_inspectorFrontendChannel; | 116 InspectorFrontendChannel* m_inspectorFrontendChannel; |
117 ${fieldDeclarations}}; | 117 ${fieldDeclarations}}; |
118 | 118 |
119 } // namespace WebCore | 119 } // namespace blink |
120 #endif // !defined(InspectorFrontend_h) | 120 #endif // !defined(InspectorFrontend_h) |
121 """) | 121 """) |
122 | 122 |
123 backend_h = ( | 123 backend_h = ( |
124 """#ifndef InspectorBackendDispatcher_h | 124 """#ifndef InspectorBackendDispatcher_h |
125 #define InspectorBackendDispatcher_h | 125 #define InspectorBackendDispatcher_h |
126 | 126 |
127 #include "InspectorTypeBuilder.h" | 127 #include "InspectorTypeBuilder.h" |
128 | 128 |
129 #include "wtf/PassRefPtr.h" | 129 #include "wtf/PassRefPtr.h" |
130 #include "wtf/RefCounted.h" | 130 #include "wtf/RefCounted.h" |
131 #include "wtf/text/WTFString.h" | 131 #include "wtf/text/WTFString.h" |
132 | 132 |
133 namespace WebCore { | 133 namespace blink { |
134 | 134 |
135 class JSONObject; | 135 class JSONObject; |
136 class JSONArray; | 136 class JSONArray; |
137 class InspectorFrontendChannel; | 137 class InspectorFrontendChannel; |
138 | 138 |
139 typedef String ErrorString; | 139 typedef String ErrorString; |
140 | 140 |
141 class InspectorBackendDispatcherImpl; | 141 class InspectorBackendDispatcherImpl; |
142 | 142 |
143 class InspectorBackendDispatcher: public RefCounted<InspectorBackendDispatcher>
{ | 143 class InspectorBackendDispatcher: public RefCounted<InspectorBackendDispatcher>
{ |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 kMethodNamesEnumSize | 191 kMethodNamesEnumSize |
192 }; | 192 }; |
193 | 193 |
194 static const char* commandName(MethodNames); | 194 static const char* commandName(MethodNames); |
195 | 195 |
196 private: | 196 private: |
197 static const char commandNames[]; | 197 static const char commandNames[]; |
198 static const size_t commandNamesIndex[]; | 198 static const size_t commandNamesIndex[]; |
199 }; | 199 }; |
200 | 200 |
201 } // namespace WebCore | 201 } // namespace blink |
202 #endif // !defined(InspectorBackendDispatcher_h) | 202 #endif // !defined(InspectorBackendDispatcher_h) |
203 | 203 |
204 | 204 |
205 """) | 205 """) |
206 | 206 |
207 backend_cpp = ( | 207 backend_cpp = ( |
208 """ | 208 """ |
209 | 209 |
210 #include "config.h" | 210 #include "config.h" |
211 #include "InspectorBackendDispatcher.h" | 211 #include "InspectorBackendDispatcher.h" |
212 | 212 |
213 #include "core/inspector/InspectorFrontendChannel.h" | 213 #include "core/inspector/InspectorFrontendChannel.h" |
214 #include "core/inspector/JSONParser.h" | 214 #include "core/inspector/JSONParser.h" |
215 #include "platform/JSONValues.h" | 215 #include "platform/JSONValues.h" |
216 #include "wtf/text/CString.h" | 216 #include "wtf/text/CString.h" |
217 #include "wtf/text/WTFString.h" | 217 #include "wtf/text/WTFString.h" |
218 | 218 |
219 namespace WebCore { | 219 namespace blink { |
220 | 220 |
221 const char InspectorBackendDispatcher::commandNames[] = { | 221 const char InspectorBackendDispatcher::commandNames[] = { |
222 $methodNameDeclarations | 222 $methodNameDeclarations |
223 }; | 223 }; |
224 | 224 |
225 const size_t InspectorBackendDispatcher::commandNamesIndex[] = { | 225 const size_t InspectorBackendDispatcher::commandNamesIndex[] = { |
226 $methodNameDeclarationsIndex | 226 $methodNameDeclarationsIndex |
227 }; | 227 }; |
228 | 228 |
229 const char* InspectorBackendDispatcher::commandName(MethodNames index) { | 229 const char* InspectorBackendDispatcher::commandName(MethodNames index) { |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 } | 501 } |
502 | 502 |
503 void InspectorBackendDispatcher::CallbackBase::sendIfActive(PassRefPtr<JSONObjec
t> partialMessage, const ErrorString& invocationError, PassRefPtr<JSONValue> err
orData) | 503 void InspectorBackendDispatcher::CallbackBase::sendIfActive(PassRefPtr<JSONObjec
t> partialMessage, const ErrorString& invocationError, PassRefPtr<JSONValue> err
orData) |
504 { | 504 { |
505 if (m_alreadySent) | 505 if (m_alreadySent) |
506 return; | 506 return; |
507 m_backendImpl->sendResponse(m_id, invocationError, errorData, partialMessage
); | 507 m_backendImpl->sendResponse(m_id, invocationError, errorData, partialMessage
); |
508 m_alreadySent = true; | 508 m_alreadySent = true; |
509 } | 509 } |
510 | 510 |
511 } // namespace WebCore | 511 } // namespace blink |
512 | 512 |
513 """) | 513 """) |
514 | 514 |
515 frontend_cpp = ( | 515 frontend_cpp = ( |
516 """ | 516 """ |
517 | 517 |
518 #include "config.h" | 518 #include "config.h" |
519 #include "InspectorFrontend.h" | 519 #include "InspectorFrontend.h" |
520 | 520 |
521 #include "core/inspector/InspectorFrontendChannel.h" | 521 #include "core/inspector/InspectorFrontendChannel.h" |
522 #include "platform/JSONValues.h" | 522 #include "platform/JSONValues.h" |
523 #include "wtf/text/CString.h" | 523 #include "wtf/text/CString.h" |
524 #include "wtf/text/WTFString.h" | 524 #include "wtf/text/WTFString.h" |
525 | 525 |
526 namespace WebCore { | 526 namespace blink { |
527 | 527 |
528 InspectorFrontend::InspectorFrontend(InspectorFrontendChannel* inspectorFrontend
Channel) | 528 InspectorFrontend::InspectorFrontend(InspectorFrontendChannel* inspectorFrontend
Channel) |
529 : m_inspectorFrontendChannel(inspectorFrontendChannel) | 529 : m_inspectorFrontendChannel(inspectorFrontendChannel) |
530 , $constructorInit | 530 , $constructorInit |
531 { | 531 { |
532 } | 532 } |
533 | 533 |
534 $methods | 534 $methods |
535 | 535 |
536 } // namespace WebCore | 536 } // namespace blink |
537 | 537 |
538 """) | 538 """) |
539 | 539 |
540 typebuilder_h = ( | 540 typebuilder_h = ( |
541 """ | 541 """ |
542 #ifndef InspectorTypeBuilder_h | 542 #ifndef InspectorTypeBuilder_h |
543 #define InspectorTypeBuilder_h | 543 #define InspectorTypeBuilder_h |
544 | 544 |
545 #include "platform/JSONValues.h" | 545 #include "platform/JSONValues.h" |
546 #include "wtf/Assertions.h" | 546 #include "wtf/Assertions.h" |
547 #include "wtf/PassRefPtr.h" | 547 #include "wtf/PassRefPtr.h" |
548 | 548 |
549 namespace WebCore { | 549 namespace blink { |
550 | 550 |
551 namespace TypeBuilder { | 551 namespace TypeBuilder { |
552 | 552 |
553 template<typename T> | 553 template<typename T> |
554 class OptOutput { | 554 class OptOutput { |
555 public: | 555 public: |
556 OptOutput() : m_assigned(false) { } | 556 OptOutput() : m_assigned(false) { } |
557 | 557 |
558 void operator=(T value) | 558 void operator=(T value) |
559 { | 559 { |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 }; | 834 }; |
835 | 835 |
836 ${forwards} | 836 ${forwards} |
837 | 837 |
838 String getEnumConstantValue(int code); | 838 String getEnumConstantValue(int code); |
839 | 839 |
840 ${typeBuilders} | 840 ${typeBuilders} |
841 } // namespace TypeBuilder | 841 } // namespace TypeBuilder |
842 | 842 |
843 | 843 |
844 } // namespace WebCore | 844 } // namespace blink |
845 | 845 |
846 #endif // !defined(InspectorTypeBuilder_h) | 846 #endif // !defined(InspectorTypeBuilder_h) |
847 | 847 |
848 """) | 848 """) |
849 | 849 |
850 typebuilder_cpp = ( | 850 typebuilder_cpp = ( |
851 """ | 851 """ |
852 | 852 |
853 #include "config.h" | 853 #include "config.h" |
854 | 854 |
855 #include "InspectorTypeBuilder.h" | 855 #include "InspectorTypeBuilder.h" |
856 #include "wtf/text/CString.h" | 856 #include "wtf/text/CString.h" |
857 | 857 |
858 namespace WebCore { | 858 namespace blink { |
859 | 859 |
860 namespace TypeBuilder { | 860 namespace TypeBuilder { |
861 | 861 |
862 const char* const enum_constant_values[] = { | 862 const char* const enum_constant_values[] = { |
863 $enumConstantValues}; | 863 $enumConstantValues}; |
864 | 864 |
865 String getEnumConstantValue(int code) { | 865 String getEnumConstantValue(int code) { |
866 return enum_constant_values[code]; | 866 return enum_constant_values[code]; |
867 } | 867 } |
868 | 868 |
(...skipping 14 matching lines...) Expand all Loading... |
883 double v; | 883 double v; |
884 bool castRes = value->asNumber(&v); | 884 bool castRes = value->asNumber(&v); |
885 ASSERT_UNUSED(castRes, castRes); | 885 ASSERT_UNUSED(castRes, castRes); |
886 ASSERT(static_cast<double>(static_cast<int>(v)) == v); | 886 ASSERT(static_cast<double>(static_cast<int>(v)) == v); |
887 } | 887 } |
888 | 888 |
889 $validatorCode | 889 $validatorCode |
890 | 890 |
891 #endif // $validatorIfdefName | 891 #endif // $validatorIfdefName |
892 | 892 |
893 } // namespace WebCore | 893 } // namespace blink |
894 | 894 |
895 """) | 895 """) |
896 | 896 |
897 param_container_access_code = """ | 897 param_container_access_code = """ |
898 RefPtr<JSONObject> paramsContainer = requestMessageObject->getObject("params
"); | 898 RefPtr<JSONObject> paramsContainer = requestMessageObject->getObject("params
"); |
899 JSONObject* paramsContainerPtr = paramsContainer.get(); | 899 JSONObject* paramsContainerPtr = paramsContainer.get(); |
900 """ | 900 """ |
901 | 901 |
902 class_binding_builder_part_1 = ( | 902 class_binding_builder_part_1 = ( |
903 """ AllFieldsSet = %s | 903 """ AllFieldsSet = %s |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
946 }; | 946 }; |
947 | 947 |
948 """) | 948 """) |
949 | 949 |
950 class_binding_builder_part_4 = ( | 950 class_binding_builder_part_4 = ( |
951 """ static Builder<NoFieldsSet> create() | 951 """ static Builder<NoFieldsSet> create() |
952 { | 952 { |
953 return Builder<NoFieldsSet>(JSONObject::create()); | 953 return Builder<NoFieldsSet>(JSONObject::create()); |
954 } | 954 } |
955 """) | 955 """) |
OLD | NEW |