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

Unified Diff: mojo/embedder/simple_platform_shared_buffer.h

Issue 621153003: Move mojo edk into mojo/edk (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix checkdeps Created 6 years, 2 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/embedder/scoped_platform_handle.h ('k') | mojo/embedder/simple_platform_shared_buffer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/embedder/simple_platform_shared_buffer.h
diff --git a/mojo/embedder/simple_platform_shared_buffer.h b/mojo/embedder/simple_platform_shared_buffer.h
deleted file mode 100644
index abe1ace13bf8ab46f45359b094f13926dbdd2ad4..0000000000000000000000000000000000000000
--- a/mojo/embedder/simple_platform_shared_buffer.h
+++ /dev/null
@@ -1,102 +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_SYSTEM_SIMPLE_PLATFORM_SHARED_BUFFER_H_
-#define MOJO_SYSTEM_SIMPLE_PLATFORM_SHARED_BUFFER_H_
-
-#include <stddef.h>
-
-#include "base/macros.h"
-#include "mojo/embedder/platform_shared_buffer.h"
-#include "mojo/system/system_impl_export.h"
-
-namespace mojo {
-namespace embedder {
-
-// A simple implementation of |PlatformSharedBuffer|.
-class MOJO_SYSTEM_IMPL_EXPORT SimplePlatformSharedBuffer
- : public PlatformSharedBuffer {
- public:
- // Creates a shared buffer of size |num_bytes| bytes (initially zero-filled).
- // |num_bytes| must be nonzero. Returns null on failure.
- static SimplePlatformSharedBuffer* Create(size_t num_bytes);
-
- static SimplePlatformSharedBuffer* CreateFromPlatformHandle(
- size_t num_bytes,
- ScopedPlatformHandle platform_handle);
-
- // |PlatformSharedBuffer| implementation:
- virtual size_t GetNumBytes() const override;
- virtual scoped_ptr<PlatformSharedBufferMapping> Map(size_t offset,
- size_t length) override;
- virtual bool IsValidMap(size_t offset, size_t length) override;
- virtual scoped_ptr<PlatformSharedBufferMapping> MapNoCheck(
- size_t offset,
- size_t length) override;
- virtual ScopedPlatformHandle DuplicatePlatformHandle() override;
- virtual ScopedPlatformHandle PassPlatformHandle() override;
-
- private:
- explicit SimplePlatformSharedBuffer(size_t num_bytes);
- virtual ~SimplePlatformSharedBuffer();
-
- // Implemented in simple_platform_shared_buffer_{posix,win}.cc:
-
- // This is called by |Create()| before this object is given to anyone.
- bool Init();
-
- // This is like |Init()|, but for |CreateFromPlatformHandle()|. (Note: It
- // should verify that |platform_handle| is an appropriate handle for the
- // claimed |num_bytes_|.)
- bool InitFromPlatformHandle(ScopedPlatformHandle platform_handle);
-
- // The platform-dependent part of |Map()|; doesn't check arguments.
- scoped_ptr<PlatformSharedBufferMapping> MapImpl(size_t offset, size_t length);
-
- const size_t num_bytes_;
-
- // This is set in |Init()|/|InitFromPlatformHandle()| and never modified
- // (except by |PassPlatformHandle()|; see the comments above its declaration),
- // hence does not need to be protected by a lock.
- ScopedPlatformHandle handle_;
-
- DISALLOW_COPY_AND_ASSIGN(SimplePlatformSharedBuffer);
-};
-
-// An implementation of |PlatformSharedBufferMapping|, produced by
-// |SimplePlatformSharedBuffer|.
-class MOJO_SYSTEM_IMPL_EXPORT SimplePlatformSharedBufferMapping
- : public PlatformSharedBufferMapping {
- public:
- virtual ~SimplePlatformSharedBufferMapping();
-
- virtual void* GetBase() const override;
- virtual size_t GetLength() const override;
-
- private:
- friend class SimplePlatformSharedBuffer;
-
- SimplePlatformSharedBufferMapping(void* base,
- size_t length,
- void* real_base,
- size_t real_length)
- : base_(base),
- length_(length),
- real_base_(real_base),
- real_length_(real_length) {}
- void Unmap();
-
- void* const base_;
- const size_t length_;
-
- void* const real_base_;
- const size_t real_length_;
-
- DISALLOW_COPY_AND_ASSIGN(SimplePlatformSharedBufferMapping);
-};
-
-} // namespace embedder
-} // namespace mojo
-
-#endif // MOJO_SYSTEM_SIMPLE_PLATFORM_SHARED_BUFFER_H_
« no previous file with comments | « mojo/embedder/scoped_platform_handle.h ('k') | mojo/embedder/simple_platform_shared_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698