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

Unified Diff: core/src/fxge/win32/fx_win32_device.cpp

Issue 1062863006: Remove checks in fxge/{apple,win32,skia,dib} now that FX_NEW cant return 0 (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Fix missing |new| typo. Created 5 years, 8 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/src/fxge/skia/fx_skia_device.cpp ('k') | core/src/fxge/win32/fx_win32_dib.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fxge/win32/fx_win32_device.cpp
diff --git a/core/src/fxge/win32/fx_win32_device.cpp b/core/src/fxge/win32/fx_win32_device.cpp
index debf94d7a6f4303f61b04b5ff3b85bf58749624a..00baa2bee92e0fca1543d46e80f59954082a866d 100644
--- a/core/src/fxge/win32/fx_win32_device.cpp
+++ b/core/src/fxge/win32/fx_win32_device.cpp
@@ -393,14 +393,11 @@ FX_BOOL CWin32FontInfo::GetFontCharset(void* hFont, int& charset)
}
IFX_SystemFontInfo* IFX_SystemFontInfo::CreateDefault()
{
- return FX_NEW CWin32FontInfo;
+ return new CWin32FontInfo;
}
void CFX_GEModule::InitPlatform()
{
- CWin32Platform* pPlatformData = FX_NEW CWin32Platform;
- if (!pPlatformData) {
- return;
- }
+ CWin32Platform* pPlatformData = new CWin32Platform;
OSVERSIONINFO ver;
ver.dwOSVersionInfoSize = sizeof(ver);
GetVersionEx(&ver);
@@ -1143,10 +1140,7 @@ CFX_WindowsDevice::CFX_WindowsDevice(HDC hDC, FX_BOOL bCmykOutput, FX_BOOL bForc
m_bForcePSOutput = bForcePSOutput;
m_psLevel = psLevel;
if (bForcePSOutput) {
- IFX_RenderDeviceDriver* pDriver = FX_NEW CPSPrinterDriver;
- if (!pDriver) {
- return;
- }
+ IFX_RenderDeviceDriver* pDriver = new CPSPrinterDriver;
((CPSPrinterDriver*)pDriver)->Init(hDC, psLevel, bCmykOutput);
SetDeviceDriver(pDriver);
return;
@@ -1172,9 +1166,9 @@ IFX_RenderDeviceDriver* CFX_WindowsDevice::CreateDriver(HDC hDC, FX_BOOL bCmykOu
device_class = FXDC_DISPLAY;
}
if (device_class == FXDC_PRINTER) {
- return FX_NEW CGdiPrinterDriver(hDC);
+ return new CGdiPrinterDriver(hDC);
}
- return FX_NEW CGdiDisplayDriver(hDC);
+ return new CGdiDisplayDriver(hDC);
}
CFX_WinBitmapDevice::CFX_WinBitmapDevice(int width, int height, FXDIB_Format format)
{
@@ -1190,18 +1184,12 @@ CFX_WinBitmapDevice::CFX_WinBitmapDevice(int width, int height, FXDIB_Format for
if (m_hBitmap == NULL) {
return;
}
- CFX_DIBitmap* pBitmap = FX_NEW CFX_DIBitmap;
- if (!pBitmap) {
- return;
- }
+ CFX_DIBitmap* pBitmap = new CFX_DIBitmap;
pBitmap->Create(width, height, format, pBuffer);
SetBitmap(pBitmap);
m_hDC = ::CreateCompatibleDC(NULL);
m_hOldBitmap = (HBITMAP)SelectObject(m_hDC, m_hBitmap);
- IFX_RenderDeviceDriver* pDriver = FX_NEW CGdiDisplayDriver(m_hDC);
- if (!pDriver) {
- return;
- }
+ IFX_RenderDeviceDriver* pDriver = new CGdiDisplayDriver(m_hDC);
SetDeviceDriver(pDriver);
}
CFX_WinBitmapDevice::~CFX_WinBitmapDevice()
« no previous file with comments | « core/src/fxge/skia/fx_skia_device.cpp ('k') | core/src/fxge/win32/fx_win32_dib.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698