Changeset 194472 in webkit


Ignore:
Timestamp:
Dec 31, 2015, 3:49:46 PM (10 years ago)
Author:
ddkilzer@apple.com
Message:

Stop using USE(CFNETWORK) path on iOS
Source/WebCore:

https://bugs.webkit.org/show_bug.cgi?id=142540

Step 1/2: Do everything but turn off USE(CFNETWORK) internally.

Original patch by Antti Koivisto <Antti Koivisto> on 2015-03-10
Reviewed by Daniel Bates.

Unify OS X and iOS code paths.

This patch just fixes the NSURLConnection code path on iOS. It
doesn't yet delete any unnecessary code.

Changes covered by most existing tests.

  • loader/DocumentLoader.h:
  • loader/ResourceLoader.cpp:
  • loader/ResourceLoader.h:
  • loader/mac/DocumentLoaderMac.cpp:
  • Update for iOS to use NSURLConnection loader.
  • page/mac/PageMac.mm:

(WebCore::Page::platformInitialize): Always use the correct
runloop on iOS regardless of which thread this was called on.
(WebCore::Page::addSchedulePair): Update for iOS to use
NSURLConnection loader.
(WebCore::Page::removeSchedulePair): Ditto.

  • platform/ios/wak/WebCoreThread.h:

(WebThreadRunLoop): No longer needs to be exported.
(WebThreadNSRunLoop): Export for WebKitLegacy.

  • platform/network/ios/QuickLook.mm: Fix header order.

(WebQuickLookHandleAsDelegate): Make delegate objects implement
WebCoreResourceLoaderDelegate protocol. This unifies the
-clearHandle and -detachHandle methods that were used on iOS and
OS X, respectively.
(-[WebQuickLookHandleAsDelegate clearHandle]): Deleted.
(-[WebQuickLookHandleAsDelegate detachHandle]): Renamed from
-clearHandle.
(WebResourceLoaderQuickLookDelegate): Make delegate objects
implement WebCoreResourceLoaderDelegate protocol.
(-[WebResourceLoaderQuickLookDelegate clearHandle]): Deleted.
(-[WebResourceLoaderQuickLookDelegate detachHandle]): Renamed from
-clearHandle.
(WebCore::QuickLookHandle::~QuickLookHandle): Call
-detachHandle instead of -clearHandle.

  • platform/network/mac/ResourceHandleMac.mm:
  • Update for iOS to use NSURLConnection loader.
  • platform/network/mac/WebCoreResourceHandleAsDelegate.h:

(WebCoreResourceLoaderDelegate): Define new protocol.

  • platform/network/mac/WebCoreResourceHandleAsDelegate.mm:

(-[WebCoreResourceHandleAsDelegate detachHandle]): Gratuitous
nullptr fix.

  • platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:

(WebCoreResourceHandleAsOperationQueueDelegate): Implement
WebCoreResourceLoaderDelegate protocol.

  • platform/spi/cocoa/NSURLDownloadSPI.h: Declare more

NSURDownload SPI to clean up other source files and make
source compile on iOS with NSURLConnection code path.

Source/WebKit/mac:

https://bugs.webkit.org/show_bug.cgi?id=142540

Step 1/2: Do everything but turn off USE(CFNETWORK) internally.

Original patch by Antti Koivisto <Antti Koivisto> on 2015-03-10
Reviewed by Daniel Bates.

  • Misc/WebDownload.h: Add header guard to make

NSURLDownloadSPI.h work when pre-declaring NSURLDownload object.

  • Misc/WebKitVersionChecks.h: Define

WEBKIT_FIRST_VERSION_WITH_LOADING_DURING_COMMON_RUNLOOP_MODES
for iOS.

  • WebView/WebView.mm:

(-[WebView _commonInitializationWithFrameName:groupName:]): Use
the correct runloop on iOS.

  • WebView/WebViewPrivate.h:

