471kB below StyleSheetContents::parserAppendRule() on Membuster3.
<http://webkit.org/b/97916>

Reviewed by Anders Carlsson.

Shrink-to-fit the StyleSheetContents rule vectors at the end of CSSParser::parseSheet().
~100kB progression on Membuster3.

* css/StyleSheetContents.h:
* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::shrinkToFit):
* css/CSSParser.cpp:
(WebCore::CSSParser::parseSheet):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129907 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Implement the GetStats interface on PeerConnection
https://bugs.webkit.org/show_bug.cgi?id=95193

Source/Platform:

Patch by Harald Tveit Alvestrand <harald@alvestrand.no> on 2012-09-28
Reviewed by Adam Barth.

* chromium/public/WebRTCPeerConnectionHandler.h:
(WebKit):
(WebRTCPeerConnectionHandler):
(WebKit::WebRTCPeerConnectionHandler::getStats):
* chromium/public/WebRTCStatsRequest.h: added.
(WebCore):
(WebKit):
(WebRTCStatsRequest):
(WebKit::WebRTCStatsRequest::WebRTCStatsRequest):
(WebKit::WebRTCStatsRequest::~WebRTCStatsRequest):
(WebKit::WebRTCStatsRequest::operator=):

Source/WebCore:

Specification:
http://dev.w3.org/2011/webrtc/editor/webrtc-20120920.html

Patch by Harald Tveit Alvestrand <harald@alvestrand.no> on 2012-09-28
Reviewed by Adam Barth.

The implementation consists of a pure virtual platform object
(RTCStatsRequest) that is implemented in WebCore, and stores
its information in a straightforward data hierarchy.
This patch adds the call path and the storage structures.
It does not add filling in data.

Test: fast/mediastream/RTCPeerConnection-stats.html

* CMakeLists.txt:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::getStats):
(WebCore):
* Modules/mediastream/RTCPeerConnection.h:
(WebCore):
(RTCPeerConnection):
* Modules/mediastream/RTCPeerConnection.idl:
* Modules/mediastream/RTCStatsCallback.h: Added.
(WebCore):
(RTCStatsCallback):
(WebCore::RTCStatsCallback::~RTCStatsCallback):
* Modules/mediastream/RTCStatsCallback.idl: Added.
* Modules/mediastream/RTCStatsElement.cpp: Added.
(WebCore):
(WebCore::RTCStatsElement::create):
(WebCore::RTCStatsElement::RTCStatsElement):
(WebCore::RTCStatsElement::stat):
* Modules/mediastream/RTCStatsElement.h: Added.
(WebCore):
(RTCStatsElement):
* Modules/mediastream/RTCStatsElement.idl: Added.
* Modules/mediastream/RTCStatsReport.cpp: Added.
(WebCore):
(WebCore::RTCStatsReport::create):
(WebCore::RTCStatsReport::RTCStatsReport):
* Modules/mediastream/RTCStatsReport.h: Added.
(WebCore):
(RTCStatsReport):
(WebCore::RTCStatsReport::local):
(WebCore::RTCStatsReport::remote):
* Modules/mediastream/RTCStatsReport.idl: Added.
* Modules/mediastream/RTCStatsRequestImpl.cpp: Added.
(WebCore):
(WebCore::RTCStatsRequestImpl::create):
(WebCore::RTCStatsRequestImpl::RTCStatsRequestImpl):
(WebCore::RTCStatsRequestImpl::~RTCStatsRequestImpl):
(WebCore::RTCStatsRequestImpl::requestSucceeded):
(WebCore::RTCStatsRequestImpl::stop):
(WebCore::RTCStatsRequestImpl::clear):
* Modules/mediastream/RTCStatsRequestImpl.h: Added.
(WebCore):
(RTCStatsRequestImpl):
* Modules/mediastream/RTCStatsResponse.cpp: Added.
(WebCore):
(WebCore::RTCStatsResponse::create):
(WebCore::RTCStatsResponse::RTCStatsResponse):
* Modules/mediastream/RTCStatsResponse.h: Added.
(WebCore):
(RTCStatsResponse):
(WebCore::RTCStatsResponse::result):
* Modules/mediastream/RTCStatsResponse.idl: Added.
* WebCore.gypi:
* platform/chromium/support/WebRTCStatsRequest.cpp: Copied from Source/Platform/chromium/public/WebRTCPeerConnectionHandler.h.
(WebKit):
(WebKit::WebRTCStatsRequest::WebRTCStatsRequest):
(WebKit::WebRTCStatsRequest::assign):
(WebKit::WebRTCStatsRequest::reset):
(WebKit::WebRTCStatsRequest::requestSucceeded):
* platform/mediastream/RTCPeerConnectionHandler.h:
(WebCore):
(RTCPeerConnectionHandler):
* platform/mediastream/RTCStatsRequest.h: Copied from Source/WebCore/platform/mediastream/RTCPeerConnectionHandler.h.
(WebCore):
(RTCStatsRequest):
(WebCore::RTCStatsRequest::~RTCStatsRequest):
(WebCore::RTCStatsRequest::RTCStatsRequest):
* platform/mediastream/chromium/RTCPeerConnectionHandlerChromium.cpp:
(WebCore::RTCPeerConnectionHandlerChromium::getStats):
(WebCore):
* platform/mediastream/chromium/RTCPeerConnectionHandlerChromium.h:
(RTCPeerConnectionHandlerChromium):

