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

Unified Diff: src/doc/SkDocument.cpp

Issue 26744002: SkDocument api changes (abort, close return success, ...) modified: include/core/SkDocument.h m… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: consitent names Created 7 years, 2 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
« no previous file with comments | « include/core/SkDocument.h ('k') | src/doc/SkDocument_PDF.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
+}
« no previous file with comments | « include/core/SkDocument.h ('k') | src/doc/SkDocument_PDF.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698