(-[WebView(WebPendingPublic) scheduleInRunLoop:forMode:]):
(-[WebView(WebPendingPublic) unscheduleFromRunLoop:forMode:]):

  • These are available on iOS now.

Source/WebKit2:

https://bugs.webkit.org/show_bug.cgi?id=142540

Step 1/2: Do everything but turn off USE(CFNETWORK) internally.

Original patch by Antti Koivisto <Antti Koivisto> on 2015-03-10
Reviewed by Daniel Bates.

  • NetworkProcess/Downloads/ios/DownloadIOS.mm: This is now the

USE(CFNETWORK) && !USE(NETWORK_SESSION) code path.

  • NetworkProcess/Downloads/mac/DownloadMac.mm: This is now the

!USE(CFNETWORK) && !USE(NETWORK_SESSION) code path. Make use of
NSURLDownloadSPI.h. Ignore a deprecated delcaration warning now
that we're using actual header declarations internally.

  • NetworkProcess/NetworkProcess.cpp:

(WebKit::NetworkProcess::initializeNetworkProcess): Update for
iOS to use NSURLConnection loader.

Source/WTF:

<https://webkit.org/b/142540>

Step 1/2: Do everything but turn off USE(CFNETWORK) internally.

Original patch by Antti Koivisto <Antti Koivisto> on 2015-03-10
Reviewed by Daniel Bates.

  • wtf/SchedulePair.h: Update macros to match WebCore.
