| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 virtual void run(double deadlineSeconds) = 0; | 58 virtual void run(double deadlineSeconds) = 0; |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 class BLINK_PLATFORM_EXPORT TaskObserver { | 61 class BLINK_PLATFORM_EXPORT TaskObserver { |
| 62 public: | 62 public: |
| 63 virtual ~TaskObserver() {} | 63 virtual ~TaskObserver() {} |
| 64 virtual void willProcessTask() = 0; | 64 virtual void willProcessTask() = 0; |
| 65 virtual void didProcessTask() = 0; | 65 virtual void didProcessTask() = 0; |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 // Returns a WebTaskRunner bound to the underlying scheduler's default task | 68 // DEPRECATED: Returns a WebTaskRunner bound to the underlying scheduler's |
| 69 // queue. | 69 // default task queue. |
| 70 // |
| 71 // Default scheduler task queue does not give scheduler enough freedom to |
| 72 // manage task priorities and should not be used. |
| 73 // Use TaskRunnerHelper::get instead (crbug.com/624696). |
| 70 virtual WebTaskRunner* getWebTaskRunner() { return nullptr; } | 74 virtual WebTaskRunner* getWebTaskRunner() { return nullptr; } |
| 71 base::SingleThreadTaskRunner* getSingleThreadTaskRunner(); | 75 base::SingleThreadTaskRunner* getSingleThreadTaskRunner(); |
| 72 | 76 |
| 73 virtual bool isCurrentThread() const = 0; | 77 virtual bool isCurrentThread() const = 0; |
| 74 virtual PlatformThreadId threadId() const { return 0; } | 78 virtual PlatformThreadId threadId() const { return 0; } |
| 75 | 79 |
| 76 // TaskObserver is an object that receives task notifications from the | 80 // TaskObserver is an object that receives task notifications from the |
| 77 // MessageLoop | 81 // MessageLoop |
| 78 // NOTE: TaskObserver implementation should be extremely fast! | 82 // NOTE: TaskObserver implementation should be extremely fast! |
| 79 // This API is performance sensitive. Use only if you have a compelling | 83 // This API is performance sensitive. Use only if you have a compelling |
| (...skipping 11 matching lines...) Expand all Loading... |
| 91 | 95 |
| 92 // Returns the scheduler associated with the thread. | 96 // Returns the scheduler associated with the thread. |
| 93 virtual WebScheduler* scheduler() const = 0; | 97 virtual WebScheduler* scheduler() const = 0; |
| 94 | 98 |
| 95 virtual ~WebThread() {} | 99 virtual ~WebThread() {} |
| 96 }; | 100 }; |
| 97 | 101 |
| 98 } // namespace blink | 102 } // namespace blink |
| 99 | 103 |
| 100 #endif | 104 #endif |
| OLD | NEW |