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

Unified Diff: content/browser/vibration_browsertest.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
Index: content/browser/vibration_browsertest.cc
diff --git a/content/browser/vibration_browsertest.cc b/content/browser/vibration_browsertest.cc
index 26779911514e0bee592166fbc3a7a9400e0834fa..320e1294351e1b76300e9a921adee2dda42ed228 100644
--- a/content/browser/vibration_browsertest.cc
+++ b/content/browser/vibration_browsertest.cc
@@ -50,16 +50,15 @@ void ResetGlobalValues() {
class FakeVibrationManager : public device::VibrationManager {
public:
- static void Create(mojo::InterfaceRequest<VibrationManager> request) {
- new FakeVibrationManager(std::move(request));
+ FakeVibrationManager() {}
+ ~FakeVibrationManager() override {}
+
+ static void Create(device::VibrationManagerRequest request) {
+ mojo::MakeStrongBinding(base::MakeUnique<FakeVibrationManager>(),
+ std::move(request));
}
private:
- FakeVibrationManager(mojo::InterfaceRequest<VibrationManager> request)
- : binding_(this, std::move(request)) {}
-
- ~FakeVibrationManager() override {}
-
void Vibrate(int64_t milliseconds, const VibrateCallback& callback) override {
g_vibrate_milliseconds = milliseconds;
callback.Run();
@@ -71,8 +70,6 @@ class FakeVibrationManager : public device::VibrationManager {
callback.Run();
g_wait_cancel_runner->Quit();
}
-
- mojo::StrongBinding<VibrationManager> binding_;
};
class VibrationTest : public ContentBrowserTest {

Powered by Google App Engine
This is Rietveld 408576698