Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(541)

Side by Side Diff: public/platform/WebThread.h

Issue 15338009: Move workers to Chromium threading (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Revert actual model change Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/workers/WorkerThread.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « Source/core/workers/WorkerThread.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698