Changeset 122648 in webkit


Ignore:
Timestamp:
Jul 13, 2012 5:33:28 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Fix for WebContext::getWebCoreStatistics() causes crash if no m_process
https://bugs.webkit.org/show_bug.cgi?id=91116

.:

Patch by Josh Hawn <jhawn@apple.com> on 2012-07-12
Reviewed by Simon Fraser.

  • Source/WebKit2/UIProcess/WebContext.cpp: WebContext::getWebCoreStatistics():

Now invalidates callback if no m_process.

Tools:

Patch by Josh Hawn <jhawn@apple.com> on 2012-07-13
Reviewed by Simon Fraser.

  • TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:

Added new test file.

  • TestWebKitAPI/Tests/WebKit2/WebCoreStatisticsWithNoWebProcess.cpp: Added.

(TestWebKitAPI::wkContextGetStatisticsCallback):

Tests that callback function receives an error.

(TestWebKitAPI::TEST):

Creates a dummy web context object (no web process).
Calls WKContextGetStatistics with the web context and test callback.
The test callback should get an expected error.

Location:
trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r122601 r122648  
     12012-07-12 Josh Hawn <jhawn@apple.com>
     2
     3        Fix for WebContext::getWebCoreStatistics() causes crash if no m_process
     4        https://bugs.webkit.org/show_bug.cgi?id=91116
     5
     6        Reviewed by Simon Fraser.
     7
     8        * Source/WebKit2/UIProcess/WebContext.cpp:
     9          WebContext::getWebCoreStatistics():
     10                Now invalidates callback if no m_process.
     11
    1122012-07-13  Thiago Marcos P. Santos  <thiago.santos@intel.com>
    213
  • trunk/Source/WebKit2/UIProcess/WebContext.cpp

    r122500 r122648  
    970970}
    971971
    972 void WebContext::getWebCoreStatistics(PassRefPtr<DictionaryCallback> prpCallback)
    973 {
    974     RefPtr<DictionaryCallback> callback = prpCallback;
     972void WebContext::getWebCoreStatistics(PassRefPtr<DictionaryCallback> callback)
     973{
     974    if (!m_process) {
     975        callback->invalidate();
     976        return;
     977    }
    975978   
    976979    uint64_t callbackID = callback->callbackID();
  • trunk/Tools/ChangeLog

    r122645 r122648  
     12012-07-13  Josh Hawn  <jhawn@apple.com>
     2
     3        Fix for WebContext::getWebCoreStatistics() causes crash if no m_process
     4        https://bugs.webkit.org/show_bug.cgi?id=91116
     5
     6        Reviewed by Simon Fraser.
     7
     8        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
     9            Added new test file.
     10        * TestWebKitAPI/Tests/WebKit2/WebCoreStatisticsWithNoWebProcess.cpp: Added.
     11        (TestWebKitAPI::wkContextGetStatisticsCallback):
     12            Tests that callback function receives an error.
     13        (TestWebKitAPI::TEST):
     14            Creates a dummy web context object (no web process).
     15            Calls WKContextGetStatistics with the web context and test callback.
     16            The test callback should get an expected error.
     17
    1182012-07-13  Dirk Pranke  <dpranke@chromium.org>
    219
  • trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj

    r121979 r122648  
    1010                0BCD833514857CE400EA2003 /* HashMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0BCD833414857CE400EA2003 /* HashMap.cpp */; };
    1111                0BCD856A1485C98B00EA2003 /* TemporaryChange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0BCD85691485C98B00EA2003 /* TemporaryChange.cpp */; };
     12                0F17BBD615AF6C4D007AB753 /* WebCoreStatisticsWithNoWebProcess.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F17BBD415AF6C4D007AB753 /* WebCoreStatisticsWithNoWebProcess.cpp */; };
    1213                0FC6C4CC141027E0005B7F0C /* RedBlackTree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC6C4CB141027E0005B7F0C /* RedBlackTree.cpp */; };
    1314                0FC6C4CF141034AD005B7F0C /* MetaAllocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC6C4CE141034AD005B7F0C /* MetaAllocator.cpp */; };
     
    230231                0BCD833414857CE400EA2003 /* HashMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HashMap.cpp; path = WTF/HashMap.cpp; sourceTree = "<group>"; };
    231232                0BCD85691485C98B00EA2003 /* TemporaryChange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TemporaryChange.cpp; path = WTF/TemporaryChange.cpp; sourceTree = "<group>"; };
     233                0F17BBD415AF6C4D007AB753 /* WebCoreStatisticsWithNoWebProcess.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebCoreStatisticsWithNoWebProcess.cpp; sourceTree = "<group>"; };
    232234                0FC6C4CB141027E0005B7F0C /* RedBlackTree.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RedBlackTree.cpp; path = WTF/RedBlackTree.cpp; sourceTree = "<group>"; };
    233235                0FC6C4CE141034AD005B7F0C /* MetaAllocator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MetaAllocator.cpp; path = WTF/MetaAllocator.cpp; sourceTree = "<group>"; };
     
    597599                                BC90995D12567BC100083756 /* WKString.cpp */,
    598600                                BC9099931256ACF100083756 /* WKStringJSString.cpp */,
     601                                0F17BBD415AF6C4D007AB753 /* WebCoreStatisticsWithNoWebProcess.cpp */,
    599602                        );
    600603                        path = WebKit2;
     
    930933                                F660AA0D15A5F061003A1243 /* GetInjectedBundleInitializationUserDataCallback.cpp in Sources */,
    931934                                F660AA1315A619C9003A1243 /* InjectedBundleInitializationUserDataCallbackWins.cpp in Sources */,
     935                                0F17BBD615AF6C4D007AB753 /* WebCoreStatisticsWithNoWebProcess.cpp in Sources */,
    932936                        );
    933937                        runOnlyForDeploymentPostprocessing = 0;
Note: See TracChangeset for help on using the changeset viewer.