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

Side by Side Diff: Source/core/dom/ExecutionContext.cpp

Issue 27073003: CSP Suborigins Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 6 years, 6 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 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2012 Google Inc. All Rights Reserved. 3 * Copyright (C) 2012 Google Inc. All Rights Reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 String m_errorMessage; 59 String m_errorMessage;
60 int m_lineNumber; 60 int m_lineNumber;
61 int m_columnNumber; 61 int m_columnNumber;
62 String m_sourceURL; 62 String m_sourceURL;
63 RefPtrWillBeMember<ScriptCallStack> m_callStack; 63 RefPtrWillBeMember<ScriptCallStack> m_callStack;
64 }; 64 };
65 65
66 ExecutionContext::ExecutionContext() 66 ExecutionContext::ExecutionContext()
67 : m_client(0) 67 : m_client(0)
68 , m_sandboxFlags(SandboxNone) 68 , m_sandboxFlags(SandboxNone)
69 , m_suboriginName("")
abarth-chromium 2014/07/31 04:56:47 We should just let this automatically initialize t
jww 2014/10/21 23:51:06 No longer relevant (m_suboriginName is gone).
69 , m_circularSequentialID(0) 70 , m_circularSequentialID(0)
70 , m_inDispatchErrorEvent(false) 71 , m_inDispatchErrorEvent(false)
71 , m_activeDOMObjectsAreSuspended(false) 72 , m_activeDOMObjectsAreSuspended(false)
72 , m_activeDOMObjectsAreStopped(false) 73 , m_activeDOMObjectsAreStopped(false)
73 { 74 {
74 } 75 }
75 76
76 ExecutionContext::~ExecutionContext() 77 ExecutionContext::~ExecutionContext()
77 { 78 {
78 } 79 }
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 m_sandboxFlags |= mask; 330 m_sandboxFlags |= mask;
330 331
331 RELEASE_ASSERT(m_client); 332 RELEASE_ASSERT(m_client);
332 // The SandboxOrigin is stored redundantly in the security origin. 333 // The SandboxOrigin is stored redundantly in the security origin.
333 if (isSandboxed(SandboxOrigin) && m_client->securityContext().securityOrigin () && !m_client->securityContext().securityOrigin()->isUnique()) { 334 if (isSandboxed(SandboxOrigin) && m_client->securityContext().securityOrigin () && !m_client->securityContext().securityOrigin()->isUnique()) {
334 m_client->securityContext().setSecurityOrigin(SecurityOrigin::createUniq ue()); 335 m_client->securityContext().setSecurityOrigin(SecurityOrigin::createUniq ue());
335 m_client->didUpdateSecurityOrigin(); 336 m_client->didUpdateSecurityOrigin();
336 } 337 }
337 } 338 }
338 339
340 void ExecutionContext::enforceSuborigin(const String& name)
341 {
342 RELEASE_ASSERT(m_client);
343 SecurityOrigin* origin = m_client->securityContext().securityOrigin();
344 ASSERT(origin);
345 if (!origin->hasSuborigin()) {
346 origin->addSuborigin(name);
347 m_client->didUpdateSecurityOrigin();
348 }
349 }
350
339 void ExecutionContext::trace(Visitor* visitor) 351 void ExecutionContext::trace(Visitor* visitor)
340 { 352 {
341 #if ENABLE(OILPAN) 353 #if ENABLE(OILPAN)
342 visitor->trace(m_pendingExceptions); 354 visitor->trace(m_pendingExceptions);
343 #endif 355 #endif
344 Supplementable<WebCore::ExecutionContext>::trace(visitor); 356 Supplementable<WebCore::ExecutionContext>::trace(visitor);
345 } 357 }
346 358
347 } // namespace WebCore 359 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698