[GTK] Add API to get the web view that initiated a custom URI request to WebKit2 GTK+
https://bugs.webkit.org/show_bug.cgi?id=97895

Reviewed by Martin Robinson.

Source/WebCore:

* platform/network/NetworkingContext.h:
(NetworkingContext): Add initiatingPageID().
* platform/network/ResourceHandle.h:
(ResourceHandle): Add static method
getSoupRequestInitiaingPageID().
* platform/network/ResourceHandleInternal.h:
(ResourceHandleInternal): Add initiatingPageID().
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::ResourceHandleInternal::initiatingPageID): Get the
initiating page ID of the resource handle networking context.
(WebCore::setSoupRequestInitiaingPageID): Helper function to
attach a page ID to a SoupRequest.
(WebCore::startHTTPRequest): Call setSoupRequestInitiaingPageID()
to attch the initiating page ID to the SoupRequest.
(WebCore::startNonHTTPRequest): Ditto.
(WebCore::ResourceHandle::getSoupRequestInitiaingPageID): Static
method to get the page ID attached to a SoupRequest.

Source/WebKit/efl:

* WebCoreSupport/FrameNetworkingContextEfl.cpp:
(WebCore::FrameNetworkingContextEfl::initiatingPageID): Stub
implementation.
* WebCoreSupport/FrameNetworkingContextEfl.h:
(FrameNetworkingContextEfl): Added.

Source/WebKit/gtk:

* WebCoreSupport/FrameNetworkingContextGtk.cpp:
(WebKit::FrameNetworkingContextGtk::initiatingPageID): Stub
implementation.
* WebCoreSupport/FrameNetworkingContextGtk.h:
(FrameNetworkingContextGtk): Added.

Source/WebKit2:

The message DidReceiveURIRequest is now sent to the page that
initiated the request that forwards the mesassage to the
WebSoupRequestManagerProxy.

* UIProcess/API/C/soup/WKSoupRequestManager.h: Update
didReceiveURIRequest callback to receive the initiating page ID.
* UIProcess/API/efl/ewk_context_request_manager_client.cpp:
(didReceiveURIRequest): Update the callback API change.
* UIProcess/API/gtk/WebKitRequestManagerClient.cpp:
(didReceiveURIRequest): Pass the initiating page to the
WebKitURISchemeRequest constructor.
* UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
(_WebKitURISchemeRequestPrivate): Keep a reference to the
WebPageProxy that initiatesd the request.
(webkitURISchemeRequestCreate): Save the initiating page.
(webkit_uri_scheme_request_get_web_view): Return the view widget
of the initiating WebPageProxy.
* UIProcess/API/gtk/WebKitURISchemeRequest.h:
* UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h:
* UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbol.
* UIProcess/API/gtk/tests/TestWebKitWebContext.cpp:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didReceiveURIRequest): Forward the request
to the soup request manager proxy.
* UIProcess/WebPageProxy.h:
(WebPageProxy): Add didReceiveURIRequest().
* UIProcess/WebPageProxy.messages.in: Add DidReceiveURIRequest
message.
* UIProcess/soup/WebSoupRequestManagerClient.cpp:
(WebKit::WebSoupRequestManagerClient::didReceiveURIRequest):
Pass the inititing page to the client callback.
* UIProcess/soup/WebSoupRequestManagerClient.h:
(WebSoupRequestManagerClient):
* UIProcess/soup/WebSoupRequestManagerProxy.cpp:
(WebKit::WebSoupRequestManagerProxy::didReceiveURIRequest): Pass
the inititing page to the client.
* UIProcess/soup/WebSoupRequestManagerProxy.h:
(WebSoupRequestManagerProxy):
* UIProcess/soup/WebSoupRequestManagerProxy.messages.in: Remove
DidReceiveURIRequest message.
* WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
(WebKit::WebFrameNetworkingContext::WebFrameNetworkingContext):
Save the pageID of the WebFrame.
(WebKit::WebFrameNetworkingContext::initiatingPageID): Return the
inititing page ID.
* WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h:
* WebProcess/soup/WebSoupRequestManager.cpp:
(WebKit::WebSoupRequestManager::send): Send DidReceiveURIRequest
message to the WebPage that initiated the request.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130259 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add data passing to the GetStats interface of RTCPeerConnection
https://bugs.webkit.org/show_bug.cgi?id=98003

