Unreviewed, rolling out r142212.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Feb 2013 05:32:45 +0000 (05:32 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Feb 2013 05:32:45 +0000 (05:32 +0000)
http://trac.webkit.org/changeset/142212
https://bugs.webkit.org/show_bug.cgi?id=109255

Causes ASSERT(!m_installed) on launch (Requested by smfr on
#webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2013-02-07

Source/WebCore:

* WebCore.exp.in:
* platform/MemoryPressureHandler.cpp:
(WebCore):
(WebCore::MemoryPressureHandler::respondToMemoryPressure):
* platform/MemoryPressureHandler.h:
(MemoryPressureHandler):
* platform/mac/MemoryPressureHandlerMac.mm:
(WebCore::MemoryPressureHandler::respondToMemoryPressure):

Source/WebKit/mac:

* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
(WebInstallMemoryPressureHandler):

Source/WebKit2:

* PluginProcess/PluginProcess.cpp:
(WebKit::PluginProcess::initializeProcess):
(WebKit::PluginProcess::shouldTerminate):
* PluginProcess/PluginProcess.h:
(PluginProcess):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):

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

Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/platform/MemoryPressureHandler.cpp
Source/WebCore/platform/MemoryPressureHandler.h
Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit2/ChangeLog
Source/WebKit2/PluginProcess/PluginProcess.cpp
Source/WebKit2/PluginProcess/PluginProcess.h
Source/WebKit2/WebProcess/WebProcess.cpp

index f1c5704ed5e6b974bdea334a36f811dd3e7f4cc8..0e712e8d4b93d6d4a10bcace7e221d57b19d7ea4 100644 (file)
@@ -1,3 +1,21 @@
+2013-02-07  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r142212.
+        http://trac.webkit.org/changeset/142212
+        https://bugs.webkit.org/show_bug.cgi?id=109255
+
+        Causes ASSERT(!m_installed) on launch (Requested by smfr on
+        #webkit).
+
+        * WebCore.exp.in:
+        * platform/MemoryPressureHandler.cpp:
+        (WebCore):
+        (WebCore::MemoryPressureHandler::respondToMemoryPressure):
+        * platform/MemoryPressureHandler.h:
+        (MemoryPressureHandler):
+        * platform/mac/MemoryPressureHandlerMac.mm:
+        (WebCore::MemoryPressureHandler::respondToMemoryPressure):
+
 2013-02-07  Hanyee Kim  <choco@company100.net>
 
         NamedFlowCollection should be a ContextDestructionObserver
index 8ec7bf489da6c3fdf0f227fd257d5cf09206c449..2c3ef93a7c3f14643a1d78d3e9cf9da01eb85faa 100644 (file)
@@ -600,7 +600,6 @@ __ZN7WebCore20makeRGBA32FromFloatsEffff
 __ZN7WebCore20protocolIsJavaScriptERKN3WTF6StringE
 __ZN7WebCore20SpaceSplitStringDataD1Ev
 __ZN7WebCore21BackForwardController11itemAtIndexEi
-__ZN7WebCore21MemoryPressureHandler13releaseMemoryEb
 __ZN7WebCore21MemoryPressureHandler7installEv
 __ZN7WebCore21NetworkStorageSession28createPrivateBrowsingSessionERKN3WTF6StringE
 __ZN7WebCore21PlatformKeyboardEvent24disambiguateKeyDownEventENS_13PlatformEvent4TypeEb
index 5945bea37772f0777b7a8cca453a536b2f518f1a..614ec36d671f0600c29bcc82a903132b9ff385ed 100644 (file)
@@ -43,13 +43,13 @@ MemoryPressureHandler::MemoryPressureHandler()
 }
 
 #if !PLATFORM(MAC) || PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED == 1060
-
 void MemoryPressureHandler::install() { }
+
 void MemoryPressureHandler::uninstall() { }
+
 void MemoryPressureHandler::holdOff(unsigned) { }
-void MemoryPressureHandler::respondToMemoryPressure() { }
-void MemoryPressureHandler::releaseMemory(bool) { }
 
+void MemoryPressureHandler::respondToMemoryPressure() { }
 #endif
  
 } // namespace WebCore
