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

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

Issue 2652343003: Replace source pointer in cc::CopyOutputRequest with a base::UnguessableToken (Closed)
Patch Set: c 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
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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 cc::CopyOutputRequest::CreateRequest(base::Bind( 356 cc::CopyOutputRequest::CreateRequest(base::Bind(
357 &DelegatedFrameHost::CopyFromCompositingSurfaceHasResultForVideo, 357 &DelegatedFrameHost::CopyFromCompositingSurfaceHasResultForVideo,
358 AsWeakPtr(), subscriber_texture, frame, 358 AsWeakPtr(), subscriber_texture, frame,
359 base::Bind(callback, present_time))); 359 base::Bind(callback, present_time)));
360 // Setting the source in this copy request asks that the layer abort any prior 360 // Setting the source in this copy request asks that the layer abort any prior
361 // uncommitted copy requests made on behalf of the same frame subscriber. 361 // uncommitted copy requests made on behalf of the same frame subscriber.
362 // This will not affect any of the copy requests spawned elsewhere from 362 // This will not affect any of the copy requests spawned elsewhere from
363 // DelegatedFrameHost (e.g., a call to CopyFromCompositingSurface() for 363 // DelegatedFrameHost (e.g., a call to CopyFromCompositingSurface() for
364 // screenshots) since those copy requests do not specify |frame_subscriber()| 364 // screenshots) since those copy requests do not specify |frame_subscriber()|
365 // as a source. 365 // as a source.
366 request->set_source(frame_subscriber()); 366 request->set_source(frame_subscriber()->GetSourceIdForCopyRequest());
367 if (subscriber_texture.get()) { 367 if (subscriber_texture.get()) {
368 request->SetTextureMailbox(cc::TextureMailbox( 368 request->SetTextureMailbox(cc::TextureMailbox(
369 subscriber_texture->mailbox(), subscriber_texture->sync_token(), 369 subscriber_texture->mailbox(), subscriber_texture->sync_token(),
370 subscriber_texture->target())); 370 subscriber_texture->target()));
371 } 371 }
372 372
373 if (local_frame_id_.is_valid()) { 373 if (local_frame_id_.is_valid()) {
374 // To avoid unnecessary composites, go directly to the Surface rather than 374 // To avoid unnecessary composites, go directly to the Surface rather than
375 // through RequestCopyOfOutput (which goes through the browser 375 // through RequestCopyOfOutput (which goes through the browser
376 // compositor). 376 // compositor).
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 std::move(request)); 867 std::move(request));
868 } 868 }
869 } 869 }
870 870
871 void DelegatedFrameHost::UnlockResources() { 871 void DelegatedFrameHost::UnlockResources() {
872 DCHECK(local_frame_id_.is_valid()); 872 DCHECK(local_frame_id_.is_valid());
873 delegated_frame_evictor_->UnlockFrame(); 873 delegated_frame_evictor_->UnlockFrame();
874 } 874 }
875 875
876 } // namespace content 876 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698