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

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 8060055: Adding support for MediaStream and PeerConnection functionality (Closed) Base URL: http://git.chromium.org/chromium/chromium.git@trunk
Patch Set: Changed type of port allocator and moved ownership of it, fixed mem leaks in unit tests. Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 #include "content/renderer/devtools_agent.h" 52 #include "content/renderer/devtools_agent.h"
53 #include "content/renderer/external_popup_menu.h" 53 #include "content/renderer/external_popup_menu.h"
54 #include "content/renderer/geolocation_dispatcher.h" 54 #include "content/renderer/geolocation_dispatcher.h"
55 #include "content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h" 55 #include "content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h"
56 #include "content/renderer/idle_user_detector.h" 56 #include "content/renderer/idle_user_detector.h"
57 #include "content/renderer/intents_dispatcher.h" 57 #include "content/renderer/intents_dispatcher.h"
58 #include "content/renderer/java/java_bridge_dispatcher.h" 58 #include "content/renderer/java/java_bridge_dispatcher.h"
59 #include "content/renderer/load_progress_tracker.h" 59 #include "content/renderer/load_progress_tracker.h"
60 #include "content/renderer/media/audio_message_filter.h" 60 #include "content/renderer/media/audio_message_filter.h"
61 #include "content/renderer/media/audio_renderer_impl.h" 61 #include "content/renderer/media/audio_renderer_impl.h"
62 #include "content/renderer/media/media_stream_dependency_factory.h"
63 #include "content/renderer/media/media_stream_dispatcher.h"
62 #include "content/renderer/media/media_stream_impl.h" 64 #include "content/renderer/media/media_stream_impl.h"
63 #include "content/renderer/media/render_media_log.h" 65 #include "content/renderer/media/render_media_log.h"
64 #include "content/renderer/mhtml_generator.h" 66 #include "content/renderer/mhtml_generator.h"
65 #include "content/renderer/notification_provider.h" 67 #include "content/renderer/notification_provider.h"
66 #include "content/renderer/p2p/socket_dispatcher.h" 68 #include "content/renderer/p2p/socket_dispatcher.h"
67 #include "content/renderer/plugin_channel_host.h" 69 #include "content/renderer/plugin_channel_host.h"
68 #include "content/renderer/render_process.h" 70 #include "content/renderer/render_process.h"
69 #include "content/renderer/render_thread_impl.h" 71 #include "content/renderer/render_thread_impl.h"
70 #include "content/renderer/render_widget_fullscreen_pepper.h" 72 #include "content/renderer/render_widget_fullscreen_pepper.h"
71 #include "content/renderer/renderer_accessibility.h" 73 #include "content/renderer/renderer_accessibility.h"
(...skipping 25 matching lines...) Expand all
97 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFormElement.h" 99 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFormElement.h"
98 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" 100 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
99 #include "third_party/WebKit/Source/WebKit/chromium/public/WebHistoryItem.h" 101 #include "third_party/WebKit/Source/WebKit/chromium/public/WebHistoryItem.h"
100 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputElement.h" 102 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputElement.h"
101 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" 103 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h"
102 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIntent.h" 104 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIntent.h"
103 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIntentServiceInfo. h" 105 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIntentServiceInfo. h"
104 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerAction. h" 106 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerAction. h"
105 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNodeList.h" 107 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNodeList.h"
106 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPageSerializer.h" 108 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPageSerializer.h"
109 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPeerConne ctionHandler.h"
110 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPeerConne ctionHandlerClient.h"
107 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPlugin.h" 111 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPlugin.h"
108 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h" 112 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h"
109 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginDocument.h" 113 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginDocument.h"
110 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginParams.h" 114 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginParams.h"
111 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRange.h" 115 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRange.h"
112 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptSource.h" 116 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptSource.h"
113 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSearchableFormData .h" 117 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSearchableFormData .h"
114 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" 118 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h"
115 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityPolicy.h" 119 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityPolicy.h"
116 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSettings.h" 120 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSettings.h"
117 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageNamespace.h " 121 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageNamespace.h "
118 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageQuotaCallba cks.h" 122 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageQuotaCallba cks.h"
119 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" 123 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
120 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWindowFeatures.h" 124 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWindowFeatures.h"
121 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebCString.h " 125 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebCString.h "
122 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebDragData. h" 126 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebDragData. h"
123 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebGraphicsC ontext3D.h" 127 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebGraphicsC ontext3D.h"
124 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebImage.h" 128 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebImage.h"
125 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPoint.h" 129 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPoint.h"
126 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h" 130 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h"
127 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h" 131 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h"
128 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" 132 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h"
129 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" 133 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h"
130 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLError. h" 134 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLError. h"
131 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLReques t.h" 135 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLReques t.h"
132 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLRespon se.h" 136 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLRespon se.h"
137 #include "third_party/WebKit/Source/WebKit/chromium/public/WebUserMediaClient.h"
133 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" 138 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h"
134 #include "third_party/skia/include/core/SkBitmap.h" 139 #include "third_party/skia/include/core/SkBitmap.h"
135 #include "ui/base/javascript_message_type.h" 140 #include "ui/base/javascript_message_type.h"
136 #include "ui/gfx/native_widget_types.h" 141 #include "ui/gfx/native_widget_types.h"
137 #include "ui/gfx/point.h" 142 #include "ui/gfx/point.h"
138 #include "ui/gfx/rect.h" 143 #include "ui/gfx/rect.h"
139 #include "v8/include/v8.h" 144 #include "v8/include/v8.h"
140 #include "webkit/appcache/web_application_cache_host_impl.h" 145 #include "webkit/appcache/web_application_cache_host_impl.h"
141 #include "webkit/forms/form_data.h" 146 #include "webkit/forms/form_data.h"
142 #include "webkit/forms/form_field.h" 147 #include "webkit/forms/form_field.h"
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 target_url_status_(TARGET_NONE), 356 target_url_status_(TARGET_NONE),
352 selection_text_offset_(0), 357 selection_text_offset_(0),
353 cached_is_main_frame_pinned_to_left_(false), 358 cached_is_main_frame_pinned_to_left_(false),
354 cached_is_main_frame_pinned_to_right_(false), 359 cached_is_main_frame_pinned_to_right_(false),
355 cached_has_main_frame_horizontal_scrollbar_(false), 360 cached_has_main_frame_horizontal_scrollbar_(false),
356 cached_has_main_frame_vertical_scrollbar_(false), 361 cached_has_main_frame_vertical_scrollbar_(false),
357 ALLOW_THIS_IN_INITIALIZER_LIST(cookie_jar_(this)), 362 ALLOW_THIS_IN_INITIALIZER_LIST(cookie_jar_(this)),
358 geolocation_dispatcher_(NULL), 363 geolocation_dispatcher_(NULL),
359 speech_input_dispatcher_(NULL), 364 speech_input_dispatcher_(NULL),
360 device_orientation_dispatcher_(NULL), 365 device_orientation_dispatcher_(NULL),
366 media_stream_dispatcher_(NULL),
361 p2p_socket_dispatcher_(NULL), 367 p2p_socket_dispatcher_(NULL),
362 devtools_agent_(NULL), 368 devtools_agent_(NULL),
363 renderer_accessibility_(NULL), 369 renderer_accessibility_(NULL),
364 session_storage_namespace_id_(session_storage_namespace_id), 370 session_storage_namespace_id_(session_storage_namespace_id),
365 handling_select_range_(false), 371 handling_select_range_(false),
366 #if defined(OS_WIN) 372 #if defined(OS_WIN)
367 focused_plugin_id_(-1), 373 focused_plugin_id_(-1),
368 #endif 374 #endif
369 ALLOW_THIS_IN_INITIALIZER_LIST(pepper_delegate_(this)) { 375 ALLOW_THIS_IN_INITIALIZER_LIST(pepper_delegate_(this)) {
370 routing_id_ = routing_id; 376 routing_id_ = routing_id;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 webview()->mainFrame()->setName(frame_name); 415 webview()->mainFrame()->setName(frame_name);
410 webview()->settings()->setMinimumTimerInterval( 416 webview()->settings()->setMinimumTimerInterval(
411 is_hidden() ? webkit_glue::kBackgroundTabTimerInterval : 417 is_hidden() ? webkit_glue::kBackgroundTabTimerInterval :
412 webkit_glue::kForegroundTabTimerInterval); 418 webkit_glue::kForegroundTabTimerInterval);
413 419
414 OnSetRendererPrefs(renderer_prefs); 420 OnSetRendererPrefs(renderer_prefs);
415 421
416 host_window_ = parent_hwnd; 422 host_window_ = parent_hwnd;
417 423
418 #if defined(ENABLE_P2P_APIS) 424 #if defined(ENABLE_P2P_APIS)
419 p2p_socket_dispatcher_ = new content::P2PSocketDispatcher(this); 425 if (!p2p_socket_dispatcher_)
426 p2p_socket_dispatcher_ = new content::P2PSocketDispatcher(this);
420 #endif 427 #endif
421 428
422 new MHTMLGenerator(this); 429 new MHTMLGenerator(this);
423 #if defined(OS_MACOSX) 430 #if defined(OS_MACOSX)
424 new TextInputClientObserver(this); 431 new TextInputClientObserver(this);
425 #endif // defined(OS_MACOSX) 432 #endif // defined(OS_MACOSX)
426 433
427 devtools_agent_ = new DevToolsAgent(this); 434 devtools_agent_ = new DevToolsAgent(this);
428 435
429 renderer_accessibility_ = new RendererAccessibility(this); 436 renderer_accessibility_ = new RendererAccessibility(this);
430 437
431 new IdleUserDetector(this); 438 new IdleUserDetector(this);
432 439
433 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
434 if (command_line.HasSwitch(switches::kEnableMediaStream)) {
435 media_stream_impl_ = new MediaStreamImpl(
436 RenderThreadImpl::current()->video_capture_impl_manager());
437 }
438
439 content::GetContentClient()->renderer()->RenderViewCreated(this); 440 content::GetContentClient()->renderer()->RenderViewCreated(this);
440 } 441 }
441 442
442 RenderViewImpl::~RenderViewImpl() { 443 RenderViewImpl::~RenderViewImpl() {
443 history_page_ids_.clear(); 444 history_page_ids_.clear();
444 445
445 if (decrement_shared_popup_at_destruction_) 446 if (decrement_shared_popup_at_destruction_)
446 shared_popup_counter_->data--; 447 shared_popup_counter_->data--;
447 448
448 // If file chooser is still waiting for answer, dispatch empty answer. 449 // If file chooser is still waiting for answer, dispatch empty answer.
(...skipping 15 matching lines...) Expand all
464 } 465 }
465 #endif 466 #endif
466 467
467 #ifndef NDEBUG 468 #ifndef NDEBUG
468 // Make sure we are no longer referenced by the ViewMap. 469 // Make sure we are no longer referenced by the ViewMap.
469 ViewMap* views = g_view_map.Pointer(); 470 ViewMap* views = g_view_map.Pointer();
470 for (ViewMap::iterator it = views->begin(); it != views->end(); ++it) 471 for (ViewMap::iterator it = views->begin(); it != views->end(); ++it)
471 DCHECK_NE(this, it->second) << "Failed to call Close?"; 472 DCHECK_NE(this, it->second) << "Failed to call Close?";
472 #endif 473 #endif
473 474
475 // MediaStreamImpl holds weak references to RenderViewObserver objects,
476 // ensure it's deleted before the observers.
477 media_stream_impl_ = NULL;
478
474 FOR_EACH_OBSERVER(RenderViewObserver, observers_, RenderViewGone()); 479 FOR_EACH_OBSERVER(RenderViewObserver, observers_, RenderViewGone());
475 FOR_EACH_OBSERVER(RenderViewObserver, observers_, OnDestruct()); 480 FOR_EACH_OBSERVER(RenderViewObserver, observers_, OnDestruct());
476 } 481 }
477 482
478 /*static*/ 483 /*static*/
479 RenderViewImpl* RenderViewImpl::FromWebView(WebView* webview) { 484 RenderViewImpl* RenderViewImpl::FromWebView(WebView* webview) {
480 ViewMap* views = g_view_map.Pointer(); 485 ViewMap* views = g_view_map.Pointer();
481 ViewMap::iterator it = views->find(webview); 486 ViewMap::iterator it = views->find(webview);
482 return it == views->end() ? NULL : it->second; 487 return it == views->end() ? NULL : it->second;
483 } 488 }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 // static 527 // static
523 void RenderViewImpl::SetNextPageID(int32 next_page_id) { 528 void RenderViewImpl::SetNextPageID(int32 next_page_id) {
524 // This method is called on startup or when the browser knows it needs to 529 // This method is called on startup or when the browser knows it needs to
525 // inflate the page_id when re-using the process. The renderer may have 530 // inflate the page_id when re-using the process. The renderer may have
526 // incremented this just as the browser was sending the message, but we 531 // incremented this just as the browser was sending the message, but we
527 // only care that next_page_id_ is at least as large as next_page_id. 532 // only care that next_page_id_ is at least as large as next_page_id.
528 if (next_page_id > next_page_id_) 533 if (next_page_id > next_page_id_)
529 next_page_id_ = next_page_id; 534 next_page_id_ = next_page_id;
530 } 535 }
531 536
537 WebKit::WebPeerConnectionHandler* RenderViewImpl::CreatePeerConnectionHandler(
538 WebKit::WebPeerConnectionHandlerClient* client) {
539 const CommandLine* cmd_line = CommandLine::ForCurrentProcess();
540 if (!cmd_line->HasSwitch(switches::kEnableMediaStream))
541 return NULL;
542 EnsureMediaStreamImpl();
543 return media_stream_impl_->CreatePeerConnectionHandler(client);
544 }
545
532 void RenderViewImpl::AddObserver(RenderViewObserver* observer) { 546 void RenderViewImpl::AddObserver(RenderViewObserver* observer) {
533 observers_.AddObserver(observer); 547 observers_.AddObserver(observer);
534 } 548 }
535 549
536 void RenderViewImpl::RemoveObserver(RenderViewObserver* observer) { 550 void RenderViewImpl::RemoveObserver(RenderViewObserver* observer) {
537 observer->RenderViewGone(); 551 observer->RenderViewGone();
538 observers_.RemoveObserver(observer); 552 observers_.RemoveObserver(observer);
539 } 553 }
540 554
541 WebKit::WebView* RenderViewImpl::webview() const { 555 WebKit::WebView* RenderViewImpl::webview() const {
(...skipping 2418 matching lines...) Expand 10 before | Expand all | Expand 10 after
2960 size.set_height(preferred_size_.height()); 2974 size.set_height(preferred_size_.height());
2961 2975
2962 if (size == preferred_size_) 2976 if (size == preferred_size_)
2963 return; 2977 return;
2964 2978
2965 preferred_size_ = size; 2979 preferred_size_ = size;
2966 Send(new ViewHostMsg_DidContentsPreferredSizeChange(routing_id_, 2980 Send(new ViewHostMsg_DidContentsPreferredSizeChange(routing_id_,
2967 preferred_size_)); 2981 preferred_size_));
2968 } 2982 }
2969 2983
2984 void RenderViewImpl::EnsureMediaStreamImpl() {
2985 #if defined(ENABLE_P2P_APIS)
2986 if (!p2p_socket_dispatcher_)
2987 p2p_socket_dispatcher_ = new content::P2PSocketDispatcher(this);
2988 #endif
2989
2990 if (!media_stream_dispatcher_)
2991 media_stream_dispatcher_ = new MediaStreamDispatcher(this);
2992
2993 if (!media_stream_impl_.get()) {
2994 MediaStreamDependencyFactory* factory = new MediaStreamDependencyFactory();
2995 media_stream_impl_ = new MediaStreamImpl(
2996 media_stream_dispatcher_,
2997 p2p_socket_dispatcher_,
2998 RenderThreadImpl::current()->video_capture_impl_manager(),
2999 factory);
3000 }
3001 }
3002
2970 void RenderViewImpl::didChangeContentsSize(WebFrame* frame, 3003 void RenderViewImpl::didChangeContentsSize(WebFrame* frame,
2971 const WebSize& size) { 3004 const WebSize& size) {
2972 if (webview()->mainFrame() != frame) 3005 if (webview()->mainFrame() != frame)
2973 return; 3006 return;
2974 WebView* frameView = frame->view(); 3007 WebView* frameView = frame->view();
2975 if (!frameView) 3008 if (!frameView)
2976 return; 3009 return;
2977 3010
2978 bool has_horizontal_scrollbar = frame->hasHorizontalScrollbar(); 3011 bool has_horizontal_scrollbar = frame->hasHorizontalScrollbar();
2979 bool has_vertical_scrollbar = frame->hasVerticalScrollbar(); 3012 bool has_vertical_scrollbar = frame->hasVerticalScrollbar();
(...skipping 1696 matching lines...) Expand 10 before | Expand all | Expand 10 after
4676 WebKit::WebPageVisibilityStateHidden : 4709 WebKit::WebPageVisibilityStateHidden :
4677 WebKit::WebPageVisibilityStateVisible; 4710 WebKit::WebPageVisibilityStateVisible;
4678 WebKit::WebPageVisibilityState override_state = current_state; 4711 WebKit::WebPageVisibilityState override_state = current_state;
4679 if (content::GetContentClient()->renderer()-> 4712 if (content::GetContentClient()->renderer()->
4680 ShouldOverridePageVisibilityState(this, 4713 ShouldOverridePageVisibilityState(this,
4681 &override_state)) 4714 &override_state))
4682 return override_state; 4715 return override_state;
4683 return current_state; 4716 return current_state;
4684 } 4717 }
4685 4718
4719 WebKit::WebUserMediaClient* RenderViewImpl::userMediaClient() {
4720 const CommandLine* cmd_line = CommandLine::ForCurrentProcess();
4721 if (!cmd_line->HasSwitch(switches::kEnableMediaStream))
4722 return NULL;
4723 EnsureMediaStreamImpl();
4724 return media_stream_impl_;
4725 }
4726
4686 bool RenderViewImpl::IsNonLocalTopLevelNavigation( 4727 bool RenderViewImpl::IsNonLocalTopLevelNavigation(
4687 const GURL& url, WebKit::WebFrame* frame, WebKit::WebNavigationType type) { 4728 const GURL& url, WebKit::WebFrame* frame, WebKit::WebNavigationType type) {
4688 // Must be a top level frame. 4729 // Must be a top level frame.
4689 if (frame->parent() != NULL) 4730 if (frame->parent() != NULL)
4690 return false; 4731 return false;
4691 4732
4692 // Navigations initiated within Webkit are not sent out to the external host 4733 // Navigations initiated within Webkit are not sent out to the external host
4693 // in the following cases. 4734 // in the following cases.
4694 // 1. The url scheme is not http/https 4735 // 1. The url scheme is not http/https
4695 // 2. The origin of the url and the opener is the same in which case the 4736 // 2. The origin of the url and the opener is the same in which case the
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
4803 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { 4844 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const {
4804 return !!RenderThreadImpl::current()->compositor_thread(); 4845 return !!RenderThreadImpl::current()->compositor_thread();
4805 } 4846 }
4806 4847
4807 void RenderViewImpl::OnJavaBridgeInit() { 4848 void RenderViewImpl::OnJavaBridgeInit() {
4808 DCHECK(!java_bridge_dispatcher_.get()); 4849 DCHECK(!java_bridge_dispatcher_.get());
4809 #if defined(ENABLE_JAVA_BRIDGE) 4850 #if defined(ENABLE_JAVA_BRIDGE)
4810 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); 4851 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this));
4811 #endif 4852 #endif
4812 } 4853 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698