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

Unified Diff: mojo/services/html_viewer/html_viewer_discardable_memory_shmem_allocator.h

Issue 1016493002: Add a DiscardableMemoryShmemeAllocator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
Index: mojo/services/html_viewer/html_viewer_discardable_memory_shmem_allocator.h
diff --git a/mojo/services/html_viewer/html_viewer_discardable_memory_shmem_allocator.h b/mojo/services/html_viewer/html_viewer_discardable_memory_shmem_allocator.h
new file mode 100644
index 0000000000000000000000000000000000000000..70b0b3390090d50aa988a8570f1c2f361ddaa3c8
--- /dev/null
+++ b/mojo/services/html_viewer/html_viewer_discardable_memory_shmem_allocator.h
@@ -0,0 +1,31 @@
+// Copyright 2015 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_SERVICES_HTML_VIEWER_HTML_VIEWER_DISCARDABLE_MEMORY_SHMEM_ALLOCATOR_H_
+#define MOJO_SERVICES_HTML_VIEWER_HTML_VIEWER_DISCARDABLE_MEMORY_SHMEM_ALLOCATOR_H_
+
+#include "base/memory/discardable_memory_shmem_allocator.h"
+
+namespace html_viewer {
+
+// This is a copy of the testing allocator, which doesn't actually do any
jamesr 2015/03/16 23:47:25 statements about history are not very useful in co
+// tricks with shared memory. It is the minimal interface needed to get a
+// Google search working in the html viewer.
+class HtmlViewerDiscardableMemoryShmemAllocator
jamesr 2015/03/16 23:47:25 you're in the directory html_viewer and in the nam
+ : public base::DiscardableMemoryShmemAllocator {
+ public:
+ HtmlViewerDiscardableMemoryShmemAllocator();
+ ~HtmlViewerDiscardableMemoryShmemAllocator() override;
+
+ // Overridden from DiscardableMemoryShmemAllocator:
+ scoped_ptr<base::DiscardableMemoryShmemChunk> AllocateLockedDiscardableMemory(
+ size_t size) override;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(HtmlViewerDiscardableMemoryShmemAllocator);
+};
+
+} // namespace html_viewer
+
+#endif // MOJO_SERVICES_HTML_VIEWER_HTML_VIEWER_DISCARDABLE_MEMORY_SHMEM_ALLOCATOR_H_

Powered by Google App Engine
This is Rietveld 408576698