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 16 matching lines...) Expand all Loading... |
27 | 27 |
28 DispatcherBase::Callback::~Callback() = default; | 28 DispatcherBase::Callback::~Callback() = default; |
29 | 29 |
30 void DispatcherBase::Callback::dispose() | 30 void DispatcherBase::Callback::dispose() |
31 { | 31 { |
32 m_backendImpl = nullptr; | 32 m_backendImpl = nullptr; |
33 } | 33 } |
34 | 34 |
35 void DispatcherBase::Callback::sendIfActive(std::unique_ptr<protocol::Dictionary
Value> partialMessage, const ErrorString& invocationError) | 35 void DispatcherBase::Callback::sendIfActive(std::unique_ptr<protocol::Dictionary
Value> partialMessage, const ErrorString& invocationError) |
36 { | 36 { |
37 if (!m_backendImpl->get()) | 37 if (!m_backendImpl || !m_backendImpl->get()) |
38 return; | 38 return; |
39 m_backendImpl->get()->sendResponse(m_callId, invocationError, nullptr, std::
move(partialMessage)); | 39 m_backendImpl->get()->sendResponse(m_callId, invocationError, nullptr, std::
move(partialMessage)); |
40 m_backendImpl = nullptr; | 40 m_backendImpl = nullptr; |
41 } | 41 } |
42 | 42 |
43 DispatcherBase::DispatcherBase(FrontendChannel* frontendChannel) | 43 DispatcherBase::DispatcherBase(FrontendChannel* frontendChannel) |
44 : m_frontendChannel(frontendChannel) { } | 44 : m_frontendChannel(frontendChannel) { } |
45 | 45 |
46 DispatcherBase::~DispatcherBase() | 46 DispatcherBase::~DispatcherBase() |
47 { | 47 { |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |