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

Side by Side Diff: third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp

Issue 2865373002: [Media, Controls] Cleanup resize observer before dereferencing. (Closed)
Patch Set: Created 3 years, 7 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 /* 1 /*
2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
3 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 DCHECK(!MediaElement().isConnected()); 436 DCHECK(!MediaElement().isConnected());
437 437
438 // TODO(mlamouri): we hide show the controls instead of having 438 // TODO(mlamouri): we hide show the controls instead of having
439 // HTMLMediaElement do it. 439 // HTMLMediaElement do it.
440 440
441 window_event_listener_->Stop(); 441 window_event_listener_->Stop();
442 media_event_listener_->Detach(); 442 media_event_listener_->Detach();
443 if (orientation_lock_delegate_) 443 if (orientation_lock_delegate_)
444 orientation_lock_delegate_->Detach(); 444 orientation_lock_delegate_->Detach();
445 445
446 resize_observer_.Clear(); 446 if (resize_observer_) {
447 resize_observer_->disconnect();
448 resize_observer_.Clear();
449 }
447 } 450 }
448 451
449 void MediaControlsImpl::Reset() { 452 void MediaControlsImpl::Reset() {
450 EventDispatchForbiddenScope::AllowUserAgentEvents allow_events_in_shadow; 453 EventDispatchForbiddenScope::AllowUserAgentEvents allow_events_in_shadow;
451 BatchedControlUpdate batch(this); 454 BatchedControlUpdate batch(this);
452 455
453 const double duration = MediaElement().duration(); 456 const double duration = MediaElement().duration();
454 duration_display_->setTextContent( 457 duration_display_->setTextContent(
455 LayoutTheme::GetTheme().FormatMediaControlsTime(duration)); 458 LayoutTheme::GetTheme().FormatMediaControlsTime(duration));
456 duration_display_->SetCurrentValue(duration); 459 duration_display_->SetCurrentValue(duration);
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after
1136 visitor->Trace(cast_button_); 1139 visitor->Trace(cast_button_);
1137 visitor->Trace(overlay_cast_button_); 1140 visitor->Trace(overlay_cast_button_);
1138 visitor->Trace(media_event_listener_); 1141 visitor->Trace(media_event_listener_);
1139 visitor->Trace(window_event_listener_); 1142 visitor->Trace(window_event_listener_);
1140 visitor->Trace(orientation_lock_delegate_); 1143 visitor->Trace(orientation_lock_delegate_);
1141 MediaControls::Trace(visitor); 1144 MediaControls::Trace(visitor);
1142 HTMLDivElement::Trace(visitor); 1145 HTMLDivElement::Trace(visitor);
1143 } 1146 }
1144 1147
1145 } // namespace blink 1148 } // namespace blink
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