Chromium Code Reviews| Index: webkit/media/crypto/ppapi/linked_ptr.h |
| diff --git a/base/memory/linked_ptr.h b/webkit/media/crypto/ppapi/linked_ptr.h |
| similarity index 94% |
| copy from base/memory/linked_ptr.h |
| copy to webkit/media/crypto/ppapi/linked_ptr.h |
| index 80044add81c22cbd63f9d1d8fefa6ea077d3652b..de646bfbfa498854608f153265b0ffc7a0fa4674 100644 |
| --- a/base/memory/linked_ptr.h |
| +++ b/webkit/media/crypto/ppapi/linked_ptr.h |
| @@ -2,6 +2,9 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| // |
| +// This is a copy of base/linked_ptr.h with CHECKS/DCHECKS replaced with |
| +// PP_DCHECKs. |
| +// |
| // A "smart" pointer type with reference tracking. Every pointer to a |
| // particular object is kept on a circular linked list. When the last pointer |
| // to an object is destroyed or reassigned, the object is deleted. |
| @@ -34,10 +37,10 @@ |
| // - is thread safe for copying and deletion |
| // - supports weak_ptrs |
| -#ifndef BASE_MEMORY_LINKED_PTR_H_ |
| -#define BASE_MEMORY_LINKED_PTR_H_ |
| +#ifndef WEBKIT_MEDIA_CRYPTO_PPAPI_LINKED_PTR_H_ |
| +#define WEBKIT_MEDIA_CRYPTO_PPAPI_LINKED_PTR_H_ |
| -#include "base/logging.h" // for CHECK macros |
| +#include "ppapi/cpp/logging.h" |
| // This is used internally by all instances of linked_ptr<>. It needs to be |
| // a non-template class because different types of linked_ptr<> can refer to |
| @@ -87,7 +90,7 @@ class linked_ptr { |
| template <typename U> linked_ptr(linked_ptr<U> const& ptr) { copy(&ptr); } |
| linked_ptr(linked_ptr const& ptr) { |
| - DCHECK_NE(&ptr, this); |
| + PP_DCHECK(&ptr != this); |
| copy(&ptr); |
| } |
| @@ -118,7 +121,7 @@ class linked_ptr { |
| // Sole ownership by this linked_ptr object is required. |
| T* release() { |
| bool last = link_.depart(); |
| - CHECK(last); |
| + PP_DCHECK(last); |
|
ddorwin
2012/09/18 04:53:14
adding
(void)last;
should fix the clang error fo
Tom Finegan
2012/09/18 06:02:31
Replaced the PP_DCHECK, and used your suggestion.
|
| T* v = value_; |
| value_ = NULL; |
| return v; |
| @@ -178,4 +181,4 @@ linked_ptr<T> make_linked_ptr(T* ptr) { |
| return linked_ptr<T>(ptr); |
| } |
| -#endif // BASE_MEMORY_LINKED_PTR_H_ |
| +#endif // WEBKIT_MEDIA_CRYPTO_PPAPI_LINKED_PTR_H_ |