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

Unified Diff: content/browser/renderer_host/vr_message_filter.h

Issue 829803003: Adding Chrome-side WebVR interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed the rest of sievers@ input 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: content/browser/renderer_host/vr_message_filter.h
diff --git a/content/browser/renderer_host/vr_message_filter.h b/content/browser/renderer_host/vr_message_filter.h
new file mode 100644
index 0000000000000000000000000000000000000000..c7b5656995058dd710c1666f25f9c26571a843b3
--- /dev/null
+++ b/content/browser/renderer_host/vr_message_filter.h
@@ -0,0 +1,54 @@
+// 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 CONTENT_BROWSER_RENDERER_HOST_VR_MESSAGE_FILTER_H_
+#define CONTENT_BROWSER_RENDERER_HOST_VR_MESSAGE_FILTER_H_
+
+#include <vector>
+#include "base/compiler_specific.h"
+#include "base/memory/shared_memory.h"
+#include "content/browser/vr/vr_service.h"
+#include "content/browser/vr/vr_service_consumer.h"
+#include "content/public/browser/browser_message_filter.h"
+
+namespace blink {
+struct WebHMDSensorState;
+class WebVRDevice;
+struct WebVRVector4;
+}
+
+namespace content {
+
+class RenderProcessHost;
+
+class VRMessageFilter :
+ public BrowserMessageFilter, public VRServiceConsumer {
+ public:
+ VRMessageFilter();
+
+ // BrowserMessageFilter implementation.
+ bool OnMessageReceived(const IPC::Message& message) override;
+
+ private:
+ ~VRMessageFilter() override;
+
+ void OnGetVRDevices(std::vector<blink::WebVRDevice>* devices);
+
+ void OnGetSensorState(
+ unsigned int index, blink::WebHMDSensorState* state);
+
+ void OnResetSensor(unsigned int index);
+
+ void OnGetRenderTargetRects(unsigned index,
+ blink::WebVRFieldOfView leftFov,
+ blink::WebVRFieldOfView rightFov,
+ blink::WebVRVector4* leftRect,
+ blink::WebVRVector4* rightRect);
+
+ DISALLOW_COPY_AND_ASSIGN(VRMessageFilter);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_RENDERER_HOST_VR_MESSAGE_FILTER_H_

Powered by Google App Engine
This is Rietveld 408576698