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

Side by Side Diff: mojo/public/cpp/bindings/lib/scratch_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
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/scratch_buffer.h" 5 #include "mojo/public/cpp/bindings/lib/scratch_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 // Scrub memory in debug builds to help catch use-after-free bugs. 15 // Scrub memory in debug builds to help catch use-after-free bugs.
16 #ifdef NDEBUG 16 #ifdef NDEBUG
17 #define DEBUG_SCRUB(address, size) (void) (address), (void) (size) 17 #define DEBUG_SCRUB(address, size) (void) (address), (void) (size)
18 #else 18 #else
19 #define DEBUG_SCRUB(address, size) memset(address, 0xCD, size) 19 #define DEBUG_SCRUB(address, size) memset(address, 0xCD, size)
20 #endif 20 #endif
21 21
22 namespace mojo { 22 namespace mojo {
23 namespace internal { 23 namespace internal {
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 Segment* segment = static_cast<Segment*>(malloc(segment_size)); 89 Segment* segment = static_cast<Segment*>(malloc(segment_size));
90 segment->next = overflow_; 90 segment->next = overflow_;
91 segment->cursor = reinterpret_cast<char*>(segment + 1); 91 segment->cursor = reinterpret_cast<char*>(segment + 1);
92 segment->end = segment->cursor + delta; 92 segment->end = segment->cursor + delta;
93 93
94 overflow_ = segment; 94 overflow_ = segment;
95 } 95 }
96 96
97 } // namespace internal 97 } // namespace internal
98 } // namespace mojo 98 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/lib/scratch_buffer.h ('k') | mojo/public/cpp/bindings/lib/shared_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698