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

Unified Diff: content/browser/media/capture/image_capture_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
« no previous file with comments | « content/browser/media/capture/image_capture_impl.h ('k') | content/browser/mime_registry_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/media/capture/image_capture_impl.cc
diff --git a/content/browser/media/capture/image_capture_impl.cc b/content/browser/media/capture/image_capture_impl.cc
index 6f0615d09d34f8ed14e0a9847b557e1ce1f8f8d9..4860b3e4f0953a2623f6513a67e52ecdd2820e25 100644
--- a/content/browser/media/capture/image_capture_impl.cc
+++ b/content/browser/media/capture/image_capture_impl.cc
@@ -14,6 +14,7 @@
#include "content/public/browser/browser_thread.h"
#include "media/base/bind_to_current_loop.h"
#include "media/capture/video/video_capture_device.h"
+#include "mojo/public/cpp/bindings/strong_binding.h"
namespace content {
@@ -116,15 +117,16 @@ void TakePhotoOnIOThread(
} // anonymous namespace
-// static
-void ImageCaptureImpl::Create(
- mojo::InterfaceRequest<media::mojom::ImageCapture> request) {
- // |binding_| will take ownership of ImageCaptureImpl.
- new ImageCaptureImpl(std::move(request));
-}
+ImageCaptureImpl::ImageCaptureImpl() {}
ImageCaptureImpl::~ImageCaptureImpl() {}
+// static
+void ImageCaptureImpl::Create(media::mojom::ImageCaptureRequest request) {
+ mojo::MakeStrongBinding(base::MakeUnique<ImageCaptureImpl>(),
+ std::move(request));
+}
+
void ImageCaptureImpl::GetCapabilities(
const std::string& source_id,
const GetCapabilitiesCallback& callback) {
@@ -172,8 +174,4 @@ void ImageCaptureImpl::TakePhoto(const std::string& source_id,
base::Passed(&scoped_callback)));
}
-ImageCaptureImpl::ImageCaptureImpl(
- mojo::InterfaceRequest<media::mojom::ImageCapture> request)
- : binding_(this, std::move(request)) {}
-
} // namespace content
« no previous file with comments | « content/browser/media/capture/image_capture_impl.h ('k') | content/browser/mime_registry_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698