Skip to content
Permalink
Browse files
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.

Canonical link: https://commits.webkit.org/61208@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@70687 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Anders Carlsson committed Oct 27, 2010
1 parent dda1f97 commit 7bb7abc698c1026c64e70c3e647e4b07359480fd
Showing 14 changed files with 446 additions and 2 deletions.
@@ -1,3 +1,36 @@
2010-10-27 Anders Carlsson <andersca@apple.com>

Reviewed by Adam Roben.

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

* 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.

2010-10-27 Adam Roben <aroben@apple.com>

Don't allow setting NetscapePlugin::m_isWindowed after NPP_New has
@@ -284,6 +284,7 @@ HEADERS += \
UIProcess/WebUIClient.h \
UIProcess/qt/WebPopupMenuProxyQt.h \
WebProcess/Downloads/DownloadManager.h \
WebProcess/Downloads/Download.h \
WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.h \
WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.h \
WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h \
@@ -430,7 +431,9 @@ SOURCES += \
UIProcess/WebProcessManager.cpp \
UIProcess/WebProcessProxy.cpp \
UIProcess/WebUIClient.cpp \
WebProcess/Downloads/Download.cpp \
WebProcess/Downloads/DownloadManager.cpp \
WebProcess/Downloads/qt/DownloadQt.cpp \
WebProcess/InjectedBundle/API/c/WKBundle.cpp \
WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp \
WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp \
@@ -91,6 +91,9 @@
1A594ABB112A1FB6009DE7C7 /* WebUIClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A594AB9112A1FB6009DE7C7 /* WebUIClient.h */; };
1A61614F127798B5003ACD86 /* DownloadManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A61614D127798B5003ACD86 /* DownloadManager.cpp */; };
1A616150127798B5003ACD86 /* DownloadManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A61614E127798B5003ACD86 /* DownloadManager.h */; };
1A6161D41278981C003ACD86 /* Download.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A6161D21278981C003ACD86 /* Download.h */; };
1A6161D51278981C003ACD86 /* Download.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6161D31278981C003ACD86 /* Download.cpp */; };
1A61639612789B2F003ACD86 /* DownloadMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A61639512789B2F003ACD86 /* DownloadMac.mm */; };
1A6F9F9011E13EFC00DB1371 /* CommandLine.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A6F9F8E11E13EFC00DB1371 /* CommandLine.h */; };
1A6F9FB711E1408500DB1371 /* CommandLineMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6F9FB611E1408500DB1371 /* CommandLineMac.cpp */; };
1A6FA01E11E1526300DB1371 /* WebProcessMainMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A6FA01D11E1526300DB1371 /* WebProcessMainMac.mm */; };
@@ -570,6 +573,9 @@
1A594AB9112A1FB6009DE7C7 /* WebUIClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebUIClient.h; sourceTree = "<group>"; };
1A61614D127798B5003ACD86 /* DownloadManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DownloadManager.cpp; sourceTree = "<group>"; };
1A61614E127798B5003ACD86 /* DownloadManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DownloadManager.h; sourceTree = "<group>"; };
1A6161D21278981C003ACD86 /* Download.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Download.h; sourceTree = "<group>"; };
1A6161D31278981C003ACD86 /* Download.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Download.cpp; sourceTree = "<group>"; };
1A61639512789B2F003ACD86 /* DownloadMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DownloadMac.mm; sourceTree = "<group>"; };
1A6F9F8E11E13EFC00DB1371 /* CommandLine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommandLine.h; sourceTree = "<group>"; };
1A6F9FB611E1408500DB1371 /* CommandLineMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CommandLineMac.cpp; sourceTree = "<group>"; };
1A6FA01D11E1526300DB1371 /* WebProcessMainMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebProcessMainMac.mm; sourceTree = "<group>"; };
@@ -1113,12 +1119,23 @@
1A61614C127798B5003ACD86 /* Downloads */ = {
isa = PBXGroup;
children = (
1A61639412789B2F003ACD86 /* mac */,
1A6161D31278981C003ACD86 /* Download.cpp */,
1A6161D21278981C003ACD86 /* Download.h */,
1A61614D127798B5003ACD86 /* DownloadManager.cpp */,
1A61614E127798B5003ACD86 /* DownloadManager.h */,
);
path = Downloads;
sourceTree = "<group>";
};
1A61639412789B2F003ACD86 /* mac */ = {
isa = PBXGroup;
children = (
1A61639512789B2F003ACD86 /* DownloadMac.mm */,
);
path = mac;
sourceTree = "<group>";
};
1A6FA01C11E1526300DB1371 /* mac */ = {
isa = PBXGroup;
children = (
@@ -2128,6 +2145,7 @@
1C8E28341275D73800BC7BD0 /* WebInspectorProxy.h in Headers */,
1C8E293912761E5B00BC7BD0 /* WKInspector.h in Headers */,
1A616150127798B5003ACD86 /* DownloadManager.h in Headers */,
1A6161D41278981C003ACD86 /* Download.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -2442,6 +2460,8 @@
1C8E28351275D73800BC7BD0 /* WebInspectorProxy.cpp in Sources */,
1C8E293A12761E5B00BC7BD0 /* WKInspector.cpp in Sources */,
1A61614F127798B5003ACD86 /* DownloadManager.cpp in Sources */,
1A6161D51278981C003ACD86 /* Download.cpp in Sources */,
1A61639612789B2F003ACD86 /* DownloadMac.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -76,6 +76,8 @@ static const type& name() \
#define JS_EXPORTCLASS
#define WEBKIT_EXPORTDATA

#include <WebCore/EmptyProtocolDefinitions.h>

#elif defined(WIN32) || defined(_WIN32)

#ifndef _WIN32_WINNT
@@ -0,0 +1,48 @@
/*
* Copyright (C) 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/

#include "Download.h"

using namespace WebCore;

namespace WebKit {

PassOwnPtr<Download> Download::create(uint64_t downloadID, const ResourceRequest& request)
{
return adoptPtr(new Download(downloadID, request));
}

Download::Download(uint64_t downloadID, const ResourceRequest& request)
: m_downloadID(downloadID)
, m_request(request)
{
ASSERT(m_downloadID);
}

Download::~Download()
{
}

} // namespace WebKit
@@ -0,0 +1,69 @@
/*
* Copyright (C) 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef Download_h
#define Download_h

#if PLATFORM(MAC)
#include <wtf/RetainPtr.h>
#ifdef __OBJC__
@class NSURLDownload;
@class WKDownloadAsDelegate;
#else
class NSURLDownload;
class WKDownloadAsDelegate;
#endif
#endif

#include <WebCore/ResourceRequest.h>
#include <wtf/Noncopyable.h>
#include <wtf/PassOwnPtr.h>

namespace WebKit {

class Download {
WTF_MAKE_NONCOPYABLE(Download);

public:
static PassOwnPtr<Download> create(uint64_t downloadID, const WebCore::ResourceRequest&);
~Download();

void start();

private:
Download(uint64_t downloadID, const WebCore::ResourceRequest&);

uint64_t m_downloadID;
WebCore::ResourceRequest m_request;

#if PLATFORM(MAC)
RetainPtr<NSURLDownload> m_nsURLDownload;
RetainPtr<WKDownloadAsDelegate> m_delegate;
#endif
};

} // namespace WebKit

#endif // Download_h
@@ -25,8 +25,12 @@

#include "DownloadManager.h"

#include "Download.h"
#include "NotImplemented.h"
#include <wtf/StdLibExtras.h>

using namespace WebCore;

namespace WebKit {

DownloadManager& DownloadManager::shared()
@@ -39,4 +43,10 @@ DownloadManager::DownloadManager()
{
}

void DownloadManager::startDownload(uint64_t downloadID, const ResourceRequest& request)
{
// FIXME: Implement.
notImplemented();
}

} // namespace WebKit
@@ -28,6 +28,10 @@

#include <wtf/Noncopyable.h>

namespace WebCore {
class ResourceRequest;
}

namespace WebKit {

class DownloadManager {
@@ -36,6 +40,8 @@ class DownloadManager {
public:
static DownloadManager& shared();

void startDownload(uint64_t downloadID, const WebCore::ResourceRequest&);

private:
DownloadManager();

@@ -0,0 +1,39 @@
/*
* Copyright (C) 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/

#include "Download.h"

#include "NotImplemented.h"

using namespace WebCore;

namespace WebKit {

void Download::start()
{
notImplemented();
}

} // namespace WebKit

0 comments on commit 7bb7abc

Please sign in to comment.