Index: ui/ozone/platform/drm/gpu/drm_device.cc |
diff --git a/ui/ozone/platform/drm/gpu/drm_device.cc b/ui/ozone/platform/drm/gpu/drm_device.cc |
index 69164431c257ea089585881872abb57d643c85fd..393d5e522ce05b6df97cc69590272a26cb94266c 100644 |
--- a/ui/ozone/platform/drm/gpu/drm_device.cc |
+++ b/ui/ozone/platform/drm/gpu/drm_device.cc |
@@ -268,20 +268,15 @@ class DrmDevice::IOWatcher |
DISALLOW_COPY_AND_ASSIGN(IOWatcher); |
}; |
-DrmDevice::DrmDevice(const base::FilePath& device_path) |
- : device_path_(device_path), |
- file_(device_path, |
- base::File::FLAG_OPEN | base::File::FLAG_READ | |
- base::File::FLAG_WRITE), |
- page_flip_manager_(new PageFlipManager()) { |
- LOG_IF(FATAL, !file_.IsValid()) |
- << "Failed to open '" << device_path_.value() |
- << "': " << base::File::ErrorToString(file_.error_details()); |
+DrmDeviceBase::DrmDeviceBase(const base::FilePath& device_path, base::File file) |
+ : device_path_(device_path), file_(file.Pass()) { |
+} |
+ |
+DrmDeviceBase::~DrmDeviceBase() { |
} |
DrmDevice::DrmDevice(const base::FilePath& device_path, base::File file) |
- : device_path_(device_path), |
- file_(file.Pass()), |
+ : DrmDeviceBase(device_path, file.Pass()), |
page_flip_manager_(new PageFlipManager()) { |
} |
@@ -321,6 +316,10 @@ void DrmDevice::InitializeTaskRunner( |
new IOWatcher(file_.GetPlatformFile(), task_runner_, page_flip_manager_); |
} |
+DrmDeviceBase::Type DrmDevice::GetType() const { |
+ return DRM; |
+} |
+ |
ScopedDrmCrtcPtr DrmDevice::GetCrtc(uint32_t crtc_id) { |
DCHECK(file_.IsValid()); |
return ScopedDrmCrtcPtr(drmModeGetCrtc(file_.GetPlatformFile(), crtc_id)); |