| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 class TaskObserver { | 44 class TaskObserver { |
| 45 public: | 45 public: |
| 46 virtual ~TaskObserver() { } | 46 virtual ~TaskObserver() { } |
| 47 virtual void willProcessTask() = 0; | 47 virtual void willProcessTask() = 0; |
| 48 virtual void didProcessTask() = 0; | 48 virtual void didProcessTask() = 0; |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 virtual void postTask(Task*) = 0; | 51 virtual void postTask(Task*) = 0; |
| 52 virtual void postDelayedTask(Task*, long long delayMs) = 0; | 52 virtual void postDelayedTask(Task*, long long delayMs) = 0; |
| 53 | 53 |
| 54 virtual bool isCurrentThread() const = 0; |
| 55 |
| 54 virtual void addTaskObserver(TaskObserver*) { } | 56 virtual void addTaskObserver(TaskObserver*) { } |
| 55 virtual void removeTaskObserver(TaskObserver*) { } | 57 virtual void removeTaskObserver(TaskObserver*) { } |
| 56 | 58 |
| 57 // enterRunLoop() processes tasks posted to this WebThread. This call does n
ot return until some task calls exitRunLoop(). | 59 // enterRunLoop() processes tasks posted to this WebThread. This call does n
ot return until some task calls exitRunLoop(). |
| 58 // WebThread does not support nesting, meaning that once the run loop is ent
ered for a given WebThread it is not valid to | 60 // WebThread does not support nesting, meaning that once the run loop is ent
ered for a given WebThread it is not valid to |
| 59 // call enterRunLoop() again. | 61 // call enterRunLoop() again. |
| 60 virtual void enterRunLoop() = 0; | 62 virtual void enterRunLoop() = 0; |
| 61 | 63 |
| 62 // exitRunLoop() runs tasks until there are no tasks available to run, then
returns control to the caller of enterRunLoop(). | 64 // exitRunLoop() runs tasks until there are no tasks available to run, then
returns control to the caller of enterRunLoop(). |
| 63 // Must be called when the WebThread is running. | 65 // Must be called when the WebThread is running. |
| 64 virtual void exitRunLoop() = 0; | 66 virtual void exitRunLoop() = 0; |
| 65 | 67 |
| 66 virtual ~WebThread() { } | 68 virtual ~WebThread() { } |
| 67 }; | 69 }; |
| 68 | 70 |
| 69 } // namespace WebKit | 71 } // namespace WebKit |
| 70 | 72 |
| 71 #endif | 73 #endif |
| OLD | NEW |