Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Unified Diff: core/cross/buffer.cc

Issue 149300: These files were meant to be checked in with ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/o3d/
Patch Set: Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/cross/buffer.h ('k') | core/cross/object_base_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/cross/buffer.cc
===================================================================
--- core/cross/buffer.cc (revision 20010)
+++ core/cross/buffer.cc (working copy)
@@ -491,7 +491,7 @@
SourceBuffer::SourceBuffer(ServiceLocator* service_locator)
: VertexBufferBase(service_locator),
- buffer_(NULL) {
+ buffer_() {
}
SourceBuffer::~SourceBuffer() {
@@ -499,31 +499,28 @@
}
void SourceBuffer::ConcreteFree() {
- if (buffer_) {
- delete [] buffer_;
- buffer_ = NULL;
- }
+ buffer_.reset();
}
bool SourceBuffer::ConcreteAllocate(size_t size_in_bytes) {
ConcreteFree();
- buffer_ = new char[size_in_bytes];
+ buffer_.reset(new char[size_in_bytes]);
return true;
}
bool SourceBuffer::ConcreteLock(AccessMode access_mode, void **buffer_data) {
- if (!buffer_) {
+ if (!buffer_.get()) {
return false;
}
- *buffer_data = reinterpret_cast<void*>(buffer_);
+ *buffer_data = reinterpret_cast<void*>(buffer_.get());
return true;
}
bool SourceBuffer::ConcreteUnlock() {
- return buffer_ != NULL;
+ return buffer_.get() != NULL;
}
ObjectBase::Ref SourceBuffer::Create(ServiceLocator* service_locator) {
« no previous file with comments | « core/cross/buffer.h ('k') | core/cross/object_base_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698