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

Unified Diff: content/browser/gamepad/gamepad_shared_buffer_impl.cc

Issue 2563483006: Move gamepad_service out of content/ and into device/ (Closed)
Patch Set: addressed Blundell's review comments Created 4 years 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: content/browser/gamepad/gamepad_shared_buffer_impl.cc
diff --git a/content/browser/gamepad/gamepad_shared_buffer_impl.cc b/content/browser/gamepad/gamepad_shared_buffer_impl.cc
deleted file mode 100644
index 03911cb06a1cdc47c442b54ec80b2b2d2cf43a03..0000000000000000000000000000000000000000
--- a/content/browser/gamepad/gamepad_shared_buffer_impl.cc
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright 2016 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.
-
-#include "content/browser/gamepad/gamepad_shared_buffer_impl.h"
-
-#include "content/common/gamepad_hardware_buffer.h"
-
-namespace content {
-
-GamepadSharedBufferImpl::GamepadSharedBufferImpl() {
- size_t data_size = sizeof(GamepadHardwareBuffer);
- bool res = shared_memory_.CreateAndMapAnonymous(data_size);
- CHECK(res);
-
- void* mem = shared_memory_.memory();
- DCHECK(mem);
- new (mem) GamepadHardwareBuffer();
-}
-
-GamepadSharedBufferImpl::~GamepadSharedBufferImpl() {
-}
-
-base::SharedMemory* GamepadSharedBufferImpl::shared_memory() {
- return &shared_memory_;
-}
-
-blink::WebGamepads* GamepadSharedBufferImpl::buffer() {
- return &(hardware_buffer()->buffer);
-}
-
-GamepadHardwareBuffer* GamepadSharedBufferImpl::hardware_buffer() {
- void* mem = shared_memory_.memory();
- DCHECK(mem);
- return static_cast<GamepadHardwareBuffer*>(mem);
-}
-
-void GamepadSharedBufferImpl::WriteBegin() {
- hardware_buffer()->sequence.WriteBegin();
-}
-
-void GamepadSharedBufferImpl::WriteEnd() {
- hardware_buffer()->sequence.WriteEnd();
-}
-
-} // namespace content
« no previous file with comments | « content/browser/gamepad/gamepad_shared_buffer_impl.h ('k') | content/browser/renderer_host/gamepad_monitor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698