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 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
453 token = frameSecurityToken + token; | 453 token = frameSecurityToken + token; |
454 } | 454 } |
455 | 455 |
456 // NOTE: V8 does identity comparison in fast path, must use a symbol | 456 // NOTE: V8 does identity comparison in fast path, must use a symbol |
457 // as the security token. | 457 // as the security token. |
458 context->SetSecurityToken(v8AtomicString(m_isolate, token)); | 458 context->SetSecurityToken(v8AtomicString(m_isolate, token)); |
459 } | 459 } |
460 | 460 |
461 void WindowProxy::updateDocument() { | 461 void WindowProxy::updateDocument() { |
462 DCHECK(m_world->isMainWorld()); | 462 DCHECK(m_world->isMainWorld()); |
463 // TODO(haraken): Replace this with a better check once we introduce | |
464 // a lifecycle model for WindowProxy. This is checking if the context | |
465 // is not yet detached. | |
466 DCHECK(!m_scriptState || isContextInitialized()); | |
Yuki
2017/01/05 13:21:26
I think it's worth commenting that we can defer up
haraken
2017/01/05 23:46:19
Done.
| |
463 if (!isContextInitialized()) | 467 if (!isContextInitialized()) |
464 return; | 468 return; |
465 | 469 |
466 updateActivityLogger(); | 470 updateActivityLogger(); |
467 updateDocumentProperty(); | 471 updateDocumentProperty(); |
468 updateSecurityOrigin(m_frame->securityContext()->getSecurityOrigin()); | 472 updateSecurityOrigin(m_frame->securityContext()->getSecurityOrigin()); |
469 } | 473 } |
470 | 474 |
471 static v8::Local<v8::Value> getNamedProperty( | 475 static v8::Local<v8::Value> getNamedProperty( |
472 HTMLDocument* htmlDocument, | 476 HTMLDocument* htmlDocument, |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
550 .ToChecked(); | 554 .ToChecked(); |
551 } | 555 } |
552 | 556 |
553 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) { | 557 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) { |
554 if (!isContextInitialized()) | 558 if (!isContextInitialized()) |
555 return; | 559 return; |
556 setSecurityToken(origin); | 560 setSecurityToken(origin); |
557 } | 561 } |
558 | 562 |
559 } // namespace blink | 563 } // namespace blink |
OLD | NEW |