Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 19 matching lines...) Expand all Loading... | |
| 30 | 30 |
| 31 #include "core/dom/ExecutionContextTask.h" | 31 #include "core/dom/ExecutionContextTask.h" |
| 32 #include "core/events/ErrorEvent.h" | 32 #include "core/events/ErrorEvent.h" |
| 33 #include "core/events/EventTarget.h" | 33 #include "core/events/EventTarget.h" |
| 34 #include "core/fetch/MemoryCache.h" | 34 #include "core/fetch/MemoryCache.h" |
| 35 #include "core/html/PublicURLManager.h" | 35 #include "core/html/PublicURLManager.h" |
| 36 #include "core/inspector/InspectorInstrumentation.h" | 36 #include "core/inspector/InspectorInstrumentation.h" |
| 37 #include "core/inspector/ScriptCallStack.h" | 37 #include "core/inspector/ScriptCallStack.h" |
| 38 #include "core/workers/WorkerGlobalScope.h" | 38 #include "core/workers/WorkerGlobalScope.h" |
| 39 #include "core/workers/WorkerThread.h" | 39 #include "core/workers/WorkerThread.h" |
| 40 #include "platform/RuntimeEnabledFeatures.h" | |
| 40 #include "wtf/MainThread.h" | 41 #include "wtf/MainThread.h" |
| 41 | 42 |
| 42 namespace blink { | 43 namespace blink { |
| 43 | 44 |
| 44 class ExecutionContext::PendingException : public NoBaseWillBeGarbageCollectedFi nalized<ExecutionContext::PendingException> { | 45 class ExecutionContext::PendingException : public NoBaseWillBeGarbageCollectedFi nalized<ExecutionContext::PendingException> { |
| 45 WTF_MAKE_NONCOPYABLE(PendingException); | 46 WTF_MAKE_NONCOPYABLE(PendingException); |
| 46 public: | 47 public: |
| 47 PendingException(const String& errorMessage, int lineNumber, int columnNumbe r, int scriptId, const String& sourceURL, PassRefPtrWillBeRawPtr<ScriptCallStack > callStack) | 48 PendingException(const String& errorMessage, int lineNumber, int columnNumbe r, int scriptId, const String& sourceURL, PassRefPtrWillBeRawPtr<ScriptCallStack > callStack) |
| 48 : m_errorMessage(errorMessage) | 49 : m_errorMessage(errorMessage) |
| 49 , m_lineNumber(lineNumber) | 50 , m_lineNumber(lineNumber) |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 246 bool ExecutionContext::isWindowInteractionAllowed() const | 247 bool ExecutionContext::isWindowInteractionAllowed() const |
| 247 { | 248 { |
| 248 return m_windowInteractionTokens > 0; | 249 return m_windowInteractionTokens > 0; |
| 249 } | 250 } |
| 250 | 251 |
| 251 void ExecutionContext::removeURLFromMemoryCache(const KURL& url) | 252 void ExecutionContext::removeURLFromMemoryCache(const KURL& url) |
| 252 { | 253 { |
| 253 memoryCache()->removeURLFromCache(url); | 254 memoryCache()->removeURLFromCache(url); |
| 254 } | 255 } |
| 255 | 256 |
| 257 // |name| should be non-empty, and this should be enforced by parsing. | |
| 258 void ExecutionContext::enforceSuborigin(const String& name) | |
| 259 { | |
| 260 if (name.isNull()) | |
| 261 return; | |
| 262 ASSERT(!name.isEmpty()); | |
| 263 ASSERT(RuntimeEnabledFeatures::suboriginsEnabled()); | |
|
jochen (gone - plz use gerrit)
2015/04/27 19:35:10
maybe just return if it's not enabled?
jww
2015/05/30 01:11:07
If Suborigins aren't enabled, then the CSP directi
| |
| 264 SecurityOrigin* origin = securityContext().securityOrigin(); | |
| 265 ASSERT(origin); | |
| 266 ASSERT(!origin->hasSuborigin() || origin->suboriginName() == name); | |
| 267 origin->addSuborigin(name); | |
| 268 securityContext().didUpdateSecurityOrigin(); | |
| 269 } | |
| 270 | |
| 256 DEFINE_TRACE(ExecutionContext) | 271 DEFINE_TRACE(ExecutionContext) |
| 257 { | 272 { |
| 258 #if ENABLE(OILPAN) | 273 #if ENABLE(OILPAN) |
| 259 visitor->trace(m_pendingExceptions); | 274 visitor->trace(m_pendingExceptions); |
| 260 visitor->trace(m_publicURLManager); | 275 visitor->trace(m_publicURLManager); |
| 261 HeapSupplementable<ExecutionContext>::trace(visitor); | 276 HeapSupplementable<ExecutionContext>::trace(visitor); |
| 262 #endif | 277 #endif |
| 263 ContextLifecycleNotifier::trace(visitor); | 278 ContextLifecycleNotifier::trace(visitor); |
| 264 } | 279 } |
| 265 | 280 |
| 266 } // namespace blink | 281 } // namespace blink |
| OLD | NEW |