Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "content/browser/webrtc/webrtc_internals.h" | 5 #include "content/browser/webrtc/webrtc_internals.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 550 << ("Cancel the wake lock on application suspension since no " | 550 << ("Cancel the wake lock on application suspension since no " |
| 551 "PeerConnections are active anymore."); | 551 "PeerConnections are active anymore."); |
| 552 GetWakeLockService()->CancelWakeLock(); | 552 GetWakeLockService()->CancelWakeLock(); |
| 553 } else if (num_open_connections_ != 0) { | 553 } else if (num_open_connections_ != 0) { |
| 554 DVLOG(1) << ("Preventing the application from being suspended while one or " | 554 DVLOG(1) << ("Preventing the application from being suspended while one or " |
| 555 "more PeerConnections are active."); | 555 "more PeerConnections are active."); |
| 556 GetWakeLockService()->RequestWakeLock(); | 556 GetWakeLockService()->RequestWakeLock(); |
| 557 } | 557 } |
| 558 } | 558 } |
| 559 | 559 |
| 560 device::mojom::WakeLockService* WebRTCInternals::GetWakeLockService() { | 560 device::mojom::WakeLock* WebRTCInternals::GetWakeLockService() { |
|
blundell
2017/06/05 11:48:11
same
juncai
2017/06/05 18:58:25
Done.
| |
| 561 // Here is a lazy binding, and will not reconnect after connection error. | 561 // Here is a lazy binding, and will not reconnect after connection error. |
| 562 if (!wake_lock_service_) { | 562 if (!wake_lock_service_) { |
| 563 device::mojom::WakeLockServiceRequest request = | 563 device::mojom::WakeLockRequest request = |
| 564 mojo::MakeRequest(&wake_lock_service_); | 564 mojo::MakeRequest(&wake_lock_service_); |
| 565 // In some testing contexts, the service manager connection isn't | 565 // In some testing contexts, the service manager connection isn't |
| 566 // initialized. | 566 // initialized. |
| 567 if (ServiceManagerConnection::GetForProcess()) { | 567 if (ServiceManagerConnection::GetForProcess()) { |
| 568 service_manager::Connector* connector = | 568 service_manager::Connector* connector = |
| 569 ServiceManagerConnection::GetForProcess()->GetConnector(); | 569 ServiceManagerConnection::GetForProcess()->GetConnector(); |
| 570 DCHECK(connector); | 570 DCHECK(connector); |
| 571 device::mojom::WakeLockProviderPtr wake_lock_provider; | 571 device::mojom::WakeLockProviderPtr wake_lock_provider; |
| 572 connector->BindInterface(device::mojom::kServiceName, | 572 connector->BindInterface(device::mojom::kServiceName, |
| 573 mojo::MakeRequest(&wake_lock_provider)); | 573 mojo::MakeRequest(&wake_lock_provider)); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 606 | 606 |
| 607 if (this_pid == static_cast<int>(pid) && this_lid == lid) { | 607 if (this_pid == static_cast<int>(pid) && this_lid == lid) { |
| 608 if (index) | 608 if (index) |
| 609 *index = i; | 609 *index = i; |
| 610 return record; | 610 return record; |
| 611 } | 611 } |
| 612 } | 612 } |
| 613 return nullptr; | 613 return nullptr; |
| 614 } | 614 } |
| 615 } // namespace content | 615 } // namespace content |
| OLD | NEW |