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

Side by Side Diff: content/browser/frame_host/render_widget_host_view_guest.cc

Issue 2750623002: Avoid unnecessary LocalSurfaceId allocation in RenderWidgetHostViewChildFrame/Guest (Closed)
Patch Set: Added test Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_guest.h" 5 #include "content/browser/frame_host/render_widget_host_view_guest.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 if (platform_view_) 265 if (platform_view_)
266 platform_view_->SetNeedsBeginFrames(needs_begin_frames); 266 platform_view_->SetNeedsBeginFrames(needs_begin_frames);
267 } 267 }
268 268
269 void RenderWidgetHostViewGuest::SetTooltipText( 269 void RenderWidgetHostViewGuest::SetTooltipText(
270 const base::string16& tooltip_text) { 270 const base::string16& tooltip_text) {
271 if (guest_) 271 if (guest_)
272 guest_->SetTooltipText(tooltip_text); 272 guest_->SetTooltipText(tooltip_text);
273 } 273 }
274 274
275 bool RenderWidgetHostViewGuest::ShouldCreateNewSurfaceId(
276 uint32_t compositor_frame_sink_id,
277 const cc::CompositorFrame& frame) {
278 return (guest_ && guest_->has_attached_since_surface_set()) ||
279 RenderWidgetHostViewChildFrame::ShouldCreateNewSurfaceId(
280 compositor_frame_sink_id, frame);
281 }
282
283 void RenderWidgetHostViewGuest::SendSurfaceInfoToEmbedderImpl( 275 void RenderWidgetHostViewGuest::SendSurfaceInfoToEmbedderImpl(
284 const cc::SurfaceInfo& surface_info, 276 const cc::SurfaceInfo& surface_info,
285 const cc::SurfaceSequence& sequence) { 277 const cc::SurfaceSequence& sequence) {
286 if (guest_ && !guest_->is_in_destruction()) 278 if (guest_ && !guest_->is_in_destruction())
287 guest_->SetChildFrameSurface(surface_info, sequence); 279 guest_->SetChildFrameSurface(surface_info, sequence);
288 } 280 }
289 281
290 void RenderWidgetHostViewGuest::OnSwapCompositorFrame( 282 void RenderWidgetHostViewGuest::OnSwapCompositorFrame(
291 uint32_t compositor_frame_sink_id, 283 uint32_t compositor_frame_sink_id,
292 cc::CompositorFrame frame) { 284 cc::CompositorFrame frame) {
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 if (gesture_event.type() == blink::WebInputEvent::GestureScrollUpdate && 631 if (gesture_event.type() == blink::WebInputEvent::GestureScrollUpdate &&
640 gesture_event.data.scrollUpdate.inertialPhase == 632 gesture_event.data.scrollUpdate.inertialPhase ==
641 blink::WebGestureEvent::MomentumPhase) { 633 blink::WebGestureEvent::MomentumPhase) {
642 return; 634 return;
643 } 635 }
644 host_->ForwardGestureEvent(gesture_event); 636 host_->ForwardGestureEvent(gesture_event);
645 return; 637 return;
646 } 638 }
647 } 639 }
648 640
641 bool RenderWidgetHostViewGuest::HasEmbedderChanged() {
642 return guest_ && guest_->has_attached_since_surface_set();
643 }
644
649 } // namespace content 645 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698