Use lambda functions in DocumentOrderedMap
https://bugs.webkit.org/show_bug.cgi?id=138376

Reviewed by Darin Adler.

Use lambda functions in DocumentOrderedMap instead of separate named
functions.

No new tests, no behavior change.

* dom/DocumentOrderedMap.cpp:
(WebCore::DocumentOrderedMap::get):
(WebCore::DocumentOrderedMap::getElementById):
(WebCore::DocumentOrderedMap::getElementByName):
(WebCore::DocumentOrderedMap::getElementByMapName):
(WebCore::DocumentOrderedMap::getElementByLowercasedMapName):
(WebCore::DocumentOrderedMap::getElementByLowercasedUsemap):
(WebCore::DocumentOrderedMap::getElementByLabelForAttribute):
(WebCore::DocumentOrderedMap::getElementByWindowNamedItem):
(WebCore::DocumentOrderedMap::getElementByDocumentNamedItem):
(WebCore::DocumentOrderedMap::getAllElementsById):
(WebCore::keyMatchesId): Deleted.
(WebCore::keyMatchesName): Deleted.
(WebCore::keyMatchesMapName): Deleted.
(WebCore::keyMatchesLowercasedMapName): Deleted.
(WebCore::keyMatchesLowercasedUsemap): Deleted.
(WebCore::keyMatchesLabelForAttribute): Deleted.
(WebCore::keyMatchesWindowNamedItem): Deleted.
(WebCore::keyMatchesDocumentNamedItem): Deleted.
* dom/DocumentOrderedMap.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175697 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] WebProcess needs to take a background task assertion to prevent being killed
for "suspended with locked system files"
https://bugs.webkit.org/show_bug.cgi?id=138155
<rdar://problem/17939303>

Reviewed by Anders Carlsson.

Mitigates an issue where the WebProcess may be killed when suspended holding locked files
by allowing the WebProcess to notify the UIProcess when it is holding such files so that
both can continue to run for a period of time after the UIProcess transitions to the
background. In particular, the WebProcess notifies the UIProcess that it is holding- or
relinquished- a locked file when it begins and ends a sequence of SQLite transactions,
respectively.

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::disconnect): Relinquish an existing background task assertion
when the WebProcess disconnects. Among other situations, the WebProcess may disconnect as
a result of being suspended holding locked files even when the UIProcess requested a
background task assertion (i.e. it may have exceeded its background time limit).
(WebKit::WebProcessProxy::setIsHoldingLockedFiles): Added. Either acquires a new background
task assertion or relinquishes an existing one.
* UIProcess/WebProcessProxy.h:
* UIProcess/WebProcessProxy.messages.in: Added message SetIsHoldingLockedFiles(bool). The WebProcess
dispatches this message to inform the UIProcess that it is holding- or relinquished- a locked file.
* WebKit2.xcodeproj/project.pbxproj: Added files WebSQLiteDatabaseTracker.{cpp, h}.
* WebProcess/WebCoreSupport/WebSQLiteDatabaseTracker.cpp: Added.
(WebKit::WebSQLiteDatabaseTracker::supplementName): Added.
(WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker): Added.
(WebKit::WebSQLiteDatabaseTracker::initialize): Register to receive SQLiteDatabaseTrackerClient callbacks.
(WebKit::WebSQLiteDatabaseTracker::willBeginFirstTransaction): Inform the HysteresisActivity object on
the main thread that we began a transaction so that it calls WebSQLiteDatabaseTracker::started().
(WebKit::WebSQLiteDatabaseTracker::didFinishLastTransaction): Inform the HysteresisActivity object on
the main thread that we finished a transaction so that it may eventually call WebSQLiteDatabaseTracker::stopped().
(WebKit::WebSQLiteDatabaseTracker::started): Notify the UIProcess that the WebProcess is holding
a locked file.
(WebKit::WebSQLiteDatabaseTracker::stopped): Notify the UIProcess that the WebProcess has
relinquished the locked file.
* WebProcess/WebCoreSupport/WebSQLiteDatabaseTracker.h: Added. We use a HysteresisActivity object
to coalesce SetIsHoldingLockedFiles(false) messages as an optimization to minimize the number of
messages exchanged between the UIProcess and WebProcess when a web page performs SQLite transactions
in batches.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::WebProcess): Instantiate the supplement WebSQLiteDatabaseTracker when building
for iOS.

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