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

Side by Side Diff: content/browser/renderer_host/delegated_frame_host.cc

Issue 2710073003: DelegatedFrameHost should not return old resources to renderer (Closed)
Patch Set: Updated comment Created 3 years, 10 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
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_aura_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/renderer_host/delegated_frame_host.h" 5 #include "content/browser/renderer_host/delegated_frame_host.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 431
432 if (compositor_frame_sink_id != last_compositor_frame_sink_id_) { 432 if (compositor_frame_sink_id != last_compositor_frame_sink_id_) {
433 // Resource ids are scoped by the output surface. 433 // Resource ids are scoped by the output surface.
434 // If the originating output surface doesn't match the last one, it 434 // If the originating output surface doesn't match the last one, it
435 // indicates the renderer's output surface may have been recreated, in which 435 // indicates the renderer's output surface may have been recreated, in which
436 // case we should recreate the DelegatedRendererLayer, to avoid matching 436 // case we should recreate the DelegatedRendererLayer, to avoid matching
437 // resources from the old one with resources from the new one which would 437 // resources from the old one with resources from the new one which would
438 // have the same id. Changing the layer to showing painted content destroys 438 // have the same id. Changing the layer to showing painted content destroys
439 // the DelegatedRendererLayer. 439 // the DelegatedRendererLayer.
440 EvictDelegatedFrame(); 440 EvictDelegatedFrame();
441
442 surface_factory_->Reset(); 441 surface_factory_->Reset();
443 if (!surface_returned_resources_.empty()) { 442 surface_returned_resources_.clear();
444 SendReclaimCompositorResources(last_compositor_frame_sink_id_,
445 false /* is_swap_ack */);
446 }
447 last_compositor_frame_sink_id_ = compositor_frame_sink_id; 443 last_compositor_frame_sink_id_ = compositor_frame_sink_id;
448 } 444 }
449 bool skip_frame = false; 445 bool skip_frame = false;
450 pending_delegated_ack_count_++; 446 pending_delegated_ack_count_++;
451 447
452 background_color_ = frame.metadata.root_background_color; 448 background_color_ = frame.metadata.root_background_color;
453 449
454 bool did_send_ack_callback = false; 450 bool did_send_ack_callback = false;
455 if (frame_size.IsEmpty()) { 451 if (frame_size.IsEmpty()) {
456 DCHECK(frame.resource_list.empty()); 452 DCHECK(frame.resource_list.empty());
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
868 std::move(request)); 864 std::move(request));
869 } 865 }
870 } 866 }
871 867
872 void DelegatedFrameHost::UnlockResources() { 868 void DelegatedFrameHost::UnlockResources() {
873 DCHECK(local_surface_id_.is_valid()); 869 DCHECK(local_surface_id_.is_valid());
874 delegated_frame_evictor_->UnlockFrame(); 870 delegated_frame_evictor_->UnlockFrame();
875 } 871 }
876 872
877 } // namespace content 873 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_aura_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698