OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 3319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3330 | 3330 |
3331 if (size == preferred_size_) | 3331 if (size == preferred_size_) |
3332 return; | 3332 return; |
3333 | 3333 |
3334 preferred_size_ = size; | 3334 preferred_size_ = size; |
3335 Send(new ViewHostMsg_DidContentsPreferredSizeChange(routing_id_, | 3335 Send(new ViewHostMsg_DidContentsPreferredSizeChange(routing_id_, |
3336 preferred_size_)); | 3336 preferred_size_)); |
3337 } | 3337 } |
3338 | 3338 |
3339 void RenderViewImpl::EnsureMediaStreamImpl() { | 3339 void RenderViewImpl::EnsureMediaStreamImpl() { |
3340 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 3340 if (!RenderThreadImpl::current()) // Will be NULL during unit tests. |
3341 if (!cmd_line->HasSwitch(switches::kEnableMediaStream)) | |
3342 return; | 3341 return; |
3343 | 3342 |
3344 #if defined(ENABLE_P2P_APIS) | 3343 #if defined(ENABLE_P2P_APIS) |
3345 if (!p2p_socket_dispatcher_) | 3344 if (!p2p_socket_dispatcher_) |
3346 p2p_socket_dispatcher_ = new content::P2PSocketDispatcher(this); | 3345 p2p_socket_dispatcher_ = new content::P2PSocketDispatcher(this); |
3347 #endif | 3346 #endif |
3348 | 3347 |
3349 #if defined(ENABLE_WEBRTC) | 3348 #if defined(ENABLE_WEBRTC) |
3350 if (!media_stream_dispatcher_) | 3349 if (!media_stream_dispatcher_) |
3351 media_stream_dispatcher_ = new MediaStreamDispatcher(this); | 3350 media_stream_dispatcher_ = new MediaStreamDispatcher(this); |
(...skipping 2039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5391 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 5390 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
5392 return !!RenderThreadImpl::current()->compositor_thread(); | 5391 return !!RenderThreadImpl::current()->compositor_thread(); |
5393 } | 5392 } |
5394 | 5393 |
5395 void RenderViewImpl::OnJavaBridgeInit() { | 5394 void RenderViewImpl::OnJavaBridgeInit() { |
5396 DCHECK(!java_bridge_dispatcher_); | 5395 DCHECK(!java_bridge_dispatcher_); |
5397 #if defined(ENABLE_JAVA_BRIDGE) | 5396 #if defined(ENABLE_JAVA_BRIDGE) |
5398 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this); | 5397 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this); |
5399 #endif | 5398 #endif |
5400 } | 5399 } |
OLD | NEW |