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

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

Issue 1180923003: Add window access checks for Suborigins (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix tests on Windows Created 5 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
« no previous file with comments | « Source/bindings/core/v8/BindingSecurity.cpp ('k') | Source/core/frame/DOMWindow.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 ASSERT(contains(object)); 141 ASSERT(contains(object));
142 // Ensure all ActiveDOMObjects are suspended also newly created ones. 142 // Ensure all ActiveDOMObjects are suspended also newly created ones.
143 if (m_activeDOMObjectsAreSuspended) 143 if (m_activeDOMObjectsAreSuspended)
144 object->suspend(); 144 object->suspend();
145 } 145 }
146 146
147 bool ExecutionContext::shouldSanitizeScriptError(const String& sourceURL, Access ControlStatus corsStatus) 147 bool ExecutionContext::shouldSanitizeScriptError(const String& sourceURL, Access ControlStatus corsStatus)
148 { 148 {
149 if (corsStatus == OpaqueResource) 149 if (corsStatus == OpaqueResource)
150 return true; 150 return true;
151 return !(securityOrigin()->canRequest(completeURL(sourceURL)) || corsStatus == SharableCrossOrigin); 151 return !(securityOrigin()->canRequestNoSuborigin(completeURL(sourceURL)) || corsStatus == SharableCrossOrigin);
152 } 152 }
153 153
154 void ExecutionContext::reportException(PassRefPtrWillBeRawPtr<ErrorEvent> event, int scriptId, PassRefPtrWillBeRawPtr<ScriptCallStack> callStack, AccessControlS tatus corsStatus) 154 void ExecutionContext::reportException(PassRefPtrWillBeRawPtr<ErrorEvent> event, int scriptId, PassRefPtrWillBeRawPtr<ScriptCallStack> callStack, AccessControlS tatus corsStatus)
155 { 155 {
156 RefPtrWillBeRawPtr<ErrorEvent> errorEvent = event; 156 RefPtrWillBeRawPtr<ErrorEvent> errorEvent = event;
157 if (m_inDispatchErrorEvent) { 157 if (m_inDispatchErrorEvent) {
158 if (!m_pendingExceptions) 158 if (!m_pendingExceptions)
159 m_pendingExceptions = adoptPtrWillBeNoop(new WillBeHeapVector<OwnPtr WillBeMember<PendingException>>()); 159 m_pendingExceptions = adoptPtrWillBeNoop(new WillBeHeapVector<OwnPtr WillBeMember<PendingException>>());
160 m_pendingExceptions->append(adoptPtrWillBeNoop(new PendingException(erro rEvent->messageForConsole(), errorEvent->lineno(), errorEvent->colno(), scriptId , errorEvent->filename(), callStack))); 160 m_pendingExceptions->append(adoptPtrWillBeNoop(new PendingException(erro rEvent->messageForConsole(), errorEvent->lineno(), errorEvent->colno(), scriptId , errorEvent->filename(), callStack)));
161 return; 161 return;
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 { 296 {
297 #if ENABLE(OILPAN) 297 #if ENABLE(OILPAN)
298 visitor->trace(m_pendingExceptions); 298 visitor->trace(m_pendingExceptions);
299 visitor->trace(m_publicURLManager); 299 visitor->trace(m_publicURLManager);
300 HeapSupplementable<ExecutionContext>::trace(visitor); 300 HeapSupplementable<ExecutionContext>::trace(visitor);
301 #endif 301 #endif
302 ContextLifecycleNotifier::trace(visitor); 302 ContextLifecycleNotifier::trace(visitor);
303 } 303 }
304 304
305 } // namespace blink 305 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/BindingSecurity.cpp ('k') | Source/core/frame/DOMWindow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698