Changeset 39517 in webkit


Ignore:
Timestamp:
Dec 30, 2008 3:08:26 AM (15 years ago)
Author:
cwzwarich@webkit.org
Message:

2008-12-30 Cameron Zwarich <cwzwarich@uwaterloo.ca>

Reviewed by Antti Koivisto.

Bug 22931: Using the inspector with purgeable resources leads to assertion failures
<https://bugs.webkit.org/show_bug.cgi?id=22931>

Change InspectorResource::sourceString() so that it doesn't attempt to
unsafely get the data of a purgeable CachedResource.

  • inspector/InspectorController.cpp: (WebCore::InspectorResource::sourceString): Attempt to make a purgeable resource unpurgeable, and if this not possible, return an empty string.
  • loader/CachedResource.h: Make InspectorResource a friend of CachedResource.
Location:
trunk/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r39514 r39517  
     12008-12-30  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
     2
     3        Reviewed by Antti Koivisto.
     4
     5        Bug 22931: Using the inspector with purgeable resources leads to assertion failures
     6        <https://bugs.webkit.org/show_bug.cgi?id=22931>
     7
     8        Change InspectorResource::sourceString() so that it doesn't attempt to
     9        unsafely get the data of a purgeable CachedResource.
     10
     11        * inspector/InspectorController.cpp:
     12        (WebCore::InspectorResource::sourceString): Attempt to make a purgeable
     13        resource unpurgeable, and if this not possible, return an empty string.
     14        * loader/CachedResource.h: Make InspectorResource a friend of CachedResource.
     15
    1162008-12-29  Alexey Proskuryakov  <ap@webkit.org>
    217
  • trunk/WebCore/inspector/InspectorController.cpp

    r39338 r39517  
    349349                return String();
    350350
     351            if (cachedResource->isPurgeable()) {
     352                // If the resource is purgeable then make it unpurgeable to get
     353                // get its data. This might fail, in which case we return an
     354                // empty String.
     355                // FIXME: should we do something else in the case of a purged
     356                // resource that informs the user why there is no data in the
     357                // inspector?
     358                if (!cachedResource->makePurgeable(false))
     359                    return String();
     360            }
     361
    351362            buffer = cachedResource->data();
    352363            textEncodingName = cachedResource->encoding();
  • trunk/WebCore/loader/CachedResource.h

    r39473 r39517  
    4040class CachedResourceHandleBase;
    4141class DocLoader;
     42class InspectorResource;
    4243class Request;
    4344class PurgeableBuffer;
     
    4849class CachedResource {
    4950    friend class Cache;
     51    friend class InspectorResource;
    5052   
    5153public:
Note: See TracChangeset for help on using the changeset viewer.