Changeset 157251 in webkit


Ignore:
Timestamp:
Oct 10, 2013 2:34:45 PM (11 years ago)
Author:
Csaba Osztrogonác
Message:

[WK2] Port RemoteNetworkingContext for Soup
https://bugs.webkit.org/show_bug.cgi?id=110097

Reviewed by Darin Adler.

Original patch by Balazs Kelemen <kbalazs@webkit.org> and Kwang Yul Seo <skyul@company100.net>.

This should be a cross-platform interface so I lifted the header from
the mac directory. Removed mac specific arguments from constructor,
added setters instead. Moved platform things behind ifdefs and added
Soup specific bits.

The following things were fixed by Csaba Osztrogonác:

  • solved conflicts in project.pbxproj
  • removed the change in the non-existent SyncNetworkResourceLoader.cpp
  • marked RemoteNetworkingContext class as FINAL
  • reordered the members for platform specific initialization
  • added initializers to m_needsSiteSpecificQuirks and m_localFileContentSniffingEnabled members on PLATFORM(MAC)
  • NetworkProcess/NetworkResourceLoader.cpp:

(WebKit::NetworkResourceLoader::start):

  • NetworkProcess/RemoteNetworkingContext.h: Renamed from Source/WebKit2/NetworkProcess/mac/RemoteNetworkingContext.h.

(WebKit::RemoteNetworkingContext::create):
(WebKit::RemoteNetworkingContext::RemoteNetworkingContext):
(WebKit::RemoteNetworkingContext::setNeedsSiteSpecificQuirks):
(WebKit::RemoteNetworkingContext::setLocalFileContentSniffingEnabled):

  • NetworkProcess/mac/RemoteNetworkingContext.mm:
  • NetworkProcess/soup/RemoteNetworkingContextSoup.cpp: Added.

