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

Side by Side Diff: Source/core/frame/ContentSecurityPolicy.cpp

Issue 33523002: Have Frame::script() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/fetch/ResourceFetcher.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) 2011 Google, Inc. All rights reserved. 2 * Copyright (C) 2011 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 1866 matching lines...) Expand 10 before | Expand all | Expand 10 after
1877 bool ContentSecurityPolicy::experimentalFeaturesEnabled() const 1877 bool ContentSecurityPolicy::experimentalFeaturesEnabled() const
1878 { 1878 {
1879 return RuntimeEnabledFeatures::experimentalContentSecurityPolicyFeaturesEnab led(); 1879 return RuntimeEnabledFeatures::experimentalContentSecurityPolicyFeaturesEnab led();
1880 } 1880 }
1881 1881
1882 bool ContentSecurityPolicy::shouldBypassMainWorld(ExecutionContext* context) 1882 bool ContentSecurityPolicy::shouldBypassMainWorld(ExecutionContext* context)
1883 { 1883 {
1884 if (context && context->isDocument()) { 1884 if (context && context->isDocument()) {
1885 Document* document = toDocument(context); 1885 Document* document = toDocument(context);
1886 if (document->frame()) 1886 if (document->frame())
1887 return document->frame()->script()->shouldBypassMainWorldContentSecu rityPolicy(); 1887 return document->frame()->script().shouldBypassMainWorldContentSecur ityPolicy();
1888 } 1888 }
1889 return false; 1889 return false;
1890 } 1890 }
1891 1891
1892 bool ContentSecurityPolicy::shouldSendViolationReport(const String& report) cons t 1892 bool ContentSecurityPolicy::shouldSendViolationReport(const String& report) cons t
1893 { 1893 {
1894 // Collisions have no security impact, so we can save space by storing only the string's hash rather than the whole report. 1894 // Collisions have no security impact, so we can save space by storing only the string's hash rather than the whole report.
1895 return !m_violationReportsSent.contains(report.impl()->hash()); 1895 return !m_violationReportsSent.contains(report.impl()->hash());
1896 } 1896 }
1897 1897
1898 void ContentSecurityPolicy::didSendViolationReport(const String& report) 1898 void ContentSecurityPolicy::didSendViolationReport(const String& report)
1899 { 1899 {
1900 m_violationReportsSent.add(report.impl()->hash()); 1900 m_violationReportsSent.add(report.impl()->hash());
1901 } 1901 }
1902 1902
1903 } // namespace WebCore 1903 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/fetch/ResourceFetcher.cpp ('k') | Source/core/frame/DOMWindow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698