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

Side by Side Diff: content/renderer/pepper/pepper_device_enumeration_event_handler.cc

Issue 10837064: Corresponding change in Pepper since EnumerateDevices contract is changed. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: keep current Pepper API Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | content/renderer/pepper/pepper_plugin_delegate_impl.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 #include "content/renderer/pepper/pepper_device_enumeration_event_handler.h" 5 #include "content/renderer/pepper/pepper_device_enumeration_event_handler.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ppapi/shared_impl/ppb_device_ref_shared.h" 8 #include "ppapi/shared_impl/ppb_device_ref_shared.h"
9 9
10 namespace content { 10 namespace content {
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 return PP_DEVICETYPE_DEV_INVALID; 120 return PP_DEVICETYPE_DEV_INVALID;
121 } 121 }
122 } 122 }
123 123
124 void PepperDeviceEnumerationEventHandler::NotifyDevicesEnumerated( 124 void PepperDeviceEnumerationEventHandler::NotifyDevicesEnumerated(
125 int request_id, 125 int request_id,
126 bool succeeded, 126 bool succeeded,
127 const media_stream::StreamDeviceInfoArray& device_array) { 127 const media_stream::StreamDeviceInfoArray& device_array) {
128 EnumerateCallbackMap::iterator iter = enumerate_callbacks_.find(request_id); 128 EnumerateCallbackMap::iterator iter = enumerate_callbacks_.find(request_id);
129 if (iter == enumerate_callbacks_.end()) { 129 if (iter == enumerate_callbacks_.end()) {
130 NOTREACHED(); 130 // This might be enumerated result sent before StopEnumerateDevices is
131 // called since EnumerateDevices is persistent request.
131 return; 132 return;
132 } 133 }
133 134
134 webkit::ppapi::PluginDelegate::EnumerateDevicesCallback callback = 135 webkit::ppapi::PluginDelegate::EnumerateDevicesCallback callback =
135 iter->second; 136 iter->second;
136 enumerate_callbacks_.erase(iter); 137 enumerate_callbacks_.erase(iter);
137 138
138 std::vector<ppapi::DeviceRefData> devices; 139 std::vector<ppapi::DeviceRefData> devices;
139 if (succeeded) { 140 if (succeeded) {
140 devices.reserve(device_array.size()); 141 devices.reserve(device_array.size());
(...skipping 15 matching lines...) Expand all
156 return; 157 return;
157 } 158 }
158 159
159 PepperPluginDelegateImpl::OpenDeviceCallback callback = iter->second; 160 PepperPluginDelegateImpl::OpenDeviceCallback callback = iter->second;
160 open_callbacks_.erase(iter); 161 open_callbacks_.erase(iter);
161 162
162 callback.Run(request_id, succeeded, label); 163 callback.Run(request_id, succeeded, label);
163 } 164 }
164 165
165 } // namespace content 166 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/renderer/pepper/pepper_plugin_delegate_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698