// Copyright 2013 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // This is a copy of url/third_party/mozilla/url_parse.h circa 2023. // It should be used only by components/feedback/redaction_tool/. // We need a copy because the components/feedback/redaction_tool source code is // shared into ChromeOS and needs to have no dependencies outside of base/. #ifndef COMPONENTS_FEEDBACK_REDACTION_TOOL_URL_PARSE_H_ #define COMPONENTS_FEEDBACK_REDACTION_TOOL_URL_PARSE_H_ #include <iosfwd> #include "base/memory/raw_ptr.h" namespace redaction_internal { // Component ------------------------------------------------------------------ // Represents a substring for URL parsing. struct Component { … }; // Parsed --------------------------------------------------------------------- // A structure that holds the identified parts of an input URL. This structure // does NOT store the URL itself. The caller will have to store the URL text // and its corresponding Parsed structure separately. // // Typical usage would be: // // Parsed parsed; // Component scheme; // if (!ExtractScheme(url, url_len, &scheme)) // return I_CAN_NOT_FIND_THE_SCHEME_DUDE; // // if (IsStandardScheme(url, scheme)) // Not provided by this component // ParseStandardURL(url, url_len, &parsed); // else if (IsFileURL(url, scheme)) // Not provided by this component // ParseFileURL(url, url_len, &parsed); // else // ParsePathURL(url, url_len, &parsed); // struct Parsed { … }; } // namespace redaction_internal #endif // COMPONENTS_FEEDBACK_REDACTION_TOOL_URL_PARSE_H_