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

Side by Side Diff: cc/prioritized_resource.cc

Issue 11606012: cc: Unify context losing machinery (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/prioritized_resource.h" 5 #include "cc/prioritized_resource.h"
6 6
7 #include "cc/platform_color.h" 7 #include "cc/platform_color.h"
8 #include "cc/prioritized_resource_manager.h" 8 #include "cc/prioritized_resource_manager.h"
9 #include "cc/priority_calculator.h" 9 #include "cc/priority_calculator.h"
10 #include "cc/proxy.h" 10 #include "cc/proxy.h"
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 { 147 {
148 DCHECK(!m_owner); 148 DCHECK(!m_owner);
149 DCHECK(m_resourceHasBeenDeleted); 149 DCHECK(m_resourceHasBeenDeleted);
150 } 150 }
151 151
152 void PrioritizedResource::Backing::deleteResource(ResourceProvider* resourceProv ider) 152 void PrioritizedResource::Backing::deleteResource(ResourceProvider* resourceProv ider)
153 { 153 {
154 DCHECK(!proxy() || proxy()->isImplThread()); 154 DCHECK(!proxy() || proxy()->isImplThread());
155 DCHECK(!m_resourceHasBeenDeleted); 155 DCHECK(!m_resourceHasBeenDeleted);
156 #ifndef NDEBUG 156 #ifndef NDEBUG
157 DCHECK(resourceProvider == m_resourceProvider); 157 DCHECK(!resourceProvider || resourceProvider == m_resourceProvider);
158 #endif 158 #endif
159 159
160 resourceProvider->deleteResource(id()); 160 if (resourceProvider)
161 resourceProvider->deleteResource(id());
jamesr 2012/12/18 21:24:01 this is a 4-space indent file
161 set_id(0); 162 set_id(0);
162 m_resourceHasBeenDeleted = true; 163 m_resourceHasBeenDeleted = true;
163 } 164 }
164 165
165 bool PrioritizedResource::Backing::resourceHasBeenDeleted() const 166 bool PrioritizedResource::Backing::resourceHasBeenDeleted() const
166 { 167 {
167 DCHECK(!proxy() || proxy()->isImplThread()); 168 DCHECK(!proxy() || proxy()->isImplThread());
168 return m_resourceHasBeenDeleted; 169 return m_resourceHasBeenDeleted;
169 } 170 }
170 171
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 } 203 }
203 204
204 const Proxy* PrioritizedResource::Backing::proxy() const 205 const Proxy* PrioritizedResource::Backing::proxy() const
205 { 206 {
206 if (!m_owner || !m_owner->resourceManager()) 207 if (!m_owner || !m_owner->resourceManager())
207 return 0; 208 return 0;
208 return m_owner->resourceManager()->proxyForDebug(); 209 return m_owner->resourceManager()->proxyForDebug();
209 } 210 }
210 211
211 } // namespace cc 212 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698