Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(222)

Side by Side Diff: Source/core/inspector/CodeGeneratorInspectorStrings.py

Issue 17030009: Inspector: wrapped inspector agent instances into factory-like wrappers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed comments Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/inspector/CodeGeneratorInspector.py ('k') | Source/core/inspector/InspectorAgent.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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->commandHandler() : 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 RefPtr<InspectorValue> resultErrorData; 57 RefPtr<InspectorValue> resultErrorData;
57 ErrorString error; 58 ErrorString error;
58 if (!protocolErrors->length()) { 59 if (!protocolErrors->length()) {
59 $agentField->$methodName(&error$agentCallParams); 60 handler->$methodName(&error$agentCallParams);
60 61
61 $errorCook${responseCook} 62 $errorCook${responseCook}
62 } 63 }
63 sendResponse(callId, result, commandNames[$commandNameIndex], protocolErrors , error, resultErrorData); 64 sendResponse(callId, result, commandNames[$commandNameIndex], protocolErrors , error, resultErrorData);
64 } 65 }
65 """) 66 """)
66 67
67 frontend_method = ("""void InspectorFrontend::$domainName::$eventName($parameter s) 68 frontend_method = ("""void InspectorFrontend::$domainName::$eventName($parameter s)
68 { 69 {
69 RefPtr<InspectorObject> jsonMessage = InspectorObject::create(); 70 RefPtr<InspectorObject> jsonMessage = InspectorObject::create();
(...skipping 864 matching lines...) Expand 10 before | Expand all | Expand 10 after
934 }; 935 };
935 936
936 """) 937 """)
937 938
938 class_binding_builder_part_4 = ( 939 class_binding_builder_part_4 = (
939 """ static Builder<NoFieldsSet> create() 940 """ static Builder<NoFieldsSet> create()
940 { 941 {
941 return Builder<NoFieldsSet>(InspectorObject::create()); 942 return Builder<NoFieldsSet>(InspectorObject::create());
942 } 943 }
943 """) 944 """)
OLDNEW
« no previous file with comments | « Source/core/inspector/CodeGeneratorInspector.py ('k') | Source/core/inspector/InspectorAgent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698