SkDocument: remove unused fDoneProc

Change-Id: I9a0739992e90a0a6d44a75b0b570097553343f1d
Reviewed-on: https://skia-review.googlesource.com/92141
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
diff --git a/bench/PDFBench.cpp b/bench/PDFBench.cpp
index 5995390..bebf2b9 100644
--- a/bench/PDFBench.cpp
+++ b/bench/PDFBench.cpp
@@ -216,7 +216,7 @@
         SkASSERT(fShader);
         while (loops-- > 0) {
             SkNullWStream nullStream;
-            SkPDFDocument doc(&nullStream, nullptr, SkDocument::PDFMetadata());
+            SkPDFDocument doc(&nullStream, SkDocument::PDFMetadata());
             sk_sp<SkPDFObject> shader = SkPDFMakeShader(&doc, fShader.get(), SkMatrix::I(),
                                                         {0, 0, 400, 400}, SK_ColorBLACK);
         }
diff --git a/include/core/SkDocument.h b/include/core/SkDocument.h
index 82b8a4f..7f293f1 100644
--- a/include/core/SkDocument.h
+++ b/include/core/SkDocument.h
@@ -184,7 +184,7 @@
     void abort();
 
 protected:
-    SkDocument(SkWStream*, void (*)(SkWStream*, bool aborted));
+    SkDocument(SkWStream*);
 
     // note: subclasses must call close() in their destructor, as the base class
     // cannot do this for them.
@@ -207,7 +207,6 @@
 
 private:
     SkWStream* fStream;
-    void       (*fDoneProc)(SkWStream*, bool aborted);
     State      fState;
 
     typedef SkRefCnt INHERITED;
diff --git a/src/core/SkDocument.cpp b/src/core/SkDocument.cpp
index b7e242a..cd5aa5a 100644
--- a/src/core/SkDocument.cpp
+++ b/src/core/SkDocument.cpp
@@ -9,10 +9,7 @@
 #include "SkDocument.h"
 #include "SkStream.h"
 
