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

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: Switch TaskTimeTracker over to WebThread::TaskTimeObserver 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
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 : public TaskObserver {
60 public:
61 virtual ~TaskTimeObserver() { }
62 virtual void reportTaskTime(double startTime, double endTime) = 0;
63 };
59 64
60 // Returns a WebTaskRunner bound to the underlying scheduler's default task queue. 65 // Returns a WebTaskRunner bound to the underlying scheduler's default task queue.
61 virtual WebTaskRunner* getWebTaskRunner() { return nullptr; } 66 virtual WebTaskRunner* getWebTaskRunner() { return nullptr; }
62 67
63 virtual bool isCurrentThread() const = 0; 68 virtual bool isCurrentThread() const = 0;
64 virtual PlatformThreadId threadId() const { return 0; } 69 virtual PlatformThreadId threadId() const { return 0; }
65 70
66 virtual void addTaskObserver(TaskObserver*) { } 71 virtual void addTaskObserver(TaskObserver*) { }
67 virtual void removeTaskObserver(TaskObserver*) { } 72 virtual void removeTaskObserver(TaskObserver*) { }
73 virtual void addTaskTimeObserver(TaskTimeObserver*) { }
74 virtual void removeTaskTimeObserver(TaskTimeObserver*) { }
68 75
69 // Returns the scheduler associated with the thread. 76 // Returns the scheduler associated with the thread.
70 virtual WebScheduler* scheduler() const = 0; 77 virtual WebScheduler* scheduler() const = 0;
71 78
72 virtual ~WebThread() { } 79 virtual ~WebThread() { }
73 }; 80 };
74 81
75 } // namespace blink 82 } // namespace blink
76 83
77 #endif 84 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698