OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 17 matching lines...) Expand all Loading... | |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 #include "core/inspector/AsyncCallStackTracker.h" | 32 #include "core/inspector/AsyncCallStackTracker.h" |
33 | 33 |
34 #include "bindings/core/v8/V8Binding.h" | 34 #include "bindings/core/v8/V8Binding.h" |
35 #include "bindings/core/v8/V8RecursionScope.h" | 35 #include "bindings/core/v8/V8RecursionScope.h" |
36 #include "core/dom/ExecutionContext.h" | 36 #include "core/dom/ExecutionContext.h" |
37 #include "core/dom/ExecutionContextTask.h" | 37 #include "core/dom/ExecutionContextTask.h" |
38 #include "core/dom/Microtask.h" | |
38 #include "core/events/Event.h" | 39 #include "core/events/Event.h" |
39 #include "core/events/EventTarget.h" | 40 #include "core/events/EventTarget.h" |
40 #include "core/xml/XMLHttpRequest.h" | 41 #include "core/xml/XMLHttpRequest.h" |
41 #include "core/xml/XMLHttpRequestUpload.h" | 42 #include "core/xml/XMLHttpRequestUpload.h" |
42 #include "wtf/text/StringBuilder.h" | 43 #include "wtf/text/StringBuilder.h" |
43 #include "wtf/text/StringHash.h" | 44 #include "wtf/text/StringHash.h" |
44 #include <v8.h> | 45 #include <v8.h> |
45 | 46 |
46 namespace { | 47 namespace { |
47 | 48 |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
410 return m_currentAsyncCallChain; // Propogate async call stack chain. | 411 return m_currentAsyncCallChain; // Propogate async call stack chain. |
411 } | 412 } |
412 RefPtrWillBeRawPtr<AsyncCallChain> chain = adoptRefWillBeNoop(m_currentAsync CallChain ? new AsyncCallStackTracker::AsyncCallChain(*m_currentAsyncCallChain) : new AsyncCallStackTracker::AsyncCallChain()); | 413 RefPtrWillBeRawPtr<AsyncCallChain> chain = adoptRefWillBeNoop(m_currentAsync CallChain ? new AsyncCallStackTracker::AsyncCallChain(*m_currentAsyncCallChain) : new AsyncCallStackTracker::AsyncCallChain()); |
413 ensureMaxAsyncCallChainDepth(chain.get(), m_maxAsyncCallStackDepth - 1); | 414 ensureMaxAsyncCallChainDepth(chain.get(), m_maxAsyncCallStackDepth - 1); |
414 chain->m_callStacks.prepend(adoptRefWillBeNoop(new AsyncCallStackTracker::As yncCallStack(description, callFrames))); | 415 chain->m_callStacks.prepend(adoptRefWillBeNoop(new AsyncCallStackTracker::As yncCallStack(description, callFrames))); |
415 return chain.release(); | 416 return chain.release(); |
416 } | 417 } |
417 | 418 |
418 void AsyncCallStackTracker::setCurrentAsyncCallChain(ExecutionContext* context, PassRefPtrWillBeRawPtr<AsyncCallChain> chain) | 419 void AsyncCallStackTracker::setCurrentAsyncCallChain(ExecutionContext* context, PassRefPtrWillBeRawPtr<AsyncCallChain> chain) |
419 { | 420 { |
420 if (chain && !V8RecursionScope::recursionLevel(toIsolate(context))) { | 421 if (chain && (!V8RecursionScope::recursionLevel(toIsolate(context)) || (V8Re cursionScope::recursionLevel(toIsolate(context)) == 1 && Microtask::performingCh eckpoint(toIsolate(context))))) { |
jsbell
2014/09/22 17:26:29
That's a lot of calls to toIsolate(context).
I co
adamk
2014/09/22 18:30:57
I'd recommend pulling it out just to clean up the
jsbell
2014/09/22 18:49:51
Done.
| |
421 // Current AsyncCallChain corresponds to the bottommost JS call frame. | 422 // Current AsyncCallChain corresponds to the bottommost JS call frame. |
422 m_currentAsyncCallChain = chain; | 423 m_currentAsyncCallChain = chain; |
423 m_nestedAsyncCallCount = 1; | 424 m_nestedAsyncCallCount = 1; |
424 } else { | 425 } else { |
425 if (m_currentAsyncCallChain) | 426 if (m_currentAsyncCallChain) |
426 ++m_nestedAsyncCallCount; | 427 ++m_nestedAsyncCallCount; |
427 } | 428 } |
428 } | 429 } |
429 | 430 |
430 void AsyncCallStackTracker::clearCurrentAsyncCallChain() | 431 void AsyncCallStackTracker::clearCurrentAsyncCallChain() |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
466 | 467 |
467 void AsyncCallStackTracker::trace(Visitor* visitor) | 468 void AsyncCallStackTracker::trace(Visitor* visitor) |
468 { | 469 { |
469 visitor->trace(m_currentAsyncCallChain); | 470 visitor->trace(m_currentAsyncCallChain); |
470 #if ENABLE(OILPAN) | 471 #if ENABLE(OILPAN) |
471 visitor->trace(m_executionContextDataMap); | 472 visitor->trace(m_executionContextDataMap); |
472 #endif | 473 #endif |
473 } | 474 } |
474 | 475 |
475 } // namespace blink | 476 } // namespace blink |
OLD | NEW |