diff options
86 files changed, 435 insertions, 215 deletions
diff --git a/content/renderer/accessibility_node_serializer.cc b/content/renderer/accessibility_node_serializer.cc index fee5ee3..076065c 100644 --- a/content/renderer/accessibility_node_serializer.cc +++ b/content/renderer/accessibility_node_serializer.cc @@ -23,7 +23,6 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" -using content::AccessibilityNodeData; using WebKit::WebAccessibilityRole; using WebKit::WebAccessibilityObject; using WebKit::WebDocument; @@ -32,6 +31,7 @@ using WebKit::WebElement; using WebKit::WebNode; using WebKit::WebVector; +namespace content { namespace { // Returns true if |ancestor| is the first unignored parent of |child|, @@ -344,8 +344,6 @@ uint32 ConvertState(const WebAccessibilityObject& o) { } // Anonymous namespace -namespace content { - void SerializeAccessibilityNode( const WebAccessibilityObject& src, AccessibilityNodeData* dst, diff --git a/content/renderer/android/email_detector.h b/content/renderer/android/email_detector.h index d48acbf..3bd4d41 100644 --- a/content/renderer/android/email_detector.h +++ b/content/renderer/android/email_detector.h @@ -8,10 +8,10 @@ #include "base/compiler_specific.h" #include "content/renderer/android/content_detector.h" -class EmailDetectorTest; - namespace content { +class EmailDetectorTest; + // Finds email addresses (in most common formats, but not including special // characters) in the given text string. class EmailDetector : public ContentDetector { @@ -19,7 +19,7 @@ class EmailDetector : public ContentDetector { EmailDetector(); private: - friend class ::EmailDetectorTest; + friend class EmailDetectorTest; // Implementation of ContentDetector. virtual bool FindContent(const string16::const_iterator& begin, diff --git a/content/renderer/android/email_detector_unittest.cc b/content/renderer/android/email_detector_unittest.cc index a68184e..aaf1cd07 100644 --- a/content/renderer/android/email_detector_unittest.cc +++ b/content/renderer/android/email_detector_unittest.cc @@ -7,7 +7,7 @@ #include "base/utf_string_conversions.h" #include "testing/gtest/include/gtest/gtest.h" -using content::EmailDetector; +namespace content { class EmailDetectorTest : public testing::Test { public: @@ -49,3 +49,5 @@ TEST_F(EmailDetectorTest, FindEmail) { FindAndCheckEmail("Just bob @google.com", ""); FindAndCheckEmail("Why not call larry@google and ask him.", ""); } + +} // namespace content diff --git a/content/renderer/android/phone_number_detector.h b/content/renderer/android/phone_number_detector.h index 553d92a..1a9a4d8 100644 --- a/content/renderer/android/phone_number_detector.h +++ b/content/renderer/android/phone_number_detector.h @@ -8,10 +8,10 @@ #include "base/compiler_specific.h" #include "content/renderer/android/content_detector.h" -class PhoneNumberDetectorTest; - namespace content { +class PhoneNumberDetectorTest; + // Finds a telephone number in the given content text string. class PhoneNumberDetector : public ContentDetector { public: @@ -20,7 +20,7 @@ class PhoneNumberDetector : public ContentDetector { virtual ~PhoneNumberDetector(); private: - friend class ::PhoneNumberDetectorTest; + friend class PhoneNumberDetectorTest; // Implementation of ContentDetector. virtual bool FindContent(const string16::const_iterator& begin, diff --git a/content/renderer/android/phone_number_detector_unittest.cc b/content/renderer/android/phone_number_detector_unittest.cc index a0a01f1..c2f653f 100644 --- a/content/renderer/android/phone_number_detector_unittest.cc +++ b/content/renderer/android/phone_number_detector_unittest.cc @@ -7,7 +7,7 @@ #include "base/utf_string_conversions.h" #include "testing/gtest/include/gtest/gtest.h" -using content::PhoneNumberDetector; +namespace content { class PhoneNumberDetectorTest : public testing::Test { public: @@ -72,3 +72,5 @@ TEST_F(PhoneNumberDetectorTest, FindAndFormatNumber) { "\xE3\x83\xBC\xEF\xBC\x96\xEF\xBC\x90\xEF\xBC\x90" "\xEF\xBC\x90", "us")); } + +} // namespace content diff --git a/content/renderer/device_orientation_dispatcher.cc b/content/renderer/device_orientation_dispatcher.cc index df8d2e3..4776edf 100644 --- a/content/renderer/device_orientation_dispatcher.cc +++ b/content/renderer/device_orientation_dispatcher.cc @@ -11,7 +11,6 @@ namespace content { - DeviceOrientationDispatcher::DeviceOrientationDispatcher( RenderViewImpl* render_view) : RenderViewObserver(render_view), diff --git a/content/renderer/dom_automation_controller.cc b/content/renderer/dom_automation_controller.cc index 0ab7035..6f4b27a 100644 --- a/content/renderer/dom_automation_controller.cc +++ b/content/renderer/dom_automation_controller.cc @@ -15,6 +15,8 @@ using webkit_glue::CppArgumentList; using webkit_glue::CppVariant; +namespace content { + DomAutomationController::DomAutomationController() : sender_(NULL), routing_id_(MSG_ROUTING_NONE), @@ -188,3 +190,5 @@ void DomAutomationController::GetHistogram(const CppArgumentList& args, } result->Set(output); } + +} // namespace content diff --git a/content/renderer/dom_automation_controller.h b/content/renderer/dom_automation_controller.h index 4550864..c393449 100644 --- a/content/renderer/dom_automation_controller.h +++ b/content/renderer/dom_automation_controller.h @@ -70,6 +70,8 @@ */ +namespace content { + // TODO(vibhor): Add another method-pair like sendLater() and sendNow() // sendLater() should keep building a json serializer // sendNow() should send the above serializer as a string. @@ -125,4 +127,6 @@ class DomAutomationController : public webkit_glue::CppBoundClass { int automation_id_; // routing id to be used by the next channel. }; +} // namespace content + #endif // CONTENT_RENDERER_DOM_AUTOMATION_CONTROLLER_H_ diff --git a/content/renderer/gpu/compositor_output_surface.h b/content/renderer/gpu/compositor_output_surface.h index ca7f5d5..f5753a6 100644 --- a/content/renderer/gpu/compositor_output_surface.h +++ b/content/renderer/gpu/compositor_output_surface.h @@ -15,7 +15,7 @@ #include "third_party/WebKit/Source/Platform/chromium/public/WebCompositorSoftwareOutputDevice.h" namespace base { - class TaskRunner; +class TaskRunner; } namespace IPC { diff --git a/content/renderer/gpu/compositor_software_output_device_gl_adapter.cc b/content/renderer/gpu/compositor_software_output_device_gl_adapter.cc index c1751f2..835b007 100644 --- a/content/renderer/gpu/compositor_software_output_device_gl_adapter.cc +++ b/content/renderer/gpu/compositor_software_output_device_gl_adapter.cc @@ -17,6 +17,8 @@ using WebKit::WebImage; using WebKit::WebGraphicsContext3D; using WebKit::WebSize; +namespace content { + //------------------------------------------------------------------------------ CompositorSoftwareOutputDeviceGLAdapter:: @@ -176,3 +178,5 @@ void CompositorSoftwareOutputDeviceGLAdapter::Draw(void* pixels) { context3d_->prepareTexture(); } + +} // namespace content diff --git a/content/renderer/gpu/compositor_software_output_device_gl_adapter.h b/content/renderer/gpu/compositor_software_output_device_gl_adapter.h index ef00cee..2073644 100644 --- a/content/renderer/gpu/compositor_software_output_device_gl_adapter.h +++ b/content/renderer/gpu/compositor_software_output_device_gl_adapter.h @@ -16,6 +16,8 @@ #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3D.h" #include "ui/gfx/size.h" +namespace content { + // This class can be created only on the main thread, but then becomes pinned // to a fixed thread when bindToClient is called. class CompositorSoftwareOutputDeviceGLAdapter @@ -51,4 +53,6 @@ private: bool locked_for_write_; }; +} // namespace content + #endif // CONTENT_RENDERER_GPU_COMPOSITOR_SOFTWARE_OUTPUT_DEVICE_GL_ADAPTER_H_ diff --git a/content/renderer/gpu/compositor_thread.h b/content/renderer/gpu/compositor_thread.h index a69e831..e0bc9f3 100644 --- a/content/renderer/gpu/compositor_thread.h +++ b/content/renderer/gpu/compositor_thread.h @@ -17,10 +17,10 @@ namespace WebKit { class WebInputEvent; } -class InputEventFilter; - namespace content { +class InputEventFilter; + // The CompositorThread class manages the background thread for the compositor. // The CompositorThread instance can be assumed to outlive the background // thread it manages. diff --git a/content/renderer/gpu/input_event_filter.cc b/content/renderer/gpu/input_event_filter.cc index 6a49fcc..e2c885d 100644 --- a/content/renderer/gpu/input_event_filter.cc +++ b/content/renderer/gpu/input_event_filter.cc @@ -11,6 +11,8 @@ using WebKit::WebInputEvent; +namespace content { + InputEventFilter::InputEventFilter(IPC::Listener* main_listener, base::MessageLoopProxy* target_loop, const Handler& handler) @@ -148,3 +150,5 @@ void InputEventFilter::SendACKOnIOThread(int routing_id, sender_->Send( new ViewHostMsg_HandleInputEvent_ACK(routing_id, event_type, processed)); } + +} // namespace content diff --git a/content/renderer/gpu/input_event_filter.h b/content/renderer/gpu/input_event_filter.h index 887c3b1..eaf6050 100644 --- a/content/renderer/gpu/input_event_filter.h +++ b/content/renderer/gpu/input_event_filter.h @@ -21,6 +21,9 @@ // The user of this class provides an instance of InputEventFilter::Handler, // which will be passed WebInputEvents on the target thread. // + +namespace content { + class CONTENT_EXPORT InputEventFilter : public IPC::ChannelProxy::MessageFilter { public: @@ -90,4 +93,6 @@ class CONTENT_EXPORT InputEventFilter std::set<int> routes_; }; +} // namespace content + #endif // CONTENT_RENDERER_GPU_INPUT_EVENT_FILTER_H_ diff --git a/content/renderer/gpu/input_event_filter_unittest.cc b/content/renderer/gpu/input_event_filter_unittest.cc index 57f6ece..685fbf5 100644 --- a/content/renderer/gpu/input_event_filter_unittest.cc +++ b/content/renderer/gpu/input_event_filter_unittest.cc @@ -16,6 +16,7 @@ using WebKit::WebInputEvent; using WebKit::WebMouseEvent; +namespace content { namespace { const int kTestRoutingID = 13; @@ -219,3 +220,5 @@ TEST(InputEventFilterTest, Basic) { filter->OnFilterRemoved(); } + +} // namespace content diff --git a/content/renderer/java/java_bridge_channel.cc b/content/renderer/java/java_bridge_channel.cc index 00cad13..6663d55 100644 --- a/content/renderer/java/java_bridge_channel.cc +++ b/content/renderer/java/java_bridge_channel.cc @@ -8,6 +8,8 @@ #include "content/common/java_bridge_messages.h" #include "content/common/plugin_messages.h" +namespace content { + JavaBridgeChannel* JavaBridgeChannel::GetJavaBridgeChannel( const IPC::ChannelHandle& channel_handle, base::MessageLoopProxy* ipc_message_loop) { @@ -50,3 +52,5 @@ bool JavaBridgeChannel::OnControlMessageReceived(const IPC::Message& msg) { } return NPChannelBase::OnControlMessageReceived(msg); } + +} // namespace content diff --git a/content/renderer/java/java_bridge_channel.h b/content/renderer/java/java_bridge_channel.h index 7728b27..4789dcf 100644 --- a/content/renderer/java/java_bridge_channel.h +++ b/content/renderer/java/java_bridge_channel.h @@ -8,6 +8,8 @@ #include "content/common/np_channel_base.h" #include "ipc/ipc_channel_handle.h" +namespace content { + class JavaBridgeChannel : public NPChannelBase { public: static JavaBridgeChannel* GetJavaBridgeChannel( @@ -30,4 +32,6 @@ class JavaBridgeChannel : public NPChannelBase { DISALLOW_COPY_AND_ASSIGN(JavaBridgeChannel); }; +} // namespace content + #endif // CONTENT_RENDERER_JAVA_JAVA_BRIDGE_CHANNEL_H_ diff --git a/content/renderer/java/java_bridge_dispatcher.cc b/content/renderer/java/java_bridge_dispatcher.cc index d5d1bca..d1ad0e84 100644 --- a/content/renderer/java/java_bridge_dispatcher.cc +++ b/content/renderer/java/java_bridge_dispatcher.cc @@ -15,8 +15,9 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" -JavaBridgeDispatcher::JavaBridgeDispatcher( - content::RenderView* render_view) +namespace content { + +JavaBridgeDispatcher::JavaBridgeDispatcher(RenderView* render_view) : RenderViewObserver(render_view) { } @@ -99,3 +100,5 @@ void JavaBridgeDispatcher::OnRemoveNamedObject(const string16& name) { WebKit::WebBindings::releaseObject(NPVARIANT_TO_OBJECT(iter->second)); objects_.erase(iter); } + +} // namespace content diff --git a/content/renderer/java/java_bridge_dispatcher.h b/content/renderer/java/java_bridge_dispatcher.h index be291cf..83dd36a 100644 --- a/content/renderer/java/java_bridge_dispatcher.h +++ b/content/renderer/java/java_bridge_dispatcher.h @@ -12,18 +12,20 @@ #include "ipc/ipc_channel_handle.h" #include "third_party/npapi/bindings/npruntime.h" -class JavaBridgeChannel; struct NPVariant_Param; +namespace content { +class JavaBridgeChannel; + // This class handles injecting Java objects into the main frame of a // RenderView. The 'add' and 'remove' messages received from the browser // process modify the entries in a map of 'pending' objects. These objects are // bound to the window object of the main frame when that window object is next // cleared. These objects remain bound until the window object is cleared // again. -class JavaBridgeDispatcher : public content::RenderViewObserver { +class JavaBridgeDispatcher : public RenderViewObserver { public: - JavaBridgeDispatcher(content::RenderView* render_view); + JavaBridgeDispatcher(RenderView* render_view); virtual ~JavaBridgeDispatcher(); private: @@ -45,4 +47,6 @@ class JavaBridgeDispatcher : public content::RenderViewObserver { scoped_refptr<JavaBridgeChannel> channel_; }; +} // namespace content + #endif // CONTENT_RENDERER_JAVA_JAVA_BRIDGE_DISPATCHER_H_ diff --git a/content/renderer/media/audio_hardware.cc b/content/renderer/media/audio_hardware.cc index 3e863c6..7ac586b 100644 --- a/content/renderer/media/audio_hardware.cc +++ b/content/renderer/media/audio_hardware.cc @@ -8,7 +8,6 @@ #include "content/common/view_messages.h" #include "content/renderer/render_thread_impl.h" -using content::RenderThreadImpl; using media::ChannelLayout; using media::CHANNEL_LAYOUT_NONE; @@ -17,9 +16,9 @@ static int input_sample_rate = 0; static size_t output_buffer_size = 0; static ChannelLayout input_channel_layout = CHANNEL_LAYOUT_NONE; -namespace audio_hardware { +namespace content { -int GetOutputSampleRate() { +int AudioHardware::GetOutputSampleRate() { DCHECK(RenderThreadImpl::current() != NULL); if (!output_sample_rate) { @@ -29,7 +28,7 @@ int GetOutputSampleRate() { return output_sample_rate; } -int GetInputSampleRate() { +int AudioHardware::GetInputSampleRate() { DCHECK(RenderThreadImpl::current() != NULL); if (!input_sample_rate) { @@ -39,7 +38,7 @@ int GetInputSampleRate() { return input_sample_rate; } -size_t GetOutputBufferSize() { +size_t AudioHardware::GetOutputBufferSize() { DCHECK(RenderThreadImpl::current() != NULL); if (!output_buffer_size) { @@ -52,7 +51,7 @@ size_t GetOutputBufferSize() { return output_buffer_size; } -ChannelLayout GetInputChannelLayout() { +ChannelLayout AudioHardware::GetInputChannelLayout() { DCHECK(RenderThreadImpl::current() != NULL); if (input_channel_layout == CHANNEL_LAYOUT_NONE) { @@ -65,7 +64,7 @@ ChannelLayout GetInputChannelLayout() { return input_channel_layout; } -void ResetCache() { +void AudioHardware::ResetCache() { DCHECK(RenderThreadImpl::current() != NULL); output_sample_rate = 0.0; @@ -74,4 +73,4 @@ void ResetCache() { input_channel_layout = CHANNEL_LAYOUT_NONE; } -} // namespace audio_hardware +} // namespace content diff --git a/content/renderer/media/audio_hardware.h b/content/renderer/media/audio_hardware.h index f78fee6..6999122 100644 --- a/content/renderer/media/audio_hardware.h +++ b/content/renderer/media/audio_hardware.h @@ -12,29 +12,32 @@ // Contains static methods to query hardware properties from the browser // process. Values are cached to avoid unnecessary round trips, but the cache // can be cleared if needed (currently only used by tests). -namespace audio_hardware { +namespace content { -// Fetch the sample rate of the default audio output end point device. -// Must be called from RenderThreadImpl::current(). -CONTENT_EXPORT int GetOutputSampleRate(); +class CONTENT_EXPORT AudioHardware { +public: + // Fetch the sample rate of the default audio output end point device. + // Must be called from RenderThreadImpl::current(). + static int GetOutputSampleRate(); -// Fetch the sample rate of the default audio input end point device. -// Must be called from RenderThreadImpl::current(). -CONTENT_EXPORT int GetInputSampleRate(); + // Fetch the sample rate of the default audio input end point device. + // Must be called from RenderThreadImpl::current(). + static int GetInputSampleRate(); -// Fetch the buffer size we use for the default output device. -// Must be called from RenderThreadImpl::current(). -// Must be used in conjunction with AUDIO_PCM_LOW_LATENCY. -CONTENT_EXPORT size_t GetOutputBufferSize(); + // Fetch the buffer size we use for the default output device. + // Must be called from RenderThreadImpl::current(). + // Must be used in conjunction with AUDIO_PCM_LOW_LATENCY. + static size_t GetOutputBufferSize(); -// Fetch the audio channel layout for the default input device. -// Must be called from RenderThreadImpl::current(). -CONTENT_EXPORT media::ChannelLayout GetInputChannelLayout(); + // Fetch the audio channel layout for the default input device. + // Must be called from RenderThreadImpl::current(). + static media::ChannelLayout GetInputChannelLayout(); -// Forces the next call to any of the Get functions to query the hardware -// and repopulate the cache. -CONTENT_EXPORT void ResetCache(); + // Forces the next call to any of the Get functions to query the hardware + // and repopulate the cache. + static void ResetCache(); +}; -} // namespace audio_hardware +} // namespace content #endif // CONTENT_RENDERER_MEDIA_AUDIO_HARDWARE_H_ diff --git a/content/renderer/media/audio_input_message_filter.cc b/content/renderer/media/audio_input_message_filter.cc index 850cd1a..ab49ec5 100644 --- a/content/renderer/media/audio_input_message_filter.cc +++ b/content/renderer/media/audio_input_message_filter.cc @@ -11,6 +11,8 @@ #include "content/common/media/audio_messages.h" #include "ipc/ipc_logging.h" +namespace content { + AudioInputMessageFilter* AudioInputMessageFilter::filter_ = NULL; AudioInputMessageFilter::AudioInputMessageFilter() @@ -180,3 +182,5 @@ void AudioInputMessageFilter::CloseStream(int stream_id) { void AudioInputMessageFilter::SetVolume(int stream_id, double volume) { Send(new AudioInputHostMsg_SetVolume(stream_id, volume)); } + +} // namespace content diff --git a/content/renderer/media/audio_input_message_filter.h b/content/renderer/media/audio_input_message_filter.h index ee99900..fd7d641 100644 --- a/content/renderer/media/audio_input_message_filter.h +++ b/content/renderer/media/audio_input_message_filter.h @@ -18,6 +18,8 @@ #include "media/audio/audio_buffers_state.h" #include "media/audio/audio_input_ipc.h" +namespace content { + class CONTENT_EXPORT AudioInputMessageFilter : public IPC::ChannelProxy::MessageFilter, public NON_EXPORTED_BASE(media::AudioInputIPC) { @@ -81,4 +83,6 @@ class CONTENT_EXPORT AudioInputMessageFilter DISALLOW_COPY_AND_ASSIGN(AudioInputMessageFilter); }; +} // namespace content + #endif // CONTENT_RENDERER_MEDIA_AUDIO_INPUT_MESSAGE_FILTER_H_ diff --git a/content/renderer/media/audio_message_filter.cc b/content/renderer/media/audio_message_filter.cc index 9f72324..d8a6e70 100644 --- a/content/renderer/media/audio_message_filter.cc +++ b/content/renderer/media/audio_message_filter.cc @@ -12,6 +12,8 @@ #include "content/renderer/render_thread_impl.h" #include "ipc/ipc_logging.h" +namespace content { + AudioMessageFilter* AudioMessageFilter::filter_ = NULL; // static @@ -154,3 +156,5 @@ void AudioMessageFilter::OnStreamStateChanged( } delegate->OnStateChanged(state); } + +} // namespace content diff --git a/content/renderer/media/audio_message_filter.h b/content/renderer/media/audio_message_filter.h index ce57ad9..3e3c9c9 100644 --- a/content/renderer/media/audio_message_filter.h +++ b/content/renderer/media/audio_message_filter.h @@ -19,6 +19,8 @@ #include "media/audio/audio_buffers_state.h" #include "media/audio/audio_output_ipc.h" +namespace content { + class CONTENT_EXPORT AudioMessageFilter : public IPC::ChannelProxy::MessageFilter, public NON_EXPORTED_BASE(media::AudioOutputIPC) { @@ -80,4 +82,6 @@ class CONTENT_EXPORT AudioMessageFilter DISALLOW_COPY_AND_ASSIGN(AudioMessageFilter); }; +} // namespace content + #endif // CONTENT_RENDERER_MEDIA_AUDIO_MESSAGE_FILTER_H_ diff --git a/content/renderer/media/audio_message_filter_unittest.cc b/content/renderer/media/audio_message_filter_unittest.cc index 63f244f..f5eb3a6 100644 --- a/content/renderer/media/audio_message_filter_unittest.cc +++ b/content/renderer/media/audio_message_filter_unittest.cc @@ -8,6 +8,7 @@ #include "media/audio/audio_output_ipc.h" #include "testing/gtest/include/gtest/gtest.h" +namespace content { namespace { class MockAudioDelegate : public media::AudioOutputIPCDelegate { @@ -140,3 +141,5 @@ TEST(AudioMessageFilterTest, Delegates) { filter->RemoveDelegate(stream_id1); filter->RemoveDelegate(stream_id2); } + +} // namespace content diff --git a/content/renderer/media/capture_video_decoder.cc b/content/renderer/media/capture_video_decoder.cc index a74147b..23dcc4a 100644 --- a/content/renderer/media/capture_video_decoder.cc +++ b/content/renderer/media/capture_video_decoder.cc @@ -15,6 +15,8 @@ using media::CopyYPlane; using media::CopyUPlane; using media::CopyVPlane; +namespace content { + CaptureVideoDecoder::CaptureVideoDecoder( base::MessageLoopProxy* message_loop_proxy, media::VideoCaptureSessionId video_stream_id, @@ -268,3 +270,5 @@ void CaptureVideoDecoder::DeliverFrame( // Reset the callback before running to protect against reentrancy. base::ResetAndReturn(&read_cb_).Run(kOk, video_frame); } + +} // namespace content diff --git a/content/renderer/media/capture_video_decoder.h b/content/renderer/media/capture_video_decoder.h index 4f03a07..1a47fe0 100644 --- a/content/renderer/media/capture_video_decoder.h +++ b/content/renderer/media/capture_video_decoder.h @@ -18,6 +18,8 @@ class MessageLoopProxy; namespace media { class VideoFrame; } + +namespace content { class VideoCaptureImplManager; // A filter takes raw frames from video capture engine and passes them to media @@ -105,4 +107,6 @@ class CONTENT_EXPORT CaptureVideoDecoder DISALLOW_COPY_AND_ASSIGN(CaptureVideoDecoder); }; +} // namespace content + #endif // CONTENT_RENDERER_MEDIA_CAPTURE_VIDEO_DECODER_H_ diff --git a/content/renderer/media/capture_video_decoder_unittest.cc b/content/renderer/media/capture_video_decoder_unittest.cc index 7c2028c..512a06d 100644 --- a/content/renderer/media/capture_video_decoder_unittest.cc +++ b/content/renderer/media/capture_video_decoder_unittest.cc @@ -24,6 +24,8 @@ static const int kHeight = 144; static const int kFPS = 30; static const media::VideoCaptureSessionId kVideoStreamId = 1; +namespace content { + ACTION(DeleteDataBuffer) { delete[] arg0->memory_pointer; } @@ -227,3 +229,5 @@ TEST_F(CaptureVideoDecoderTest, ReadAndShutdown) { decoder_->Read(read_cb_); message_loop_->RunAllPending(); } + +} // namespace content diff --git a/content/renderer/media/local_video_capture.h b/content/renderer/media/local_video_capture.h index bbf67dc..3df3d41 100644 --- a/content/renderer/media/local_video_capture.h +++ b/content/renderer/media/local_video_capture.h @@ -18,9 +18,8 @@ namespace media { class VideoCaptureHandlerProxy; } -class VideoCaptureImplManager; - namespace content { +class VideoCaptureImplManager; // This class takes raw frames from video capture engine via VideoCaptureProxy // and passes them to media player as a video frame provider. diff --git a/content/renderer/media/media_stream_center.h b/content/renderer/media/media_stream_center.h index c10080e..95ce850 100644 --- a/content/renderer/media/media_stream_center.h +++ b/content/renderer/media/media_stream_center.h @@ -14,9 +14,8 @@ namespace WebKit { class WebMediaStreamCenterClient; } -class MediaStreamDependencyFactory; - namespace content { +class MediaStreamDependencyFactory; class CONTENT_EXPORT MediaStreamCenter : NON_EXPORTED_BASE(public WebKit::WebMediaStreamCenter) { diff --git a/content/renderer/media/media_stream_dependency_factory.cc b/content/renderer/media/media_stream_dependency_factory.cc index a6a3d8e..29c1e02 100644 --- a/content/renderer/media/media_stream_dependency_factory.cc +++ b/content/renderer/media/media_stream_dependency_factory.cc @@ -28,10 +28,12 @@ #include "net/socket/nss_ssl_util.h" #endif +namespace content{ + class P2PPortAllocatorFactory : public webrtc::PortAllocatorFactoryInterface { public: P2PPortAllocatorFactory( - content::P2PSocketDispatcher* socket_dispatcher, + P2PSocketDispatcher* socket_dispatcher, talk_base::NetworkManager* network_manager, talk_base::PacketSocketFactory* socket_factory, WebKit::WebFrame* web_frame) @@ -45,7 +47,7 @@ class P2PPortAllocatorFactory : public webrtc::PortAllocatorFactoryInterface { const std::vector<StunConfiguration>& stun_servers, const std::vector<TurnConfiguration>& turn_configurations) OVERRIDE { CHECK(web_frame_); - content::P2PPortAllocator::Config config; + P2PPortAllocator::Config config; if (stun_servers.size() > 0) { config.stun_server = stun_servers[0].server.hostname(); config.stun_server_port = stun_servers[0].server.port(); @@ -57,18 +59,18 @@ class P2PPortAllocatorFactory : public webrtc::PortAllocatorFactoryInterface { config.relay_password = turn_configurations[0].password; } - return new content::P2PPortAllocator(web_frame_, - socket_dispatcher_, - network_manager_, - socket_factory_, - config); + return new P2PPortAllocator(web_frame_, + socket_dispatcher_, + network_manager_, + socket_factory_, + config); } protected: virtual ~P2PPortAllocatorFactory() {} private: - scoped_refptr<content::P2PSocketDispatcher> socket_dispatcher_; + scoped_refptr<P2PSocketDispatcher> socket_dispatcher_; // |network_manager_| and |socket_factory_| are a weak references, owned by // MediaStreamDependencyFactory. talk_base::NetworkManager* network_manager_; @@ -79,7 +81,7 @@ class P2PPortAllocatorFactory : public webrtc::PortAllocatorFactoryInterface { MediaStreamDependencyFactory::MediaStreamDependencyFactory( VideoCaptureImplManager* vc_manager, - content::P2PSocketDispatcher* p2p_socket_dispatcher) + P2PSocketDispatcher* p2p_socket_dispatcher) : network_manager_(NULL), vc_manager_(vc_manager), p2p_socket_dispatcher_(p2p_socket_dispatcher), @@ -173,7 +175,7 @@ bool MediaStreamDependencyFactory::CreateNativeLocalMediaStream( continue; } const bool is_screencast = (source_data->device_info().stream_type == - content::MEDIA_TAB_VIDEO_CAPTURE); + MEDIA_TAB_VIDEO_CAPTURE); scoped_refptr<webrtc::LocalVideoTrackInterface> video_track( CreateLocalVideoTrack(UTF16ToUTF8(source.id()), source_data->device_info().session_id, @@ -182,18 +184,18 @@ bool MediaStreamDependencyFactory::CreateNativeLocalMediaStream( video_track->set_enabled(video_components[i].isEnabled()); } - description->setExtraData(new content::MediaStreamExtraData(native_stream)); + description->setExtraData(new MediaStreamExtraData(native_stream)); return true; } bool MediaStreamDependencyFactory::CreateNativeLocalMediaStream( WebKit::WebMediaStreamDescriptor* description, - const content::MediaStreamExtraData::StreamStopCallback& stream_stop) { + const MediaStreamExtraData::StreamStopCallback& stream_stop) { if (!CreateNativeLocalMediaStream(description)) return false; - content::MediaStreamExtraData* extra_data = - static_cast<content::MediaStreamExtraData*>(description->extraData()); + MediaStreamExtraData* extra_data = + static_cast<MediaStreamExtraData*>(description->extraData()); extra_data->SetLocalStreamStopCallback(stream_stop); return true; } @@ -201,7 +203,7 @@ bool MediaStreamDependencyFactory::CreateNativeLocalMediaStream( bool MediaStreamDependencyFactory::CreatePeerConnectionFactory() { if (!pc_factory_.get()) { DCHECK(!audio_device_); - audio_device_ = new content::WebRtcAudioDeviceImpl(); + audio_device_ = new WebRtcAudioDeviceImpl(); scoped_refptr<webrtc::PeerConnectionFactoryInterface> factory( webrtc::CreatePeerConnectionFactory(worker_thread_, signaling_thread_, @@ -306,7 +308,7 @@ void MediaStreamDependencyFactory::InitializeWorkerThread( void MediaStreamDependencyFactory::CreateIpcNetworkManagerOnWorkerThread( base::WaitableEvent* event) { DCHECK_EQ(MessageLoop::current(), chrome_worker_thread_.message_loop()); - network_manager_ = new content::IpcNetworkManager(p2p_socket_dispatcher_); + network_manager_ = new IpcNetworkManager(p2p_socket_dispatcher_); event->Signal(); } @@ -357,7 +359,7 @@ bool MediaStreamDependencyFactory::EnsurePeerConnectionFactory() { if (!socket_factory_.get()) { socket_factory_.reset( - new content::IpcPacketSocketFactory(p2p_socket_dispatcher_)); + new IpcPacketSocketFactory(p2p_socket_dispatcher_)); } #if !defined(USE_OPENSSL) @@ -390,3 +392,5 @@ void MediaStreamDependencyFactory::CleanupPeerConnectionFactory() { } } } + +} // namespace content diff --git a/content/renderer/media/media_stream_dependency_factory.h b/content/renderer/media/media_stream_dependency_factory.h index 1ab19dd..8b359da 100644 --- a/content/renderer/media/media_stream_dependency_factory.h +++ b/content/renderer/media/media_stream_dependency_factory.h @@ -19,12 +19,6 @@ namespace base { class WaitableEvent; } -namespace content { -class IpcNetworkManager; -class IpcPacketSocketFactory; -class WebRtcAudioDeviceImpl; -} - namespace talk_base { class NetworkManager; class PacketSocketFactory; @@ -44,7 +38,12 @@ class WebRTCPeerConnectionHandler; class WebRTCPeerConnectionHandlerClient; } +namespace content { + +class IpcNetworkManager; +class IpcPacketSocketFactory; class VideoCaptureImplManager; +class WebRtcAudioDeviceImpl; // Object factory for RTC MediaStreams and RTC PeerConnections. class CONTENT_EXPORT MediaStreamDependencyFactory @@ -52,7 +51,7 @@ class CONTENT_EXPORT MediaStreamDependencyFactory public: MediaStreamDependencyFactory( VideoCaptureImplManager* vc_manager, - content::P2PSocketDispatcher* p2p_socket_dispatcher); + P2PSocketDispatcher* p2p_socket_dispatcher); virtual ~MediaStreamDependencyFactory(); // Create a PeerConnectionHandlerJsep object that implements the @@ -76,7 +75,7 @@ class CONTENT_EXPORT MediaStreamDependencyFactory // stopped. bool CreateNativeLocalMediaStream( WebKit::WebMediaStreamDescriptor* description, - const content::MediaStreamExtraData::StreamStopCallback& stream_stop); + const MediaStreamExtraData::StreamStopCallback& stream_stop); // Asks the libjingle PeerConnection factory to create a libjingle // PeerConnection object. @@ -142,14 +141,14 @@ class CONTENT_EXPORT MediaStreamDependencyFactory // We own network_manager_, must be deleted on the worker thread. // The network manager uses |p2p_socket_dispatcher_|. - content::IpcNetworkManager* network_manager_; - scoped_ptr<content::IpcPacketSocketFactory> socket_factory_; + IpcNetworkManager* network_manager_; + scoped_ptr<IpcPacketSocketFactory> socket_factory_; scoped_refptr<webrtc::PeerConnectionFactoryInterface> pc_factory_; scoped_refptr<VideoCaptureImplManager> vc_manager_; - scoped_refptr<content::P2PSocketDispatcher> p2p_socket_dispatcher_; - scoped_refptr<content::WebRtcAudioDeviceImpl> audio_device_; + scoped_refptr<P2PSocketDispatcher> p2p_socket_dispatcher_; + scoped_refptr<WebRtcAudioDeviceImpl> audio_device_; // PeerConnection threads. signaling_thread_ is created from the // "current" chrome thread. @@ -160,4 +159,6 @@ class CONTENT_EXPORT MediaStreamDependencyFactory DISALLOW_COPY_AND_ASSIGN(MediaStreamDependencyFactory); }; +} // namespace content + #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ diff --git a/content/renderer/media/media_stream_dependency_factory_unittest.cc b/content/renderer/media/media_stream_dependency_factory_unittest.cc index 3922beb..9eda682 100644 --- a/content/renderer/media/media_stream_dependency_factory_unittest.cc +++ b/content/renderer/media/media_stream_dependency_factory_unittest.cc @@ -18,6 +18,8 @@ #include "third_party/WebKit/Source/Platform/chromium/public/WebRTCPeerConnectionHandler.h" #include "third_party/WebKit/Source/Platform/chromium/public/WebVector.h" +namespace content { + class MediaStreamDependencyFactoryTest : public ::testing::Test { public: void SetUp() { @@ -64,14 +66,14 @@ class MediaStreamDependencyFactoryTest : public ::testing::Test { }; TEST_F(MediaStreamDependencyFactoryTest, CreatePeerConnectionHandlerJsep) { - WebKit::MockWebPeerConnection00HandlerClient client_jsep; + MockWebPeerConnection00HandlerClient client_jsep; scoped_ptr<WebKit::WebPeerConnection00Handler> pc_handler_jsep( dependency_factory_->CreatePeerConnectionHandlerJsep(&client_jsep)); EXPECT_TRUE(pc_handler_jsep.get() != NULL); } TEST_F(MediaStreamDependencyFactoryTest, CreateRTCPeerConnectionHandler) { - WebKit::MockWebRTCPeerConnectionHandlerClient client_jsep; + MockWebRTCPeerConnectionHandlerClient client_jsep; scoped_ptr<WebKit::WebRTCPeerConnectionHandler> pc_handler( dependency_factory_->CreateRTCPeerConnectionHandler(&client_jsep)); EXPECT_TRUE(pc_handler.get() != NULL); @@ -114,3 +116,5 @@ TEST_F(MediaStreamDependencyFactoryTest, CreateNativeMediaStreamWithoutSource) { EXPECT_EQ(0u, extra_data->local_stream()->video_tracks()->count()); EXPECT_EQ(0u, extra_data->local_stream()->audio_tracks()->count()); } + +} // namespace content diff --git a/content/renderer/media/media_stream_dispatcher_eventhandler.h b/content/renderer/media/media_stream_dispatcher_eventhandler.h index b837afc..c02bcba 100644 --- a/content/renderer/media/media_stream_dispatcher_eventhandler.h +++ b/content/renderer/media/media_stream_dispatcher_eventhandler.h @@ -10,6 +10,8 @@ #include "content/common/content_export.h" #include "content/common/media/media_stream_options.h" +namespace content { + class CONTENT_EXPORT MediaStreamDispatcherEventHandler { public: // A new media stream have been created. @@ -44,4 +46,6 @@ class CONTENT_EXPORT MediaStreamDispatcherEventHandler { virtual ~MediaStreamDispatcherEventHandler() {} }; +} // namespace content + #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DISPATCHER_EVENTHANDLER_H_ diff --git a/content/renderer/media/media_stream_impl.h b/content/renderer/media/media_stream_impl.h index e8db00d..110e23a 100644 --- a/content/renderer/media/media_stream_impl.h +++ b/content/renderer/media/media_stream_impl.h @@ -26,11 +26,10 @@ namespace WebKit { class WebMediaStreamDescriptor; } -class MediaStreamDependencyFactory; -class VideoCaptureImplManager; - namespace content { +class MediaStreamDependencyFactory; class MediaStreamDispatcher; +class VideoCaptureImplManager; // MediaStreamImpl is a delegate for the Media Stream API messages used by // WebKit. It ties together WebKit, native PeerConnection in libjingle and diff --git a/content/renderer/media/media_stream_source_extra_data.h b/content/renderer/media/media_stream_source_extra_data.h index a737817..5ae26dc 100644 --- a/content/renderer/media/media_stream_source_extra_data.h +++ b/content/renderer/media/media_stream_source_extra_data.h @@ -10,6 +10,8 @@ #include "content/common/media/media_stream_options.h" #include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStreamSource.h" +namespace content { + class CONTENT_EXPORT MediaStreamSourceExtraData : NON_EXPORTED_BASE(public WebKit::WebMediaStreamSource::ExtraData) { public: @@ -29,4 +31,6 @@ class CONTENT_EXPORT MediaStreamSourceExtraData DISALLOW_COPY_AND_ASSIGN(MediaStreamSourceExtraData); }; +} // namespace content + #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_SOURCE_EXTRA_DATA_H_ diff --git a/content/renderer/media/mock_media_stream_dependency_factory.cc b/content/renderer/media/mock_media_stream_dependency_factory.cc index cf8645b..ffbabc3 100644 --- a/content/renderer/media/mock_media_stream_dependency_factory.cc +++ b/content/renderer/media/mock_media_stream_dependency_factory.cc @@ -2,17 +2,29 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/logging.h" #include "content/renderer/media/mock_media_stream_dependency_factory.h" + +#include "base/logging.h" #include "content/renderer/media/mock_peer_connection_impl.h" #include "third_party/libjingle/source/talk/app/webrtc/mediastreaminterface.h" #include "third_party/libjingle/source/talk/base/scoped_ref_ptr.h" -namespace webrtc { +using webrtc::AudioSourceInterface; +using webrtc::AudioTrackInterface; +using webrtc::IceCandidateCollection; +using webrtc::IceCandidateInterface; +using webrtc::LocalMediaStreamInterface; +using webrtc::ObserverInterface; +using webrtc::SessionDescriptionInterface; +using webrtc::VideoRendererInterface; +using webrtc::VideoSourceInterface; +using webrtc::VideoTrackInterface; + +namespace content { template <class TrackType> class MockMediaStreamTrackList - : public MediaStreamTrackListInterface<TrackType> { + : public webrtc::MediaStreamTrackListInterface<TrackType> { public: virtual size_t count() const OVERRIDE { return tracks_.size(); @@ -34,7 +46,7 @@ class MockMediaStreamTrackList typedef MockMediaStreamTrackList<AudioTrackInterface> MockAudioTracks; typedef MockMediaStreamTrackList<VideoTrackInterface> MockVideoTracks; -class MockLocalMediaStream : public LocalMediaStreamInterface { +class MockLocalMediaStream : public webrtc::LocalMediaStreamInterface { public: explicit MockLocalMediaStream(std::string label) : label_(label), @@ -50,10 +62,10 @@ class MockLocalMediaStream : public LocalMediaStreamInterface { return true; } virtual std::string label() const OVERRIDE { return label_; } - virtual AudioTracks* audio_tracks() OVERRIDE { + virtual webrtc::AudioTracks* audio_tracks() OVERRIDE { return audio_tracks_; } - virtual VideoTracks* video_tracks() OVERRIDE { + virtual webrtc::VideoTracks* video_tracks() OVERRIDE { return video_tracks_; } virtual ReadyState ready_state() const OVERRIDE { @@ -249,8 +261,6 @@ class MockIceCandidate : public IceCandidateInterface { std::string sdp_; }; -} // namespace webrtc - MockMediaStreamDependencyFactory::MockMediaStreamDependencyFactory() : MediaStreamDependencyFactory(NULL, NULL), mock_pc_factory_created_(false) { @@ -268,7 +278,7 @@ MockMediaStreamDependencyFactory::CreatePeerConnection( const std::string& config, webrtc::PeerConnectionObserver* observer) { DCHECK(mock_pc_factory_created_); - return new talk_base::RefCountedObject<webrtc::MockPeerConnectionImpl>(this); + return new talk_base::RefCountedObject<MockPeerConnectionImpl>(this); } scoped_refptr<webrtc::PeerConnectionInterface> @@ -278,15 +288,14 @@ MockMediaStreamDependencyFactory::CreatePeerConnection( WebKit::WebFrame* frame, webrtc::PeerConnectionObserver* observer) { DCHECK(mock_pc_factory_created_); - return new talk_base::RefCountedObject<webrtc::MockPeerConnectionImpl>(this); + return new talk_base::RefCountedObject<MockPeerConnectionImpl>(this); } scoped_refptr<webrtc::LocalMediaStreamInterface> MockMediaStreamDependencyFactory::CreateLocalMediaStream( const std::string& label) { DCHECK(mock_pc_factory_created_); - return - new talk_base::RefCountedObject<webrtc::MockLocalMediaStream>(label); + return new talk_base::RefCountedObject<MockLocalMediaStream>(label); } scoped_refptr<webrtc::LocalVideoTrackInterface> @@ -296,7 +305,7 @@ MockMediaStreamDependencyFactory::CreateLocalVideoTrack( bool is_screencast) { DCHECK(mock_pc_factory_created_); scoped_refptr<webrtc::LocalVideoTrackInterface> track( - new talk_base::RefCountedObject<webrtc::MockLocalVideoTrack>(label)); + new talk_base::RefCountedObject<MockLocalVideoTrack>(label)); return track; } @@ -306,21 +315,21 @@ MockMediaStreamDependencyFactory::CreateLocalAudioTrack( webrtc::AudioDeviceModule* audio_device) { DCHECK(mock_pc_factory_created_); scoped_refptr<webrtc::LocalAudioTrackInterface> track( - new talk_base::RefCountedObject<webrtc::MockLocalAudioTrack>(label)); + new talk_base::RefCountedObject<MockLocalAudioTrack>(label)); return track; } -webrtc::SessionDescriptionInterface* +SessionDescriptionInterface* MockMediaStreamDependencyFactory::CreateSessionDescription( const std::string& sdp) { return CreateSessionDescription ("unknown", sdp); } -webrtc::SessionDescriptionInterface* +SessionDescriptionInterface* MockMediaStreamDependencyFactory::CreateSessionDescription( const std::string& type, const std::string& sdp) { - return new webrtc::MockSessionDescription(type, sdp); + return new MockSessionDescription(type, sdp); } webrtc::IceCandidateInterface* @@ -328,8 +337,10 @@ MockMediaStreamDependencyFactory::CreateIceCandidate( const std::string& sdp_mid, int sdp_mline_index, const std::string& sdp) { - return new webrtc::MockIceCandidate(sdp_mid, sdp_mline_index, sdp); + return new MockIceCandidate(sdp_mid, sdp_mline_index, sdp); } void MockMediaStreamDependencyFactory::SetAudioDeviceSessionId(int session_id) { } + +} // namespace content diff --git a/content/renderer/media/mock_media_stream_dependency_factory.h b/content/renderer/media/mock_media_stream_dependency_factory.h index 0c36f62..2fb07d9 100644 --- a/content/renderer/media/mock_media_stream_dependency_factory.h +++ b/content/renderer/media/mock_media_stream_dependency_factory.h @@ -11,16 +11,17 @@ #include "base/compiler_specific.h" #include "content/renderer/media/media_stream_dependency_factory.h" -namespace webrtc { +namespace content { -class MockLocalVideoTrack : public LocalVideoTrackInterface { +class MockLocalVideoTrack : public webrtc::LocalVideoTrackInterface { public: explicit MockLocalVideoTrack(std::string label) : enabled_(false), label_(label) { } - virtual void AddRenderer(VideoRendererInterface* renderer) OVERRIDE; - virtual void RemoveRenderer(VideoRendererInterface* renderer) OVERRIDE; + virtual void AddRenderer(webrtc::VideoRendererInterface* renderer) OVERRIDE; + virtual void RemoveRenderer( + webrtc::VideoRendererInterface* renderer) OVERRIDE; virtual cricket::VideoRenderer* FrameInput() OVERRIDE; virtual std::string kind() const OVERRIDE; virtual std::string label() const OVERRIDE; @@ -28,9 +29,9 @@ class MockLocalVideoTrack : public LocalVideoTrackInterface { virtual TrackState state() const OVERRIDE; virtual bool set_enabled(bool enable) OVERRIDE; virtual bool set_state(TrackState new_state) OVERRIDE; - virtual void RegisterObserver(ObserverInterface* observer) OVERRIDE; - virtual void UnregisterObserver(ObserverInterface* observer) OVERRIDE; - virtual VideoSourceInterface* GetSource() const OVERRIDE; + virtual void RegisterObserver(webrtc::ObserverInterface* observer) OVERRIDE; + virtual void UnregisterObserver(webrtc::ObserverInterface* observer) OVERRIDE; + virtual webrtc::VideoSourceInterface* GetSource() const OVERRIDE; protected: virtual ~MockLocalVideoTrack() {} @@ -40,7 +41,7 @@ class MockLocalVideoTrack : public LocalVideoTrackInterface { std::string label_; }; -class MockLocalAudioTrack : public LocalAudioTrackInterface { +class MockLocalAudioTrack : public webrtc::LocalAudioTrackInterface { public: explicit MockLocalAudioTrack(const std::string& label) : enabled_(false), @@ -52,9 +53,9 @@ class MockLocalAudioTrack : public LocalAudioTrackInterface { virtual TrackState state() const OVERRIDE; virtual bool set_enabled(bool enable) OVERRIDE; virtual bool set_state(TrackState new_state) OVERRIDE; - virtual void RegisterObserver(ObserverInterface* observer) OVERRIDE; - virtual void UnregisterObserver(ObserverInterface* observer) OVERRIDE; - virtual AudioSourceInterface* GetSource() const OVERRIDE; + virtual void RegisterObserver(webrtc::ObserverInterface* observer) OVERRIDE; + virtual void UnregisterObserver(webrtc::ObserverInterface* observer) OVERRIDE; + virtual webrtc::AudioSourceInterface* GetSource() const OVERRIDE; protected: virtual ~MockLocalAudioTrack() {} @@ -64,8 +65,6 @@ class MockLocalAudioTrack : public LocalAudioTrackInterface { std::string label_; }; -} // namespace webrtc - // A mock factory for creating different objects for // RTC MediaStreams and PeerConnections. class MockMediaStreamDependencyFactory : public MediaStreamDependencyFactory { @@ -109,4 +108,6 @@ class MockMediaStreamDependencyFactory : public MediaStreamDependencyFactory { DISALLOW_COPY_AND_ASSIGN(MockMediaStreamDependencyFactory); }; +} // namespace content + #endif // CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ diff --git a/content/renderer/media/mock_peer_connection_impl.cc b/content/renderer/media/mock_peer_connection_impl.cc index e4a547f..a6b7014 100644 --- a/content/renderer/media/mock_peer_connection_impl.cc +++ b/content/renderer/media/mock_peer_connection_impl.cc @@ -9,9 +9,18 @@ #include "base/logging.h" -namespace webrtc { - -class MockStreamCollection : public StreamCollectionInterface { +using webrtc::CreateSessionDescriptionObserver; +using webrtc::IceCandidateInterface; +using webrtc::LocalMediaStreamInterface; +using webrtc::MediaConstraintsInterface; +using webrtc::MediaStreamInterface; +using webrtc::PeerConnectionInterface; +using webrtc::SessionDescriptionInterface; +using webrtc::SetSessionDescriptionObserver; + +namespace content { + +class MockStreamCollection : public webrtc::StreamCollectionInterface { public: virtual size_t count() OVERRIDE { return streams_.size(); @@ -67,17 +76,18 @@ MockPeerConnectionImpl::MockPeerConnectionImpl( MockPeerConnectionImpl::~MockPeerConnectionImpl() {} -talk_base::scoped_refptr<StreamCollectionInterface> +talk_base::scoped_refptr<webrtc::StreamCollectionInterface> MockPeerConnectionImpl::local_streams() { return local_streams_; } -talk_base::scoped_refptr<StreamCollectionInterface> +talk_base::scoped_refptr<webrtc::StreamCollectionInterface> MockPeerConnectionImpl::remote_streams() { return remote_streams_; } -void MockPeerConnectionImpl::AddStream(LocalMediaStreamInterface* stream) { +void MockPeerConnectionImpl::AddStream( + LocalMediaStreamInterface* stream) { DCHECK(stream_label_.empty()); stream_label_ = stream->label(); local_streams_->AddStream(stream); @@ -220,4 +230,4 @@ PeerConnectionInterface::IceState MockPeerConnectionImpl::ice_state() { return ice_state_; } -} // namespace webrtc +} // namespace content diff --git a/content/renderer/media/mock_peer_connection_impl.h b/content/renderer/media/mock_peer_connection_impl.h index 7c1bf20..26f0037 100644 --- a/content/renderer/media/mock_peer_connection_impl.h +++ b/content/renderer/media/mock_peer_connection_impl.h @@ -12,29 +12,29 @@ #include "base/memory/scoped_ptr.h" #include "third_party/libjingle/source/talk/app/webrtc/peerconnectioninterface.h" -class MockMediaStreamDependencyFactory; - -namespace webrtc { +namespace content { +class MockMediaStreamDependencyFactory; class MockStreamCollection; -class MockPeerConnectionImpl : public PeerConnectionInterface { +class MockPeerConnectionImpl : public webrtc::PeerConnectionInterface { public: explicit MockPeerConnectionImpl(MockMediaStreamDependencyFactory* factory); // PeerConnectionInterface implementation. - virtual talk_base::scoped_refptr<StreamCollectionInterface> + virtual talk_base::scoped_refptr<webrtc::StreamCollectionInterface> local_streams() OVERRIDE; - virtual talk_base::scoped_refptr<StreamCollectionInterface> + virtual talk_base::scoped_refptr<webrtc::StreamCollectionInterface> remote_streams() OVERRIDE; - virtual void AddStream(LocalMediaStreamInterface* stream) OVERRIDE; - virtual bool AddStream(MediaStreamInterface* local_stream, - const MediaConstraintsInterface* constraints) OVERRIDE; + virtual void AddStream(webrtc::LocalMediaStreamInterface* stream) OVERRIDE; + virtual bool AddStream( + webrtc::MediaStreamInterface* local_stream, + const webrtc::MediaConstraintsInterface* constraints) OVERRIDE; virtual bool CanSendDtmf(const webrtc::AudioTrackInterface* track) OVERRIDE; virtual bool SendDtmf(const webrtc::AudioTrackInterface* send_track, const std::string& tones, int duration, const webrtc::AudioTrackInterface* play_track) OVERRIDE; - virtual void RemoveStream(MediaStreamInterface* local_stream) OVERRIDE; + virtual void RemoveStream(webrtc::MediaStreamInterface* local_stream) OVERRIDE; virtual ReadyState ready_state() OVERRIDE; virtual bool StartIce(IceOptions options) OVERRIDE; @@ -58,21 +58,25 @@ class MockPeerConnectionImpl : public PeerConnectionInterface { // JSEP01 APIs virtual void CreateOffer( - CreateSessionDescriptionObserver* observer, - const MediaConstraintsInterface* constraints) OVERRIDE; + webrtc::CreateSessionDescriptionObserver* observer, + const webrtc::MediaConstraintsInterface* constraints) OVERRIDE; virtual void CreateAnswer( - CreateSessionDescriptionObserver* observer, - const MediaConstraintsInterface* constraints) OVERRIDE; - virtual void SetLocalDescription(SetSessionDescriptionObserver* observer, - SessionDescriptionInterface* desc) OVERRIDE; - virtual void SetRemoteDescription(SetSessionDescriptionObserver* observer, - SessionDescriptionInterface* desc) OVERRIDE; - virtual bool UpdateIce(const IceServers& configuration, - const MediaConstraintsInterface* constraints) OVERRIDE; - virtual bool AddIceCandidate(const IceCandidateInterface* candidate) OVERRIDE; + webrtc::CreateSessionDescriptionObserver* observer, + const webrtc::MediaConstraintsInterface* constraints) OVERRIDE; + virtual void SetLocalDescription( + webrtc::SetSessionDescriptionObserver* observer, + webrtc::SessionDescriptionInterface* desc) OVERRIDE; + virtual void SetRemoteDescription( + webrtc::SetSessionDescriptionObserver* observer, + webrtc::SessionDescriptionInterface* desc) OVERRIDE; + virtual bool UpdateIce( + const IceServers& configuration, + const webrtc::MediaConstraintsInterface* constraints) OVERRIDE; + virtual bool AddIceCandidate( + const webrtc::IceCandidateInterface* candidate) OVERRIDE; virtual IceState ice_state() OVERRIDE; - void AddRemoteStream(MediaStreamInterface* stream); + void AddRemoteStream(webrtc::MediaStreamInterface* stream); void SetReadyState(ReadyState state) { ready_state_ = state; } void SetIceState(IceState state) { ice_state_ = state; } @@ -118,6 +122,6 @@ class MockPeerConnectionImpl : public PeerConnectionInterface { DISALLOW_COPY_AND_ASSIGN(MockPeerConnectionImpl); }; -} // namespace webrtc +} // namespace content #endif // CONTENT_RENDERER_MEDIA_MOCK_PEER_CONNECTION_IMPL_H_ diff --git a/content/renderer/media/mock_web_peer_connection_00_handler_client.cc b/content/renderer/media/mock_web_peer_connection_00_handler_client.cc index 770e3fb7..513995c 100644 --- a/content/renderer/media/mock_web_peer_connection_00_handler_client.cc +++ b/content/renderer/media/mock_web_peer_connection_00_handler_client.cc @@ -9,7 +9,7 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebMediaStreamDescriptor.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" -namespace WebKit { +namespace content { MockWebPeerConnection00HandlerClient:: MockWebPeerConnection00HandlerClient() @@ -21,7 +21,7 @@ MockWebPeerConnection00HandlerClient:: ~MockWebPeerConnection00HandlerClient() {} void MockWebPeerConnection00HandlerClient::didGenerateICECandidate( - const WebICECandidateDescriptor& candidate, + const WebKit::WebICECandidateDescriptor& candidate, bool more_to_follow) { if (candidate.isNull()) { candidate_label_.clear(); @@ -43,14 +43,14 @@ void MockWebPeerConnection00HandlerClient::didChangeICEState(ICEState state) { } void MockWebPeerConnection00HandlerClient::didAddRemoteStream( - const WebMediaStreamDescriptor& stream_descriptor) { + const WebKit::WebMediaStreamDescriptor& stream_descriptor) { stream_label_ = UTF16ToUTF8(stream_descriptor.label()); } void MockWebPeerConnection00HandlerClient::didRemoveRemoteStream( - const WebMediaStreamDescriptor& stream_descriptor) { + const WebKit::WebMediaStreamDescriptor& stream_descriptor) { DCHECK(stream_label_ == UTF16ToUTF8(stream_descriptor.label())); stream_label_.clear(); } -} // namespace WebKit +} // namespace content diff --git a/content/renderer/media/mock_web_peer_connection_00_handler_client.h b/content/renderer/media/mock_web_peer_connection_00_handler_client.h index 7f3de5c..5fa3536 100644 --- a/content/renderer/media/mock_web_peer_connection_00_handler_client.h +++ b/content/renderer/media/mock_web_peer_connection_00_handler_client.h @@ -11,24 +11,24 @@ #include "base/compiler_specific.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPeerConnection00HandlerClient.h" -namespace WebKit { +namespace content { class MockWebPeerConnection00HandlerClient - : public WebPeerConnection00HandlerClient { + : public WebKit::WebPeerConnection00HandlerClient { public: MockWebPeerConnection00HandlerClient(); virtual ~MockWebPeerConnection00HandlerClient(); // WebPeerConnection00HandlerClient implementation. virtual void didGenerateICECandidate( - const WebICECandidateDescriptor& candidate, + const WebKit::WebICECandidateDescriptor& candidate, bool more_to_follow) OVERRIDE; virtual void didChangeReadyState(ReadyState state) OVERRIDE; virtual void didChangeICEState(ICEState state) OVERRIDE; virtual void didAddRemoteStream( - const WebMediaStreamDescriptor& stream_descriptor) OVERRIDE; + const WebKit::WebMediaStreamDescriptor& stream_descriptor) OVERRIDE; virtual void didRemoveRemoteStream( - const WebMediaStreamDescriptor& stream_descriptor) OVERRIDE; + const WebKit::WebMediaStreamDescriptor& stream_descriptor) OVERRIDE; const std::string& stream_label() const { return stream_label_; } ReadyState ready_state() const { return ready_state_; } @@ -46,6 +46,6 @@ class MockWebPeerConnection00HandlerClient DISALLOW_COPY_AND_ASSIGN(MockWebPeerConnection00HandlerClient); }; -} // namespace WebKit +} // namespace content #endif // CONTENT_RENDERER_MEDIA_MOCK_WEB_JSEP_PEER_CONNECTION_HANDLER_CLIENT_H_ diff --git a/content/renderer/media/mock_web_rtc_peer_connection_handler_client.cc b/content/renderer/media/mock_web_rtc_peer_connection_handler_client.cc index 18fddfd..685cb86 100644 --- a/content/renderer/media/mock_web_rtc_peer_connection_handler_client.cc +++ b/content/renderer/media/mock_web_rtc_peer_connection_handler_client.cc @@ -9,7 +9,7 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebMediaStreamDescriptor.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" -namespace WebKit { +namespace content { MockWebRTCPeerConnectionHandlerClient:: MockWebRTCPeerConnectionHandlerClient() @@ -27,7 +27,7 @@ void MockWebRTCPeerConnectionHandlerClient::negotiationNeeded() { } void MockWebRTCPeerConnectionHandlerClient::didGenerateICECandidate( - const WebRTCICECandidate& candidate) { + const WebKit::WebRTCICECandidate& candidate) { if (!candidate.isNull()) { candidate_sdp_ = UTF16ToUTF8(candidate.candidate()); candidate_mline_index_ = candidate.sdpMLineIndex(); @@ -49,14 +49,14 @@ void MockWebRTCPeerConnectionHandlerClient::didChangeICEState(ICEState state) { } void MockWebRTCPeerConnectionHandlerClient::didAddRemoteStream( - const WebMediaStreamDescriptor& stream_descriptor) { + const WebKit::WebMediaStreamDescriptor& stream_descriptor) { stream_label_ = UTF16ToUTF8(stream_descriptor.label()); } void MockWebRTCPeerConnectionHandlerClient::didRemoveRemoteStream( - const WebMediaStreamDescriptor& stream_descriptor) { + const WebKit::WebMediaStreamDescriptor& stream_descriptor) { DCHECK(stream_label_ == UTF16ToUTF8(stream_descriptor.label())); stream_label_.clear(); } -} // namespace WebKit +} // namespace content diff --git a/content/renderer/media/mock_web_rtc_peer_connection_handler_client.h b/content/renderer/media/mock_web_rtc_peer_connection_handler_client.h index 84c2964..2559bb7 100644 --- a/content/renderer/media/mock_web_rtc_peer_connection_handler_client.h +++ b/content/renderer/media/mock_web_rtc_peer_connection_handler_client.h @@ -12,10 +12,10 @@ #include "third_party/WebKit/Source/Platform/chromium/public/WebRTCICECandidate.h" #include "third_party/WebKit/Source/Platform/chromium/public/WebRTCPeerConnectionHandlerClient.h" -namespace WebKit { +namespace content { class MockWebRTCPeerConnectionHandlerClient - : public WebRTCPeerConnectionHandlerClient { + : public WebKit::WebRTCPeerConnectionHandlerClient { public: MockWebRTCPeerConnectionHandlerClient(); virtual ~MockWebRTCPeerConnectionHandlerClient(); @@ -23,13 +23,13 @@ class MockWebRTCPeerConnectionHandlerClient // WebRTCPeerConnectionHandlerClient implementation. virtual void negotiationNeeded() OVERRIDE; virtual void didGenerateICECandidate( - const WebRTCICECandidate& candidate) OVERRIDE; + const WebKit::WebRTCICECandidate& candidate) OVERRIDE; virtual void didChangeReadyState(ReadyState) OVERRIDE; virtual void didChangeICEState(ICEState) OVERRIDE; virtual void didAddRemoteStream( - const WebMediaStreamDescriptor& stream_descriptor) OVERRIDE; + const WebKit::WebMediaStreamDescriptor& stream_descriptor) OVERRIDE; virtual void didRemoveRemoteStream( - const WebMediaStreamDescriptor& stream_descriptor) OVERRIDE; + const WebKit::WebMediaStreamDescriptor& stream_descriptor) OVERRIDE; bool renegotiate() const { return renegotiate_; } @@ -54,6 +54,6 @@ class MockWebRTCPeerConnectionHandlerClient DISALLOW_COPY_AND_ASSIGN(MockWebRTCPeerConnectionHandlerClient); }; -} // namespace WebKit +} // namespace content #endif // CONTENT_RENDERER_MEDIA_MOCK_WEB_RTC_PEER_CONNECTION_HANDLER_CLIENT_H_ diff --git a/content/renderer/media/peer_connection_handler_base.cc b/content/renderer/media/peer_connection_handler_base.cc index 328e384..379e336 100644 --- a/content/renderer/media/peer_connection_handler_base.cc +++ b/content/renderer/media/peer_connection_handler_base.cc @@ -12,10 +12,12 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebMediaStreamSource.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" +namespace content { + static webrtc::LocalMediaStreamInterface* GetLocalNativeMediaStream( const WebKit::WebMediaStreamDescriptor& stream) { - content::MediaStreamExtraData* extra_data = - static_cast<content::MediaStreamExtraData*>(stream.extraData()); + MediaStreamExtraData* extra_data = + static_cast<MediaStreamExtraData*>(stream.extraData()); if (extra_data) return extra_data->local_stream(); return NULL; @@ -91,6 +93,8 @@ PeerConnectionHandlerBase::CreateWebKitStreamDescriptor( WebKit::WebMediaStreamDescriptor descriptor; descriptor.initialize(UTF8ToUTF16(stream->label()), audio_source_vector, video_source_vector); - descriptor.setExtraData(new content::MediaStreamExtraData(stream)); + descriptor.setExtraData(new MediaStreamExtraData(stream)); return descriptor; } + +} // namespace content diff --git a/content/renderer/media/peer_connection_handler_base.h b/content/renderer/media/peer_connection_handler_base.h index fc57b35..7ccf42a 100644 --- a/content/renderer/media/peer_connection_handler_base.h +++ b/content/renderer/media/peer_connection_handler_base.h @@ -15,6 +15,7 @@ #include "third_party/libjingle/source/talk/app/webrtc/peerconnectioninterface.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebMediaStreamDescriptor.h" +namespace content { class MediaStreamDependencyFactory; // PeerConnectionHandlerBase is the base class of a delegate for the @@ -55,4 +56,6 @@ class CONTENT_EXPORT PeerConnectionHandlerBase DISALLOW_COPY_AND_ASSIGN(PeerConnectionHandlerBase); }; +} // namespace content + #endif // CONTENT_RENDERER_MEDIA_PEER_CONNECTION_HANDLER_BASE_H_ diff --git a/content/renderer/media/peer_connection_handler_jsep.cc b/content/renderer/media/peer_connection_handler_jsep.cc index e243a48..5601b898 100644 --- a/content/renderer/media/peer_connection_handler_jsep.cc +++ b/content/renderer/media/peer_connection_handler_jsep.cc @@ -23,6 +23,8 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSessionDescriptionDescriptor.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" +namespace content { + PeerConnectionHandlerJsep::PeerConnectionHandlerJsep( WebKit::WebPeerConnection00HandlerClient* client, MediaStreamDependencyFactory* dependency_factory) @@ -364,3 +366,5 @@ bool PeerConnectionHandlerJsep::GetNativeAction( } return true; } + +} // namespace content diff --git a/content/renderer/media/peer_connection_handler_jsep.h b/content/renderer/media/peer_connection_handler_jsep.h index 5fbdb0c..6eb6e25 100644 --- a/content/renderer/media/peer_connection_handler_jsep.h +++ b/content/renderer/media/peer_connection_handler_jsep.h @@ -14,6 +14,8 @@ #include "content/renderer/media/peer_connection_handler_base.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPeerConnection00Handler.h" +namespace content { + // PeerConnectionHandlerJsep is a delegate for the JSEP PeerConnection API // messages going between WebKit and native PeerConnection in libjingle. It's // owned by WebKit. @@ -77,4 +79,6 @@ class CONTENT_EXPORT PeerConnectionHandlerJsep DISALLOW_COPY_AND_ASSIGN(PeerConnectionHandlerJsep); }; +} // namespace content + #endif // CONTENT_RENDERER_MEDIA_PEER_CONNECTION_HANDLER_JSEP_H_ diff --git a/content/renderer/media/peer_connection_handler_jsep_unittest.cc b/content/renderer/media/peer_connection_handler_jsep_unittest.cc index a561916..256c4f0 100644 --- a/content/renderer/media/peer_connection_handler_jsep_unittest.cc +++ b/content/renderer/media/peer_connection_handler_jsep_unittest.cc @@ -21,6 +21,8 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSessionDescriptionDescriptor.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" +namespace content { + class PeerConnectionHandlerJsepUnderTest : public PeerConnectionHandlerJsep { public: PeerConnectionHandlerJsepUnderTest( @@ -29,9 +31,8 @@ class PeerConnectionHandlerJsepUnderTest : public PeerConnectionHandlerJsep { : PeerConnectionHandlerJsep(client, dependency_factory) { } - webrtc::MockPeerConnectionImpl* native_peer_connection() { - return static_cast<webrtc::MockPeerConnectionImpl*>( - native_peer_connection_.get()); + MockPeerConnectionImpl* native_peer_connection() { + return static_cast<MockPeerConnectionImpl*>(native_peer_connection_.get()); } }; @@ -41,7 +42,7 @@ class PeerConnectionHandlerJsepTest : public ::testing::Test { } void SetUp() { - mock_client_.reset(new WebKit::MockWebPeerConnection00HandlerClient()); + mock_client_.reset(new MockWebPeerConnection00HandlerClient()); mock_dependency_factory_.reset( new MockMediaStreamDependencyFactory()); mock_dependency_factory_->EnsurePeerConnectionFactory(); @@ -88,7 +89,7 @@ class PeerConnectionHandlerJsepTest : public ::testing::Test { WebKit::WebMediaStreamDescriptor local_stream; local_stream.initialize(UTF8ToUTF16(stream_label), audio_sources, video_sources); - local_stream.setExtraData(new content::MediaStreamExtraData(native_stream)); + local_stream.setExtraData(new MediaStreamExtraData(native_stream)); return local_stream; } @@ -118,12 +119,12 @@ class PeerConnectionHandlerJsepTest : public ::testing::Test { return stream; } - scoped_ptr<WebKit::MockWebPeerConnection00HandlerClient> mock_client_; + scoped_ptr<MockWebPeerConnection00HandlerClient> mock_client_; scoped_ptr<MockMediaStreamDependencyFactory> mock_dependency_factory_; scoped_ptr<PeerConnectionHandlerJsepUnderTest> pc_handler_; // Weak reference to the mocked native peer connection implementation. - webrtc::MockPeerConnectionImpl* mock_peer_connection_; + MockPeerConnectionImpl* mock_peer_connection_; }; TEST_F(PeerConnectionHandlerJsepTest, Basic) { @@ -304,3 +305,5 @@ TEST_F(PeerConnectionHandlerJsepTest, ReceiveMultipleRemoteStreams) { pc_handler_->OnAddStream(stream_2); EXPECT_EQ(stream_label_2, mock_client_->stream_label()); } + +} // namespace content diff --git a/content/renderer/media/renderer_gpu_video_decoder_factories.cc b/content/renderer/media/renderer_gpu_video_decoder_factories.cc index 431b587..c1b8435 100644 --- a/content/renderer/media/renderer_gpu_video_decoder_factories.cc +++ b/content/renderer/media/renderer_gpu_video_decoder_factories.cc @@ -15,6 +15,8 @@ #include "gpu/command_buffer/client/gles2_implementation.h" #include "gpu/ipc/command_buffer_proxy.h" +namespace content { + RendererGpuVideoDecoderFactories::~RendererGpuVideoDecoderFactories() {} RendererGpuVideoDecoderFactories::RendererGpuVideoDecoderFactories( GpuChannelHost* gpu_channel_host, @@ -217,3 +219,5 @@ void RendererGpuVideoDecoderFactories::AsyncCreateSharedMemory( *shm = ChildThread::current()->AllocateSharedMemory(size); waiter->Signal(); } + +} // namespace content diff --git a/content/renderer/media/renderer_gpu_video_decoder_factories.h b/content/renderer/media/renderer_gpu_video_decoder_factories.h index 8516525..3f8d63d 100644 --- a/content/renderer/media/renderer_gpu_video_decoder_factories.h +++ b/content/renderer/media/renderer_gpu_video_decoder_factories.h @@ -19,6 +19,8 @@ namespace base { class WaitableEvent; } +namespace content { + // Glue code to expose functionality needed by media::GpuVideoDecoder to // RenderViewImpl. This class is entirely an implementation detail of // RenderViewImpl and only has its own header to allow extraction of its @@ -90,4 +92,6 @@ class CONTENT_EXPORT RendererGpuVideoDecoderFactories DISALLOW_IMPLICIT_CONSTRUCTORS(RendererGpuVideoDecoderFactories); }; +} // namespace content + #endif // CONTENT_RENDERER_MEDIA_RENDERER_GPU_VIDEO_DECODER_FACTORIES_H_ diff --git a/content/renderer/media/renderer_webaudiodevice_impl.cc b/content/renderer/media/renderer_webaudiodevice_impl.cc index 4eb2761..4c72e8c 100644 --- a/content/renderer/media/renderer_webaudiodevice_impl.cc +++ b/content/renderer/media/renderer_webaudiodevice_impl.cc @@ -9,10 +9,11 @@ #include "content/renderer/media/audio_device_factory.h" #include "media/base/media_switches.h" -using content::AudioDeviceFactory; using WebKit::WebAudioDevice; using WebKit::WebVector; +namespace content { + RendererWebAudioDeviceImpl::RendererWebAudioDeviceImpl( const media::AudioParameters& params, WebAudioDevice::RenderCallback* callback) @@ -88,3 +89,5 @@ void RendererWebAudioDeviceImpl::RenderIO(media::AudioBus* source, void RendererWebAudioDeviceImpl::OnRenderError() { // TODO(crogers): implement error handling. } + +} // namespace content diff --git a/content/renderer/media/renderer_webaudiodevice_impl.h b/content/renderer/media/renderer_webaudiodevice_impl.h index 2a643f4..2e747c9 100644 --- a/content/renderer/media/renderer_webaudiodevice_impl.h +++ b/content/renderer/media/renderer_webaudiodevice_impl.h @@ -10,6 +10,8 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebAudioDevice.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" +namespace content { + class RendererWebAudioDeviceImpl : public WebKit::WebAudioDevice, public media::AudioRendererSink::RenderCallback { @@ -43,4 +45,6 @@ class RendererWebAudioDeviceImpl DISALLOW_COPY_AND_ASSIGN(RendererWebAudioDeviceImpl); }; +} // namespace content + #endif // CONTENT_RENDERER_MEDIA_MEDIA_RENDERER_WEBAUDIODEVICE_IMPL_H_ diff --git a/content/renderer/media/rtc_peer_connection_handler.cc b/content/renderer/media/rtc_peer_connection_handler.cc index b4ccea2..c2092cf 100644 --- a/content/renderer/media/rtc_peer_connection_handler.cc +++ b/content/renderer/media/rtc_peer_connection_handler.cc @@ -21,6 +21,8 @@ #include "third_party/WebKit/Source/Platform/chromium/public/WebURL.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" +namespace content { + // Converter functions from libjingle types to WebKit types. static WebKit::WebRTCPeerConnectionHandlerClient::ICEState @@ -446,3 +448,5 @@ RTCPeerConnectionHandler::CreateNativeSessionDescription( return native_desc; } + +} // namespace content diff --git a/content/renderer/media/rtc_peer_connection_handler.h b/content/renderer/media/rtc_peer_connection_handler.h index e6350db..01db449 100644 --- a/content/renderer/media/rtc_peer_connection_handler.h +++ b/content/renderer/media/rtc_peer_connection_handler.h @@ -15,6 +15,8 @@ namespace WebKit { class WebFrame; } +namespace content { + // RTCPeerConnectionHandler is a delegate for the RTC PeerConnection API // messages going between WebKit and native PeerConnection in libjingle. It's // owned by WebKit. @@ -96,4 +98,6 @@ class CONTENT_EXPORT RTCPeerConnectionHandler DISALLOW_COPY_AND_ASSIGN(RTCPeerConnectionHandler); }; +} // namespace content + #endif // CONTENT_RENDERER_MEDIA_RTC_PEER_CONNECTION_HANDLER_H_ diff --git a/content/renderer/media/rtc_peer_connection_handler_unittest.cc b/content/renderer/media/rtc_peer_connection_handler_unittest.cc index 4889f5e..a0a1b7b 100644 --- a/content/renderer/media/rtc_peer_connection_handler_unittest.cc +++ b/content/renderer/media/rtc_peer_connection_handler_unittest.cc @@ -27,6 +27,8 @@ static const char kDummySdp[] = "dummy sdp"; static const char kDummySdpType[] = "dummy type"; +namespace content { + class RTCPeerConnectionHandlerUnderTest : public RTCPeerConnectionHandler { public: RTCPeerConnectionHandlerUnderTest( @@ -35,9 +37,8 @@ class RTCPeerConnectionHandlerUnderTest : public RTCPeerConnectionHandler { : RTCPeerConnectionHandler(client, dependency_factory) { } - webrtc::MockPeerConnectionImpl* native_peer_connection() { - return static_cast<webrtc::MockPeerConnectionImpl*>( - native_peer_connection_.get()); + MockPeerConnectionImpl* native_peer_connection() { + return static_cast<MockPeerConnectionImpl*>(native_peer_connection_.get()); } }; @@ -47,7 +48,7 @@ class RTCPeerConnectionHandlerTest : public ::testing::Test { } void SetUp() { - mock_client_.reset(new WebKit::MockWebRTCPeerConnectionHandlerClient()); + mock_client_.reset(new MockWebRTCPeerConnectionHandlerClient()); mock_dependency_factory_.reset(new MockMediaStreamDependencyFactory()); mock_dependency_factory_->EnsurePeerConnectionFactory(); pc_handler_.reset( @@ -92,7 +93,7 @@ class RTCPeerConnectionHandlerTest : public ::testing::Test { WebKit::WebMediaStreamDescriptor local_stream; local_stream.initialize(UTF8ToUTF16(stream_label), audio_sources, video_sources); - local_stream.setExtraData(new content::MediaStreamExtraData(native_stream)); + local_stream.setExtraData(new MediaStreamExtraData(native_stream)); return local_stream; } @@ -122,12 +123,12 @@ class RTCPeerConnectionHandlerTest : public ::testing::Test { return stream; } - scoped_ptr<WebKit::MockWebRTCPeerConnectionHandlerClient> mock_client_; + scoped_ptr<MockWebRTCPeerConnectionHandlerClient> mock_client_; scoped_ptr<MockMediaStreamDependencyFactory> mock_dependency_factory_; scoped_ptr<RTCPeerConnectionHandlerUnderTest> pc_handler_; // Weak reference to the mocked native peer connection implementation. - webrtc::MockPeerConnectionImpl* mock_peer_connection_; + MockPeerConnectionImpl* mock_peer_connection_; }; TEST_F(RTCPeerConnectionHandlerTest, CreateOffer) { @@ -312,3 +313,5 @@ TEST_F(RTCPeerConnectionHandlerTest, OnRenegotiationNeeded) { pc_handler_->OnRenegotiationNeeded(); EXPECT_TRUE(mock_client_->renegotiate()); } + +} // namespace content diff --git a/content/renderer/media/rtc_video_capture_delegate.cc b/content/renderer/media/rtc_video_capture_delegate.cc index 89a8548..33a1917 100644 --- a/content/renderer/media/rtc_video_capture_delegate.cc +++ b/content/renderer/media/rtc_video_capture_delegate.cc @@ -6,6 +6,8 @@ #include "base/bind.h" +namespace content { + RtcVideoCaptureDelegate::RtcVideoCaptureDelegate( const media::VideoCaptureSessionId id, VideoCaptureImplManager* vc_manager) @@ -106,3 +108,5 @@ void RtcVideoCaptureDelegate::OnErrorOnCaptureThread( if (!state_callback_.is_null()) state_callback_.Run(got_first_frame_ ? CAPTURE_STOPPED : CAPTURE_FAILED); } + +} // namespace content diff --git a/content/renderer/media/rtc_video_capture_delegate.h b/content/renderer/media/rtc_video_capture_delegate.h index 97a838c..6482250 100644 --- a/content/renderer/media/rtc_video_capture_delegate.h +++ b/content/renderer/media/rtc_video_capture_delegate.h @@ -11,6 +11,8 @@ #include "content/renderer/media/video_capture_impl_manager.h" #include "media/video/capture/video_capture.h" +namespace content { + // Implements a simple reference counted video capturer that guarantees that // methods in RtcVideoCaptureDelegateEventHandler is only called from when // StartCapture have been called until after StopCapture have been called. @@ -83,4 +85,6 @@ class RtcVideoCaptureDelegate scoped_refptr<base::MessageLoopProxy> message_loop_proxy_; }; +} // namespace content + #endif // CONTENT_RENDERER_MEDIA_RTC_VIDEO_CAPTURE_DELEGATE_H_ diff --git a/content/renderer/media/rtc_video_capturer.cc b/content/renderer/media/rtc_video_capturer.cc index 1bc3614..754e499 100644 --- a/content/renderer/media/rtc_video_capturer.cc +++ b/content/renderer/media/rtc_video_capturer.cc @@ -6,6 +6,8 @@ #include "base/bind.h" +namespace content { + RtcVideoCapturer::RtcVideoCapturer( const media::VideoCaptureSessionId id, VideoCaptureImplManager* vc_manager, @@ -123,3 +125,5 @@ void RtcVideoCapturer::OnStateChange( } SignalStateChange(this, converted_state); } + +} // namespace content diff --git a/content/renderer/media/rtc_video_capturer.h b/content/renderer/media/rtc_video_capturer.h index 5fb72a4..47c0a90 100644 --- a/content/renderer/media/rtc_video_capturer.h +++ b/content/renderer/media/rtc_video_capturer.h @@ -11,6 +11,7 @@ #include "content/renderer/media/rtc_video_capture_delegate.h" #include "third_party/libjingle/source/talk/media/base/videocapturer.h" +namespace content { class VideoCaptureImplManager; // RtcVideoCapturer implements a simple cricket::VideoCapturer that is used for @@ -54,4 +55,6 @@ class RtcVideoCapturer DISALLOW_COPY_AND_ASSIGN(RtcVideoCapturer); }; +} // namespace content + #endif // CONTENT_RENDERER_MEDIA_RTC_VIDEO_CAPTURER_H_ diff --git a/content/renderer/media/rtc_video_decoder.cc b/content/renderer/media/rtc_video_decoder.cc index d86a2ae..2ca2379 100644 --- a/content/renderer/media/rtc_video_decoder.cc +++ b/content/renderer/media/rtc_video_decoder.cc @@ -26,6 +26,8 @@ using media::PipelineStatusCB; using media::StatisticsCB; using media::VideoDecoder; +namespace content { + RTCVideoDecoder::RTCVideoDecoder(base::TaskRunner* video_decoder_thread, base::TaskRunner* main_thread, webrtc::VideoTrackInterface* video_track) @@ -192,3 +194,5 @@ void RTCVideoDecoder::DeregisterFromVideoTrack() { RTCVideoDecoder::~RTCVideoDecoder() { DCHECK_NE(kNormal, state_); } + +} // namespace content diff --git a/content/renderer/media/rtc_video_decoder.h b/content/renderer/media/rtc_video_decoder.h index 9c87053..39cfd81 100644 --- a/content/renderer/media/rtc_video_decoder.h +++ b/content/renderer/media/rtc_video_decoder.h @@ -21,6 +21,8 @@ namespace cricket { class VideoFrame; } // namespace cricket +namespace content { + // RTCVideoDecoder is a media::VideoDecoder designed for rendering // Video MediaStreamTracks, // http://dev.w3.org/2011/webrtc/editor/getusermedia.html#mediastreamtrack @@ -91,4 +93,6 @@ class CONTENT_EXPORT RTCVideoDecoder DISALLOW_COPY_AND_ASSIGN(RTCVideoDecoder); }; +} // namespace content + #endif // CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_H_ diff --git a/content/renderer/media/rtc_video_decoder_unittest.cc b/content/renderer/media/rtc_video_decoder_unittest.cc index f37b610..c13b255 100644 --- a/content/renderer/media/rtc_video_decoder_unittest.cc +++ b/content/renderer/media/rtc_video_decoder_unittest.cc @@ -36,6 +36,7 @@ using media::PipelineStatistics; using media::PIPELINE_OK; using media::StatisticsCB; +namespace content { namespace { class NullVideoFrame : public cricket::VideoFrame { @@ -327,3 +328,5 @@ TEST_F(RTCVideoDecoderTest, ReadAndShutdown) { decoder_->Read(read_cb_); message_loop_.RunAllPending(); } + +} // namespace content diff --git a/content/renderer/media/video_capture_impl.cc b/content/renderer/media/video_capture_impl.cc index 9ebc8a7..51047ec 100644 --- a/content/renderer/media/video_capture_impl.cc +++ b/content/renderer/media/video_capture_impl.cc @@ -9,6 +9,8 @@ #include "content/common/child_process.h" #include "content/common/media/video_capture_messages.h" +namespace content { + struct VideoCaptureImpl::DIBBuffer { public: DIBBuffer( @@ -434,3 +436,5 @@ bool VideoCaptureImpl::RemoveClient( } return found; } + +} // namespace content diff --git a/content/renderer/media/video_capture_impl.h b/content/renderer/media/video_capture_impl.h index 381ecc2..b23f7a3 100644 --- a/content/renderer/media/video_capture_impl.h +++ b/content/renderer/media/video_capture_impl.h @@ -32,6 +32,8 @@ namespace base { class MessageLoopProxy; } +namespace content { + class CONTENT_EXPORT VideoCaptureImpl : public media::VideoCapture, public VideoCaptureMessageFilter::Delegate { public: @@ -127,4 +129,6 @@ class CONTENT_EXPORT VideoCaptureImpl DISALLOW_COPY_AND_ASSIGN(VideoCaptureImpl); }; +} // namespace content + #endif // CONTENT_RENDERER_MEDIA_VIDEO_CAPTURE_IMPL_H_ diff --git a/content/renderer/media/video_capture_impl_manager.cc b/content/renderer/media/video_capture_impl_manager.cc index d1f0e6d..806ddf5 100644 --- a/content/renderer/media/video_capture_impl_manager.cc +++ b/content/renderer/media/video_capture_impl_manager.cc @@ -9,6 +9,8 @@ #include "content/renderer/media/video_capture_impl.h" #include "content/renderer/media/video_capture_message_filter.h" +namespace content { + VideoCaptureImplManager::VideoCaptureImplManager() : thread_("VC manager") { thread_.Start(); @@ -76,3 +78,5 @@ VideoCaptureImplManager::Device::Device( } VideoCaptureImplManager::Device::~Device() {} + +} // namespace content diff --git a/content/renderer/media/video_capture_impl_manager.h b/content/renderer/media/video_capture_impl_manager.h index 0d3faa5..0a3baf4 100644 --- a/content/renderer/media/video_capture_impl_manager.h +++ b/content/renderer/media/video_capture_impl_manager.h @@ -19,6 +19,8 @@ #include "content/common/content_export.h" #include "media/video/capture/video_capture.h" +namespace content { + class VideoCaptureImpl; class VideoCaptureMessageFilter; @@ -71,4 +73,6 @@ class CONTENT_EXPORT VideoCaptureImplManager DISALLOW_COPY_AND_ASSIGN(VideoCaptureImplManager); }; +} // namespace content + #endif // CONTENT_RENDERER_MEDIA_VIDEO_CAPTURE_IMPL_MANAGER_H_ diff --git a/content/renderer/media/video_capture_impl_unittest.cc b/content/renderer/media/video_capture_impl_unittest.cc index 2ea5adb..1587714 100644 --- a/content/renderer/media/video_capture_impl_unittest.cc +++ b/content/renderer/media/video_capture_impl_unittest.cc @@ -18,6 +18,8 @@ using ::testing::Return; #define CAPABILITY_LARGE {320, 240, 30, media::VideoCaptureCapability::kI420, \ 0, false } +namespace content { + class MockVideoCaptureMessageFilter : public VideoCaptureMessageFilter { public: MockVideoCaptureMessageFilter() : VideoCaptureMessageFilter() {} @@ -296,3 +298,5 @@ TEST_F(VideoCaptureImplTest, TwoClientsWithSameSize) { video_capture_impl_->StopCapture(client2.get()); message_loop_->RunAllPending(); } + +} // namespace content diff --git a/content/renderer/media/video_capture_message_filter.cc b/content/renderer/media/video_capture_message_filter.cc index dabbcae..df2e856 100644 --- a/content/renderer/media/video_capture_message_filter.cc +++ b/content/renderer/media/video_capture_message_filter.cc @@ -7,6 +7,8 @@ #include "content/common/media/video_capture_messages.h" #include "content/common/view_messages.h" +namespace content { + VideoCaptureMessageFilter::VideoCaptureMessageFilter() : last_device_id_(0), channel_(NULL) { @@ -159,3 +161,5 @@ void VideoCaptureMessageFilter::OnDeviceInfoReceived( } delegate->OnDeviceInfoReceived(params); } + +} // namespace content diff --git a/content/renderer/media/video_capture_message_filter.h b/content/renderer/media/video_capture_message_filter.h index ba597c4..634c5fe 100644 --- a/content/renderer/media/video_capture_message_filter.h +++ b/content/renderer/media/video_capture_message_filter.h @@ -19,6 +19,8 @@ #include "ipc/ipc_channel_proxy.h" #include "media/video/capture/video_capture.h" +namespace content { + class CONTENT_EXPORT VideoCaptureMessageFilter : public IPC::ChannelProxy::MessageFilter { public: @@ -103,4 +105,6 @@ class CONTENT_EXPORT VideoCaptureMessageFilter DISALLOW_COPY_AND_ASSIGN(VideoCaptureMessageFilter); }; +} // namespace content + #endif // CONTENT_RENDERER_MEDIA_VIDEO_CAPTURE_MESSAGE_FILTER_H_ diff --git a/content/renderer/media/video_capture_message_filter_unittest.cc b/content/renderer/media/video_capture_message_filter_unittest.cc index 46ecc4d..4c074c2 100644 --- a/content/renderer/media/video_capture_message_filter_unittest.cc +++ b/content/renderer/media/video_capture_message_filter_unittest.cc @@ -8,6 +8,7 @@ #include "content/renderer/media/video_capture_message_filter.h" #include "testing/gtest/include/gtest/gtest.h" +namespace content { namespace { class MockVideoCaptureDelegate : public VideoCaptureMessageFilter::Delegate { @@ -215,3 +216,5 @@ TEST(VideoCaptureMessageFilterTest, Delegates) { message_loop.RunAllPending(); } + +} // namespace content diff --git a/content/renderer/media/webmediaplayer_proxy_impl_android.cc b/content/renderer/media/webmediaplayer_proxy_impl_android.cc index 8bfed8c..34d21cd 100644 --- a/content/renderer/media/webmediaplayer_proxy_impl_android.cc +++ b/content/renderer/media/webmediaplayer_proxy_impl_android.cc @@ -13,9 +13,9 @@ namespace content { WebMediaPlayerProxyImplAndroid::WebMediaPlayerProxyImplAndroid( - content::RenderView* render_view, + RenderView* render_view, webkit_media::WebMediaPlayerManagerAndroid* manager) - : content::RenderViewObserver(render_view), + : RenderViewObserver(render_view), manager_(manager) { } diff --git a/content/renderer/media/webrtc_audio_device_impl.cc b/content/renderer/media/webrtc_audio_device_impl.cc index 36ecab4..54fb42a 100644 --- a/content/renderer/media/webrtc_audio_device_impl.cc +++ b/content/renderer/media/webrtc_audio_device_impl.cc @@ -420,7 +420,7 @@ int32_t WebRtcAudioDeviceImpl::Init() { // Ask the browser for the default audio output hardware sample-rate. // This request is based on a synchronous IPC message. - int out_sample_rate = audio_hardware::GetOutputSampleRate(); + int out_sample_rate = AudioHardware::GetOutputSampleRate(); DVLOG(1) << "Audio output hardware sample rate: " << out_sample_rate; AddHistogramSampleRate(kAudioOutput, out_sample_rate); @@ -436,7 +436,7 @@ int32_t WebRtcAudioDeviceImpl::Init() { // Ask the browser for the default audio input hardware sample-rate. // This request is based on a synchronous IPC message. - int in_sample_rate = audio_hardware::GetInputSampleRate(); + int in_sample_rate = AudioHardware::GetInputSampleRate(); DVLOG(1) << "Audio input hardware sample rate: " << in_sample_rate; AddHistogramSampleRate(kAudioInput, in_sample_rate); @@ -452,7 +452,7 @@ int32_t WebRtcAudioDeviceImpl::Init() { // Ask the browser for the default number of audio input channels. // This request is based on a synchronous IPC message. - ChannelLayout in_channel_layout = audio_hardware::GetInputChannelLayout(); + ChannelLayout in_channel_layout = AudioHardware::GetInputChannelLayout(); DVLOG(1) << "Audio input hardware channels: " << in_channel_layout; ChannelLayout out_channel_layout = media::CHANNEL_LAYOUT_MONO; diff --git a/content/renderer/media/webrtc_audio_device_unittest.cc b/content/renderer/media/webrtc_audio_device_unittest.cc index ec6337a..ed2245f 100644 --- a/content/renderer/media/webrtc_audio_device_unittest.cc +++ b/content/renderer/media/webrtc_audio_device_unittest.cc @@ -93,7 +93,7 @@ bool HardwareSampleRatesAreValid() { // Verify the input sample rate. int input_sample_rate = - static_cast<int>(audio_hardware::GetInputSampleRate()); + static_cast<int>(AudioHardware::GetInputSampleRate()); if (!FindElementInArray(valid_input_rates, arraysize(valid_input_rates), input_sample_rate)) { @@ -103,7 +103,7 @@ bool HardwareSampleRatesAreValid() { // Given that the input rate was OK, verify the output rate as well. int output_sample_rate = - static_cast<int>(audio_hardware::GetOutputSampleRate()); + static_cast<int>(AudioHardware::GetOutputSampleRate()); if (!FindElementInArray(valid_output_rates, arraysize(valid_output_rates), output_sample_rate)) { LOG(WARNING) << "Non-supported output sample rate detected."; diff --git a/content/renderer/media/webrtc_uma_histograms.h b/content/renderer/media/webrtc_uma_histograms.h index 9b7a073..de358f4 100644 --- a/content/renderer/media/webrtc_uma_histograms.h +++ b/content/renderer/media/webrtc_uma_histograms.h @@ -7,7 +7,7 @@ #include "base/metrics/histogram.h" -namespace { +namespace content { // Helper enum used for histogramming calls to WebRTC APIs from JavaScript. enum JavaScriptAPIName { @@ -21,10 +21,10 @@ enum JavaScriptAPIName { // Helper method used to collect information about the number of times // different WebRTC API:s are called from JavaScript. // The histogram can be viewed at chrome://histograms/WebRTC.webkitApiCount. -void UpdateWebRTCMethodCount(JavaScriptAPIName api_name) { +inline void UpdateWebRTCMethodCount(JavaScriptAPIName api_name) { UMA_HISTOGRAM_ENUMERATION("WebRTC.webkitApiCount", api_name, INVALID_NAME); } -} // namespace +} // namespace content #endif // CONTENT_RENDERER_MEDIA_WEBRTC_UMA_HISTOGRAMS_H_ diff --git a/content/renderer/pepper/pepper_file_chooser_host.h b/content/renderer/pepper/pepper_file_chooser_host.h index 5763132..d9f9a2a 100644 --- a/content/renderer/pepper/pepper_file_chooser_host.h +++ b/content/renderer/pepper/pepper_file_chooser_host.h @@ -60,6 +60,6 @@ class CONTENT_EXPORT PepperFileChooserHost DISALLOW_COPY_AND_ASSIGN(PepperFileChooserHost); }; -} // namespace ppapi +} // namespace content #endif // CONTENT_RENDERER_PEPPER_PEPPER_FILE_CHOOSER_HOST_H_ diff --git a/content/renderer/pepper/pepper_platform_audio_output_impl.cc b/content/renderer/pepper/pepper_platform_audio_output_impl.cc index 843569f..738d620 100644 --- a/content/renderer/pepper/pepper_platform_audio_output_impl.cc +++ b/content/renderer/pepper/pepper_platform_audio_output_impl.cc @@ -129,9 +129,9 @@ bool PepperPlatformAudioOutputImpl::Initialize( // Rely on AudioOutputResampler to handle any inconsistencies between the // hardware params required for low latency and the requested params. format = media::AudioParameters::AUDIO_PCM_LOW_LATENCY; - } else if (sample_rate == audio_hardware::GetOutputSampleRate() && + } else if (sample_rate == AudioHardware::GetOutputSampleRate() && frames_per_buffer <= kMaxFramesForLowLatency && - frames_per_buffer % audio_hardware::GetOutputBufferSize() == 0) { + frames_per_buffer % AudioHardware::GetOutputBufferSize() == 0) { // Use the low latency back end if the client request is compatible, and // the sample count is low enough to justify using AUDIO_PCM_LOW_LATENCY. format = media::AudioParameters::AUDIO_PCM_LOW_LATENCY; diff --git a/content/renderer/pepper/pepper_plugin_delegate_impl.cc b/content/renderer/pepper/pepper_plugin_delegate_impl.cc index 63b36fa..c5a5e63 100644 --- a/content/renderer/pepper/pepper_plugin_delegate_impl.cc +++ b/content/renderer/pepper/pepper_plugin_delegate_impl.cc @@ -875,11 +875,11 @@ void PepperPluginDelegateImpl::SelectedFindResultChanged(int identifier, } uint32_t PepperPluginDelegateImpl::GetAudioHardwareOutputSampleRate() { - return static_cast<uint32_t>(audio_hardware::GetOutputSampleRate()); + return static_cast<uint32_t>(AudioHardware::GetOutputSampleRate()); } uint32_t PepperPluginDelegateImpl::GetAudioHardwareOutputBufferSize() { - return static_cast<uint32_t>(audio_hardware::GetOutputBufferSize()); + return static_cast<uint32_t>(AudioHardware::GetOutputBufferSize()); } webkit::ppapi::PluginDelegate::PlatformAudioOutput* diff --git a/content/renderer/pepper/pepper_proxy_channel_delegate_impl.cc b/content/renderer/pepper/pepper_proxy_channel_delegate_impl.cc index e9af62c..18eb6ca 100644 --- a/content/renderer/pepper/pepper_proxy_channel_delegate_impl.cc +++ b/content/renderer/pepper/pepper_proxy_channel_delegate_impl.cc @@ -28,8 +28,8 @@ PepperProxyChannelDelegateImpl::ShareHandleWithRemote( base::PlatformFile handle, const IPC::SyncChannel& channel, bool should_close_source) { - return content::BrokerGetFileHandleForProcess(handle, channel.peer_pid(), - should_close_source); + return BrokerGetFileHandleForProcess(handle, channel.peer_pid(), + should_close_source); } } // namespace content diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc index f853b5e..74e81ce 100644 --- a/content/renderer/render_thread_impl.cc +++ b/content/renderer/render_thread_impl.cc @@ -856,8 +856,8 @@ RenderThreadImpl::GetGpuVDAContext3D() { AudioRendererMixerManager* RenderThreadImpl::GetAudioRendererMixerManager() { if (!audio_renderer_mixer_manager_.get()) { audio_renderer_mixer_manager_.reset(new AudioRendererMixerManager( - audio_hardware::GetOutputSampleRate(), - audio_hardware::GetOutputBufferSize())); + AudioHardware::GetOutputSampleRate(), + AudioHardware::GetOutputBufferSize())); } return audio_renderer_mixer_manager_.get(); diff --git a/content/renderer/render_thread_impl.h b/content/renderer/render_thread_impl.h index 4806e3f..404e7cc 100644 --- a/content/renderer/render_thread_impl.h +++ b/content/renderer/render_thread_impl.h @@ -23,17 +23,13 @@ #include "ui/gfx/native_widget_types.h" class AppCacheDispatcher; -class AudioInputMessageFilter; -class AudioMessageFilter; class DBMessageFilter; class GpuChannelHost; class IndexedDBDispatcher; -class MediaStreamDependencyFactory; class SkBitmap; -class VideoCaptureImplManager; -struct ViewMsg_New_Params; class WebDatabaseObserverImpl; class WebGraphicsContext3DCommandBufferImpl; +struct ViewMsg_New_Params; namespace WebKit { class WebMediaStreamCenter; @@ -61,14 +57,18 @@ class Extension; namespace content { +class AudioInputMessageFilter; +class AudioMessageFilter; class AudioRendererMixerManager; class CompositorThread; class DevToolsAgentFilter; class DomStorageDispatcher; class MediaStreamCenter; +class MediaStreamDependencyFactory; class P2PSocketDispatcher; class RendererWebKitPlatformSupportImpl; class RenderProcessObserver; +class VideoCaptureImplManager; namespace old { class BrowserPluginChannelManager; diff --git a/content/renderer/render_view_impl.h b/content/renderer/render_view_impl.h index 5e62136..7885b35 100644 --- a/content/renderer/render_view_impl.h +++ b/content/renderer/render_view_impl.h @@ -63,8 +63,6 @@ #endif class CommandLine; -class DomAutomationController; -class JavaBridgeDispatcher; class PepperDeviceTest; class SkBitmap; class WebUIBindings; @@ -143,9 +141,11 @@ namespace content { class DeviceOrientationDispatcher; class DevToolsAgent; class DocumentState; +class DomAutomationController; class ExternalPopupMenu; class GeolocationDispatcher; class InputTagSpeechDispatcher; +class JavaBridgeDispatcher; class LoadProgressTracker; class MediaStreamDispatcher; class MediaStreamImpl; diff --git a/content/renderer/renderer_webkitplatformsupport_impl.cc b/content/renderer/renderer_webkitplatformsupport_impl.cc index b3a6312..ac0559b 100644 --- a/content/renderer/renderer_webkitplatformsupport_impl.cc +++ b/content/renderer/renderer_webkitplatformsupport_impl.cc @@ -556,11 +556,11 @@ bool RendererWebKitPlatformSupportImpl::canAccelerate2dCanvas() { } double RendererWebKitPlatformSupportImpl::audioHardwareSampleRate() { - return audio_hardware::GetOutputSampleRate(); + return AudioHardware::GetOutputSampleRate(); } size_t RendererWebKitPlatformSupportImpl::audioHardwareBufferSize() { - return audio_hardware::GetOutputBufferSize(); + return AudioHardware::GetOutputBufferSize(); } WebAudioDevice* diff --git a/content/renderer/v8_value_converter_impl_unittest.cc b/content/renderer/v8_value_converter_impl_unittest.cc index b4b12bd..c260b3f 100644 --- a/content/renderer/v8_value_converter_impl_unittest.cc +++ b/content/renderer/v8_value_converter_impl_unittest.cc @@ -10,7 +10,7 @@ #include "testing/gtest/include/gtest/gtest.h" #include "v8/include/v8.h" -using content::V8ValueConverter; +namespace content { namespace { @@ -547,3 +547,5 @@ TEST_F(V8ValueConverterImplTest, UndefinedValueBehavior) { scoped_ptr<Value> actual_array(converter.FromV8Value(array, context_)); EXPECT_TRUE(Value::Equals(&expected_array, actual_array.get())); } + +} // namespace content diff --git a/content/test/webrtc_audio_device_test.cc b/content/test/webrtc_audio_device_test.cc index 55c8a8e..eaf5b15 100644 --- a/content/test/webrtc_audio_device_test.cc +++ b/content/test/webrtc_audio_device_test.cc @@ -190,7 +190,7 @@ bool WebRTCAudioDeviceTest::Send(IPC::Message* message) { void WebRTCAudioDeviceTest::SetAudioUtilCallback(AudioUtilInterface* callback) { // Invalidate any potentially cached values since the new callback should // be used for those queries. - audio_hardware::ResetCache(); + AudioHardware::ResetCache(); audio_util_callback_ = callback; } |