| 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 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 v8::Local<v8::Context> context = m_scriptState->context(); | 391 v8::Local<v8::Context> context = m_scriptState->context(); |
| 392 LocalFrame* frame = toLocalFrame(m_frame); | 392 LocalFrame* frame = toLocalFrame(m_frame); |
| 393 v8::Local<v8::Value> documentWrapper = toV8(frame->document(), context->Glob
al(), context->GetIsolate()); | 393 v8::Local<v8::Value> documentWrapper = toV8(frame->document(), context->Glob
al(), context->GetIsolate()); |
| 394 if (documentWrapper.IsEmpty()) | 394 if (documentWrapper.IsEmpty()) |
| 395 return; | 395 return; |
| 396 ASSERT(documentWrapper == m_document.newLocal(m_isolate) || m_document.isEmp
ty()); | 396 ASSERT(documentWrapper == m_document.newLocal(m_isolate) || m_document.isEmp
ty()); |
| 397 if (m_document.isEmpty()) | 397 if (m_document.isEmpty()) |
| 398 updateDocumentWrapper(v8::Local<v8::Object>::Cast(documentWrapper)); | 398 updateDocumentWrapper(v8::Local<v8::Object>::Cast(documentWrapper)); |
| 399 checkDocumentWrapper(m_document.newLocal(m_isolate), frame->document()); | 399 checkDocumentWrapper(m_document.newLocal(m_isolate), frame->document()); |
| 400 | 400 |
| 401 ASSERT(documentWrapper->IsObject()); | |
| 402 // 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. | |
| 403 if (!v8CallBoolean(context->Global()->ForceSet(context, v8AtomicString(m_iso
late, "document"), documentWrapper, static_cast<v8::PropertyAttribute>(v8::ReadO
nly | v8::DontDelete)))) | |
| 404 return; | |
| 405 | |
| 406 // We also stash a reference to the document on the inner global object so t
hat | 401 // We also stash a reference to the document on the inner global object so t
hat |
| 407 // LocalDOMWindow objects we obtain from JavaScript references are guarantee
d to have | 402 // LocalDOMWindow objects we obtain from JavaScript references are guarantee
d to have |
| 408 // live Document objects. | 403 // live Document objects. |
| 409 V8HiddenValue::setHiddenValue(m_scriptState.get(), v8::Local<v8::Object>::Ca
st(context->Global()->GetPrototype()), V8HiddenValue::document(m_isolate), docum
entWrapper); | 404 V8HiddenValue::setHiddenValue(m_scriptState.get(), v8::Local<v8::Object>::Ca
st(context->Global()->GetPrototype()), V8HiddenValue::document(m_isolate), docum
entWrapper); |
| 410 } | 405 } |
| 411 | 406 |
| 412 void WindowProxy::updateActivityLogger() | 407 void WindowProxy::updateActivityLogger() |
| 413 { | 408 { |
| 414 m_scriptState->perContextData()->setActivityLogger(V8DOMActivityLogger::acti
vityLogger( | 409 m_scriptState->perContextData()->setActivityLogger(V8DOMActivityLogger::acti
vityLogger( |
| 415 m_world->worldId(), m_frame->isLocalFrame() && toLocalFrame(m_frame)->do
cument() ? toLocalFrame(m_frame)->document()->baseURI() : KURL())); | 410 m_world->worldId(), m_frame->isLocalFrame() && toLocalFrame(m_frame)->do
cument() ? toLocalFrame(m_frame)->document()->baseURI() : KURL())); |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 } | 545 } |
| 551 | 546 |
| 552 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) | 547 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) |
| 553 { | 548 { |
| 554 if (!isContextInitialized()) | 549 if (!isContextInitialized()) |
| 555 return; | 550 return; |
| 556 setSecurityToken(origin); | 551 setSecurityToken(origin); |
| 557 } | 552 } |
| 558 | 553 |
| 559 } // namespace blink | 554 } // namespace blink |
| OLD | NEW |