Changeset 168441 in webkit


Ignore:
Timestamp:
May 7, 2014, 2:57:06 PM (11 years ago)
Author:
mitz@apple.com
Message:

<rdar://problem/16831276> [iOS] Unparenting a WKWebView that’s loading pauses it
https://bugs.webkit.org/show_bug.cgi?id=132659

Reviewed by Tim Horton.

  • UIProcess/Cocoa/NavigationState.h: Added a member variable.
  • UIProcess/Cocoa/NavigationState.mm:

(WebKit::NavigationState::didChangeIsLoading): When transitioning into loading state,
acquire a background activity token. When transitioning out of loading state, dispose of
the token.

Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r168439 r168441  
     12014-05-07  Dan Bernstein  <mitz@apple.com>
     2
     3        <rdar://problem/16831276> [iOS] Unparenting a WKWebView that’s loading pauses it
     4        https://bugs.webkit.org/show_bug.cgi?id=132659
     5
     6        Reviewed by Tim Horton.
     7
     8        * UIProcess/Cocoa/NavigationState.h: Added a member variable.
     9        * UIProcess/Cocoa/NavigationState.mm:
     10        (WebKit::NavigationState::didChangeIsLoading): When transitioning into loading state,
     11        acquire a background activity token. When transitioning out of loading state, dispose of
     12        the token.
     13
    1142014-05-07  Jeremy Jones  <jeremyj@apple.com>
    215
  • trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.h

    r168324 r168441  
    3636#import "APIPolicyClient.h"
    3737#import "PageLoadState.h"
     38#import "ProcessThrottler.h"
    3839#import "WeakObjCPtr.h"
    3940
     
    160161        bool webViewDidUpdateHistoryTitleForURL : 1;
    161162    } m_historyDelegateMethods;
     163
     164#if PLATFORM(IOS)
     165    std::unique_ptr<ProcessThrottler::BackgroundActivityToken> m_activityToken;
     166#endif
    162167};
    163168
  • trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm

    r168324 r168441  
    5252#import "WebFrameProxy.h"
    5353#import "WebPageProxy.h"
     54#import "WebProcessProxy.h"
    5455#import <wtf/NeverDestroyed.h>
    5556
     
    626627void NavigationState::didChangeIsLoading()
    627628{
     629#if PLATFORM(IOS)
     630    if (m_webView->_page->pageLoadState().isLoading())
     631        m_activityToken = std::make_unique<ProcessThrottler::BackgroundActivityToken>(m_webView->_page->process().throttler());
     632    else
     633        m_activityToken = nullptr;
     634#endif
     635
    628636    [m_webView didChangeValueForKey:@"loading"];
    629637}
Note: See TracChangeset for help on using the changeset viewer.