| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 // Ensure all SuspendableObjects are suspended also newly created ones. | 91 // Ensure all SuspendableObjects are suspended also newly created ones. |
| 92 if (m_isContextSuspended) | 92 if (m_isContextSuspended) |
| 93 object->suspend(); | 93 object->suspend(); |
| 94 } | 94 } |
| 95 | 95 |
| 96 bool ExecutionContext::shouldSanitizeScriptError( | 96 bool ExecutionContext::shouldSanitizeScriptError( |
| 97 const String& sourceURL, | 97 const String& sourceURL, |
| 98 AccessControlStatus corsStatus) { | 98 AccessControlStatus corsStatus) { |
| 99 if (corsStatus == OpaqueResource) | 99 if (corsStatus == OpaqueResource) |
| 100 return true; | 100 return true; |
| 101 return !(getSecurityOrigin()->canRequestNoSuborigin(completeURL(sourceURL)) || | 101 const KURL& url = completeURL(sourceURL); |
| 102 if (url.protocolIsData()) |
| 103 return false; |
| 104 return !(getSecurityOrigin()->canRequestNoSuborigin(url) || |
| 102 corsStatus == SharableCrossOrigin); | 105 corsStatus == SharableCrossOrigin); |
| 103 } | 106 } |
| 104 | 107 |
| 105 void ExecutionContext::dispatchErrorEvent(ErrorEvent* errorEvent, | 108 void ExecutionContext::dispatchErrorEvent(ErrorEvent* errorEvent, |
| 106 AccessControlStatus corsStatus) { | 109 AccessControlStatus corsStatus) { |
| 107 if (m_inDispatchErrorEvent) { | 110 if (m_inDispatchErrorEvent) { |
| 108 m_pendingExceptions.push_back(errorEvent); | 111 m_pendingExceptions.push_back(errorEvent); |
| 109 return; | 112 return; |
| 110 } | 113 } |
| 111 | 114 |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 } | 234 } |
| 232 | 235 |
| 233 DEFINE_TRACE(ExecutionContext) { | 236 DEFINE_TRACE(ExecutionContext) { |
| 234 visitor->trace(m_publicURLManager); | 237 visitor->trace(m_publicURLManager); |
| 235 visitor->trace(m_pendingExceptions); | 238 visitor->trace(m_pendingExceptions); |
| 236 ContextLifecycleNotifier::trace(visitor); | 239 ContextLifecycleNotifier::trace(visitor); |
| 237 Supplementable<ExecutionContext>::trace(visitor); | 240 Supplementable<ExecutionContext>::trace(visitor); |
| 238 } | 241 } |
| 239 | 242 |
| 240 } // namespace blink | 243 } // namespace blink |
| OLD | NEW |