#include "third_party/blink/renderer/modules/subapps/sub_apps.h"
#include <utility>
#include "base/check.h"
#include "third_party/blink/public/platform/browser_interface_broker_proxy.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_throw_dom_exception.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_sub_apps_add_params.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_sub_apps_list_result.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_sub_apps_result_code.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/navigator.h"
#include "third_party/blink/renderer/core/frame/settings.h"
#include "third_party/blink/renderer/core/page/page.h"
#include "third_party/blink/renderer/platform/bindings/exception_code.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/heap/persistent.h"
#include "third_party/blink/renderer/platform/wtf/functional.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
namespace blink {
SubAppsService;
SubAppsServiceAddParameters;
SubAppsServiceAddParametersPtr;
SubAppsServiceAddResultPtr;
SubAppsServiceListResultEntryPtr;
SubAppsServiceListResultPtr;
SubAppsServiceRemoveResultPtr;
SubAppsServiceResultCode;
namespace {
const int kMaximumNumberOfSubappsPerAddCall = …;
Vector<std::pair<String, V8SubAppsResultCode>> AddResultsFromMojo(
Vector<SubAppsServiceAddResultPtr> add_results_mojo) { … }
Vector<std::pair<String, V8SubAppsResultCode>> RemoveResultsFromMojo(
Vector<SubAppsServiceRemoveResultPtr> remove_results_mojo) { … }
Vector<SubAppsServiceAddParametersPtr> AddOptionsToMojo(
HeapVector<std::pair<String, Member<SubAppsAddParams>>>
sub_apps_to_add_idl) { … }
HeapVector<std::pair<String, Member<SubAppsListResult>>> ListResultsFromMojo(
Vector<SubAppsServiceListResultEntryPtr> sub_apps_list_mojo) { … }
}
const char SubApps::kSupplementName[] = …;
SubApps::SubApps(Navigator& navigator)
: … { … }
SubApps* SubApps::subApps(Navigator& navigator) { … }
void SubApps::Trace(Visitor* visitor) const { … }
HeapMojoRemote<SubAppsService>& SubApps::GetService() { … }
void SubApps::OnConnectionError() { … }
ScriptPromise<IDLRecord<IDLString, V8SubAppsResultCode>> SubApps::add(
ScriptState* script_state,
const HeapVector<std::pair<String, Member<SubAppsAddParams>>>&
sub_apps_to_add,
ExceptionState& exception_state) { … }
ScriptPromise<IDLRecord<IDLString, SubAppsListResult>> SubApps::list(
ScriptState* script_state,
ExceptionState& exception_state) { … }
ScriptPromise<IDLRecord<IDLString, V8SubAppsResultCode>> SubApps::remove(
ScriptState* script_state,
const Vector<String>& manifest_id_paths,
ExceptionState& exception_state) { … }
bool SubApps::CheckPreconditionsMaybeThrow(ScriptState* script_state,
ExceptionState& exception_state) { … }
}