Title: [149416] trunk/Source
Revision
149416
Author
[email protected]
Date
2013-04-30 17:27:55 -0700 (Tue, 30 Apr 2013)

Log Message

Remove the WebKit2 BinarySemaphore class
https://bugs.webkit.org/show_bug.cgi?id=115458

Reviewed by Benjamin Poulain.

Source/WebKit2:

Remove the WK2 specific BinarySemaphore class and use the one from WTF.

* Platform/CoreIPC/BinarySemaphore.cpp: Removed.
* Platform/CoreIPC/BinarySemaphore.h: Removed.
* Platform/CoreIPC/Connection.cpp:
* Platform/CoreIPC/Connection.h:
* WebKit2.xcodeproj/project.pbxproj:

Source/WTF:

* wtf/Forward.h:
Add BinarySemaphore forward declaration.

* wtf/threads/BinarySemaphore.h:
Add WTF_EXPORT_PRIVATE to declarations.

Modified Paths

Removed Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (149415 => 149416)


--- trunk/Source/WTF/ChangeLog	2013-05-01 00:02:12 UTC (rev 149415)
+++ trunk/Source/WTF/ChangeLog	2013-05-01 00:27:55 UTC (rev 149416)
@@ -1,3 +1,16 @@
+2013-04-30  Anders Carlsson  <[email protected]>
+
+        Remove the WebKit2 BinarySemaphore class
+        https://bugs.webkit.org/show_bug.cgi?id=115458
+
+        Reviewed by Benjamin Poulain.
+
+        * wtf/Forward.h:
+        Add BinarySemaphore forward declaration.
+
+        * wtf/threads/BinarySemaphore.h:
+        Add WTF_EXPORT_PRIVATE to declarations.
+
 2013-04-30  Commit Queue  <[email protected]>
 
         Unreviewed, rolling out r149408.

Modified: trunk/Source/WTF/wtf/Forward.h (149415 => 149416)


--- trunk/Source/WTF/wtf/Forward.h	2013-05-01 00:02:12 UTC (rev 149415)
+++ trunk/Source/WTF/wtf/Forward.h	2013-05-01 00:27:55 UTC (rev 149416)
@@ -39,6 +39,7 @@
     class ArrayBufferView;
     class AtomicString;
     class AtomicStringImpl;
+    class BinarySemaphore;
     class CString;
     class Decoder;
     class Encoder;
@@ -72,6 +73,7 @@
 using WTF::ArrayBufferView;
 using WTF::AtomicString;
 using WTF::AtomicStringImpl;
+using WTF::BinarySemaphore;
 using WTF::CString;
 using WTF::Encoder;
 using WTF::Decoder;

Modified: trunk/Source/WTF/wtf/threads/BinarySemaphore.h (149415 => 149416)


--- trunk/Source/WTF/wtf/threads/BinarySemaphore.h	2013-05-01 00:02:12 UTC (rev 149415)
+++ trunk/Source/WTF/wtf/threads/BinarySemaphore.h	2013-05-01 00:27:55 UTC (rev 149416)
@@ -35,11 +35,11 @@
     WTF_MAKE_NONCOPYABLE(BinarySemaphore);
 
 public:
-    BinarySemaphore();
-    ~BinarySemaphore();
+    WTF_EXPORT_PRIVATE BinarySemaphore();
+    WTF_EXPORT_PRIVATE ~BinarySemaphore();
 
-    void signal();
-    bool wait(double absoluteTime);
+    WTF_EXPORT_PRIVATE void signal();
+    WTF_EXPORT_PRIVATE bool wait(double absoluteTime);
 
 #if PLATFORM(WIN)
     HANDLE event() const { return m_event; }

Modified: trunk/Source/WebKit2/ChangeLog (149415 => 149416)


--- trunk/Source/WebKit2/ChangeLog	2013-05-01 00:02:12 UTC (rev 149415)
+++ trunk/Source/WebKit2/ChangeLog	2013-05-01 00:27:55 UTC (rev 149416)
@@ -1,3 +1,18 @@
+2013-04-30  Anders Carlsson  <[email protected]>
+
+        Remove the WebKit2 BinarySemaphore class
+        https://bugs.webkit.org/show_bug.cgi?id=115458
+
+        Reviewed by Benjamin Poulain.
+
+        Remove the WK2 specific BinarySemaphore class and use the one from WTF.
+
+        * Platform/CoreIPC/BinarySemaphore.cpp: Removed.
+        * Platform/CoreIPC/BinarySemaphore.h: Removed.
+        * Platform/CoreIPC/Connection.cpp:
+        * Platform/CoreIPC/Connection.h:
+        * WebKit2.xcodeproj/project.pbxproj:
+
 2013-04-30  Alexey Proskuryakov  <[email protected]>
 
         <rdar://problem/13757475> WebProcess deny ipc-posix-shm-read-data CFPBS:A2:

