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

Side by Side Diff: ppapi/proxy/audio_input_resource.h

Issue 1097393007: Update {virtual,override} to follow C++11 style in ppapi. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Split off one file into separate review. Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « ppapi/proxy/audio_buffer_resource.h ('k') | ppapi/proxy/broker_dispatcher.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 PPAPI_PROXY_AUDIO_INPUT_RESOURCE_H_ 5 #ifndef PPAPI_PROXY_AUDIO_INPUT_RESOURCE_H_
6 #define PPAPI_PROXY_AUDIO_INPUT_RESOURCE_H_ 6 #define PPAPI_PROXY_AUDIO_INPUT_RESOURCE_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 13 matching lines...) Expand all
24 namespace ppapi { 24 namespace ppapi {
25 namespace proxy { 25 namespace proxy {
26 26
27 class ResourceMessageReplyParams; 27 class ResourceMessageReplyParams;
28 28
29 class AudioInputResource : public PluginResource, 29 class AudioInputResource : public PluginResource,
30 public thunk::PPB_AudioInput_API, 30 public thunk::PPB_AudioInput_API,
31 public base::DelegateSimpleThread::Delegate { 31 public base::DelegateSimpleThread::Delegate {
32 public: 32 public:
33 AudioInputResource(Connection connection, PP_Instance instance); 33 AudioInputResource(Connection connection, PP_Instance instance);
34 virtual ~AudioInputResource(); 34 ~AudioInputResource() override;
35 35
36 // Resource overrides. 36 // Resource overrides.
37 virtual thunk::PPB_AudioInput_API* AsPPB_AudioInput_API() override; 37 thunk::PPB_AudioInput_API* AsPPB_AudioInput_API() override;
38 virtual void OnReplyReceived(const ResourceMessageReplyParams& params, 38 void OnReplyReceived(const ResourceMessageReplyParams& params,
39 const IPC::Message& msg) override; 39 const IPC::Message& msg) override;
40 40
41 // PPB_AudioInput_API implementation. 41 // PPB_AudioInput_API implementation.
42 virtual int32_t EnumerateDevices( 42 int32_t EnumerateDevices(const PP_ArrayOutput& output,
43 const PP_ArrayOutput& output, 43 scoped_refptr<TrackedCallback> callback) override;
44 scoped_refptr<TrackedCallback> callback) override; 44 int32_t MonitorDeviceChange(PP_MonitorDeviceChangeCallback callback,
45 virtual int32_t MonitorDeviceChange( 45 void* user_data) override;
46 PP_MonitorDeviceChangeCallback callback, 46 int32_t Open0_3(PP_Resource device_ref,
47 void* user_data) override; 47 PP_Resource config,
48 virtual int32_t Open0_3(PP_Resource device_ref, 48 PPB_AudioInput_Callback_0_3 audio_input_callback_0_3,
49 PP_Resource config, 49 void* user_data,
50 PPB_AudioInput_Callback_0_3 audio_input_callback_0_3, 50 scoped_refptr<TrackedCallback> callback) override;
51 void* user_data, 51 int32_t Open(PP_Resource device_ref,
52 scoped_refptr<TrackedCallback> callback) override; 52 PP_Resource config,
53 virtual int32_t Open(PP_Resource device_ref, 53 PPB_AudioInput_Callback audio_input_callback,
54 PP_Resource config, 54 void* user_data,
55 PPB_AudioInput_Callback audio_input_callback, 55 scoped_refptr<TrackedCallback> callback) override;
56 void* user_data, 56 PP_Resource GetCurrentConfig() override;
57 scoped_refptr<TrackedCallback> callback) override; 57 PP_Bool StartCapture() override;
58 virtual PP_Resource GetCurrentConfig() override; 58 PP_Bool StopCapture() override;
59 virtual PP_Bool StartCapture() override; 59 void Close() override;
60 virtual PP_Bool StopCapture() override;
61 virtual void Close() override;
62 60
63 protected: 61 protected:
64 // Resource override. 62 // Resource override.
65 virtual void LastPluginRefWasDeleted() override; 63 void LastPluginRefWasDeleted() override;
66 64
67 private: 65 private:
68 enum OpenState { 66 enum OpenState {
69 BEFORE_OPEN, 67 BEFORE_OPEN,
70 OPENED, 68 OPENED,
71 CLOSED 69 CLOSED
72 }; 70 };
73 71
74 void OnPluginMsgOpenReply(const ResourceMessageReplyParams& params); 72 void OnPluginMsgOpenReply(const ResourceMessageReplyParams& params);
75 73
76 // Sets the shared memory and socket handles. This will automatically start 74 // Sets the shared memory and socket handles. This will automatically start
77 // capture if we're currently set to capture. 75 // capture if we're currently set to capture.
78 void SetStreamInfo(base::SharedMemoryHandle shared_memory_handle, 76 void SetStreamInfo(base::SharedMemoryHandle shared_memory_handle,
79 size_t shared_memory_size, 77 size_t shared_memory_size,
80 base::SyncSocket::Handle socket_handle); 78 base::SyncSocket::Handle socket_handle);
81 79
82 // Starts execution of the audio input thread. 80 // Starts execution of the audio input thread.
83 void StartThread(); 81 void StartThread();
84 82
85 // Stops execution of the audio input thread. 83 // Stops execution of the audio input thread.
86 void StopThread(); 84 void StopThread();
87 85
88 // DelegateSimpleThread::Delegate implementation. 86 // DelegateSimpleThread::Delegate implementation.
89 // Run on the audio input thread. 87 // Run on the audio input thread.
90 virtual void Run() override; 88 void Run() override;
91 89
92 int32_t CommonOpen(PP_Resource device_ref, 90 int32_t CommonOpen(PP_Resource device_ref,
93 PP_Resource config, 91 PP_Resource config,
94 PPB_AudioInput_Callback_0_3 audio_input_callback_0_3, 92 PPB_AudioInput_Callback_0_3 audio_input_callback_0_3,
95 PPB_AudioInput_Callback audio_input_callback, 93 PPB_AudioInput_Callback audio_input_callback,
96 void* user_data, 94 void* user_data,
97 scoped_refptr<TrackedCallback> callback); 95 scoped_refptr<TrackedCallback> callback);
98 96
99 OpenState open_state_; 97 OpenState open_state_;
100 98
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 int client_buffer_size_bytes_; 143 int client_buffer_size_bytes_;
146 scoped_ptr<uint8_t[]> client_buffer_; 144 scoped_ptr<uint8_t[]> client_buffer_;
147 145
148 DISALLOW_COPY_AND_ASSIGN(AudioInputResource); 146 DISALLOW_COPY_AND_ASSIGN(AudioInputResource);
149 }; 147 };
150 148
151 } // namespace proxy 149 } // namespace proxy
152 } // namespace ppapi 150 } // namespace ppapi
153 151
154 #endif // PPAPI_PROXY_AUDIO_INPUT_RESOURCE_H_ 152 #endif // PPAPI_PROXY_AUDIO_INPUT_RESOURCE_H_
OLDNEW
« no previous file with comments | « ppapi/proxy/audio_buffer_resource.h ('k') | ppapi/proxy/broker_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698