| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 static void beforeCallEnteredCallback(v8::Isolate* isolate) { | 48 static void beforeCallEnteredCallback(v8::Isolate* isolate) { |
| 49 RELEASE_ASSERT(!ScriptForbiddenScope::isScriptForbidden()); | 49 RELEASE_ASSERT(!ScriptForbiddenScope::isScriptForbidden()); |
| 50 } | 50 } |
| 51 | 51 |
| 52 static void microtasksCompletedCallback(v8::Isolate* isolate) { | 52 static void microtasksCompletedCallback(v8::Isolate* isolate) { |
| 53 V8PerIsolateData::from(isolate)->runEndOfScopeTasks(); | 53 V8PerIsolateData::from(isolate)->runEndOfScopeTasks(); |
| 54 } | 54 } |
| 55 | 55 |
| 56 V8PerIsolateData::V8PerIsolateData(WebTaskRunner* taskRunner) | 56 V8PerIsolateData::V8PerIsolateData(WebTaskRunner* taskRunner) |
| 57 : m_isolateHolder(WTF::makeUnique<gin::IsolateHolder>( | 57 : m_isolateHolder(WTF::makeUnique<gin::IsolateHolder>( |
| 58 taskRunner ? taskRunner->toSingleThreadTaskRunner() : nullptr)), | 58 taskRunner ? taskRunner->toSingleThreadTaskRunner() : nullptr, |
| 59 gin::IsolateHolder::kSingleThread, |
| 60 isMainThread() ? gin::IsolateHolder::kDisallowAtomicsWait |
| 61 : gin::IsolateHolder::kAllowAtomicsWait)), |
| 59 m_stringCache(WTF::wrapUnique(new StringCache(isolate()))), | 62 m_stringCache(WTF::wrapUnique(new StringCache(isolate()))), |
| 60 m_hiddenValue(V8HiddenValue::create()), | 63 m_hiddenValue(V8HiddenValue::create()), |
| 61 m_privateProperty(V8PrivateProperty::create()), | 64 m_privateProperty(V8PrivateProperty::create()), |
| 62 m_constructorMode(ConstructorMode::CreateNewObject), | 65 m_constructorMode(ConstructorMode::CreateNewObject), |
| 63 m_useCounterDisabled(false), | 66 m_useCounterDisabled(false), |
| 64 m_isHandlingRecursionLevelError(false), | 67 m_isHandlingRecursionLevelError(false), |
| 65 m_isReportingException(false) { | 68 m_isReportingException(false) { |
| 66 // FIXME: Remove once all v8::Isolate::GetCurrent() calls are gone. | 69 // FIXME: Remove once all v8::Isolate::GetCurrent() calls are gone. |
| 67 isolate()->Enter(); | 70 isolate()->Enter(); |
| 68 isolate()->AddBeforeCallEnteredCallback(&beforeCallEnteredCallback); | 71 isolate()->AddBeforeCallEnteredCallback(&beforeCallEnteredCallback); |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 ScriptWrappableVisitor* current = currentVisitor(); | 415 ScriptWrappableVisitor* current = currentVisitor(); |
| 413 if (current) | 416 if (current) |
| 414 current->performCleanup(); | 417 current->performCleanup(); |
| 415 | 418 |
| 416 V8PerIsolateData::from(m_isolate)->m_scriptWrappableVisitor.swap( | 419 V8PerIsolateData::from(m_isolate)->m_scriptWrappableVisitor.swap( |
| 417 m_savedVisitor); | 420 m_savedVisitor); |
| 418 m_isolate->SetEmbedderHeapTracer(currentVisitor()); | 421 m_isolate->SetEmbedderHeapTracer(currentVisitor()); |
| 419 } | 422 } |
| 420 | 423 |
| 421 } // namespace blink | 424 } // namespace blink |
| OLD | NEW |