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

Side by Side Diff: gin/v8_platform.cc

Issue 2756673004: Implement stack trace printing callback for v8 (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « gin/public/v8_platform.h ('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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium 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 #include "gin/public/v8_platform.h" 5 #include "gin/public/v8_platform.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/debug/stack_trace.h"
8 #include "base/location.h" 9 #include "base/location.h"
9 #include "base/sys_info.h" 10 #include "base/sys_info.h"
10 #include "base/threading/worker_pool.h" 11 #include "base/threading/worker_pool.h"
11 #include "base/trace_event/trace_event.h" 12 #include "base/trace_event/trace_event.h"
12 #include "gin/per_isolate_data.h" 13 #include "gin/per_isolate_data.h"
13 14
14 namespace gin { 15 namespace gin {
15 16
16 namespace { 17 namespace {
17 18
(...skipping 17 matching lines...) Expand all
35 task_->Run(deadline_in_seconds); 36 task_->Run(deadline_in_seconds);
36 } 37 }
37 38
38 private: 39 private:
39 v8::Isolate* isolate_; 40 v8::Isolate* isolate_;
40 std::unique_ptr<v8::IdleTask> task_; 41 std::unique_ptr<v8::IdleTask> task_;
41 42
42 DISALLOW_COPY_AND_ASSIGN(IdleTaskWithLocker); 43 DISALLOW_COPY_AND_ASSIGN(IdleTaskWithLocker);
43 }; 44 };
44 45
46 void PrintStackTrace() {
47 base::debug::StackTrace trace;
48 trace.Print();
49 }
50
45 } // namespace 51 } // namespace
46 52
47 // static 53 // static
48 V8Platform* V8Platform::Get() { return g_v8_platform.Pointer(); } 54 V8Platform* V8Platform::Get() { return g_v8_platform.Pointer(); }
49 55
50 V8Platform::V8Platform() {} 56 V8Platform::V8Platform() {}
51 57
52 V8Platform::~V8Platform() {} 58 V8Platform::~V8Platform() {}
53 59
54 size_t V8Platform::NumberOfAvailableBackgroundThreads() { 60 size_t V8Platform::NumberOfAvailableBackgroundThreads() {
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 void V8Platform::AddTraceStateObserver( 262 void V8Platform::AddTraceStateObserver(
257 v8::Platform::TraceStateObserver* observer) { 263 v8::Platform::TraceStateObserver* observer) {
258 g_trace_state_dispatcher.Get().AddObserver(observer); 264 g_trace_state_dispatcher.Get().AddObserver(observer);
259 } 265 }
260 266
261 void V8Platform::RemoveTraceStateObserver( 267 void V8Platform::RemoveTraceStateObserver(
262 v8::Platform::TraceStateObserver* observer) { 268 v8::Platform::TraceStateObserver* observer) {
263 g_trace_state_dispatcher.Get().RemoveObserver(observer); 269 g_trace_state_dispatcher.Get().RemoveObserver(observer);
264 } 270 }
265 271
272 v8::Platform::StackTracePrinter V8Platform::GetStackTracePrinter() {
273 return PrintStackTrace;
274 }
275
266 } // namespace gin 276 } // namespace gin
OLDNEW
« no previous file with comments | « gin/public/v8_platform.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698