index dc2f86082735503105512ad5c88138cd695e19a3..d894f841dba8cc6b6d242f2a7ac2f74060cf997c 100644 (file)
 
 namespace WebCore {
 
-typedef void (*LowMemoryHandler)(bool critical);
-
 class MemoryPressureHandler {
     WTF_MAKE_FAST_ALLOCATED;
 public:
     friend MemoryPressureHandler& memoryPressureHandler();
 
-    void initialize(LowMemoryHandler handler = releaseMemory)
-    {
-        ASSERT(!m_installed);
-        m_lowMemoryHandler = handler;
-        install();
-    }
-
-private:
     void install();
     void uninstall();
 
     void holdOff(unsigned);
 
+private:
     MemoryPressureHandler();
     ~MemoryPressureHandler();
 
     void respondToMemoryPressure();
-    static void releaseMemory(bool critical);
+    void releaseMemory(bool critical);
 
     bool m_installed;
     time_t m_lastRespondTime;
-    LowMemoryHandler m_lowMemoryHandler;
 };
  
 // Function to obtain the global memory pressure object.
index 3dbbd4968b7bbf8a95244b74a2dc079712eb8c96..161b89c1fcd79067eb1b83dc412eb3e52803fbde 100644 (file)
@@ -134,8 +134,7 @@ void MemoryPressureHandler::respondToMemoryPressure()
 
     double startTime = monotonicallyIncreasingTime();
 
-    ASSERT(m_lowMemoryHandler);
-    m_lowMemoryHandler(false);
+    releaseMemory(false);
 
     unsigned holdOffTime = (monotonicallyIncreasingTime() - startTime) * s_holdOffMultiplier;
 
index aff9046368b680894f5632f12bdfc7286f737484..cc05691e635b3947709e08755927c8df270c9a59 100644 (file)
@@ -1,3 +1,16 @@
+2013-02-07  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r142212.
+        http://trac.webkit.org/changeset/142212
+        https://bugs.webkit.org/show_bug.cgi?id=109255
+
+        Causes ASSERT(!m_installed) on launch (Requested by smfr on
+        #webkit).
+
+        * WebView/WebView.mm:
+        (-[WebView _commonInitializationWithFrameName:groupName:]):
+        (WebInstallMemoryPressureHandler):
+
 2013-02-06  Gavin Barraclough  <barraclough@apple.com>
 
         PluginProcess should quit immediately if idle in response to low-memory notifications
index 13687b902818a9c072eab9e9f8686e762279b9e7..fc2cb3a909eaf459066430648505496a980322f8 100644 (file)
@@ -819,7 +819,7 @@ static bool shouldRespectPriorityInCSSAttributeSetters()
     [self _preferencesChanged:[self preferences]];
     [[self preferences] _postPreferencesChangedAPINotification];
 
-    memoryPressureHandler().initialize();
+    memoryPressureHandler().install();
 
     if (!WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_LOCAL_RESOURCE_SECURITY_RESTRICTION)) {
         // Originally, we allowed all local loads.
@@ -6734,7 +6734,7 @@ static void glibContextIterationCallback(CFRunLoopObserverRef, CFRunLoopActivity
 
 void WebInstallMemoryPressureHandler(void)
 {
-    memoryPressureHandler().initialize();
+    memoryPressureHandler().install();
 }
 
 #if __MAC_OS_X_VERSION_MIN_REQUIRED == 1050
index cc66331f91ba8001afc8c86747afd84ad3d51ba6..699a2775ed5745895581c60f33398cc073cd00f3 100644 (file)
@@ -1,3 +1,20 @@
+2013-02-07  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r142212.
+        http://trac.webkit.org/changeset/142212
+        https://bugs.webkit.org/show_bug.cgi?id=109255
+
+        Causes ASSERT(!m_installed) on launch (Requested by smfr on
+        #webkit).
+
+        * PluginProcess/PluginProcess.cpp:
+        (WebKit::PluginProcess::initializeProcess):
+        (WebKit::PluginProcess::shouldTerminate):
+        * PluginProcess/PluginProcess.h:
+        (PluginProcess):
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::initializeWebProcess):
+
 2013-02-07  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
 
         [EFL][WK2] Remove dead code after r142169
index c11ba6cb37769a34c14584ded70b7cb8cee908ed..20d094afb2bda692efb0ead97e1695b6ef50e972 100644 (file)
@@ -36,7 +36,6 @@
 #include "PluginProcessCreationParameters.h"
 #include "PluginProcessProxyMessages.h"
 #include "WebProcessConnection.h"
-#include <WebCore/MemoryPressureHandler.h>
 #include <WebCore/NotImplemented.h>
 #include <WebCore/RunLoop.h>
 
@@ -86,18 +85,10 @@ PluginProcess::~PluginProcess()
 {
 }
 
-void PluginProcess::lowMemoryHandler(bool)
-{
-    if (shared().shouldTerminate())
-        shared().terminate();
-}
-
 void PluginProcess::initializeProcess(const ChildProcessInitializationParameters& parameters)
 {
     m_pluginPath = parameters.extraInitializationData.get("plugin-path");
     platformInitializeProcess(parameters);
-
-    memoryPressureHandler().initialize(lowMemoryHandler);
 }
 
 void PluginProcess::removeWebProcessConnection(WebProcessConnection* webProcessConnection)
@@ -134,7 +125,9 @@ NetscapePluginModule* PluginProcess::netscapePluginModule()
 
 bool PluginProcess::shouldTerminate()
 {
-    return m_webProcessConnections.isEmpty();
+    ASSERT(m_webProcessConnections.isEmpty());
+
+    return true;
 }
 
 void PluginProcess::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageDecoder& decoder)
index c9699efee0ed337d7dbc89bd4d0e9161c54fa2d8..72fbc75c816a7c082558e85b7b441e09b4de6cf7 100644 (file)
@@ -108,8 +108,6 @@ private:
     // The Mach port used for accelerated compositing.
     mach_port_t m_compositingRenderServerPort;
 #endif
-
-    static void lowMemoryHandler(bool critical);
 };
 
 } // namespace WebKit
index 28486b223c94995d5c24c48d88388fd300519409..490f3190a44f044af25099951fbac59ff1ba7fbc 100644 (file)
@@ -244,7 +244,7 @@ void WebProcess::initializeWebProcess(const WebProcessCreationParameters& parame
 
     platformInitializeWebProcess(parameters, decoder);
 
-    memoryPressureHandler().initialize();
+    memoryPressureHandler().install();
 
     RefPtr<APIObject> injectedBundleInitializationUserData;
     InjectedBundleUserMessageDecoder messageDecoder(injectedBundleInitializationUserData);