| 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/setup/me2me_native_messaging_host.h" | 5 #include "remoting/host/setup/me2me_native_messaging_host.h" |
| 6 | 6 |
| 7 #include <cstdint> | 7 #include <cstdint> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 | 90 |
| 91 Me2MeNativeMessagingHost::~Me2MeNativeMessagingHost() { | 91 Me2MeNativeMessagingHost::~Me2MeNativeMessagingHost() { |
| 92 DCHECK(task_runner()->BelongsToCurrentThread()); | 92 DCHECK(task_runner()->BelongsToCurrentThread()); |
| 93 } | 93 } |
| 94 | 94 |
| 95 void Me2MeNativeMessagingHost::OnMessage(const std::string& message) { | 95 void Me2MeNativeMessagingHost::OnMessage(const std::string& message) { |
| 96 DCHECK(task_runner()->BelongsToCurrentThread()); | 96 DCHECK(task_runner()->BelongsToCurrentThread()); |
| 97 | 97 |
| 98 std::unique_ptr<base::DictionaryValue> response(new base::DictionaryValue()); | 98 std::unique_ptr<base::DictionaryValue> response(new base::DictionaryValue()); |
| 99 std::unique_ptr<base::Value> message_value = base::JSONReader::Read(message); | 99 std::unique_ptr<base::Value> message_value = base::JSONReader::Read(message); |
| 100 if (!message_value->IsType(base::Value::TYPE_DICTIONARY)) { | 100 if (!message_value->IsType(base::Value::Type::DICTIONARY)) { |
| 101 OnError("Received a message that's not a dictionary."); | 101 OnError("Received a message that's not a dictionary."); |
| 102 return; | 102 return; |
| 103 } | 103 } |
| 104 | 104 |
| 105 std::unique_ptr<base::DictionaryValue> message_dict( | 105 std::unique_ptr<base::DictionaryValue> message_dict( |
| 106 static_cast<base::DictionaryValue*>(message_value.release())); | 106 static_cast<base::DictionaryValue*>(message_value.release())); |
| 107 | 107 |
| 108 // If the client supplies an ID, it will expect it in the response. This | 108 // If the client supplies an ID, it will expect it in the response. This |
| 109 // might be a string or a number, so cope with both. | 109 // might be a string or a number, so cope with both. |
| 110 const base::Value* id; | 110 const base::Value* id; |
| (...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 | 570 |
| 571 bool Me2MeNativeMessagingHost::DelegateToElevatedHost( | 571 bool Me2MeNativeMessagingHost::DelegateToElevatedHost( |
| 572 std::unique_ptr<base::DictionaryValue> message) { | 572 std::unique_ptr<base::DictionaryValue> message) { |
| 573 NOTREACHED(); | 573 NOTREACHED(); |
| 574 return false; | 574 return false; |
| 575 } | 575 } |
| 576 | 576 |
| 577 #endif // !defined(OS_WIN) | 577 #endif // !defined(OS_WIN) |
| 578 | 578 |
| 579 } // namespace remoting | 579 } // namespace remoting |
| OLD | NEW |