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

Unified Diff: mojo/public/bindings/lib/scratch_buffer.h

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/router.cc ('k') | mojo/public/bindings/lib/scratch_buffer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/bindings/lib/scratch_buffer.h
diff --git a/mojo/public/bindings/lib/scratch_buffer.h b/mojo/public/bindings/lib/scratch_buffer.h
deleted file mode 100644
index 310969ba344d21c9814a5551a6613c104dc7e643..0000000000000000000000000000000000000000
--- a/mojo/public/bindings/lib/scratch_buffer.h
+++ /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.
-
-#ifndef MOJO_PUBLIC_BINDINGS_LIB_SCRATCH_BUFFER_H_
-#define MOJO_PUBLIC_BINDINGS_LIB_SCRATCH_BUFFER_H_
-
-#include <deque>
-
-#include "mojo/public/cpp/bindings/buffer.h"
-#include "mojo/public/cpp/system/macros.h"
-
-namespace mojo {
-namespace internal {
-
-// The following class is designed to be allocated on the stack. If necessary,
-// it will failover to allocating objects on the heap.
-class ScratchBuffer : public Buffer {
- public:
- ScratchBuffer();
- virtual ~ScratchBuffer();
-
- virtual void* Allocate(size_t num_bytes, Destructor func = NULL)
- MOJO_OVERRIDE;
-
- private:
- enum { kMinSegmentSize = 512 };
-
- struct Segment {
- Segment* next;
- char* cursor;
- char* end;
- };
-
- void* AllocateInSegment(Segment* segment, size_t num_bytes);
- void AddOverflowSegment(size_t delta);
-
- char fixed_data_[kMinSegmentSize];
- Segment fixed_;
- Segment* overflow_;
-
- struct PendingDestructor {
- Destructor func;
- void* address;
- };
- std::deque<PendingDestructor> pending_dtors_;
-
- MOJO_DISALLOW_COPY_AND_ASSIGN(ScratchBuffer);
-};
-
-} // namespace internal
-} // namespace mojo
-
-#endif // MOJO_PUBLIC_BINDINGS_LIB_SCRATCH_BUFFER_H_
« no previous file with comments | « mojo/public/bindings/lib/router.cc ('k') | mojo/public/bindings/lib/scratch_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698