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

Unified Diff: ui/ozone/platform/drm/host/drm_device_handle.cc

Issue 1125283012: [Ozone-Drm] Revert of holding on to the DRM FDs in the browser process (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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: ui/ozone/platform/drm/host/drm_device_handle.cc
diff --git a/ui/ozone/platform/drm/host/drm_device_handle.cc b/ui/ozone/platform/drm/host/drm_device_handle.cc
index 36d5a8373099b551cb468478f2b2829343a7672f..8d9fc0c53af256964ff95b8175229814145ae113 100644
--- a/ui/ozone/platform/drm/host/drm_device_handle.cc
+++ b/ui/ozone/platform/drm/host/drm_device_handle.cc
@@ -30,7 +30,8 @@ DrmDeviceHandle::DrmDeviceHandle() {
}
DrmDeviceHandle::~DrmDeviceHandle() {
- base::ThreadRestrictions::AssertIOAllowed();
+ if (file_.is_valid())
+ base::ThreadRestrictions::AssertIOAllowed();
}
bool DrmDeviceHandle::Initialize(const base::FilePath& path) {
@@ -63,15 +64,8 @@ bool DrmDeviceHandle::IsValid() const {
return file_.is_valid();
}
-base::ScopedFD DrmDeviceHandle::Duplicate() {
- DCHECK(file_.is_valid());
- int fd = dup(file_.get());
- if (fd < 0) {
- PLOG(ERROR) << "Failed to dup";
- return base::ScopedFD();
- }
-
- return base::ScopedFD(fd);
+base::ScopedFD DrmDeviceHandle::PassFD() {
+ return file_.Pass();
}
} // namespace ui
« no previous file with comments | « ui/ozone/platform/drm/host/drm_device_handle.h ('k') | ui/ozone/platform/drm/host/drm_display_host_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698