OLD | NEW |
---|---|
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 "webkit/glue/webkitplatformsupport_impl.h" | 5 #include "webkit/glue/webkitplatformsupport_impl.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
668 } | 668 } |
669 } | 669 } |
670 | 670 |
671 NOTREACHED() << "Unknown image resource " << name; | 671 NOTREACHED() << "Unknown image resource " << name; |
672 return WebData(); | 672 return WebData(); |
673 } | 673 } |
674 | 674 |
675 bool WebKitPlatformSupportImpl::loadAudioResource( | 675 bool WebKitPlatformSupportImpl::loadAudioResource( |
676 WebKit::WebAudioBus* destination_bus, const char* audio_file_data, | 676 WebKit::WebAudioBus* destination_bus, const char* audio_file_data, |
677 size_t data_size, double sample_rate) { | 677 size_t data_size, double sample_rate) { |
678 #if !defined(OS_ANDROID) | |
678 return webkit_media::DecodeAudioFileData(destination_bus, | 679 return webkit_media::DecodeAudioFileData(destination_bus, |
679 audio_file_data, | 680 audio_file_data, |
680 data_size, | 681 data_size, |
681 sample_rate); | 682 sample_rate); |
683 #else | |
684 webkit_media::WebAudioMediaCodecRunner runner = GetWebAudioMediaCodecRunner(); | |
685 return webkit_media::DecodeAudioFileData( | |
686 destination_bus, | |
687 audio_file_data, | |
688 data_size, | |
689 sample_rate, | |
690 runner); | |
691 #endif | |
682 } | 692 } |
683 | 693 |
684 WebString WebKitPlatformSupportImpl::queryLocalizedString( | 694 WebString WebKitPlatformSupportImpl::queryLocalizedString( |
685 WebLocalizedString::Name name) { | 695 WebLocalizedString::Name name) { |
686 int message_id = ToMessageID(name); | 696 int message_id = ToMessageID(name); |
687 if (message_id < 0) | 697 if (message_id < 0) |
688 return WebString(); | 698 return WebString(); |
689 return GetLocalizedString(message_id); | 699 return GetLocalizedString(message_id); |
690 } | 700 } |
691 | 701 |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
954 WebKitPlatformSupportImpl::allocateAndLockDiscardableMemory(size_t bytes) { | 964 WebKitPlatformSupportImpl::allocateAndLockDiscardableMemory(size_t bytes) { |
955 if (!base::DiscardableMemory::Supported()) | 965 if (!base::DiscardableMemory::Supported()) |
956 return NULL; | 966 return NULL; |
957 scoped_ptr<WebDiscardableMemoryImpl> discardable( | 967 scoped_ptr<WebDiscardableMemoryImpl> discardable( |
958 new WebDiscardableMemoryImpl()); | 968 new WebDiscardableMemoryImpl()); |
959 if (discardable->InitializeAndLock(bytes)) | 969 if (discardable->InitializeAndLock(bytes)) |
960 return discardable.release(); | 970 return discardable.release(); |
961 return NULL; | 971 return NULL; |
962 } | 972 } |
963 | 973 |
974 /* static */ | |
975 void WebKitPlatformSupportImpl::NullRunWebAudioMediaCodec( | |
976 base::SharedMemoryHandle encoded_data_handle, | |
977 base::FileDescriptor pcm_output) { | |
978 } | |
964 | 979 |
980 webkit_media::WebAudioMediaCodecRunner | |
981 WebKitPlatformSupportImpl::GetWebAudioMediaCodecRunner() { | |
982 return base::Bind(&WebKitPlatformSupportImpl::NullRunWebAudioMediaCodec); | |
983 } | |
brettw
2013/04/08 04:14:35
Nit: leave blank line before namespace end.
| |
965 } // namespace webkit_glue | 984 } // namespace webkit_glue |
OLD | NEW |