| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 template <typename T, WebPrivatePtrDestruction crossThreadDestruction = WebPriva
tePtrDestructionSameThread, WebPrivatePtrStrength strongOrWeak = WebPrivatePtrSt
rength::Normal> | 241 template <typename T, WebPrivatePtrDestruction crossThreadDestruction = WebPriva
tePtrDestructionSameThread, WebPrivatePtrStrength strongOrWeak = WebPrivatePtrSt
rength::Normal> |
| 242 class WebPrivatePtr { | 242 class WebPrivatePtr { |
| 243 public: | 243 public: |
| 244 WebPrivatePtr() : m_storage(0) { } | 244 WebPrivatePtr() : m_storage(0) { } |
| 245 ~WebPrivatePtr() | 245 ~WebPrivatePtr() |
| 246 { | 246 { |
| 247 // We don't destruct the object pointed by m_ptr here because we don't | 247 // We don't destruct the object pointed by m_ptr here because we don't |
| 248 // want to expose destructors of core classes to embedders. We should | 248 // want to expose destructors of core classes to embedders. We should |
| 249 // call reset() manually in destructors of classes with WebPrivatePtr | 249 // call reset() manually in destructors of classes with WebPrivatePtr |
| 250 // members. | 250 // members. |
| 251 BLINK_ASSERT(!m_storage); | 251 DCHECK(!m_storage); |
| 252 } | 252 } |
| 253 | 253 |
| 254 bool isNull() const { return !m_storage; } | 254 bool isNull() const { return !m_storage; } |
| 255 | 255 |
| 256 #if INSIDE_BLINK | 256 #if INSIDE_BLINK |
| 257 template<typename U> | 257 template<typename U> |
| 258 WebPrivatePtr(const U& ptr) | 258 WebPrivatePtr(const U& ptr) |
| 259 : m_storage(0) | 259 : m_storage(0) |
| 260 { | 260 { |
| 261 storage().assign(ptr); | 261 storage().assign(ptr); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 // Disable the copy constructor; classes that contain a WebPrivatePtr | 307 // Disable the copy constructor; classes that contain a WebPrivatePtr |
| 308 // should implement their copy constructor using assign(). | 308 // should implement their copy constructor using assign(). |
| 309 WebPrivatePtr(const WebPrivatePtr&); | 309 WebPrivatePtr(const WebPrivatePtr&); |
| 310 | 310 |
| 311 void* m_storage; | 311 void* m_storage; |
| 312 }; | 312 }; |
| 313 | 313 |
| 314 } // namespace blink | 314 } // namespace blink |
| 315 | 315 |
| 316 #endif // WebPrivatePtr_h | 316 #endif // WebPrivatePtr_h |
| OLD | NEW |