diff options
author | scottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-30 20:30:18 +0000 |
---|---|---|
committer | scottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-30 20:30:18 +0000 |
commit | 6a497d7a743cd99e675d3f40606690d961df145a (patch) | |
tree | 5407b203c1c15eb2de79fc635a55eb0592e312b5 /base/memory/ref_counted_memory.cc | |
parent | 48a9ad9dc7be28316b777cb9f8525d6b664cfe3b (diff) | |
download | chromium_src-6a497d7a743cd99e675d3f40606690d961df145a.zip chromium_src-6a497d7a743cd99e675d3f40606690d961df145a.tar.gz chromium_src-6a497d7a743cd99e675d3f40606690d961df145a.tar.bz2 |
Add pointer+size ctor to RefCountedBytes
Split out from https://codereview.chromium.org/255543006/ .
R=brettw@chromium.org
BUG=170859
Review URL: https://codereview.chromium.org/264563009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@267321 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/memory/ref_counted_memory.cc')
-rw-r--r-- | base/memory/ref_counted_memory.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/base/memory/ref_counted_memory.cc b/base/memory/ref_counted_memory.cc index b1deee1..477c941 100644 --- a/base/memory/ref_counted_memory.cc +++ b/base/memory/ref_counted_memory.cc @@ -37,6 +37,9 @@ RefCountedBytes::RefCountedBytes(const std::vector<unsigned char>& initializer) : data_(initializer) { } +RefCountedBytes::RefCountedBytes(const unsigned char* p, size_t size) + : data_(p, p + size) {} + RefCountedBytes* RefCountedBytes::TakeVector( std::vector<unsigned char>* to_destroy) { RefCountedBytes* bytes = new RefCountedBytes; |