Deleted: trunk/Source/WebKit2/Platform/CoreIPC/BinarySemaphore.cpp (149415 => 149416)


--- trunk/Source/WebKit2/Platform/CoreIPC/BinarySemaphore.cpp	2013-05-01 00:02:12 UTC (rev 149415)
+++ trunk/Source/WebKit2/Platform/CoreIPC/BinarySemaphore.cpp	2013-05-01 00:27:55 UTC (rev 149416)
@@ -1,64 +0,0 @@
-/*
- * 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 "config.h"
-#include "BinarySemaphore.h"
-
-namespace CoreIPC {
-
-BinarySemaphore::BinarySemaphore()
-    : m_isSet(false)
-{
-}
-    
-BinarySemaphore::~BinarySemaphore()
-{
-}
-
-void BinarySemaphore::signal()
-{
-    MutexLocker locker(m_mutex);
-
-    m_isSet = true;
-    m_condition.signal();
-}
-
-bool BinarySemaphore::wait(double absoluteTime)
-{
-    MutexLocker locker(m_mutex);
-
-    bool timedOut = false;
-    while (!m_isSet) {
-        timedOut = !m_condition.timedWait(m_mutex, absoluteTime);
-        if (timedOut)
-            return false;
-    }
-
-    // Reset the semaphore.
-    m_isSet = false;
-    return true;
-}
-
-} // namespace CoreIPC

Deleted: trunk/Source/WebKit2/Platform/CoreIPC/BinarySemaphore.h (149415 => 149416)


--- trunk/Source/WebKit2/Platform/CoreIPC/BinarySemaphore.h	2013-05-01 00:02:12 UTC (rev 149415)
+++ trunk/Source/WebKit2/Platform/CoreIPC/BinarySemaphore.h	2013-05-01 00:27:55 UTC (rev 149416)
@@ -1,62 +0,0 @@
-/*
- * 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 BinarySemaphore_h
-#define BinarySemaphore_h
-
-#include <wtf/Noncopyable.h>
-#include <wtf/ThreadingPrimitives.h>
-
-namespace CoreIPC {
-
-class BinarySemaphore {
-    WTF_MAKE_NONCOPYABLE(BinarySemaphore);
-
-public:
-    BinarySemaphore();
-    ~BinarySemaphore();
-
-    void signal();
-    bool wait(double absoluteTime);
-
-#if OS(WINDOWS)
-    HANDLE event() const { return m_event; }
-#endif
-
-private:
-#if OS(WINDOWS)
-    HANDLE m_event;
-#else
-    bool m_isSet;
-
-    Mutex m_mutex;
-    ThreadCondition m_condition;
-#endif
-};
-
-} // namespace CoreIPC
-
-
-#endif // BinarySemaphore_h

Modified: trunk/Source/WebKit2/Platform/CoreIPC/Connection.cpp (149415 => 149416)


--- trunk/Source/WebKit2/Platform/CoreIPC/Connection.cpp	2013-05-01 00:02:12 UTC (rev 149415)
+++ trunk/Source/WebKit2/Platform/CoreIPC/Connection.cpp	2013-05-01 00:27:55 UTC (rev 149416)
@@ -26,11 +26,11 @@
 #include "config.h"
 #include "Connection.h"
 
-#include "BinarySemaphore.h"
 #include <WebCore/RunLoop.h>
 #include <wtf/CurrentTime.h>
 #include <wtf/HashSet.h>
 #include <wtf/text/WTFString.h>
+#include <wtf/threads/BinarySemaphore.h>
 
 using namespace WebCore;
 

Modified: trunk/Source/WebKit2/Platform/CoreIPC/Connection.h (149415 => 149416)


--- trunk/Source/WebKit2/Platform/CoreIPC/Connection.h	2013-05-01 00:02:12 UTC (rev 149415)
+++ trunk/Source/WebKit2/Platform/CoreIPC/Connection.h	2013-05-01 00:27:55 UTC (rev 149416)
@@ -34,6 +34,7 @@
 #include "MessageReceiver.h"
 #include "WorkQueue.h"
 #include <wtf/Deque.h>
+#include <wtf/Forward.h>
 #include <wtf/PassRefPtr.h>
 #include <wtf/OwnPtr.h>
 #include <wtf/Threading.h>
@@ -60,8 +61,6 @@
 
 namespace CoreIPC {
 
-class BinarySemaphore;
-    
 enum MessageSendFlags {
     // Whether this message should be dispatched when waiting for a sync reply.
     // This is the default for synchronous messages.

Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (149415 => 149416)


--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2013-05-01 00:02:12 UTC (rev 149415)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2013-05-01 00:27:55 UTC (rev 149416)
@@ -247,8 +247,6 @@
 		1AB7D78D1288CD9A00CFD08C /* WKDownload.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AB7D78B1288CD9A00CFD08C /* WKDownload.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		1AB7D78E1288CD9A00CFD08C /* WKDownload.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AB7D78C1288CD9A00CFD08C /* WKDownload.cpp */; };
 		1AC25FC212A48F6000BD2671 /* PluginProcessShim.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AC25F8A12A48E0300BD2671 /* PluginProcessShim.mm */; };
