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

Unified Diff: src/pdf/SkPDFStream.cpp

Issue 360473005: Add lock to SkPDFDict (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
Index: src/pdf/SkPDFStream.cpp
diff --git a/src/pdf/SkPDFStream.cpp b/src/pdf/SkPDFStream.cpp
index e570976403382cac79dfcb327030391fa9a08253..44f839fdb16debc0878bc19ebc867869e4123cbc 100644
--- a/src/pdf/SkPDFStream.cpp
+++ b/src/pdf/SkPDFStream.cpp
@@ -36,15 +36,9 @@ SkPDFStream::SkPDFStream(const SkPDFStream& pdfStream)
fState = kCompressed_State;
removeLength = false;
}
- SkPDFDict::Iter dict(pdfStream);
- SkPDFName* key;
- SkPDFObject* value;
- SkPDFName lengthName("Length");
- for (key = dict.next(&value); key != NULL; key = dict.next(&value)) {
- if (removeLength && *key == lengthName) {
- continue;
- }
- this->insert(key, value);
+ this->insertDict(pdfStream);
mtklein 2014/06/27 15:26:51 Can either of these become private methods of SkPD
hal.canary 2014/06/27 16:03:27 I don't see how. At least this is an improvement
+ if (removeLength) {
+ this->remove("Length");
}
}
« no previous file with comments | « src/pdf/SkPDFStream.h ('k') | src/pdf/SkPDFTypes.h » ('j') | src/pdf/SkPDFTypes.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698