Chromium Code Reviews| Index: base/values.h |
| diff --git a/base/values.h b/base/values.h |
| index f9a459e762cab6a5e9e27baf79530f699082f7bc..361a1389b398053fa742a4731a255aa3257817d4 100644 |
| --- a/base/values.h |
| +++ b/base/values.h |
| @@ -30,6 +30,7 @@ |
| #include "base/basictypes.h" |
| #include "base/compiler_specific.h" |
| #include "base/string16.h" |
| +#include "base/string_piece.h" |
|
brettw
2012/07/13 16:46:46
I don't actually know the answer but I wonder if w
Jeffrey Yasskin
2012/07/15 04:07:24
I tend to think that StringPiece should be used ev
|
| // This file declares "using base::Value", etc. at the bottom, so that |
| // current code can use these classes without the base namespace. In |
| @@ -188,6 +189,9 @@ class BASE_EXPORT BinaryValue: public Value { |
| // buffer that's passed in. |
| // Returns NULL if buffer is NULL. |
| static BinaryValue* CreateWithCopiedBuffer(const char* buffer, size_t size); |
| + static BinaryValue* CreateWithCopiedBuffer(StringPiece buffer) { |
| + return CreateWithCopiedBuffer(buffer.data(), buffer.size()); |
| + } |
| size_t GetSize() const { return size_; } |
| char* GetBuffer() { return buffer_; } |