OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 // rid of it if it is fast enough to go through thread-local storage | 74 // rid of it if it is fast enough to go through thread-local storage |
75 // always. | 75 // always. |
76 enum ThreadAffinity { | 76 enum ThreadAffinity { |
77 AnyThread, | 77 AnyThread, |
78 MainThreadOnly, | 78 MainThreadOnly, |
79 }; | 79 }; |
80 | 80 |
81 class Node; | 81 class Node; |
82 class CSSValue; | 82 class CSSValue; |
83 | 83 |
84 template<typename T, bool derivesNode = WTF::IsSubclass<T, Node>::value> struct
DefaultThreadingTrait; | 84 template<typename T, bool derivesNode = WTF::IsSubclass<typename WTF::RemoveCons
t<T>::Type, Node>::value> struct DefaultThreadingTrait; |
85 | 85 |
86 template<typename T> | 86 template<typename T> |
87 struct DefaultThreadingTrait<T, false> { | 87 struct DefaultThreadingTrait<T, false> { |
88 static const ThreadAffinity Affinity = AnyThread; | 88 static const ThreadAffinity Affinity = AnyThread; |
89 }; | 89 }; |
90 | 90 |
91 template<typename T> | 91 template<typename T> |
92 struct DefaultThreadingTrait<T, true> { | 92 struct DefaultThreadingTrait<T, true> { |
93 static const ThreadAffinity Affinity = MainThreadOnly; | 93 static const ThreadAffinity Affinity = MainThreadOnly; |
94 }; | 94 }; |
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 }; | 596 }; |
597 | 597 |
598 template<> class ThreadStateFor<AnyThread> { | 598 template<> class ThreadStateFor<AnyThread> { |
599 public: | 599 public: |
600 static ThreadState* state() { return ThreadState::current(); } | 600 static ThreadState* state() { return ThreadState::current(); } |
601 }; | 601 }; |
602 | 602 |
603 } | 603 } |
604 | 604 |
605 #endif // ThreadState_h | 605 #endif // ThreadState_h |
OLD | NEW |