From a5db4db58b706598b0ab4ed1d3de7e5ebae91389 Mon Sep 17 00:00:00 2001 From: "rtoy@google.com" Date: Mon, 22 Apr 2013 17:28:21 +0000 Subject: Support concatenated spatialization data BUG=227141 This is initial support for concatenated spatialization data to speed up loading of the HRTF database on Android. A followup webkit patch (https://codereview.chromium.org/14304002/) will actually enable the concatenated data. Review URL: https://chromiumcodereview.appspot.com/14297003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195537 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/glue/webkitplatformsupport_impl.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'webkit') diff --git a/webkit/glue/webkitplatformsupport_impl.cc b/webkit/glue/webkitplatformsupport_impl.cc index c88767c..24208b7 100644 --- a/webkit/glue/webkitplatformsupport_impl.cc +++ b/webkit/glue/webkitplatformsupport_impl.cc @@ -499,6 +499,15 @@ namespace { WebData loadAudioSpatializationResource(WebKitPlatformSupportImpl* platform, const char* name) { +#ifdef IDR_AUDIO_SPATIALIZATION_COMPOSITE + if (!strcmp(name, "Composite")) { + base::StringPiece resource = + platform->GetDataResource(IDR_AUDIO_SPATIALIZATION_COMPOSITE, + ui::SCALE_FACTOR_NONE); + return WebData(resource.data(), resource.size()); + } +#endif + #ifdef IDR_AUDIO_SPATIALIZATION_T000_P000 const size_t kExpectedSpatializationNameLength = 31; if (strlen(name) != kExpectedSpatializationNameLength) { @@ -666,7 +675,8 @@ WebData WebKitPlatformSupportImpl::loadResource(const char* name) { return WebData(); // Check the name prefix to see if it's an audio resource. - if (StartsWithASCII(name, "IRC_Composite", true)) + if (StartsWithASCII(name, "IRC_Composite", true) || + StartsWithASCII(name, "Composite", true)) return loadAudioSpatializationResource(this, name); // TODO(flackr): We should use a better than linear search here, a trie would -- cgit v1.1