-		1AC41AC71263C88300054E94 /* BinarySemaphore.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AC41AC51263C88300054E94 /* BinarySemaphore.h */; };
-		1AC41AC81263C88300054E94 /* BinarySemaphore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC41AC61263C88300054E94 /* BinarySemaphore.cpp */; };
 		1AC4C82916B876A90069DCCD /* MessageFlags.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AC4C82816B876A90069DCCD /* MessageFlags.h */; };
 		1AC86FF3130B46D3002C1257 /* WKPluginSiteDataManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC86FF1130B46D3002C1257 /* WKPluginSiteDataManager.cpp */; };
 		1AC86FF4130B46D3002C1257 /* WKPluginSiteDataManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AC86FF2130B46D3002C1257 /* WKPluginSiteDataManager.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -1670,8 +1668,6 @@
 		1AC25F8912A48E0300BD2671 /* PluginProcessShim.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginProcessShim.h; sourceTree = "<group>"; };
 		1AC25F8A12A48E0300BD2671 /* PluginProcessShim.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PluginProcessShim.mm; sourceTree = "<group>"; };
 		1AC25FB012A48EA700BD2671 /* PluginProcessShim.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = PluginProcessShim.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
-		1AC41AC51263C88300054E94 /* BinarySemaphore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BinarySemaphore.h; sourceTree = "<group>"; };
-		1AC41AC61263C88300054E94 /* BinarySemaphore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BinarySemaphore.cpp; sourceTree = "<group>"; };
 		1AC4C82816B876A90069DCCD /* MessageFlags.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MessageFlags.h; sourceTree = "<group>"; };
 		1AC86FF1130B46D3002C1257 /* WKPluginSiteDataManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKPluginSiteDataManager.cpp; sourceTree = "<group>"; };
 		1AC86FF2130B46D3002C1257 /* WKPluginSiteDataManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKPluginSiteDataManager.h; sourceTree = "<group>"; };
@@ -3390,8 +3386,6 @@
 				BC032DA110F437D10058C15A /* Arguments.h */,
 				BCEE966A112FAF57006BCC24 /* Attachment.cpp */,
 				BCEE966B112FAF57006BCC24 /* Attachment.h */,
-				1AC41AC61263C88300054E94 /* BinarySemaphore.cpp */,
-				1AC41AC51263C88300054E94 /* BinarySemaphore.h */,
 				BC032DA210F437D10058C15A /* Connection.cpp */,
 				BC032DA310F437D10058C15A /* Connection.h */,
 				1A8EFDFD1253CB6E00F7067F /* DataReference.cpp */,
@@ -5247,7 +5241,6 @@
 				518E8EF916B2091C00E91429 /* AuthenticationManager.h in Headers */,
 				512F58A312A883AD00629530 /* AuthenticationManagerMessages.h in Headers */,
 				1A64256812DE42EC00CAAE2C /* BackingStore.h in Headers */,
-				1AC41AC71263C88300054E94 /* BinarySemaphore.h in Headers */,
 				4F601432155C5AA2001FBDE0 /* BlockingResponseMap.h in Headers */,
 				BC3065FA1259344E00E71278 /* CacheModel.h in Headers */,
 				1AA2E51D12E4C05E00BC4966 /* CGUtilities.h in Headers */,
@@ -6483,7 +6476,6 @@
 				512F58A212A883AD00629530 /* AuthenticationManagerMessageReceiver.cpp in Sources */,
 				1A64256912DE42EC00CAAE2C /* BackingStore.cpp in Sources */,
 				1A64292D12DE5F9800CAAE2C /* BackingStoreMac.mm in Sources */,
-				1AC41AC81263C88300054E94 /* BinarySemaphore.cpp in Sources */,
 				BCF18638167D071E00A1A85A /* CacheModel.cpp in Sources */,
 				1AA2E51E12E4C05E00BC4966 /* CGUtilities.cpp in Sources */,
 				1A2D957012848564001EB962 /* ChildProcess.cpp in Sources */,
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to