Changeset 228567 in webkit


Ignore:
Timestamp:
Feb 16, 2018 11:34:12 AM (6 years ago)
Author:
commit-queue@webkit.org
Message:

[WinCario] Add NetworkSessionCurl
https://bugs.webkit.org/show_bug.cgi?id=182680

Patch by Yousuke Kimoto <yousuke.kimoto@sony.com> on 2018-02-16
Reviewed by Konstantin Tokarev.

  • NetworkProcess/NetworkSession.cpp:

(WebKit::NetworkSession::create):

  • PlatformWin.cmake:
Location:
trunk/Source/WebKit
Files:
3 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r228564 r228567  
     12018-02-16  Yousuke Kimoto  <yousuke.kimoto@sony.com>
     2
     3        [WinCario] Add NetworkSessionCurl
     4        https://bugs.webkit.org/show_bug.cgi?id=182680
     5
     6        Reviewed by Konstantin Tokarev.
     7
     8        * NetworkProcess/NetworkSession.cpp:
     9        (WebKit::NetworkSession::create):
     10        * PlatformWin.cmake:
     11
    1122018-02-16  Chris Dumez  <cdumez@apple.com>
    213
  • trunk/Source/WebKit/NetworkProcess/NetworkSession.cpp

    r227364 r228567  
    3838#include "NetworkSessionSoup.h"
    3939#endif
     40#if USE(CURL)
     41#include "NetworkSessionCurl.h"
     42#endif
    4043
    4144
     
    5154#if USE(SOUP)
    5255    return NetworkSessionSoup::create(WTFMove(parameters));
     56#endif
     57#if USE(CURL)
     58    return NetworkSessionCurl::create(WTFMove(parameters));
    5359#endif
    5460}
  • trunk/Source/WebKit/NetworkProcess/curl/NetworkSessionCurl.cpp

    r228566 r228567  
    11/*
    2  * Copyright (C) 2015 Apple Inc. All rights reserved.
     2 * Copyright (C) 2018 Sony Interactive Entertainment Inc.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2525
    2626#include "config.h"
    27 #include "NetworkSession.h"
     27#include "NetworkSessionCurl.h"
    2828
    29 #include "NetworkDataTask.h"
    30 #include <WebCore/NetworkStorageSession.h>
    31 #include <wtf/MainThread.h>
    32 #include <wtf/RunLoop.h>
    33 
    34 #if PLATFORM(COCOA)
    35 #include "NetworkSessionCocoa.h"
    36 #endif
    37 #if USE(SOUP)
    38 #include "NetworkSessionSoup.h"
    39 #endif
    40 
     29#include "NetworkSessionCreationParameters.h"
    4130
    4231using namespace WebCore;
     
    4433namespace WebKit {
    4534
    46 Ref<NetworkSession> NetworkSession::create(NetworkSessionCreationParameters&& parameters)
     35NetworkSessionCurl::NetworkSessionCurl(NetworkSessionCreationParameters&& parameters)
     36    : NetworkSession(parameters.sessionID)
    4737{
    48 #if PLATFORM(COCOA)
    49     return NetworkSessionCocoa::create(WTFMove(parameters));
    50 #endif
    51 #if USE(SOUP)
    52     return NetworkSessionSoup::create(WTFMove(parameters));
    53 #endif
     38
    5439}
    5540
    56 NetworkStorageSession& NetworkSession::networkStorageSession() const
     41NetworkSessionCurl::~NetworkSessionCurl()
    5742{
    58     auto* storageSession = NetworkStorageSession::storageSession(m_sessionID);
    59     RELEASE_ASSERT(storageSession);
    60     return *storageSession;
    61 }
    6243
    63 NetworkSession::NetworkSession(PAL::SessionID sessionID)
    64     : m_sessionID(sessionID)
    65 {
    66 }
    67 
    68 NetworkSession::~NetworkSession()
    69 {
    70 }
    71 
    72 void NetworkSession::invalidateAndCancel()
    73 {
    74     for (auto* task : m_dataTaskSet)
    75         task->invalidateAndCancel();
    76 }
    77 
    78 bool NetworkSession::allowsSpecificHTTPSCertificateForHost(const WebCore::AuthenticationChallenge& challenge)
    79 {
    80 #if PLATFORM(COCOA)
    81     return NetworkSessionCocoa::allowsSpecificHTTPSCertificateForHost(challenge);
    82 #else
    83     return false;
    84 #endif
    8544}
    8645
  • trunk/Source/WebKit/NetworkProcess/curl/NetworkSessionCurl.h

    r228566 r228567  
    11/*
    2  * Copyright (C) 2015 Apple Inc. All rights reserved.
     2 * Copyright (C) 2018 Sony Interactive Entertainment Inc.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #include "config.h"
     26#pragma once
     27
    2728#include "NetworkSession.h"
    28 
    29 #include "NetworkDataTask.h"
    30 #include <WebCore/NetworkStorageSession.h>
    31 #include <wtf/MainThread.h>
    32 #include <wtf/RunLoop.h>
    33 
    34 #if PLATFORM(COCOA)
    35 #include "NetworkSessionCocoa.h"
    36 #endif
    37 #if USE(SOUP)
    38 #include "NetworkSessionSoup.h"
    39 #endif
    40 
    41 
    42 using namespace WebCore;
    4329
    4430namespace WebKit {
    4531
    46 Ref<NetworkSession> NetworkSession::create(NetworkSessionCreationParameters&& parameters)
    47 {
    48 #if PLATFORM(COCOA)
    49     return NetworkSessionCocoa::create(WTFMove(parameters));
    50 #endif
    51 #if USE(SOUP)
    52     return NetworkSessionSoup::create(WTFMove(parameters));
    53 #endif
    54 }
     32struct NetworkSessionCreationParameters;
    5533
    56 NetworkStorageSession& NetworkSession::networkStorageSession() const
    57 {
    58     auto* storageSession = NetworkStorageSession::storageSession(m_sessionID);
    59     RELEASE_ASSERT(storageSession);
    60     return *storageSession;
    61 }
     34class NetworkSessionCurl final : public NetworkSession {
     35public:
     36    static Ref<NetworkSession> create(NetworkSessionCreationParameters&& parameters)
     37    {
     38        return adoptRef(*new NetworkSessionCurl(WTFMove(parameters)));
     39    }
     40    ~NetworkSessionCurl();
    6241
    63 NetworkSession::NetworkSession(PAL::SessionID sessionID)
    64     : m_sessionID(sessionID)
    65 {
    66 }
    67 
    68 NetworkSession::~NetworkSession()
    69 {
    70 }
    71 
    72 void NetworkSession::invalidateAndCancel()
    73 {
    74     for (auto* task : m_dataTaskSet)
    75         task->invalidateAndCancel();
    76 }
    77 
    78 bool NetworkSession::allowsSpecificHTTPSCertificateForHost(const WebCore::AuthenticationChallenge& challenge)
    79 {
    80 #if PLATFORM(COCOA)
    81     return NetworkSessionCocoa::allowsSpecificHTTPSCertificateForHost(challenge);
    82 #else
    83     return false;
    84 #endif
    85 }
     42private:
     43    NetworkSessionCurl(NetworkSessionCreationParameters&&);
     44};
    8645
    8746} // namespace WebKit
  • trunk/Source/WebKit/PlatformWin.cmake

    r228369 r228567  
    125125
    126126    list(APPEND WebKit_INCLUDE_DIRECTORIES
    127         "${WEBKIT_DIR}/UIProcess/WebCoreSupport/curl"
     127        "${WEBKIT_DIR}/NetworkProcess/curl"
     128        "${WEBKIT_DIR}/WebProcess/WebCoreSupport/curl"
    128129    )
    129130
Note: See TracChangeset for help on using the changeset viewer.