OLD | NEW |
---|---|
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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
50 }; | 50 }; |
51 | 51 |
52 template<typename T> struct CrossThreadTaskTraits<PassRefPtr<T> > { | 52 template<typename T> struct CrossThreadTaskTraits<PassRefPtr<T> > { |
53 typedef PassRefPtr<T> ParamType; | 53 typedef PassRefPtr<T> ParamType; |
54 }; | 54 }; |
55 | 55 |
56 template<typename T> struct CrossThreadTaskTraits<PassOwnPtr<T> > { | 56 template<typename T> struct CrossThreadTaskTraits<PassOwnPtr<T> > { |
57 typedef PassOwnPtr<T> ParamType; | 57 typedef PassOwnPtr<T> ParamType; |
58 }; | 58 }; |
59 | 59 |
60 template<typename T> struct CrossThreadTaskTraits<CrossThreadPersistent<T> > { | |
61 typedef CrossThreadPersistent<T> ParamType; | |
62 }; | |
63 | |
60 template<typename P1, typename MP1> | 64 template<typename P1, typename MP1> |
61 class CrossThreadTask1 : public ExecutionContextTask { | 65 class CrossThreadTask1 : public ExecutionContextTask { |
62 public: | 66 public: |
63 typedef void (*Method)(ExecutionContext*, MP1); | 67 typedef void (*Method)(ExecutionContext*, MP1); |
64 typedef CrossThreadTask1<P1, MP1> CrossThreadTask; | 68 typedef CrossThreadTask1<P1, MP1> CrossThreadTask; |
65 typedef typename CrossThreadTaskTraits<P1>::ParamType Param1; | 69 typedef typename CrossThreadTaskTraits<P1>::ParamType Param1; |
66 | 70 |
67 static PassOwnPtr<CrossThreadTask> create(Method method, Param1 parameter1) | 71 static PassOwnPtr<CrossThreadTask> create(Method method, Param1 parameter1) |
68 { | 72 { |
69 return adoptPtr(new CrossThreadTask(method, parameter1)); | 73 return adoptPtr(new CrossThreadTask(method, parameter1)); |
70 } | 74 } |
71 | 75 |
72 private: | 76 private: |
73 CrossThreadTask1(Method method, Param1 parameter1) | 77 CrossThreadTask1(Method method, Param1 parameter1) |
74 : m_method(method) | 78 : m_method(method) |
75 , m_parameter1(parameter1) | 79 , m_parameter1(parameter1) |
76 { | 80 { |
77 } | 81 } |
78 | 82 |
79 virtual void performTask(ExecutionContext* context) | 83 virtual void performTask(ExecutionContext* context) |
80 { | 84 { |
81 (*m_method)(context, m_parameter1); | 85 (*m_method)(context, m_parameter1); |
haraken
2014/05/09 08:08:23
This line hits the following compile error:
../..
| |
82 } | 86 } |
83 | 87 |
84 private: | 88 private: |
85 Method m_method; | 89 Method m_method; |
86 P1 m_parameter1; | 90 P1 m_parameter1; |
87 }; | 91 }; |
88 | 92 |
89 template<typename P1, typename MP1, typename P2, typename MP2> | 93 template<typename P1, typename MP1, typename P2, typename MP2> |
90 class CrossThreadTask2 : public ExecutionContextTask { | 94 class CrossThreadTask2 : public ExecutionContextTask { |
91 public: | 95 public: |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
468 method, | 472 method, |
469 CrossThreadCopier<P1>::co py(parameter1), CrossThreadCopier<P2>::copy(parameter2), | 473 CrossThreadCopier<P1>::co py(parameter1), CrossThreadCopier<P2>::copy(parameter2), |
470 CrossThreadCopier<P3>::co py(parameter3), CrossThreadCopier<P4>::copy(parameter4), | 474 CrossThreadCopier<P3>::co py(parameter3), CrossThreadCopier<P4>::copy(parameter4), |
471 CrossThreadCopier<P5>::co py(parameter5), CrossThreadCopier<P6>::copy(parameter6), | 475 CrossThreadCopier<P5>::co py(parameter5), CrossThreadCopier<P6>::copy(parameter6), |
472 CrossThreadCopier<P7>::co py(parameter7), CrossThreadCopier<P8>::copy(parameter8)); | 476 CrossThreadCopier<P7>::co py(parameter7), CrossThreadCopier<P8>::copy(parameter8)); |
473 } | 477 } |
474 | 478 |
475 } // namespace WebCore | 479 } // namespace WebCore |
476 | 480 |
477 #endif // CrossThreadTask_h | 481 #endif // CrossThreadTask_h |
OLD | NEW |