| 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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 return; | 404 return; |
| 405 ASSERT(documentWrapper == m_document.newLocal(m_isolate) || m_document.isEmp
ty()); | 405 ASSERT(documentWrapper == m_document.newLocal(m_isolate) || m_document.isEmp
ty()); |
| 406 if (m_document.isEmpty()) | 406 if (m_document.isEmpty()) |
| 407 updateDocumentWrapper(v8::Local<v8::Object>::Cast(documentWrapper)); | 407 updateDocumentWrapper(v8::Local<v8::Object>::Cast(documentWrapper)); |
| 408 checkDocumentWrapper(m_document.newLocal(m_isolate), frame->document()); | 408 checkDocumentWrapper(m_document.newLocal(m_isolate), frame->document()); |
| 409 | 409 |
| 410 ASSERT(documentWrapper->IsObject()); | 410 ASSERT(documentWrapper->IsObject()); |
| 411 // 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. | 411 // 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. |
| 412 if (!v8CallBoolean(context->Global()->ForceSet(context, v8AtomicString(m_iso
late, "document"), documentWrapper, static_cast<v8::PropertyAttribute>(v8::ReadO
nly | v8::DontDelete)))) | 412 if (!v8CallBoolean(context->Global()->ForceSet(context, v8AtomicString(m_iso
late, "document"), documentWrapper, static_cast<v8::PropertyAttribute>(v8::ReadO
nly | v8::DontDelete)))) |
| 413 return; | 413 return; |
| 414 | |
| 415 // We also stash a reference to the document on the inner global object so t
hat | |
| 416 // LocalDOMWindow objects we obtain from JavaScript references are guarantee
d to have | |
| 417 // live Document objects. | |
| 418 V8HiddenValue::setHiddenValue(m_scriptState.get(), v8::Local<v8::Object>::Ca
st(context->Global()->GetPrototype()), V8HiddenValue::document(m_isolate), docum
entWrapper); | |
| 419 } | 414 } |
| 420 | 415 |
| 421 void WindowProxy::updateActivityLogger() | 416 void WindowProxy::updateActivityLogger() |
| 422 { | 417 { |
| 423 m_scriptState->perContextData()->setActivityLogger(V8DOMActivityLogger::acti
vityLogger( | 418 m_scriptState->perContextData()->setActivityLogger(V8DOMActivityLogger::acti
vityLogger( |
| 424 m_world->worldId(), m_frame->isLocalFrame() && toLocalFrame(m_frame)->do
cument() ? toLocalFrame(m_frame)->document()->baseURI() : KURL())); | 419 m_world->worldId(), m_frame->isLocalFrame() && toLocalFrame(m_frame)->do
cument() ? toLocalFrame(m_frame)->document()->baseURI() : KURL())); |
| 425 } | 420 } |
| 426 | 421 |
| 427 void WindowProxy::setSecurityToken(SecurityOrigin* origin) | 422 void WindowProxy::setSecurityToken(SecurityOrigin* origin) |
| 428 { | 423 { |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 } | 553 } |
| 559 | 554 |
| 560 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) | 555 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) |
| 561 { | 556 { |
| 562 if (!isContextInitialized()) | 557 if (!isContextInitialized()) |
| 563 return; | 558 return; |
| 564 setSecurityToken(origin); | 559 setSecurityToken(origin); |
| 565 } | 560 } |
| 566 | 561 |
| 567 } // namespace blink | 562 } // namespace blink |
| OLD | NEW |