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

Unified Diff: chrome/gpu/chrome_content_gpu_client.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/gpu/chrome_content_gpu_client.cc
diff --git a/chrome/gpu/chrome_content_gpu_client.cc b/chrome/gpu/chrome_content_gpu_client.cc
index a8cb1e6c63ca19c61a76975122bbcfa1a444752a..d7b9acc2341c21bdcf2b692af43aee2b40670e9f 100644
--- a/chrome/gpu/chrome_content_gpu_client.cc
+++ b/chrome/gpu/chrome_content_gpu_client.cc
@@ -5,6 +5,8 @@
#include "chrome/gpu/chrome_content_gpu_client.h"
#include "base/command_line.h"
+#include "base/memory/ptr_util.h"
+#include "mojo/public/cpp/bindings/strong_binding.h"
#include "services/shell/public/cpp/connector.h"
#include "services/shell/public/cpp/interface_registry.h"
@@ -17,23 +19,18 @@ namespace {
void DeprecatedCreateGpuArcVideoService(
const gpu::GpuPreferences& gpu_preferences,
- ::arc::mojom::VideoAcceleratorServiceClientRequest request) {
- // GpuArcVideoService is strongly bound to the Mojo message pipe it
- // is connected to. When that message pipe is closed, either explicitly on the
- // other end (in the browser process), or by a connection error, this object
- // will be destroyed.
- auto* service = new chromeos::arc::GpuArcVideoService(gpu_preferences);
- service->Connect(std::move(request));
+ ::arc::mojom::VideoAcceleratorServiceClientRequest client_request) {
+ chromeos::arc::GpuArcVideoService::DeprecatedConnect(
+ base::MakeUnique<chromeos::arc::GpuArcVideoService>(gpu_preferences),
+ std::move(client_request));
}
void CreateGpuArcVideoService(
const gpu::GpuPreferences& gpu_preferences,
::arc::mojom::VideoAcceleratorServiceRequest request) {
- // GpuArcVideoService is strongly bound to the Mojo message pipe it
- // is connected to. When that message pipe is closed, either explicitly on the
- // other end (in the browser process), or by a connection error, this object
- // will be destroyed.
- new chromeos::arc::GpuArcVideoService(std::move(request), gpu_preferences);
+ mojo::MakeStrongBinding(
+ base::MakeUnique<chromeos::arc::GpuArcVideoService>(gpu_preferences),
+ std::move(request));
}
} // namespace
« no previous file with comments | « chrome/browser/metrics/leak_detector/leak_detector_remote_controller.cc ('k') | chrome/gpu/gpu_arc_video_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698