OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "bindings/core/v8/ActiveScriptWrappable.h" | 5 #include "bindings/core/v8/ActiveScriptWrappable.h" |
6 | 6 |
7 #include "bindings/core/v8/DOMDataStore.h" | 7 #include "bindings/core/v8/DOMDataStore.h" |
8 #include "bindings/core/v8/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" |
9 #include "bindings/core/v8/ScriptWrappableVisitor.h" | 9 #include "bindings/core/v8/ScriptWrappableVisitor.h" |
10 #include "bindings/core/v8/V8Binding.h" | 10 #include "bindings/core/v8/V8Binding.h" |
11 #include "bindings/core/v8/V8PerIsolateData.h" | 11 #include "bindings/core/v8/V8PerIsolateData.h" |
12 #include "core/dom/ExecutionContext.h" | 12 #include "core/dom/ExecutionContext.h" |
13 | 13 |
14 namespace blink { | 14 namespace blink { |
15 | 15 |
16 ActiveScriptWrappableBase::ActiveScriptWrappableBase() { | 16 ActiveScriptWrappableBase::ActiveScriptWrappableBase() { |
17 ASSERT(ThreadState::Current()); | 17 DCHECK(ThreadState::Current()); |
18 v8::Isolate* isolate = ThreadState::Current()->GetIsolate(); | 18 v8::Isolate* isolate = ThreadState::Current()->GetIsolate(); |
19 V8PerIsolateData* isolate_data = V8PerIsolateData::From(isolate); | 19 V8PerIsolateData* isolate_data = V8PerIsolateData::From(isolate); |
20 isolate_data->AddActiveScriptWrappable(this); | 20 isolate_data->AddActiveScriptWrappable(this); |
21 } | 21 } |
22 | 22 |
23 void ActiveScriptWrappableBase::TraceActiveScriptWrappables( | 23 void ActiveScriptWrappableBase::TraceActiveScriptWrappables( |
24 v8::Isolate* isolate, | 24 v8::Isolate* isolate, |
25 ScriptWrappableVisitor* visitor) { | 25 ScriptWrappableVisitor* visitor) { |
26 V8PerIsolateData* isolate_data = V8PerIsolateData::From(isolate); | 26 V8PerIsolateData* isolate_data = V8PerIsolateData::From(isolate); |
27 auto active_script_wrappables = isolate_data->ActiveScriptWrappables(); | 27 auto active_script_wrappables = isolate_data->ActiveScriptWrappables(); |
(...skipping 26 matching lines...) Expand all Loading... |
54 auto script_wrappable = | 54 auto script_wrappable = |
55 active_wrappable->ToScriptWrappable(active_wrappable); | 55 active_wrappable->ToScriptWrappable(active_wrappable); |
56 auto wrapper_type_info = | 56 auto wrapper_type_info = |
57 const_cast<WrapperTypeInfo*>(script_wrappable->GetWrapperTypeInfo()); | 57 const_cast<WrapperTypeInfo*>(script_wrappable->GetWrapperTypeInfo()); |
58 visitor->RegisterV8Reference( | 58 visitor->RegisterV8Reference( |
59 std::make_pair(wrapper_type_info, script_wrappable)); | 59 std::make_pair(wrapper_type_info, script_wrappable)); |
60 } | 60 } |
61 } | 61 } |
62 | 62 |
63 } // namespace blink | 63 } // namespace blink |
OLD | NEW |