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

Unified Diff: chrome/browser/media/output_protection_impl.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: chrome/browser/media/output_protection_impl.cc
diff --git a/chrome/browser/media/output_protection_impl.cc b/chrome/browser/media/output_protection_impl.cc
index 6668f394b8ba5c5a5d7fa00473246210ec16320f..1c77c057ad68b58cab86de58b326bb771dbfe0bc 100644
--- a/chrome/browser/media/output_protection_impl.cc
+++ b/chrome/browser/media/output_protection_impl.cc
@@ -6,6 +6,7 @@
#include "base/logging.h"
#include "content/public/browser/browser_thread.h"
+#include "mojo/public/cpp/bindings/strong_binding.h"
using media::mojom::OutputProtection;
@@ -16,17 +17,14 @@ void OutputProtectionImpl::Create(
DVLOG(2) << __FUNCTION__;
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK(render_frame_host);
-
- // The created object is strongly bound to (and owned by) the pipe.
- new OutputProtectionImpl(render_frame_host, std::move(request));
+ mojo::MakeStrongBinding(
+ base::MakeUnique<OutputProtectionImpl>(render_frame_host),
+ std::move(request));
}
OutputProtectionImpl::OutputProtectionImpl(
- content::RenderFrameHost* render_frame_host,
- mojo::InterfaceRequest<OutputProtection> request)
- : binding_(this, std::move(request)),
- render_frame_host_(render_frame_host),
- weak_factory_(this) {
+ content::RenderFrameHost* render_frame_host)
+ : render_frame_host_(render_frame_host), weak_factory_(this) {
DCHECK(render_frame_host_);
}
« no previous file with comments | « chrome/browser/media/output_protection_impl.h ('k') | chrome/browser/metrics/leak_detector/leak_detector_remote_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698