// Copyright 2019 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef SERVICES_DATA_DECODER_PUBLIC_CPP_SAFE_WEB_BUNDLE_PARSER_H_ #define SERVICES_DATA_DECODER_PUBLIC_CPP_SAFE_WEB_BUNDLE_PARSER_H_ #include <memory> #include <optional> #include "base/containers/flat_map.h" #include "base/files/file.h" #include "base/functional/callback.h" #include "components/web_package/mojom/web_bundle_parser.mojom.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/pending_remote.h" #include "mojo/public/cpp/bindings/remote.h" #include "services/data_decoder/public/cpp/data_decoder.h" #include "url/gurl.h" namespace data_decoder { // This interface specifies the requirements how a // `web_package::mojom::BundleDataSource` should be created. class DataSourceCreatingStrategy { … }; // This class is used for safe parsing of the Web Bundles. Even though it // internally uses parsing in the data decoder process by means of // mojo and IPC, the aim of this class is to isolate users from any knowledge // about mojo and IPC. // // Every parsing method will try to reestablish the IPC connection (if // necessary) before returning an error. // // It is safe to delete this object from within the callbacks passed to its // methods. class SafeWebBundleParser { … }; } // namespace data_decoder #endif // SERVICES_DATA_DECODER_PUBLIC_CPP_SAFE_WEB_BUNDLE_PARSER_H_