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

Unified Diff: src/pdf/SkPDFStream.cpp

Issue 360473005: Add lock to SkPDFDict (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: response to sunshine comments 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/SkPDFStream.h ('k') | src/pdf/SkPDFTypes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFStream.cpp
diff --git a/src/pdf/SkPDFStream.cpp b/src/pdf/SkPDFStream.cpp
index e570976403382cac79dfcb327030391fa9a08253..815ef481ee2135abab110171975687f6d8a6d28a 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->mergeFrom(pdfStream);
+ if (removeLength) {
+ this->remove("Length");
}
}
« no previous file with comments | « src/pdf/SkPDFStream.h ('k') | src/pdf/SkPDFTypes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698