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

Side by Side Diff: third_party/inspector_protocol/lib/DispatcherBase_cpp.template

Issue 2675763003: Adapt String::find method via StringUtil adapter. [v8 repo] (Closed)
Patch Set: Update revision hash for inspector_protocol repo. Created 3 years, 10 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
« no previous file with comments | « third_party/inspector_protocol/README.v8 ('k') | no next file » | 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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 } 269 }
270 270
271 protocol::Value* methodValue = messageObject->get("method"); 271 protocol::Value* methodValue = messageObject->get("method");
272 String method; 272 String method;
273 success = methodValue && methodValue->asString(&method); 273 success = methodValue && methodValue->asString(&method);
274 if (!success) { 274 if (!success) {
275 reportProtocolErrorTo(m_frontendChannel, callId, DispatchResponse::kInva lidRequest, "Message must have string 'method' porperty", nullptr); 275 reportProtocolErrorTo(m_frontendChannel, callId, DispatchResponse::kInva lidRequest, "Message must have string 'method' porperty", nullptr);
276 return DispatchResponse::kError; 276 return DispatchResponse::kError;
277 } 277 }
278 278
279 size_t dotIndex = method.find("."); 279 size_t dotIndex = StringUtil::find(method, ".");
280 if (dotIndex == StringUtil::kNotFound) { 280 if (dotIndex == StringUtil::kNotFound) {
281 if (m_fallThroughForNotFound) 281 if (m_fallThroughForNotFound)
282 return DispatchResponse::kFallThrough; 282 return DispatchResponse::kFallThrough;
283 reportProtocolErrorTo(m_frontendChannel, callId, DispatchResponse::kMeth odNotFound, "'" + method + "' wasn't found", nullptr); 283 reportProtocolErrorTo(m_frontendChannel, callId, DispatchResponse::kMeth odNotFound, "'" + method + "' wasn't found", nullptr);
284 return DispatchResponse::kError; 284 return DispatchResponse::kError;
285 } 285 }
286 String domain = StringUtil::substring(method, 0, dotIndex); 286 String domain = StringUtil::substring(method, 0, dotIndex);
287 auto it = m_dispatchers.find(domain); 287 auto it = m_dispatchers.find(domain);
288 if (it == m_dispatchers.end()) { 288 if (it == m_dispatchers.end()) {
289 if (m_fallThroughForNotFound) 289 if (m_fallThroughForNotFound)
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 InternalResponse::InternalResponse(int callId, const String& notification, std:: unique_ptr<Serializable> params) 325 InternalResponse::InternalResponse(int callId, const String& notification, std:: unique_ptr<Serializable> params)
326 : m_callId(callId) 326 : m_callId(callId)
327 , m_notification(notification) 327 , m_notification(notification)
328 , m_params(params ? std::move(params) : nullptr) 328 , m_params(params ? std::move(params) : nullptr)
329 { 329 {
330 } 330 }
331 331
332 {% for namespace in config.protocol.namespace %} 332 {% for namespace in config.protocol.namespace %}
333 } // namespace {{namespace}} 333 } // namespace {{namespace}}
334 {% endfor %} 334 {% endfor %}
OLDNEW
« no previous file with comments | « third_party/inspector_protocol/README.v8 ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698