Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2015 Google Inc. All rights reserved. | 2 * Copyright (C) 2015 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 63 { | 63 { |
| 64 return *getConsecutiveData(dataPosition, 1, 0); | 64 return *getConsecutiveData(dataPosition, 1, 0); |
| 65 } | 65 } |
| 66 | 66 |
| 67 size_t size() const | 67 size_t size() const |
| 68 { | 68 { |
| 69 return m_data->size(); | 69 return m_data->size(); |
| 70 } | 70 } |
| 71 | 71 |
| 72 private: | 72 private: |
| 73 void getSomeDataIntoCache(unsigned dataPosition); | |
|
Peter Kasting
2015/03/26 19:37:08
Nit: getSomeDataInternal() might be a better name,
kbalazs
2015/03/26 20:33:11
Acknowledged.
| |
| 74 | |
| 73 RefPtr<SharedBuffer> m_data; | 75 RefPtr<SharedBuffer> m_data; |
| 74 | 76 |
| 75 // Caches the last segment of |m_data| accessed, since subsequent reads are | 77 // Caches the last segment of |m_data| accessed, since subsequent reads are |
| 76 // likely to re-access it. | 78 // likely to re-access it. |
| 77 const char* m_segment; | 79 const char* m_segment; |
| 78 size_t m_segmentLength; | 80 size_t m_segmentLength; |
| 79 | 81 |
| 80 // Data position in |m_data| pointed by |m_segment|. | 82 // Data position in |m_data| pointed by |segment|. |
|
Peter Kasting
2015/03/26 19:37:08
Nit: pointed -> pointed to
kbalazs
2015/03/26 20:33:11
Ah, I didn't mean to change it. Originally it was
| |
| 81 size_t m_dataPosition; | 83 size_t m_dataPosition; |
| 82 }; | 84 }; |
| 83 | 85 |
| 84 } // namespace blink | 86 } // namespace blink |
| 85 | 87 |
| 86 #endif | 88 #endif |
| OLD | NEW |