Changeset 85364 in webkit


Ignore:
Timestamp:
Apr 29, 2011 4:12:44 PM (13 years ago)
Author:
weinig@apple.com
Message:

2011-04-29 Sam Weinig <sam@webkit.org>

Reviewed by Dan Bernstein.

Add protection for shared memory failing to allocate
<rdar://problem/9125287>
https://bugs.webkit.org/show_bug.cgi?id=59842

  • Platform/mac/SharedMemoryMac.cpp: (WebKit::SharedMemory::create): Add logging in shared memory failure cases.
  • WebProcess/WebPage/DrawingAreaImpl.cpp: (WebKit::DrawingAreaImpl::display): Guard against ShareableBitmap failing to create a shared memory backing.
Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r85359 r85364  
     12011-04-29  Sam Weinig  <sam@webkit.org>
     2
     3        Reviewed by Dan Bernstein.
     4
     5        Add protection for shared memory failing to allocate
     6        <rdar://problem/9125287>
     7        https://bugs.webkit.org/show_bug.cgi?id=59842
     8
     9        * Platform/mac/SharedMemoryMac.cpp:
     10        (WebKit::SharedMemory::create):
     11        Add logging in shared memory failure cases.
     12
     13        * WebProcess/WebPage/DrawingAreaImpl.cpp:
     14        (WebKit::DrawingAreaImpl::display):
     15        Guard against ShareableBitmap failing to create a shared memory
     16        backing.
     17
    1182011-04-28  Stephanie Lewis  <slewis@apple.com>
    219
  • trunk/Source/WebKit2/Platform/mac/SharedMemoryMac.cpp

    r78578 r85364  
    9696    mach_vm_address_t address;
    9797    kern_return_t kr = mach_vm_allocate(mach_task_self(), &address, round_page(size), VM_FLAGS_ANYWHERE);
    98     if (kr != KERN_SUCCESS)
    99         return 0;
     98    if (kr != KERN_SUCCESS) {
     99        LOG_ERROR("Failed to allocate mach_vm_allocate shared memory (%zu bytes) [error code: %x]", size, kr);
     100        return 0;
     101    }
    100102
    101103    // Create a Mach port that represents the shared memory.
     
    105107
    106108    if (kr != KERN_SUCCESS) {
     109        LOG_ERROR("Failed to create a mach port for shared memory [error code: %x]", kr);
    107110        mach_vm_deallocate(mach_task_self(), address, round_page(size));
    108111        return 0;
  • trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp

    r84682 r85364  
    572572
    573573        RefPtr<ShareableBitmap> bitmap = ShareableBitmap::createShareable(bounds.size(), ShareableBitmap::SupportsAlpha);
     574        if (!bitmap)
     575            return;
     576
    574577        if (!bitmap->createHandle(updateInfo.bitmapHandle))
    575578            return;
Note: See TracChangeset for help on using the changeset viewer.