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

Unified Diff: Source/platform/image-decoders/FastSharedBufferReader.h

Issue 1011113003: Fix potential bug in FastSharedBufferReader::getConsecutiveData (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix my bug too... Created 5 years, 9 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: Source/platform/image-decoders/FastSharedBufferReader.h
diff --git a/Source/platform/image-decoders/FastSharedBufferReader.h b/Source/platform/image-decoders/FastSharedBufferReader.h
index 1add43037db0de7d83767a74ac8eb40fcea09ce9..36b84b67bc005b84a894bc421547c16d3fdb55c3 100644
--- a/Source/platform/image-decoders/FastSharedBufferReader.h
+++ b/Source/platform/image-decoders/FastSharedBufferReader.h
@@ -70,15 +70,21 @@ public:
}
private:
+ void getSomeDataIntoCache(unsigned dataPosition);
+
RefPtr<SharedBuffer> m_data;
- // Caches the last segment of |m_data| accessed, since subsequent reads are
- // likely to re-access it.
- const char* m_segment;
- size_t m_segmentLength;
+ struct Cache {
Peter Kasting 2015/03/25 19:53:11 I don't see what adding this struct buys other tha
+ Cache();
+
+ // Caches the last segment of |m_data| accessed, since subsequent reads are
+ // likely to re-access it.
+ const char* segment;
+ size_t segmentLength;
- // Data position in |m_data| pointed by |m_segment|.
- size_t m_dataPosition;
+ // Data position in |m_data| pointed by |segment|.
+ size_t dataPosition;
+ } m_cache;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698