Preparation for using Soup on Windows.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 31 Mar 2014 16:30:00 +0000 (16:30 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 31 Mar 2014 16:30:00 +0000 (16:30 +0000)
https://bugs.webkit.org/show_bug.cgi?id=130615

Patch by Alex Christensen <achristensen@webkit.org> on 2014-03-31
Reviewed by Carlos Garcia Campos.

Source/WebCore:

* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
Added Soup source files in WinCairo build.
* loader/soup/CachedRawResourceSoup.cpp:
* loader/soup/SubresourceLoaderSoup.cpp:
* platform/soup/SharedBufferSoup.cpp:
* platform/soup/URLSoup.cpp:
* platform/network/NetworkStorageSessionStub.cpp:
Only build if USE(SOUP) to prevent building when USE(CURL) is true.
* platform/network/soup/ResourceHandleSoup.cpp:
Only include unistd.h in non-Visual Studio builds.
This would normally be done with a HAVE_UNISTD_H macro when compiling glib and Soup,
but that would need to be left undefined for Visual Studio.

Source/WTF:

* WTF.vcxproj/WTF.vcxproj:
* WTF.vcxproj/WTF.vcxproj.filters:
Add all gobject source files in WinCairo build.
* wtf/gobject/GRefPtr.h:
Export refGPtr and derefGPtr overloads in WTF.dll to fix linker errors with WebKit.dll when using soup.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@166506 268f45cc-cd09-0410-ab3c-d52691b4dbfc

13 files changed:
Source/WTF/ChangeLog
Source/WTF/WTF.vcxproj/WTF.vcxproj
Source/WTF/WTF.vcxproj/WTF.vcxproj.filters
Source/WTF/wtf/gobject/GRefPtr.h
Source/WebCore/ChangeLog
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
Source/WebCore/loader/soup/CachedRawResourceSoup.cpp
Source/WebCore/loader/soup/SubresourceLoaderSoup.cpp
Source/WebCore/platform/network/NetworkStorageSessionStub.cpp
Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp
Source/WebCore/platform/soup/SharedBufferSoup.cpp
Source/WebCore/platform/soup/URLSoup.cpp

index 28433c7..b8ed56e 100644 (file)
@@ -1,3 +1,16 @@
+2014-03-31  Alex Christensen  <achristensen@webkit.org>
+
+        Preparation for using Soup on Windows.
+        https://bugs.webkit.org/show_bug.cgi?id=130615
+
+        Reviewed by Carlos Garcia Campos.
+
+        * WTF.vcxproj/WTF.vcxproj:
+        * WTF.vcxproj/WTF.vcxproj.filters:
+        Add all gobject source files in WinCairo build.
+        * wtf/gobject/GRefPtr.h:
+        Export refGPtr and derefGPtr overloads in WTF.dll to fix linker errors with WebKit.dll when using soup.
+
 2014-03-31  Zan Dobersek  <zdobersek@igalia.com>
 
         Use std::unique_ptr in WTF::CompressedVector, WTF::GenericCompressedData
index b1da05a..60a720b 100644 (file)
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
     </ClCompile>
+    <ClCompile Include="..\wtf\gobject\GMainLoopSource.cpp">
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
+    </ClCompile>
     <ClCompile Include="..\wtf\gobject\GRefPtr.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
     <ClInclude Include="..\wtf\Functional.h" />
     <ClInclude Include="..\wtf\GetPtr.h" />
     <ClInclude Include="..\wtf\gobject\GlibUtilities.h" />
+    <ClInclude Include="..\wtf\gobject\GMainLoopSource.h" />
     <ClInclude Include="..\wtf\gobject\GMutexLocker.h" />
     <ClInclude Include="..\wtf\gobject\GRefPtr.h" />
     <ClInclude Include="..\wtf\gobject\GTypedefs.h" />
+    <ClInclude Include="..\wtf\gobject\GUniquePtr.h" />
     <ClInclude Include="..\wtf\GregorianDateTime.h" />
     <ClInclude Include="..\wtf\HashCountedSet.h" />
     <ClInclude Include="..\wtf\HashFunctions.h" />
index 28a2f98..39e3b06 100644 (file)
       <Filter>win</Filter>
     </ClCompile>
     <ClCompile Include="..\wtf\FastBitVector.cpp" />
+    <ClCompile Include="..\wtf\gobject\GMainLoopSource.cpp">
+      <Filter>wtf\gobject</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\wtf\dtoa\utils.h">
     <ClInclude Include="..\wtf\RunLoop.h">
       <Filter>wtf</Filter>
     </ClInclude>
+    <ClInclude Include="..\wtf\HashMethod.h" />
+    <ClInclude Include="..\wtf\gobject\GMainLoopSource.h">
+      <Filter>wtf\gobject</Filter>
+    </ClInclude>
+    <ClInclude Include="..\wtf\gobject\GUniquePtr.h">
+      <Filter>wtf\gobject</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="WTFPostBuild.cmd" />
index b25b7bb..4ba8920 100644 (file)
@@ -203,24 +203,24 @@ template <typename T> GRefPtr<T> adoptGRef(T* p)
     return GRefPtr<T>(p, GRefPtrAdopt);
 }
 
