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

Side by Side Diff: remoting/client/plugin/chromoting_instance.cc

Issue 1131113004: Convert JsonWriter::Write to taking a const ref for the in-param (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another rebase Created 5 years, 7 months 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
« no previous file with comments | « remoting/base/vlog_net_log.cc ('k') | remoting/host/cast_extension_session.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/client/plugin/chromoting_instance.h" 5 #include "remoting/client/plugin/chromoting_instance.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #if defined(OS_NACL) 10 #if defined(OS_NACL)
(...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after
1009 const pp::VarDictionary& data) { 1009 const pp::VarDictionary& data) {
1010 pp::VarDictionary message; 1010 pp::VarDictionary message;
1011 message.Set(pp::Var("method"), pp::Var(method)); 1011 message.Set(pp::Var("method"), pp::Var(method));
1012 message.Set(pp::Var("data"), data); 1012 message.Set(pp::Var("data"), data);
1013 PostMessage(message); 1013 PostMessage(message);
1014 } 1014 }
1015 1015
1016 void ChromotingInstance::PostLegacyJsonMessage( 1016 void ChromotingInstance::PostLegacyJsonMessage(
1017 const std::string& method, 1017 const std::string& method,
1018 scoped_ptr<base::DictionaryValue> data) { 1018 scoped_ptr<base::DictionaryValue> data) {
1019 scoped_ptr<base::DictionaryValue> message(new base::DictionaryValue()); 1019 base::DictionaryValue message;
1020 message->SetString("method", method); 1020 message.SetString("method", method);
1021 message->Set("data", data.release()); 1021 message.Set("data", data.release());
1022 1022
1023 std::string message_json; 1023 std::string message_json;
1024 base::JSONWriter::Write(message.get(), &message_json); 1024 base::JSONWriter::Write(message, &message_json);
1025 PostMessage(pp::Var(message_json)); 1025 PostMessage(pp::Var(message_json));
1026 } 1026 }
1027 1027
1028 void ChromotingInstance::SendTrappedKey(uint32 usb_keycode, bool pressed) { 1028 void ChromotingInstance::SendTrappedKey(uint32 usb_keycode, bool pressed) {
1029 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); 1029 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue());
1030 data->SetInteger("usbKeycode", usb_keycode); 1030 data->SetInteger("usbKeycode", usb_keycode);
1031 data->SetBoolean("pressed", pressed); 1031 data->SetBoolean("pressed", pressed);
1032 PostLegacyJsonMessage("trappedKeyEvent", data.Pass()); 1032 PostLegacyJsonMessage("trappedKeyEvent", data.Pass());
1033 } 1033 }
1034 1034
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
1190 1190
1191 #if !defined(OS_NACL) 1191 #if !defined(OS_NACL)
1192 // Log messages are forwarded to the webapp only in PNaCl version of the 1192 // Log messages are forwarded to the webapp only in PNaCl version of the
1193 // plugin, so ProcessLogToUI() needs to be called explicitly in the non-PNaCl 1193 // plugin, so ProcessLogToUI() needs to be called explicitly in the non-PNaCl
1194 // version. 1194 // version.
1195 ProcessLogToUI(message); 1195 ProcessLogToUI(message);
1196 #endif // !defined(OS_NACL) 1196 #endif // !defined(OS_NACL)
1197 } 1197 }
1198 1198
1199 } // namespace remoting 1199 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/base/vlog_net_log.cc ('k') | remoting/host/cast_extension_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698