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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 if (!installDOMWindow()) { | 235 if (!installDOMWindow()) { |
236 disposeContext(DoNotDetachGlobal); | 236 disposeContext(DoNotDetachGlobal); |
237 return false; | 237 return false; |
238 } | 238 } |
239 | 239 |
240 if (isMainWorld) { | 240 if (isMainWorld) { |
241 updateDocument(); | 241 updateDocument(); |
242 if (m_frame->document()) { | 242 if (m_frame->document()) { |
243 setSecurityToken(m_frame->document()->securityOrigin()); | 243 setSecurityToken(m_frame->document()->securityOrigin()); |
244 ContentSecurityPolicy* csp = m_frame->document()->contentSecurityPol
icy(); | 244 ContentSecurityPolicy* csp = m_frame->document()->contentSecurityPol
icy(); |
245 context->AllowCodeGenerationFromStrings(csp->allowScriptEval(0, Cont
entSecurityPolicy::SuppressReport)); | 245 context->AllowCodeGenerationFromStrings(csp->allowEval(0, ContentSec
urityPolicy::SuppressReport)); |
246 context->SetErrorMessageForCodeGenerationFromStrings(v8String(m_isol
ate, csp->evalDisabledErrorMessage())); | 246 context->SetErrorMessageForCodeGenerationFromStrings(v8String(m_isol
ate, csp->evalDisabledErrorMessage())); |
247 } | 247 } |
248 } else { | 248 } else { |
249 // Using the default security token means that the canAccess is always | 249 // Using the default security token means that the canAccess is always |
250 // called, which is slow. | 250 // called, which is slow. |
251 // FIXME: Use tokens where possible. This will mean keeping track of all | 251 // FIXME: Use tokens where possible. This will mean keeping track of all |
252 // created contexts so that they can all be updated when the | 252 // created contexts so that they can all be updated when the |
253 // document domain | 253 // document domain |
254 // changes. | 254 // changes. |
255 context->UseDefaultSecurityToken(); | 255 context->UseDefaultSecurityToken(); |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 if (!isMainThread()) | 517 if (!isMainThread()) |
518 return true; | 518 return true; |
519 // We're initializing the context, so it is not yet in a status where we can | 519 // We're initializing the context, so it is not yet in a status where we can |
520 // validate the context. | 520 // validate the context. |
521 if (contextBeingInitialized) | 521 if (contextBeingInitialized) |
522 return true; | 522 return true; |
523 return !!toDOMWindow(context); | 523 return !!toDOMWindow(context); |
524 } | 524 } |
525 | 525 |
526 } // WebCore | 526 } // WebCore |
OLD | NEW |