Patch by Harald Alvestrand <hta@google.com> on 2012-10-03
Reviewed by Adam Barth.

Source/Platform:

* Platform.gypi:
* chromium/public/WebRTCStatsRequest.h:
(WebKit):
(WebRTCStatsRequest):
* chromium/public/WebRTCStatsResponse.h: Added.
(WebCore):
(WebKit):
(WebRTCStatsResponse):
(WebKit::WebRTCStatsResponse::WebRTCStatsResponse):
(WebKit::WebRTCStatsResponse::~WebRTCStatsResponse):
(WebKit::WebRTCStatsResponse::operator=):

Source/WebCore:

Added an RTCStatsResponseBase interface to platform, and let the
RTCStatsRequestImpl class produce an implementation of it that's returned
to WebCore.

Tested by extension of the RTCPeerConnection-stats.html test.

* Modules/mediastream/RTCStatsElement.cpp:
(WebCore::RTCStatsElement::addStatistic):
(WebCore):
* Modules/mediastream/RTCStatsElement.h:
(RTCStatsElement):
* Modules/mediastream/RTCStatsReport.cpp:
(WebCore):
(WebCore::RTCStatsReport::addElement):
(WebCore::RTCStatsReport::addStatistic):
* Modules/mediastream/RTCStatsReport.h:
(RTCStatsReport):
* Modules/mediastream/RTCStatsRequestImpl.cpp:
(WebCore::RTCStatsRequestImpl::createResponse):
(WebCore):
(WebCore::RTCStatsRequestImpl::requestSucceeded):
* Modules/mediastream/RTCStatsRequestImpl.h:
(RTCStatsRequestImpl):
* Modules/mediastream/RTCStatsResponse.cpp:
(WebCore::RTCStatsResponse::create):
(WebCore::RTCStatsResponse::addReport):
(WebCore):
(WebCore::RTCStatsResponse::addElement):
(WebCore::RTCStatsResponse::addStatistic):
* Modules/mediastream/RTCStatsResponse.h:
(RTCStatsResponse):
* WebCore.gypi:
* platform/chromium/support/WebRTCStatsRequest.cpp:
(WebKit::WebRTCStatsRequest::response):
(WebKit):
(WebKit::WebRTCStatsRequest::requestSucceeded):
* platform/chromium/support/WebRTCStatsResponse.cpp: Added.
(WebKit):
(WebKit::WebRTCStatsResponse::WebRTCStatsResponse):
(WebKit::WebRTCStatsResponse::assign):
(WebKit::WebRTCStatsResponse::reset):
(WebKit::WebRTCStatsResponse::operator WTF::PassRefPtr<WebCore::RTCStatsResponseBase>):
(WebKit::WebRTCStatsResponse::addReport):
(WebKit::WebRTCStatsResponse::addElement):
(WebKit::WebRTCStatsResponse::addStatistic):
* platform/mediastream/RTCStatsRequest.h:
(WebCore):
(RTCStatsRequest):
* platform/mediastream/RTCStatsResponseBase.h: Added.
(WebCore):
(RTCStatsResponseBase):
(WebCore::RTCStatsResponseBase::~RTCStatsResponseBase):

Tools:

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

LayoutTests:

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

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130260 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: "Load profile..." context menu item has to be shown only for left column with the list of profiles.
https://bugs.webkit.org/show_bug.cgi?id=98163

Reviewed by Yury Semikhatsky.

The text was changed to "Load Heap Snapshot..."
Also I changed "Save profile..." to "Save Heap Snapshot..." because other profiles don't support Save/Load operations yet.
The Load context menu item will appear only when the user clicked in sidebar the tree empty space or a profile.

* English.lproj/localizedStrings.js:
* inspector/front-end/ProfilesPanel.js:
(WebInspector.ProfilesPanel.prototype._handleContextMenuEvent):
(WebInspector.ProfileSidebarTreeElement.prototype.handleContextMenuEvent):

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