Commit 0a504439 authored by psolanki@apple.com's avatar psolanki@apple.com

2011-05-12 Pratik Solanki <psolanki@apple.com>

        Reviewed by Antti Koivisto.

        Part of WebCore should use CFNetwork-based loader on Mac
        https://bugs.webkit.org/show_bug.cgi?id=51836

        Implement ResourceHandle::schedule()/unschedule() based on CF for Mac.

        * WebCore.exp.in:
        * platform/cf/SchedulePair.h:
        * platform/mac/SchedulePairMac.mm:
        * platform/network/cf/ResourceHandleCFNet.cpp:
        (WebCore::ResourceHandle::schedule):
        (WebCore::ResourceHandle::unschedule):
2011-05-12  Pratik Solanki  <psolanki@apple.com>

        Reviewed by Antti Koivisto.

        Part of WebCore should use CFNetwork-based loader on Mac
        https://bugs.webkit.org/show_bug.cgi?id=51836

        Use CFRunLoop when using CFNetwork.

        * WebView/WebView.mm:
        (-[WebView scheduleInRunLoop:forMode:]):
        (-[WebView unscheduleFromRunLoop:forMode:]):
2011-05-12  Pratik Solanki  <psolanki@apple.com>

        Reviewed by Antti Koivisto.

        Part of WebCore should use CFNetwork-based loader on Mac
        https://bugs.webkit.org/show_bug.cgi?id=51836

        Use CFRunLoop when using CFNetwork.

        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::platformInitialize):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@86415 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 7c5455c6
