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

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

Issue 18562010: pdfviewer: measure mem usage, command line flags library. (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 9988)
+++ experimental/PdfViewer/pdfparser/native/SkPdfNativeTokenizer.h (working copy)
@@ -83,9 +83,11 @@
int fCurrentUsed;
SkPdfObject* allocBlock();
+ size_t fSizeInBytes;
public:
SkPdfAllocator() {
+ fSizeInBytes = sizeof(*this);
fCurrent = allocBlock();
fCurrentUsed = 0;
}
@@ -98,8 +100,13 @@
void* alloc(size_t bytes) {
void* data = malloc(bytes);
fHandles.push(data);
+ fSizeInBytes += bytes;
return data;
}
+
+ size_t bytesUsed() {
+ return fSizeInBytes;
+ }
};
class SkNativeParsedPDF;

Powered by Google App Engine
This is Rietveld 408576698