Make sure that user gestures can't be consumed twice
https://bugs.webkit.org/show_bug.cgi?id=97483

Reviewed by Adam Barth.

Source/WebCore:

Instead of a simple counter, use a ref counted token to track how many
user gestures happened and where consumed. When creating a timer that
is supposed to forward the user gesture, take a reference to this token
and reinstantiate the UserGestureIndicator with that token when the
timer is triggered.

Tests: platform/chromium/fast/events/popup-forwarded-gesture-blocked.html
       platform/chromium/fast/events/popup-forwarded-gesture.html

* dom/UserGestureIndicator.cpp:
(WebCore):
(WebCore::UserGestureIndicator::UserGestureIndicator):
(WebCore::UserGestureIndicator::~UserGestureIndicator):
(WebCore::UserGestureIndicator::processingUserGesture):
(WebCore::UserGestureIndicator::consumeUserGesture):
(WebCore::UserGestureIndicator::currentToken):
* dom/UserGestureIndicator.h:
(Token):
(WebCore::UserGestureIndicator::Token::~Token):
(UserGestureIndicator):
* page/DOMTimer.cpp:
(WebCore::DOMTimer::DOMTimer):
(WebCore::DOMTimer::fired):
* page/DOMTimer.h:
(DOMTimer):

LayoutTests:

* platform/chromium/fast/events/popup-forwarded-gesture-blocked-expected.txt: Added.
* platform/chromium/fast/events/popup-forwarded-gesture-blocked.html: Added.
* platform/chromium/fast/events/popup-forwarded-gesture-expected.txt: Added.
* platform/chromium/fast/events/popup-forwarded-gesture.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130267 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebImage::framesFromData should skip corrupted frames
https://bugs.webkit.org/show_bug.cgi?id=98214

Patch by Peter Kotwicz <pkotwicz@google.com> on 2012-10-03
Reviewed by Adam Barth.

WebImage::framesFromData() should only return bitmaps for valid frames
of a .ico file.

* src/WebImageSkia.cpp:
(WebKit::WebImage::framesFromData):
* tests/WebImageTest.cpp:
(WebKit::TEST):
(WebKit):
* tests/data/valid_header_missing_bitmap.ico: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130268 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Profiles: taking heap snapshot causes error message in console.
https://bugs.webkit.org/show_bug.cgi?id=97890

Patch by Eugene Klyuchnikov <eustas.bug@gmail.com> on 2012-10-03
Reviewed by Yury Semikhatsky.

Actual problem is that proxy loader is closed twice.

"_snapshotReceived" should never try to close receiver,
because it is a callback fired by close.

Also minor glitches fixed:
 - taking snapshot shows "Loading..." status first,
and then "Saving xxx%";
 - after all chunks are sent "Parsing" status is set and
then is replaced with "Saving 100%";
 - removed dead code in proxy;
 - proxy was ignoring callback parameter;
 - "Loading %d\%" is not localized.

* English.lproj/localizedStrings.js: Added missing "Loading %d%" string.
* inspector/front-end/HeapSnapshotProxy.js: Removed dead code.
(WebInspector.HeapSnapshotLoaderProxy):
(WebInspector.HeapSnapshotLoaderProxy.prototype.write): Make this method
interface-conformant.
* inspector/front-end/HeapSnapshotView.js:
(WebInspector.HeapProfileHeader): Fixed update-status and
finish-transfer logic.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130269 268f45cc-cd09-0410-ab3c-d52691b4dbfc
MediaStream API: RTCPeerConnection should send down its handler via the FrameLoaderClient directly after creation.
https://bugs.webkit.org/show_bug.cgi?id=98149

Reviewed by Adam Barth.

Source/WebCore:

The chromium implementation needs to know which Frame created a PeerConnection so
that the right housekeeping can take place correctly.

Not testable in DRT, but have verified the change manually and with our pyautotests.

* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::RTCPeerConnection):
* loader/FrameLoaderClient.h:
(WebCore):
(FrameLoaderClient):
(WebCore::FrameLoaderClient::dispatchWillStartUsingPeerConnectionHandler):
* platform/mediastream/chromium/RTCPeerConnectionHandlerChromium.cpp:
(WebCore::RTCPeerConnectionHandlerChromium::toWebRTCPeerConnectionHandler):
(WebCore):
(WebCore::RTCPeerConnectionHandlerChromium::RTCPeerConnectionHandlerChromium):
(WebCore::RTCPeerConnectionHandlerChromium::initialize):
* platform/mediastream/chromium/RTCPeerConnectionHandlerChromium.h:
(RTCPeerConnectionHandlerChromium):

Source/WebKit/chromium:

Adding willStartUsingPeerConnectionHandler to the WebFrameClient.

* public/WebFrameClient.h:
(WebKit):
(WebFrameClient):
(WebKit::WebFrameClient::willStartUsingPeerConnectionHandler):
* src/FrameLoaderClientImpl.cpp:
(WebKit):
(WebKit::FrameLoaderClientImpl::dispatchWillStartUsingPeerConnectionHandler):
* src/FrameLoaderClientImpl.h:
(FrameLoaderClientImpl):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130270 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt][DRT] Add support for overriding the "WebKitDisplayImagesKey" preference.
https://bugs.webkit.org/show_bug.cgi?id=98200

Patch by Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> on 2012-10-03
Reviewed by Csaba Osztrogonác.

Tools:

* DumpRenderTree/qt/TestRunnerQt.cpp:
(TestRunner::overridePreference):

LayoutTests:

* platform/qt/TestExpectations: Unskip a few tests that depended
on this feature.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130271 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove MemoryInstrumentation::addCollectionElements
https://bugs.webkit.org/show_bug.cgi?id=98245

Reviewed by Vsevolod Vlasov.

Removed MemoryInstrumentation::addCollectionElements and switched all call sites
to reportSequenceMemoryUsage.

Drive-by fix: removed some unused methods on MemoryInstrumentation.

* wtf/MemoryInstrumentation.h:
* wtf/MemoryInstrumentationHashSet.h:
(WTF::reportMemoryUsage):
* wtf/MemoryInstrumentationSequence.h:
(WTF::SequenceMemoryInstrumentationTraits::reportMemoryUsage):
* wtf/MemoryInstrumentationVector.h:
(WTF::reportMemoryUsage):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130272 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Gardening after r130186 and r130231

Unreviewed, EFL gardening.

r130186 introduces usage of Xvfb which allows us to unskip a few X11 dependent cases.
r130231 introduces caching for the Harfbuzz font path, which caused regressions on Harfbuzz NG + Freetype,
see bug 98247. Temporarily going to skip those failures until I check Kenichi's patch.

* platform/efl-wk1/TestExpectations: DRT disables X11 usage, skip a few tests here only for Wk1.
* platform/efl-wk2/TestExpectations: Unskip a couple of X11 dependent cases. (r130186)
* platform/efl/TestExpectations: Temporarily mark a few complex font text as failed (r130231)
* platform/efl/fast/text/atsui-multiple-renderers-expected.png: Rebaseline incorrect result.
* platform/efl/fast/text/atsui-spacing-features-expected.png: Rebaseline incorrect result.
* platform/efl/fast/text/wide-zero-width-space-expected.png: Rebaseline incorrect result.

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