Changeset 89172 in webkit


Ignore:
Timestamp:
Jun 17, 2011 2:20:44 PM (13 years ago)
Author:
jer.noble@apple.com
Message:

2011-06-17 Jer Noble <jer.noble@apple.com>

Reviewed by Ada Chan.

Playing video from the manifest crashes on Windows
https://bugs.webkit.org/show_bug.cgi?id=62901

No new tests. This will be covered by existing App Cache tests.

Two related fixes. 1) Null-check the CFStringRef and CFURLRef created in QTMovie::load() before
passing them to CFRelease(). 2) Use CFURL to create an appropriate file-URL on windows in
createFileURLForApplicationCacheResource.

  • html/HTMLMediaElement.cpp: (WebCore::createFileURLForApplicationCacheResource):
  • platform/graphics/win/QTMovie.cpp: (QTMovie::load):
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r89165 r89172  
     12011-06-17  Jer Noble  <jer.noble@apple.com>
     2
     3        Reviewed by Ada Chan.
     4
     5        Playing video from the manifest crashes on Windows
     6        https://bugs.webkit.org/show_bug.cgi?id=62901
     7
     8        No new tests. This will be covered by existing App Cache tests.
     9
     10        Two related fixes.  1) Null-check the CFStringRef and CFURLRef created in QTMovie::load() before
     11        passing them to CFRelease().  2) Use CFURL to create an appropriate file-URL on windows in
     12        createFileURLForApplicationCacheResource.
     13
     14        * html/HTMLMediaElement.cpp:
     15        (WebCore::createFileURLForApplicationCacheResource):
     16        * platform/graphics/win/QTMovie.cpp:
     17        (QTMovie::load):
     18
    1192011-06-17  Abhishek Arya  <inferno@chromium.org>
    220
  • trunk/Source/WebCore/html/HTMLMediaElement.cpp

    r89044 r89172  
    682682    // does not correctly escape '#' and '?'. This function works for our purposes because
    683683    // app cache media files are always created with encodeForFileName(createCanonicalUUIDString()).
     684
     685#if USE(CF) && PLATFORM(WIN)
     686    RetainPtr<CFStringRef> cfPath(AdoptCF, path.createCFString());
     687    RetainPtr<CFURLRef> cfURL(AdoptCF, CFURLCreateWithFileSystemPath(0, cfPath.get(), kCFURLWindowsPathStyle, false));
     688    KURL url(cfURL.get());
     689#else
    684690    KURL url;
    685691
    686692    url.setProtocol("file");
    687693    url.setPath(path);
     694#endif
    688695    return url;
    689696}
  • trunk/Source/WebCore/platform/graphics/win/QTMovie.cpp

    r82014 r89172  
    450450    load(cfURL, preservesPitch);
    451451
    452     CFRelease(cfURL);
    453     CFRelease(urlStringRef);
     452    if (cfURL)
     453        CFRelease(cfURL);
     454    if (urlStringRef)
     455        CFRelease(urlStringRef);
    454456}
    455457
     
    461463    load(cfURL, preservesPitch);
    462464
    463     CFRelease(cfURL);
    464     CFRelease(urlStringRef);
     465    if (cfURL)
     466        CFRelease(cfURL);
     467    if (urlStringRef)
     468        CFRelease(urlStringRef);
    465469}
    466470
Note: See TracChangeset for help on using the changeset viewer.