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

Side by Side Diff: content/renderer/device_sensors/device_sensor_event_pump.h

Issue 2592623002: mojo:: Introduce InterfaceRequest ctor that takes in InterfacePtr* (Closed)
Patch Set: Rebase + response to review 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_RENDERER_DEVICE_SENSORS_DEVICE_SENSOR_EVENT_PUMP_H_ 5 #ifndef CONTENT_RENDERER_DEVICE_SENSORS_DEVICE_SENSOR_EVENT_PUMP_H_
6 #define CONTENT_RENDERER_DEVICE_SENSORS_DEVICE_SENSOR_EVENT_PUMP_H_ 6 #define CONTENT_RENDERER_DEVICE_SENSORS_DEVICE_SENSOR_EVENT_PUMP_H_
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/memory/shared_memory.h" 11 #include "base/memory/shared_memory.h"
12 #include "base/time/time.h" 12 #include "base/time/time.h"
13 #include "base/timer/timer.h" 13 #include "base/timer/timer.h"
14 #include "content/public/renderer/platform_event_observer.h" 14 #include "content/public/renderer/platform_event_observer.h"
15 #include "content/renderer/render_thread_impl.h" 15 #include "content/renderer/render_thread_impl.h"
16 #include "mojo/public/cpp/system/platform_handle.h" 16 #include "mojo/public/cpp/system/platform_handle.h"
17 #include "services/service_manager/public/cpp/interface_provider.h" 17 #include "services/service_manager/public/cpp/interface_provider.h"
18 18
19 namespace content { 19 namespace content {
20 20
21 template <typename Base, typename MojoInterface> 21 template <typename Base, typename MojoInterface>
22 class CONTENT_EXPORT DeviceSensorMojoClientMixin : public Base { 22 class CONTENT_EXPORT DeviceSensorMojoClientMixin : public Base {
23 public: 23 public:
24 template <typename... Args> 24 template <typename... Args>
25 explicit DeviceSensorMojoClientMixin(Args&&... args) 25 explicit DeviceSensorMojoClientMixin(Args&&... args)
26 : Base(std::forward<Args>(args)...) { 26 : Base(std::forward<Args>(args)...) {
27 mojo::InterfaceRequest<MojoInterface> request = 27 mojo::InterfaceRequest<MojoInterface> request(&mojo_interface_);
28 mojo::MakeRequest(&mojo_interface_);
29 28
30 // When running layout tests, those observers should not listen to the 29 // When running layout tests, those observers should not listen to the
31 // actual hardware changes. In order to make that happen, don't connect 30 // actual hardware changes. In order to make that happen, don't connect
32 // the other end of the mojo pipe to anything. 31 // the other end of the mojo pipe to anything.
33 // 32 //
34 // TODO(sammc): Remove this when JS layout test support for shared buffers 33 // TODO(sammc): Remove this when JS layout test support for shared buffers
35 // is ready and the layout tests are converted to use that for mocking. 34 // is ready and the layout tests are converted to use that for mocking.
36 if (RenderThreadImpl::current() && 35 if (RenderThreadImpl::current() &&
37 !RenderThreadImpl::current()->layout_test_mode()) { 36 !RenderThreadImpl::current()->layout_test_mode()) {
38 RenderThread::Get()->GetRemoteInterfaces()->GetInterface( 37 RenderThread::Get()->GetRemoteInterfaces()->GetInterface(
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 int pump_delay_microseconds_; 141 int pump_delay_microseconds_;
143 PumpState state_; 142 PumpState state_;
144 base::RepeatingTimer timer_; 143 base::RepeatingTimer timer_;
145 144
146 DISALLOW_COPY_AND_ASSIGN(DeviceSensorEventPump); 145 DISALLOW_COPY_AND_ASSIGN(DeviceSensorEventPump);
147 }; 146 };
148 147
149 } // namespace content 148 } // namespace content
150 149
151 #endif // CONTENT_RENDERER_DEVICE_SENSORS_DEVICE_SENSOR_EVENT_PUMP_H_ 150 #endif // CONTENT_RENDERER_DEVICE_SENSORS_DEVICE_SENSOR_EVENT_PUMP_H_
OLDNEW
« no previous file with comments | « content/public/browser/utility_process_mojo_client.h ('k') | content/renderer/render_frame_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698