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

Side by Side Diff: Source/core/inspector/AsyncCallStackTracker.cpp

Issue 555163005: Deactivate IDBTransactions created within Microtasks (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Refactored fix Created 6 years, 3 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 | Annotate | Revision Log
« Source/core/dom/Microtask.cpp ('K') | « Source/core/dom/Microtask.cpp ('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 /* 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
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
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
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
OLDNEW
« Source/core/dom/Microtask.cpp ('K') | « Source/core/dom/Microtask.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698