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

Side by Side Diff: third_party/WebKit/Source/platform/CrossThreadCopier.h

Issue 2103813002: Disallow Member<T> in CrossThreadCopier (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2009, 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 PLATFORM_EXPORT static Type copy(const ResourceRequest&); 199 PLATFORM_EXPORT static Type copy(const ResourceRequest&);
200 }; 200 };
201 201
202 template <> 202 template <>
203 struct CrossThreadCopier<ResourceResponse> { 203 struct CrossThreadCopier<ResourceResponse> {
204 STATIC_ONLY(CrossThreadCopier); 204 STATIC_ONLY(CrossThreadCopier);
205 typedef WTF::PassedWrapper<std::unique_ptr<CrossThreadResourceResponseData>> Type; 205 typedef WTF::PassedWrapper<std::unique_ptr<CrossThreadResourceResponseData>> Type;
206 PLATFORM_EXPORT static Type copy(const ResourceResponse&); 206 PLATFORM_EXPORT static Type copy(const ResourceResponse&);
207 }; 207 };
208 208
209 template <typename T>
210 struct CrossThreadCopier<Member<T>> {
211 STATIC_ONLY(CrossThreadCopier);
212 static_assert(IsGarbageCollectedType<T>::value, "T must be a garbage-collect ed type.");
213 typedef T* Type;
214 static Type copy(const Member<T>& ptr)
215 {
216 return ptr;
217 }
218 };
219
220 } // namespace blink 209 } // namespace blink
221 210
222 #endif // CrossThreadCopier_h 211 #endif // CrossThreadCopier_h
OLDNEW
« 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