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

Side by Side Diff: content/browser/media/capture/web_contents_video_capture_device.cc

Issue 1555513004: Fix crash when view is already deleted (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // Implementation notes: This needs to work on a variety of hardware 5 // Implementation notes: This needs to work on a variety of hardware
6 // configurations where the speed of the CPU and GPU greatly affect overall 6 // configurations where the speed of the CPU and GPU greatly affect overall
7 // performance. Spanning several threads, the process of capturing has been 7 // performance. Spanning several threads, the process of capturing has been
8 // split up into four conceptual stages: 8 // split up into four conceptual stages:
9 // 9 //
10 // 1. Reserve Buffer: Before a frame can be captured, a slot in the client's 10 // 1. Reserve Buffer: Before a frame can be captured, a slot in the client's
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 // https://crbug.com/554280 https://crbug.com/549182 436 // https://crbug.com/554280 https://crbug.com/549182
437 #if defined(USE_AURA) && defined(OS_LINUX) 437 #if defined(USE_AURA) && defined(OS_LINUX)
438 if (view) { 438 if (view) {
439 cursor_renderer_.reset( 439 cursor_renderer_.reset(
440 new content::CursorRendererAura(view->GetNativeView())); 440 new content::CursorRendererAura(view->GetNativeView()));
441 } 441 }
442 #endif 442 #endif
443 // TODO(isheriff): Needs implementation on non-aura platforms. 443 // TODO(isheriff): Needs implementation on non-aura platforms.
444 // https://crbug.com/567735 444 // https://crbug.com/567735
445 #if defined(USE_AURA) 445 #if defined(USE_AURA)
446 window_activity_tracker_.reset( 446 if (view) {
miu 2015/12/30 00:22:40 Possible clean-up in future CL: Looks like we shou
Irfan 2015/12/30 00:32:12 I like not instantiating ContentCaptureSubscriptio
447 new content::WindowActivityTrackerAura(view->GetNativeView())); 447 window_activity_tracker_.reset(
448 new content::WindowActivityTrackerAura(view->GetNativeView()));
449 }
448 #endif 450 #endif
449 timer_subscriber_.reset(new FrameSubscriber( 451 timer_subscriber_.reset(new FrameSubscriber(
450 media::VideoCaptureOracle::kTimerPoll, oracle_proxy, &delivery_log_, 452 media::VideoCaptureOracle::kTimerPoll, oracle_proxy, &delivery_log_,
451 cursor_renderer_ ? cursor_renderer_->GetWeakPtr() 453 cursor_renderer_ ? cursor_renderer_->GetWeakPtr()
452 : base::WeakPtr<CursorRenderer>(), 454 : base::WeakPtr<CursorRenderer>(),
453 window_activity_tracker_ ? window_activity_tracker_->GetWeakPtr() 455 window_activity_tracker_ ? window_activity_tracker_->GetWeakPtr()
454 : base::WeakPtr<WindowActivityTracker>())); 456 : base::WeakPtr<WindowActivityTracker>()));
455 457
456 // Subscribe to compositor updates. These will be serviced directly by the 458 // Subscribe to compositor updates. These will be serviced directly by the
457 // oracle. 459 // oracle.
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
966 scoped_ptr<Client> client) { 968 scoped_ptr<Client> client) {
967 DVLOG(1) << "Allocating " << params.requested_format.frame_size.ToString(); 969 DVLOG(1) << "Allocating " << params.requested_format.frame_size.ToString();
968 core_->AllocateAndStart(params, client.Pass()); 970 core_->AllocateAndStart(params, client.Pass());
969 } 971 }
970 972
971 void WebContentsVideoCaptureDevice::StopAndDeAllocate() { 973 void WebContentsVideoCaptureDevice::StopAndDeAllocate() {
972 core_->StopAndDeAllocate(); 974 core_->StopAndDeAllocate();
973 } 975 }
974 976
975 } // namespace content 977 } // namespace content
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