| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009, 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 if (!BindingSecurity::shouldAllowAccessToFrame(frame, es)) { | 165 if (!BindingSecurity::shouldAllowAccessToFrame(frame, es)) { |
| 166 es.throwIfNeeded(); | 166 es.throwIfNeeded(); |
| 167 return; | 167 return; |
| 168 } | 168 } |
| 169 | 169 |
| 170 ASSERT(frame); | 170 ASSERT(frame); |
| 171 v8::Local<v8::Context> context = frame->script()->currentWorldContext(); | 171 v8::Local<v8::Context> context = frame->script()->currentWorldContext(); |
| 172 if (context.IsEmpty()) | 172 if (context.IsEmpty()) |
| 173 return; | 173 return; |
| 174 | 174 |
| 175 v8::Handle<v8::String> eventSymbol = V8HiddenPropertyName::event(); | 175 v8::Handle<v8::String> eventSymbol = V8HiddenPropertyName::event(info.GetIso
late()); |
| 176 v8::Handle<v8::Value> jsEvent = context->Global()->GetHiddenValue(eventSymbo
l); | 176 v8::Handle<v8::Value> jsEvent = context->Global()->GetHiddenValue(eventSymbo
l); |
| 177 if (jsEvent.IsEmpty()) | 177 if (jsEvent.IsEmpty()) |
| 178 return; | 178 return; |
| 179 v8SetReturnValue(info, jsEvent); | 179 v8SetReturnValue(info, jsEvent); |
| 180 } | 180 } |
| 181 | 181 |
| 182 void V8Window::eventAttributeSetterCustom(v8::Local<v8::String> name, v8::Local<
v8::Value> value, const v8::PropertyCallbackInfo<void>& info) | 182 void V8Window::eventAttributeSetterCustom(v8::Local<v8::String> name, v8::Local<
v8::Value> value, const v8::PropertyCallbackInfo<void>& info) |
| 183 { | 183 { |
| 184 v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8
Window::GetTemplate(info.GetIsolate(), worldTypeInMainThread(info.GetIsolate()))
); | 184 v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8
Window::GetTemplate(info.GetIsolate(), worldTypeInMainThread(info.GetIsolate()))
); |
| 185 if (holder.IsEmpty()) | 185 if (holder.IsEmpty()) |
| 186 return; | 186 return; |
| 187 | 187 |
| 188 Frame* frame = V8Window::toNative(holder)->frame(); | 188 Frame* frame = V8Window::toNative(holder)->frame(); |
| 189 ExceptionState es(info.GetIsolate()); | 189 ExceptionState es(info.GetIsolate()); |
| 190 if (!BindingSecurity::shouldAllowAccessToFrame(frame, es)) { | 190 if (!BindingSecurity::shouldAllowAccessToFrame(frame, es)) { |
| 191 es.throwIfNeeded(); | 191 es.throwIfNeeded(); |
| 192 return; | 192 return; |
| 193 } | 193 } |
| 194 | 194 |
| 195 ASSERT(frame); | 195 ASSERT(frame); |
| 196 v8::Local<v8::Context> context = frame->script()->currentWorldContext(); | 196 v8::Local<v8::Context> context = frame->script()->currentWorldContext(); |
| 197 if (context.IsEmpty()) | 197 if (context.IsEmpty()) |
| 198 return; | 198 return; |
| 199 | 199 |
| 200 v8::Handle<v8::String> eventSymbol = V8HiddenPropertyName::event(); | 200 v8::Handle<v8::String> eventSymbol = V8HiddenPropertyName::event(info.GetIso
late()); |
| 201 context->Global()->SetHiddenValue(eventSymbol, value); | 201 context->Global()->SetHiddenValue(eventSymbol, value); |
| 202 } | 202 } |
| 203 | 203 |
| 204 void V8Window::locationAttributeSetterCustom(v8::Local<v8::String> name, v8::Loc
al<v8::Value> value, const v8::PropertyCallbackInfo<void>& info) | 204 void V8Window::locationAttributeSetterCustom(v8::Local<v8::String> name, v8::Loc
al<v8::Value> value, const v8::PropertyCallbackInfo<void>& info) |
| 205 { | 205 { |
| 206 DOMWindow* imp = V8Window::toNative(info.Holder()); | 206 DOMWindow* imp = V8Window::toNative(info.Holder()); |
| 207 | 207 |
| 208 DOMWindow* active = activeDOMWindow(); | 208 DOMWindow* active = activeDOMWindow(); |
| 209 if (!active) | 209 if (!active) |
| 210 return; | 210 return; |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 v8::Handle<v8::Context> context = frame->script()->currentWorldContext(); | 557 v8::Handle<v8::Context> context = frame->script()->currentWorldContext(); |
| 558 if (context.IsEmpty()) | 558 if (context.IsEmpty()) |
| 559 return v8Undefined(); | 559 return v8Undefined(); |
| 560 | 560 |
| 561 v8::Handle<v8::Object> global = context->Global(); | 561 v8::Handle<v8::Object> global = context->Global(); |
| 562 ASSERT(!global.IsEmpty()); | 562 ASSERT(!global.IsEmpty()); |
| 563 return global; | 563 return global; |
| 564 } | 564 } |
| 565 | 565 |
| 566 } // namespace WebCore | 566 } // namespace WebCore |
| OLD | NEW |