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

Side by Side Diff: url/third_party/mozilla/url_parse.cc

Issue 2895953002: Update dangling markup mitigations. (Closed)
Patch Set: Test. Created 3 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 /* Based on nsURLParsers.cc from Mozilla 1 /* Based on nsURLParsers.cc from Mozilla
2 * ------------------------------------- 2 * -------------------------------------
3 * The contents of this file are subject to the Mozilla Public License Version 3 * The contents of this file are subject to the Mozilla Public License Version
4 * 1.1 (the "License"); you may not use this file except in compliance with 4 * 1.1 (the "License"); you may not use this file except in compliance with
5 * the License. You may obtain a copy of the License at 5 * the License. You may obtain a copy of the License at
6 * http://www.mozilla.org/MPL/ 6 * http://www.mozilla.org/MPL/
7 * 7 *
8 * Software distributed under the License is distributed on an "AS IS" basis, 8 * Software distributed under the License is distributed on an "AS IS" basis,
9 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 9 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
10 * for the specific language governing rights and limitations under the 10 * for the specific language governing rights and limitations under the
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 if (cur < end && spec[cur] == '&') 683 if (cur < end && spec[cur] == '&')
684 cur++; 684 cur++;
685 685
686 // Save the new query 686 // Save the new query
687 *query = MakeRange(cur, end); 687 *query = MakeRange(cur, end);
688 return true; 688 return true;
689 } 689 }
690 690
691 } // namespace 691 } // namespace
692 692
693 Parsed::Parsed() : whitespace_removed(false), inner_parsed_(NULL) {} 693 Parsed::Parsed() : potentially_dangling_markup(false), inner_parsed_(NULL) {}
694 694
695 Parsed::Parsed(const Parsed& other) 695 Parsed::Parsed(const Parsed& other)
696 : scheme(other.scheme), 696 : scheme(other.scheme),
697 username(other.username), 697 username(other.username),
698 password(other.password), 698 password(other.password),
699 host(other.host), 699 host(other.host),
700 port(other.port), 700 port(other.port),
701 path(other.path), 701 path(other.path),
702 query(other.query), 702 query(other.query),
703 ref(other.ref), 703 ref(other.ref),
704 whitespace_removed(other.whitespace_removed), 704 potentially_dangling_markup(other.potentially_dangling_markup),
705 inner_parsed_(NULL) { 705 inner_parsed_(NULL) {
706 if (other.inner_parsed_) 706 if (other.inner_parsed_)
707 set_inner_parsed(*other.inner_parsed_); 707 set_inner_parsed(*other.inner_parsed_);
708 } 708 }
709 709
710 Parsed& Parsed::operator=(const Parsed& other) { 710 Parsed& Parsed::operator=(const Parsed& other) {
711 if (this != &other) { 711 if (this != &other) {
712 scheme = other.scheme; 712 scheme = other.scheme;
713 username = other.username; 713 username = other.username;
714 password = other.password; 714 password = other.password;
715 host = other.host; 715 host = other.host;
716 port = other.port; 716 port = other.port;
717 path = other.path; 717 path = other.path;
718 query = other.query; 718 query = other.query;
719 ref = other.ref; 719 ref = other.ref;
720 whitespace_removed = other.whitespace_removed; 720 potentially_dangling_markup = other.potentially_dangling_markup;
721 if (other.inner_parsed_) 721 if (other.inner_parsed_)
722 set_inner_parsed(*other.inner_parsed_); 722 set_inner_parsed(*other.inner_parsed_);
723 else 723 else
724 clear_inner_parsed(); 724 clear_inner_parsed();
725 } 725 }
726 return *this; 726 return *this;
727 } 727 }
728 728
729 Parsed::~Parsed() { 729 Parsed::~Parsed() {
730 delete inner_parsed_; 730 delete inner_parsed_;
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
936 } 936 }
937 937
938 void ParseAfterScheme(const base::char16* spec, 938 void ParseAfterScheme(const base::char16* spec,
939 int spec_len, 939 int spec_len,
940 int after_scheme, 940 int after_scheme,
941 Parsed* parsed) { 941 Parsed* parsed) {
942 DoParseAfterScheme(spec, spec_len, after_scheme, parsed); 942 DoParseAfterScheme(spec, spec_len, after_scheme, parsed);
943 } 943 }
944 944
945 } // namespace url 945 } // namespace url
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698