-template <> GHashTable* refGPtr(GHashTable* ptr);
-template <> void derefGPtr(GHashTable* ptr);
-template <> GMainContext* refGPtr(GMainContext* ptr);
-template <> void derefGPtr(GMainContext* ptr);
-template <> GMainLoop* refGPtr(GMainLoop* ptr);
-template <> void derefGPtr(GMainLoop* ptr);
-template <> GVariant* refGPtr(GVariant* ptr);
-template <> void derefGPtr(GVariant* ptr);
-template <> GSource* refGPtr(GSource* ptr);
-template <> void derefGPtr(GSource* ptr);
-template <> GPtrArray* refGPtr(GPtrArray*);
-template <> void derefGPtr(GPtrArray*);
-template <> GByteArray* refGPtr(GByteArray*);
-template <> void derefGPtr(GByteArray*);
-template <> GBytes* refGPtr(GBytes*);
-template <> void derefGPtr(GBytes*);
-template <> GClosure* refGPtr(GClosure*);
-template <> void derefGPtr(GClosure*);
+template <> WTF_EXPORT_PRIVATE GHashTable* refGPtr(GHashTable* ptr);
+template <> WTF_EXPORT_PRIVATE void derefGPtr(GHashTable* ptr);
+template <> WTF_EXPORT_PRIVATE GMainContext* refGPtr(GMainContext* ptr);
+template <> WTF_EXPORT_PRIVATE void derefGPtr(GMainContext* ptr);
+template <> WTF_EXPORT_PRIVATE GMainLoop* refGPtr(GMainLoop* ptr);
+template <> WTF_EXPORT_PRIVATE void derefGPtr(GMainLoop* ptr);
+template <> WTF_EXPORT_PRIVATE GVariant* refGPtr(GVariant* ptr);
+template <> WTF_EXPORT_PRIVATE void derefGPtr(GVariant* ptr);
+template <> WTF_EXPORT_PRIVATE GSource* refGPtr(GSource* ptr);
+template <> WTF_EXPORT_PRIVATE void derefGPtr(GSource* ptr);
+template <> WTF_EXPORT_PRIVATE GPtrArray* refGPtr(GPtrArray*);
+template <> WTF_EXPORT_PRIVATE void derefGPtr(GPtrArray*);
+template <> WTF_EXPORT_PRIVATE GByteArray* refGPtr(GByteArray*);
+template <> WTF_EXPORT_PRIVATE void derefGPtr(GByteArray*);
+template <> WTF_EXPORT_PRIVATE GBytes* refGPtr(GBytes*);
+template <> WTF_EXPORT_PRIVATE void derefGPtr(GBytes*);
+template <> WTF_EXPORT_PRIVATE GClosure* refGPtr(GClosure*);
+template <> WTF_EXPORT_PRIVATE void derefGPtr(GClosure*);
 
 template <typename T> inline T* refGPtr(T* ptr)
 {
index 437148d..5f828cb 100644 (file)
@@ -1,3 +1,24 @@
+2014-03-31  Alex Christensen  <achristensen@webkit.org>
+
+        Preparation for using Soup on Windows.
+        https://bugs.webkit.org/show_bug.cgi?id=130615
+
+        Reviewed by Carlos Garcia Campos.
+
+        * WebCore.vcxproj/WebCore.vcxproj:
+        * WebCore.vcxproj/WebCore.vcxproj.filters:
+        Added Soup source files in WinCairo build.
+        * loader/soup/CachedRawResourceSoup.cpp:
+        * loader/soup/SubresourceLoaderSoup.cpp:
+        * platform/soup/SharedBufferSoup.cpp:
+        * platform/soup/URLSoup.cpp:
+        * platform/network/NetworkStorageSessionStub.cpp:
+        Only build if USE(SOUP) to prevent building when USE(CURL) is true.
+        * platform/network/soup/ResourceHandleSoup.cpp:
+        Only include unistd.h in non-Visual Studio builds.
+        This would normally be done with a HAVE_UNISTD_H macro when compiling glib and Soup,
+        but that would need to be left undefined for Visual Studio.
+
 2014-03-31  Zan Dobersek  <zdobersek@igalia.com>
 
         Unreviewed. Addressing reviewing comments for r166491 that I forgot
index d9e186d..15660be 100644 (file)
     <ClCompile Include="..\html\track\VTTRegion.cpp" />
     <ClCompile Include="..\html\track\VTTRegionList.cpp" />
     <ClCompile Include="..\html\track\WebVTTElement.cpp" />
+    <ClCompile Include="..\loader\soup\CachedRawResourceSoup.cpp">
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
+    </ClCompile>
+    <ClCompile Include="..\loader\soup\SubresourceLoaderSoup.cpp">
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
+    </ClCompile>
     <ClCompile Include="..\Modules\geolocation\Coordinates.cpp" />
     <ClCompile Include="..\Modules\geolocation\Geolocation.cpp" />
     <ClCompile Include="..\Modules\geolocation\GeolocationController.cpp" />
     <ClCompile Include="..\platform\UserActivity.cpp" />
     <ClCompile Include="..\platform\UUID.cpp" />
     <ClCompile Include="..\platform\Widget.cpp" />
+    <ClCompile Include="..\platform\soup\SharedBufferSoup.cpp">
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
+    </ClCompile>
+    <ClCompile Include="..\platform\soup\URLSoup.cpp">
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
+    </ClCompile>
     <ClCompile Include="..\platform\win\BitmapInfo.cpp" />
     <ClCompile Include="..\platform\win\BString.cpp" />
     <ClCompile Include="..\platform\win\ClipboardUtilitiesWin.cpp" />
index a7aecfc..eb2382f 100644 (file)
     <Filter Include="platform\network\soup">
       <UniqueIdentifier>{f9947de2-8c4a-4e86-a0db-828f03ada050}</UniqueIdentifier>
     </Filter>
+    <Filter Include="loader\soup">
+      <UniqueIdentifier>{44cc9774-577c-48d5-b098-4f208cf92032}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="platform\soup">
+      <UniqueIdentifier>{b353479a-a6bf-41ad-b655-876165789b99}</UniqueIdentifier>
+    </Filter>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\DerivedSources.cpp">
     <ClCompile Include="..\platform\network\soup\SynchronousLoaderClientSoup.cpp">
       <Filter>platform\network\soup</Filter>
     </ClCompile>
+    <ClCompile Include="..\loader\soup\CachedRawResourceSoup.cpp">
+      <Filter>loader\soup</Filter>
+    </ClCompile>
+    <ClCompile Include="..\loader\soup\SubresourceLoaderSoup.cpp">
+      <Filter>loader\soup</Filter>
+    </ClCompile>
+    <ClCompile Include="..\platform\soup\SharedBufferSoup.cpp">
+      <Filter>platform\soup</Filter>
+    </ClCompile>
+    <ClCompile Include="..\platform\soup\URLSoup.cpp">
+      <Filter>platform\soup</Filter>
+    </ClCompile>
     <ClCompile Include="..\html\track\VTTRegion.cpp">
       <Filter>html\track</Filter>
     </ClCompile>
index 4934e9d..9635db1 100644 (file)
@@ -17,6 +17,9 @@
  */
 
 #include "config.h"
+
+#if USE(SOUP)
+
 #include "CachedRawResource.h"
 
 #include "CachedRawResourceClient.h"
@@ -36,3 +39,5 @@ char* CachedRawResource::getOrCreateReadBuffer(size_t requestedSize, size_t& act
 }
 
 } // namespace WebCore
