OLD | NEW |
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 <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 RequestFilteringInputEvents(PP_INPUTEVENT_CLASS_KEYBOARD); | 239 RequestFilteringInputEvents(PP_INPUTEVENT_CLASS_KEYBOARD); |
240 | 240 |
241 // Resister this instance to handle debug log messsages. | 241 // Resister this instance to handle debug log messsages. |
242 RegisterLoggingInstance(); | 242 RegisterLoggingInstance(); |
243 | 243 |
244 #if defined(USE_OPENSSL) | 244 #if defined(USE_OPENSSL) |
245 // Initialize random seed for libjingle. It's necessary only with OpenSSL. | 245 // Initialize random seed for libjingle. It's necessary only with OpenSSL. |
246 char random_seed[kRandomSeedSize]; | 246 char random_seed[kRandomSeedSize]; |
247 crypto::RandBytes(random_seed, sizeof(random_seed)); | 247 crypto::RandBytes(random_seed, sizeof(random_seed)); |
248 talk_base::InitRandom(random_seed, sizeof(random_seed)); | 248 talk_base::InitRandom(random_seed, sizeof(random_seed)); |
249 #elif defined(USE_NSS) | 249 #else |
| 250 // Libjingle's SSL implementation is not really used, but it has to be |
| 251 // initialized for NSS builds to make sure that RNG is initialized in NSS, |
| 252 // because libjingle uses it. |
250 talk_base::InitializeSSL(); | 253 talk_base::InitializeSSL(); |
251 #endif // defined(USE_NSS) | 254 #endif // !defined(USE_OPENSSL) |
252 | 255 |
253 // Send hello message. | 256 // Send hello message. |
254 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); | 257 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); |
255 data->SetInteger("apiVersion", kApiVersion); | 258 data->SetInteger("apiVersion", kApiVersion); |
256 data->SetString("apiFeatures", kApiFeatures); | 259 data->SetString("apiFeatures", kApiFeatures); |
257 data->SetInteger("apiMinVersion", kApiMinMessagingVersion); | 260 data->SetInteger("apiMinVersion", kApiMinMessagingVersion); |
258 data->SetString("requestedCapabilities", kRequestedCapabilities); | 261 data->SetString("requestedCapabilities", kRequestedCapabilities); |
259 data->SetString("supportedCapabilities", kSupportedCapabilities); | 262 data->SetString("supportedCapabilities", kSupportedCapabilities); |
260 | 263 |
261 PostLegacyJsonMessage("hello", data.Pass()); | 264 PostLegacyJsonMessage("hello", data.Pass()); |
(...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1178 pp::VarArrayBuffer array_buffer(buffer_size); | 1181 pp::VarArrayBuffer array_buffer(buffer_size); |
1179 void* data_ptr = array_buffer.Map(); | 1182 void* data_ptr = array_buffer.Map(); |
1180 memcpy(data_ptr, buffer, buffer_size); | 1183 memcpy(data_ptr, buffer, buffer_size); |
1181 array_buffer.Unmap(); | 1184 array_buffer.Unmap(); |
1182 pp::VarDictionary data_dictionary; | 1185 pp::VarDictionary data_dictionary; |
1183 data_dictionary.Set(pp::Var("buffer"), array_buffer); | 1186 data_dictionary.Set(pp::Var("buffer"), array_buffer); |
1184 PostChromotingMessage("mediaSourceData", data_dictionary); | 1187 PostChromotingMessage("mediaSourceData", data_dictionary); |
1185 } | 1188 } |
1186 | 1189 |
1187 } // namespace remoting | 1190 } // namespace remoting |
OLD | NEW |