Changeset 70687 in webkit


Ignore:
Timestamp:
Oct 27, 2010 12:21:41 PM (14 years ago)
Author:
andersca@apple.com
Message:

Begin stubbing out the Download class
https://bugs.webkit.org/show_bug.cgi?id=48447

Reviewed by Adam Roben.

  • WebKit2.pro:
  • WebKit2.xcodeproj/project.pbxproj:

Add new files.

  • WebKit2Prefix.h:

Include WebCore/EmptyProtocolDefinitions.h

  • WebProcess/Downloads/Download.cpp: Added.
  • WebProcess/Downloads/Download.h: Added.
  • WebProcess/Downloads/DownloadManager.cpp:

(WebKit::DownloadManager::startDownload):
Create a Download object and start it.

  • WebProcess/Downloads/mac/DownloadMac.mm: Added.

(WebKit::Download::start):
Create an NSURLDownload.

  • WebProcess/WebPage/WebFrame.cpp:

(WebKit::WebFrame::startDownload):
Ask the download manager to start downloading.

  • win/WebKit2.vcproj:
  • win/WebKit2Common.vsprops:

Add new files.

Location:
trunk/WebKit2
Files:
4 added
9 edited
4 copied

Legend:

Unmodified
Added
Removed
  • trunk/WebKit2/ChangeLog

    r70685 r70687  
     12010-10-27  Anders Carlsson  <andersca@apple.com>
     2
     3        Reviewed by Adam Roben.
     4
     5        Begin stubbing out the Download class
     6        https://bugs.webkit.org/show_bug.cgi?id=48447
     7
     8        * WebKit2.pro:
     9        * WebKit2.xcodeproj/project.pbxproj:
     10        Add new files.
     11       
     12        * WebKit2Prefix.h:
     13        Include WebCore/EmptyProtocolDefinitions.h
     14       
     15        * WebProcess/Downloads/Download.cpp: Added.
     16        * WebProcess/Downloads/Download.h: Added.
     17
     18        * WebProcess/Downloads/DownloadManager.cpp:
     19        (WebKit::DownloadManager::startDownload):
     20        Create a Download object and start it.
     21
     22        * WebProcess/Downloads/mac/DownloadMac.mm: Added.
     23        (WebKit::Download::start):
     24        Create an NSURLDownload.
     25   
     26        * WebProcess/WebPage/WebFrame.cpp:
     27        (WebKit::WebFrame::startDownload):
     28        Ask the download manager to start downloading.
     29
     30        * win/WebKit2.vcproj:
     31        * win/WebKit2Common.vsprops:
     32        Add new files.
     33
    1342010-10-27  Adam Roben  <aroben@apple.com>
    235
  • trunk/WebKit2/WebKit2.pro

    r70659 r70687  
    285285    UIProcess/qt/WebPopupMenuProxyQt.h \
    286286    WebProcess/Downloads/DownloadManager.h \
     287    WebProcess/Downloads/Download.h \
    287288    WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.h \
    288289    WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.h \
     
    431432    UIProcess/WebProcessProxy.cpp \
    432433    UIProcess/WebUIClient.cpp \
     434    WebProcess/Downloads/Download.cpp \
    433435    WebProcess/Downloads/DownloadManager.cpp \
     436    WebProcess/Downloads/qt/DownloadQt.cpp \
    434437    WebProcess/InjectedBundle/API/c/WKBundle.cpp \
    435438    WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp \
  • trunk/WebKit2/WebKit2.xcodeproj/project.pbxproj

    r70659 r70687  
    9292                1A61614F127798B5003ACD86 /* DownloadManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A61614D127798B5003ACD86 /* DownloadManager.cpp */; };
    9393                1A616150127798B5003ACD86 /* DownloadManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A61614E127798B5003ACD86 /* DownloadManager.h */; };
     94                1A6161D41278981C003ACD86 /* Download.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A6161D21278981C003ACD86 /* Download.h */; };
     95                1A6161D51278981C003ACD86 /* Download.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6161D31278981C003ACD86 /* Download.cpp */; };
     96                1A61639612789B2F003ACD86 /* DownloadMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A61639512789B2F003ACD86 /* DownloadMac.mm */; };
    9497                1A6F9F9011E13EFC00DB1371 /* CommandLine.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A6F9F8E11E13EFC00DB1371 /* CommandLine.h */; };
    9598                1A6F9FB711E1408500DB1371 /* CommandLineMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6F9FB611E1408500DB1371 /* CommandLineMac.cpp */; };
     
    571574                1A61614D127798B5003ACD86 /* DownloadManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DownloadManager.cpp; sourceTree = "<group>"; };
    572575                1A61614E127798B5003ACD86 /* DownloadManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DownloadManager.h; sourceTree = "<group>"; };
     576                1A6161D21278981C003ACD86 /* Download.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Download.h; sourceTree = "<group>"; };
     577                1A6161D31278981C003ACD86 /* Download.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Download.cpp; sourceTree = "<group>"; };
     578                1A61639512789B2F003ACD86 /* DownloadMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DownloadMac.mm; sourceTree = "<group>"; };
    573579                1A6F9F8E11E13EFC00DB1371 /* CommandLine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommandLine.h; sourceTree = "<group>"; };
    574580                1A6F9FB611E1408500DB1371 /* CommandLineMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CommandLineMac.cpp; sourceTree = "<group>"; };
     
    11141120                        isa = PBXGroup;
    11151121                        children = (
     1122                                1A61639412789B2F003ACD86 /* mac */,
     1123                                1A6161D31278981C003ACD86 /* Download.cpp */,
     1124                                1A6161D21278981C003ACD86 /* Download.h */,
    11161125                                1A61614D127798B5003ACD86 /* DownloadManager.cpp */,
    11171126                                1A61614E127798B5003ACD86 /* DownloadManager.h */,
    11181127                        );
    11191128                        path = Downloads;
     1129                        sourceTree = "<group>";
     1130                };
     1131                1A61639412789B2F003ACD86 /* mac */ = {
     1132                        isa = PBXGroup;
     1133                        children = (
     1134                                1A61639512789B2F003ACD86 /* DownloadMac.mm */,
     1135                        );
     1136                        path = mac;
    11201137                        sourceTree = "<group>";
    11211138                };
     
    21292146                                1C8E293912761E5B00BC7BD0 /* WKInspector.h in Headers */,
    21302147                                1A616150127798B5003ACD86 /* DownloadManager.h in Headers */,
     2148                                1A6161D41278981C003ACD86 /* Download.h in Headers */,
    21312149                        );
    21322150                        runOnlyForDeploymentPostprocessing = 0;
     
    24432461                                1C8E293A12761E5B00BC7BD0 /* WKInspector.cpp in Sources */,
    24442462                                1A61614F127798B5003ACD86 /* DownloadManager.cpp in Sources */,
     2463                                1A6161D51278981C003ACD86 /* Download.cpp in Sources */,
     2464                                1A61639612789B2F003ACD86 /* DownloadMac.mm in Sources */,
    24452465                        );
    24462466                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/WebKit2/WebKit2Prefix.h

    r70544 r70687  
    7777#define WEBKIT_EXPORTDATA
    7878
     79#include <WebCore/EmptyProtocolDefinitions.h>
     80
    7981#elif defined(WIN32) || defined(_WIN32)
    8082
  • trunk/WebKit2/WebProcess/Downloads/Download.cpp

    r70686 r70687  
    2424 */
    2525
    26 #include "DownloadManager.h"
     26#include "Download.h"
    2727
    28 #include <wtf/StdLibExtras.h>
     28using namespace WebCore;
    2929
    3030namespace WebKit {
    3131
    32 DownloadManager& DownloadManager::shared()
     32PassOwnPtr<Download> Download::create(uint64_t downloadID, const ResourceRequest& request)
    3333{
    34     DEFINE_STATIC_LOCAL(DownloadManager, downloadManager, ());
    35     return downloadManager;
     34    return adoptPtr(new Download(downloadID, request));
    3635}
    3736
    38 DownloadManager::DownloadManager()
     37Download::Download(uint64_t downloadID, const ResourceRequest& request)
     38    : m_downloadID(downloadID)
     39    , m_request(request)
     40{
     41    ASSERT(m_downloadID);
     42}
     43
     44Download::~Download()
    3945{
    4046}
  • trunk/WebKit2/WebProcess/Downloads/Download.h

    r70686 r70687  
    2424 */
    2525
    26 #ifndef DownloadManager_h
    27 #define DownloadManager_h
     26#ifndef Download_h
     27#define Download_h
    2828
     29#if PLATFORM(MAC)
     30#include <wtf/RetainPtr.h>
     31#ifdef __OBJC__
     32@class NSURLDownload;
     33@class WKDownloadAsDelegate;
     34#else
     35class NSURLDownload;
     36class WKDownloadAsDelegate;
     37#endif
     38#endif
     39
     40#include <WebCore/ResourceRequest.h>
    2941#include <wtf/Noncopyable.h>
     42#include <wtf/PassOwnPtr.h>
    3043
    3144namespace WebKit {
    3245
    33 class DownloadManager {
    34     WTF_MAKE_NONCOPYABLE(DownloadManager);
     46class Download {
     47    WTF_MAKE_NONCOPYABLE(Download);
    3548
    3649public:
    37     static DownloadManager& shared();
     50    static PassOwnPtr<Download> create(uint64_t downloadID, const WebCore::ResourceRequest&);
     51    ~Download();
     52
     53    void start();
    3854
    3955private:
    40     DownloadManager();
     56    Download(uint64_t downloadID, const WebCore::ResourceRequest&);
    4157
     58    uint64_t m_downloadID;
     59    WebCore::ResourceRequest m_request;
     60
     61#if PLATFORM(MAC)
     62    RetainPtr<NSURLDownload> m_nsURLDownload;
     63    RetainPtr<WKDownloadAsDelegate> m_delegate;
     64#endif
    4265};
    4366
    4467} // namespace WebKit
    4568
    46 #endif // DownloadManager_h
     69#endif // Download_h
  • trunk/WebKit2/WebProcess/Downloads/DownloadManager.cpp

    r70659 r70687  
    2626#include "DownloadManager.h"
    2727
     28#include "Download.h"
     29#include "NotImplemented.h"
    2830#include <wtf/StdLibExtras.h>
     31
     32using namespace WebCore;
    2933
    3034namespace WebKit {
     
    4044}
    4145
     46void DownloadManager::startDownload(uint64_t downloadID, const ResourceRequest& request)
     47{
     48    // FIXME: Implement.
     49    notImplemented();
     50}
     51
    4252} // namespace WebKit
  • trunk/WebKit2/WebProcess/Downloads/DownloadManager.h

    r70659 r70687  
    2929#include <wtf/Noncopyable.h>
    3030
     31namespace WebCore {
     32    class ResourceRequest;
     33}
     34
    3135namespace WebKit {
    3236
     
    3640public:
    3741    static DownloadManager& shared();
     42
     43    void startDownload(uint64_t downloadID, const WebCore::ResourceRequest&);
    3844
    3945private:
  • trunk/WebKit2/WebProcess/Downloads/cf/DownloadCFNet.cpp

    r70686 r70687  
    2424 */
    2525
    26 #include "DownloadManager.h"
     26#include "Download.h"
    2727
    28 #include <wtf/StdLibExtras.h>
     28#include "NotImplemented.h"
     29
     30using namespace WebCore;
    2931
    3032namespace WebKit {
    3133
    32 DownloadManager& DownloadManager::shared()
     34void Download::start()
    3335{
    34     DEFINE_STATIC_LOCAL(DownloadManager, downloadManager, ());
    35     return downloadManager;
    36 }
    37 
    38 DownloadManager::DownloadManager()
    39 {
     36    notImplemented();
    4037}
    4138
  • trunk/WebKit2/WebProcess/Downloads/qt/DownloadQt.cpp

    r70686 r70687  
    2424 */
    2525
    26 #include "DownloadManager.h"
     26#include "Download.h"
    2727
    28 #include <wtf/StdLibExtras.h>
     28#include "NotImplemented.h"
     29
     30using namespace WebCore;
    2931
    3032namespace WebKit {
    3133
    32 DownloadManager& DownloadManager::shared()
     34void Download::start()
    3335{
    34     DEFINE_STATIC_LOCAL(DownloadManager, downloadManager, ());
    35     return downloadManager;
    36 }
    37 
    38 DownloadManager::DownloadManager()
    39 {
     36    notImplemented();
    4037}
    4138
  • trunk/WebKit2/WebProcess/WebPage/WebFrame.cpp

    r70585 r70687  
    2626#include "WebFrame.h"
    2727
     28#include "DownloadManager.h"
    2829#include "InjectedBundleNodeHandle.h"
    2930#include "InjectedBundleRangeHandle.h"
     
    206207}
    207208
    208 void WebFrame::startDownload(const WebCore::ResourceRequest&)
     209void WebFrame::startDownload(const WebCore::ResourceRequest& request)
    209210{
    210211    ASSERT(m_policyDownloadID);
     212
     213    DownloadManager::shared().startDownload(m_policyDownloadID, request);
    211214
    212215    m_policyDownloadID = 0;
  • trunk/WebKit2/win/WebKit2.vcproj

    r70659 r70687  
    12371237                                >
    12381238                                <File
     1239                                        RelativePath="..\WebProcess\Downloads\Download.cpp"
     1240                                        >
     1241                                </File>
     1242                                <File
     1243                                        RelativePath="..\WebProcess\Downloads\Download.h"
     1244                                        >
     1245                                </File>
     1246                                <File
    12391247                                        RelativePath="..\WebProcess\Downloads\DownloadManager.cpp"
    12401248                                        >
     
    12441252                                        >
    12451253                                </File>
     1254                                <Filter
     1255                                Name="cf"
     1256                                >
     1257                                <File
     1258                                        RelativePath="..\WebProcess\Downloads\cf\DownloadCFNet.cpp"
     1259                                        >
     1260                                </File>
     1261                        </Filter>
    12461262                        </Filter>
    12471263                        <Filter
  • trunk/WebKit2/win/WebKit2Common.vsprops

    r70659 r70687  
    77        <Tool
    88                Name="VCCLCompilerTool"
    9                 AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\Platform&quot;;&quot;$(ProjectDir)\..\Platform\CoreIPC&quot;;&quot;$(ProjectDir)\..\PluginProcess&quot;;&quot;$(ProjectDir)\..\Shared&quot;;&quot;$(ProjectDir)\..\Shared\win&quot;;&quot;$(ProjectDir)\..\Shared\API\c&quot;;&quot;$(ProjectDir)\..\Shared\API\c\cf&quot;;&quot;$(ProjectDir)\..\Shared\API\c\win&quot;;&quot;$(ProjectDir)\..\Shared\CoreIPCSupport&quot;;&quot;$(ProjectDir)\..\UIProcess&quot;;&quot;$(ProjectDir)\..\UIProcess\API\C&quot;;&quot;$(ProjectDir)\..\UIProcess\API\C\win&quot;;&quot;$(ProjectDir)\..\UIProcess\API\cpp&quot;;&quot;$(ProjectDir)\..\UIProcess\API\win&quot;;&quot;$(ProjectDir)\..\UIProcess\Launcher&quot;;&quot;$(ProjectDir)\..\UIProcess\Plugins&quot;;&quot;$(ProjectDir)\..\UIProcess\win&quot;;&quot;$(ProjectDir)\..\WebProcess&quot;;&quot;$(ProjectDir)\..\WebProcess\WebCoreSupport&quot;;&quot;$(ProjectDir)\..\WebProcess\WebCoreSupport\win&quot;;&quot;$(ProjectDir)\..\WebProcess\WebPage&quot;;&quot;$(ProjectDir)\..\WebProcess\WebPage\win&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\API\c&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\DOM&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\win&quot;;&quot;$(ProjectDir)\..\WebProcess\Plugins&quot;;&quot;$(ProjectDir)\..\WebProcess\Plugins\Netscape&quot;;&quot;$(ProjectDir)\..\WebProcess\win&quot;;&quot;$(ProjectDir)\..\WebProcess\Downloads&quot;;&quot;$(ProjectDir)\..\WebProcess\Downloads\win&quot;;&quot;$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitLibrariesDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\Include\pthreads&quot;;&quot;$(WebKitOutputDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\private\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\private\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders&quot;"
     9                AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\Platform&quot;;&quot;$(ProjectDir)\..\Platform\CoreIPC&quot;;&quot;$(ProjectDir)\..\PluginProcess&quot;;&quot;$(ProjectDir)\..\Shared&quot;;&quot;$(ProjectDir)\..\Shared\win&quot;;&quot;$(ProjectDir)\..\Shared\API\c&quot;;&quot;$(ProjectDir)\..\Shared\API\c\cf&quot;;&quot;$(ProjectDir)\..\Shared\API\c\win&quot;;&quot;$(ProjectDir)\..\Shared\CoreIPCSupport&quot;;&quot;$(ProjectDir)\..\UIProcess&quot;;&quot;$(ProjectDir)\..\UIProcess\API\C&quot;;&quot;$(ProjectDir)\..\UIProcess\API\C\win&quot;;&quot;$(ProjectDir)\..\UIProcess\API\cpp&quot;;&quot;$(ProjectDir)\..\UIProcess\API\win&quot;;&quot;$(ProjectDir)\..\UIProcess\Launcher&quot;;&quot;$(ProjectDir)\..\UIProcess\Plugins&quot;;&quot;$(ProjectDir)\..\UIProcess\win&quot;;&quot;$(ProjectDir)\..\WebProcess&quot;;&quot;$(ProjectDir)\..\WebProcess\WebCoreSupport&quot;;&quot;$(ProjectDir)\..\WebProcess\WebCoreSupport\win&quot;;&quot;$(ProjectDir)\..\WebProcess\WebPage&quot;;&quot;$(ProjectDir)\..\WebProcess\WebPage\win&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\API\c&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\DOM&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\win&quot;;&quot;$(ProjectDir)\..\WebProcess\Plugins&quot;;&quot;$(ProjectDir)\..\WebProcess\Plugins\Netscape&quot;;&quot;$(ProjectDir)\..\WebProcess\win&quot;;&quot;$(ProjectDir)\..\WebProcess\Downloads&quot;;&quot;$(ProjectDir)\..\WebProcess\Downloads\cf&quot;;&quot;$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitLibrariesDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\Include\pthreads&quot;;&quot;$(WebKitOutputDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\private\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\private\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders&quot;"
    1010                PreprocessorDefinitions="_USRDLL;WEBKIT_EXPORTS;FRAMEWORK_NAME=WebKit;BUILDING_WEBKIT"
    1111                UsePrecompiledHeader="2"
Note: See TracChangeset for help on using the changeset viewer.