diff options
author | gman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-27 06:20:40 +0000 |
---|---|---|
committer | gman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-27 06:20:40 +0000 |
commit | 51330b3a08d845da9815b843e020833e62577828 (patch) | |
tree | abb2d82043ba58e23700b923b0ed44a7df61e84b /gpu/command_buffer/service/common_decoder.cc | |
parent | c99b9d56b7c89e661df77557da07d86c09f7b369 (diff) | |
download | chromium_src-51330b3a08d845da9815b843e020833e62577828.zip chromium_src-51330b3a08d845da9815b843e020833e62577828.tar.gz chromium_src-51330b3a08d845da9815b843e020833e62577828.tar.bz2 |
Resumitting reverted CL
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/660238
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40212 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer/service/common_decoder.cc')
-rw-r--r-- | gpu/command_buffer/service/common_decoder.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gpu/command_buffer/service/common_decoder.cc b/gpu/command_buffer/service/common_decoder.cc index 4452e39..06d368d 100644 --- a/gpu/command_buffer/service/common_decoder.cc +++ b/gpu/command_buffer/service/common_decoder.cc @@ -8,7 +8,7 @@ namespace gpu { -const void* CommonDecoder::Bucket::GetData(size_t offset, size_t size) const { +void* CommonDecoder::Bucket::GetData(size_t offset, size_t size) const { if (OffsetSizeValid(offset, size)) { return data_.get() + offset; } @@ -33,8 +33,10 @@ bool CommonDecoder::Bucket::SetData( } void CommonDecoder::Bucket::SetFromString(const std::string& str) { - SetSize(str.size()); - SetData(str.c_str(), 0, str.size()); + // Strings are passed NULL terminated to distinguish between empty string + // and no string. + SetSize(str.size() + 1); + SetData(str.c_str(), 0, str.size() + 1); } void* CommonDecoder::GetAddressAndCheckSize(unsigned int shm_id, |