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

Side by Side Diff: third_party/WebKit/Source/platform/inspector_protocol/Frontend_cpp.template

Issue 1738073002: DevTools: introduce protocol::Value, baseline for hierarchical data in remote debugging protocol. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
OLDNEW
1 // This file is generated 1 // This file is generated
2 2
3 // Copyright (c) 2016 The Chromium Authors. All rights reserved. 3 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style license that can be 4 // Use of this source code is governed by a BSD-style license that can be
5 // found in the LICENSE file. 5 // found in the LICENSE file.
6 6
7 #include "platform/inspector_protocol/{{class_name}}.h" 7 #include "platform/inspector_protocol/{{class_name}}.h"
8 8
9 #include "wtf/text/CString.h" 9 #include "wtf/text/CString.h"
10 #include "wtf/text/WTFString.h" 10 #include "wtf/text/WTFString.h"
(...skipping 14 matching lines...) Expand all
25 {% if "handlers" in event and not ("renderer" in event["handlers"]) %}{% con tinue %}{% endif %} 25 {% if "handlers" in event and not ("renderer" in event["handlers"]) %}{% con tinue %}{% endif %}
26 void Frontend::{{domain.domain}}::{{event.name}}( 26 void Frontend::{{domain.domain}}::{{event.name}}(
27 {%- for parameter in event.parameters %} 27 {%- for parameter in event.parameters %}
28 {% if "optional" in parameter -%} 28 {% if "optional" in parameter -%}
29 const Maybe<{{resolve_type(parameter).raw_type}}>& 29 const Maybe<{{resolve_type(parameter).raw_type}}>&
30 {%- else -%} 30 {%- else -%}
31 {{resolve_type(parameter).pass_type}} 31 {{resolve_type(parameter).pass_type}}
32 {%- endif %} {{parameter.name}}{%- if not loop.last -%}, {% endif -%} 32 {%- endif %} {{parameter.name}}{%- if not loop.last -%}, {% endif -%}
33 {% endfor -%}) 33 {% endfor -%})
34 { 34 {
35 RefPtr<JSONObject> jsonMessage = JSONObject::create(); 35 RefPtr<protocol::DictionaryValue> jsonMessage = DictionaryValue::create();
36 jsonMessage->setString("method", "{{domain.domain}}.{{event.name}}"); 36 jsonMessage->setString("method", "{{domain.domain}}.{{event.name}}");
37 RefPtr<JSONObject> paramsObject = JSONObject::create(); 37 RefPtr<protocol::DictionaryValue> paramsObject = DictionaryValue::create();
38 {% for parameter in event.parameters %} 38 {% for parameter in event.parameters %}
39 {% if "optional" in parameter %} 39 {% if "optional" in parameter %}
40 if ({{parameter.name}}.isJust()) 40 if ({{parameter.name}}.isJust())
41 paramsObject->setValue("{{parameter.name}}", toValue({{parameter.name}}. fromJust())); 41 paramsObject->setValue("{{parameter.name}}", toValue({{parameter.name}}. fromJust()));
42 {% else %} 42 {% else %}
43 paramsObject->setValue("{{parameter.name}}", toValue({{parameter.name}})); 43 paramsObject->setValue("{{parameter.name}}", toValue({{parameter.name}}));
44 {% endif %} 44 {% endif %}
45 {% endfor %} 45 {% endfor %}
46 jsonMessage->setObject("params", paramsObject); 46 jsonMessage->setObject("params", paramsObject);
47 if (m_frontendChannel) 47 if (m_frontendChannel)
48 m_frontendChannel->sendProtocolNotification(jsonMessage.release()); 48 m_frontendChannel->sendProtocolNotification(jsonMessage.release());
49 } 49 }
50 {% endfor %} 50 {% endfor %}
51 {% endfor %} 51 {% endfor %}
52 52
53 } // namespace protocol 53 } // namespace protocol
54 } // namespace blink 54 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698