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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 next_status == Lifecycle::kFrameIsDetached); | 54 next_status == Lifecycle::kFrameIsDetached); |
55 | 55 |
56 if (lifecycle_ != Lifecycle::kContextIsInitialized) | 56 if (lifecycle_ != Lifecycle::kContextIsInitialized) |
57 return; | 57 return; |
58 | 58 |
59 if (next_status == Lifecycle::kGlobalObjectIsDetached && | 59 if (next_status == Lifecycle::kGlobalObjectIsDetached && |
60 !global_proxy_.IsEmpty()) { | 60 !global_proxy_.IsEmpty()) { |
61 global_proxy_.Get().SetWrapperClassId(0); | 61 global_proxy_.Get().SetWrapperClassId(0); |
62 V8DOMWrapper::ClearNativeInfo(GetIsolate(), | 62 V8DOMWrapper::ClearNativeInfo(GetIsolate(), |
63 global_proxy_.NewLocal(GetIsolate())); | 63 global_proxy_.NewLocal(GetIsolate())); |
64 #if DCHECK_IS_ON() | 64 #if DCHECK_IS_ON() || DVLOG_IS_ON() |
65 DidDetachGlobalObject(); | 65 DidDetachGlobalObject(); |
66 #endif | 66 #endif |
67 } | 67 } |
68 | 68 |
69 if (next_status == Lifecycle::kFrameIsDetached) { | 69 if (next_status == Lifecycle::kFrameIsDetached) { |
70 // The context's frame is detached from the DOM, so there shouldn't be a | 70 // The context's frame is detached from the DOM, so there shouldn't be a |
71 // strong reference to the context. | 71 // strong reference to the context. |
72 global_proxy_.SetPhantom(); | 72 global_proxy_.SetPhantom(); |
73 } | 73 } |
74 | 74 |
(...skipping 26 matching lines...) Expand all Loading... |
101 v8::Local<v8::Object> global_proxy = | 101 v8::Local<v8::Object> global_proxy = |
102 v8::Context::NewRemoteContext(GetIsolate(), global_template, | 102 v8::Context::NewRemoteContext(GetIsolate(), global_template, |
103 global_proxy_.NewLocal(GetIsolate())) | 103 global_proxy_.NewLocal(GetIsolate())) |
104 .ToLocalChecked(); | 104 .ToLocalChecked(); |
105 if (global_proxy_.IsEmpty()) | 105 if (global_proxy_.IsEmpty()) |
106 global_proxy_.Set(GetIsolate(), global_proxy); | 106 global_proxy_.Set(GetIsolate(), global_proxy); |
107 else | 107 else |
108 DCHECK(global_proxy_.Get() == global_proxy); | 108 DCHECK(global_proxy_.Get() == global_proxy); |
109 CHECK(!global_proxy_.IsEmpty()); | 109 CHECK(!global_proxy_.IsEmpty()); |
110 | 110 |
111 #if DCHECK_IS_ON() | 111 #if DCHECK_IS_ON() || DVLOG_IS_ON() |
112 DidAttachGlobalObject(); | 112 DidAttachGlobalObject(); |
113 #endif | 113 #endif |
114 | 114 |
115 DCHECK(lifecycle_ == Lifecycle::kContextIsUninitialized || | 115 DCHECK(lifecycle_ == Lifecycle::kContextIsUninitialized || |
116 lifecycle_ == Lifecycle::kGlobalObjectIsDetached); | 116 lifecycle_ == Lifecycle::kGlobalObjectIsDetached); |
117 lifecycle_ = Lifecycle::kContextIsInitialized; | 117 lifecycle_ = Lifecycle::kContextIsInitialized; |
118 } | 118 } |
119 | 119 |
120 void RemoteWindowProxy::SetupWindowPrototypeChain() { | 120 void RemoteWindowProxy::SetupWindowPrototypeChain() { |
121 // Associate the window wrapper object and its prototype chain with the | 121 // Associate the window wrapper object and its prototype chain with the |
(...skipping 11 matching lines...) Expand all Loading... |
133 | 133 |
134 // The global object, aka window wrapper object. | 134 // The global object, aka window wrapper object. |
135 v8::Local<v8::Object> window_wrapper = | 135 v8::Local<v8::Object> window_wrapper = |
136 global_proxy->GetPrototype().As<v8::Object>(); | 136 global_proxy->GetPrototype().As<v8::Object>(); |
137 v8::Local<v8::Object> associated_wrapper = | 137 v8::Local<v8::Object> associated_wrapper = |
138 AssociateWithWrapper(window, wrapper_type_info, window_wrapper); | 138 AssociateWithWrapper(window, wrapper_type_info, window_wrapper); |
139 DCHECK(associated_wrapper == window_wrapper); | 139 DCHECK(associated_wrapper == window_wrapper); |
140 } | 140 } |
141 | 141 |
142 } // namespace blink | 142 } // namespace blink |
OLD | NEW |