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

Unified Diff: src/pdf/SkPDFStream.h

Issue 340783013: Switch SkPDFStream's internal storage from SkStream to SkData (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 6 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 | « src/pdf/SkPDFPage.cpp ('k') | src/pdf/SkPDFStream.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFStream.h
diff --git a/src/pdf/SkPDFStream.h b/src/pdf/SkPDFStream.h
index 636ea984e39efd04b8132922d02e7238fa14be6d..3a84068e3d4aaaa3f60a68441fea70739b13a8e9 100644
--- a/src/pdf/SkPDFStream.h
+++ b/src/pdf/SkPDFStream.h
@@ -38,7 +38,8 @@ public:
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);
@@ -69,22 +70,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;
}
@@ -92,8 +93,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;
« no previous file with comments | « src/pdf/SkPDFPage.cpp ('k') | src/pdf/SkPDFStream.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698