| Index: ppapi/examples/audio_input/audio_input.cc
|
| diff --git a/ppapi/examples/audio_input/audio_input.cc b/ppapi/examples/audio_input/audio_input.cc
|
| index 7d156b72e6381d00b6fcde660edc262a66c6507c..62bf2995cc86a8d7544a2068bdb6054f8f6f99b3 100644
|
| --- a/ppapi/examples/audio_input/audio_input.cc
|
| +++ b/ppapi/examples/audio_input/audio_input.cc
|
| @@ -93,9 +93,10 @@ class MyInstance : public pp::Instance {
|
| if (message_data.is_string()) {
|
| std::string event = message_data.AsString();
|
| if (event == "PageInitialized") {
|
| - pp::CompletionCallback callback = callback_factory_.NewCallback(
|
| - &MyInstance::EnumerateDevicesFinished);
|
| - int32_t result = audio_input_.EnumerateDevices(&devices_, callback);
|
| + pp::CompletionCallbackWithOutput<std::vector<pp::DeviceRef_Dev> >
|
| + callback = callback_factory_.NewCallbackWithOutput(
|
| + &MyInstance::EnumerateDevicesFinished);
|
| + int32_t result = audio_input_.EnumerateDevices(callback);
|
| if (result != PP_OK_COMPLETIONPENDING)
|
| PostMessage(pp::Var("EnumerationFailed"));
|
| } else if (event == "UseDefault") {
|
| @@ -241,10 +242,12 @@ class MyInstance : public pp::Instance {
|
| }
|
| }
|
|
|
| - void EnumerateDevicesFinished(int32_t result) {
|
| + void EnumerateDevicesFinished(int32_t result,
|
| + std::vector<pp::DeviceRef_Dev>& devices) {
|
| static const char* const kDelimiter = "#__#";
|
|
|
| if (result == PP_OK) {
|
| + devices_.swap(devices);
|
| std::string device_names;
|
| for (size_t index = 0; index < devices_.size(); ++index) {
|
| pp::Var name = devices_[index].GetName();
|
|
|