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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 // rid of it if it is fast enough to go through thread-local storage | 73 // rid of it if it is fast enough to go through thread-local storage |
74 // always. | 74 // always. |
75 enum ThreadAffinity { | 75 enum ThreadAffinity { |
76 AnyThread, | 76 AnyThread, |
77 MainThreadOnly, | 77 MainThreadOnly, |
78 }; | 78 }; |
79 | 79 |
80 class Node; | 80 class Node; |
81 class CSSValue; | 81 class CSSValue; |
82 | 82 |
83 template<typename T, bool derivesNode = WTF::IsSubclass<T, Node>::value> struct
DefaultThreadingTrait; | 83 template<typename T, bool derivesNodeOrCSSValue = WTF::IsSubclass<T, Node>::valu
e || WTF::IsSubclass<T, CSSValue>::value > struct DefaultThreadingTrait; |
84 | 84 |
85 template<typename T> | 85 template<typename T> |
86 struct DefaultThreadingTrait<T, false> { | 86 struct DefaultThreadingTrait<T, false> { |
87 static const ThreadAffinity Affinity = AnyThread; | 87 static const ThreadAffinity Affinity = AnyThread; |
88 }; | 88 }; |
89 | 89 |
90 template<typename T> | 90 template<typename T> |
91 struct DefaultThreadingTrait<T, true> { | 91 struct DefaultThreadingTrait<T, true> { |
92 static const ThreadAffinity Affinity = MainThreadOnly; | 92 static const ThreadAffinity Affinity = MainThreadOnly; |
93 }; | 93 }; |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 }; | 568 }; |
569 | 569 |
570 template<> class ThreadStateFor<AnyThread> { | 570 template<> class ThreadStateFor<AnyThread> { |
571 public: | 571 public: |
572 static ThreadState* state() { return ThreadState::current(); } | 572 static ThreadState* state() { return ThreadState::current(); } |
573 }; | 573 }; |
574 | 574 |
575 } | 575 } |
576 | 576 |
577 #endif // ThreadState_h | 577 #endif // ThreadState_h |
OLD | NEW |