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> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <limits> | 10 #include <limits> |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 api_->GetLogger())); | 327 api_->GetLogger())); |
328 if (socket->keep_alive()) { | 328 if (socket->keep_alive()) { |
329 // Wrap read delegate in a KeepAliveDelegate for timeout handling. | 329 // Wrap read delegate in a KeepAliveDelegate for timeout handling. |
330 api::cast_channel::KeepAliveDelegate* keep_alive = | 330 api::cast_channel::KeepAliveDelegate* keep_alive = |
331 new api::cast_channel::KeepAliveDelegate( | 331 new api::cast_channel::KeepAliveDelegate( |
332 socket, api_->GetLogger(), std::move(delegate), ping_interval_, | 332 socket, api_->GetLogger(), std::move(delegate), ping_interval_, |
333 liveness_timeout_); | 333 liveness_timeout_); |
334 std::unique_ptr<base::Timer> injected_timer = | 334 std::unique_ptr<base::Timer> injected_timer = |
335 api_->GetInjectedTimeoutTimerForTest(); | 335 api_->GetInjectedTimeoutTimerForTest(); |
336 if (injected_timer) { | 336 if (injected_timer) { |
337 keep_alive->SetTimersForTest(base::MakeUnique<base::Timer>(false, false), | 337 keep_alive->SetTimersForTest(base::MakeUnique<base::OneShotTimer>(), |
338 std::move(injected_timer)); | 338 std::move(injected_timer)); |
339 } | 339 } |
340 delegate.reset(keep_alive); | 340 delegate.reset(keep_alive); |
341 } | 341 } |
342 | 342 |
343 socket->Connect(std::move(delegate), | 343 socket->Connect(std::move(delegate), |
344 base::Bind(&CastChannelOpenFunction::OnOpen, this)); | 344 base::Bind(&CastChannelOpenFunction::OnOpen, this)); |
345 } | 345 } |
346 | 346 |
347 void CastChannelOpenFunction::OnOpen(cast_channel::ChannelError result) { | 347 void CastChannelOpenFunction::OnOpen(cast_channel::ChannelError result) { |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 BrowserThread::PostTask( | 519 BrowserThread::PostTask( |
520 BrowserThread::UI, FROM_HERE, | 520 BrowserThread::UI, FROM_HERE, |
521 base::Bind(ui_dispatch_cb_, socket_->owner_extension_id(), | 521 base::Bind(ui_dispatch_cb_, socket_->owner_extension_id(), |
522 base::Passed(std::move(event)))); | 522 base::Passed(std::move(event)))); |
523 } | 523 } |
524 | 524 |
525 void CastChannelOpenFunction::CastMessageHandler::Start() { | 525 void CastChannelOpenFunction::CastMessageHandler::Start() { |
526 } | 526 } |
527 | 527 |
528 } // namespace extensions | 528 } // namespace extensions |
OLD | NEW |