OLD | NEW |
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 "platform/inspector_protocol/DispatcherBase.h" | 5 #include "platform/inspector_protocol/DispatcherBase.h" |
6 | 6 |
7 #include "platform/inspector_protocol/FrontendChannel.h" | 7 #include "platform/inspector_protocol/FrontendChannel.h" |
8 #include "platform/inspector_protocol/Parser.h" | 8 #include "platform/inspector_protocol/Parser.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 if (!success) | 147 if (!success) |
148 return; | 148 return; |
149 | 149 |
150 protocol::Value* methodValue = messageObject->get("method"); | 150 protocol::Value* methodValue = messageObject->get("method"); |
151 String16 method; | 151 String16 method; |
152 success = methodValue && methodValue->asString(&method); | 152 success = methodValue && methodValue->asString(&method); |
153 if (!success) | 153 if (!success) |
154 return; | 154 return; |
155 | 155 |
156 size_t dotIndex = method.find("."); | 156 size_t dotIndex = method.find("."); |
157 if (dotIndex == kNotFound) { | 157 if (dotIndex == String16::kNotFound) { |
158 reportProtocolError(m_frontendChannel, callId, DispatcherBase::MethodNot
Found, "'" + method + "' wasn't found", nullptr); | 158 reportProtocolError(m_frontendChannel, callId, DispatcherBase::MethodNot
Found, "'" + method + "' wasn't found", nullptr); |
159 return; | 159 return; |
160 } | 160 } |
161 String16 domain = method.substring(0, dotIndex); | 161 String16 domain = method.substring(0, dotIndex); |
162 auto it = m_dispatchers.find(domain); | 162 auto it = m_dispatchers.find(domain); |
163 if (it == m_dispatchers.end()) { | 163 if (it == m_dispatchers.end()) { |
164 reportProtocolError(m_frontendChannel, callId, DispatcherBase::MethodNot
Found, "'" + method + "' wasn't found", nullptr); | 164 reportProtocolError(m_frontendChannel, callId, DispatcherBase::MethodNot
Found, "'" + method + "' wasn't found", nullptr); |
165 return; | 165 return; |
166 } | 166 } |
167 it->second->dispatch(callId, method, std::move(messageObject)); | 167 it->second->dispatch(callId, method, std::move(messageObject)); |
168 } | 168 } |
169 | 169 |
170 UberDispatcher::~UberDispatcher() = default; | 170 UberDispatcher::~UberDispatcher() = default; |
171 | 171 |
172 } // namespace protocol | 172 } // namespace protocol |
173 } // namespace blink | 173 } // namespace blink |
OLD | NEW |