Chromium Code Reviews| Index: base/memory/ref_counted_memory.h |
| diff --git a/base/memory/ref_counted_memory.h b/base/memory/ref_counted_memory.h |
| index d2987c5d21bd3d1cb1c6ebd6bf3c7f827b341491..53592812501630e7067cac9ebb1684f504d1d04f 100644 |
| --- a/base/memory/ref_counted_memory.h |
| +++ b/base/memory/ref_counted_memory.h |
| @@ -11,6 +11,7 @@ |
| #include "base/base_export.h" |
| #include "base/compiler_specific.h" |
| #include "base/memory/ref_counted.h" |
| +#include "base/strings/string_piece.h" |
| namespace base { |
| @@ -20,6 +21,10 @@ namespace base { |
| class BASE_EXPORT RefCountedMemory |
| : public base::RefCountedThreadSafe<RefCountedMemory> { |
| public: |
| + // Returns a StringPiece representing this memory, or an empty StringPiece |
| + // if |memory| is NULL. |
| + static base::StringPiece AsString(const RefCountedMemory* memory); |
|
Nico
2013/11/27 01:49:49
Huh, why is this a static method on RefCountedMemo
|
| + |
| // Retrieves a pointer to the beginning of the data we point to. If the data |
| // is empty, this will return NULL. |
| virtual const unsigned char* front() const = 0; |