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

Unified Diff: mojo/public/bindings/lib/fixed_buffer.cc

Issue 220243007: Mojo: Move mojo/public/bindings/lib to mojo/public/cpp/bindings/lib. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | « mojo/public/bindings/lib/fixed_buffer.h ('k') | mojo/public/bindings/lib/interface.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/bindings/lib/fixed_buffer.cc
diff --git a/mojo/public/bindings/lib/fixed_buffer.cc b/mojo/public/bindings/lib/fixed_buffer.cc
deleted file mode 100644
index 09e309434a0a0f7e05254c8a28f2e55140d72bbb..0000000000000000000000000000000000000000
--- a/mojo/public/bindings/lib/fixed_buffer.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "mojo/public/bindings/lib/fixed_buffer.h"
-
-#include <assert.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <algorithm>
-
-#include "mojo/public/bindings/lib/bindings_serialization.h"
-
-namespace mojo {
-namespace internal {
-
-FixedBuffer::FixedBuffer(size_t size)
- : ptr_(NULL),
- cursor_(0),
- size_(internal::Align(size)) {
- ptr_ = static_cast<char*>(calloc(size_, 1));
-}
-
-FixedBuffer::~FixedBuffer() {
- free(ptr_);
-}
-
-void* FixedBuffer::Allocate(size_t delta, Destructor dtor) {
- assert(!dtor);
-
- delta = internal::Align(delta);
-
- if (delta == 0 || delta > size_ - cursor_) {
- assert(false);
- return NULL;
- }
-
- char* result = ptr_ + cursor_;
- cursor_ += delta;
-
- return result;
-}
-
-void* FixedBuffer::Leak() {
- char* ptr = ptr_;
- ptr_ = NULL;
- cursor_ = 0;
- size_ = 0;
- return ptr;
-}
-
-} // namespace internal
-} // namespace mojo
« no previous file with comments | « mojo/public/bindings/lib/fixed_buffer.h ('k') | mojo/public/bindings/lib/interface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698