(WebKit::RemoteNetworkingContext::~RemoteNetworkingContext):
(WebKit::RemoteNetworkingContext::isValid):
(WebKit::RemoteNetworkingContext::initiatingPageID):
(WebKit::RemoteNetworkingContext::setPrivateBrowsingStorageSessionIdentifierBase):
(WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
(WebKit::RemoteNetworkingContext::destroyPrivateBrowsingSession):
(WebKit::RemoteNetworkingContext::storageSession):
(WebKit::RemoteNetworkingContext::privateBrowsingSession):

  • WebKit2.xcodeproj/project.pbxproj:
Location:
trunk/Source/WebKit2
Files:
2 added
4 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r157248 r157251  
     12013-10-10  Csaba Osztrogonác  <ossy@webkit.org>
     2
     3        [WK2] Port RemoteNetworkingContext for Soup
     4        https://bugs.webkit.org/show_bug.cgi?id=110097
     5
     6        Reviewed by Darin Adler.
     7
     8        Original patch by Balazs Kelemen <kbalazs@webkit.org> and Kwang Yul Seo <skyul@company100.net>.
     9
     10        This should be a cross-platform interface so I lifted the header from
     11        the mac directory. Removed mac specific arguments from constructor,
     12        added setters instead. Moved platform things behind ifdefs and added
     13        Soup specific bits.
     14
     15        The following things were fixed by Csaba Osztrogonác:
     16        - solved conflicts in project.pbxproj
     17        - removed the change in the non-existent SyncNetworkResourceLoader.cpp
     18        - marked RemoteNetworkingContext class as FINAL
     19        - reordered the members for platform specific initialization
     20        - added initializers to m_needsSiteSpecificQuirks and m_localFileContentSniffingEnabled members on PLATFORM(MAC)
     21
     22        * NetworkProcess/NetworkResourceLoader.cpp:
     23        (WebKit::NetworkResourceLoader::start):
     24        * NetworkProcess/RemoteNetworkingContext.h: Renamed from Source/WebKit2/NetworkProcess/mac/RemoteNetworkingContext.h.
     25        (WebKit::RemoteNetworkingContext::create):
     26        (WebKit::RemoteNetworkingContext::RemoteNetworkingContext):
     27        (WebKit::RemoteNetworkingContext::setNeedsSiteSpecificQuirks):
     28        (WebKit::RemoteNetworkingContext::setLocalFileContentSniffingEnabled):
     29        * NetworkProcess/mac/RemoteNetworkingContext.mm:
     30        * NetworkProcess/soup/RemoteNetworkingContextSoup.cpp: Added.
     31        (WebKit::RemoteNetworkingContext::~RemoteNetworkingContext):
     32        (WebKit::RemoteNetworkingContext::isValid):
     33        (WebKit::RemoteNetworkingContext::initiatingPageID):
     34        (WebKit::RemoteNetworkingContext::setPrivateBrowsingStorageSessionIdentifierBase):
     35        (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
     36        (WebKit::RemoteNetworkingContext::destroyPrivateBrowsingSession):
     37        (WebKit::RemoteNetworkingContext::storageSession):
     38        (WebKit::RemoteNetworkingContext::privateBrowsingSession):
     39        * WebKit2.xcodeproj/project.pbxproj:
     40
    1412013-10-10  Sergio Correia  <sergio.correia@openbossa.org>
    242
  • trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp

    r156688 r157251  
    127127    // Explicit ref() balanced by a deref() in NetworkResourceLoader::resourceHandleStopped()
    128128    ref();
    129    
    130     // FIXME (NetworkProcess): Create RemoteNetworkingContext with actual settings.
    131     m_networkingContext = RemoteNetworkingContext::create(false, false, m_inPrivateBrowsingMode, m_shouldClearReferrerOnHTTPSToHTTPRedirect);
     129
     130    // FIXME (NetworkProcess): Set platform specific settings.
     131    m_networkingContext = RemoteNetworkingContext::create(m_inPrivateBrowsingMode, m_shouldClearReferrerOnHTTPSToHTTPRedirect);
    132132
    133133    consumeSandboxExtensions();
  • trunk/Source/WebKit2/NetworkProcess/RemoteNetworkingContext.h

    r157250 r157251  
    11/*
    22 * Copyright (C) 2012 Apple Inc. All rights reserved.
     3 * Copyright (C) 2013 University of Szeged. All rights reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    3132namespace WebKit {
    3233
    33 class RemoteNetworkingContext : public WebCore::NetworkingContext {
     34class RemoteNetworkingContext FINAL : public WebCore::NetworkingContext {
    3435public:
    35     static PassRefPtr<RemoteNetworkingContext> create(bool needsSiteSpecificQuirks, bool localFileContentSniffingEnabled, bool privateBrowsingEnabled, bool shouldClearReferrerOnHTTPSToHTTPRedirect)
     36    static PassRefPtr<RemoteNetworkingContext> create(bool privateBrowsingEnabled, bool shouldClearReferrerOnHTTPSToHTTPRedirect)
    3637    {
    37         return adoptRef(new RemoteNetworkingContext(needsSiteSpecificQuirks, localFileContentSniffingEnabled, privateBrowsingEnabled, shouldClearReferrerOnHTTPSToHTTPRedirect));
     38        return adoptRef(new RemoteNetworkingContext(privateBrowsingEnabled, shouldClearReferrerOnHTTPSToHTTPRedirect));
    3839    }
    3940    virtual ~RemoteNetworkingContext();
     
    4546    static WebCore::NetworkStorageSession* privateBrowsingSession();
    4647
    47     virtual bool shouldClearReferrerOnHTTPSToHTTPRedirect() const OVERRIDE;
     48    virtual bool shouldClearReferrerOnHTTPSToHTTPRedirect() const OVERRIDE { return m_shouldClearReferrerOnHTTPSToHTTPRedirect; }
    4849
    4950private:
    50     RemoteNetworkingContext(bool needsSiteSpecificQuirks, bool localFileContentSniffingEnabled, bool privateBrowsingEnabled, bool m_shouldClearReferrerOnHTTPSToHTTPRedirect);
     51    RemoteNetworkingContext(bool privateBrowsingEnabled, bool shouldClearReferrerOnHTTPSToHTTPRedirect)
     52        : m_privateBrowsingEnabled(privateBrowsingEnabled)
     53        , m_shouldClearReferrerOnHTTPSToHTTPRedirect(shouldClearReferrerOnHTTPSToHTTPRedirect)
     54#if PLATFORM(MAC)
     55        , m_needsSiteSpecificQuirks(false)
     56        , m_localFileContentSniffingEnabled(false)
     57#endif
     58    { }
    5159
    5260    virtual bool isValid() const OVERRIDE;
     61    virtual WebCore::NetworkStorageSession& storageSession() const OVERRIDE;
    5362
     63#if PLATFORM(MAC)
     64    void setNeedsSiteSpecificQuirks(bool value) { m_needsSiteSpecificQuirks = value; }
    5465    virtual bool needsSiteSpecificQuirks() const OVERRIDE;
     66    void setLocalFileContentSniffingEnabled(bool value) { m_localFileContentSniffingEnabled = value; }
    5567    virtual bool localFileContentSniffingEnabled() const OVERRIDE;
    56     virtual WebCore::NetworkStorageSession& storageSession() const OVERRIDE;
    5768    virtual RetainPtr<CFDataRef> sourceApplicationAuditData() const OVERRIDE;
    5869    virtual WebCore::ResourceError blockedError(const WebCore::ResourceRequest&) const OVERRIDE;
     70#endif
    5971
     72#if USE(SOUP)
     73    virtual uint64_t initiatingPageID() const;
     74#endif
     75
     76    bool m_privateBrowsingEnabled;
     77    bool m_shouldClearReferrerOnHTTPSToHTTPRedirect;
     78
     79#if PLATFORM(MAC)
    6080    bool m_needsSiteSpecificQuirks;
    6181    bool m_localFileContentSniffingEnabled;
    62     bool m_privateBrowsingEnabled;
    63     bool m_shouldClearReferrerOnHTTPSToHTTPRedirect;
     82#endif
    6483};
    6584
  • trunk/Source/WebKit2/NetworkProcess/mac/RemoteNetworkingContext.mm

    r156690 r157251  
    4343    DEFINE_STATIC_LOCAL(OwnPtr<NetworkStorageSession>, session, ());
    4444    return session;
    45 }
    46 
    47 bool RemoteNetworkingContext::shouldClearReferrerOnHTTPSToHTTPRedirect() const
    48 {
    49     return m_shouldClearReferrerOnHTTPSToHTTPRedirect;
    50 }
    51 
    52 RemoteNetworkingContext::RemoteNetworkingContext(bool needsSiteSpecificQuirks, bool localFileContentSniffingEnabled, bool privateBrowsingEnabled, bool shouldClearReferrerOnHTTPSToHTTPRedirect)
    53     : m_needsSiteSpecificQuirks(needsSiteSpecificQuirks)
    54     , m_localFileContentSniffingEnabled(localFileContentSniffingEnabled)
    55     , m_privateBrowsingEnabled(privateBrowsingEnabled)
    56     , m_shouldClearReferrerOnHTTPSToHTTPRedirect(shouldClearReferrerOnHTTPSToHTTPRedirect)
    57 {
    5845}
    5946
  • trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj

    r156877 r157251  
    25762576                E1AEA22D14687BDB00804569 /* WKFullKeyboardAccessWatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKFullKeyboardAccessWatcher.h; sourceTree = "<group>"; };
    25772577                E1AEA22E14687BDB00804569 /* WKFullKeyboardAccessWatcher.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKFullKeyboardAccessWatcher.mm; sourceTree = "<group>"; };
    2578                 E1B78470163F24690007B692 /* RemoteNetworkingContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteNetworkingContext.h; sourceTree = "<group>"; };
     2578                E1B78470163F24690007B692 /* RemoteNetworkingContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RemoteNetworkingContext.h; path = NetworkProcess/RemoteNetworkingContext.h; sourceTree = "<group>"; };
    25792579                E1B78472163F253E0007B692 /* RemoteNetworkingContext.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RemoteNetworkingContext.mm; sourceTree = "<group>"; };
    25802580                E1CC1B8E12D7EADF00625838 /* PrintInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PrintInfo.h; sourceTree = "<group>"; };
     
    34713471                                51829DA31637C70C000953D6 /* NetworkResourceLoadScheduler.cpp */,
    34723472                                51829DA41637C70C000953D6 /* NetworkResourceLoadScheduler.h */,
     3473                                E1B78470163F24690007B692 /* RemoteNetworkingContext.h */,
    34733474                                51FCB18317BBFE0300394CD8 /* SynchronousNetworkLoaderClient.cpp */,
    34743475                                51FCB18417BBFE0300394CD8 /* SynchronousNetworkLoaderClient.h */,
     
    34863487                                51E3B67E16F266B3009968DC /* NetworkResourceLoaderMac.mm */,
    34873488                                512C068F16390E6900ABB911 /* NetworkResourceLoadSchedulerMac.mm */,
    3488                                 E1B78470163F24690007B692 /* RemoteNetworkingContext.h */,
    34893489                                E1B78472163F253E0007B692 /* RemoteNetworkingContext.mm */,
    34903490                        );
Note: See TracChangeset for help on using the changeset viewer.