| 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 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 LocalFrame* frame = toLocalFrame(m_frame); | 421 LocalFrame* frame = toLocalFrame(m_frame); |
| 422 v8::Local<v8::Value> documentWrapper = toV8(frame->document(), context->Glob
al(), context->GetIsolate()); | 422 v8::Local<v8::Value> documentWrapper = toV8(frame->document(), context->Glob
al(), context->GetIsolate()); |
| 423 if (documentWrapper.IsEmpty()) | 423 if (documentWrapper.IsEmpty()) |
| 424 return; | 424 return; |
| 425 ASSERT(documentWrapper == m_document.newLocal(m_isolate) || m_document.isEmp
ty()); | 425 ASSERT(documentWrapper == m_document.newLocal(m_isolate) || m_document.isEmp
ty()); |
| 426 if (m_document.isEmpty()) | 426 if (m_document.isEmpty()) |
| 427 updateDocumentWrapper(v8::Local<v8::Object>::Cast(documentWrapper)); | 427 updateDocumentWrapper(v8::Local<v8::Object>::Cast(documentWrapper)); |
| 428 checkDocumentWrapper(m_document.newLocal(m_isolate), frame->document()); | 428 checkDocumentWrapper(m_document.newLocal(m_isolate), frame->document()); |
| 429 | 429 |
| 430 ASSERT(documentWrapper->IsObject()); | 430 ASSERT(documentWrapper->IsObject()); |
| 431 if (!v8CallBoolean(context->Global()->DefineOwnProperty(context, v8AtomicStr
ing(m_isolate, "document"), documentWrapper, static_cast<v8::PropertyAttribute>(
v8::ReadOnly | v8::DontDelete)))) | 431 // 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. |
| 432 if (!v8CallBoolean(context->Global()->ForceSet(context, v8AtomicString(m_iso
late, "document"), documentWrapper, static_cast<v8::PropertyAttribute>(v8::ReadO
nly | v8::DontDelete)))) |
| 432 return; | 433 return; |
| 433 | 434 |
| 434 // We also stash a reference to the document on the inner global object so t
hat | 435 // We also stash a reference to the document on the inner global object so t
hat |
| 435 // LocalDOMWindow objects we obtain from JavaScript references are guarantee
d to have | 436 // LocalDOMWindow objects we obtain from JavaScript references are guarantee
d to have |
| 436 // live Document objects. | 437 // live Document objects. |
| 437 V8HiddenValue::setHiddenValue(m_scriptState.get(), toInnerGlobalObject(conte
xt), V8HiddenValue::document(m_isolate), documentWrapper); | 438 V8HiddenValue::setHiddenValue(m_scriptState.get(), toInnerGlobalObject(conte
xt), V8HiddenValue::document(m_isolate), documentWrapper); |
| 438 } | 439 } |
| 439 | 440 |
| 440 void WindowProxy::updateActivityLogger() | 441 void WindowProxy::updateActivityLogger() |
| 441 { | 442 { |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 } | 579 } |
| 579 | 580 |
| 580 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) | 581 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) |
| 581 { | 582 { |
| 582 if (!isContextInitialized()) | 583 if (!isContextInitialized()) |
| 583 return; | 584 return; |
| 584 setSecurityToken(origin); | 585 setSecurityToken(origin); |
| 585 } | 586 } |
| 586 | 587 |
| 587 } // namespace blink | 588 } // namespace blink |
| OLD | NEW |