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

Unified Diff: components/dom_distiller/content/renderer/distiller_js_render_frame_observer.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: components/dom_distiller/content/renderer/distiller_js_render_frame_observer.cc
diff --git a/components/dom_distiller/content/renderer/distiller_js_render_frame_observer.cc b/components/dom_distiller/content/renderer/distiller_js_render_frame_observer.cc
index ac24a1f9d07cef9f3609545e97c18456fc37fc6f..0ba5d2718cc868da857e1764751314bac2b5d473 100644
--- a/components/dom_distiller/content/renderer/distiller_js_render_frame_observer.cc
+++ b/components/dom_distiller/content/renderer/distiller_js_render_frame_observer.cc
@@ -10,6 +10,7 @@
#include "components/dom_distiller/content/common/distiller_page_notifier_service.mojom.h"
#include "components/dom_distiller/content/renderer/distiller_page_notifier_service_impl.h"
#include "content/public/renderer/render_frame.h"
+#include "mojo/public/cpp/bindings/strong_binding.h"
#include "services/shell/public/cpp/interface_registry.h"
#include "v8/include/v8.h"
@@ -59,8 +60,9 @@ void DistillerJsRenderFrameObserver::RegisterMojoInterface() {
void DistillerJsRenderFrameObserver::CreateDistillerPageNotifierService(
mojo::InterfaceRequest<mojom::DistillerPageNotifierService> request) {
- // This is strongly bound to and owned by the pipe.
- new DistillerPageNotifierServiceImpl(this, std::move(request));
+ mojo::MakeStrongBinding(
+ base::MakeUnique<DistillerPageNotifierServiceImpl>(this),
+ std::move(request));
}
void DistillerJsRenderFrameObserver::SetIsDistillerPage() {

Powered by Google App Engine
This is Rietveld 408576698