Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 49 virtual void run(double deadlineSeconds) = 0; | 49 virtual void run(double deadlineSeconds) = 0; |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 class BLINK_PLATFORM_EXPORT TaskObserver { | 52 class BLINK_PLATFORM_EXPORT TaskObserver { |
| 53 public: | 53 public: |
| 54 virtual ~TaskObserver() { } | 54 virtual ~TaskObserver() { } |
| 55 virtual void willProcessTask() = 0; | 55 virtual void willProcessTask() = 0; |
| 56 virtual void didProcessTask() = 0; | 56 virtual void didProcessTask() = 0; |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 class BLINK_PLATFORM_EXPORT TaskTimeObserver { | |
| 60 public: | |
| 61 virtual ~TaskTimeObserver() { } | |
| 62 virtual void willProcessTask() = 0; | |
|
Sami
2016/08/19 14:44:56
Could you remind me why we need did/willProcess ag
panicker
2016/08/19 18:06:50
This is to line up the Begin / End with Time Repor
panicker
2016/08/19 18:10:53
If you can suggest a completely different way to h
Sami
2016/08/22 15:51:30
The task observer can also check if it is nested.
| |
| 63 virtual void didProcessTask() = 0; | |
| 64 virtual void reportTaskTime(double, double) = 0; | |
| 65 }; | |
| 59 | 66 |
| 60 // Returns a WebTaskRunner bound to the underlying scheduler's default task queue. | 67 // Returns a WebTaskRunner bound to the underlying scheduler's default task queue. |
| 61 virtual WebTaskRunner* getWebTaskRunner() { return nullptr; } | 68 virtual WebTaskRunner* getWebTaskRunner() { return nullptr; } |
| 62 | 69 |
| 63 virtual bool isCurrentThread() const = 0; | 70 virtual bool isCurrentThread() const = 0; |
| 64 virtual PlatformThreadId threadId() const { return 0; } | 71 virtual PlatformThreadId threadId() const { return 0; } |
| 65 | 72 |
| 66 virtual void addTaskObserver(TaskObserver*) { } | 73 virtual void addTaskObserver(TaskObserver*) { } |
| 67 virtual void removeTaskObserver(TaskObserver*) { } | 74 virtual void removeTaskObserver(TaskObserver*) { } |
| 75 virtual void addTaskTimeObserver(TaskTimeObserver*) { } | |
| 76 virtual void removeTaskTimeObserver(TaskTimeObserver*) { } | |
| 68 | 77 |
| 69 // Returns the scheduler associated with the thread. | 78 // Returns the scheduler associated with the thread. |
| 70 virtual WebScheduler* scheduler() const = 0; | 79 virtual WebScheduler* scheduler() const = 0; |
| 71 | 80 |
| 72 virtual ~WebThread() { } | 81 virtual ~WebThread() { } |
| 73 }; | 82 }; |
| 74 | 83 |
| 75 } // namespace blink | 84 } // namespace blink |
| 76 | 85 |
| 77 #endif | 86 #endif |
| OLD | NEW |