Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(389)

Unified Diff: content/browser/device_sensors/device_sensor_host.cc

Issue 2326913003: Privatize StrongBinding lifetime management (Closed)
Patch Set: rebase Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/device_sensors/device_sensor_host.h ('k') | content/browser/hyphenation/hyphenation_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/device_sensors/device_sensor_host.cc
diff --git a/content/browser/device_sensors/device_sensor_host.cc b/content/browser/device_sensors/device_sensor_host.cc
index 4ece1b12dea3d137ecc94c11b0661e61e689eb61..e4b806967e5c16aac8448233141f422249d19874 100644
--- a/content/browser/device_sensors/device_sensor_host.cc
+++ b/content/browser/device_sensors/device_sensor_host.cc
@@ -6,19 +6,21 @@
#include "content/browser/device_sensors/device_sensor_service.h"
#include "content/public/browser/browser_thread.h"
+#include "mojo/public/cpp/bindings/strong_binding.h"
namespace content {
template <typename MojoInterface, ConsumerType consumer_type>
void DeviceSensorHost<MojoInterface, consumer_type>::Create(
mojo::InterfaceRequest<MojoInterface> request) {
- new DeviceSensorHost(std::move(request));
+ mojo::MakeStrongBinding(
+ base::WrapUnique(new DeviceSensorHost<MojoInterface, consumer_type>),
+ std::move(request));
}
template <typename MojoInterface, ConsumerType consumer_type>
-DeviceSensorHost<MojoInterface, consumer_type>::DeviceSensorHost(
- mojo::InterfaceRequest<MojoInterface> request)
- : is_started_(false), binding_(this, std::move(request)) {
+DeviceSensorHost<MojoInterface, consumer_type>::DeviceSensorHost()
+ : is_started_(false) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
}
« no previous file with comments | « content/browser/device_sensors/device_sensor_host.h ('k') | content/browser/hyphenation/hyphenation_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698