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

Side by Side Diff: third_party/WebKit/Source/web/WebPluginContainerImpl.cpp

Issue 2421473004: CSP: Fire 'SecurityPolicyViolation' on the offending element. (Closed)
Patch Set: Test. Created 4 years, 2 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 | « third_party/WebKit/Source/core/loader/HttpEquiv.cpp ('k') | no next file » | 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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * Copyright (C) 2014 Opera Software ASA. All rights reserved. 3 * Copyright (C) 2014 Opera Software ASA. 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 are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 return v8::Local<v8::Object>::Cast(v8value); 460 return v8::Local<v8::Object>::Cast(v8value);
461 } 461 }
462 462
463 WebString WebPluginContainerImpl::executeScriptURL(const WebURL& url, 463 WebString WebPluginContainerImpl::executeScriptURL(const WebURL& url,
464 bool popupsAllowed) { 464 bool popupsAllowed) {
465 LocalFrame* frame = m_element->document().frame(); 465 LocalFrame* frame = m_element->document().frame();
466 if (!frame) 466 if (!frame)
467 return WebString(); 467 return WebString();
468 468
469 if (!m_element->document().contentSecurityPolicy()->allowJavaScriptURLs( 469 if (!m_element->document().contentSecurityPolicy()->allowJavaScriptURLs(
470 m_element->document().url(), OrdinalNumber())) 470 m_element, m_element->document().url(), OrdinalNumber())) {
471 return WebString(); 471 return WebString();
472 }
472 473
473 const KURL& kurl = url; 474 const KURL& kurl = url;
474 DCHECK(kurl.protocolIs("javascript")); 475 DCHECK(kurl.protocolIs("javascript"));
475 476
476 String script = decodeURLEscapeSequences( 477 String script = decodeURLEscapeSequences(
477 kurl.getString().substring(strlen("javascript:"))); 478 kurl.getString().substring(strlen("javascript:")));
478 479
479 UserGestureIndicator gestureIndicator( 480 UserGestureIndicator gestureIndicator(
480 popupsAllowed ? UserGestureToken::create(UserGestureToken::NewGesture) 481 popupsAllowed ? UserGestureToken::create(UserGestureToken::NewGesture)
481 : nullptr); 482 : nullptr);
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
970 // frame view. 971 // frame view.
971 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRect); 972 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRect);
972 } 973 }
973 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects); 974 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects);
974 // Convert to the plugin position. 975 // Convert to the plugin position.
975 for (size_t i = 0; i < cutOutRects.size(); i++) 976 for (size_t i = 0; i < cutOutRects.size(); i++)
976 cutOutRects[i].move(-frameRect().x(), -frameRect().y()); 977 cutOutRects[i].move(-frameRect().x(), -frameRect().y());
977 } 978 }
978 979
979 } // namespace blink 980 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/HttpEquiv.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698