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

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

Issue 1775933002: CORS-RFC1918: Pipe creator address space through SharedWorker creation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: typo 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 16 matching lines...) Expand all
27 #include "core/dom/SecurityContext.h" 27 #include "core/dom/SecurityContext.h"
28 28
29 #include "core/frame/csp/ContentSecurityPolicy.h" 29 #include "core/frame/csp/ContentSecurityPolicy.h"
30 #include "platform/RuntimeEnabledFeatures.h" 30 #include "platform/RuntimeEnabledFeatures.h"
31 #include "platform/weborigin/SecurityOrigin.h" 31 #include "platform/weborigin/SecurityOrigin.h"
32 32
33 namespace blink { 33 namespace blink {
34 34
35 SecurityContext::SecurityContext() 35 SecurityContext::SecurityContext()
36 : m_sandboxFlags(SandboxNone) 36 : m_sandboxFlags(SandboxNone)
37 , m_addressSpace(WebURLRequest::AddressSpacePublic) 37 , m_addressSpace(WebAddressSpacePublic)
38 , m_insecureRequestsPolicy(InsecureRequestsDoNotUpgrade) 38 , m_insecureRequestsPolicy(InsecureRequestsDoNotUpgrade)
39 , m_enforceStrictMixedContentChecking(false) 39 , m_enforceStrictMixedContentChecking(false)
40 { 40 {
41 } 41 }
42 42
43 SecurityContext::~SecurityContext() 43 SecurityContext::~SecurityContext()
44 { 44 {
45 } 45 }
46 46
47 DEFINE_TRACE(SecurityContext) 47 DEFINE_TRACE(SecurityContext)
(...skipping 17 matching lines...) Expand all
65 65
66 if (isSandboxed(SandboxOrigin) && securityOrigin() && !securityOrigin()->isU nique()) { 66 if (isSandboxed(SandboxOrigin) && securityOrigin() && !securityOrigin()->isU nique()) {
67 setSecurityOrigin(SecurityOrigin::createUnique()); 67 setSecurityOrigin(SecurityOrigin::createUnique());
68 didUpdateSecurityOrigin(); 68 didUpdateSecurityOrigin();
69 } 69 }
70 } 70 }
71 71
72 String SecurityContext::addressSpaceForBindings() const 72 String SecurityContext::addressSpaceForBindings() const
73 { 73 {
74 switch (m_addressSpace) { 74 switch (m_addressSpace) {
75 case WebURLRequest::AddressSpacePublic: 75 case WebAddressSpacePublic:
76 return "public"; 76 return "public";
77 77
78 case WebURLRequest::AddressSpacePrivate: 78 case WebAddressSpacePrivate:
79 return "private"; 79 return "private";
80 80
81 case WebURLRequest::AddressSpaceLocal: 81 case WebAddressSpaceLocal:
82 return "local"; 82 return "local";
83 } 83 }
84 ASSERT_NOT_REACHED(); 84 ASSERT_NOT_REACHED();
85 return "public"; 85 return "public";
86 } 86 }
87 87
88 bool SecurityContext::hasSuborigin() 88 bool SecurityContext::hasSuborigin()
89 { 89 {
90 ASSERT(m_securityOrigin.get()); 90 ASSERT(m_securityOrigin.get());
91 return m_securityOrigin->hasSuborigin(); 91 return m_securityOrigin->hasSuborigin();
(...skipping 18 matching lines...) Expand all
110 return; 110 return;
111 ASSERT(!name.isEmpty()); 111 ASSERT(!name.isEmpty());
112 ASSERT(RuntimeEnabledFeatures::suboriginsEnabled()); 112 ASSERT(RuntimeEnabledFeatures::suboriginsEnabled());
113 ASSERT(m_securityOrigin.get()); 113 ASSERT(m_securityOrigin.get());
114 ASSERT(!m_securityOrigin->hasSuborigin() || m_securityOrigin->suboriginName( ) == name); 114 ASSERT(!m_securityOrigin->hasSuborigin() || m_securityOrigin->suboriginName( ) == name);
115 m_securityOrigin->addSuborigin(name); 115 m_securityOrigin->addSuborigin(name);
116 didUpdateSecurityOrigin(); 116 didUpdateSecurityOrigin();
117 } 117 }
118 118
119 } // namespace blink 119 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698