Title: [137756] trunk/Source/WebKit2
Revision
137756
Author
[email protected]
Date
2012-12-14 10:47:59 -0800 (Fri, 14 Dec 2012)

Log Message

Add a DownloadsProxyMap class in preparation for moving the downloads map away from WebContext
https://bugs.webkit.org/show_bug.cgi?id=104980

Reviewed by Andreas Kling.

Currently the DownloadProxyMap doesn't really do anything; this initial change is to make sure that
adding the new files won't break any builds.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* UIProcess/Downloads/DownloadProxyMap.cpp: Added.
(WebKit):
(WebKit::DownloadProxyMap::shared):
(WebKit::DownloadProxyMap::DownloadProxyMap):
(WebKit::DownloadProxyMap::~DownloadProxyMap):
(WebKit::DownloadProxyMap::createDownloadProxy):
* UIProcess/Downloads/DownloadProxyMap.h: Added.
(WebKit):
(DownloadProxyMap):
* UIProcess/WebContext.cpp:
(WebKit::WebContext::createDownloadProxy):
* WebKit2.xcodeproj/project.pbxproj:
* win/WebKit2.vcproj:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebKit2/CMakeLists.txt (137755 => 137756)


--- trunk/Source/WebKit2/CMakeLists.txt	2012-12-14 18:42:37 UTC (rev 137755)
+++ trunk/Source/WebKit2/CMakeLists.txt	2012-12-14 18:47:59 UTC (rev 137756)
@@ -352,6 +352,7 @@
     UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp
 
     UIProcess/Downloads/DownloadProxy.cpp
+    UIProcess/Downloads/DownloadProxyMap.cpp
 
     UIProcess/InspectorServer/WebInspectorServer.cpp
     UIProcess/InspectorServer/WebSocketServer.cpp

Modified: trunk/Source/WebKit2/ChangeLog (137755 => 137756)


--- trunk/Source/WebKit2/ChangeLog	2012-12-14 18:42:37 UTC (rev 137755)
+++ trunk/Source/WebKit2/ChangeLog	2012-12-14 18:47:59 UTC (rev 137756)
@@ -1,5 +1,32 @@
 2012-12-14  Anders Carlsson  <[email protected]>
 
+        Add a DownloadsProxyMap class in preparation for moving the downloads map away from WebContext
+        https://bugs.webkit.org/show_bug.cgi?id=104980
+
+        Reviewed by Andreas Kling.
+
+        Currently the DownloadProxyMap doesn't really do anything; this initial change is to make sure that
+        adding the new files won't break any builds.
+
+        * CMakeLists.txt:
+        * GNUmakefile.list.am:
+        * Target.pri:
+        * UIProcess/Downloads/DownloadProxyMap.cpp: Added.
+        (WebKit):
+        (WebKit::DownloadProxyMap::shared):
+        (WebKit::DownloadProxyMap::DownloadProxyMap):
+        (WebKit::DownloadProxyMap::~DownloadProxyMap):
+        (WebKit::DownloadProxyMap::createDownloadProxy):
+        * UIProcess/Downloads/DownloadProxyMap.h: Added.
+        (WebKit):
+        (DownloadProxyMap):
+        * UIProcess/WebContext.cpp:
+        (WebKit::WebContext::createDownloadProxy):
+        * WebKit2.xcodeproj/project.pbxproj:
+        * win/WebKit2.vcproj:
+
+2012-12-14  Anders Carlsson  <[email protected]>
+
         Fix assertion failure when the network process is enabled
         https://bugs.webkit.org/show_bug.cgi?id=105040
         <rdar://problem/12883632>

Modified: trunk/Source/WebKit2/GNUmakefile.list.am (137755 => 137756)


--- trunk/Source/WebKit2/GNUmakefile.list.am	2012-12-14 18:42:37 UTC (rev 137755)
+++ trunk/Source/WebKit2/GNUmakefile.list.am	2012-12-14 18:47:59 UTC (rev 137756)
@@ -775,6 +775,8 @@
 	Source/WebKit2/UIProcess/BackingStore.h \
 	Source/WebKit2/UIProcess/Downloads/DownloadProxy.cpp \
 	Source/WebKit2/UIProcess/Downloads/DownloadProxy.h \
+	Source/WebKit2/UIProcess/Downloads/DownloadProxyMap.cpp \
+	Source/WebKit2/UIProcess/Downloads/DownloadProxyMap.h \
 	Source/WebKit2/UIProcess/DrawingAreaProxy.cpp \
 	Source/WebKit2/UIProcess/DrawingAreaProxy.h \
 	Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp \

