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

Side by Side Diff: remoting/host/it2me/it2me_native_messaging_host.cc

Issue 2539363004: Make base::Value::TYPE a scoped enum. (Closed)
Patch Set: Rebase Created 4 years 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
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « remoting/host/host_config.cc ('k') | remoting/host/it2me/it2me_native_messaging_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698