Chromium Code Reviews| 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 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 459 // SecurityOrigin::m_domain would have been modified. | 459 // SecurityOrigin::m_domain would have been modified. |
| 460 // m_domain is not used by SecurityOrigin::toString(), so we would end | 460 // m_domain is not used by SecurityOrigin::toString(), so we would end |
| 461 // up generating the same token that was already set. | 461 // up generating the same token that was already set. |
| 462 if (frameSecurityOrigin->domainWasSetInDOM() || frameSecurityToken.isEmp ty() || frameSecurityToken == "null") { | 462 if (frameSecurityOrigin->domainWasSetInDOM() || frameSecurityToken.isEmp ty() || frameSecurityToken == "null") { |
| 463 context->UseDefaultSecurityToken(); | 463 context->UseDefaultSecurityToken(); |
| 464 return; | 464 return; |
| 465 } | 465 } |
| 466 token = frameSecurityToken + token; | 466 token = frameSecurityToken + token; |
| 467 } | 467 } |
| 468 | 468 |
| 469 CString utf8Token = token.utf8(); | |
|
esprehn
2016/07/13 00:48:53
Doing this meant we were allocating an extra tempo
| |
| 470 // NOTE: V8 does identity comparison in fast path, must use a symbol | 469 // NOTE: V8 does identity comparison in fast path, must use a symbol |
| 471 // as the security token. | 470 // as the security token. |
| 472 context->SetSecurityToken(v8AtomicString(m_isolate, utf8Token.data(), utf8To ken.length())); | 471 context->SetSecurityToken(v8AtomicString(m_isolate, token)); |
| 473 } | 472 } |
| 474 | 473 |
| 475 void WindowProxy::updateDocument() | 474 void WindowProxy::updateDocument() |
| 476 { | 475 { |
| 477 ASSERT(m_world->isMainWorld()); | 476 ASSERT(m_world->isMainWorld()); |
| 478 if (!isGlobalInitialized()) | 477 if (!isGlobalInitialized()) |
| 479 return; | 478 return; |
| 480 if (!isContextInitialized()) | 479 if (!isContextInitialized()) |
| 481 return; | 480 return; |
| 482 updateActivityLogger(); | 481 updateActivityLogger(); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 555 } | 554 } |
| 556 | 555 |
| 557 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) | 556 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) |
| 558 { | 557 { |
| 559 if (!isContextInitialized()) | 558 if (!isContextInitialized()) |
| 560 return; | 559 return; |
| 561 setSecurityToken(origin); | 560 setSecurityToken(origin); |
| 562 } | 561 } |
| 563 | 562 |
| 564 } // namespace blink | 563 } // namespace blink |
| OLD | NEW |