Modified: trunk/Source/WebKit2/Target.pri (137755 => 137756)


--- trunk/Source/WebKit2/Target.pri	2012-12-14 18:42:37 UTC (rev 137755)
+++ trunk/Source/WebKit2/Target.pri	2012-12-14 18:47:59 UTC (rev 137756)
@@ -575,6 +575,7 @@
     UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp \
     UIProcess/DefaultUndoController.cpp \
     UIProcess/Downloads/DownloadProxy.cpp \
+    UIProcess/Downloads/DownloadProxyMap.cpp \
     UIProcess/DrawingAreaProxy.cpp \
     UIProcess/DrawingAreaProxyImpl.cpp \
     UIProcess/FindIndicator.cpp \

Added: trunk/Source/WebKit2/UIProcess/Downloads/DownloadProxyMap.cpp (0 => 137756)


--- trunk/Source/WebKit2/UIProcess/Downloads/DownloadProxyMap.cpp	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/Downloads/DownloadProxyMap.cpp	2012-12-14 18:47:59 UTC (rev 137756)
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2012 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 "config.h"
+#include "DownloadProxyMap.h"
+
+#include "DownloadProxy.h"
+#include <wtf/StdLibExtras.h>
+
+namespace WebKit {
+
+DownloadProxyMap& DownloadProxyMap::shared()
+{
+    DEFINE_STATIC_LOCAL(DownloadProxyMap, downloadProxyMap, ());
+
+    return downloadProxyMap;
+}
+
+DownloadProxyMap::DownloadProxyMap()
+{
+}
+
+DownloadProxyMap::~DownloadProxyMap()
+{
+}
+
+PassRefPtr<DownloadProxy> DownloadProxyMap::createDownloadProxy(WebContext* webContext)
+{
+    RefPtr<DownloadProxy> downloadProxy = DownloadProxy::create(webContext);
+
+    return downloadProxy.release();
+}
+
+} // namespace WebKit

Added: trunk/Source/WebKit2/UIProcess/Downloads/DownloadProxyMap.h (0 => 137756)


--- trunk/Source/WebKit2/UIProcess/Downloads/DownloadProxyMap.h	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/Downloads/DownloadProxyMap.h	2012-12-14 18:47:59 UTC (rev 137756)
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2012 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 DownloadProxyMap_h
+#define DownloadProxyMap_h
+
+#include <wtf/Noncopyable.h>
+#include <wtf/PassRefPtr.h>
+
+namespace WebKit {
+
+class DownloadProxy;
+class WebContext;
+
+class DownloadProxyMap {
+    WTF_MAKE_NONCOPYABLE(DownloadProxyMap);
+
+public:
+    static DownloadProxyMap& shared();
+
+    PassRefPtr<DownloadProxy> createDownloadProxy(WebContext*);
+
+private:
+    DownloadProxyMap();
+    ~DownloadProxyMap();
+};
+
+} // namespace WebKit
+
+#endif // DownloadProxyMap_h

Modified: trunk/Source/WebKit2/UIProcess/WebContext.cpp (137755 => 137756)


--- trunk/Source/WebKit2/UIProcess/WebContext.cpp	2012-12-14 18:42:37 UTC (rev 137755)
+++ trunk/Source/WebKit2/UIProcess/WebContext.cpp	2012-12-14 18:47:59 UTC (rev 137756)
@@ -27,6 +27,7 @@
 #include "WebContext.h"
 
 #include "DownloadProxy.h"
+#include "DownloadProxyMap.h"
 #include "DownloadProxyMessages.h"
 #include "ImmutableArray.h"
 #include "Logging.h"
@@ -835,7 +836,7 @@
 
 DownloadProxy* WebContext::createDownloadProxy()
 {
-    RefPtr<DownloadProxy> downloadProxy = DownloadProxy::create(this);
+    RefPtr<DownloadProxy> downloadProxy = DownloadProxyMap::shared().createDownloadProxy(this);
     m_downloads.set(downloadProxy->downloadID(), downloadProxy);
     addMessageReceiver(Messages::DownloadProxy::messageReceiverName(), downloadProxy->downloadID(), this);
     return downloadProxy.get();

Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (137755 => 137756)


--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2012-12-14 18:42:37 UTC (rev 137755)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2012-12-14 18:47:59 UTC (rev 137756)
@@ -243,6 +243,8 @@
 		1AC86FF4130B46D3002C1257 /* WKPluginSiteDataManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AC86FF2130B46D3002C1257 /* WKPluginSiteDataManager.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		1AC8702D130B49A2002C1257 /* WebPluginSiteDataManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AC8702B130B49A2002C1257 /* WebPluginSiteDataManager.h */; };
 		1AC8702E130B49A2002C1257 /* WebPluginSiteDataManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC8702C130B49A2002C1257 /* WebPluginSiteDataManager.cpp */; };
