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

Unified Diff: third_party/WebKit/Source/platform/heap/Handle.h

Issue 1579463002: Restrict the scope of PointerFieldStorageTrait<>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: revert adoptRef() move Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/heap/Handle.h
diff --git a/third_party/WebKit/Source/platform/heap/Handle.h b/third_party/WebKit/Source/platform/heap/Handle.h
index 49d3f33e2e717c08c92c3d0f119052c99b777240..33e77b69f9cff6aad757da64472e873ec9891d0d 100644
--- a/third_party/WebKit/Source/platform/heap/Handle.h
+++ b/third_party/WebKit/Source/platform/heap/Handle.h
@@ -1196,18 +1196,6 @@ template<typename T> PassOwnPtrWillBeRawPtr<T> adoptPtrWillBeNoop(T* ptr) { retu
#endif // ENABLE(OILPAN)
-template<typename T, bool = IsGarbageCollectedType<T>::value>
-class PointerFieldStorageTrait {
-public:
- using Type = RawPtr<T>;
-};
-
-template<typename T>
-class PointerFieldStorageTrait<T, true> {
-public:
- using Type = Member<T>;
-};
-
// Abstraction for injecting calls to an object's 'dispose()' method
// on leaving a stack scope, ensuring earlier release of resources
// than waiting until the object is eventually GCed.
@@ -1229,6 +1217,18 @@ public:
void clear() { m_object.clear(); }
private:
+ template<typename U, bool = IsGarbageCollectedType<U>::value>
+ class PointerFieldStorageTrait {
+ public:
+ using Type = RawPtr<U>;
+ };
+
+ template<typename U>
+ class PointerFieldStorageTrait<U, true> {
+ public:
+ using Type = Member<U>;
+ };
+
typename PointerFieldStorageTrait<T>::Type m_object;
};
@@ -1580,6 +1580,7 @@ struct ParamStorageTraits<blink::AllowCrossThreadWeakPersistent<T>> {
static T* unwrap(const StorageType& value) { return value.get(); }
};
+// Adoption is not needed nor wanted for RefCountedGarbageCollected<>-derived types.
template<typename T>
PassRefPtr<T> adoptRef(blink::RefCountedGarbageCollected<T>*) = delete;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698