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

Unified Diff: experimental/PdfViewer/pdfparser/native/SkPdfNativeTokenizer.h

Issue 19793011: (upload draf code for backup) pdfviewer: improve memory, son't allocate extra buffers, and put the … (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 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
Index: experimental/PdfViewer/pdfparser/native/SkPdfNativeTokenizer.h
===================================================================
--- experimental/PdfViewer/pdfparser/native/SkPdfNativeTokenizer.h (revision 10235)
+++ experimental/PdfViewer/pdfparser/native/SkPdfNativeTokenizer.h (working copy)
@@ -62,9 +62,9 @@
#define isPdfDigit(ch) ((ch)>='0'&&(ch)<='9')
#define isPdfNumeric(ch) (isPdfDigit(ch)||(ch)=='+'||(ch)=='-')
-unsigned char* skipPdfWhiteSpaces(unsigned char* buffer, size_t len);
-unsigned char* endOfPdfToken(unsigned char* start, size_t len);
-unsigned char* skipPdfComment(unsigned char* start, size_t len);
+const unsigned char* skipPdfWhiteSpaces(int level, const unsigned char* buffer, size_t len);
+const unsigned char* endOfPdfToken(int level, const unsigned char* start, size_t len);
+const unsigned char* skipPdfComment(int level, const unsigned char* start, size_t len);
// TODO(edisonn): typedef read and integer tyepes? make less readable...
//typedef double SkPdfReal;
@@ -111,7 +111,7 @@
};
class SkNativeParsedPDF;
-unsigned char* nextObject(unsigned char* start, unsigned char* end, SkPdfObject* token, SkPdfAllocator* allocator, SkNativeParsedPDF* doc);
+const unsigned char* nextObject(int level, const unsigned char* start, const unsigned char* end, SkPdfObject* token, SkPdfAllocator* allocator, SkNativeParsedPDF* doc);
enum SkPdfTokenType {
kKeyword_TokenType,
@@ -130,7 +130,7 @@
class SkPdfNativeTokenizer {
public:
SkPdfNativeTokenizer(SkPdfObject* objWithStream, const SkPdfMapper* mapper, SkPdfAllocator* allocator, SkNativeParsedPDF* doc);
- SkPdfNativeTokenizer(unsigned char* buffer, int len, const SkPdfMapper* mapper, SkPdfAllocator* allocator, SkNativeParsedPDF* doc);
+ SkPdfNativeTokenizer(const unsigned char* buffer, int len, const SkPdfMapper* mapper, SkPdfAllocator* allocator, SkNativeParsedPDF* doc);
virtual ~SkPdfNativeTokenizer();
@@ -144,9 +144,9 @@
const SkPdfMapper* fMapper;
SkPdfAllocator* fAllocator;
- unsigned char* fUncompressedStreamStart;
- unsigned char* fUncompressedStream;
- unsigned char* fUncompressedStreamEnd;
+ const unsigned char* fUncompressedStreamStart;
+ const unsigned char* fUncompressedStream;
+ const unsigned char* fUncompressedStreamEnd;
bool fEmpty;
bool fHasPutBack;

Powered by Google App Engine
This is Rietveld 408576698