| 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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 LocalFrame* frame = toLocalFrame(m_frame); | 414 LocalFrame* frame = toLocalFrame(m_frame); |
| 415 v8::Local<v8::Value> documentWrapper = toV8(frame->document(), context->Glob
al(), context->GetIsolate()); | 415 v8::Local<v8::Value> documentWrapper = toV8(frame->document(), context->Glob
al(), context->GetIsolate()); |
| 416 if (documentWrapper.IsEmpty()) | 416 if (documentWrapper.IsEmpty()) |
| 417 return; | 417 return; |
| 418 ASSERT(documentWrapper == m_document.newLocal(m_isolate) || m_document.isEmp
ty()); | 418 ASSERT(documentWrapper == m_document.newLocal(m_isolate) || m_document.isEmp
ty()); |
| 419 if (m_document.isEmpty()) | 419 if (m_document.isEmpty()) |
| 420 updateDocumentWrapper(v8::Local<v8::Object>::Cast(documentWrapper)); | 420 updateDocumentWrapper(v8::Local<v8::Object>::Cast(documentWrapper)); |
| 421 checkDocumentWrapper(m_document.newLocal(m_isolate), frame->document()); | 421 checkDocumentWrapper(m_document.newLocal(m_isolate), frame->document()); |
| 422 | 422 |
| 423 ASSERT(documentWrapper->IsObject()); | 423 ASSERT(documentWrapper->IsObject()); |
| 424 if (!v8CallBoolean(context->Global()->DefineOwnProperty(context, v8AtomicStr
ing(m_isolate, "document"), documentWrapper, static_cast<v8::PropertyAttribute>(
v8::ReadOnly | v8::DontDelete)))) | 424 // TODO(jochen): Don't replace the accessor with a data value. We need a way
to tell v8 that the accessor's return value won't change after this point. |
| 425 if (!v8CallBoolean(context->Global()->ForceSet(context, v8AtomicString(m_iso
late, "document"), documentWrapper, static_cast<v8::PropertyAttribute>(v8::ReadO
nly | v8::DontDelete)))) |
| 425 return; | 426 return; |
| 426 | 427 |
| 427 // We also stash a reference to the document on the inner global object so t
hat | 428 // We also stash a reference to the document on the inner global object so t
hat |
| 428 // LocalDOMWindow objects we obtain from JavaScript references are guarantee
d to have | 429 // LocalDOMWindow objects we obtain from JavaScript references are guarantee
d to have |
| 429 // live Document objects. | 430 // live Document objects. |
| 430 V8HiddenValue::setHiddenValue(m_scriptState.get(), toInnerGlobalObject(conte
xt), V8HiddenValue::document(m_isolate), documentWrapper); | 431 V8HiddenValue::setHiddenValue(m_scriptState.get(), toInnerGlobalObject(conte
xt), V8HiddenValue::document(m_isolate), documentWrapper); |
| 431 } | 432 } |
| 432 | 433 |
| 433 void WindowProxy::updateActivityLogger() | 434 void WindowProxy::updateActivityLogger() |
| 434 { | 435 { |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 } | 572 } |
| 572 | 573 |
| 573 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) | 574 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) |
| 574 { | 575 { |
| 575 if (!isContextInitialized()) | 576 if (!isContextInitialized()) |
| 576 return; | 577 return; |
| 577 setSecurityToken(origin); | 578 setSecurityToken(origin); |
| 578 } | 579 } |
| 579 | 580 |
| 580 } // namespace blink | 581 } // namespace blink |
| OLD | NEW |