Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #ifndef _FX_BASIC_H_ | 7 #ifndef _FX_BASIC_H_ |
| 8 #define _FX_BASIC_H_ | 8 #define _FX_BASIC_H_ |
| 9 #ifndef _FX_SYSTEM_H_ | 9 #ifndef _FX_SYSTEM_H_ |
| 10 #include "fx_system.h" | 10 #include "fx_system.h" |
| (...skipping 1396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1407 virtual void v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_Bi naryBuf& dest_buf) = 0; | 1407 virtual void v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_Bi naryBuf& dest_buf) = 0; |
| 1408 virtual void v_FilterFinish(CFX_BinaryBuf& dest_buf) = 0; | 1408 virtual void v_FilterFinish(CFX_BinaryBuf& dest_buf) = 0; |
| 1409 void ReportEOF(FX_DWORD left_input); | 1409 void ReportEOF(FX_DWORD left_input); |
| 1410 | 1410 |
| 1411 FX_BOOL m_bEOF; | 1411 FX_BOOL m_bEOF; |
| 1412 | 1412 |
| 1413 FX_DWORD m_SrcPos; | 1413 FX_DWORD m_SrcPos; |
| 1414 | 1414 |
| 1415 CFX_DataFilter* m_pDestFilter; | 1415 CFX_DataFilter* m_pDestFilter; |
| 1416 }; | 1416 }; |
| 1417 | |
| 1418 template<typename T> | |
| 1419 class CFX_AutoRestorer { | |
| 1420 public: | |
| 1421 CFX_AutoRestorer(T* location) { | |
|
Lei Zhang
2015/01/27 00:43:32
nit: explicit
Tom Sepez
2015/01/27 00:50:45
Done.
| |
| 1422 m_Location = location; | |
| 1423 m_OldValue = *location; | |
| 1424 } | |
| 1425 ~CFX_AutoRestorer() { *m_Location = m_OldValue; } | |
| 1426 | |
| 1427 private: | |
| 1428 T* m_Location; | |
| 1429 T m_OldValue; | |
| 1430 }; | |
| 1431 | |
| 1417 template <class T> | 1432 template <class T> |
| 1418 class CFX_SmartPointer | 1433 class CFX_SmartPointer |
| 1419 { | 1434 { |
| 1420 public: | 1435 public: |
| 1421 CFX_SmartPointer(T *pObj) : m_pObj(pObj) {} | 1436 CFX_SmartPointer(T *pObj) : m_pObj(pObj) {} |
| 1422 ~CFX_SmartPointer() | 1437 ~CFX_SmartPointer() |
| 1423 { | 1438 { |
| 1424 m_pObj->Release(); | 1439 m_pObj->Release(); |
| 1425 } | 1440 } |
| 1426 operator T*(void) | 1441 operator T*(void) |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1634 FX_FLOAT c; | 1649 FX_FLOAT c; |
| 1635 FX_FLOAT d; | 1650 FX_FLOAT d; |
| 1636 FX_FLOAT e; | 1651 FX_FLOAT e; |
| 1637 FX_FLOAT f; | 1652 FX_FLOAT f; |
| 1638 FX_FLOAT g; | 1653 FX_FLOAT g; |
| 1639 FX_FLOAT h; | 1654 FX_FLOAT h; |
| 1640 FX_FLOAT i; | 1655 FX_FLOAT i; |
| 1641 }; | 1656 }; |
| 1642 | 1657 |
| 1643 #endif | 1658 #endif |
| OLD | NEW |