Diff
Modified: trunk/Source/WebCore/ChangeLog (185341 => 185342)
--- trunk/Source/WebCore/ChangeLog 2015-06-09 00:23:45 UTC (rev 185341)
+++ trunk/Source/WebCore/ChangeLog 2015-06-09 00:28:19 UTC (rev 185342)
@@ -1,3 +1,27 @@
+2015-06-08 Chris Dumez <[email protected]>
+
+ Access GCController instance via GCController::singleton() instead of a free function
+ https://bugs.webkit.org/show_bug.cgi?id=145776
+
+ Reviewed by Darin Adler.
+
+ Access GCController instance via GCController::singleton() instead of a
+ free function as per coding style and for consistency with other
+ singleton classes in the codebase.
+
+ * bindings/js/GCController.cpp:
+ (WebCore::GCController::singleton):
+ (WebCore::gcController): Deleted.
+ * bindings/js/GCController.h:
+ * bindings/js/JSDOMWindowShell.cpp:
+ (WebCore::JSDOMWindowShell::setWindow):
+ * bindings/js/ScriptCachedFrameData.cpp:
+ (WebCore::ScriptCachedFrameData::clear):
+ * bindings/js/ScriptController.cpp:
+ (WebCore::collectGarbageAfterWindowShellDestruction):
+ * platform/MemoryPressureHandler.cpp:
+ (WebCore::MemoryPressureHandler::releaseCriticalMemory):
+
2015-06-08 Daniel Bates <[email protected]>
Mouse release on AutoFill button activates it; should only activate on click
Modified: trunk/Source/WebCore/bindings/js/GCController.cpp (185341 => 185342)
--- trunk/Source/WebCore/bindings/js/GCController.cpp 2015-06-09 00:23:45 UTC (rev 185341)
+++ trunk/Source/WebCore/bindings/js/GCController.cpp 2015-06-09 00:28:19 UTC (rev 185342)
@@ -32,6 +32,7 @@
#include <heap/Heap.h>
#include <wtf/StdLibExtras.h>
#include <wtf/FastMalloc.h>
+#include <wtf/NeverDestroyed.h>
using namespace JSC;
@@ -43,10 +44,10 @@
JSDOMWindow::commonVM().heap.collectAllGarbage();
}
-GCController& gcController()
+GCController& GCController::singleton()
{
- DEPRECATED_DEFINE_STATIC_LOCAL(GCController, staticGCController, ());
- return staticGCController;
+ static NeverDestroyed<GCController> controller;
+ return controller;
}
GCController::GCController()
Modified: trunk/Source/WebCore/bindings/js/GCController.h (185341 => 185342)
--- trunk/Source/WebCore/bindings/js/GCController.h 2015-06-09 00:23:45 UTC (rev 185341)
+++ trunk/Source/WebCore/bindings/js/GCController.h 2015-06-09 00:28:19 UTC (rev 185342)
@@ -26,36 +26,34 @@
#ifndef GCController_h
#define GCController_h
-#include <wtf/FastMalloc.h>
+#include <wtf/Forward.h>
#include <wtf/Noncopyable.h>
#include "Timer.h"
namespace WebCore {
- class GCController {
- WTF_MAKE_NONCOPYABLE(GCController); WTF_MAKE_FAST_ALLOCATED;
- WEBCORE_EXPORT friend GCController& gcController();
+class GCController {
+ WTF_MAKE_NONCOPYABLE(GCController);
+ friend class WTF::NeverDestroyed<GCController>;
+public:
+ WEBCORE_EXPORT static GCController& singleton();
- public:
- WEBCORE_EXPORT void garbageCollectSoon();
- WEBCORE_EXPORT void garbageCollectNow(); // It's better to call garbageCollectSoon, unless you have a specific reason not to.
- void garbageCollectOnNextRunLoop();
+ WEBCORE_EXPORT void garbageCollectSoon();
+ WEBCORE_EXPORT void garbageCollectNow(); // It's better to call garbageCollectSoon, unless you have a specific reason not to.
+ void garbageCollectOnNextRunLoop();
- WEBCORE_EXPORT void garbageCollectOnAlternateThreadForDebugging(bool waitUntilDone); // Used for stress testing.
- WEBCORE_EXPORT void releaseExecutableMemory();
- WEBCORE_EXPORT void setJavaScriptGarbageCollectorTimerEnabled(bool);
- WEBCORE_EXPORT void discardAllCompiledCode();
+ WEBCORE_EXPORT void garbageCollectOnAlternateThreadForDebugging(bool waitUntilDone); // Used for stress testing.
+ WEBCORE_EXPORT void releaseExecutableMemory();
+ WEBCORE_EXPORT void setJavaScriptGarbageCollectorTimerEnabled(bool);
+ WEBCORE_EXPORT void discardAllCompiledCode();
- private:
- GCController(); // Use gcController() instead
+private:
+ GCController(); // Use singleton() instead.
- void gcTimerFired();
- Timer m_GCTimer;
- };
+ void gcTimerFired();
+ Timer m_GCTimer;
+};
- // Function to obtain the global GC controller.
- WEBCORE_EXPORT GCController& gcController() PURE_FUNCTION;
-
} // namespace WebCore
#endif // GCController_h
Modified: trunk/Source/WebCore/bindings/js/JSDOMWindowShell.cpp (185341 => 185342)
--- trunk/Source/WebCore/bindings/js/JSDOMWindowShell.cpp 2015-06-09 00:23:45 UTC (rev 185341)
+++ trunk/Source/WebCore/bindings/js/JSDOMWindowShell.cpp 2015-06-09 00:28:19 UTC (rev 185342)
@@ -66,7 +66,7 @@
ASSERT_ARG(window, window);
setTarget(vm, window);
structure()->setGlobalObject(vm, window);
- gcController().garbageCollectSoon();
+ GCController::singleton().garbageCollectSoon();
}
void JSDOMWindowShell::setWindow(PassRefPtr<DOMWindow> domWindow)
Modified: trunk/Source/WebCore/bindings/js/ScriptCachedFrameData.cpp (185341 => 185342)
--- trunk/Source/WebCore/bindings/js/ScriptCachedFrameData.cpp 2015-06-09 00:23:45 UTC (rev 185341)
+++ trunk/Source/WebCore/bindings/js/ScriptCachedFrameData.cpp 2015-06-09 00:28:19 UTC (rev 185342)
@@ -109,7 +109,7 @@
JSLockHolder lock(JSDOMWindowBase::commonVM());
m_windows.clear();
- gcController().garbageCollectSoon();
+ GCController::singleton().garbageCollectSoon();
}
} // namespace WebCore
Modified: trunk/Source/WebCore/bindings/js/ScriptController.cpp (185341 => 185342)
--- trunk/Source/WebCore/bindings/js/ScriptController.cpp 2015-06-09 00:23:45 UTC (rev 185341)
+++ trunk/Source/WebCore/bindings/js/ScriptController.cpp 2015-06-09 00:28:19 UTC (rev 185342)
@@ -69,9 +69,9 @@
if (MemoryPressureHandler::singleton().isUnderMemoryPressure()) {
// NOTE: We do the collection on next runloop to ensure that there's no pointer
// to the window object on the stack.
- gcController().garbageCollectOnNextRunLoop();
+ GCController::singleton().garbageCollectOnNextRunLoop();
} else
- gcController().garbageCollectSoon();
+ GCController::singleton().garbageCollectSoon();
}
void ScriptController::initializeThreading()
Modified: trunk/Source/WebCore/platform/MemoryPressureHandler.cpp (185341 => 185342)
--- trunk/Source/WebCore/platform/MemoryPressureHandler.cpp 2015-06-09 00:23:45 UTC (rev 185341)
+++ trunk/Source/WebCore/platform/MemoryPressureHandler.cpp 2015-06-09 00:28:19 UTC (rev 185342)
@@ -128,7 +128,7 @@
{
ReliefLogger log("Discard all JIT-compiled code");
- gcController().discardAllCompiledCode();
+ GCController::singleton().discardAllCompiledCode();
}
{
@@ -138,11 +138,11 @@
if (synchronous == Synchronous::Yes) {
ReliefLogger log("Collecting _javascript_ garbage");
- gcController().garbageCollectNow();
+ GCController::singleton().garbageCollectNow();
} else {
// FIXME: We should do a garbage sweep and prune dead resources from the MemoryCache
// after the garbage collection has completed to free up more memory.
- gcController().garbageCollectSoon();
+ GCController::singleton().garbageCollectSoon();
// Do a full sweep of collected objects. garbageCollectNow() already does this so we only
// need to do this if it isn't called.
Modified: trunk/Source/WebKit/mac/ChangeLog (185341 => 185342)
--- trunk/Source/WebKit/mac/ChangeLog 2015-06-09 00:23:45 UTC (rev 185341)
+++ trunk/Source/WebKit/mac/ChangeLog 2015-06-09 00:28:19 UTC (rev 185342)
@@ -1,3 +1,23 @@
+2015-06-08 Chris Dumez <[email protected]>
+
+ Access GCController instance via GCController::singleton() instead of a free function
+ https://bugs.webkit.org/show_bug.cgi?id=145776
+
+ Reviewed by Darin Adler.
+
+ Access GCController instance via GCController::singleton() instead of a
+ free function as per coding style and for consistency with other
+ singleton classes in the codebase.
+
+ * Misc/WebCoreStatistics.mm:
+ (+[WebCoreStatistics garbageCollectJavaScriptObjects]):
+ (+[WebCoreStatistics garbageCollectJavaScriptObjectsOnAlternateThreadForDebugging:]):
+ (+[WebCoreStatistics setJavaScriptGarbageCollectorTimerEnabled:]):
+ * WebView/WebView.mm:
+ (+[WebView garbageCollectNow]):
+ (+[WebView discardAllCompiledCode]):
+ (-[WebView _close]):
+
2015-06-08 Anders Carlsson <[email protected]>
Remove more unused Objective-C methods
Modified: trunk/Source/WebKit/mac/Misc/WebCoreStatistics.mm (185341 => 185342)
--- trunk/Source/WebKit/mac/Misc/WebCoreStatistics.mm 2015-06-09 00:23:45 UTC (rev 185341)
+++ trunk/Source/WebKit/mac/Misc/WebCoreStatistics.mm 2015-06-09 00:28:19 UTC (rev 185342)
@@ -112,17 +112,17 @@
+ (void)garbageCollectJavaScriptObjects
{
- gcController().garbageCollectNow();
+ GCController::singleton().garbageCollectNow();
}
+ (void)garbageCollectJavaScriptObjectsOnAlternateThreadForDebugging:(BOOL)waitUntilDone
{
- gcController().garbageCollectOnAlternateThreadForDebugging(waitUntilDone);
+ GCController::singleton().garbageCollectOnAlternateThreadForDebugging(waitUntilDone);
}
+ (void)setJavaScriptGarbageCollectorTimerEnabled:(BOOL)enable
{
- gcController().setJavaScriptGarbageCollectorTimerEnabled(enable);
+ GCController::singleton().setJavaScriptGarbageCollectorTimerEnabled(enable);
}
+ (size_t)iconPageURLMappingCount
Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (185341 => 185342)
--- trunk/Source/WebKit/mac/WebView/WebView.mm 2015-06-09 00:23:45 UTC (rev 185341)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm 2015-06-09 00:28:19 UTC (rev 185342)
@@ -1350,7 +1350,7 @@
{
ASSERT(WebThreadIsCurrent());
WebKit::MemoryMeasure measurer("Memory warning: Calling _javascript_ GC.");
- gcController().garbageCollectNow();
+ GCController::singleton().garbageCollectNow();
}
+ (void)purgeInactiveFontData
@@ -1371,7 +1371,7 @@
{
ASSERT(WebThreadIsCurrent());
WebKit::MemoryMeasure measurer("Memory warning: Discarding JIT'ed code.");
- gcController().discardAllCompiledCode();
+ GCController::singleton().discardAllCompiledCode();
}
+ (BOOL)isCharacterSmartReplaceExempt:(unichar)character isPreviousCharacter:(BOOL)b
@@ -1802,7 +1802,7 @@
#ifndef NDEBUG
// Need this to make leak messages accurate.
if (applicationIsTerminating) {
- gcController().garbageCollectNow();
+ GCController::singleton().garbageCollectNow();
[WebCache setDisabled:YES];
}
#endif
Modified: trunk/Source/WebKit/win/ChangeLog (185341 => 185342)
--- trunk/Source/WebKit/win/ChangeLog 2015-06-09 00:23:45 UTC (rev 185341)
+++ trunk/Source/WebKit/win/ChangeLog 2015-06-09 00:28:19 UTC (rev 185342)
@@ -1,3 +1,22 @@
+2015-06-08 Chris Dumez <[email protected]>
+
+ Access GCController instance via GCController::singleton() instead of a free function
+ https://bugs.webkit.org/show_bug.cgi?id=145776
+
+ Reviewed by Darin Adler.
+
+ Access GCController instance via GCController::singleton() instead of a
+ free function as per coding style and for consistency with other
+ singleton classes in the codebase.
+
+ * WebCoreStatistics.cpp:
+ (WebCoreStatistics::garbageCollectJavaScriptObjects):
+ (WebCoreStatistics::garbageCollectJavaScriptObjectsOnAlternateThreadForDebugging):
+ (WebCoreStatistics::setJavaScriptGarbageCollectorTimerEnabled):
+ * WebJavaScriptCollector.cpp:
+ (WebJavaScriptCollector::collect):
+ (WebJavaScriptCollector::collectOnAlternateThread):
+
2015-06-05 Mark Lam <[email protected]>
finally blocks should not set the exception stack trace when re-throwing the exception.
Modified: trunk/Source/WebKit/win/WebCoreStatistics.cpp (185341 => 185342)
--- trunk/Source/WebKit/win/WebCoreStatistics.cpp 2015-06-09 00:23:45 UTC (rev 185341)
+++ trunk/Source/WebKit/win/WebCoreStatistics.cpp 2015-06-09 00:28:19 UTC (rev 185342)
@@ -246,19 +246,19 @@
HRESULT WebCoreStatistics::garbageCollectJavaScriptObjects()
{
- gcController().garbageCollectNow();
+ GCController::singleton().garbageCollectNow();
return S_OK;
}
HRESULT WebCoreStatistics::garbageCollectJavaScriptObjectsOnAlternateThreadForDebugging(BOOL waitUntilDone)
{
- gcController().garbageCollectOnAlternateThreadForDebugging(waitUntilDone);
+ GCController::singleton().garbageCollectOnAlternateThreadForDebugging(waitUntilDone);
return S_OK;
}
HRESULT WebCoreStatistics::setJavaScriptGarbageCollectorTimerEnabled(BOOL enable)
{
- gcController().setJavaScriptGarbageCollectorTimerEnabled(enable);
+ GCController::singleton().setJavaScriptGarbageCollectorTimerEnabled(enable);
return S_OK;
}
Modified: trunk/Source/WebKit/win/WebJavaScriptCollector.cpp (185341 => 185342)
--- trunk/Source/WebKit/win/WebJavaScriptCollector.cpp 2015-06-09 00:23:45 UTC (rev 185341)
+++ trunk/Source/WebKit/win/WebJavaScriptCollector.cpp 2015-06-09 00:28:19 UTC (rev 185342)
@@ -91,14 +91,14 @@
HRESULT STDMETHODCALLTYPE WebJavaScriptCollector::collect()
{
- gcController().garbageCollectNow();
+ GCController::singleton().garbageCollectNow();
return S_OK;
}
HRESULT STDMETHODCALLTYPE WebJavaScriptCollector::collectOnAlternateThread(
/* [in] */ BOOL waitUntilDone)
{
- gcController().garbageCollectOnAlternateThreadForDebugging(!!waitUntilDone);
+ GCController::singleton().garbageCollectOnAlternateThreadForDebugging(!!waitUntilDone);
return S_OK;
}
Modified: trunk/Source/WebKit2/ChangeLog (185341 => 185342)
--- trunk/Source/WebKit2/ChangeLog 2015-06-09 00:23:45 UTC (rev 185341)
+++ trunk/Source/WebKit2/ChangeLog 2015-06-09 00:28:19 UTC (rev 185342)
@@ -1,3 +1,23 @@
+2015-06-08 Chris Dumez <[email protected]>
+
+ Access GCController instance via GCController::singleton() instead of a free function
+ https://bugs.webkit.org/show_bug.cgi?id=145776
+
+ Reviewed by Darin Adler.
+
+ Access GCController instance via GCController::singleton() instead of a
+ free function as per coding style and for consistency with other
+ singleton classes in the codebase.
+
+ * WebProcess/InjectedBundle/InjectedBundle.cpp:
+ (WebKit::InjectedBundle::garbageCollectJavaScriptObjects):
+ (WebKit::InjectedBundle::garbageCollectJavaScriptObjectsOnAlternateThreadForDebugging):
+ * WebProcess/WebProcess.cpp:
+ (WebKit::WebProcess::terminate):
+ (WebKit::WebProcess::didClose):
+ (WebKit::WebProcess::garbageCollectJavaScriptObjects):
+ (WebKit::WebProcess::setJavaScriptGarbageCollectorTimerEnabled):
+
2015-06-08 Anders Carlsson <[email protected]>
Include IndexedDB databases in -[WKWebsiteDataStore allWebsiteDataTypes]
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp (185341 => 185342)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp 2015-06-09 00:23:45 UTC (rev 185341)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp 2015-06-09 00:28:19 UTC (rev 185342)
@@ -497,12 +497,12 @@
void InjectedBundle::garbageCollectJavaScriptObjects()
{
- gcController().garbageCollectNow();
+ GCController::singleton().garbageCollectNow();
}
void InjectedBundle::garbageCollectJavaScriptObjectsOnAlternateThreadForDebugging(bool waitUntilDone)
{
- gcController().garbageCollectOnAlternateThreadForDebugging(waitUntilDone);
+ GCController::singleton().garbageCollectOnAlternateThreadForDebugging(waitUntilDone);
}
size_t InjectedBundle::_javascript_ObjectsCount()
Modified: trunk/Source/WebKit2/WebProcess/WebProcess.cpp (185341 => 185342)
--- trunk/Source/WebKit2/WebProcess/WebProcess.cpp 2015-06-09 00:23:45 UTC (rev 185341)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.cpp 2015-06-09 00:28:19 UTC (rev 185342)
@@ -591,7 +591,7 @@
void WebProcess::terminate()
{
#ifndef NDEBUG
- gcController().garbageCollectNow();
+ GCController::singleton().garbageCollectNow();
FontCache::singleton().invalidate();
MemoryCache::singleton().setDisabled(true);
#endif
@@ -655,7 +655,7 @@
page->close();
pages.clear();
- gcController().garbageCollectSoon();
+ GCController::singleton().garbageCollectSoon();
FontCache::singleton().invalidate();
MemoryCache::singleton().setDisabled(true);
#endif
@@ -980,12 +980,12 @@
void WebProcess::garbageCollectJavaScriptObjects()
{
- gcController().garbageCollectNow();
+ GCController::singleton().garbageCollectNow();
}
void WebProcess::setJavaScriptGarbageCollectorTimerEnabled(bool flag)
{
- gcController().setJavaScriptGarbageCollectorTimerEnabled(flag);
+ GCController::singleton().setJavaScriptGarbageCollectorTimerEnabled(flag);
}
void WebProcess::handleInjectedBundleMessage(const String& messageName, const UserData& messageBody)