1197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch// Copyright 2014 The Chromium Authors. All rights reserved. 2197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch// Use of this source code is governed by a BSD-style license that can be 3197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch// found in the LICENSE file. 4197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch 5197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch#include "config.h" 6197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch#include "bindings/modules/v8/ModuleBindingsInitializer.h" 7197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch 8197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch#include "bindings/core/v8/ModuleProxy.h" 97242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci#include "bindings/core/v8/V8PerIsolateData.h" 107242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci#include "core/dom/ExecutionContext.h" 11197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch#include "modules/indexeddb/IDBPendingTransactionMonitor.h" 12197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch 13c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles)namespace blink { 14197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch 157242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tuccistatic void didLeaveScriptContextForModule(v8::Isolate* isolate) 16197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch{ 17197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch // Indexed DB requires that transactions are created with an internal |active| flag 18197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch // set to true, but the flag becomes false when control returns to the event loop. 197242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci V8PerIsolateData::from(isolate)->ensureIDBPendingTransactionMonitor()->deactivateNewTransactions(); 20197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch} 21197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch 22197021e6b966cfb06891637935ef33fff06433d1Ben Murdochvoid ModuleBindingsInitializer::init() 23197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch{ 24197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch ModuleProxy::moduleProxy().registerDidLeaveScriptContextForRecursionScope(didLeaveScriptContextForModule); 25197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch} 26197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch 27c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles)} // namespace blink 28