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

Unified Diff: content/browser/aura/owned_mailbox.cc

Issue 120913004: aura: Ensure OwnedMailbox not used with invalid or destroyed GLHelper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ownedmailbox: expectfalse Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/aura/owned_mailbox.h ('k') | content/browser/renderer_host/render_widget_host_view_aura.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/aura/owned_mailbox.cc
diff --git a/content/browser/aura/owned_mailbox.cc b/content/browser/aura/owned_mailbox.cc
index 1a99d335ac245f3760d29c29af9c7ae531eb632b..5994903b33220a908dba061a304f1830e535f6c1 100644
--- a/content/browser/aura/owned_mailbox.cc
+++ b/content/browser/aura/owned_mailbox.cc
@@ -18,11 +18,8 @@ OwnedMailbox::OwnedMailbox(GLHelper* gl_helper)
}
OwnedMailbox::~OwnedMailbox() {
- ImageTransportFactory::GetInstance()->RemoveObserver(this);
- if (gl_helper_) {
- gl_helper_->WaitSyncPoint(sync_point_);
- gl_helper_->DeleteTexture(texture_id_);
- }
+ if (gl_helper_)
+ Destroy();
}
void OwnedMailbox::UpdateSyncPoint(uint32 sync_point) {
@@ -30,7 +27,8 @@ void OwnedMailbox::UpdateSyncPoint(uint32 sync_point) {
sync_point_ = sync_point;
}
-void OwnedMailbox::OnLostResources() {
+void OwnedMailbox::Destroy() {
+ ImageTransportFactory::GetInstance()->RemoveObserver(this);
gl_helper_->WaitSyncPoint(sync_point_);
gl_helper_->DeleteTexture(texture_id_);
texture_id_ = 0;
@@ -39,4 +37,9 @@ void OwnedMailbox::OnLostResources() {
gl_helper_ = NULL;
}
+void OwnedMailbox::OnLostResources() {
+ if (gl_helper_)
+ Destroy();
+}
+
} // namespace content
« no previous file with comments | « content/browser/aura/owned_mailbox.h ('k') | content/browser/renderer_host/render_widget_host_view_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698