Chromium Code Reviews

Side by Side Diff: src/gurl.h

Issue 9838097: Fix a memory leak; properly initialize inner_parsed before use. (Closed) Base URL: http://google-url.googlecode.com/svn/trunk/
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
« no previous file with comments | « no previous file | src/gurl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2007, Google Inc. 1 // Copyright 2007, Google Inc.
2 // All rights reserved. 2 // 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 51 matching lines...)
62 /*, output_param_encoding*/); 62 /*, output_param_encoding*/);
63 GURL_API explicit GURL(const string16& url_string 63 GURL_API explicit GURL(const string16& url_string
64 /*, output_param_encoding*/); 64 /*, output_param_encoding*/);
65 65
66 // Constructor for URLs that have already been parsed and canonicalized. This 66 // Constructor for URLs that have already been parsed and canonicalized. This
67 // is used for conversions from KURL, for example. The caller must supply all 67 // is used for conversions from KURL, for example. The caller must supply all
68 // information associated with the URL, which must be correct and consistent. 68 // information associated with the URL, which must be correct and consistent.
69 GURL_API GURL(const char* canonical_spec, size_t canonical_spec_len, 69 GURL_API GURL(const char* canonical_spec, size_t canonical_spec_len,
70 const url_parse::Parsed& parsed, bool is_valid); 70 const url_parse::Parsed& parsed, bool is_valid);
71 71
72 GURL_API ~GURL();
73
72 GURL_API GURL& operator=(const GURL& other); 74 GURL_API GURL& operator=(const GURL& other);
73 75
74 // Returns true when this object represents a valid parsed URL. When not 76 // Returns true when this object represents a valid parsed URL. When not
75 // valid, other functions will still succeed, but you will not get canonical 77 // valid, other functions will still succeed, but you will not get canonical
76 // data out in the format you may be expecting. Instead, we keep something 78 // data out in the format you may be expecting. Instead, we keep something
77 // "reasonable looking" so that the user can see how it's busted if 79 // "reasonable looking" so that the user can see how it's busted if
78 // displayed to them. 80 // displayed to them.
79 bool is_valid() const { 81 bool is_valid() const {
80 return is_valid_; 82 return is_valid_;
81 } 83 }
(...skipping 299 matching lines...)
381 // Used for nested schemes [currently only filesystem:]. 383 // Used for nested schemes [currently only filesystem:].
382 GURL* inner_url_; 384 GURL* inner_url_;
383 385
384 // TODO bug 684583: Add encoding for query params. 386 // TODO bug 684583: Add encoding for query params.
385 }; 387 };
386 388
387 // Stream operator so GURL can be used in assertion statements. 389 // Stream operator so GURL can be used in assertion statements.
388 GURL_API std::ostream& operator<<(std::ostream& out, const GURL& url); 390 GURL_API std::ostream& operator<<(std::ostream& out, const GURL& url);
389 391
390 #endif // GOOGLEURL_SRC_GURL_H__ 392 #endif // GOOGLEURL_SRC_GURL_H__
OLDNEW
« no previous file with comments | « no previous file | src/gurl.cc » ('j') | no next file with comments »

Powered by Google App Engine