+
+#endif
index b7670a0..f86bd55 100644 (file)
@@ -17,6 +17,9 @@
  */
 
 #include "config.h"
+
+#if USE(SOUP)
+
 #include "SubresourceLoader.h"
 
 #include "CachedResource.h"
@@ -29,3 +32,5 @@ char* SubresourceLoader::getOrCreateReadBuffer(size_t requestedLength, size_t& a
 }
 
 } // namespace WebCore
+
+#endif
index c9d0cf1..c7f0b43 100644 (file)
@@ -24,6 +24,9 @@
  */
 
 #include "config.h"
+
+#if !USE(SOUP)
+
 #include "NetworkStorageSession.h"
 
 #include "NetworkingContext.h"
@@ -62,3 +65,5 @@ void NetworkStorageSession::switchToNewTestingSession()
 }
 
 }
+
+#endif
index 10dc695..5b10fec 100644 (file)
@@ -54,7 +54,9 @@
 #include <libsoup/soup.h>
 #include <sys/stat.h>
 #include <sys/types.h>
+#if !COMPILER(MSVC)
 #include <unistd.h>
+#endif
 #include <wtf/CurrentTime.h>
 #include <wtf/SHA1.h>
 #include <wtf/gobject/GRefPtr.h>
index 3ce1249..73f856c 100644 (file)
@@ -17,6 +17,9 @@
  */
 
 #include "config.h"
+
+#if USE(SOUP)
+
 #include "SharedBuffer.h"
 
 #include "PurgeableBuffer.h"
@@ -77,3 +80,5 @@ unsigned SharedBuffer::platformDataSize() const
 }
 
 } // namespace WebCore
+
+#endif
index dc6b25c..064090d 100644 (file)
@@ -24,6 +24,9 @@
  */
 
 #include "config.h"
+
+#if USE(SOUP)
+
 #include "URL.h"
 
 #include <libsoup/soup.h>
@@ -61,3 +64,5 @@ GUniquePtr<SoupURI> URL::createSoupURI() const
 }
 
 } // namespace WebCore
+
+#endif