PluginProcess should quit immediately if idle in response to low-memory notifications
https://bugs.webkit.org/show_bug.cgi?id=109103
<rdar://problem/12679827>

Reviewed by Darin Adler.

Source/WebCore: 

This patch allows a process to set a custom callback for low memory warnings
(defaulting to the current behaviour, as implemented in releaseMemory).

MemoryPressureHandler::install is currently used for two purposes - it is
called when first initializing a low memory handler for a process, and also
used to reinstall the handler (on a delay) after the notification has occured.
Since reinstallation doesn't change the callback, split these behaviours out -
MemoryPressureHandler::initialize is added to initialization, and accepts a
custom callback, install in made private.

* WebCore.exp.in:
    - Added export for releaseMemory.
* platform/MemoryPressureHandler.cpp:
(WebCore::MemoryPressureHandler::releaseMemory):
    - Added null implementation for non-Mac builds.
* platform/MemoryPressureHandler.h:
(WebCore::MemoryPressureHandler::initialize):
    - distinguish initialization from reinstallations, allow handler to be set.
(MemoryPressureHandler):
    - Added m_lowMemoryHandler function pointer member variable.
* platform/mac/MemoryPressureHandlerMac.mm:
(WebCore::MemoryPressureHandler::respondToMemoryPressure):
    - Call m_lowMemoryHandler instead of releaseMemory.

Source/WebKit/mac: 

* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
    - MemoryPressureHandler::install is now called via MemoryPressureHandler::initialize.
(WebInstallMemoryPressureHandler):
    - MemoryPressureHandler::install is now called via MemoryPressureHandler::initialize.

Source/WebKit2: 

PluginProcess now initializes a MemoryPressureHandler for the process, providing
a custom callback which will call terminate if appropriate (if the plugin is not
currently in use).

* PluginProcess/PluginProcess.cpp:
(WebKit::PluginProcess::lowMemoryHandler):
    - Custom callback to terminate if appropriate.
(WebKit::PluginProcess::initializeProcess):
    - Initialize the MemoryPressureHandler.
(WebKit::PluginProcess::shouldTerminate):
    - This method now also needs to be callable in situations where it might return false.
* PluginProcess/PluginProcess.h:
(PluginProcess):
    - Added declaration for lowMemoryHandler.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
    - MemoryPressureHandler::install is now called via MemoryPressureHandler::initialize.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142212 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add a comment about how the SQLTransaction state machine works.
https://bugs.webkit.org/show_bug.cgi?id=109243.

Rubber stamped by Anders Carlsson.

No new tests.

* Modules/webdatabase/SQLTransactionBackend.cpp:



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