OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008, 2009, 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2008, 2009, 2011 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 if (!global_proxy_.IsEmpty()) { | 86 if (!global_proxy_.IsEmpty()) { |
87 CHECK(global_proxy_ == context->Global()); | 87 CHECK(global_proxy_ == context->Global()); |
88 CHECK_EQ(ToScriptWrappable(context->Global()), | 88 CHECK_EQ(ToScriptWrappable(context->Global()), |
89 ToScriptWrappable( | 89 ToScriptWrappable( |
90 context->Global()->GetPrototype().As<v8::Object>())); | 90 context->Global()->GetPrototype().As<v8::Object>())); |
91 global_proxy_.Get().SetWrapperClassId(0); | 91 global_proxy_.Get().SetWrapperClassId(0); |
92 } | 92 } |
93 V8DOMWrapper::ClearNativeInfo(GetIsolate(), context->Global()); | 93 V8DOMWrapper::ClearNativeInfo(GetIsolate(), context->Global()); |
94 script_state_->DetachGlobalObject(); | 94 script_state_->DetachGlobalObject(); |
95 | 95 |
96 #if DCHECK_IS_ON() | 96 #if DCHECK_IS_ON() || DVLOG_IS_ON() |
97 DidDetachGlobalObject(); | 97 DidDetachGlobalObject(); |
98 #endif | 98 #endif |
99 } | 99 } |
100 | 100 |
101 script_state_->DisposePerContextData(); | 101 script_state_->DisposePerContextData(); |
102 | 102 |
103 // It's likely that disposing the context has created a lot of | 103 // It's likely that disposing the context has created a lot of |
104 // garbage. Notify V8 about this so it'll have a chance of cleaning | 104 // garbage. Notify V8 about this so it'll have a chance of cleaning |
105 // it up when idle. | 105 // it up when idle. |
106 V8GCForContextDispose::Instance().NotifyContextDisposed( | 106 V8GCForContextDispose::Instance().NotifyContextDisposed( |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 v8::Local<v8::Context> context; | 193 v8::Local<v8::Context> context; |
194 { | 194 { |
195 V8PerIsolateData::UseCounterDisabledScope use_counter_disabled( | 195 V8PerIsolateData::UseCounterDisabledScope use_counter_disabled( |
196 V8PerIsolateData::From(GetIsolate())); | 196 V8PerIsolateData::From(GetIsolate())); |
197 context = | 197 context = |
198 v8::Context::New(GetIsolate(), &extension_configuration, | 198 v8::Context::New(GetIsolate(), &extension_configuration, |
199 global_template, global_proxy_.NewLocal(GetIsolate())); | 199 global_template, global_proxy_.NewLocal(GetIsolate())); |
200 } | 200 } |
201 CHECK(!context.IsEmpty()); | 201 CHECK(!context.IsEmpty()); |
202 | 202 |
203 #if DCHECK_IS_ON() | 203 #if DCHECK_IS_ON() || DVLOG_IS_ON() |
204 DidAttachGlobalObject(); | 204 DidAttachGlobalObject(); |
205 #endif | 205 #endif |
206 | 206 |
207 script_state_ = ScriptState::Create(context, world_); | 207 script_state_ = ScriptState::Create(context, world_); |
208 | 208 |
209 DCHECK(lifecycle_ == Lifecycle::kContextIsUninitialized || | 209 DCHECK(lifecycle_ == Lifecycle::kContextIsUninitialized || |
210 lifecycle_ == Lifecycle::kGlobalObjectIsDetached); | 210 lifecycle_ == Lifecycle::kGlobalObjectIsDetached); |
211 lifecycle_ = Lifecycle::kContextIsInitialized; | 211 lifecycle_ = Lifecycle::kContextIsInitialized; |
212 DCHECK(script_state_->ContextIsValid()); | 212 DCHECK(script_state_->ContextIsValid()); |
213 } | 213 } |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 | 468 |
469 SetSecurityToken(origin); | 469 SetSecurityToken(origin); |
470 } | 470 } |
471 | 471 |
472 LocalWindowProxy::LocalWindowProxy(v8::Isolate* isolate, | 472 LocalWindowProxy::LocalWindowProxy(v8::Isolate* isolate, |
473 LocalFrame& frame, | 473 LocalFrame& frame, |
474 RefPtr<DOMWrapperWorld> world) | 474 RefPtr<DOMWrapperWorld> world) |
475 : WindowProxy(isolate, frame, std::move(world)) {} | 475 : WindowProxy(isolate, frame, std::move(world)) {} |
476 | 476 |
477 } // namespace blink | 477 } // namespace blink |
OLD | NEW |