| 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 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 #include "RuntimeEnabledFeatures.h" | 34 #include "RuntimeEnabledFeatures.h" |
| 35 #include "V8Document.h" | 35 #include "V8Document.h" |
| 36 #include "V8HTMLCollection.h" | 36 #include "V8HTMLCollection.h" |
| 37 #include "V8HTMLDocument.h" | 37 #include "V8HTMLDocument.h" |
| 38 #include "V8Window.h" | 38 #include "V8Window.h" |
| 39 #include "bindings/v8/DOMWrapperWorld.h" | 39 #include "bindings/v8/DOMWrapperWorld.h" |
| 40 #include "bindings/v8/ScriptController.h" | 40 #include "bindings/v8/ScriptController.h" |
| 41 #include "bindings/v8/V8Binding.h" | 41 #include "bindings/v8/V8Binding.h" |
| 42 #include "bindings/v8/V8GCForContextDispose.h" | 42 #include "bindings/v8/V8GCForContextDispose.h" |
| 43 #include "bindings/v8/V8HiddenPropertyName.h" | |
| 44 #include "bindings/v8/V8Initializer.h" | 43 #include "bindings/v8/V8Initializer.h" |
| 45 #include "bindings/v8/V8ObjectConstructor.h" | 44 #include "bindings/v8/V8ObjectConstructor.h" |
| 46 #include "bindings/v8/V8PerContextData.h" | 45 #include "bindings/v8/V8PerContextData.h" |
| 47 #include "core/html/HTMLCollection.h" | 46 #include "core/html/HTMLCollection.h" |
| 48 #include "core/html/HTMLIFrameElement.h" | 47 #include "core/html/HTMLIFrameElement.h" |
| 49 #include "core/inspector/InspectorInstrumentation.h" | 48 #include "core/inspector/InspectorInstrumentation.h" |
| 50 #include "core/loader/DocumentLoader.h" | 49 #include "core/loader/DocumentLoader.h" |
| 51 #include "core/loader/FrameLoader.h" | 50 #include "core/loader/FrameLoader.h" |
| 52 #include "core/loader/FrameLoaderClient.h" | 51 #include "core/loader/FrameLoaderClient.h" |
| 53 #include "core/frame/ContentSecurityPolicy.h" | 52 #include "core/frame/ContentSecurityPolicy.h" |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 if (documentWrapper.IsEmpty()) { | 357 if (documentWrapper.IsEmpty()) { |
| 359 clearDocumentProperty(); | 358 clearDocumentProperty(); |
| 360 return; | 359 return; |
| 361 } | 360 } |
| 362 ASSERT(documentWrapper->IsObject()); | 361 ASSERT(documentWrapper->IsObject()); |
| 363 context->Global()->ForceSet(v8AtomicString(m_isolate, "document"), documentW
rapper, static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontDelete)); | 362 context->Global()->ForceSet(v8AtomicString(m_isolate, "document"), documentW
rapper, static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontDelete)); |
| 364 | 363 |
| 365 // We also stash a reference to the document on the inner global object so t
hat | 364 // We also stash a reference to the document on the inner global object so t
hat |
| 366 // DOMWindow objects we obtain from JavaScript references are guaranteed to
have | 365 // DOMWindow objects we obtain from JavaScript references are guaranteed to
have |
| 367 // live Document objects. | 366 // live Document objects. |
| 368 toInnerGlobalObject(context)->SetHiddenValue(V8HiddenPropertyName::document(
m_isolate), documentWrapper); | 367 setHiddenValue(m_isolate, toInnerGlobalObject(context), "document", document
Wrapper); |
| 369 } | 368 } |
| 370 | 369 |
| 371 void V8WindowShell::clearDocumentProperty() | 370 void V8WindowShell::clearDocumentProperty() |
| 372 { | 371 { |
| 373 ASSERT(m_contextHolder); | 372 ASSERT(m_contextHolder); |
| 374 if (!m_world->isMainWorld()) | 373 if (!m_world->isMainWorld()) |
| 375 return; | 374 return; |
| 376 v8::HandleScope handleScope(m_isolate); | 375 v8::HandleScope handleScope(m_isolate); |
| 377 m_contextHolder->context()->Global()->ForceDelete(v8AtomicString(m_isolate,
"document")); | 376 m_contextHolder->context()->Global()->ForceDelete(v8AtomicString(m_isolate,
"document")); |
| 378 } | 377 } |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 void V8WindowShell::updateSecurityOrigin(SecurityOrigin* origin) | 495 void V8WindowShell::updateSecurityOrigin(SecurityOrigin* origin) |
| 497 { | 496 { |
| 498 ASSERT(m_world->isMainWorld()); | 497 ASSERT(m_world->isMainWorld()); |
| 499 if (!m_contextHolder) | 498 if (!m_contextHolder) |
| 500 return; | 499 return; |
| 501 v8::HandleScope handleScope(m_isolate); | 500 v8::HandleScope handleScope(m_isolate); |
| 502 setSecurityToken(origin); | 501 setSecurityToken(origin); |
| 503 } | 502 } |
| 504 | 503 |
| 505 } // WebCore | 504 } // WebCore |
| OLD | NEW |