| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "remoting/host/it2me/it2me_native_messaging_host.h" | 5 #include "remoting/host/it2me/it2me_native_messaging_host.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 it2me_host_->Disconnect(); | 112 it2me_host_->Disconnect(); |
| 113 it2me_host_ = nullptr; | 113 it2me_host_ = nullptr; |
| 114 } | 114 } |
| 115 } | 115 } |
| 116 | 116 |
| 117 void It2MeNativeMessagingHost::OnMessage(const std::string& message) { | 117 void It2MeNativeMessagingHost::OnMessage(const std::string& message) { |
| 118 DCHECK(task_runner()->BelongsToCurrentThread()); | 118 DCHECK(task_runner()->BelongsToCurrentThread()); |
| 119 | 119 |
| 120 std::unique_ptr<base::DictionaryValue> response(new base::DictionaryValue()); | 120 std::unique_ptr<base::DictionaryValue> response(new base::DictionaryValue()); |
| 121 std::unique_ptr<base::Value> message_value = base::JSONReader::Read(message); | 121 std::unique_ptr<base::Value> message_value = base::JSONReader::Read(message); |
| 122 if (!message_value->IsType(base::Value::TYPE_DICTIONARY)) { | 122 if (!message_value->IsType(base::Value::Type::DICTIONARY)) { |
| 123 LOG(ERROR) << "Received a message that's not a dictionary."; | 123 LOG(ERROR) << "Received a message that's not a dictionary."; |
| 124 client_->CloseChannel(std::string()); | 124 client_->CloseChannel(std::string()); |
| 125 return; | 125 return; |
| 126 } | 126 } |
| 127 | 127 |
| 128 std::unique_ptr<base::DictionaryValue> message_dict( | 128 std::unique_ptr<base::DictionaryValue> message_dict( |
| 129 static_cast<base::DictionaryValue*>(message_value.release())); | 129 static_cast<base::DictionaryValue*>(message_value.release())); |
| 130 | 130 |
| 131 // If the client supplies an ID, it will expect it in the response. This | 131 // If the client supplies an ID, it will expect it in the response. This |
| 132 // might be a string or a number, so cope with both. | 132 // might be a string or a number, so cope with both. |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 | 528 |
| 529 bool It2MeNativeMessagingHost::DelegateToElevatedHost( | 529 bool It2MeNativeMessagingHost::DelegateToElevatedHost( |
| 530 std::unique_ptr<base::DictionaryValue> message) { | 530 std::unique_ptr<base::DictionaryValue> message) { |
| 531 NOTREACHED(); | 531 NOTREACHED(); |
| 532 return false; | 532 return false; |
| 533 } | 533 } |
| 534 | 534 |
| 535 #endif // !defined(OS_WIN) | 535 #endif // !defined(OS_WIN) |
| 536 | 536 |
| 537 } // namespace remoting | 537 } // namespace remoting |
| OLD | NEW |