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

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

Issue 2259013003: Move and rename TaskTimeTracker to public interface exposed to WebThread, use in WebPerf Agent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move TaskTimeTracker to public interface, expose to WebThread. Created 4 years, 4 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
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
11 * notice, this list of conditions and the following disclaimer in the 11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution. 12 * documentation and/or other materials provided with the distribution.
13 * 13 *
14 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY 14 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 16 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY 17 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
18 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 18 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 19 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 20 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 #ifndef WebThread_h 25 #ifndef WebThread_h
26 #define WebThread_h 26 #define WebThread_h
27 27
28 #include "WebCommon.h" 28 #include "WebCommon.h"
29 #include "public/platform/scheduler/base/task_time_tracker.h"
Sami 2016/08/23 10:34:59 nit: Could forward declare this instead.
panickercorp 2016/08/23 17:43:31 Done.
30
29 #include <stdint.h> 31 #include <stdint.h>
30 32
31 namespace blink { 33 namespace blink {
32 class WebScheduler; 34 class WebScheduler;
33 class WebTaskRunner; 35 class WebTaskRunner;
34 36
35 // Always an integer value. 37 // Always an integer value.
36 typedef uintptr_t PlatformThreadId; 38 typedef uintptr_t PlatformThreadId;
37 39
38 // Provides an interface to an embedder-defined thread implementation. 40 // Provides an interface to an embedder-defined thread implementation.
(...skipping 17 matching lines...) Expand all
56 virtual void didProcessTask() = 0; 58 virtual void didProcessTask() = 0;
57 }; 59 };
58 60
59 61
60 // Returns a WebTaskRunner bound to the underlying scheduler's default task queue. 62 // Returns a WebTaskRunner bound to the underlying scheduler's default task queue.
61 virtual WebTaskRunner* getWebTaskRunner() { return nullptr; } 63 virtual WebTaskRunner* getWebTaskRunner() { return nullptr; }
62 64
63 virtual bool isCurrentThread() const = 0; 65 virtual bool isCurrentThread() const = 0;
64 virtual PlatformThreadId threadId() const { return 0; } 66 virtual PlatformThreadId threadId() const { return 0; }
65 67
66 virtual void addTaskObserver(TaskObserver*) { } 68 virtual void addTaskObserver(TaskObserver*) { }
Sami 2016/08/23 10:34:59 Could you add a comment here saying that both the
panickercorp 2016/08/23 17:43:31 How is this?
67 virtual void removeTaskObserver(TaskObserver*) { } 69 virtual void removeTaskObserver(TaskObserver*) { }
68 70
71 virtual void addTaskTimeTracker(scheduler::TaskTimeTracker*) {}
72 virtual void removeTaskTimeTracker(scheduler::TaskTimeTracker*) {}
73
69 // Returns the scheduler associated with the thread. 74 // Returns the scheduler associated with the thread.
70 virtual WebScheduler* scheduler() const = 0; 75 virtual WebScheduler* scheduler() const = 0;
71 76
72 virtual ~WebThread() { } 77 virtual ~WebThread() { }
73 }; 78 };
74 79
75 } // namespace blink 80 } // namespace blink
76 81
77 #endif 82 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698