Index: src/pdf/SkPDFStream.h |
diff --git a/src/pdf/SkPDFStream.h b/src/pdf/SkPDFStream.h |
index 6371bc187d14d9c90ed463d7734cfa67776f4d2e..f847a2952bace940929d2b10d68f143b6f369ba3 100644 |
--- a/src/pdf/SkPDFStream.h |
+++ b/src/pdf/SkPDFStream.h |
@@ -41,7 +41,8 @@ public: |
explicit SkPDFStream(const SkPDFStream& pdfStream); |
virtual ~SkPDFStream(); |
- // The SkPDFObject interface. |
+ // The SkPDFObject interface. These two methods use a mutex to |
+ // allow multiple threads to call at the same time. |
virtual void emitObject(SkWStream* stream, SkPDFCatalog* catalog, |
bool indirect); |
virtual size_t getOutputSize(SkPDFCatalog* catalog, bool indirect); |
@@ -67,22 +68,22 @@ protected: |
fSubstitute.reset(stream); |
} |
- SkPDFStream* getSubstitute() { |
+ SkPDFStream* getSubstitute() const { |
return fSubstitute.get(); |
} |
void setData(SkData* data); |
void setData(SkStream* stream); |
- SkStream* getData() { |
- return fData.get(); |
- } |
+ size_t dataSize() const; |
+ |
+ SkData* getData() const { return fData.get(); } |
void setState(State state) { |
fState = state; |
} |
- State getState() { |
+ State getState() const { |
return fState; |
} |
@@ -90,8 +91,10 @@ private: |
// Indicates what form (or if) the stream has been requested. |
State fState; |
- // TODO(vandebo): Use SkData (after removing deprecated constructor). |
- SkAutoTUnref<SkStream> fData; |
+ // Mutex guards fState, fData, and fSubstitute in public interface. |
+ SkMutex fMutex; |
+ |
+ SkAutoTUnref<SkData> fData; |
SkAutoTUnref<SkPDFStream> fSubstitute; |
typedef SkPDFDict INHERITED; |