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

Unified Diff: components/dom_distiller/content/browser/distiller_javascript_service_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: components/dom_distiller/content/browser/distiller_javascript_service_impl.cc
diff --git a/components/dom_distiller/content/browser/distiller_javascript_service_impl.cc b/components/dom_distiller/content/browser/distiller_javascript_service_impl.cc
index ea825c0014fb2bab35585a92113a3d455725fe4b..5ed3eb84690036c0befc16cf4e66f384a83bd843 100644
--- a/components/dom_distiller/content/browser/distiller_javascript_service_impl.cc
+++ b/components/dom_distiller/content/browser/distiller_javascript_service_impl.cc
@@ -10,15 +10,14 @@
#include "components/dom_distiller/core/feedback_reporter.h"
#include "content/public/browser/user_metrics.h"
#include "mojo/public/cpp/bindings/string.h"
+#include "mojo/public/cpp/bindings/strong_binding.h"
namespace dom_distiller {
DistillerJavaScriptServiceImpl::DistillerJavaScriptServiceImpl(
content::RenderFrameHost* render_frame_host,
- DistillerUIHandle* distiller_ui_handle,
- mojo::InterfaceRequest<mojom::DistillerJavaScriptService> request)
- : binding_(this, std::move(request)),
- render_frame_host_(render_frame_host),
+ DistillerUIHandle* distiller_ui_handle)
+ : render_frame_host_(render_frame_host),
distiller_ui_handle_(distiller_ui_handle) {}
DistillerJavaScriptServiceImpl::~DistillerJavaScriptServiceImpl() {}
@@ -66,9 +65,9 @@ void CreateDistillerJavaScriptService(
content::RenderFrameHost* render_frame_host,
DistillerUIHandle* distiller_ui_handle,
mojo::InterfaceRequest<mojom::DistillerJavaScriptService> request) {
- // This is strongly bound and owned by the pipe.
- new DistillerJavaScriptServiceImpl(render_frame_host, distiller_ui_handle,
- std::move(request));
+ mojo::MakeStrongBinding(base::MakeUnique<DistillerJavaScriptServiceImpl>(
+ render_frame_host, distiller_ui_handle),
+ std::move(request));
}
} // namespace dom_distiller

Powered by Google App Engine
This is Rietveld 408576698