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

Side by Side Diff: mojo/public/cpp/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, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « mojo/public/cpp/bindings/lib/fixed_buffer.h ('k') | mojo/public/cpp/bindings/lib/interface.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "mojo/public/bindings/lib/fixed_buffer.h" 5 #include "mojo/public/cpp/bindings/lib/fixed_buffer.h"
6 6
7 #include <assert.h> 7 #include <assert.h>
8 #include <stdlib.h> 8 #include <stdlib.h>
9 #include <string.h> 9 #include <string.h>
10 10
11 #include <algorithm> 11 #include <algorithm>
12 12
13 #include "mojo/public/bindings/lib/bindings_serialization.h" 13 #include "mojo/public/cpp/bindings/lib/bindings_serialization.h"
14 14
15 namespace mojo { 15 namespace mojo {
16 namespace internal { 16 namespace internal {
17 17
18 FixedBuffer::FixedBuffer(size_t size) 18 FixedBuffer::FixedBuffer(size_t size)
19 : ptr_(NULL), 19 : ptr_(NULL),
20 cursor_(0), 20 cursor_(0),
21 size_(internal::Align(size)) { 21 size_(internal::Align(size)) {
22 ptr_ = static_cast<char*>(calloc(size_, 1)); 22 ptr_ = static_cast<char*>(calloc(size_, 1));
23 } 23 }
(...skipping 21 matching lines...) Expand all
45 void* FixedBuffer::Leak() { 45 void* FixedBuffer::Leak() {
46 char* ptr = ptr_; 46 char* ptr = ptr_;
47 ptr_ = NULL; 47 ptr_ = NULL;
48 cursor_ = 0; 48 cursor_ = 0;
49 size_ = 0; 49 size_ = 0;
50 return ptr; 50 return ptr;
51 } 51 }
52 52
53 } // namespace internal 53 } // namespace internal
54 } // namespace mojo 54 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/lib/fixed_buffer.h ('k') | mojo/public/cpp/bindings/lib/interface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698