OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/frame/csp/CSPDirectiveList.h" | 5 #include "core/frame/csp/CSPDirectiveList.h" |
6 | 6 |
7 #include "bindings/core/v8/SourceLocation.h" | 7 #include "bindings/core/v8/SourceLocation.h" |
8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
9 #include "core/dom/SecurityContext.h" | 9 #include "core/dom/SecurityContext.h" |
10 #include "core/dom/SpaceSplitString.h" | 10 #include "core/dom/SpaceSplitString.h" |
(...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
955 while (position < end) { | 955 while (position < end) { |
956 const UChar* directive_begin = position; | 956 const UChar* directive_begin = position; |
957 skipUntil<UChar>(position, end, ';'); | 957 skipUntil<UChar>(position, end, ';'); |
958 | 958 |
959 String name, value; | 959 String name, value; |
960 if (ParseDirective(directive_begin, position, name, value)) { | 960 if (ParseDirective(directive_begin, position, name, value)) { |
961 DCHECK(!name.IsEmpty()); | 961 DCHECK(!name.IsEmpty()); |
962 AddDirective(name, value); | 962 AddDirective(name, value); |
963 } | 963 } |
964 | 964 |
965 ASSERT(position == end || *position == ';'); | 965 DCHECK(position == end || *position == ';'); |
966 skipExactly<UChar>(position, end, ';'); | 966 skipExactly<UChar>(position, end, ';'); |
967 } | 967 } |
968 } | 968 } |
969 | 969 |
970 // directive = *WSP [ directive-name [ WSP directive-value ] ] | 970 // directive = *WSP [ directive-name [ WSP directive-value ] ] |
971 // directive-name = 1*( ALPHA / DIGIT / "-" ) | 971 // directive-name = 1*( ALPHA / DIGIT / "-" ) |
972 // directive-value = *( WSP / <VCHAR except ";"> ) | 972 // directive-value = *( WSP / <VCHAR except ";"> ) |
973 // | 973 // |
974 bool CSPDirectiveList::ParseDirective(const UChar* begin, | 974 bool CSPDirectiveList::ParseDirective(const UChar* begin, |
975 const UChar* end, | 975 const UChar* end, |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1418 visitor->Trace(img_src_); | 1418 visitor->Trace(img_src_); |
1419 visitor->Trace(media_src_); | 1419 visitor->Trace(media_src_); |
1420 visitor->Trace(manifest_src_); | 1420 visitor->Trace(manifest_src_); |
1421 visitor->Trace(object_src_); | 1421 visitor->Trace(object_src_); |
1422 visitor->Trace(script_src_); | 1422 visitor->Trace(script_src_); |
1423 visitor->Trace(style_src_); | 1423 visitor->Trace(style_src_); |
1424 visitor->Trace(worker_src_); | 1424 visitor->Trace(worker_src_); |
1425 } | 1425 } |
1426 | 1426 |
1427 } // namespace blink | 1427 } // namespace blink |
OLD | NEW |