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

Side by Side Diff: third_party/WebKit/Source/core/dom/SecurityContext.cpp

Issue 1723753002: Make Document::isSecureContext() work for OOPIFs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more rebase fixups Created 4 years, 9 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) 2011 Google Inc. All Rights Reserved. 2 * Copyright (C) 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 m_securityOrigin = securityOrigin; 54 m_securityOrigin = securityOrigin;
55 } 55 }
56 56
57 void SecurityContext::setContentSecurityPolicy(PassRefPtrWillBeRawPtr<ContentSec urityPolicy> contentSecurityPolicy) 57 void SecurityContext::setContentSecurityPolicy(PassRefPtrWillBeRawPtr<ContentSec urityPolicy> contentSecurityPolicy)
58 { 58 {
59 m_contentSecurityPolicy = contentSecurityPolicy; 59 m_contentSecurityPolicy = contentSecurityPolicy;
60 } 60 }
61 61
62 void SecurityContext::enforceSandboxFlags(SandboxFlags mask) 62 void SecurityContext::enforceSandboxFlags(SandboxFlags mask)
63 { 63 {
64 applySandboxFlags(mask);
65 }
66
67 void SecurityContext::applySandboxFlags(SandboxFlags mask)
68 {
64 m_sandboxFlags |= mask; 69 m_sandboxFlags |= mask;
65 70
66 if (isSandboxed(SandboxOrigin) && getSecurityOrigin() && !getSecurityOrigin( )->isUnique()) { 71 if (isSandboxed(SandboxOrigin) && getSecurityOrigin() && !getSecurityOrigin( )->isUnique()) {
67 setSecurityOrigin(SecurityOrigin::createUnique()); 72 setSecurityOrigin(SecurityOrigin::createUnique());
68 didUpdateSecurityOrigin(); 73 didUpdateSecurityOrigin();
69 } 74 }
70 } 75 }
71 76
72 String SecurityContext::addressSpaceForBindings() const 77 String SecurityContext::addressSpaceForBindings() const
73 { 78 {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 return; 115 return;
111 ASSERT(!name.isEmpty()); 116 ASSERT(!name.isEmpty());
112 ASSERT(RuntimeEnabledFeatures::suboriginsEnabled()); 117 ASSERT(RuntimeEnabledFeatures::suboriginsEnabled());
113 ASSERT(m_securityOrigin.get()); 118 ASSERT(m_securityOrigin.get());
114 ASSERT(!m_securityOrigin->hasSuborigin() || m_securityOrigin->suboriginName( ) == name); 119 ASSERT(!m_securityOrigin->hasSuborigin() || m_securityOrigin->suboriginName( ) == name);
115 m_securityOrigin->addSuborigin(name); 120 m_securityOrigin->addSuborigin(name);
116 didUpdateSecurityOrigin(); 121 didUpdateSecurityOrigin();
117 } 122 }
118 123
119 } // namespace blink 124 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/SecurityContext.h ('k') | third_party/WebKit/Source/core/loader/FrameLoaderClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698