[Tests] Move fast/notifications/notifications-event-listener-crash.html to http/tests/notifications
https://bugs.webkit.org/show_bug.cgi?id=95535
<rdar://problem/12213781>

Reviewed by Jessie Berlin.

This test is among a few that are being migrated from fast/notifications to http/tests/notifications because of permissions.
Since most notifications tests will involve permissions, it is easier to have all of them consolidated in the same directory.

This test has been slightly modified to take advantage of the new testRunner notifications API. The test itself also does not
need to be protected within the window.testRunner check since it does not use that object.

* fast/notifications/notifications-event-listener-crash-expected.txt: Removed.
* fast/notifications/notifications-event-listener-crash.html: Removed.
* http/tests/notifications/event-listener-crash-expected.txt: Added.
* http/tests/notifications/event-listener-crash.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@127362 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-09-01  Geoffrey Garen  <ggaren@apple.com>

        Rolled back in a piece of <http://trac.webkit.org/changeset/127293>.

            Shrink activation objects by half
            https://bugs.webkit.org/show_bug.cgi?id=95591

            Reviewed by Sam Weinig.

        * runtime/JSActivation.cpp:
        (JSC::JSActivation::JSActivation):
        * runtime/JSGlobalObject.cpp:
        (JSC::JSGlobalObject::JSGlobalObject):
        (JSC::JSGlobalObject::setGlobalThis):
        (JSC):
        (JSC::JSGlobalObject::visitChildren):
        * runtime/JSGlobalObject.h:
        (JSGlobalObject):
        (JSC::JSScope::globalThis):
        (JSC):
        (JSC::JSGlobalObject::globalThis):
        * runtime/JSNameScope.h:
        (JSC::JSNameScope::JSNameScope):
        * runtime/JSScope.cpp:
        (JSC::JSScope::visitChildren):
        * runtime/JSScope.h:
        (JSScope):
        (JSC::JSScope::JSScope):
        (JSC::JSScope::globalObject):
        (JSC::JSScope::globalData):
        * runtime/JSSegmentedVariableObject.h:
        (JSC::JSSegmentedVariableObject::JSSegmentedVariableObject):
        * runtime/JSSymbolTableObject.h:
        (JSC::JSSymbolTableObject::JSSymbolTableObject):
        * runtime/JSVariableObject.h:
        (JSC::JSVariableObject::JSVariableObject):
        * runtime/JSWithScope.h:
        (JSC::JSWithScope::JSWithScope):
        * runtime/StrictEvalActivation.cpp:
        (JSC::StrictEvalActivation::StrictEvalActivation):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@127363 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Tests] Add a test for all notification events
https://bugs.webkit.org/show_bug.cgi?id=95609
<rdar://problem/12218309>

Reviewed by Jessie Berlin.

This test tests for the onshow, onclick, and onclose events. onerror is called only if the
origin did not have permission to show the notification, and that is covered in
http/tests/notifications/{legacy,}/show.html.

* http/tests/notifications/events-expected.txt: Added.
* http/tests/notifications/events.html: Added.
* http/tests/notifications/legacy/events-expected.txt: Added.
* http/tests/notifications/legacy/events.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@127364 268f45cc-cd09-0410-ab3c-d52691b4dbfc
MediaStream API: Add MediaStream management to RTCPeerConnection
https://bugs.webkit.org/show_bug.cgi?id=95543

Reviewed by Adam Barth.

Source/Platform:

* chromium/public/WebMediaStreamCenter.h:
(WebMediaStreamCenter):
* chromium/public/WebRTCPeerConnectionHandler.h:
(WebKit):
(WebRTCPeerConnectionHandler):
* chromium/public/WebRTCPeerConnectionHandlerClient.h:
(WebKit):
(WebRTCPeerConnectionHandlerClient):

Source/WebCore:

This includes addStream/removeStream to RTCPeerConnection,
as well as didAddRemoteStream/didRemoveRemoteStream to RTCPeerConnectionHandlerClient.

Test: fast/mediastream/RTCPeerConnection-AddRemoveStream.html

* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::parseConfiguration):
(WebCore::RTCPeerConnection::RTCPeerConnection):
(WebCore::RTCPeerConnection::addStream):
(WebCore):
(WebCore::RTCPeerConnection::removeStream):
(WebCore::RTCPeerConnection::localStreams):
(WebCore::RTCPeerConnection::remoteStreams):
(WebCore::RTCPeerConnection::didAddRemoteStream):
(WebCore::RTCPeerConnection::didRemoveRemoteStream):
* Modules/mediastream/RTCPeerConnection.h:
(RTCPeerConnection):
* Modules/mediastream/RTCPeerConnection.idl:
* bindings/js/Dictionary.cpp:
(WebCore::Dictionary::getOwnPropertiesAsStringHashMap):
(WebCore::Dictionary::getOwnPropertyNames):
* bindings/v8/Dictionary.cpp:
(WebCore::Dictionary::getOwnPropertiesAsStringHashMap):
(WebCore::Dictionary::getOwnPropertyNames):
* bindings/v8/Dictionary.h:
(Dictionary):
* platform/mediastream/RTCPeerConnectionHandler.cpp:
(RTCPeerConnectionHandlerDummy):
(WebCore::RTCPeerConnectionHandlerDummy::addStream):
(WebCore):
(WebCore::RTCPeerConnectionHandlerDummy::removeStream):
* platform/mediastream/RTCPeerConnectionHandler.h:
(RTCPeerConnectionHandler):
* platform/mediastream/RTCPeerConnectionHandlerClient.h:
(WebCore):
(RTCPeerConnectionHandlerClient):
* platform/mediastream/chromium/RTCPeerConnectionHandlerChromium.cpp:
(WebCore::RTCPeerConnectionHandlerChromium::addStream):
(WebCore):
(WebCore::RTCPeerConnectionHandlerChromium::removeStream):
(WebCore::RTCPeerConnectionHandlerChromium::didAddRemoteStream):
(WebCore::RTCPeerConnectionHandlerChromium::didRemoveRemoteStream):
* platform/mediastream/chromium/RTCPeerConnectionHandlerChromium.h:
(WebKit):
(RTCPeerConnectionHandlerChromium):

Source/WebKit/chromium:

* src/AssertMatchingEnums.cpp:

Tools:

Extending MockWebRTCPeerConnectionHandler to handle addStream/removeStream.

* DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.cpp:
(MockWebRTCPeerConnectionHandler::MockWebRTCPeerConnectionHandler):
(MockWebRTCPeerConnectionHandler::addStream):
(MockWebRTCPeerConnectionHandler::removeStream):
* DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.h:
(MockWebRTCPeerConnectionHandler):

LayoutTests:

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


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@127365 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove all-but-one use of WTF::String::operator+= from WebCore
https://bugs.webkit.org/show_bug.cgi?id=95508

Reviewed by Benjamin Poulain.

This patch removes all the uses of WTF::String::operator+= from
WebCore, except those in WorkerScriptLoader (which need a more delicate
patch). There were actually a handful of legitimate use cases for += in
this group. I've replaced them with calls to String::append rather than
+= so that we can remove += and encourage most contributors to use
more efficient string idioms.

(There are likely some more uses in WebCore hiding in port-specific
code---this patch covers only those call sites found when compiling the
chromium-mac port.)

* inspector/InspectorStyleTextEditor.cpp:
(WebCore::InspectorStyleTextEditor::insertProperty):
    - This complicated function looks really inefficient, but I didn't
      have the heart to rewrite it.
* inspector/NetworkResourcesData.cpp:
(WebCore::NetworkResourcesData::ResourceData::decodeDataToContent):
* loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::sheetText):
(WebCore::CachedCSSStyleSheet::data):
* loader/cache/CachedFont.cpp:
(WebCore::CachedFont::ensureSVGFontData):
* loader/cache/CachedScript.cpp:
(WebCore::CachedScript::script):
* loader/cache/CachedXSLStyleSheet.cpp:
(WebCore::CachedXSLStyleSheet::data):
    - This decoder/flush pattern can probably be improved by combining
      the decode and flush operations, but I didn't do that in this
      patch.
* page/FrameTree.cpp:
(WebCore::FrameTree::uniqueChildName):
    - I found this code very amusing. It's worried enough about
      efficiency to give a big speech about why snprintf is safe, but
      then it implicitly performs a large number of mallocs and memcpy
      operations.
* page/Page.cpp:
(WebCore::Page::userStyleSheet):
* platform/chromium/support/WebHTTPLoadInfo.cpp:
(WebKit::addHeader):
* platform/chromium/support/WebURLResponse.cpp:
(WebKit::WebURLResponse::addHTTPHeaderField):
    - This header-appending idiom looks like a reasonable use case for
      String::append.
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::send):
(WebCore::XMLHttpRequest::setRequestHeaderInternal):
* xml/XPathFunctions.cpp:
(WebCore::XPath::FunTranslate::evaluate):
    - Fixes 6 year old FIXME.
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::append):
* xml/parser/XMLDocumentParser.h:
(XMLDocumentParser):
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::doEnd):
* xml/parser/XMLDocumentParserQt.cpp:
(WebCore::XMLDocumentParser::doEnd):
    - Changed m_originalSourceForTransform to a SegmentedString so that
      we don't need to malloc and copy the entire document every time
      we get more data from the network.


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