Index: src/doc/SkDocument.cpp |
diff --git a/src/doc/SkDocument.cpp b/src/doc/SkDocument.cpp |
index 055c749792bb29c4de263c8e55f96d80b4ee08ab..cefe34ee859eeb519763caacb48c7fc91596e606 100644 |
--- a/src/doc/SkDocument.cpp |
+++ b/src/doc/SkDocument.cpp |
@@ -60,12 +60,12 @@ void SkDocument::endPage() { |
} |
} |
-void SkDocument::close() { |
+bool SkDocument::close() { |
for (;;) { |
switch (fState) { |
- case kBetweenPages_State: |
+ case kBetweenPages_State: { |
fState = kClosed_State; |
- this->onClose(fStream); |
+ bool success = this->onClose(fStream); |
if (fDoneProc) { |
fDoneProc(fStream); |
@@ -73,12 +73,17 @@ void SkDocument::close() { |
// we don't own the stream, but we mark it NULL since we can |
// no longer write to it. |
fStream = NULL; |
- return; |
+ return success; |
+ } |
case kInPage_State: |
this->endPage(); |
break; |
case kClosed_State: |
- return; |
+ return false; |
} |
} |
} |
+ |
+void SkDocument::abort() { |
+ fState = kClosed_State; |
+} |