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

Side by Side Diff: core/src/fxcrt/fx_basic_util.cpp

Issue 1052553006: Remove checks in fxcrt now that FX_NEW can't return 0. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « core/include/fxcrt/fx_basic.h ('k') | core/src/fxcrt/fx_xml_parser.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "../../include/fxcrt/fx_basic.h" 7 #include "../../include/fxcrt/fx_basic.h"
8 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ 8 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_
9 #include <sys/types.h> 9 #include <sys/types.h>
10 #include <dirent.h> 10 #include <dirent.h>
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 { 311 {
312 public: 312 public:
313 virtual ~CFindFileDataW() {} 313 virtual ~CFindFileDataW() {}
314 WIN32_FIND_DATAW m_FindData; 314 WIN32_FIND_DATAW m_FindData;
315 }; 315 };
316 #endif 316 #endif
317 void* FX_OpenFolder(FX_LPCSTR path) 317 void* FX_OpenFolder(FX_LPCSTR path)
318 { 318 {
319 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ 319 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
320 #ifndef _WIN32_WCE 320 #ifndef _WIN32_WCE
321 CFindFileDataA* pData = FX_NEW CFindFileDataA; 321 CFindFileDataA* pData = new CFindFileDataA;
322 if (!pData) {
323 return NULL;
324 }
325 #ifdef _FX_WINAPI_PARTITION_DESKTOP_ 322 #ifdef _FX_WINAPI_PARTITION_DESKTOP_
326 pData->m_Handle = FindFirstFileA(CFX_ByteString(path) + "/*.*", &pData->m_Fi ndData); 323 pData->m_Handle = FindFirstFileA(CFX_ByteString(path) + "/*.*", &pData->m_Fi ndData);
327 #else 324 #else
328 pData->m_Handle = FindFirstFileExA(CFX_ByteString(path) + "/*.*", FindExInfo Standard, &pData->m_FindData, FindExSearchNameMatch, NULL, 0); 325 pData->m_Handle = FindFirstFileExA(CFX_ByteString(path) + "/*.*", FindExInfo Standard, &pData->m_FindData, FindExSearchNameMatch, NULL, 0);
329 #endif 326 #endif
330 #else 327 #else
331 CFindFileDataW* pData = FX_NEW CFindFileDataW; 328 CFindFileDataW* pData = new CFindFileDataW;
332 if (!pData) {
333 return NULL;
334 }
335 pData->m_Handle = FindFirstFileW(CFX_WideString::FromLocal(path) + L"/*.*", &pData->m_FindData); 329 pData->m_Handle = FindFirstFileW(CFX_WideString::FromLocal(path) + L"/*.*", &pData->m_FindData);
336 #endif 330 #endif
337 if (pData->m_Handle == INVALID_HANDLE_VALUE) { 331 if (pData->m_Handle == INVALID_HANDLE_VALUE) {
338 delete pData; 332 delete pData;
339 return NULL; 333 return NULL;
340 } 334 }
341 pData->m_bEnd = FALSE; 335 pData->m_bEnd = FALSE;
342 return pData; 336 return pData;
343 #else 337 #else
344 DIR* dir = opendir(path); 338 DIR* dir = opendir(path);
345 return dir; 339 return dir;
346 #endif 340 #endif
347 } 341 }
348 void* FX_OpenFolder(FX_LPCWSTR path) 342 void* FX_OpenFolder(FX_LPCWSTR path)
349 { 343 {
350 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ 344 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
351 CFindFileDataW* pData = FX_NEW CFindFileDataW; 345 CFindFileDataW* pData = new CFindFileDataW;
352 if (!pData) {
353 return NULL;
354 }
355 #ifdef _FX_WINAPI_PARTITION_DESKTOP_ 346 #ifdef _FX_WINAPI_PARTITION_DESKTOP_
356 pData->m_Handle = FindFirstFileW(CFX_WideString(path) + L"/*.*", &pData->m_F indData); 347 pData->m_Handle = FindFirstFileW(CFX_WideString(path) + L"/*.*", &pData->m_F indData);
357 #else 348 #else
358 pData->m_Handle = FindFirstFileExW(CFX_WideString(path) + L"/*.*", FindExInf oStandard, &pData->m_FindData, FindExSearchNameMatch, NULL, 0); 349 pData->m_Handle = FindFirstFileExW(CFX_WideString(path) + L"/*.*", FindExInf oStandard, &pData->m_FindData, FindExSearchNameMatch, NULL, 0);
359 #endif 350 #endif
360 if (pData->m_Handle == INVALID_HANDLE_VALUE) { 351 if (pData->m_Handle == INVALID_HANDLE_VALUE) {
361 delete pData; 352 delete pData;
362 return NULL; 353 return NULL;
363 } 354 }
364 pData->m_bEnd = FALSE; 355 pData->m_bEnd = FALSE;
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 } 487 }
497 488
498 CFX_Vector_3by1 CFX_Matrix_3by3::TransformVector(const CFX_Vector_3by1 &v) 489 CFX_Vector_3by1 CFX_Matrix_3by3::TransformVector(const CFX_Vector_3by1 &v)
499 { 490 {
500 return CFX_Vector_3by1( 491 return CFX_Vector_3by1(
501 a * v.a + b * v.b + c * v.c, 492 a * v.a + b * v.b + c * v.c,
502 d * v.a + e * v.b + f * v.c, 493 d * v.a + e * v.b + f * v.c,
503 g * v.a + h * v.b + i * v.c 494 g * v.a + h * v.b + i * v.c
504 ); 495 );
505 } 496 }
OLDNEW
« no previous file with comments | « core/include/fxcrt/fx_basic.h ('k') | core/src/fxcrt/fx_xml_parser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698