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

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

Issue 1309363006: Mark FastSharedBufferReader's methods const (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@noConsolidateBMP
Patch Set: Created 5 years, 3 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 | « no previous file | Source/platform/image-decoders/FastSharedBufferReader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/image-decoders/FastSharedBufferReader.h
diff --git a/Source/platform/image-decoders/FastSharedBufferReader.h b/Source/platform/image-decoders/FastSharedBufferReader.h
index 3e2099a58303df7b06b909ad9543aecc43ae94cc..5d0d11b3ca2422d759a337e9146df52071492c10 100644
--- a/Source/platform/image-decoders/FastSharedBufferReader.h
+++ b/Source/platform/image-decoders/FastSharedBufferReader.h
@@ -54,14 +54,14 @@ public:
// |m_data| if such a consecutive buffer can be found.
// Otherwise copies into |buffer| and returns it.
// Caller must ensure there are enough bytes in |m_data| and |buffer|.
- const char* getConsecutiveData(size_t dataPosition, size_t length, char* buffer);
+ const char* getConsecutiveData(size_t dataPosition, size_t length, char* buffer) const;
// Wraps SharedBuffer::getSomeData().
- size_t getSomeData(const char*& someData, size_t dataPosition);
+ size_t getSomeData(const char*& someData, size_t dataPosition) const;
// Returns a byte at |dataPosition|.
// Caller must ensure there are enough bytes in |m_data|.
- inline char getOneByte(size_t dataPosition)
+ inline char getOneByte(size_t dataPosition) const
{
return *getConsecutiveData(dataPosition, 1, 0);
}
@@ -72,17 +72,17 @@ public:
}
private:
- void getSomeDataInternal(unsigned dataPosition);
+ void getSomeDataInternal(unsigned dataPosition) const;
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;
+ mutable const char* m_segment;
+ mutable size_t m_segmentLength;
// Data position in |m_data| pointed to by |m_segment|.
- size_t m_dataPosition;
+ mutable size_t m_dataPosition;
};
} // namespace blink
« no previous file with comments | « no previous file | Source/platform/image-decoders/FastSharedBufferReader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698