Commit 54b362c8 authored by grunell@chromium.org's avatar grunell@chromium.org

Forwarding app URL to handler host for WebRTC logs.

BUG=229829

Review URL: https://chromiumcodereview.appspot.com/15875005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202426 0039d316-1c4b-4281-b951-d872f2087c98
parent cbbc00ce
...@@ -42,7 +42,8 @@ bool WebRtcLoggingHandlerHost::OnMessageReceived(const IPC::Message& message, ...@@ -42,7 +42,8 @@ bool WebRtcLoggingHandlerHost::OnMessageReceived(const IPC::Message& message,
return handled; return handled;
} }
void WebRtcLoggingHandlerHost::OnOpenLog(const std::string& app_session_id) { void WebRtcLoggingHandlerHost::OnOpenLog(const std::string& app_session_id,
const std::string& app_url) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
DCHECK(!base::SharedMemory::IsHandleValid(shared_memory_.handle())); DCHECK(!base::SharedMemory::IsHandleValid(shared_memory_.handle()));
...@@ -60,6 +61,7 @@ void WebRtcLoggingHandlerHost::OnOpenLog(const std::string& app_session_id) { ...@@ -60,6 +61,7 @@ void WebRtcLoggingHandlerHost::OnOpenLog(const std::string& app_session_id) {
} }
app_session_id_ = app_session_id; app_session_id_ = app_session_id;
app_url_ = app_url;
Send(new WebRtcLoggingMsg_LogOpened(foreign_memory_handle, kWebRtcLogSize)); Send(new WebRtcLoggingMsg_LogOpened(foreign_memory_handle, kWebRtcLogSize));
} }
......
...@@ -30,10 +30,11 @@ class WebRtcLoggingHandlerHost : public BrowserMessageFilter { ...@@ -30,10 +30,11 @@ class WebRtcLoggingHandlerHost : public BrowserMessageFilter {
virtual ~WebRtcLoggingHandlerHost(); virtual ~WebRtcLoggingHandlerHost();
void OnOpenLog(const std::string& app_session_id); void OnOpenLog(const std::string& app_session_id, const std::string& app_url);
base::SharedMemory shared_memory_; base::SharedMemory shared_memory_;
std::string app_session_id_; std::string app_session_id_;
std::string app_url_;
DISALLOW_COPY_AND_ASSIGN(WebRtcLoggingHandlerHost); DISALLOW_COPY_AND_ASSIGN(WebRtcLoggingHandlerHost);
}; };
......
...@@ -13,8 +13,9 @@ ...@@ -13,8 +13,9 @@
// Messages sent from the renderer to the browser. // Messages sent from the renderer to the browser.
// Request to open a log. // Request to open a log.
IPC_MESSAGE_CONTROL1(WebRtcLoggingMsg_OpenLog, IPC_MESSAGE_CONTROL2(WebRtcLoggingMsg_OpenLog,
std::string /* app_session_id */) std::string /* app_session_id */,
std::string /* app_url */)
// Messages sent from the browser to the renderer. // Messages sent from the browser to the renderer.
......
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
#include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStream.h" #include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStream.h"
#include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStreamSource.h" #include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStreamSource.h"
#include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStreamTrack.h" #include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStreamTrack.h"
#include "third_party/WebKit/Source/Platform/chromium/public/WebURL.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
#if defined(USE_OPENSSL) #if defined(USE_OPENSSL)
...@@ -508,13 +510,15 @@ MediaStreamDependencyFactory::CreatePeerConnection( ...@@ -508,13 +510,15 @@ MediaStreamDependencyFactory::CreatePeerConnection(
optional_constraints.FindFirst(kWebRtcLoggingConstraint, optional_constraints.FindFirst(kWebRtcLoggingConstraint,
&constraint_value)) { &constraint_value)) {
webrtc_log_open_ = true; webrtc_log_open_ = true;
std::string url = web_frame->document().url().spec();
RenderThreadImpl::current()->GetIOMessageLoopProxy()->PostTask( RenderThreadImpl::current()->GetIOMessageLoopProxy()->PostTask(
FROM_HERE, base::Bind( FROM_HERE, base::Bind(
&MediaStreamDependencyFactory::CreateWebRtcLoggingHandler, &MediaStreamDependencyFactory::CreateWebRtcLoggingHandler,
base::Unretained(this), base::Unretained(this),
RenderThreadImpl::current()->webrtc_logging_message_filter(), RenderThreadImpl::current()->webrtc_logging_message_filter(),
constraint_value)); constraint_value,
url));
} }
scoped_refptr<P2PPortAllocatorFactory> pa_factory = scoped_refptr<P2PPortAllocatorFactory> pa_factory =
...@@ -789,10 +793,11 @@ void MediaStreamDependencyFactory::CleanupPeerConnectionFactory() { ...@@ -789,10 +793,11 @@ void MediaStreamDependencyFactory::CleanupPeerConnectionFactory() {
void MediaStreamDependencyFactory::CreateWebRtcLoggingHandler( void MediaStreamDependencyFactory::CreateWebRtcLoggingHandler(
WebRtcLoggingMessageFilter* filter, WebRtcLoggingMessageFilter* filter,
const std::string& app_session_id) { const std::string& app_session_id,
const std::string& app_url) {
WebRtcLoggingHandlerImpl* handler = WebRtcLoggingHandlerImpl* handler =
new WebRtcLoggingHandlerImpl(filter->io_message_loop()); new WebRtcLoggingHandlerImpl(filter->io_message_loop());
filter->InitLogging(handler, app_session_id); filter->InitLogging(handler, app_session_id, app_url);
} }
} // namespace content } // namespace content
...@@ -197,7 +197,8 @@ class CONTENT_EXPORT MediaStreamDependencyFactory ...@@ -197,7 +197,8 @@ class CONTENT_EXPORT MediaStreamDependencyFactory
void CleanupPeerConnectionFactory(); void CleanupPeerConnectionFactory();
void CreateWebRtcLoggingHandler(WebRtcLoggingMessageFilter* filter, void CreateWebRtcLoggingHandler(WebRtcLoggingMessageFilter* filter,
const std::string& app_session_id); const std::string& app_session_id,
const std::string& app_url);
// We own network_manager_, must be deleted on the worker thread. // We own network_manager_, must be deleted on the worker thread.
// The network manager uses |p2p_socket_dispatcher_|. // The network manager uses |p2p_socket_dispatcher_|.
......
...@@ -54,11 +54,12 @@ void WebRtcLoggingMessageFilter::OnChannelClosing() { ...@@ -54,11 +54,12 @@ void WebRtcLoggingMessageFilter::OnChannelClosing() {
void WebRtcLoggingMessageFilter::InitLogging( void WebRtcLoggingMessageFilter::InitLogging(
WebRtcLoggingHandlerImpl* logging_handler, WebRtcLoggingHandlerImpl* logging_handler,
const std::string& app_session_id) { const std::string& app_session_id,
const std::string& app_url) {
DCHECK(io_message_loop_->BelongsToCurrentThread()); DCHECK(io_message_loop_->BelongsToCurrentThread());
DCHECK(!logging_handler_); DCHECK(!logging_handler_);
logging_handler_ = logging_handler; logging_handler_ = logging_handler;
Send(new WebRtcLoggingMsg_OpenLog(app_session_id)); Send(new WebRtcLoggingMsg_OpenLog(app_session_id, app_url));
} }
void WebRtcLoggingMessageFilter::OnLogOpened( void WebRtcLoggingMessageFilter::OnLogOpened(
......
...@@ -28,7 +28,8 @@ class CONTENT_EXPORT WebRtcLoggingMessageFilter ...@@ -28,7 +28,8 @@ class CONTENT_EXPORT WebRtcLoggingMessageFilter
// We take owbership of |logging_handler|. See also comment below. // We take owbership of |logging_handler|. See also comment below.
virtual void InitLogging(WebRtcLoggingHandlerImpl* logging_handler, virtual void InitLogging(WebRtcLoggingHandlerImpl* logging_handler,
const std::string& app_session_id); const std::string& app_session_id,
const std::string& app_url);
const scoped_refptr<base::MessageLoopProxy>& io_message_loop() { const scoped_refptr<base::MessageLoopProxy>& io_message_loop() {
return io_message_loop_; return io_message_loop_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment