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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/V8LazyEventListener.cpp

Issue 1923273002: CSP: Allow hashed inline event handlers only with 'unsafe-hashed-attributes' (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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) 2006, 2007, 2008, 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 v8::Local<v8::Context> v8Context = toV8Context(executionContext, world()); 119 v8::Local<v8::Context> v8Context = toV8Context(executionContext, world());
120 if (v8Context.IsEmpty()) 120 if (v8Context.IsEmpty())
121 return; 121 return;
122 ScriptState* scriptState = ScriptState::from(v8Context); 122 ScriptState* scriptState = ScriptState::from(v8Context);
123 if (!scriptState->contextIsValid()) 123 if (!scriptState->contextIsValid())
124 return; 124 return;
125 125
126 if (!executionContext->isDocument()) 126 if (!executionContext->isDocument())
127 return; 127 return;
128 128
129 if (!toDocument(executionContext)->allowInlineEventHandlers(m_node, this, m_ sourceURL, m_position.m_line)) { 129 if (!toDocument(executionContext)->allowInlineEventHandler(m_node, this, m_s ourceURL, m_position.m_line)) {
130 clearListenerObject(); 130 clearListenerObject();
131 return; 131 return;
132 } 132 }
133 133
134 if (hasExistingListenerObject()) 134 if (hasExistingListenerObject())
135 return; 135 return;
136 136
137 ScriptState::Scope scope(scriptState); 137 ScriptState::Scope scope(scriptState);
138 138
139 // Nodes other than the document object, when executing inline event 139 // Nodes other than the document object, when executing inline event
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 AccessControlStatus accessControlStatus = NotSharableCrossOrigin; 218 AccessControlStatus accessControlStatus = NotSharableCrossOrigin;
219 if (message->IsOpaque()) 219 if (message->IsOpaque())
220 accessControlStatus = OpaqueResource; 220 accessControlStatus = OpaqueResource;
221 else if (message->IsSharedCrossOrigin()) 221 else if (message->IsSharedCrossOrigin())
222 accessControlStatus = SharableCrossOrigin; 222 accessControlStatus = SharableCrossOrigin;
223 223
224 executionContext->reportException(event, 0, nullptr, accessControlStatus); 224 executionContext->reportException(event, 0, nullptr, accessControlStatus);
225 } 225 }
226 226
227 } // namespace blink 227 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698