| 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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 disposeContext(); | 239 disposeContext(); |
| 240 return false; | 240 return false; |
| 241 } | 241 } |
| 242 | 242 |
| 243 if (isMainWorld) { | 243 if (isMainWorld) { |
| 244 updateDocument(); | 244 updateDocument(); |
| 245 setSecurityToken(); | 245 setSecurityToken(); |
| 246 if (m_frame->document()) { | 246 if (m_frame->document()) { |
| 247 ContentSecurityPolicy* csp = m_frame->document()->contentSecurityPol
icy(); | 247 ContentSecurityPolicy* csp = m_frame->document()->contentSecurityPol
icy(); |
| 248 context->AllowCodeGenerationFromStrings(csp->allowEval(0, ContentSec
urityPolicy::SuppressReport)); | 248 context->AllowCodeGenerationFromStrings(csp->allowEval(0, ContentSec
urityPolicy::SuppressReport)); |
| 249 context->SetErrorMessageForCodeGenerationFromStrings(v8String(csp->e
valDisabledErrorMessage(), m_isolate)); | 249 context->SetErrorMessageForCodeGenerationFromStrings(deprecatedV8Str
ing(csp->evalDisabledErrorMessage())); |
| 250 } | 250 } |
| 251 } else { | 251 } else { |
| 252 // Using the default security token means that the canAccess is always | 252 // Using the default security token means that the canAccess is always |
| 253 // called, which is slow. | 253 // called, which is slow. |
| 254 // FIXME: Use tokens where possible. This will mean keeping track of all | 254 // FIXME: Use tokens where possible. This will mean keeping track of all |
| 255 // created contexts so that they can all be updated when the | 255 // created contexts so that they can all be updated when the |
| 256 // document domain | 256 // document domain |
| 257 // changes. | 257 // changes. |
| 258 m_context->UseDefaultSecurityToken(); | 258 m_context->UseDefaultSecurityToken(); |
| 259 | 259 |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 ASSERT(m_world->isMainWorld()); | 446 ASSERT(m_world->isMainWorld()); |
| 447 | 447 |
| 448 if (m_context.isEmpty()) | 448 if (m_context.isEmpty()) |
| 449 return; | 449 return; |
| 450 | 450 |
| 451 v8::HandleScope handleScope; | 451 v8::HandleScope handleScope; |
| 452 v8::Context::Scope contextScope(m_context.get()); | 452 v8::Context::Scope contextScope(m_context.get()); |
| 453 | 453 |
| 454 ASSERT(!m_document.isEmpty()); | 454 ASSERT(!m_document.isEmpty()); |
| 455 checkDocumentWrapper(m_document.get(), document); | 455 checkDocumentWrapper(m_document.get(), document); |
| 456 m_document->SetAccessor(v8String(name, m_isolate), getter); | 456 m_document->SetAccessor(deprecatedV8String(name), getter); |
| 457 } | 457 } |
| 458 | 458 |
| 459 void V8DOMWindowShell::namedItemRemoved(HTMLDocument* document, const AtomicStri
ng& name) | 459 void V8DOMWindowShell::namedItemRemoved(HTMLDocument* document, const AtomicStri
ng& name) |
| 460 { | 460 { |
| 461 ASSERT(m_world->isMainWorld()); | 461 ASSERT(m_world->isMainWorld()); |
| 462 | 462 |
| 463 if (m_context.isEmpty()) | 463 if (m_context.isEmpty()) |
| 464 return; | 464 return; |
| 465 | 465 |
| 466 if (document->hasNamedItem(name.impl()) || document->hasExtraNamedItem(name.
impl())) | 466 if (document->hasNamedItem(name.impl()) || document->hasExtraNamedItem(name.
impl())) |
| 467 return; | 467 return; |
| 468 | 468 |
| 469 v8::HandleScope handleScope; | 469 v8::HandleScope handleScope; |
| 470 v8::Context::Scope contextScope(m_context.get()); | 470 v8::Context::Scope contextScope(m_context.get()); |
| 471 | 471 |
| 472 ASSERT(!m_document.isEmpty()); | 472 ASSERT(!m_document.isEmpty()); |
| 473 checkDocumentWrapper(m_document.get(), document); | 473 checkDocumentWrapper(m_document.get(), document); |
| 474 m_document->Delete(v8String(name, m_isolate)); | 474 m_document->Delete(deprecatedV8String(name)); |
| 475 } | 475 } |
| 476 | 476 |
| 477 void V8DOMWindowShell::updateSecurityOrigin() | 477 void V8DOMWindowShell::updateSecurityOrigin() |
| 478 { | 478 { |
| 479 ASSERT(m_world->isMainWorld()); | 479 ASSERT(m_world->isMainWorld()); |
| 480 if (m_context.isEmpty()) | 480 if (m_context.isEmpty()) |
| 481 return; | 481 return; |
| 482 v8::HandleScope handleScope; | 482 v8::HandleScope handleScope; |
| 483 setSecurityToken(); | 483 setSecurityToken(); |
| 484 } | 484 } |
| 485 | 485 |
| 486 } // WebCore | 486 } // WebCore |
| OLD | NEW |