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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/ScriptCallStack.cpp

Issue 1987153002: Account for empty stack trace with non-empty async chain in V8Initializer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp » ('j') | 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) 2008, Google Inc. All rights reserved. 2 * Copyright (c) 2008, 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 27 matching lines...) Expand all
38 #include "platform/v8_inspector/public/V8Debugger.h" 38 #include "platform/v8_inspector/public/V8Debugger.h"
39 #include "platform/v8_inspector/public/V8StackTrace.h" 39 #include "platform/v8_inspector/public/V8StackTrace.h"
40 40
41 namespace blink { 41 namespace blink {
42 42
43 PassRefPtr<ScriptCallStack> ScriptCallStack::create(v8::Isolate* isolate, v8::Lo cal<v8::StackTrace> stackTrace, size_t maxStackSize) 43 PassRefPtr<ScriptCallStack> ScriptCallStack::create(v8::Isolate* isolate, v8::Lo cal<v8::StackTrace> stackTrace, size_t maxStackSize)
44 { 44 {
45 V8PerIsolateData* data = V8PerIsolateData::from(isolate); 45 V8PerIsolateData* data = V8PerIsolateData::from(isolate);
46 if (!data->threadDebugger()) 46 if (!data->threadDebugger())
47 return nullptr; 47 return nullptr;
48 return adoptRef(new ScriptCallStack(data->threadDebugger()->debugger()->crea teStackTrace(stackTrace, maxStackSize))); 48 OwnPtr<V8StackTrace> stack = data->threadDebugger()->debugger()->createStack Trace(stackTrace, maxStackSize);
49 return stack ? adoptRef(new ScriptCallStack(std::move(stack))) : nullptr;
49 } 50 }
50 51
51 PassRefPtr<ScriptCallStack> ScriptCallStack::capture(size_t maxStackSize) 52 PassRefPtr<ScriptCallStack> ScriptCallStack::capture(size_t maxStackSize)
52 { 53 {
53 v8::Isolate* isolate = v8::Isolate::GetCurrent(); 54 v8::Isolate* isolate = v8::Isolate::GetCurrent();
54 if (!isolate->InContext()) 55 if (!isolate->InContext())
55 return nullptr; 56 return nullptr;
56 V8PerIsolateData* data = V8PerIsolateData::from(isolate); 57 V8PerIsolateData* data = V8PerIsolateData::from(isolate);
57 if (!data->threadDebugger()) 58 if (!data->threadDebugger())
58 return nullptr; 59 return nullptr;
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 value->endDictionary(); 123 value->endDictionary();
123 value->endArray(); 124 value->endArray();
124 } 125 }
125 126
126 String ScriptCallStack::toString() const 127 String ScriptCallStack::toString() const
127 { 128 {
128 return m_stackTrace->toString(); 129 return m_stackTrace->toString();
129 } 130 }
130 131
131 } // namespace blink 132 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698