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

Side by Side Diff: lib/DispatcherBase_cpp.template

Issue 2490733002: [inspector_protocol] Allow custom json parser. (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « lib/Array_h.template ('k') | lib/Forward_h.template » ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 //#include "DispatcherBase.h" 5 //#include "DispatcherBase.h"
6 //#include "Parser.h" 6 //#include "Parser.h"
7 7
8 {% for namespace in config.protocol.namespace %} 8 {% for namespace in config.protocol.namespace %}
9 namespace {{namespace}} { 9 namespace {{namespace}} {
10 {% endfor %} 10 {% endfor %}
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 : m_frontendChannel(frontendChannel) { } 81 : m_frontendChannel(frontendChannel) { }
82 82
83 DispatcherBase::~DispatcherBase() 83 DispatcherBase::~DispatcherBase()
84 { 84 {
85 clearFrontend(); 85 clearFrontend();
86 } 86 }
87 87
88 // static 88 // static
89 bool DispatcherBase::getCommandName(const String& message, String* result) 89 bool DispatcherBase::getCommandName(const String& message, String* result)
90 { 90 {
91 std::unique_ptr<protocol::Value> value = parseJSON(message); 91 std::unique_ptr<protocol::Value> value = StringUtil::parseJSON(message);
92 if (!value) 92 if (!value)
93 return false; 93 return false;
94 94
95 protocol::DictionaryValue* object = DictionaryValue::cast(value.get()); 95 protocol::DictionaryValue* object = DictionaryValue::cast(value.get());
96 if (!object) 96 if (!object)
97 return false; 97 return false;
98 98
99 if (!object->getString("method", result)) 99 if (!object->getString("method", result))
100 return false; 100 return false;
101 101
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 return DispatchResponse::kError; 216 return DispatchResponse::kError;
217 } 217 }
218 return it->second->dispatch(callId, method, std::move(messageObject)); 218 return it->second->dispatch(callId, method, std::move(messageObject));
219 } 219 }
220 220
221 UberDispatcher::~UberDispatcher() = default; 221 UberDispatcher::~UberDispatcher() = default;
222 222
223 {% for namespace in config.protocol.namespace %} 223 {% for namespace in config.protocol.namespace %}
224 } // namespace {{namespace}} 224 } // namespace {{namespace}}
225 {% endfor %} 225 {% endfor %}
OLDNEW
« no previous file with comments | « lib/Array_h.template ('k') | lib/Forward_h.template » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698