+		1AD25E95167AB08100EA9BCD /* DownloadProxyMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD25E93167AB08100EA9BCD /* DownloadProxyMap.cpp */; };
+		1AD25E96167AB08100EA9BCD /* DownloadProxyMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD25E94167AB08100EA9BCD /* DownloadProxyMap.h */; };
 		1AE117F611DBB30900981615 /* ProcessLauncher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AE117F511DBB30900981615 /* ProcessLauncher.cpp */; };
 		1AE4976811FF658E0048B464 /* NPJSObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AE4976611FF658E0048B464 /* NPJSObject.h */; };
 		1AE4976911FF658E0048B464 /* NPJSObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AE4976711FF658E0048B464 /* NPJSObject.cpp */; };
@@ -1459,6 +1461,8 @@
 		1AC86FF2130B46D3002C1257 /* WKPluginSiteDataManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKPluginSiteDataManager.h; sourceTree = "<group>"; };
 		1AC8702B130B49A2002C1257 /* WebPluginSiteDataManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPluginSiteDataManager.h; sourceTree = "<group>"; };
 		1AC8702C130B49A2002C1257 /* WebPluginSiteDataManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPluginSiteDataManager.cpp; sourceTree = "<group>"; };
+		1AD25E93167AB08100EA9BCD /* DownloadProxyMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DownloadProxyMap.cpp; sourceTree = "<group>"; };
+		1AD25E94167AB08100EA9BCD /* DownloadProxyMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DownloadProxyMap.h; sourceTree = "<group>"; };
 		1AE117F511DBB30900981615 /* ProcessLauncher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProcessLauncher.cpp; sourceTree = "<group>"; };
 		1AE4976611FF658E0048B464 /* NPJSObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NPJSObject.h; sourceTree = "<group>"; };
 		1AE4976711FF658E0048B464 /* NPJSObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NPJSObject.cpp; sourceTree = "<group>"; };
@@ -2975,6 +2979,8 @@
 				1AB7D4C91288AAA700CFD08C /* DownloadProxy.cpp */,
 				1AB7D4C81288AAA700CFD08C /* DownloadProxy.h */,
 				1AB7D5E91288B8C000CFD08C /* DownloadProxy.messages.in */,
+				1AD25E93167AB08100EA9BCD /* DownloadProxyMap.cpp */,
+				1AD25E94167AB08100EA9BCD /* DownloadProxyMap.h */,
 			);
 			path = Downloads;
 			sourceTree = "<group>";
@@ -5016,6 +5022,7 @@
 				E1513C67166EABB200149FCB /* ChildProcessProxy.h in Headers */,
 				31A67E0D165B2A99006CBA66 /* PlugInAutoStartProvider.h in Headers */,
 				31D5929F166E060000E6BF02 /* WebPlugInClient.h in Headers */,
+				1AD25E96167AB08100EA9BCD /* DownloadProxyMap.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -5972,6 +5979,7 @@
 				E1513C66166EABB200149FCB /* ChildProcessProxy.cpp in Sources */,
 				31A67E0C165B2A99006CBA66 /* PlugInAutoStartProvider.cpp in Sources */,
 				31D5929E166E060000E6BF02 /* WebPlugInClient.cpp in Sources */,
+				1AD25E95167AB08100EA9BCD /* DownloadProxyMap.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

Modified: trunk/Source/WebKit2/win/WebKit2.vcproj (137755 => 137756)


--- trunk/Source/WebKit2/win/WebKit2.vcproj	2012-12-14 18:42:37 UTC (rev 137755)
+++ trunk/Source/WebKit2/win/WebKit2.vcproj	2012-12-14 18:47:59 UTC (rev 137756)
@@ -3790,6 +3790,14 @@
 					>
 				</File>
 				<File
+					RelativePath="..\UIProcess\Downloads\DownloadProxyMap.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\UIProcess\Downloads\DownloadProxyMap.h"
+					>
+				</File>
+				<File
 					RelativePath="..\UIProcess\Downloads\DownloadProxy.messages.in"
 					>
 				</File>
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to