Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/browser/frame_host/render_widget_host_view_child_frame.h" | 5 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 49 | 49 |
| 50 RenderWidgetHostViewChildFrame::RenderWidgetHostViewChildFrame( | 50 RenderWidgetHostViewChildFrame::RenderWidgetHostViewChildFrame( |
| 51 RenderWidgetHost* widget_host) | 51 RenderWidgetHost* widget_host) |
| 52 : host_(RenderWidgetHostImpl::From(widget_host)), | 52 : host_(RenderWidgetHostImpl::From(widget_host)), |
| 53 frame_sink_id_( | 53 frame_sink_id_( |
| 54 base::checked_cast<uint32_t>(widget_host->GetProcess()->GetID()), | 54 base::checked_cast<uint32_t>(widget_host->GetProcess()->GetID()), |
| 55 base::checked_cast<uint32_t>(widget_host->GetRoutingID())), | 55 base::checked_cast<uint32_t>(widget_host->GetRoutingID())), |
| 56 next_surface_sequence_(1u), | 56 next_surface_sequence_(1u), |
| 57 last_compositor_frame_sink_id_(0), | 57 last_compositor_frame_sink_id_(0), |
| 58 current_surface_scale_factor_(1.f), | 58 current_surface_scale_factor_(1.f), |
| 59 ack_pending_count_(0), | |
| 60 frame_connector_(nullptr), | 59 frame_connector_(nullptr), |
| 61 begin_frame_source_(nullptr), | |
| 62 weak_factory_(this) { | 60 weak_factory_(this) { |
| 63 id_allocator_.reset(new cc::LocalSurfaceIdAllocator()); | 61 id_allocator_.reset(new cc::LocalSurfaceIdAllocator()); |
| 64 auto* manager = GetSurfaceManager(); | 62 GetSurfaceManager()->RegisterFrameSinkId(frame_sink_id_); |
| 65 manager->RegisterFrameSinkId(frame_sink_id_); | 63 CreateCompositorFrameSinkSupport(); |
| 66 surface_factory_ = | |
| 67 base::MakeUnique<cc::SurfaceFactory>(frame_sink_id_, manager, this); | |
| 68 } | 64 } |
| 69 | 65 |
| 70 RenderWidgetHostViewChildFrame::~RenderWidgetHostViewChildFrame() { | 66 RenderWidgetHostViewChildFrame::~RenderWidgetHostViewChildFrame() { |
| 71 surface_factory_->EvictSurface(); | 67 ResetCompositorFrameSinkSupport(); |
| 72 if (GetSurfaceManager()) | 68 if (GetSurfaceManager()) |
| 73 GetSurfaceManager()->InvalidateFrameSinkId(frame_sink_id_); | 69 GetSurfaceManager()->InvalidateFrameSinkId(frame_sink_id_); |
| 74 } | 70 } |
| 75 | 71 |
| 76 void RenderWidgetHostViewChildFrame::Init() { | 72 void RenderWidgetHostViewChildFrame::Init() { |
| 77 RegisterFrameSinkId(); | 73 RegisterFrameSinkId(); |
| 78 host_->SetView(this); | 74 host_->SetView(this); |
| 79 GetTextInputManager(); | 75 GetTextInputManager(); |
| 80 } | 76 } |
| 81 | 77 |
| 78 void RenderWidgetHostViewChildFrame::ResetCompositorFrameSinkSupport() { | |
| 79 if (!support_) | |
| 80 return; | |
| 81 if (parent_frame_sink_id_.is_valid()) { | |
| 82 GetSurfaceManager()->UnregisterFrameSinkHierarchy(parent_frame_sink_id_, | |
| 83 frame_sink_id_); | |
| 84 } | |
| 85 support_.reset(); | |
| 86 } | |
| 87 | |
| 88 void RenderWidgetHostViewChildFrame::CreateCompositorFrameSinkSupport() { | |
|
Fady Samuel
2017/02/23 23:29:31
Can you simply merge ResetCompsoitorFrameSinkSuppo
Saman Sami
2017/02/24 16:46:16
I'm not sure how I should do that. What if I only
| |
| 89 DCHECK(!support_); | |
| 90 support_ = base::MakeUnique<cc::CompositorFrameSinkSupport>( | |
| 91 this, GetSurfaceManager(), frame_sink_id_, false /* is_root */, | |
| 92 false /* handles_frame_sink_id_invalidation */, | |
| 93 true /* needs_sync_points */); | |
| 94 if (parent_frame_sink_id_.is_valid()) { | |
| 95 GetSurfaceManager()->RegisterFrameSinkHierarchy(parent_frame_sink_id_, | |
| 96 frame_sink_id_); | |
| 97 } | |
| 98 if (needs_begin_frame_) | |
| 99 support_->SetNeedsBeginFrame(needs_begin_frame_); | |
| 100 } | |
| 101 | |
| 82 void RenderWidgetHostViewChildFrame::SetCrossProcessFrameConnector( | 102 void RenderWidgetHostViewChildFrame::SetCrossProcessFrameConnector( |
| 83 CrossProcessFrameConnector* frame_connector) { | 103 CrossProcessFrameConnector* frame_connector) { |
| 84 if (frame_connector_ == frame_connector) | 104 if (frame_connector_ == frame_connector) |
| 85 return; | 105 return; |
| 86 | 106 |
| 87 if (frame_connector_) { | 107 if (frame_connector_) { |
| 88 if (parent_frame_sink_id_.is_valid()) { | 108 ResetCompositorFrameSinkSupport(); |
| 89 GetSurfaceManager()->UnregisterFrameSinkHierarchy(parent_frame_sink_id_, | |
| 90 frame_sink_id_); | |
| 91 } | |
| 92 // Unregister the client here, as it is not guaranteed in tests that the | |
| 93 // destructor will be called. | |
| 94 GetSurfaceManager()->UnregisterSurfaceFactoryClient(frame_sink_id_); | |
| 95 | |
| 96 parent_frame_sink_id_ = cc::FrameSinkId(); | 109 parent_frame_sink_id_ = cc::FrameSinkId(); |
| 97 | 110 |
| 98 // After the RenderWidgetHostViewChildFrame loses the frame_connector, it | |
| 99 // won't be able to walk up the frame tree anymore. Clean up anything that | |
| 100 // needs to be done through the CrossProcessFrameConnector before it's gone. | |
| 101 | |
| 102 // Unlocks the mouse if this RenderWidgetHostView holds the lock. | 111 // Unlocks the mouse if this RenderWidgetHostView holds the lock. |
| 103 UnlockMouse(); | 112 UnlockMouse(); |
| 104 } | 113 } |
| 105 frame_connector_ = frame_connector; | 114 frame_connector_ = frame_connector; |
| 106 if (frame_connector_) { | 115 if (frame_connector_) { |
| 107 GetSurfaceManager()->RegisterSurfaceFactoryClient(frame_sink_id_, this); | 116 ResetCompositorFrameSinkSupport(); |
| 108 RenderWidgetHostViewBase* parent_view = | 117 RenderWidgetHostViewBase* parent_view = |
| 109 frame_connector_->GetParentRenderWidgetHostView(); | 118 frame_connector_->GetParentRenderWidgetHostView(); |
| 110 if (parent_view) { | 119 if (parent_view) { |
| 111 parent_frame_sink_id_ = parent_view->GetFrameSinkId(); | 120 parent_frame_sink_id_ = parent_view->GetFrameSinkId(); |
| 112 DCHECK(parent_frame_sink_id_.is_valid()); | 121 DCHECK(parent_frame_sink_id_.is_valid()); |
| 113 GetSurfaceManager()->RegisterFrameSinkHierarchy(parent_frame_sink_id_, | |
| 114 frame_sink_id_); | |
| 115 } | 122 } |
| 123 CreateCompositorFrameSinkSupport(); | |
| 116 } | 124 } |
| 117 } | 125 } |
| 118 | 126 |
| 119 void RenderWidgetHostViewChildFrame::InitAsChild( | 127 void RenderWidgetHostViewChildFrame::InitAsChild( |
| 120 gfx::NativeView parent_view) { | 128 gfx::NativeView parent_view) { |
| 121 NOTREACHED(); | 129 NOTREACHED(); |
| 122 } | 130 } |
| 123 | 131 |
| 124 RenderWidgetHost* RenderWidgetHostViewChildFrame::GetRenderWidgetHost() const { | 132 RenderWidgetHost* RenderWidgetHostViewChildFrame::GetRenderWidgetHost() const { |
| 125 return host_; | 133 return host_; |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 346 // always forwarded and handled according to current scroll state in the | 354 // always forwarded and handled according to current scroll state in the |
| 347 // RenderWidgetHostInputEventRouter. | 355 // RenderWidgetHostInputEventRouter. |
| 348 if (!frame_connector_) | 356 if (!frame_connector_) |
| 349 return; | 357 return; |
| 350 if ((event.type() == blink::WebInputEvent::GestureScrollUpdate && | 358 if ((event.type() == blink::WebInputEvent::GestureScrollUpdate && |
| 351 not_consumed) || | 359 not_consumed) || |
| 352 event.type() == blink::WebInputEvent::GestureScrollEnd) | 360 event.type() == blink::WebInputEvent::GestureScrollEnd) |
| 353 frame_connector_->BubbleScrollEvent(event); | 361 frame_connector_->BubbleScrollEvent(event); |
| 354 } | 362 } |
| 355 | 363 |
| 356 void RenderWidgetHostViewChildFrame::SurfaceDrawn( | 364 void RenderWidgetHostViewChildFrame::DidReceiveCompositorFrameAck() { |
| 357 uint32_t compositor_frame_sink_id) { | 365 if (!host_) |
| 358 DCHECK_GT(ack_pending_count_, 0U); | 366 return; |
| 359 if (host_) { | 367 host_->Send(new ViewMsg_ReclaimCompositorResources( |
| 360 host_->Send(new ViewMsg_ReclaimCompositorResources( | 368 host_->GetRoutingID(), last_compositor_frame_sink_id_, |
| 361 host_->GetRoutingID(), compositor_frame_sink_id, true /* is_swap_ack */, | 369 true /* is_swap_ack */, cc::ReturnedResourceArray())); |
| 362 surface_returned_resources_)); | |
| 363 surface_returned_resources_.clear(); | |
| 364 } | |
| 365 ack_pending_count_--; | |
| 366 } | 370 } |
| 367 | 371 |
| 368 bool RenderWidgetHostViewChildFrame::ShouldCreateNewSurfaceId( | 372 bool RenderWidgetHostViewChildFrame::ShouldCreateNewSurfaceId( |
| 369 uint32_t compositor_frame_sink_id, | 373 uint32_t compositor_frame_sink_id, |
| 370 const cc::CompositorFrame& frame) { | 374 const cc::CompositorFrame& frame) { |
| 371 gfx::Size new_frame_size = frame.render_pass_list.back()->output_rect.size(); | 375 gfx::Size new_frame_size = frame.render_pass_list.back()->output_rect.size(); |
| 372 float new_scale_factor = frame.metadata.device_scale_factor; | 376 float new_scale_factor = frame.metadata.device_scale_factor; |
| 373 | 377 |
| 374 return compositor_frame_sink_id != last_compositor_frame_sink_id_ || | 378 return compositor_frame_sink_id != last_compositor_frame_sink_id_ || |
| 375 new_frame_size != current_surface_size_ || | 379 new_frame_size != current_surface_size_ || |
| 376 new_scale_factor != current_surface_scale_factor_; | 380 new_scale_factor != current_surface_scale_factor_; |
| 377 } | 381 } |
| 378 | 382 |
| 379 void RenderWidgetHostViewChildFrame::ProcessCompositorFrame( | 383 void RenderWidgetHostViewChildFrame::ProcessCompositorFrame( |
| 380 uint32_t compositor_frame_sink_id, | 384 uint32_t compositor_frame_sink_id, |
| 381 cc::CompositorFrame frame) { | 385 cc::CompositorFrame frame) { |
| 382 if (ShouldCreateNewSurfaceId(compositor_frame_sink_id, frame)) { | 386 if (ShouldCreateNewSurfaceId(compositor_frame_sink_id, frame)) { |
| 383 ClearCompositorSurfaceIfNecessary(); | 387 ClearCompositorSurfaceIfNecessary(); |
| 384 // If the renderer changed its frame sink, reset the surface factory to | 388 // If the renderer changed its frame sink, reset the |
| 385 // avoid returning stale resources. | 389 // CompositorFrameSinkSupport to avoid returning stale resources. |
| 386 if (compositor_frame_sink_id != last_compositor_frame_sink_id_) | 390 if (compositor_frame_sink_id != last_compositor_frame_sink_id_) { |
| 387 surface_factory_->Reset(); | 391 ResetCompositorFrameSinkSupport(); |
| 392 CreateCompositorFrameSinkSupport(); | |
| 393 } | |
| 388 last_compositor_frame_sink_id_ = compositor_frame_sink_id; | 394 last_compositor_frame_sink_id_ = compositor_frame_sink_id; |
| 389 current_surface_size_ = frame.render_pass_list.back()->output_rect.size(); | 395 current_surface_size_ = frame.render_pass_list.back()->output_rect.size(); |
| 390 current_surface_scale_factor_ = frame.metadata.device_scale_factor; | 396 current_surface_scale_factor_ = frame.metadata.device_scale_factor; |
| 391 } | 397 } |
| 392 | 398 |
| 393 bool allocated_new_local_surface_id = false; | 399 bool allocated_new_local_surface_id = false; |
| 394 if (!local_surface_id_.is_valid()) { | 400 if (!local_surface_id_.is_valid()) { |
| 395 local_surface_id_ = id_allocator_->GenerateId(); | 401 local_surface_id_ = id_allocator_->GenerateId(); |
| 396 allocated_new_local_surface_id = true; | 402 allocated_new_local_surface_id = true; |
| 397 } | 403 } |
| 398 | 404 |
| 399 cc::SurfaceFactory::DrawCallback ack_callback = | 405 support_->SubmitCompositorFrame(local_surface_id_, std::move(frame)); |
| 400 base::Bind(&RenderWidgetHostViewChildFrame::SurfaceDrawn, AsWeakPtr(), | |
| 401 compositor_frame_sink_id); | |
| 402 ack_pending_count_++; | |
| 403 // If this value grows very large, something is going wrong. | |
| 404 DCHECK_LT(ack_pending_count_, 1000U); | |
| 405 surface_factory_->SubmitCompositorFrame(local_surface_id_, std::move(frame), | |
| 406 ack_callback); | |
| 407 if (allocated_new_local_surface_id) | 406 if (allocated_new_local_surface_id) |
| 408 SendSurfaceInfoToEmbedder(); | 407 SendSurfaceInfoToEmbedder(); |
| 409 ProcessFrameSwappedCallbacks(); | 408 ProcessFrameSwappedCallbacks(); |
| 410 } | 409 } |
| 411 | 410 |
| 412 void RenderWidgetHostViewChildFrame::SendSurfaceInfoToEmbedder() { | 411 void RenderWidgetHostViewChildFrame::SendSurfaceInfoToEmbedder() { |
| 413 cc::SurfaceSequence sequence = | 412 cc::SurfaceSequence sequence = |
| 414 cc::SurfaceSequence(frame_sink_id_, next_surface_sequence_++); | 413 cc::SurfaceSequence(frame_sink_id_, next_surface_sequence_++); |
| 415 cc::SurfaceManager* manager = GetSurfaceManager(); | 414 cc::SurfaceManager* manager = GetSurfaceManager(); |
| 416 cc::SurfaceId surface_id(frame_sink_id_, local_surface_id_); | 415 cc::SurfaceId surface_id(frame_sink_id_, local_surface_id_); |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 619 SubmitSurfaceCopyRequest(src_subrect, output_size, callback, | 618 SubmitSurfaceCopyRequest(src_subrect, output_size, callback, |
| 620 preferred_color_type); | 619 preferred_color_type); |
| 621 } | 620 } |
| 622 | 621 |
| 623 void RenderWidgetHostViewChildFrame::SubmitSurfaceCopyRequest( | 622 void RenderWidgetHostViewChildFrame::SubmitSurfaceCopyRequest( |
| 624 const gfx::Rect& src_subrect, | 623 const gfx::Rect& src_subrect, |
| 625 const gfx::Size& output_size, | 624 const gfx::Size& output_size, |
| 626 const ReadbackRequestCallback& callback, | 625 const ReadbackRequestCallback& callback, |
| 627 const SkColorType preferred_color_type) { | 626 const SkColorType preferred_color_type) { |
| 628 DCHECK(IsSurfaceAvailableForCopy()); | 627 DCHECK(IsSurfaceAvailableForCopy()); |
| 628 DCHECK(support_); | |
| 629 | 629 |
| 630 std::unique_ptr<cc::CopyOutputRequest> request = | 630 std::unique_ptr<cc::CopyOutputRequest> request = |
| 631 cc::CopyOutputRequest::CreateRequest( | 631 cc::CopyOutputRequest::CreateRequest( |
| 632 base::Bind(&CopyFromCompositingSurfaceHasResult, output_size, | 632 base::Bind(&CopyFromCompositingSurfaceHasResult, output_size, |
| 633 preferred_color_type, callback)); | 633 preferred_color_type, callback)); |
| 634 if (!src_subrect.IsEmpty()) | 634 if (!src_subrect.IsEmpty()) |
| 635 request->set_area(src_subrect); | 635 request->set_area(src_subrect); |
| 636 | 636 |
| 637 surface_factory_->RequestCopyOfSurface(std::move(request)); | 637 support_->RequestCopyOfSurface(std::move(request)); |
| 638 } | 638 } |
| 639 | 639 |
| 640 void RenderWidgetHostViewChildFrame::CopyFromCompositingSurfaceToVideoFrame( | 640 void RenderWidgetHostViewChildFrame::CopyFromCompositingSurfaceToVideoFrame( |
| 641 const gfx::Rect& src_subrect, | 641 const gfx::Rect& src_subrect, |
| 642 const scoped_refptr<media::VideoFrame>& target, | 642 const scoped_refptr<media::VideoFrame>& target, |
| 643 const base::Callback<void(const gfx::Rect&, bool)>& callback) { | 643 const base::Callback<void(const gfx::Rect&, bool)>& callback) { |
| 644 NOTIMPLEMENTED(); | 644 NOTIMPLEMENTED(); |
| 645 callback.Run(gfx::Rect(), false); | 645 callback.Run(gfx::Rect(), false); |
| 646 } | 646 } |
| 647 | 647 |
| 648 bool RenderWidgetHostViewChildFrame::CanCopyToVideoFrame() const { | 648 bool RenderWidgetHostViewChildFrame::CanCopyToVideoFrame() const { |
| 649 return false; | 649 return false; |
| 650 } | 650 } |
| 651 | 651 |
| 652 bool RenderWidgetHostViewChildFrame::HasAcceleratedSurface( | 652 bool RenderWidgetHostViewChildFrame::HasAcceleratedSurface( |
| 653 const gfx::Size& desired_size) { | 653 const gfx::Size& desired_size) { |
| 654 return false; | 654 return false; |
| 655 } | 655 } |
| 656 | 656 |
| 657 // cc::SurfaceFactoryClient implementation. | 657 void RenderWidgetHostViewChildFrame::ReclaimResources( |
| 658 void RenderWidgetHostViewChildFrame::ReturnResources( | |
| 659 const cc::ReturnedResourceArray& resources) { | 658 const cc::ReturnedResourceArray& resources) { |
| 660 if (resources.empty()) | 659 if (!host_) |
| 661 return; | 660 return; |
| 662 | 661 host_->Send(new ViewMsg_ReclaimCompositorResources( |
| 663 if (!ack_pending_count_ && host_) { | 662 host_->GetRoutingID(), last_compositor_frame_sink_id_, |
| 664 host_->Send(new ViewMsg_ReclaimCompositorResources( | 663 false /* is_swap_ack */, resources)); |
| 665 host_->GetRoutingID(), last_compositor_frame_sink_id_, | |
| 666 false /* is_swap_ack */, resources)); | |
| 667 return; | |
| 668 } | |
| 669 | |
| 670 std::copy(resources.begin(), resources.end(), | |
| 671 std::back_inserter(surface_returned_resources_)); | |
| 672 } | |
| 673 | |
| 674 void RenderWidgetHostViewChildFrame::SetBeginFrameSource( | |
| 675 cc::BeginFrameSource* source) { | |
| 676 bool needs_begin_frames = host_->needs_begin_frames(); | |
| 677 if (begin_frame_source_ && needs_begin_frames) | |
| 678 begin_frame_source_->RemoveObserver(this); | |
| 679 begin_frame_source_ = source; | |
| 680 if (begin_frame_source_ && needs_begin_frames) | |
| 681 begin_frame_source_->AddObserver(this); | |
| 682 } | 664 } |
| 683 | 665 |
| 684 void RenderWidgetHostViewChildFrame::OnBeginFrame( | 666 void RenderWidgetHostViewChildFrame::OnBeginFrame( |
| 685 const cc::BeginFrameArgs& args) { | 667 const cc::BeginFrameArgs& args) { |
| 686 host_->Send(new ViewMsg_BeginFrame(host_->GetRoutingID(), args)); | 668 host_->Send(new ViewMsg_BeginFrame(host_->GetRoutingID(), args)); |
| 687 last_begin_frame_args_ = args; | |
| 688 } | |
| 689 | |
| 690 const cc::BeginFrameArgs& | |
| 691 RenderWidgetHostViewChildFrame::LastUsedBeginFrameArgs() const { | |
| 692 return last_begin_frame_args_; | |
| 693 } | |
| 694 | |
| 695 void RenderWidgetHostViewChildFrame::OnBeginFrameSourcePausedChanged( | |
| 696 bool paused) { | |
| 697 // Only used on Android WebView. | |
| 698 } | 669 } |
| 699 | 670 |
| 700 void RenderWidgetHostViewChildFrame::SetNeedsBeginFrames( | 671 void RenderWidgetHostViewChildFrame::SetNeedsBeginFrames( |
| 701 bool needs_begin_frames) { | 672 bool needs_begin_frames) { |
| 702 if (!begin_frame_source_) | 673 needs_begin_frame_ = needs_begin_frames; |
| 703 return; | 674 if (support_) |
| 704 | 675 support_->SetNeedsBeginFrame(needs_begin_frames); |
| 705 if (needs_begin_frames) | |
| 706 begin_frame_source_->AddObserver(this); | |
| 707 else | |
| 708 begin_frame_source_->RemoveObserver(this); | |
| 709 } | 676 } |
| 710 | 677 |
| 711 InputEventAckState RenderWidgetHostViewChildFrame::FilterInputEvent( | 678 InputEventAckState RenderWidgetHostViewChildFrame::FilterInputEvent( |
| 712 const blink::WebInputEvent& input_event) { | 679 const blink::WebInputEvent& input_event) { |
| 713 if (input_event.type() == blink::WebInputEvent::GestureFlingStart) { | 680 if (input_event.type() == blink::WebInputEvent::GestureFlingStart) { |
| 714 const blink::WebGestureEvent& gesture_event = | 681 const blink::WebGestureEvent& gesture_event = |
| 715 static_cast<const blink::WebGestureEvent&>(input_event); | 682 static_cast<const blink::WebGestureEvent&>(input_event); |
| 716 // Zero-velocity touchpad flings are an Aura-specific signal that the | 683 // Zero-velocity touchpad flings are an Aura-specific signal that the |
| 717 // touchpad scroll has ended, and should not be forwarded to the renderer. | 684 // touchpad scroll has ended, and should not be forwarded to the renderer. |
| 718 if (gesture_event.sourceDevice == blink::WebGestureDeviceTouchpad && | 685 if (gesture_event.sourceDevice == blink::WebGestureDeviceTouchpad && |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 734 } | 701 } |
| 735 | 702 |
| 736 BrowserAccessibilityManager* | 703 BrowserAccessibilityManager* |
| 737 RenderWidgetHostViewChildFrame::CreateBrowserAccessibilityManager( | 704 RenderWidgetHostViewChildFrame::CreateBrowserAccessibilityManager( |
| 738 BrowserAccessibilityDelegate* delegate, bool for_root_frame) { | 705 BrowserAccessibilityDelegate* delegate, bool for_root_frame) { |
| 739 return BrowserAccessibilityManager::Create( | 706 return BrowserAccessibilityManager::Create( |
| 740 BrowserAccessibilityManager::GetEmptyDocument(), delegate); | 707 BrowserAccessibilityManager::GetEmptyDocument(), delegate); |
| 741 } | 708 } |
| 742 | 709 |
| 743 void RenderWidgetHostViewChildFrame::ClearCompositorSurfaceIfNecessary() { | 710 void RenderWidgetHostViewChildFrame::ClearCompositorSurfaceIfNecessary() { |
| 744 surface_factory_->EvictSurface(); | 711 if (support_) |
| 712 support_->EvictFrame(); | |
| 745 local_surface_id_ = cc::LocalSurfaceId(); | 713 local_surface_id_ = cc::LocalSurfaceId(); |
| 746 } | 714 } |
| 747 | 715 |
| 748 bool RenderWidgetHostViewChildFrame::IsChildFrameForTesting() const { | 716 bool RenderWidgetHostViewChildFrame::IsChildFrameForTesting() const { |
| 749 return true; | 717 return true; |
| 750 } | 718 } |
| 751 | 719 |
| 752 cc::SurfaceId RenderWidgetHostViewChildFrame::SurfaceIdForTesting() const { | 720 cc::SurfaceId RenderWidgetHostViewChildFrame::SurfaceIdForTesting() const { |
| 753 return cc::SurfaceId(frame_sink_id_, local_surface_id_); | 721 return cc::SurfaceId(frame_sink_id_, local_surface_id_); |
| 754 }; | 722 }; |
| 755 | 723 |
| 756 } // namespace content | 724 } // namespace content |
| OLD | NEW |