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 30 matching lines...) Expand all Loading... |
41 | 41 |
42 $domainClassName* $domainFieldName() { return &m_$domainFieldName; } | 42 $domainClassName* $domainFieldName() { return &m_$domainFieldName; } |
43 | 43 |
44 """) | 44 """) |
45 | 45 |
46 backend_method = ( | 46 backend_method = ( |
47 """void InspectorBackendDispatcherImpl::${domainName}_$methodName(long callId, I
nspectorObject*$requestMessageObject) | 47 """void InspectorBackendDispatcherImpl::${domainName}_$methodName(long callId, I
nspectorObject*$requestMessageObject) |
48 { | 48 { |
49 RefPtr<InspectorArray> protocolErrors = InspectorArray::create(); | 49 RefPtr<InspectorArray> protocolErrors = InspectorArray::create(); |
50 | 50 |
51 if (!$agentField) | 51 $handlerClass* handler = $agentField ? $agentField->getCommandHandler() : 0; |
| 52 if (!handler) |
52 protocolErrors->pushString("${domainName} handler is not available."); | 53 protocolErrors->pushString("${domainName} handler is not available."); |
53 $methodOutCode | 54 $methodOutCode |
54 $methodInCode | 55 $methodInCode |
55 RefPtr<InspectorObject> result = InspectorObject::create(); | 56 RefPtr<InspectorObject> result = InspectorObject::create(); |
56 ErrorString error; | 57 ErrorString error; |
57 if (!protocolErrors->length()) { | 58 if (!protocolErrors->length()) { |
58 $agentField->$methodName(&error$agentCallParams); | 59 handler->$methodName(&error$agentCallParams); |
59 | 60 |
60 ${responseCook} | 61 ${responseCook} |
61 } | 62 } |
62 sendResponse(callId, result, commandNames[$commandNameIndex], protocolErrors
, error); | 63 sendResponse(callId, result, commandNames[$commandNameIndex], protocolErrors
, error); |
63 } | 64 } |
64 """) | 65 """) |
65 | 66 |
66 frontend_method = ("""void InspectorFrontend::$domainName::$eventName($parameter
s) | 67 frontend_method = ("""void InspectorFrontend::$domainName::$eventName($parameter
s) |
67 { | 68 { |
68 RefPtr<InspectorObject> jsonMessage = InspectorObject::create(); | 69 RefPtr<InspectorObject> jsonMessage = InspectorObject::create(); |
(...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
920 }; | 921 }; |
921 | 922 |
922 """) | 923 """) |
923 | 924 |
924 class_binding_builder_part_4 = ( | 925 class_binding_builder_part_4 = ( |
925 """ static Builder<NoFieldsSet> create() | 926 """ static Builder<NoFieldsSet> create() |
926 { | 927 { |
927 return Builder<NoFieldsSet>(InspectorObject::create()); | 928 return Builder<NoFieldsSet>(InspectorObject::create()); |
928 } | 929 } |
929 """) | 930 """) |
OLD | NEW |