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

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

Issue 2690933003: Don't sanitize errors if the protocol is "data:" (Closed)
Patch Set: Removed the runtime-error-data-url-expected.txt file since both tests in it are now passing Created 3 years, 10 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/external/wpt/html/webappapis/scripting/processing-model-2/runtime-error-data-url-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698