Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: content/renderer/media/media_stream_dependency_factory.cc

Issue 15875005: Forwarding app URL to handler host for WebRTC logs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review + rebase. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/media/media_stream_dependency_factory.h" 5 #include "content/renderer/media/media_stream_dependency_factory.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/synchronization/waitable_event.h" 10 #include "base/synchronization/waitable_event.h"
(...skipping 12 matching lines...) Expand all
23 #include "content/renderer/media/webrtc_uma_histograms.h" 23 #include "content/renderer/media/webrtc_uma_histograms.h"
24 #include "content/renderer/p2p/ipc_network_manager.h" 24 #include "content/renderer/p2p/ipc_network_manager.h"
25 #include "content/renderer/p2p/ipc_socket_factory.h" 25 #include "content/renderer/p2p/ipc_socket_factory.h"
26 #include "content/renderer/p2p/port_allocator.h" 26 #include "content/renderer/p2p/port_allocator.h"
27 #include "content/renderer/render_thread_impl.h" 27 #include "content/renderer/render_thread_impl.h"
28 #include "jingle/glue/thread_wrapper.h" 28 #include "jingle/glue/thread_wrapper.h"
29 #include "third_party/WebKit/Source/Platform/chromium/public/WebMediaConstraints .h" 29 #include "third_party/WebKit/Source/Platform/chromium/public/WebMediaConstraints .h"
30 #include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStream.h" 30 #include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStream.h"
31 #include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStreamSourc e.h" 31 #include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStreamSourc e.h"
32 #include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStreamTrack .h" 32 #include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStreamTrack .h"
33 #include "third_party/WebKit/Source/Platform/chromium/public/WebURL.h"
34 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h"
33 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" 35 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
34 36
35 #if defined(USE_OPENSSL) 37 #if defined(USE_OPENSSL)
36 #include "third_party/libjingle/source/talk/base/ssladapter.h" 38 #include "third_party/libjingle/source/talk/base/ssladapter.h"
37 #else 39 #else
38 #include "net/socket/nss_ssl_util.h" 40 #include "net/socket/nss_ssl_util.h"
39 #endif 41 #endif
40 42
41 namespace content { 43 namespace content {
42 44
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 CHECK(web_frame); 503 CHECK(web_frame);
502 CHECK(observer); 504 CHECK(observer);
503 505
504 webrtc::MediaConstraintsInterface::Constraints optional_constraints = 506 webrtc::MediaConstraintsInterface::Constraints optional_constraints =
505 constraints->GetOptional(); 507 constraints->GetOptional();
506 std::string constraint_value; 508 std::string constraint_value;
507 if (!webrtc_log_open_ && 509 if (!webrtc_log_open_ &&
508 optional_constraints.FindFirst(kWebRtcLoggingConstraint, 510 optional_constraints.FindFirst(kWebRtcLoggingConstraint,
509 &constraint_value)) { 511 &constraint_value)) {
510 webrtc_log_open_ = true; 512 webrtc_log_open_ = true;
513 std::string url = web_frame->document().url().spec();
511 514
512 RenderThreadImpl::current()->GetIOMessageLoopProxy()->PostTask( 515 RenderThreadImpl::current()->GetIOMessageLoopProxy()->PostTask(
513 FROM_HERE, base::Bind( 516 FROM_HERE, base::Bind(
514 &MediaStreamDependencyFactory::CreateWebRtcLoggingHandler, 517 &MediaStreamDependencyFactory::CreateWebRtcLoggingHandler,
515 base::Unretained(this), 518 base::Unretained(this),
516 RenderThreadImpl::current()->webrtc_logging_message_filter(), 519 RenderThreadImpl::current()->webrtc_logging_message_filter(),
517 constraint_value)); 520 constraint_value,
521 url));
518 } 522 }
519 523
520 scoped_refptr<P2PPortAllocatorFactory> pa_factory = 524 scoped_refptr<P2PPortAllocatorFactory> pa_factory =
521 new talk_base::RefCountedObject<P2PPortAllocatorFactory>( 525 new talk_base::RefCountedObject<P2PPortAllocatorFactory>(
522 p2p_socket_dispatcher_.get(), 526 p2p_socket_dispatcher_.get(),
523 network_manager_, 527 network_manager_,
524 socket_factory_.get(), 528 socket_factory_.get(),
525 web_frame); 529 web_frame);
526 return pc_factory_->CreatePeerConnection( 530 return pc_factory_->CreatePeerConnection(
527 ice_servers, constraints, pa_factory, observer).get(); 531 ice_servers, constraints, pa_factory, observer).get();
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
782 // letting the the function continue to avoid any potential race issues. 786 // letting the the function continue to avoid any potential race issues.
783 chrome_worker_thread_.Stop(); 787 chrome_worker_thread_.Stop();
784 } else { 788 } else {
785 NOTREACHED() << "Worker thread not running."; 789 NOTREACHED() << "Worker thread not running.";
786 } 790 }
787 } 791 }
788 } 792 }
789 793
790 void MediaStreamDependencyFactory::CreateWebRtcLoggingHandler( 794 void MediaStreamDependencyFactory::CreateWebRtcLoggingHandler(
791 WebRtcLoggingMessageFilter* filter, 795 WebRtcLoggingMessageFilter* filter,
792 const std::string& app_session_id) { 796 const std::string& app_session_id,
797 const std::string& app_url) {
793 WebRtcLoggingHandlerImpl* handler = 798 WebRtcLoggingHandlerImpl* handler =
794 new WebRtcLoggingHandlerImpl(filter->io_message_loop()); 799 new WebRtcLoggingHandlerImpl(filter->io_message_loop());
795 filter->InitLogging(handler, app_session_id); 800 filter->InitLogging(handler, app_session_id, app_url);
796 } 801 }
797 802
798 } // namespace content 803 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/media_stream_dependency_factory.h ('k') | content/renderer/media/webrtc_logging_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698