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

Side by Side Diff: core/src/fxcodec/jbig2/JBig2_Object.cpp

Issue 1336783002: Merge to XFA: Remove CJBig2_Object, CJBig2_Module, and friends. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
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 unified diff | Download patch
« no previous file with comments | « core/src/fxcodec/jbig2/JBig2_Object.h ('k') | core/src/fxcodec/jbig2/JBig2_Segment.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7 #include "JBig2_Object.h"
8 #include "JBig2_Module.h"
9 void* CJBig2_Object::operator new(size_t size,
10 CJBig2_Module* pModule,
11 const FX_CHAR* filename,
12 int line) {
13 CJBig2_Object* p;
14 p = (CJBig2_Object*)pModule->JBig2_Malloc((FX_DWORD)size);
15 p->m_pModule = pModule;
16 return p;
17 }
18 void CJBig2_Object::operator delete(void* p,
19 CJBig2_Module* pModule,
20 const FX_CHAR* filename,
21 int line) {
22 pModule->JBig2_Free(p);
23 }
24 void* CJBig2_Object::operator new(size_t size, CJBig2_Module* pModule) {
25 CJBig2_Object* p;
26 p = (CJBig2_Object*)pModule->JBig2_Malloc((FX_DWORD)size);
27 p->m_pModule = pModule;
28 return p;
29 }
30 void CJBig2_Object::operator delete(void* p) {
31 ((CJBig2_Object*)p)->m_pModule->JBig2_Free(p);
32 }
33 void CJBig2_Object::operator delete(void* p, CJBig2_Module* pModule) {
34 pModule->JBig2_Free(p);
35 }
36 void* CJBig2_Object::operator new[](size_t size,
37 CJBig2_Module* pModule,
38 size_t unit_size,
39 const FX_CHAR* filename,
40 int line) {
41 void* p;
42 uint8_t *pCur, *pEnd;
43 p = (uint8_t*)pModule->JBig2_Malloc((FX_DWORD)size);
44 pCur = (uint8_t*)p;
45 pEnd = pCur + size;
46 for (; pCur < pEnd; pCur += unit_size) {
47 ((CJBig2_Object*)pCur)->m_pModule = pModule;
48 }
49 return p;
50 }
51 void CJBig2_Object::operator delete[](void* p,
52 CJBig2_Module* pModule,
53 size_t unit_size,
54 const FX_CHAR* filename,
55 int line) {
56 pModule->JBig2_Free(p);
57 }
58 void* CJBig2_Object::operator new[](size_t size,
59 CJBig2_Module* pModule,
60 size_t unit_size) {
61 void* p;
62 uint8_t *pCur, *pEnd;
63 p = (uint8_t*)pModule->JBig2_Malloc((FX_DWORD)size);
64 pCur = (uint8_t*)p;
65 pEnd = pCur + size;
66 for (; pCur < pEnd; pCur += unit_size) {
67 ((CJBig2_Object*)pCur)->m_pModule = pModule;
68 }
69 return p;
70 }
71 void CJBig2_Object::operator delete[](void* p) {
72 ((CJBig2_Object*)p)->m_pModule->JBig2_Free(p);
73 }
74 void CJBig2_Object::operator delete[](void* p,
75 CJBig2_Module* pModule,
76 size_t unit_size) {
77 pModule->JBig2_Free(p);
78 }
OLDNEW
« no previous file with comments | « core/src/fxcodec/jbig2/JBig2_Object.h ('k') | core/src/fxcodec/jbig2/JBig2_Segment.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698