OLD | NEW |
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 "config.h" | 5 #include "config.h" |
6 #include "bindings/modules/v8/ModuleBindingsInitializer.h" | 6 #include "bindings/modules/v8/ModuleBindingsInitializer.h" |
7 | 7 |
8 #include "bindings/core/v8/ModuleProxy.h" | 8 #include "bindings/core/v8/ModuleProxy.h" |
9 #include "core/dom/ExecutionContext.h" | 9 #include "core/dom/ExecutionContext.h" |
10 #include "modules/indexeddb/IDBPendingTransactionMonitor.h" | 10 #include "modules/indexeddb/IDBPendingTransactionMonitor.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 static void didLeaveScriptContextForModule(ExecutionContext& executionContext) | 14 static void didLeaveScriptContextForModule(v8::Isolate* isolate) |
15 { | 15 { |
16 // Indexed DB requires that transactions are created with an internal |activ
e| flag | 16 // Indexed DB requires that transactions are created with an internal |activ
e| flag |
17 // set to true, but the flag becomes false when control returns to the event
loop. | 17 // set to true, but the flag becomes false when control returns to the event
loop. |
18 IDBPendingTransactionMonitor::from(executionContext).deactivateNewTransactio
ns(); | 18 IDBPendingTransactionMonitor::deactivateNewTransactions(isolate); |
19 } | 19 } |
20 | 20 |
21 void ModuleBindingsInitializer::init() | 21 void ModuleBindingsInitializer::init() |
22 { | 22 { |
23 ModuleProxy::moduleProxy().registerDidLeaveScriptContextForRecursionScope(di
dLeaveScriptContextForModule); | 23 ModuleProxy::moduleProxy().registerDidLeaveScriptContextForRecursionScope(di
dLeaveScriptContextForModule); |
24 } | 24 } |
25 | 25 |
26 } // namespace blink | 26 } // namespace blink |
OLD | NEW |