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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 WindowProxy::WindowProxy(v8::Isolate* isolate, | 55 WindowProxy::WindowProxy(v8::Isolate* isolate, |
56 Frame& frame, | 56 Frame& frame, |
57 RefPtr<DOMWrapperWorld> world) | 57 RefPtr<DOMWrapperWorld> world) |
58 : isolate_(isolate), | 58 : isolate_(isolate), |
59 frame_(frame), | 59 frame_(frame), |
60 | 60 |
61 world_(std::move(world)), | 61 world_(std::move(world)), |
62 lifecycle_(Lifecycle::kContextIsUninitialized) {} | 62 lifecycle_(Lifecycle::kContextIsUninitialized) {} |
63 | 63 |
64 void WindowProxy::ClearForClose() { | 64 void WindowProxy::ClearForClose() { |
65 DisposeContext(kDoNotDetachGlobal); | 65 DisposeContext(Lifecycle::kFrameIsDetached); |
66 } | 66 } |
67 | 67 |
68 void WindowProxy::ClearForNavigation() { | 68 void WindowProxy::ClearForNavigation() { |
69 DisposeContext(kDetachGlobal); | 69 DisposeContext(Lifecycle::kGlobalObjectIsDetached); |
70 } | 70 } |
71 | 71 |
72 v8::Local<v8::Object> WindowProxy::GlobalProxyIfNotDetached() { | 72 v8::Local<v8::Object> WindowProxy::GlobalProxyIfNotDetached() { |
73 if (lifecycle_ == Lifecycle::kContextIsInitialized) { | 73 if (lifecycle_ == Lifecycle::kContextIsInitialized) { |
74 DLOG_IF(FATAL, !is_global_object_attached_) | 74 DLOG_IF(FATAL, !is_global_object_attached_) |
75 << "Context is initialized but global object is detached!"; | 75 << "Context is initialized but global object is detached!"; |
76 return global_proxy_.NewLocal(isolate_); | 76 return global_proxy_.NewLocal(isolate_); |
77 } | 77 } |
78 return v8::Local<v8::Object>(); | 78 return v8::Local<v8::Object>(); |
79 } | 79 } |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 wrapper)) { | 157 wrapper)) { |
158 wrapper_type_info->WrapperCreated(); | 158 wrapper_type_info->WrapperCreated(); |
159 V8DOMWrapper::SetNativeInfo(isolate_, wrapper, wrapper_type_info, window); | 159 V8DOMWrapper::SetNativeInfo(isolate_, wrapper, wrapper_type_info, window); |
160 DCHECK(V8DOMWrapper::HasInternalFieldsSet(wrapper)); | 160 DCHECK(V8DOMWrapper::HasInternalFieldsSet(wrapper)); |
161 } | 161 } |
162 SECURITY_CHECK(ToScriptWrappable(wrapper) == window); | 162 SECURITY_CHECK(ToScriptWrappable(wrapper) == window); |
163 return wrapper; | 163 return wrapper; |
164 } | 164 } |
165 | 165 |
166 } // namespace blink | 166 } // namespace blink |
OLD | NEW |