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

Side by Side Diff: components/html_viewer/web_layer_tree_view_impl.cc

Issue 1247803006: Fixes possible use after free in WebLayerTreeViewImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 | no next file » | 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 "components/html_viewer/web_layer_tree_view_impl.h" 5 #include "components/html_viewer/web_layer_tree_view_impl.h"
6 6
7 #include "base/thread_task_runner_handle.h" 7 #include "base/thread_task_runner_handle.h"
8 #include "cc/blink/web_layer_impl.h" 8 #include "cc/blink/web_layer_impl.h"
9 #include "cc/layers/layer.h" 9 #include "cc/layers/layer.h"
10 #include "cc/output/begin_frame_args.h" 10 #include "cc/output/begin_frame_args.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 scoped_refptr<cc::ContextProvider> context_provider( 65 scoped_refptr<cc::ContextProvider> context_provider(
66 new mojo::ContextProviderMojo(cb.PassInterface().PassHandle())); 66 new mojo::ContextProviderMojo(cb.PassInterface().PassHandle()));
67 output_surface_.reset( 67 output_surface_.reset(
68 new mojo::OutputSurfaceMojo(this, context_provider, 68 new mojo::OutputSurfaceMojo(this, context_provider,
69 surface.PassInterface().PassHandle())); 69 surface.PassInterface().PassHandle()));
70 } 70 }
71 layer_tree_host_->SetLayerTreeHostClientReady(); 71 layer_tree_host_->SetLayerTreeHostClientReady();
72 } 72 }
73 73
74 WebLayerTreeViewImpl::~WebLayerTreeViewImpl() { 74 WebLayerTreeViewImpl::~WebLayerTreeViewImpl() {
75 // Destroy the LayerTreeHost before anything else as doing so ensures we're
76 // not accessed on the compositor thread (we are the LayerTreeHostClient).
77 layer_tree_host_.reset();
75 } 78 }
76 79
77 void WebLayerTreeViewImpl::WillBeginMainFrame() { 80 void WebLayerTreeViewImpl::WillBeginMainFrame() {
78 } 81 }
79 82
80 void WebLayerTreeViewImpl::DidBeginMainFrame() { 83 void WebLayerTreeViewImpl::DidBeginMainFrame() {
81 } 84 }
82 85
83 void WebLayerTreeViewImpl::BeginMainFrameNotExpectedSoon() { 86 void WebLayerTreeViewImpl::BeginMainFrameNotExpectedSoon() {
84 } 87 }
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 base::Bind(&WebLayerTreeViewImpl::DidCreateSurfaceOnMainThread, 247 base::Bind(&WebLayerTreeViewImpl::DidCreateSurfaceOnMainThread,
245 main_thread_bound_weak_ptr_, 248 main_thread_bound_weak_ptr_,
246 id)); 249 id));
247 } 250 }
248 251
249 void WebLayerTreeViewImpl::DidCreateSurfaceOnMainThread(cc::SurfaceId id) { 252 void WebLayerTreeViewImpl::DidCreateSurfaceOnMainThread(cc::SurfaceId id) {
250 view_->SetSurfaceId(mojo::SurfaceId::From(id)); 253 view_->SetSurfaceId(mojo::SurfaceId::From(id));
251 } 254 }
252 255
253 } // namespace html_viewer 256 } // namespace html_viewer
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698