Chromium Code Reviews| 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 <limits> | 7 #include <limits> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 340 scoped_ptr<CastSocket> test_socket = api_->GetSocketForTest(); | 340 scoped_ptr<CastSocket> test_socket = api_->GetSocketForTest(); |
| 341 if (test_socket.get()) { | 341 if (test_socket.get()) { |
| 342 socket = test_socket.release(); | 342 socket = test_socket.release(); |
| 343 } else { | 343 } else { |
| 344 socket = new cast_channel::CastSocketImpl( | 344 socket = new cast_channel::CastSocketImpl( |
| 345 extension_->id(), *ip_endpoint_, channel_auth_, | 345 extension_->id(), *ip_endpoint_, channel_auth_, |
| 346 ExtensionsBrowserClient::Get()->GetNetLog(), | 346 ExtensionsBrowserClient::Get()->GetNetLog(), |
| 347 base::TimeDelta::FromMilliseconds(connect_info_->timeout.get() | 347 base::TimeDelta::FromMilliseconds(connect_info_->timeout.get() |
| 348 ? *connect_info_->timeout | 348 ? *connect_info_->timeout |
| 349 : kDefaultConnectTimeoutMillis), | 349 : kDefaultConnectTimeoutMillis), |
| 350 api_->GetLogger()); | 350 api_->GetLogger(), |
| 351 connect_info_->capabilities.get() ? *connect_info_->capabilities : 0); | |
|
mark a. foltz
2015/01/13 01:42:19
Consider declaring a constant value to provide the
vadimgo
2015/01/13 02:21:44
Done.
| |
| 351 } | 352 } |
| 352 new_channel_id_ = AddSocket(socket); | 353 new_channel_id_ = AddSocket(socket); |
| 353 scoped_ptr<CastMessageHandler> delegate(new CastMessageHandler(api_, socket)); | 354 scoped_ptr<CastMessageHandler> delegate(new CastMessageHandler(api_, socket)); |
| 354 api_->GetLogger()->LogNewSocketEvent(*socket); | 355 api_->GetLogger()->LogNewSocketEvent(*socket); |
| 355 socket->Connect(delegate.Pass(), | 356 socket->Connect(delegate.Pass(), |
| 356 base::Bind(&CastChannelOpenFunction::OnOpen, this)); | 357 base::Bind(&CastChannelOpenFunction::OnOpen, this)); |
| 357 } | 358 } |
| 358 | 359 |
| 359 void CastChannelOpenFunction::OnOpen(cast_channel::ChannelError result) { | 360 void CastChannelOpenFunction::OnOpen(cast_channel::ChannelError result) { |
| 360 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 361 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 562 std::string& signature = params_->signature; | 563 std::string& signature = params_->signature; |
| 563 if (signature.empty() || keys.empty() || | 564 if (signature.empty() || keys.empty() || |
| 564 !cast_channel::SetTrustedCertificateAuthorities(keys, signature)) { | 565 !cast_channel::SetTrustedCertificateAuthorities(keys, signature)) { |
| 565 SetError("Unable to set authority keys."); | 566 SetError("Unable to set authority keys."); |
| 566 } | 567 } |
| 567 | 568 |
| 568 AsyncWorkCompleted(); | 569 AsyncWorkCompleted(); |
| 569 } | 570 } |
| 570 | 571 |
| 571 } // namespace extensions | 572 } // namespace extensions |
| OLD | NEW |