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

Side by Side Diff: Source/platform/graphics/Canvas2DLayerBridge.cpp

Issue 340093003: Added an assertion verifying that a Canvas2DLayerBridge is not deleted (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Formatting error corrected Created 6 years, 6 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 | Source/platform/graphics/Canvas2DLayerManager.h » ('j') | 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 m_layer->setRateLimitContext(m_rateLimitingEnabled); 109 m_layer->setRateLimitContext(m_rateLimitingEnabled);
110 m_canvas->setNotificationClient(this); 110 m_canvas->setNotificationClient(this);
111 #ifndef NDEBUG 111 #ifndef NDEBUG
112 canvas2DLayerBridgeInstanceCounter.increment(); 112 canvas2DLayerBridgeInstanceCounter.increment();
113 #endif 113 #endif
114 } 114 }
115 115
116 Canvas2DLayerBridge::~Canvas2DLayerBridge() 116 Canvas2DLayerBridge::~Canvas2DLayerBridge()
117 { 117 {
118 ASSERT(m_destructionInProgress); 118 ASSERT(m_destructionInProgress);
119 ASSERT(!Canvas2DLayerManager::get().isInList(this));
119 m_layer.clear(); 120 m_layer.clear();
120 freeReleasedMailbox(); 121 freeReleasedMailbox();
121 #if ASSERT_ENABLED 122 #if ASSERT_ENABLED
122 Vector<MailboxInfo>::iterator mailboxInfo; 123 Vector<MailboxInfo>::iterator mailboxInfo;
123 for (mailboxInfo = m_mailboxes.begin(); mailboxInfo < m_mailboxes.end(); ++m ailboxInfo) { 124 for (mailboxInfo = m_mailboxes.begin(); mailboxInfo < m_mailboxes.end(); ++m ailboxInfo) {
124 ASSERT(mailboxInfo->m_status != MailboxInUse); 125 ASSERT(mailboxInfo->m_status != MailboxInUse);
125 ASSERT(mailboxInfo->m_status != MailboxReleased || m_contextProvider->co ntext3d()->isContextLost() || !m_isSurfaceValid); 126 ASSERT(mailboxInfo->m_status != MailboxReleased || m_contextProvider->co ntext3d()->isContextLost() || !m_isSurfaceValid);
126 } 127 }
127 #endif 128 #endif
128 m_mailboxes.clear(); 129 m_mailboxes.clear();
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 Canvas2DLayerBridge::MailboxInfo::MailboxInfo(const MailboxInfo& other) { 534 Canvas2DLayerBridge::MailboxInfo::MailboxInfo(const MailboxInfo& other) {
534 // This copy constructor should only be used for Vector reallocation 535 // This copy constructor should only be used for Vector reallocation
535 // Assuming 'other' is to be destroyed, we transfer m_image ownership 536 // Assuming 'other' is to be destroyed, we transfer m_image ownership
536 // rather than do a refcount dance. 537 // rather than do a refcount dance.
537 memcpy(&m_mailbox, &other.m_mailbox, sizeof(m_mailbox)); 538 memcpy(&m_mailbox, &other.m_mailbox, sizeof(m_mailbox));
538 m_image = const_cast<MailboxInfo*>(&other)->m_image.release(); 539 m_image = const_cast<MailboxInfo*>(&other)->m_image.release();
539 m_status = other.m_status; 540 m_status = other.m_status;
540 } 541 }
541 542
542 } 543 }
OLDNEW
« no previous file with comments | « no previous file | Source/platform/graphics/Canvas2DLayerManager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698