Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(201)

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp

Issue 2142373002: Make v8AtomicString take a StringView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Woops, pass the length. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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();
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/V8Binding.h ('k') | third_party/WebKit/Source/modules/crypto/CryptoResultImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698