Location:
trunk/Source
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r194469 r194472  
     12015-12-31  David Kilzer  <ddkilzer@apple.com>
     2
     3        Stop using USE(CFNETWORK) path on iOS
     4        <https://webkit.org/b/142540>
     5
     6        Step 1/2: Do everything but turn off USE(CFNETWORK) internally.
     7
     8        Original patch by Antti Koivisto <antti@apple.com> on 2015-03-10
     9        Reviewed by Daniel Bates.
     10
     11        * wtf/SchedulePair.h: Update macros to match WebCore.
     12
    1132015-12-31  Andy Estes  <aestes@apple.com>
    214
  • trunk/Source/WTF/wtf/SchedulePair.h

    r191803 r194472  
    3636#include <wtf/text/WTFString.h>
    3737
    38 #if USE(FOUNDATION)
     38#if PLATFORM(COCOA) && !USE(CFNETWORK)
    3939OBJC_CLASS NSRunLoop;
    4040#endif
     
    4646    static Ref<SchedulePair> create(CFRunLoopRef runLoop, CFStringRef mode) { return adoptRef(*new SchedulePair(runLoop, mode)); }
    4747
    48 #if USE(FOUNDATION) && !USE(CFNETWORK)
     48#if PLATFORM(COCOA) && !USE(CFNETWORK)
    4949    static Ref<SchedulePair> create(NSRunLoop* runLoop, CFStringRef mode) { return adoptRef(*new SchedulePair(runLoop, mode)); }
    5050    NSRunLoop* nsRunLoop() const { return m_nsRunLoop.get(); }
     
    6464    }
    6565
    66 #if USE(FOUNDATION) && !USE(CFNETWORK)
     66#if PLATFORM(COCOA) && !USE(CFNETWORK)
    6767    WTF_EXPORT_PRIVATE SchedulePair(NSRunLoop*, CFStringRef);
    6868    RetainPtr<NSRunLoop*> m_nsRunLoop;
  • trunk/Source/WebCore/ChangeLog

    r194470 r194472  
     12015-12-31  David Kilzer  <ddkilzer@apple.com>
     2
     3        Stop using USE(CFNETWORK) path on iOS
     4        https://bugs.webkit.org/show_bug.cgi?id=142540
     5
     6        Step 1/2: Do everything but turn off USE(CFNETWORK) internally.
     7
     8        Original patch by Antti Koivisto <antti@apple.com> on 2015-03-10
     9        Reviewed by Daniel Bates.
     10
     11        Unify OS X and iOS code paths.
     12
     13        This patch just fixes the NSURLConnection code path on iOS. It
     14        doesn't yet delete any unnecessary code.
     15
     16        Changes covered by most existing tests.
     17
     18        * loader/DocumentLoader.h:
     19        * loader/ResourceLoader.cpp:
     20        * loader/ResourceLoader.h:
     21        * loader/mac/DocumentLoaderMac.cpp:
     22        - Update for iOS to use NSURLConnection loader.
     23
     24        * page/mac/PageMac.mm:
     25        (WebCore::Page::platformInitialize): Always use the correct
     26        runloop on iOS regardless of which thread this was called on.
     27        (WebCore::Page::addSchedulePair): Update for iOS to use
     28        NSURLConnection loader.
     29        (WebCore::Page::removeSchedulePair): Ditto.
     30
     31        * platform/ios/wak/WebCoreThread.h:
     32        (WebThreadRunLoop): No longer needs to be exported.
     33        (WebThreadNSRunLoop): Export for WebKitLegacy.
     34
     35        * platform/network/ios/QuickLook.mm: Fix header order.
     36        (WebQuickLookHandleAsDelegate): Make delegate objects implement
     37        WebCoreResourceLoaderDelegate protocol.  This unifies the
     38        -clearHandle and -detachHandle methods that were used on iOS and
     39        OS X, respectively.
     40        (-[WebQuickLookHandleAsDelegate clearHandle]): Deleted.
     41        (-[WebQuickLookHandleAsDelegate detachHandle]): Renamed from
     42        -clearHandle.
     43        (WebResourceLoaderQuickLookDelegate): Make delegate objects
     44        implement WebCoreResourceLoaderDelegate protocol.
     45        (-[WebResourceLoaderQuickLookDelegate clearHandle]): Deleted.
     46        (-[WebResourceLoaderQuickLookDelegate detachHandle]): Renamed from
     47        -clearHandle.
     48        (WebCore::QuickLookHandle::~QuickLookHandle): Call
     49        -detachHandle instead of -clearHandle.
     50
     51        * platform/network/mac/ResourceHandleMac.mm:
     52        - Update for iOS to use NSURLConnection loader.
     53
     54        * platform/network/mac/WebCoreResourceHandleAsDelegate.h:
     55        (WebCoreResourceLoaderDelegate): Define new protocol.
     56
     57        * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
     58        (-[WebCoreResourceHandleAsDelegate detachHandle]): Gratuitous
     59        nullptr fix.
     60
     61        * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
     62        (WebCoreResourceHandleAsOperationQueueDelegate): Implement
     63        WebCoreResourceLoaderDelegate protocol.
     64
     65        * platform/spi/cocoa/NSURLDownloadSPI.h: Declare more
     66        NSURDownload SPI to clean up other source files and make
     67        source compile on iOS with NSURLConnection code path.
     68
    1692015-12-31  Andy Estes  <aestes@apple.com>
    270
  • trunk/Source/WebCore/loader/DocumentLoader.h

    r192995 r194472  
    5757#endif
    5858
     59#if PLATFORM(COCOA) && !USE(CFNETWORK)
     60#include <wtf/SchedulePair.h>
     61#endif
     62
    5963namespace WebCore {
    6064
     
    145149        const String& overrideEncoding() const { return m_overrideEncoding; }
    146150
    147 #if PLATFORM(MAC)
     151#if PLATFORM(COCOA) && !USE(CFNETWORK)
    148152        void schedule(SchedulePair&);
    149153        void unschedule(SchedulePair&);
  • trunk/Source/WebCore/loader/ResourceLoader.cpp

    r194419 r194472  
    725725}
    726726
    727 #if PLATFORM(MAC)
     727#if PLATFORM(COCOA) && !USE(CFNETWORK)
    728728
    729729void ResourceLoader::schedule(SchedulePair& pair)
  • trunk/Source/WebCore/loader/ResourceLoader.h

    r189043 r194472  
    141141    void willSwitchToSubstituteResource();
    142142
    143 #if PLATFORM(MAC)
     143#if PLATFORM(COCOA) && !USE(CFNETWORK)
    144144    void schedule(WTF::SchedulePair&);
    145145    void unschedule(WTF::SchedulePair&);
  • trunk/Source/WebCore/loader/mac/DocumentLoaderMac.cpp

    r188486 r194472  
    3434namespace WebCore {
    3535
    36 #if PLATFORM(MAC)
     36#if !USE(CFNETWORK)
    3737
    3838static void scheduleAll(const ResourceLoaderMap& loaders, SchedulePair& pair)
  • trunk/Source/WebCore/page/mac/PageMac.mm

    r191673 r194472  
    3535#import "MainFrame.h"
    3636
     37#if PLATFORM(IOS)
     38#import "WebCoreThread.h"
     39#endif
     40
    3741namespace WebCore {
    3842
    3943void Page::platformInitialize()
    4044{
     45#if PLATFORM(IOS)
    4146#if USE(CFNETWORK)
    42     addSchedulePair(SchedulePair::create([[NSRunLoop currentRunLoop] getCFRunLoop], kCFRunLoopCommonModes));
     47    addSchedulePair(SchedulePair::create(WebThreadRunLoop(), kCFRunLoopCommonModes));
     48#else
     49    addSchedulePair(SchedulePair::create(WebThreadNSRunLoop(), kCFRunLoopCommonModes));
     50#endif // USE(CFNETWORK)
    4351#else
    4452    addSchedulePair(SchedulePair::create([NSRunLoop currentRunLoop], kCFRunLoopCommonModes));
     
    5260    m_scheduledRunLoopPairs->add(pair.ptr());
    5361
    54 #if !PLATFORM(IOS)
     62#if !USE(CFNETWORK)
    5563    for (Frame* frame = m_mainFrame.get(); frame; frame = frame->tree().traverseNext()) {
    5664        if (DocumentLoader* documentLoader = frame->loader().documentLoader())
     
    7280    m_scheduledRunLoopPairs->remove(pair.ptr());
    7381
    74 #if !PLATFORM(IOS)
     82#if !USE(CFNETWORK)
    7583    for (Frame* frame = m_mainFrame.get(); frame; frame = frame->tree().traverseNext()) {
    7684        if (DocumentLoader* documentLoader = frame->loader().documentLoader())
  • trunk/Source/WebCore/platform/ios/wak/WebCoreThread.h

    r179886 r194472  
    8181static inline void WebThreadSetShouldYield() { webThreadShouldYield = true; }
    8282
    83 WEBCORE_EXPORT CFRunLoopRef WebThreadRunLoop(void);
    84 NSRunLoop* WebThreadNSRunLoop(void);
     83CFRunLoopRef WebThreadRunLoop(void);
     84WEBCORE_EXPORT NSRunLoop* WebThreadNSRunLoop(void);
    8585WebThreadContext *WebThreadCurrentContext(void);
    8686bool WebThreadContextIsCurrent(void);
  • trunk/Source/WebCore/platform/network/ios/QuickLook.mm

    r194428 r194472  
    3333#import "Logging.h"
    3434#import "NSFileManagerSPI.h"
    35 #import "QuickLookSoftLink.h"
    3635#import "ResourceError.h"
    3736#import "ResourceHandle.h"
     
    3938#import "RuntimeApplicationChecksIOS.h"
    4039#import "SynchronousResourceHandleCFURLConnectionDelegate.h"
     40#import "WebCoreResourceHandleAsDelegate.h"
    4141#import "WebCoreURLResponseIOS.h"
    4242#import <Foundation/Foundation.h>
     
    4646#import <wtf/Vector.h>
    4747#import <wtf/text/WTFString.h>
     48
     49#import "QuickLookSoftLink.h"
    4850
    4951using namespace WebCore;
     
    194196// So we create WebQuickLookHandleAsDelegate as an intermediate delegate object and pass it to
    195197// QLPreviewConverter. The proxy delegate then forwards the messages on to the CFNetwork code.
    196 @interface WebQuickLookHandleAsDelegate : NSObject <NSURLConnectionDelegate> {
     198@interface WebQuickLookHandleAsDelegate : NSObject <NSURLConnectionDelegate, WebCoreResourceLoaderDelegate> {
    197199    RefPtr<SynchronousResourceHandleCFURLConnectionDelegate> m_connectionDelegate;
    198200}
    199201
    200202- (id)initWithConnectionDelegate:(SynchronousResourceHandleCFURLConnectionDelegate*)connectionDelegate;
    201 - (void)clearHandle;
    202203@end
    203204
     
    253254}
    254255
    255 - (void)clearHandle
     256- (void)detachHandle
    256257{
    257258    m_connectionDelegate = nullptr;
     
    260261#endif
    261262
    262 @interface WebResourceLoaderQuickLookDelegate : NSObject <NSURLConnectionDelegate> {
     263@interface WebResourceLoaderQuickLookDelegate : NSObject <NSURLConnectionDelegate, WebCoreResourceLoaderDelegate> {
    263264    RefPtr<ResourceLoader> _resourceLoader;
    264265    BOOL _hasSentDidReceiveResponse;
     
    351352}
    352353
    353 - (void)clearHandle
     354- (void)detachHandle
    354355{
    355356    _resourceLoader = nullptr;
     
    492493    m_converter = nullptr;
    493494
    494     [m_delegate clearHandle];
     495    [m_delegate detachHandle];
    495496}
    496497
  • trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm

    r194378 r194472  
    315315}
    316316
    317 #if PLATFORM(MAC)
     317#if !USE(CFNETWORK)
    318318
    319319void ResourceHandle::schedule(SchedulePair& pair)
  • trunk/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsDelegate.h

    r146929 r194472  
    2727#define WebCoreResourceHandleAsDelegate_h
    2828
    29 #if !USE(CFNETWORK)
    30 
    3129namespace WebCore {
    3230class ResourceHandle;
    3331}
    3432
    35 @interface WebCoreResourceHandleAsDelegate : NSObject <NSURLConnectionDelegate> {
     33@protocol WebCoreResourceLoaderDelegate
     34- (void)detachHandle;
     35@end
     36
     37#if !USE(CFNETWORK)
     38
     39@interface WebCoreResourceHandleAsDelegate : NSObject <NSURLConnectionDelegate, WebCoreResourceLoaderDelegate> {
    3640    WebCore::ResourceHandle* m_handle;
    3741}
    3842- (id)initWithHandle:(WebCore::ResourceHandle*)handle;
    39 - (void)detachHandle;
    4043@end
    4144
  • trunk/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsDelegate.mm

    r187609 r194472  
    5555- (void)detachHandle
    5656{
    57     m_handle = 0;
     57    m_handle = nullptr;
    5858}
    5959
  • trunk/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h

    r168248 r194472  
    2929#if !USE(CFNETWORK)
    3030
     31#include "WebCoreResourceHandleAsDelegate.h"
    3132#include <dispatch/dispatch.h>
    3233#include <wtf/RetainPtr.h>
     
    3637}
    3738
    38 @interface WebCoreResourceHandleAsOperationQueueDelegate : NSObject <NSURLConnectionDelegate> {
     39@interface WebCoreResourceHandleAsOperationQueueDelegate : NSObject <NSURLConnectionDelegate, WebCoreResourceLoaderDelegate> {
    3940    WebCore::ResourceHandle* m_handle;
    4041
     
    4748
    4849- (id)initWithHandle:(WebCore::ResourceHandle*)handle;
    49 - (void)detachHandle;
    5050- (void)continueWillSendRequest:(NSURLRequest *)newRequest;
    5151- (void)continueDidReceiveResponse;
  • trunk/Source/WebCore/platform/spi/cocoa/NSURLDownloadSPI.h

    r187609 r194472  
    3030#import <Foundation/NSURLDownload.h>
    3131
     32#if USE(APPLE_INTERNAL_SDK)
     33#import <Foundation/NSURLDownloadPrivate.h>
     34#else
     35@interface NSURLDownload ()
     36+(id)_downloadWithLoadingConnection:(NSURLConnection *)connection request:(NSURLRequest *)request response:(NSURLResponse *)response delegate:(id)delegate proxy:(id)proxy;
     37@end
     38#endif
     39
    3240#else
    3341
     
    5765@end
    5866
     67#ifndef WebDownload_h
     68/* Also defined in <WebKit/WebDownload.h>. */
     69@interface NSURLDownload : NSObject
     70@end
     71#endif
     72
    5973@interface NSURLDownload ()
    6074- (instancetype)initWithRequest:(NSURLRequest *)request delegate:(id <NSURLDownloadDelegate>)delegate;
     75- (instancetype)initWithResumeData:(NSData *)resumeData delegate:(id <NSURLDownloadDelegate>)delegate path:(NSString *)path;
     76- (void)cancel;
     77- (void)setDestination:(NSString *)path allowOverwrite:(BOOL)allowOverwrite;
     78@property (readonly, copy) NSURLRequest *request;
     79@property (readonly, copy) NSData *resumeData;
     80@property BOOL deletesFileUponFailure;
     81
     82+(id)_downloadWithLoadingConnection:(NSURLConnection *)connection request:(NSURLRequest *)request response:(NSURLResponse *)response delegate:(id)delegate proxy:(id)proxy;
    6183@end
    6284
  • trunk/Source/WebKit/mac/ChangeLog

    r194463 r194472  
     12015-12-31  David Kilzer  <ddkilzer@apple.com>
     2
     3        Stop using USE(CFNETWORK) path on iOS
     4        https://bugs.webkit.org/show_bug.cgi?id=142540
     5
     6        Step 1/2: Do everything but turn off USE(CFNETWORK) internally.
     7
     8        Original patch by Antti Koivisto <antti@apple.com> on 2015-03-10
     9        Reviewed by Daniel Bates.
     10
     11        * Misc/WebDownload.h: Add header guard to make
     12        NSURLDownloadSPI.h work when pre-declaring NSURLDownload object.
     13        * Misc/WebKitVersionChecks.h: Define
     14        WEBKIT_FIRST_VERSION_WITH_LOADING_DURING_COMMON_RUNLOOP_MODES
     15        for iOS.
     16        * WebView/WebView.mm:
     17        (-[WebView _commonInitializationWithFrameName:groupName:]): Use
     18        the correct runloop on iOS.
     19        * WebView/WebViewPrivate.h:
     20        (-[WebView(WebPendingPublic) scheduleInRunLoop:forMode:]):
     21        (-[WebView(WebPendingPublic) unscheduleFromRunLoop:forMode:]):
     22        - These are available on iOS now.
     23
    1242015-12-31  Simon Fraser  <simon.fraser@apple.com>
    225
  • trunk/Source/WebKit/mac/Misc/WebDownload.h

    r186124 r194472  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
     28
     29#ifndef WebDownload_h
     30#define WebDownload_h
    2831
    2932#if !TARGET_OS_IPHONE || (defined USE_APPLE_INTERNAL_SDK && USE_APPLE_INTERNAL_SDK)
     
    7982
    8083@end
     84
     85#endif /* WebDownload_h */
  • trunk/Source/WebKit/mac/Misc/WebKitVersionChecks.h

    r183023 r194472  
    7373#define WEBKIT_FIRST_VERSION_WITH_YOUTUBE_EMBED_IFRAME_TRANSFORM 2239 // iOS 6.0
    7474#define WEBKIT_FIRST_VERSION_WITHOUT_LEGACY_BACKGROUNDSIZE_SHORTHAND_BEHAVIOR 2665 // iOS 7.0
     75#define WEBKIT_FIRST_VERSION_WITH_LOADING_DURING_COMMON_RUNLOOP_MODES 2665 // iOS 7.0
    7576#define WEBKIT_FIRST_VERSION_WITH_INSECURE_CONTENT_BLOCKING 3454
    7677#endif // PLATFORM(IOS)
  • trunk/Source/WebKit/mac/WebView/WebView.mm

    r194318 r194472  
    10271027    [WebFrame _createMainFrameWithPage:_private->page frameName:frameName frameView:frameView];
    10281028
    1029 #if !PLATFORM(IOS)
     1029#if PLATFORM(IOS)
     1030    NSRunLoop *runLoop = WebThreadNSRunLoop();
     1031#else
    10301032    NSRunLoop *runLoop = [NSRunLoop mainRunLoop];
     1033#endif
    10311034
    10321035    if (WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_LOADING_DURING_COMMON_RUNLOOP_MODES))
     
    10341037    else
    10351038        [self scheduleInRunLoop:runLoop forMode:NSDefaultRunLoopMode];
    1036 #endif
    10371039
    10381040    [self _addToAllWebViewsSet];
     
    66196621@implementation WebView (WebPendingPublic)
    66206622
    6621 #if !PLATFORM(IOS)
    66226623- (void)scheduleInRunLoop:(NSRunLoop *)runLoop forMode:(NSString *)mode
    66236624{
     
    66416642        core(self)->removeSchedulePair(SchedulePair::create(schedulePairRunLoop, (CFStringRef)mode));
    66426643}
    6643 #endif
    66446644
    66456645static BOOL findString(NSView <WebDocumentSearching> *searchView, NSString *string, WebFindOptions options)
  • trunk/Source/WebKit/mac/WebView/WebViewPrivate.h

    r186909 r194472  
    199199@interface WebView (WebPendingPublic)
    200200
    201 #if !TARGET_OS_IPHONE
    202201- (void)scheduleInRunLoop:(NSRunLoop *)runLoop forMode:(NSString *)mode;
    203202- (void)unscheduleFromRunLoop:(NSRunLoop *)runLoop forMode:(NSString *)mode;
    204 #endif
    205203
    206204- (BOOL)findString:(NSString *)string options:(WebFindOptions)options;
  • trunk/Source/WebKit2/ChangeLog

    r194470 r194472  
     12015-12-31  David Kilzer  <ddkilzer@apple.com>
     2
     3        Stop using USE(CFNETWORK) path on iOS
     4        https://bugs.webkit.org/show_bug.cgi?id=142540
     5
     6        Step 1/2: Do everything but turn off USE(CFNETWORK) internally.
     7
     8        Original patch by Antti Koivisto <antti@apple.com> on 2015-03-10
     9        Reviewed by Daniel Bates.
     10
     11        * NetworkProcess/Downloads/ios/DownloadIOS.mm: This is now the
     12        USE(CFNETWORK) && !USE(NETWORK_SESSION) code path.
     13        * NetworkProcess/Downloads/mac/DownloadMac.mm: This is now the
     14        !USE(CFNETWORK) && !USE(NETWORK_SESSION) code path.  Make use of
     15        NSURLDownloadSPI.h.  Ignore a deprecated delcaration warning now
     16        that we're using actual header declarations internally.
     17        * NetworkProcess/NetworkProcess.cpp:
     18        (WebKit::NetworkProcess::initializeNetworkProcess): Update for
     19        iOS to use NSURLConnection loader.
     20
    1212015-12-31  Andy Estes  <aestes@apple.com>
    222
  • trunk/Source/WebKit2/NetworkProcess/Downloads/ios/DownloadIOS.mm

    r194211 r194472  
    2727#import "Download.h"
    2828
    29 #if PLATFORM(IOS) && !USE(NETWORK_SESSION)
     29#if USE(CFNETWORK) && !USE(NETWORK_SESSION)
    3030
    3131#import "DataReference.h"
     32#import <CFNetwork/CFURLDownload.h>
    3233#import <WebCore/NotImplemented.h>
    3334#import <WebCore/ResourceError.h>
     
    3738#import <wtf/RunLoop.h>
    3839
    39 #if USE(CFNETWORK)
    40 #import <CFNetwork/CFURLDownload.h>
    41 #endif
    42 
    4340using namespace WebCore;
    4441
    4542namespace WebKit {
    4643
    47 #if USE(CFNETWORK)
    4844// FIXME: If possible, we should consider moving some callbacks off the main thread or at least
    4945// making them asynchonous calls.
     
    126122    };
    127123}
    128 #endif // USE(CFNETWORK)
    129124
    130125void Download::start()
     
    140135void Download::startWithHandle(ResourceHandle* handle, const ResourceResponse& response)
    141136{
    142 #if USE(CFNETWORK)
    143137    CFURLDownloadClient client;
    144138    setUpDownloadClient(client, *this);
     
    147141    m_download = adoptCF(CFURLDownloadCreateAndStartWithLoadingConnection(NULL, handle->releaseConnectionForDownload().get(), m_request.cfURLRequest(UpdateHTTPBody), response.cfURLResponse(), &client));
    148142#pragma clang diagnostic pop
    149 #else
    150     notImplemented();
    151 #endif
    152143}
    153144
     
    194185} // namespace WebKit
    195186
    196 #endif // PLATFORM(IOS)
     187#endif // USE(CFNETWORK) && !USE(NETWORK_SESSION)
  • trunk/Source/WebKit2/NetworkProcess/Downloads/mac/DownloadMac.mm

    r194211 r194472  
    2727#import "Download.h"
    2828
    29 #if PLATFORM(MAC) && !USE(NETWORK_SESSION)
     29#if !USE(CFNETWORK) && !USE(NETWORK_SESSION)
    3030
    3131#import <WebCore/AuthenticationChallenge.h>
    3232#import <WebCore/AuthenticationMac.h>
     33#import <WebCore/NSURLDownloadSPI.h>
    3334#import <WebCore/NotImplemented.h>
    3435#import <WebCore/ResourceHandle.h>
     
    3839#import "WebPage.h"
    3940
    40 @interface NSURLDownload (WebNSURLDownloadDetails)
    41 +(id)_downloadWithLoadingConnection:(NSURLConnection *)connection
    42                             request:(NSURLRequest *)request
    43                            response:(NSURLResponse *)r
    44                            delegate:(id)delegate
    45                               proxy:(id)proxy;
    46 @end
    47 
    4841@interface WKDownloadAsDelegate : NSObject <NSURLDownloadDelegate> {
    4942    WebKit::Download* _download;
     
    7871
    7972    m_delegate = adoptNS([[WKDownloadAsDelegate alloc] initWithDownload:this]);
     73#pragma clang diagnostic push
     74#pragma clang diagnostic ignored "-Wdeprecated-declarations"
    8075    m_nsURLDownload = [NSURLDownload _downloadWithLoadingConnection:handle->connection()
    8176                                                            request:m_request.nsURLRequest(UpdateHTTPBody)
     
    8378                                                            delegate:m_delegate.get()
    8479                                                               proxy:nil];
     80#pragma clang diagnostic pop
    8581
    8682    // FIXME: Allow this to be changed by the client.
     
    309305@end
    310306
    311 #endif // PLATFORM(MAC) && !USE(NETWORK_SESSION)
     307#endif // !USE(CFNETWORK) && !USE(NETWORK_SESSION)
  • trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp

    r194264 r194472  
    199199    setCanHandleHTTPSServerTrustEvaluation(parameters.canHandleHTTPSServerTrustEvaluation);
    200200
    201 #if PLATFORM(MAC) || USE(CFNETWORK)
     201#if PLATFORM(COCOA) || USE(CFNETWORK)
    202202    SessionTracker::setIdentifierBase(parameters.uiProcessBundleIdentifier);
    203203#endif
Note: See TracChangeset for help on using the changeset viewer.