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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 RequestFilteringInputEvents(PP_INPUTEVENT_CLASS_KEYBOARD); | 215 RequestFilteringInputEvents(PP_INPUTEVENT_CLASS_KEYBOARD); |
216 | 216 |
217 // Resister this instance to handle debug log messsages. | 217 // Resister this instance to handle debug log messsages. |
218 RegisterLoggingInstance(); | 218 RegisterLoggingInstance(); |
219 | 219 |
220 #if defined(USE_OPENSSL) | 220 #if defined(USE_OPENSSL) |
221 // Initialize random seed for libjingle. It's necessary only with OpenSSL. | 221 // Initialize random seed for libjingle. It's necessary only with OpenSSL. |
222 char random_seed[kRandomSeedSize]; | 222 char random_seed[kRandomSeedSize]; |
223 crypto::RandBytes(random_seed, sizeof(random_seed)); | 223 crypto::RandBytes(random_seed, sizeof(random_seed)); |
224 talk_base::InitRandom(random_seed, sizeof(random_seed)); | 224 talk_base::InitRandom(random_seed, sizeof(random_seed)); |
225 #elif defined(USE_NSS) | 225 #else |
| 226 // Libjingle's SSL implementation is not really used, but it has to be |
| 227 // initialized for NSS builds to make sure that RNG is initialized in NSS, |
| 228 // because libjingle uses it. |
226 talk_base::InitializeSSL(); | 229 talk_base::InitializeSSL(); |
227 #endif // defined(USE_NSS) | 230 #endif // !defined(USE_OPENSSL) |
228 | 231 |
229 // Send hello message. | 232 // Send hello message. |
230 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); | 233 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); |
231 data->SetInteger("apiVersion", kApiVersion); | 234 data->SetInteger("apiVersion", kApiVersion); |
232 data->SetString("apiFeatures", kApiFeatures); | 235 data->SetString("apiFeatures", kApiFeatures); |
233 data->SetInteger("apiMinVersion", kApiMinMessagingVersion); | 236 data->SetInteger("apiMinVersion", kApiMinMessagingVersion); |
234 data->SetString("requestedCapabilities", kRequestedCapabilities); | 237 data->SetString("requestedCapabilities", kRequestedCapabilities); |
235 data->SetString("supportedCapabilities", kSupportedCapabilities); | 238 data->SetString("supportedCapabilities", kSupportedCapabilities); |
236 | 239 |
237 PostLegacyJsonMessage("hello", data.Pass()); | 240 PostLegacyJsonMessage("hello", data.Pass()); |
(...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1126 pp::VarArrayBuffer array_buffer(buffer_size); | 1129 pp::VarArrayBuffer array_buffer(buffer_size); |
1127 void* data_ptr = array_buffer.Map(); | 1130 void* data_ptr = array_buffer.Map(); |
1128 memcpy(data_ptr, buffer, buffer_size); | 1131 memcpy(data_ptr, buffer, buffer_size); |
1129 array_buffer.Unmap(); | 1132 array_buffer.Unmap(); |
1130 pp::VarDictionary data_dictionary; | 1133 pp::VarDictionary data_dictionary; |
1131 data_dictionary.Set(pp::Var("buffer"), array_buffer); | 1134 data_dictionary.Set(pp::Var("buffer"), array_buffer); |
1132 PostChromotingMessage("mediaSourceData", data_dictionary); | 1135 PostChromotingMessage("mediaSourceData", data_dictionary); |
1133 } | 1136 } |
1134 | 1137 |
1135 } // namespace remoting | 1138 } // namespace remoting |
OLD | NEW |