Index: src/doc/SkDocument.cpp |
=================================================================== |
--- src/doc/SkDocument.cpp (revision 12300) |
+++ src/doc/SkDocument.cpp (working copy) |
@@ -10,7 +10,7 @@ |
SK_DEFINE_INST_COUNT(SkDocument) |
-SkDocument::SkDocument(SkWStream* stream, void (*doneProc)(SkWStream*)) { |
+SkDocument::SkDocument(SkWStream* stream, void (*doneProc)(SkWStream*, bool)) { |
fStream = stream; // we do not own this object. |
fDoneProc = doneProc; |
fState = kBetweenPages_State; |
@@ -68,7 +68,7 @@ |
bool success = this->onClose(fStream); |
if (fDoneProc) { |
- fDoneProc(fStream); |
+ fDoneProc(fStream, false); |
} |
// we don't own the stream, but we mark it NULL since we can |
// no longer write to it. |
@@ -85,5 +85,13 @@ |
} |
void SkDocument::abort() { |
+ this->onAbort(); |
+ |
fState = kClosed_State; |
+ if (fDoneProc) { |
+ fDoneProc(fStream, true); |
+ } |
+ // we don't own the stream, but we mark it NULL since we can |
+ // no longer write to it. |
+ fStream = NULL; |
} |