Index: base/memory/ref_counted_memory.cc |
diff --git a/base/memory/ref_counted_memory.cc b/base/memory/ref_counted_memory.cc |
index b1deee1120167d8517e41b782b7e8690d4e11b80..c19f17f885e3fa87930e75aefe039f654d01174b 100644 |
--- a/base/memory/ref_counted_memory.cc |
+++ b/base/memory/ref_counted_memory.cc |
@@ -21,6 +21,15 @@ RefCountedMemory::RefCountedMemory() {} |
RefCountedMemory::~RefCountedMemory() {} |
+base::StringPiece RefCountedMemory::AsString(const RefCountedMemory* memory) { |
+ if (memory) { |
+ return base::StringPiece(reinterpret_cast<const char*>(memory->front()), |
+ memory->size()); |
+ } else { |
+ return base::StringPiece(); |
+ } |
+} |
+ |
const unsigned char* RefCountedStaticMemory::front() const { |
return data_; |
} |