Tools:

Patch by Harald Tveit Alvestrand <harald@alvestrand.no> on 2012-09-28
Reviewed by Adam Barth.

* DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.cpp:
(RTCStatsRequestSucceededTask):
(RTCStatsRequestSucceededTask::RTCStatsRequestSucceededTask):
(MockWebRTCPeerConnectionHandler::getStats):
* DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.h:
(MockWebRTCPeerConnectionHandler):

LayoutTests:

Patch by Harald Tveit Alvestrand <harald@alvestrand.no> on 2012-09-28
Reviewed by Adam Barth.

* fast/mediastream/RTCPeerConnection-stats-expected.txt: Added.
* fast/mediastream/RTCPeerConnection-stats.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129908 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Exiting fullscreen does not set the correct scroll position
https://bugs.webkit.org/show_bug.cgi?id=97917
PR #212920

Reviewed by Yong Li.
Patch by Antonio Gomes <agomes@rim.com>
Internally reviewed by Jacky Jiang.

Restore the zoom level and scroll position at the time when know
the fullscreen exit routine has ended (i.e. in ::setViewportSize
instead of ::exitFullScreenForElement).

Also patch caches now the scroll position instead of only the
"x scroll position.

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::WebPagePrivate):
(BlackBerry::WebKit::WebPagePrivate::setViewportSize):
(BlackBerry::WebKit::WebPagePrivate::enterFullScreenForElement):
(BlackBerry::WebKit::WebPagePrivate::exitFullScreenForElement):
* Api/WebPage_p.h:
(WebPagePrivate):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129909 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Fix the find-in-page implementation for detaching frames.
https://bugs.webkit.org/show_bug.cgi?id=97807

Reviewed by Adam Barth.

Follow-up of 97688. Introduces proper test coverage for the find-in-page
feature in detaching/detached frame situations, fixing a few crashes and
ensuring that a final reply is always sent.

* public/WebNode.h:
* src/WebFrameImpl.cpp:
(WebKit::WebFrameImpl::find):
(WebKit::WebFrameImpl::scopeStringMatches):
(WebKit::WebFrameImpl::flushCurrentScopingEffort):
(WebKit):
(WebKit::WebFrameImpl::finishCurrentScopingEffort):
(WebKit::WebFrameImpl::cancelPendingScopingEffort):
(WebKit::WebFrameImpl::WebFrameImpl):
(WebKit::WebFrameImpl::setWebCoreFrame):
(WebKit::WebFrameImpl::initializeAsMainFrame):
(WebKit::WebFrameImpl::createChildFrame):
(WebKit::WebFrameImpl::shouldScopeMatches):
(WebKit::WebFrameImpl::willDetachPage):
* src/WebFrameImpl.h:
(WebFrameImpl):
* src/WebNode.cpp:
(WebKit::WebNode::remove):
(WebKit):
* tests/WebFrameTest.cpp:
* tests/data/find_in_page.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129910 268f45cc-cd09-0410-ab3c-d52691b4dbfc
IndexedDB: Run multiple tasks per transaction tick
https://bugs.webkit.org/show_bug.cgi?id=97738

Reviewed by Tony Chang.

Process multiple tasks from the pending queue(s) when the timer fires. The
task may initiate new tasks that change which queue is active (e.g. indexing
operations) so the loop must re-check each tick which queue to use.

In DumpRenderTree, time to make 20k puts/20k gets dropped from 3.2s to 2.0s (-37%);
in Chromium's content_shell, the time dropped from 8.1s to 4.6s (-42%).

No new tests - just perf improvements, covered by (nearly) all existing IDB tests.

* Modules/indexeddb/IDBTransactionBackendImpl.cpp:
(WebCore::IDBTransactionBackendImpl::abort): Use takeFirst() to clean up code.
(WebCore::IDBTransactionBackendImpl::taskTimerFired): Process as many tasks as are available.


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