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

Side by Side Diff: src/libplatform/default-platform.h

Issue 988893003: Implement tracing interface for v8 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove v8-tracing in favor of v8-platform, make passing Isolate* explicit, still WIP Created 5 years, 2 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 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_LIBPLATFORM_DEFAULT_PLATFORM_H_ 5 #ifndef V8_LIBPLATFORM_DEFAULT_PLATFORM_H_
6 #define V8_LIBPLATFORM_DEFAULT_PLATFORM_H_ 6 #define V8_LIBPLATFORM_DEFAULT_PLATFORM_H_
7 7
8 #include <functional> 8 #include <functional>
9 #include <map> 9 #include <map>
10 #include <queue> 10 #include <queue>
(...skipping 26 matching lines...) Expand all
37 virtual void CallOnBackgroundThread( 37 virtual void CallOnBackgroundThread(
38 Task* task, ExpectedRuntime expected_runtime) override; 38 Task* task, ExpectedRuntime expected_runtime) override;
39 virtual void CallOnForegroundThread(v8::Isolate* isolate, 39 virtual void CallOnForegroundThread(v8::Isolate* isolate,
40 Task* task) override; 40 Task* task) override;
41 virtual void CallDelayedOnForegroundThread(Isolate* isolate, Task* task, 41 virtual void CallDelayedOnForegroundThread(Isolate* isolate, Task* task,
42 double delay_in_seconds) override; 42 double delay_in_seconds) override;
43 virtual void CallIdleOnForegroundThread(Isolate* isolate, 43 virtual void CallIdleOnForegroundThread(Isolate* isolate,
44 IdleTask* task) override; 44 IdleTask* task) override;
45 virtual bool IdleTasksEnabled(Isolate* isolate) override; 45 virtual bool IdleTasksEnabled(Isolate* isolate) override;
46 double MonotonicallyIncreasingTime() override; 46 double MonotonicallyIncreasingTime() override;
47 virtual const uint8_t* GetCategoryGroupEnabled(const char* name) override;
48 virtual const char* GetCategoryGroupName(
49 const uint8_t* categoryEnabledFlag) override;
50 virtual uint64_t AddTraceEvent(char phase, const uint8_t* categoryEnabledFlag,
51 const char* name, uint64_t id,
52 uint64_t context_id, uint64_t bind_id,
53 int32_t numArgs, const char** argNames,
54 const uint8_t* argTypes,
55 const uint64_t* argValues,
56 unsigned int flags) override;
57 virtual void UpdateTraceEventDuration(const uint8_t* categoryEnabledFlag,
58 const char* name,
59 uint64_t handle) override;
60
47 61
48 private: 62 private:
49 static const int kMaxThreadPoolSize; 63 static const int kMaxThreadPoolSize;
50 64
51 Task* PopTaskInMainThreadQueue(v8::Isolate* isolate); 65 Task* PopTaskInMainThreadQueue(v8::Isolate* isolate);
52 Task* PopTaskInMainThreadDelayedQueue(v8::Isolate* isolate); 66 Task* PopTaskInMainThreadDelayedQueue(v8::Isolate* isolate);
53 67
54 base::Mutex lock_; 68 base::Mutex lock_;
55 bool initialized_; 69 bool initialized_;
56 int thread_pool_size_; 70 int thread_pool_size_;
57 std::vector<WorkerThread*> thread_pool_; 71 std::vector<WorkerThread*> thread_pool_;
58 TaskQueue queue_; 72 TaskQueue queue_;
59 std::map<v8::Isolate*, std::queue<Task*> > main_thread_queue_; 73 std::map<v8::Isolate*, std::queue<Task*> > main_thread_queue_;
60 74
61 typedef std::pair<double, Task*> DelayedEntry; 75 typedef std::pair<double, Task*> DelayedEntry;
62 std::map<v8::Isolate*, 76 std::map<v8::Isolate*,
63 std::priority_queue<DelayedEntry, std::vector<DelayedEntry>, 77 std::priority_queue<DelayedEntry, std::vector<DelayedEntry>,
64 std::greater<DelayedEntry> > > 78 std::greater<DelayedEntry> > >
65 main_thread_delayed_queue_; 79 main_thread_delayed_queue_;
66 80
67 DISALLOW_COPY_AND_ASSIGN(DefaultPlatform); 81 DISALLOW_COPY_AND_ASSIGN(DefaultPlatform);
68 }; 82 };
69 83
70 84
71 } } // namespace v8::platform 85 } } // namespace v8::platform
72 86
73 87
74 #endif // V8_LIBPLATFORM_DEFAULT_PLATFORM_H_ 88 #endif // V8_LIBPLATFORM_DEFAULT_PLATFORM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698