-SkDocument::SkDocument(SkWStream* stream, void (*doneProc)(SkWStream*, bool))
-        : fStream(stream)  // we do not own this object.
-        , fDoneProc(doneProc)
-        , fState(kBetweenPages_State) {}
+SkDocument::SkDocument(SkWStream* stream) : fStream(stream), fState(kBetweenPages_State) {}
 
 SkDocument::~SkDocument() {
     this->close();
@@ -57,10 +54,6 @@
             case kBetweenPages_State: {
                 fState = kClosed_State;
                 this->onClose(fStream);
-
-                if (fDoneProc) {
-                    fDoneProc(fStream, false);
-                }
                 // we don't own the stream, but we mark it nullptr since we can
                 // no longer write to it.
                 fStream = nullptr;
@@ -79,9 +72,6 @@
     this->onAbort();
 
     fState = kClosed_State;
-    if (fDoneProc) {
-        fDoneProc(fStream, true);
-    }
     // we don't own the stream, but we mark it nullptr since we can
     // no longer write to it.
     fStream = nullptr;
diff --git a/src/pdf/SkPDFDocument.cpp b/src/pdf/SkPDFDocument.cpp
index 939e9ed..da7170f 100644
--- a/src/pdf/SkPDFDocument.cpp
+++ b/src/pdf/SkPDFDocument.cpp
@@ -172,9 +172,8 @@
 ////////////////////////////////////////////////////////////////////////////////
 
 SkPDFDocument::SkPDFDocument(SkWStream* stream,
-                             void (*doneProc)(SkWStream*, bool),
                              const SkDocument::PDFMetadata& metadata)
-    : SkDocument(stream, doneProc)
+    : SkDocument(stream)
     , fMetadata(metadata) {
 }
 
@@ -425,7 +424,6 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 sk_sp<SkDocument> SkPDFMakeDocument(SkWStream* stream,
-                                    void (*proc)(SkWStream*, bool),
                                     const SkDocument::PDFMetadata& metadata) {
     SkDocument::PDFMetadata meta = metadata;
     if (meta.fRasterDPI <= 0) {
@@ -434,14 +432,14 @@
     if (meta.fEncodingQuality < 0) {
         meta.fEncodingQuality = 0;
     }
-    return stream ? sk_make_sp<SkPDFDocument>(stream, proc, meta) : nullptr;
+    return stream ? sk_make_sp<SkPDFDocument>(stream, meta) : nullptr;
 }
 
 sk_sp<SkDocument> SkDocument::MakePDF(SkWStream* stream, const PDFMetadata& metadata) {
-    return SkPDFMakeDocument(stream, nullptr, metadata);
+    return SkPDFMakeDocument(stream, metadata);
 }
 
 sk_sp<SkDocument> SkDocument::MakePDF(SkWStream* stream) {
-    return SkPDFMakeDocument(stream, nullptr, PDFMetadata());
+    return SkPDFMakeDocument(stream, PDFMetadata());
 }
 
diff --git a/src/pdf/SkPDFDocument.h b/src/pdf/SkPDFDocument.h
index a13670a..ed92554 100644
--- a/src/pdf/SkPDFDocument.h
+++ b/src/pdf/SkPDFDocument.h
@@ -25,7 +25,6 @@
  *         SK_ScalarDefaultRasterDPI(72.0f).
  */
 sk_sp<SkDocument> SkPDFMakeDocument(SkWStream* stream,
-                                    void (*doneProc)(SkWStream*, bool),
                                     const SkDocument::PDFMetadata&);
 
 // Logically part of SkPDFDocument (like SkPDFCanon), but separate to
@@ -52,7 +51,6 @@
 class SkPDFDocument : public SkDocument {
 public:
     SkPDFDocument(SkWStream*,
-                  void (*)(SkWStream*, bool),
                   const SkDocument::PDFMetadata&);
     ~SkPDFDocument() override;
     SkCanvas* onBeginPage(SkScalar, SkScalar) override;
diff --git a/src/utils/SkMultiPictureDocument.cpp b/src/utils/SkMultiPictureDocument.cpp
index b3e84dc..b09db06 100644
--- a/src/utils/SkMultiPictureDocument.cpp
+++ b/src/utils/SkMultiPictureDocument.cpp
@@ -51,8 +51,8 @@
     SkSize fCurrentPageSize;
     SkTArray<sk_sp<SkPicture>> fPages;
     SkTArray<SkSize> fSizes;
-    MultiPictureDocument(SkWStream* s, void (*d)(SkWStream*, bool), const SkSerialProcs* procs)
-        : SkDocument(s, d)
+    MultiPictureDocument(SkWStream* s, const SkSerialProcs* procs)
+        : SkDocument(s)
         , fProcs(procs ? *procs : SkSerialProcs())
     {}
     ~MultiPictureDocument() override { this->close(); }
@@ -94,7 +94,7 @@
 }
 
 sk_sp<SkDocument> SkMakeMultiPictureDocument(SkWStream* wStream, const SkSerialProcs* procs) {
-    return sk_make_sp<MultiPictureDocument>(wStream, nullptr, procs);
+    return sk_make_sp<MultiPictureDocument>(wStream, procs);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
diff --git a/src/xps/SkXPSDocument.cpp b/src/xps/SkXPSDocument.cpp
index ac62c62..05bb280 100644
--- a/src/xps/SkXPSDocument.cpp
+++ b/src/xps/SkXPSDocument.cpp
@@ -16,7 +16,7 @@
 SkXPSDocument::SkXPSDocument(SkWStream* stream,
                    SkScalar dpi,
                    SkTScopedComPtr<IXpsOMObjectFactory> xpsFactory)
-        : SkDocument(stream, nullptr)
+        : SkDocument(stream)
         , fXpsFactory(std::move(xpsFactory))
         , fDevice(SkISize{10000, 10000})
 {