OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/browser/api/cast_channel/cast_channel_api.h" | 5 #include "extensions/browser/api/cast_channel/cast_channel_api.h" |
6 | 6 |
| 7 #include <stddef.h> |
| 8 #include <stdint.h> |
| 9 |
7 #include <limits> | 10 #include <limits> |
8 #include <string> | 11 #include <string> |
9 #include <utility> | 12 #include <utility> |
10 | 13 |
11 #include "base/json/json_writer.h" | 14 #include "base/json/json_writer.h" |
12 #include "base/lazy_instance.h" | 15 #include "base/lazy_instance.h" |
13 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
14 #include "base/strings/string_number_conversions.h" | 17 #include "base/strings/string_number_conversions.h" |
15 #include "base/time/default_clock.h" | 18 #include "base/time/default_clock.h" |
16 #include "base/values.h" | 19 #include "base/values.h" |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 : new_channel_id_(0) { | 243 : new_channel_id_(0) { |
241 } | 244 } |
242 | 245 |
243 CastChannelOpenFunction::~CastChannelOpenFunction() { } | 246 CastChannelOpenFunction::~CastChannelOpenFunction() { } |
244 | 247 |
245 net::IPEndPoint* CastChannelOpenFunction::ParseConnectInfo( | 248 net::IPEndPoint* CastChannelOpenFunction::ParseConnectInfo( |
246 const ConnectInfo& connect_info) { | 249 const ConnectInfo& connect_info) { |
247 net::IPAddressNumber ip_address; | 250 net::IPAddressNumber ip_address; |
248 CHECK(net::ParseIPLiteralToNumber(connect_info.ip_address, &ip_address)); | 251 CHECK(net::ParseIPLiteralToNumber(connect_info.ip_address, &ip_address)); |
249 return new net::IPEndPoint(ip_address, | 252 return new net::IPEndPoint(ip_address, |
250 static_cast<uint16>(connect_info.port)); | 253 static_cast<uint16_t>(connect_info.port)); |
251 } | 254 } |
252 | 255 |
253 bool CastChannelOpenFunction::PrePrepare() { | 256 bool CastChannelOpenFunction::PrePrepare() { |
254 api_ = CastChannelAPI::Get(browser_context()); | 257 api_ = CastChannelAPI::Get(browser_context()); |
255 return CastChannelAsyncApiFunction::PrePrepare(); | 258 return CastChannelAsyncApiFunction::PrePrepare(); |
256 } | 259 } |
257 | 260 |
258 bool CastChannelOpenFunction::Prepare() { | 261 bool CastChannelOpenFunction::Prepare() { |
259 params_ = Open::Params::Create(*args_); | 262 params_ = Open::Params::Create(*args_); |
260 EXTENSION_FUNCTION_VALIDATE(params_.get()); | 263 EXTENSION_FUNCTION_VALIDATE(params_.get()); |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 std::string& signature = params_->signature; | 562 std::string& signature = params_->signature; |
560 if (signature.empty() || keys.empty() || | 563 if (signature.empty() || keys.empty() || |
561 !cast_channel::SetTrustedCertificateAuthorities(keys, signature)) { | 564 !cast_channel::SetTrustedCertificateAuthorities(keys, signature)) { |
562 SetError("Unable to set authority keys."); | 565 SetError("Unable to set authority keys."); |
563 } | 566 } |
564 | 567 |
565 AsyncWorkCompleted(); | 568 AsyncWorkCompleted(); |
566 } | 569 } |
567 | 570 |
568 } // namespace extensions | 571 } // namespace extensions |
OLD | NEW |