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

Unified Diff: ui/ozone/platform/drm/gpu/drm_gpu_platform_support.h

Issue 1311043016: Switch DRM platform to using a separate thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mv-drm-calls-on-thread2
Patch Set: . Created 5 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: ui/ozone/platform/drm/gpu/drm_gpu_platform_support.h
diff --git a/ui/ozone/platform/drm/gpu/drm_gpu_platform_support.h b/ui/ozone/platform/drm/gpu/drm_gpu_platform_support.h
index 21caf35e6550877b29c2cadb9133d99aad7ba639..e3676aeec3cfb48f23a937f1634a9074f3c5659f 100644
--- a/ui/ozone/platform/drm/gpu/drm_gpu_platform_support.h
+++ b/ui/ozone/platform/drm/gpu/drm_gpu_platform_support.h
@@ -5,18 +5,16 @@
#ifndef UI_OZONE_PLATFORM_DRM_GPU_DRM_GPU_PLATFORM_SUPPORT_H_
#define UI_OZONE_PLATFORM_DRM_GPU_DRM_GPU_PLATFORM_SUPPORT_H_
-#include "base/containers/scoped_ptr_hash_map.h"
+#include "base/callback.h"
#include "base/memory/scoped_ptr.h"
-#include "ipc/message_filter.h"
+#include "base/memory/weak_ptr.h"
#include "ui/display/types/display_constants.h"
#include "ui/gfx/native_widget_types.h"
-#include "ui/ozone/public/gpu_platform_support.h"
class SkBitmap;
namespace base {
class FilePath;
-class SingleThreadTaskRunner;
struct FileDescriptor;
}
@@ -25,34 +23,36 @@ class Point;
class Rect;
}
+namespace IPC {
+class Message;
+class Sender;
+}
+
namespace ui {
class DrmDeviceManager;
class DrmGpuDisplayManager;
-class DrmSurfaceFactory;
-class DrmWindow;
class ScreenManager;
class ScanoutBufferGenerator;
struct DisplayMode_Params;
-struct DisplaySnapshot_Params;
struct OverlayCheck_Params;
struct GammaRampRGBEntry;
-class DrmGpuPlatformSupport : public GpuPlatformSupport {
+class DrmGpuPlatformSupport
+ : public base::SupportsWeakPtr<DrmGpuPlatformSupport> {
spang 2015/09/18 00:46:25 Please only use WeakPtrFactory for weak pointers.
dnicoara 2015/09/18 17:43:07 Why? SupportsWeakPtr is meant to be used when you
spang 2015/09/18 20:49:55 SupportsWeakPtr causes subtle bugs and is deprecat
dnicoara 2015/09/29 17:57:05 Removed entirely since it's not needed anymore.
public:
+ typedef base::Callback<void(IPC::Message*)> IPCSender;
+
DrmGpuPlatformSupport(DrmDeviceManager* drm_device_manager,
ScreenManager* screen_manager,
ScanoutBufferGenerator* buffer_generator,
scoped_ptr<DrmGpuDisplayManager> display_manager);
- ~DrmGpuPlatformSupport() override;
+ ~DrmGpuPlatformSupport();
- // GpuPlatformSupport:
- void OnChannelEstablished(IPC::Sender* sender) override;
- IPC::MessageFilter* GetMessageFilter() override;
+ void RegisterSender(const IPCSender& sender);
- // IPC::Listener:
- bool OnMessageReceived(const IPC::Message& message) override;
+ bool OnMessageReceived(const IPC::Message& message);
private:
void OnCreateWindow(gfx::AcceleratedWidget widget);
@@ -83,16 +83,12 @@ class DrmGpuPlatformSupport : public GpuPlatformSupport {
void OnSetHDCPState(int64_t display_id, HDCPState state);
void OnSetGammaRamp(int64_t id, const std::vector<GammaRampRGBEntry>& lut);
- void SetIOTaskRunner(
- const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner);
-
- IPC::Sender* sender_ = nullptr; // Not owned.
- DrmDeviceManager* drm_device_manager_; // Not owned.
- ScreenManager* screen_manager_; // Not owned.
+ DrmDeviceManager* drm_device_manager_; // Not owned.
+ ScreenManager* screen_manager_; // Not owned.
ScanoutBufferGenerator* buffer_generator_; // Not owned.
scoped_ptr<DrmGpuDisplayManager> display_manager_;
- scoped_refptr<IPC::MessageFilter> filter_;
+ IPCSender sender_;
};
} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698