| 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 * * Neither the name of Google Inc. nor the names of its | 10 * * Neither the name of Google Inc. nor the names of its |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 | 51 |
| 52 ~MainThreadTaskRunner(); | 52 ~MainThreadTaskRunner(); |
| 53 | 53 |
| 54 DECLARE_TRACE(); | 54 DECLARE_TRACE(); |
| 55 | 55 |
| 56 // Executes the task on context's thread asynchronously. | 56 // Executes the task on context's thread asynchronously. |
| 57 void postTask(const WebTraceLocation&, | 57 void postTask(const WebTraceLocation&, |
| 58 std::unique_ptr<ExecutionContextTask>, | 58 std::unique_ptr<ExecutionContextTask>, |
| 59 const String& taskNameForInstrumentation = emptyString()); | 59 const String& taskNameForInstrumentation = emptyString()); |
| 60 | 60 |
| 61 void postInspectorTask(const WebTraceLocation&, | |
| 62 std::unique_ptr<ExecutionContextTask>); | |
| 63 void perform(std::unique_ptr<ExecutionContextTask>, | 61 void perform(std::unique_ptr<ExecutionContextTask>, |
| 64 bool isInspectorTask, | |
| 65 bool instrumenting); | 62 bool instrumenting); |
| 66 | 63 |
| 67 private: | 64 private: |
| 68 explicit MainThreadTaskRunner(ExecutionContext*); | 65 explicit MainThreadTaskRunner(ExecutionContext*); |
| 69 | 66 |
| 70 void postTaskInternal(const WebTraceLocation&, | |
| 71 std::unique_ptr<ExecutionContextTask>, | |
| 72 bool isInspectorTask, | |
| 73 bool instrumenting); | |
| 74 | |
| 75 // Untraced back reference to the owner Document; | 67 // Untraced back reference to the owner Document; |
| 76 // this object has identical lifetime to it. | 68 // this object has identical lifetime to it. |
| 77 UntracedMember<ExecutionContext> m_context; | 69 UntracedMember<ExecutionContext> m_context; |
| 78 WeakPtrFactory<MainThreadTaskRunner> m_weakFactory; | 70 WeakPtrFactory<MainThreadTaskRunner> m_weakFactory; |
| 79 WeakPtr<MainThreadTaskRunner> m_weakPtr; | 71 WeakPtr<MainThreadTaskRunner> m_weakPtr; |
| 80 }; | 72 }; |
| 81 | 73 |
| 82 inline std::unique_ptr<MainThreadTaskRunner> MainThreadTaskRunner::create( | 74 inline std::unique_ptr<MainThreadTaskRunner> MainThreadTaskRunner::create( |
| 83 ExecutionContext* context) { | 75 ExecutionContext* context) { |
| 84 return wrapUnique(new MainThreadTaskRunner(context)); | 76 return wrapUnique(new MainThreadTaskRunner(context)); |
| 85 } | 77 } |
| 86 | 78 |
| 87 } // namespace blink | 79 } // namespace blink |
| 88 | 80 |
| 89 #endif | 81 #endif |
| OLD | NEW |