Title: [154028] trunk/Source/WebCore
Revision
154028
Author
[email protected]
Date
2013-08-13 15:50:35 -0700 (Tue, 13 Aug 2013)

Log Message

<https://webkit.org/b/119771> Use NeverDestroyed for smart pointer slot static locals

Reviewed by Andreas Kling.

This is preparation for making it a hard error to use DEFINE_STATIC_LOCAL with smart pointer types.

* dom/UserTypingGestureIndicator.cpp:
(WebCore::focusedNode):
* page/mac/EventHandlerMac.mm:
(WebCore::currentNSEventSlot):
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::defaultNetworkStorageSession):
(WebCore::cookieStorageOverride):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (154027 => 154028)


--- trunk/Source/WebCore/ChangeLog	2013-08-13 22:48:43 UTC (rev 154027)
+++ trunk/Source/WebCore/ChangeLog	2013-08-13 22:50:35 UTC (rev 154028)
@@ -1,5 +1,21 @@
 2013-08-13  Anders Carlsson  <[email protected]>
 
+        <https://webkit.org/b/119771> Use NeverDestroyed for smart pointer slot static locals
+
+        Reviewed by Andreas Kling.
+
+        This is preparation for making it a hard error to use DEFINE_STATIC_LOCAL with smart pointer types.
+
+        * dom/UserTypingGestureIndicator.cpp:
+        (WebCore::focusedNode):
+        * page/mac/EventHandlerMac.mm:
+        (WebCore::currentNSEventSlot):
+        * platform/network/cf/NetworkStorageSessionCFNet.cpp:
+        (WebCore::defaultNetworkStorageSession):
+        (WebCore::cookieStorageOverride):
+
+2013-08-13  Anders Carlsson  <[email protected]>
+
         Stop using DEFINE_STATIC_LOCAL with RefPtr
         https://bugs.webkit.org/show_bug.cgi?id=119769
 

Modified: trunk/Source/WebCore/dom/UserTypingGestureIndicator.cpp (154027 => 154028)


--- trunk/Source/WebCore/dom/UserTypingGestureIndicator.cpp	2013-08-13 22:48:43 UTC (rev 154027)
+++ trunk/Source/WebCore/dom/UserTypingGestureIndicator.cpp	2013-08-13 22:50:35 UTC (rev 154028)
@@ -29,7 +29,7 @@
 #include "Document.h"
 #include "Element.h"
 #include "Frame.h"
-#include <wtf/StdLibExtras.h>
+#include <wtf/NeverDestroyed.h>
 
 namespace WebCore {
 
@@ -41,7 +41,7 @@
 
 static RefPtr<Node>& focusedNode()
 {
-    DEFINE_STATIC_LOCAL(RefPtr<Node>, node, ());
+    static NeverDestroyed<RefPtr<Node>> node;
     return node;
 }
 

Modified: trunk/Source/WebCore/page/mac/EventHandlerMac.mm (154027 => 154028)


--- trunk/Source/WebCore/page/mac/EventHandlerMac.mm	2013-08-13 22:48:43 UTC (rev 154027)
+++ trunk/Source/WebCore/page/mac/EventHandlerMac.mm	2013-08-13 22:50:35 UTC (rev 154028)
@@ -49,8 +49,8 @@
 #include "Settings.h"
 #include "WebCoreSystemInterface.h"
 #include <wtf/MainThread.h>
+#include <wtf/NeverDestroyed.h>
 #include <wtf/ObjcRuntimeExtras.h>
-#include <wtf/StdLibExtras.h>
 
 namespace WebCore {
 
@@ -60,7 +60,7 @@
 
 static RetainPtr<NSEvent>& currentNSEventSlot()
 {
-    DEFINE_STATIC_LOCAL(RetainPtr<NSEvent>, event, ());
+    static NeverDestroyed<RetainPtr<NSEvent>> event;
     return event;
 }
 

Modified: trunk/Source/WebCore/platform/network/cf/NetworkStorageSessionCFNet.cpp (154027 => 154028)


--- trunk/Source/WebCore/platform/network/cf/NetworkStorageSessionCFNet.cpp	2013-08-13 22:48:43 UTC (rev 154027)
+++ trunk/Source/WebCore/platform/network/cf/NetworkStorageSessionCFNet.cpp	2013-08-13 22:50:35 UTC (rev 154028)
@@ -27,6 +27,7 @@
 #include "NetworkStorageSession.h"
 
 #include <wtf/MainThread.h>
+#include <wtf/NeverDestroyed.h>
 #include <wtf/PassOwnPtr.h>
 
 #if PLATFORM(MAC)
@@ -46,7 +47,7 @@
 static OwnPtr<NetworkStorageSession>& defaultNetworkStorageSession()
 {
     ASSERT(isMainThread());
-    DEFINE_STATIC_LOCAL(OwnPtr<NetworkStorageSession>, session, ());
+    static NeverDestroyed<OwnPtr<NetworkStorageSession>> session;
     return session;
 }
 
@@ -64,7 +65,7 @@
 #if PLATFORM(WIN)
 static RetainPtr<CFHTTPCookieStorageRef>& cookieStorageOverride()
 {
-    DEFINE_STATIC_LOCAL(RetainPtr<CFHTTPCookieStorageRef>, cookieStorage, ());
+    static NeverDestroyed<RetainPtr<CFHTTPCookieStorageRef>> cookieStorage;
     return cookieStorage;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to