| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 if (context.IsEmpty()) | 100 if (context.IsEmpty()) |
| 101 return; | 101 return; |
| 102 | 102 |
| 103 V8HiddenValue::setHiddenValue(info.GetIsolate(), context->Global(), V8Hidden
Value::event(info.GetIsolate()), value); | 103 V8HiddenValue::setHiddenValue(info.GetIsolate(), context->Global(), V8Hidden
Value::event(info.GetIsolate()), value); |
| 104 } | 104 } |
| 105 | 105 |
| 106 void V8Window::frameElementAttributeGetterCustom(const v8::PropertyCallbackInfo<
v8::Value>& info) | 106 void V8Window::frameElementAttributeGetterCustom(const v8::PropertyCallbackInfo<
v8::Value>& info) |
| 107 { | 107 { |
| 108 LocalDOMWindow* impl = toLocalDOMWindow(V8Window::toImpl(info.Holder())); | 108 LocalDOMWindow* impl = toLocalDOMWindow(V8Window::toImpl(info.Holder())); |
| 109 ExceptionState exceptionState(ExceptionState::GetterContext, "frame", "Windo
w", info.Holder(), info.GetIsolate()); | 109 ExceptionState exceptionState(ExceptionState::GetterContext, "frame", "Windo
w", info.Holder(), info.GetIsolate()); |
| 110 if (!BindingSecurity::shouldAllowAccessToNode(info.GetIsolate(), impl->frame
Element(), exceptionState)) { | 110 |
| 111 // Do the security check against the parent frame rather than |
| 112 // frameElement() itself, so that a remote parent frame can be handled |
| 113 // properly. In that case, there's no frameElement(), yet we should still |
| 114 // throw a proper exception and deny access. |
| 115 Frame* target = impl->frame() ? impl->frame()->tree().parent() : nullptr; |
| 116 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), target, ex
ceptionState)) { |
| 111 v8SetReturnValueNull(info); | 117 v8SetReturnValueNull(info); |
| 112 exceptionState.throwIfNeeded(); | 118 exceptionState.throwIfNeeded(); |
| 113 return; | 119 return; |
| 114 } | 120 } |
| 115 | 121 |
| 116 // The wrapper for an <iframe> should get its prototype from the context of
the frame it's in, rather than its own frame. | 122 // The wrapper for an <iframe> should get its prototype from the context of
the frame it's in, rather than its own frame. |
| 117 // So, use its containing document as the creation context when wrapping. | 123 // So, use its containing document as the creation context when wrapping. |
| 118 v8::Local<v8::Value> creationContext = toV8(&impl->frameElement()->document(
), info.Holder(), info.GetIsolate()); | 124 v8::Local<v8::Value> creationContext = toV8(&impl->frameElement()->document(
), info.Holder(), info.GetIsolate()); |
| 119 RELEASE_ASSERT(!creationContext.IsEmpty()); | 125 RELEASE_ASSERT(!creationContext.IsEmpty()); |
| 120 v8::Local<v8::Value> wrapper = toV8(impl->frameElement(), v8::Local<v8::Obje
ct>::Cast(creationContext), info.GetIsolate()); | 126 v8::Local<v8::Value> wrapper = toV8(impl->frameElement(), v8::Local<v8::Obje
ct>::Cast(creationContext), info.GetIsolate()); |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 { | 345 { |
| 340 return securityCheck(host); | 346 return securityCheck(host); |
| 341 } | 347 } |
| 342 | 348 |
| 343 bool V8Window::indexedSecurityCheckCustom(v8::Local<v8::Object> host, uint32_t i
ndex, v8::AccessType type, v8::Local<v8::Value>) | 349 bool V8Window::indexedSecurityCheckCustom(v8::Local<v8::Object> host, uint32_t i
ndex, v8::AccessType type, v8::Local<v8::Value>) |
| 344 { | 350 { |
| 345 return securityCheck(host); | 351 return securityCheck(host); |
| 346 } | 352 } |
| 347 | 353 |
| 348 } // namespace blink | 354 } // namespace blink |
| OLD | NEW |