2011-05-12 Pratik Solanki <psolanki@apple.com>
Reviewed by Antti Koivisto.
Part of WebCore should use CFNetwork-based loader on Mac
https://bugs.webkit.org/show_bug.cgi?id=51836
Implement ResourceHandle::schedule()/unschedule() based on CF for Mac.
* WebCore.exp.in:
* platform/cf/SchedulePair.h:
* platform/mac/SchedulePairMac.mm:
* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::ResourceHandle::schedule):
(WebCore::ResourceHandle::unschedule):
2011-05-12 Pratik Solanki <psolanki@apple.com>
Reviewed by Antti Koivisto.
......@@ -283,7 +283,6 @@ __ZN7WebCore12RenderObject16repaintRectangleERKNS_7IntRectEb
__ZN7WebCore12RenderWidget19showSubstituteImageEN3WTF10PassRefPtrINS_5ImageEEE
__ZN7WebCore12RenderWidget28resumeWidgetHierarchyUpdatesEv
__ZN7WebCore12RenderWidget29suspendWidgetHierarchyUpdatesEv
__ZN7WebCore12SchedulePairC1EP9NSRunLoopPK10__CFString
__ZN7WebCore12SharedBuffer10wrapNSDataEP6NSData
__ZN7WebCore12SharedBuffer12createNSDataEv
__ZN7WebCore12SharedBuffer24createWithContentsOfFileERKN3WTF6StringE
......@@ -1873,3 +1872,9 @@ __ZN7WebCore14ResourceHandle29privateBrowsingStorageSessionEv
#if USE(AVFOUNDATION)
__ZN7WebCore8Settings20gAVFoundationEnabledE
#endif
#if USE(CFNETWORK)
__ZN7WebCore12SchedulePairC1EP11__CFRunLoopPK10__CFString
#else
__ZN7WebCore12SchedulePairC1EP9NSRunLoopPK10__CFString
#endif
......@@ -47,7 +47,7 @@ class SchedulePair : public RefCounted<SchedulePair> {
public:
static PassRefPtr<SchedulePair> create(CFRunLoopRef runLoop, CFStringRef mode) { return adoptRef(new SchedulePair(runLoop, mode)); }
#if PLATFORM(MAC)
#if PLATFORM(MAC) && !USE(CFNETWORK)
static PassRefPtr<SchedulePair> create(NSRunLoop* runLoop, CFStringRef mode) { return adoptRef(new SchedulePair(runLoop, mode)); }
NSRunLoop* nsRunLoop() const { return m_nsRunLoop.get(); }
#endif
......@@ -60,7 +60,7 @@ public:
private:
SchedulePair(CFRunLoopRef, CFStringRef);
#if PLATFORM(MAC)
#if PLATFORM(MAC) && !USE(CFNETWORK)
SchedulePair(NSRunLoop*, CFStringRef);
RetainPtr<NSRunLoop*> m_nsRunLoop;
#endif
......
......@@ -30,6 +30,8 @@
#include "SchedulePair.h"
#if !USE(CFNETWORK)
namespace WebCore {
SchedulePair::SchedulePair(NSRunLoop* runLoop, CFStringRef mode)
......@@ -41,3 +43,5 @@ SchedulePair::SchedulePair(NSRunLoop* runLoop, CFStringRef mode)
}
} // namespace
#endif
......@@ -777,6 +777,30 @@ CFURLStorageSessionRef ResourceHandle::defaultStorageSession()
#endif // USE(CFURLSTORAGESESSIONS)
#if PLATFORM(MAC)
void ResourceHandle::schedule(SchedulePair* pair)
{
CFRunLoopRef runLoop = pair->runLoop();
if (!runLoop)
return;
CFURLConnectionScheduleWithRunLoop(d->m_connection.get(), runLoop, pair->mode());
if (d->m_startWhenScheduled) {
CFURLConnectionStart(d->m_connection.get());
d->m_startWhenScheduled = false;
}
}
void ResourceHandle::unschedule(SchedulePair* pair)
{
CFRunLoopRef runLoop = pair->runLoop();
if (!runLoop)
return;
CFURLConnectionUnscheduleFromRunLoop(d->m_connection.get(), runLoop, pair->mode());
}
#endif
void WebCoreSynchronousLoaderClient::willSendRequest(ResourceHandle* handle, ResourceRequest& request, const ResourceResponse& /*redirectResponse*/)
{
// FIXME: This needs to be fixed to follow the redirect correctly even for cross-domain requests.
......
2011-05-12 Pratik Solanki <psolanki@apple.com>
Reviewed by Antti Koivisto.
Part of WebCore should use CFNetwork-based loader on Mac
https://bugs.webkit.org/show_bug.cgi?id=51836
Use CFRunLoop when using CFNetwork.
* WebView/WebView.mm:
(-[WebView scheduleInRunLoop:forMode:]):
(-[WebView unscheduleFromRunLoop:forMode:]):
2011-05-12 Pratik Solanki <psolanki@apple.com>
Reviewed by Antti Koivisto.
......
......@@ -4473,14 +4473,24 @@ static WebFrame *incrementFrame(WebFrame *frame, WebFindOptions options = 0)
- (void)scheduleInRunLoop:(NSRunLoop *)runLoop forMode:(NSString *)mode
{
#if USE(CFNETWORK)
CFRunLoopRef schedulePairRunLoop = [runLoop getCFRunLoop];
#else
NSRunLoop *schedulePairRunLoop = runLoop;
#endif
if (runLoop && mode)
core(self)->addSchedulePair(SchedulePair::create(runLoop, (CFStringRef)mode));
core(self)->addSchedulePair(SchedulePair::create(schedulePairRunLoop, (CFStringRef)mode));
}
- (void)unscheduleFromRunLoop:(NSRunLoop *)runLoop forMode:(NSString *)mode
{
#if USE(CFNETWORK)
CFRunLoopRef schedulePairRunLoop = [runLoop getCFRunLoop];
#else
NSRunLoop *schedulePairRunLoop = runLoop;
#endif
if (runLoop && mode)
core(self)->removeSchedulePair(SchedulePair::create(runLoop, (CFStringRef)mode));
core(self)->removeSchedulePair(SchedulePair::create(schedulePairRunLoop, (CFStringRef)mode));
}
static BOOL findString(NSView <WebDocumentSearching> *searchView, NSString *string, WebFindOptions options)
......
2011-05-12 Pratik Solanki <psolanki@apple.com>
Reviewed by Antti Koivisto.
Part of WebCore should use CFNetwork-based loader on Mac
https://bugs.webkit.org/show_bug.cgi?id=51836
Use CFRunLoop when using CFNetwork.
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::platformInitialize):
2011-05-12 Sam Weinig <sam@webkit.org>
Reviewed by Gavin Barraclough.
......
......@@ -63,7 +63,11 @@ static PassRefPtr<Range> convertToRange(Frame*, NSRange);
void WebPage::platformInitialize()
{
#if USE(CFNETWORK)
m_page->addSchedulePair(SchedulePair::create([[NSRunLoop currentRunLoop] getCFRunLoop], kCFRunLoopCommonModes));
#else
m_page->addSchedulePair(SchedulePair::create([NSRunLoop currentRunLoop], kCFRunLoopCommonModes));
#endif
AccessibilityWebPageObject* mockAccessibilityElement = [[[AccessibilityWebPageObject alloc] init] autorelease];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment