Changeset 104858 in webkit


Ignore:
Timestamp:
Jan 12, 2012 2:13:35 PM (12 years ago)
Author:
jer.noble@apple.com
Message:

WebAudio: AudioBus::loadPlatformResource should mmap file on Mac port.
https://bugs.webkit.org/show_bug.cgi?id=74326

Reviewed by Darin Adler.

No new tests; no net change in functionality.

Use NSDataReadingMappedIfSafe when reading platform audio file data.

  • platform/audio/mac/AudioBusMac.mm:

(WebCore::AudioBus::loadPlatformResource):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r104857 r104858  
     12011-12-12  Jer Noble  <jer.noble@apple.com>
     2
     3        WebAudio: AudioBus::loadPlatformResource should mmap file on Mac port.
     4        https://bugs.webkit.org/show_bug.cgi?id=74326
     5
     6        Reviewed by Darin Adler.
     7
     8        No new tests; no net change in functionality.
     9
     10        Use NSDataReadingMappedIfSafe when reading platform audio file data.
     11
     12        * platform/audio/mac/AudioBusMac.mm:
     13        (WebCore::AudioBus::loadPlatformResource):
     14
    1152011-12-12  Jer Noble  <jer.noble@apple.com>
    216
  • trunk/Source/WebCore/platform/audio/mac/AudioBusMac.mm

    r96745 r104858  
    4848   
    4949    NSBundle *bundle = [NSBundle bundleForClass:[WebCoreAudioBundleClass class]];
    50     NSString *audioFilePath = [bundle pathForResource:[NSString stringWithUTF8String:name] ofType:@"wav" inDirectory:@"audio"];
    51     NSData *audioData = [NSData dataWithContentsOfFile:audioFilePath];
     50    NSURL *audioFileURL = [bundle URLForResource:[NSString stringWithUTF8String:name] withExtension:@"wav" subdirectory:@"audio"];
     51    NSData *audioData = [NSData dataWithContentsOfURL:audioFileURL options:NSDataReadingMappedIfSafe error:nil];
    5252
    5353    if (audioData) {
Note: See TracChangeset for help on using the changeset viewer.