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

Unified Diff: content/child/child_client_native_pixmap_manager_message_filter_ozone.cc

Issue 1248713002: ozone: ClientPixmapManager passes VGEM fd from browser to renderer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase to latest crrev.com/1128113011 Created 5 years, 5 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: content/child/child_client_native_pixmap_manager_message_filter_ozone.cc
diff --git a/content/child/child_client_native_pixmap_manager_message_filter_ozone.cc b/content/child/child_client_native_pixmap_manager_message_filter_ozone.cc
new file mode 100644
index 0000000000000000000000000000000000000000..7378a4d4d7cd4f01b82d3a468d1db30615504550
--- /dev/null
+++ b/content/child/child_client_native_pixmap_manager_message_filter_ozone.cc
@@ -0,0 +1,45 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/child/child_client_native_pixmap_manager_message_filter_ozone.h"
+
+#include "base/files/scoped_file.h"
+#include "content/child/child_client_native_pixmap_manager_ozone.h"
+#include "content/common/gpu/client_native_pixmap_manager_ozone_messages.h"
+#include "ipc/ipc_message_macros.h"
+
+namespace content {
+
+ChildClientNativePixmapManagerMessageFilter::
+ ChildClientNativePixmapManagerMessageFilter() {}
+
+ChildClientNativePixmapManagerMessageFilter::
+ ~ChildClientNativePixmapManagerMessageFilter() {}
+
+void ChildClientNativePixmapManagerMessageFilter::OnSetVirtualDevice(
+ const base::FileDescriptor& virtual_device) {
+ if (!ui::ClientNativePixmapManager::GetInstance()) {
+ ChildClientNativePixmapManager::GetInstance()->Initialize(virtual_device);
+ ui::ClientNativePixmapManager::SetInstance(
+ ChildClientNativePixmapManager::GetInstance());
+ } else {
+ // Many child threads can live in the same process. e.g. --single-process
+ if (virtual_device.auto_close) {
+ base::ScopedFD closing_fd(virtual_device.fd);
+ }
+ }
+}
+
+bool ChildClientNativePixmapManagerMessageFilter::OnMessageReceived(
+ const IPC::Message& message) {
+ bool handled = true;
+ IPC_BEGIN_MESSAGE_MAP(ChildClientNativePixmapManagerMessageFilter, message)
+ IPC_MESSAGE_HANDLER(ChildClientNativePixmapManagerMsg_SetVirtualDevice,
+ OnSetVirtualDevice)
+ IPC_MESSAGE_UNHANDLED(handled = false)
+ IPC_END_MESSAGE_MAP()
+ return handled;
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698