#include "content/browser/mojo_binder_policy_map_impl.h"
#include <string_view>
#include "base/feature_list.h"
#include "base/no_destructor.h"
#include "base/not_fatal_until.h"
#include "content/common/dom_automation_controller.mojom.h"
#include "content/common/frame.mojom.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/mojo_binder_policy_map.h"
#include "content/public/common/content_client.h"
#include "device/gamepad/public/mojom/gamepad.mojom.h"
#include "media/mojo/mojom/media_player.mojom.h"
#include "media/mojo/mojom/webrtc_video_perf.mojom.h"
#include "services/network/public/mojom/restricted_cookie_manager.mojom.h"
#include "third_party/blink/public/mojom/blob/blob_url_store.mojom.h"
#include "third_party/blink/public/mojom/broadcastchannel/broadcast_channel.mojom.h"
#include "third_party/blink/public/mojom/cache_storage/cache_storage.mojom.h"
#include "third_party/blink/public/mojom/clipboard/clipboard.mojom.h"
#include "third_party/blink/public/mojom/file/file_utilities.mojom.h"
#include "third_party/blink/public/mojom/frame/back_forward_cache_controller.mojom.h"
#include "third_party/blink/public/mojom/frame/frame.mojom.h"
#include "third_party/blink/public/mojom/indexeddb/indexeddb.mojom.h"
#include "third_party/blink/public/mojom/loader/fetch_later.mojom.h"
#if BUILDFLAG(IS_MAC)
#include "third_party/blink/public/mojom/input/text_input_host.mojom.h"
#endif
#include "third_party/blink/public/mojom/loader/code_cache.mojom.h"
#include "third_party/blink/public/mojom/manifest/manifest_observer.mojom.h"
#include "third_party/blink/public/mojom/media/renderer_audio_output_stream_factory.mojom.h"
#include "third_party/blink/public/mojom/notifications/notification_service.mojom.h"
#include "third_party/blink/public/mojom/page/display_cutout.mojom.h"
namespace content {
#if BUILDFLAG(IS_MAC)
BASE_FEATURE(kTextInputHostMojoCapabilityControlWorkaround,
"TextInputHostMojoCapabilityControlWorkaround",
base::FEATURE_ENABLED_BY_DEFAULT);
#endif
namespace {
enum class PolicyClass { … };
void RegisterNonAssociatedPolicies(MojoBinderPolicyMap& map,
PolicyClass policy) { … }
void RegisterChannelAssociatedPoliciesForSameOriginPrerendering(
MojoBinderPolicyMap& map) { … }
void RegisterContentBinderPoliciesForSameOriginPrerendering(
MojoBinderPolicyMap& map) { … }
void RegisterContentBinderPoliciesForPreview(MojoBinderPolicyMap& map) { … }
class BrowserInterfaceBrokerMojoBinderPolicyMapHolder { … };
}
MojoBinderPolicyMapImpl::MojoBinderPolicyMapImpl() = default;
MojoBinderPolicyMapImpl::MojoBinderPolicyMapImpl(
const base::flat_map<std::string, MojoBinderNonAssociatedPolicy>& init_map)
: … { … }
MojoBinderPolicyMapImpl::~MojoBinderPolicyMapImpl() = default;
const MojoBinderPolicyMapImpl*
MojoBinderPolicyMapImpl::GetInstanceForSameOriginPrerendering() { … }
const MojoBinderPolicyMapImpl*
MojoBinderPolicyMapImpl::GetInstanceForPreview() { … }
MojoBinderNonAssociatedPolicy
MojoBinderPolicyMapImpl::GetNonAssociatedMojoBinderPolicy(
const std::string& interface_name,
const MojoBinderNonAssociatedPolicy default_policy) const { … }
MojoBinderAssociatedPolicy
MojoBinderPolicyMapImpl::GetAssociatedMojoBinderPolicy(
const std::string& interface_name,
const MojoBinderAssociatedPolicy default_policy) const { … }
MojoBinderNonAssociatedPolicy
MojoBinderPolicyMapImpl::GetNonAssociatedMojoBinderPolicyOrDieForTesting(
const std::string& interface_name) const { … }
MojoBinderAssociatedPolicy
MojoBinderPolicyMapImpl::GetAssociatedMojoBinderPolicyOrDieForTesting(
const std::string& interface_name) const { … }
void MojoBinderPolicyMapImpl::SetPolicyByName(
const std::string_view& name,
MojoBinderNonAssociatedPolicy policy) { … }
void MojoBinderPolicyMapImpl::SetPolicyByName(
const std::string_view& name,
MojoBinderAssociatedPolicy policy) { … }
}