| 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 { | 103 { |
| 104 if (!isContextInitialized()) | 104 if (!isContextInitialized()) |
| 105 return; | 105 return; |
| 106 | 106 |
| 107 v8::HandleScope handleScope(m_isolate); | 107 v8::HandleScope handleScope(m_isolate); |
| 108 v8::Local<v8::Context> context = m_scriptState->context(); | 108 v8::Local<v8::Context> context = m_scriptState->context(); |
| 109 if (m_frame->isLocalFrame()) { | 109 if (m_frame->isLocalFrame()) { |
| 110 LocalFrame* frame = toLocalFrame(m_frame); | 110 LocalFrame* frame = toLocalFrame(m_frame); |
| 111 // The embedder could run arbitrary code in response to the willReleaseS
criptContext callback, so all disposing should happen after it returns. | 111 // The embedder could run arbitrary code in response to the willReleaseS
criptContext callback, so all disposing should happen after it returns. |
| 112 frame->loader().client()->willReleaseScriptContext(context, m_world->wor
ldId()); | 112 frame->loader().client()->willReleaseScriptContext(context, m_world->wor
ldId()); |
| 113 MainThreadDebugger::contextWillBeDestroyed(m_scriptState.get()); | 113 MainThreadDebugger::instance()->contextWillBeDestroyed(m_scriptState.get
()); |
| 114 } | 114 } |
| 115 | 115 |
| 116 m_document.clear(); | 116 m_document.clear(); |
| 117 | 117 |
| 118 if (behavior == DetachGlobal) | 118 if (behavior == DetachGlobal) |
| 119 m_scriptState->detachGlobalObject(); | 119 m_scriptState->detachGlobalObject(); |
| 120 | 120 |
| 121 m_scriptState->disposePerContextData(); | 121 m_scriptState->disposePerContextData(); |
| 122 | 122 |
| 123 // It's likely that disposing the context has created a lot of | 123 // It's likely that disposing the context has created a lot of |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 ContentSecurityPolicy* csp = m_frame->securityContext()->contentSecurity
Policy(); | 262 ContentSecurityPolicy* csp = m_frame->securityContext()->contentSecurity
Policy(); |
| 263 context->AllowCodeGenerationFromStrings(csp->allowEval(0, ContentSecurit
yPolicy::SuppressReport)); | 263 context->AllowCodeGenerationFromStrings(csp->allowEval(0, ContentSecurit
yPolicy::SuppressReport)); |
| 264 context->SetErrorMessageForCodeGenerationFromStrings(v8String(m_isolate,
csp->evalDisabledErrorMessage())); | 264 context->SetErrorMessageForCodeGenerationFromStrings(v8String(m_isolate,
csp->evalDisabledErrorMessage())); |
| 265 } else { | 265 } else { |
| 266 updateActivityLogger(); | 266 updateActivityLogger(); |
| 267 origin = m_world->isolatedWorldSecurityOrigin(); | 267 origin = m_world->isolatedWorldSecurityOrigin(); |
| 268 setSecurityToken(origin); | 268 setSecurityToken(origin); |
| 269 } | 269 } |
| 270 if (m_frame->isLocalFrame()) { | 270 if (m_frame->isLocalFrame()) { |
| 271 LocalFrame* frame = toLocalFrame(m_frame); | 271 LocalFrame* frame = toLocalFrame(m_frame); |
| 272 MainThreadDebugger::contextCreated(m_scriptState.get(), frame, origin); | 272 MainThreadDebugger::instance()->contextCreated(m_scriptState.get(), fram
e, origin); |
| 273 frame->loader().client()->didCreateScriptContext(context, m_world->exten
sionGroup(), m_world->worldId()); | 273 frame->loader().client()->didCreateScriptContext(context, m_world->exten
sionGroup(), m_world->worldId()); |
| 274 } | 274 } |
| 275 return true; | 275 return true; |
| 276 } | 276 } |
| 277 | 277 |
| 278 namespace { | 278 namespace { |
| 279 | 279 |
| 280 void configureInnerGlobalObjectTemplate(v8::Local<v8::ObjectTemplate> templ, v8:
:Isolate* isolate) | 280 void configureInnerGlobalObjectTemplate(v8::Local<v8::ObjectTemplate> templ, v8:
:Isolate* isolate) |
| 281 { | 281 { |
| 282 // Install a security handler with V8. | 282 // Install a security handler with V8. |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 } | 579 } |
| 580 | 580 |
| 581 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) | 581 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) |
| 582 { | 582 { |
| 583 if (!isContextInitialized()) | 583 if (!isContextInitialized()) |
| 584 return; | 584 return; |
| 585 setSecurityToken(origin); | 585 setSecurityToken(origin); |
| 586 } | 586 } |
| 587 | 587 |
| 588 } // namespace blink | 588 } // namespace blink |
| OLD | NEW |