OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * Copyright (C) 2013 Intel Corporation. All rights reserved. | 3 * Copyright (C) 2013 Intel Corporation. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 16 matching lines...) Expand all Loading... |
27 #ifndef WebPrivateOwnPtr_h | 27 #ifndef WebPrivateOwnPtr_h |
28 #define WebPrivateOwnPtr_h | 28 #define WebPrivateOwnPtr_h |
29 | 29 |
30 #include "WebCommon.h" | 30 #include "WebCommon.h" |
31 #include "WebNonCopyable.h" | 31 #include "WebNonCopyable.h" |
32 | 32 |
33 #if INSIDE_BLINK | 33 #if INSIDE_BLINK |
34 #include "wtf/PassOwnPtr.h" | 34 #include "wtf/PassOwnPtr.h" |
35 #endif | 35 #endif |
36 | 36 |
37 namespace WebKit { | 37 namespace blink { |
38 | 38 |
39 // This class is an implementation detail of the WebKit API. It exists | 39 // This class is an implementation detail of the WebKit API. It exists |
40 // to help simplify the implementation of WebKit interfaces that merely | 40 // to help simplify the implementation of WebKit interfaces that merely |
41 // wrap a pointer to a WebCore class. It's similar to WebPrivatePtr, but it | 41 // wrap a pointer to a WebCore class. It's similar to WebPrivatePtr, but it |
42 // wraps a naked pointer rather than a reference counted. | 42 // wraps a naked pointer rather than a reference counted. |
43 // Note: you must call reset(0) on the implementation side in order to delete | 43 // Note: you must call reset(0) on the implementation side in order to delete |
44 // the WebCore pointer. | 44 // the WebCore pointer. |
45 template <typename T> | 45 template <typename T> |
46 class WebPrivateOwnPtr : public WebNonCopyable { | 46 class WebPrivateOwnPtr : public WebNonCopyable { |
47 public: | 47 public: |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 }; | 88 }; |
89 | 89 |
90 #if INSIDE_BLINK | 90 #if INSIDE_BLINK |
91 template<typename T> template<typename U> inline WebPrivateOwnPtr<T>::WebPrivate
OwnPtr(const PassOwnPtr<U>& o, EnsurePtrConvertibleArgDefn(U, T)) | 91 template<typename T> template<typename U> inline WebPrivateOwnPtr<T>::WebPrivate
OwnPtr(const PassOwnPtr<U>& o, EnsurePtrConvertibleArgDefn(U, T)) |
92 : m_ptr(o.leakPtr()) | 92 : m_ptr(o.leakPtr()) |
93 { | 93 { |
94 COMPILE_ASSERT(!WTF::IsArray<T>::value, Pointers_to_array_must_never_be_conv
erted); | 94 COMPILE_ASSERT(!WTF::IsArray<T>::value, Pointers_to_array_must_never_be_conv
erted); |
95 } | 95 } |
96 #endif | 96 #endif |
97 | 97 |
98 } // namespace WebKit | 98 } // namespace blink |
99 | 99 |
100 #endif | 100 #endif |
OLD | NEW |