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

Unified Diff: core/fxge/ge/fx_ge_device.cpp

Issue 2163103002: Use smart pointers for graphics device classes (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: fix all platforms Created 4 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
« no previous file with comments | « core/fxge/dib/fx_dib_main.cpp ('k') | core/fxge/include/fx_dib.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxge/ge/fx_ge_device.cpp
diff --git a/core/fxge/ge/fx_ge_device.cpp b/core/fxge/ge/fx_ge_device.cpp
index 9bb950beed26c70faf75a78f9dcd53079a062fcd..571f90cfa11658217c0ad51202c02ad09fd33f7e 100644
--- a/core/fxge/ge/fx_ge_device.cpp
+++ b/core/fxge/ge/fx_ge_device.cpp
@@ -17,21 +17,13 @@ CFX_RenderDevice::CFX_RenderDevice()
m_Height(0),
m_bpp(0),
m_RenderCaps(0),
- m_DeviceClass(0),
- m_pDeviceDriver(nullptr) {}
+ m_DeviceClass(0) {}
-CFX_RenderDevice::~CFX_RenderDevice() {
- delete m_pDeviceDriver;
-}
-
-void CFX_RenderDevice::Flush() {
- delete m_pDeviceDriver;
- m_pDeviceDriver = nullptr;
-}
+CFX_RenderDevice::~CFX_RenderDevice() {}
-void CFX_RenderDevice::SetDeviceDriver(IFX_RenderDeviceDriver* pDriver) {
- delete m_pDeviceDriver;
- m_pDeviceDriver = pDriver;
+void CFX_RenderDevice::SetDeviceDriver(
+ std::unique_ptr<IFX_RenderDeviceDriver> pDriver) {
+ m_pDeviceDriver = std::move(pDriver);
InitDeviceInfo();
}
« no previous file with comments | « core/fxge/dib/fx_dib_main.cpp ('k') | core/fxge/include/fx_dib.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698