| OLD | NEW |
| 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 995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1006 // To avoid memory use after free, take a scoped self-reference | 1006 // To avoid memory use after free, take a scoped self-reference |
| 1007 // to postpone destruction until the end of this function. | 1007 // to postpone destruction until the end of this function. |
| 1008 selfRef = this; | 1008 selfRef = this; |
| 1009 } | 1009 } |
| 1010 | 1010 |
| 1011 // The destruction of 'releasedMailboxInfo' will: | 1011 // The destruction of 'releasedMailboxInfo' will: |
| 1012 // 1) Release the self reference held by the mailboxInfo, which may trigger | 1012 // 1) Release the self reference held by the mailboxInfo, which may trigger |
| 1013 // the self-destruction of this Canvas2DLayerBridge | 1013 // the self-destruction of this Canvas2DLayerBridge |
| 1014 // 2) Release the SkImage, which will return the texture to skia's scratch | 1014 // 2) Release the SkImage, which will return the texture to skia's scratch |
| 1015 // texture pool. | 1015 // texture pool. |
| 1016 m_mailboxes.remove(releasedMailboxInfo); | 1016 m_mailboxes.erase(releasedMailboxInfo); |
| 1017 | 1017 |
| 1018 if (m_mailboxes.isEmpty() && m_accelerationMode == DisableAcceleration) | 1018 if (m_mailboxes.isEmpty() && m_accelerationMode == DisableAcceleration) |
| 1019 m_layer.reset(); | 1019 m_layer.reset(); |
| 1020 } | 1020 } |
| 1021 | 1021 |
| 1022 WebLayer* Canvas2DLayerBridge::layer() const { | 1022 WebLayer* Canvas2DLayerBridge::layer() const { |
| 1023 DCHECK(!m_destructionInProgress); | 1023 DCHECK(!m_destructionInProgress); |
| 1024 DCHECK(m_layer); | 1024 DCHECK(m_layer); |
| 1025 return m_layer->layer(); | 1025 return m_layer->layer(); |
| 1026 } | 1026 } |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1116 default; | 1116 default; |
| 1117 | 1117 |
| 1118 void Canvas2DLayerBridge::Logger::reportHibernationEvent( | 1118 void Canvas2DLayerBridge::Logger::reportHibernationEvent( |
| 1119 HibernationEvent event) { | 1119 HibernationEvent event) { |
| 1120 DEFINE_STATIC_LOCAL(EnumerationHistogram, hibernationHistogram, | 1120 DEFINE_STATIC_LOCAL(EnumerationHistogram, hibernationHistogram, |
| 1121 ("Canvas.HibernationEvents", HibernationEventCount)); | 1121 ("Canvas.HibernationEvents", HibernationEventCount)); |
| 1122 hibernationHistogram.count(event); | 1122 hibernationHistogram.count(event); |
| 1123 } | 1123 } |
| 1124 | 1124 |
| 1125 } // namespace blink | 1125 } // namespace blink |
| OLD | NEW |