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

Side by Side Diff: Source/modules/webgl/WebGLContextGroup.cpp

Issue 1234883002: [Oilpan] Migrate classes under module/webgl onto oilpan heap (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Work for comments Created 5 years, 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2011 Apple 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 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 } 73 }
74 74
75 void WebGLContextGroup::addObject(WebGLSharedObject* object) 75 void WebGLContextGroup::addObject(WebGLSharedObject* object)
76 { 76 {
77 m_groupObjects.add(object); 77 m_groupObjects.add(object);
78 } 78 }
79 79
80 void WebGLContextGroup::detachAndRemoveAllObjects() 80 void WebGLContextGroup::detachAndRemoveAllObjects()
81 { 81 {
82 while (!m_groupObjects.isEmpty()) { 82 while (!m_groupObjects.isEmpty()) {
83 HashSet<WebGLSharedObject*>::iterator it = m_groupObjects.begin(); 83 PersistentHeapHashSet<WeakMember<WebGLSharedObject>>::iterator it = m_gr oupObjects.begin();
84 (*it)->detachContextGroup(); 84 (*it)->detachContextGroup();
85 } 85 }
86 } 86 }
87 87
88 void WebGLContextGroup::loseContextGroup(WebGLRenderingContextBase::LostContextM ode mode, WebGLRenderingContextBase::AutoRecoveryMethod autoRecoveryMethod) 88 void WebGLContextGroup::loseContextGroup(WebGLRenderingContextBase::LostContextM ode mode, WebGLRenderingContextBase::AutoRecoveryMethod autoRecoveryMethod)
89 { 89 {
90 // Detach must happen before loseContextImpl, which destroys the GraphicsCon text3D 90 // Detach must happen before loseContextImpl, which destroys the GraphicsCon text3D
91 // and prevents groupObjects from being properly deleted. 91 // and prevents groupObjects from being properly deleted.
92 detachAndRemoveAllObjects(); 92 detachAndRemoveAllObjects();
93 93
94 for (WebGLRenderingContextBase* const context : m_contexts) 94 for (WebGLRenderingContextBase* const context : m_contexts)
95 context->loseContextImpl(mode, autoRecoveryMethod); 95 context->loseContextImpl(mode, autoRecoveryMethod);
96 } 96 }
97 97
98 } // namespace blink 98 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698