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

Side by Side Diff: ppapi/cpp/audio.cc

Issue 9682003: Check for specific PPB versions in C++ wrappers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update pp::Fullscreen in this CL, too. Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ppapi/cpp/fullscreen.cc » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "ppapi/cpp/audio.h" 5 #include "ppapi/cpp/audio.h"
6 6
7 #include "ppapi/cpp/instance_handle.h" 7 #include "ppapi/cpp/instance_handle.h"
8 #include "ppapi/cpp/module_impl.h" 8 #include "ppapi/cpp/module_impl.h"
9 9
10 namespace pp { 10 namespace pp {
11 11
12 namespace { 12 namespace {
13 13
14 template <> const char* interface_name<PPB_Audio>() { 14 template <> const char* interface_name<PPB_Audio_1_0>() {
15 return PPB_AUDIO_INTERFACE; 15 return PPB_AUDIO_INTERFACE_1_0;
16 } 16 }
17 17
18 } // namespace 18 } // namespace
19 19
20 Audio::Audio(const InstanceHandle& instance, 20 Audio::Audio(const InstanceHandle& instance,
21 const AudioConfig& config, 21 const AudioConfig& config,
22 PPB_Audio_Callback callback, 22 PPB_Audio_Callback callback,
23 void* user_data) 23 void* user_data)
24 : config_(config) { 24 : config_(config) {
25 if (has_interface<PPB_Audio>()) { 25 if (has_interface<PPB_Audio_1_0>()) {
26 PassRefFromConstructor(get_interface<PPB_Audio>()->Create( 26 PassRefFromConstructor(get_interface<PPB_Audio_1_0>()->Create(
27 instance.pp_instance(), config.pp_resource(), callback, user_data)); 27 instance.pp_instance(), config.pp_resource(), callback, user_data));
28 } 28 }
29 } 29 }
30 30
31 bool Audio::StartPlayback() { 31 bool Audio::StartPlayback() {
32 return has_interface<PPB_Audio>() && 32 return has_interface<PPB_Audio_1_0>() &&
33 get_interface<PPB_Audio>()->StartPlayback(pp_resource()); 33 get_interface<PPB_Audio_1_0>()->StartPlayback(pp_resource());
34 } 34 }
35 35
36 bool Audio::StopPlayback() { 36 bool Audio::StopPlayback() {
37 return has_interface<PPB_Audio>() && 37 return has_interface<PPB_Audio_1_0>() &&
38 get_interface<PPB_Audio>()->StopPlayback(pp_resource()); 38 get_interface<PPB_Audio_1_0>()->StopPlayback(pp_resource());
39 } 39 }
40 40
41 } // namespace pp 41 } // namespace pp
42
OLDNEW
« no previous file with comments | « no previous file | ppapi/cpp/fullscreen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698