| OLD | NEW |
| 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 | 5 |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 } | 69 } |
| 70 } | 70 } |
| 71 | 71 |
| 72 void ExtraChecks(pp::AudioConfig* config) { | 72 void ExtraChecks(pp::AudioConfig* config) { |
| 73 CHECK(obtained_sample_frame_count_ >= PP_AUDIOMINSAMPLEFRAMECOUNT); | 73 CHECK(obtained_sample_frame_count_ >= PP_AUDIOMINSAMPLEFRAMECOUNT); |
| 74 CHECK(obtained_sample_frame_count_ <= PP_AUDIOMAXSAMPLEFRAMECOUNT); | 74 CHECK(obtained_sample_frame_count_ <= PP_AUDIOMAXSAMPLEFRAMECOUNT); |
| 75 | 75 |
| 76 PPB_GetInterface get_browser_if = | 76 PPB_GetInterface get_browser_if = |
| 77 pp::Module::Get()->get_browser_interface(); | 77 pp::Module::Get()->get_browser_interface(); |
| 78 | 78 |
| 79 const struct PPB_AudioConfig* audio_config_if = | 79 const PPB_AudioConfig* audio_config_if = |
| 80 static_cast<const struct PPB_AudioConfig*>( | 80 static_cast<const PPB_AudioConfig*>( |
| 81 get_browser_if(PPB_AUDIO_CONFIG_INTERFACE)); | 81 get_browser_if(PPB_AUDIO_CONFIG_INTERFACE)); |
| 82 | 82 |
| 83 const struct PPB_Audio* audio_if = | 83 const PPB_Audio* audio_if = |
| 84 static_cast<const struct PPB_Audio*>( | 84 static_cast<const PPB_Audio*>( |
| 85 get_browser_if(PPB_AUDIO_INTERFACE)); | 85 get_browser_if(PPB_AUDIO_INTERFACE)); |
| 86 | 86 |
| 87 CHECK(NULL != audio_config_if); | 87 CHECK(NULL != audio_config_if); |
| 88 CHECK(NULL != audio_if); | 88 CHECK(NULL != audio_if); |
| 89 | 89 |
| 90 const PP_Resource audio_config_res = config->pp_resource(); | 90 const PP_Resource audio_config_res = config->pp_resource(); |
| 91 const PP_Resource audio_res = audio_.pp_resource(); | 91 const PP_Resource audio_res = audio_.pp_resource(); |
| 92 | 92 |
| 93 CHECK(PP_TRUE == audio_config_if->IsAudioConfig(audio_config_res)); | 93 CHECK(PP_TRUE == audio_config_if->IsAudioConfig(audio_config_res)); |
| 94 CHECK(PP_TRUE == audio_if->IsAudio(audio_res)); | 94 CHECK(PP_TRUE == audio_if->IsAudio(audio_res)); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 return new MyInstance(instance); | 145 return new MyInstance(instance); |
| 146 } | 146 } |
| 147 }; | 147 }; |
| 148 | 148 |
| 149 namespace pp { | 149 namespace pp { |
| 150 Module* CreateModule() { | 150 Module* CreateModule() { |
| 151 return new MyModule(); | 151 return new MyModule(); |
| 152 } | 152 } |
| 153 | 153 |
| 154 } // namespace pp | 154 } // namespace pp |
| OLD | NEW |