blob: 6d43c6d3cff6b5c80bc051c50608cd3322a2c757 [file] [log] [blame]
// chrome/browser/ui/webui/tab_search/tab_search.mojom-blink.cc is auto generated by mojom_bindings_generator.py, do not edit
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#endif
#include "chrome/browser/ui/webui/tab_search/tab_search.mojom-blink.h"
#include <math.h>
#include <stdint.h>
#include <utility>
#include "base/debug/alias.h"
#include "base/hash/md5_constexpr.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/trace_event/trace_event.h"
#include "base/trace_event/typed_macros.h"
#include "mojo/public/cpp/bindings/lib/generated_code_util.h"
#include "mojo/public/cpp/bindings/lib/message_internal.h"
#include "mojo/public/cpp/bindings/lib/send_message_helper.h"
#include "mojo/public/cpp/bindings/lib/proxy_to_responder.h"
#include "mojo/public/cpp/bindings/lib/serialization_util.h"
#include "mojo/public/cpp/bindings/lib/unserialized_message_context.h"
#include "mojo/public/cpp/bindings/lib/validate_params.h"
#include "mojo/public/cpp/bindings/lib/validation_errors.h"
#include "mojo/public/cpp/bindings/mojo_buildflags.h"
#include "mojo/public/interfaces/bindings/interface_control_messages.mojom.h"
#include "third_party/perfetto/include/perfetto/tracing/traced_value.h"
#include "chrome/browser/ui/webui/tab_search/tab_search.mojom-params-data.h"
#include "chrome/browser/ui/webui/tab_search/tab_search.mojom-shared-message-ids.h"
#include "chrome/browser/ui/webui/tab_search/tab_search.mojom-blink-import-headers.h"
#include "chrome/browser/ui/webui/tab_search/tab_search.mojom-blink-test-utils.h"
#include "mojo/public/cpp/bindings/lib/wtf_serialization.h"
#ifndef CHROME_BROWSER_UI_WEBUI_TAB_SEARCH_TAB_SEARCH_MOJOM_BLINK_JUMBO_H_
#define CHROME_BROWSER_UI_WEBUI_TAB_SEARCH_TAB_SEARCH_MOJOM_BLINK_JUMBO_H_
#endif
namespace tab_search {
namespace mojom {
namespace blink {
ProfileData::ProfileData()
: windows(),
tab_groups(),
recently_closed_tabs(),
recently_closed_tab_groups(),
recently_closed_section_expanded() {}
ProfileData::ProfileData(
WTF::Vector<WindowPtr> windows_in,
WTF::Vector<TabGroupPtr> tab_groups_in,
WTF::Vector<RecentlyClosedTabPtr> recently_closed_tabs_in,
WTF::Vector<RecentlyClosedTabGroupPtr> recently_closed_tab_groups_in,
bool recently_closed_section_expanded_in)
: windows(std::move(windows_in)),
tab_groups(std::move(tab_groups_in)),
recently_closed_tabs(std::move(recently_closed_tabs_in)),
recently_closed_tab_groups(std::move(recently_closed_tab_groups_in)),
recently_closed_section_expanded(std::move(recently_closed_section_expanded_in)) {}
ProfileData::~ProfileData() = default;
void ProfileData::WriteIntoTrace(
perfetto::TracedValue traced_context) const {
[[maybe_unused]] auto dict = std::move(traced_context).WriteDictionary();
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"windows"), this->windows,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type WTF::Vector<WindowPtr>>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"tab_groups"), this->tab_groups,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type WTF::Vector<TabGroupPtr>>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"recently_closed_tabs"), this->recently_closed_tabs,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type WTF::Vector<RecentlyClosedTabPtr>>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"recently_closed_tab_groups"), this->recently_closed_tab_groups,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type WTF::Vector<RecentlyClosedTabGroupPtr>>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"recently_closed_section_expanded"), this->recently_closed_section_expanded,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type bool>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
}
bool ProfileData::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) {
return Data_::Validate(data, validation_context);
}
Window::Window()
: active(),
height(),
tabs() {}
Window::Window(
bool active_in,
uint32_t height_in,
WTF::Vector<TabPtr> tabs_in)
: active(std::move(active_in)),
height(std::move(height_in)),
tabs(std::move(tabs_in)) {}
Window::~Window() = default;
void Window::WriteIntoTrace(
perfetto::TracedValue traced_context) const {
[[maybe_unused]] auto dict = std::move(traced_context).WriteDictionary();
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"active"), this->active,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type bool>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"height"), this->height,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type uint32_t>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"tabs"), this->tabs,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type WTF::Vector<TabPtr>>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
}
bool Window::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) {
return Data_::Validate(data, validation_context);
}
Tab::Tab()
: active(),
alert_states(),
index(),
tab_id(),
group_id(),
pinned(),
title(),
url(),
favicon_url(),
is_default_favicon(),
show_icon(),
last_active_time_ticks(),
last_active_elapsed_text() {}
Tab::Tab(
bool active_in,
WTF::Vector<::tabs::mojom::blink::TabAlertState> alert_states_in,
int32_t index_in,
int32_t tab_id_in,
const absl::optional<::base::Token>& group_id_in,
bool pinned_in,
const WTF::String& title_in,
const ::blink::KURL& url_in,
const absl::optional<::blink::KURL>& favicon_url_in,
bool is_default_favicon_in,
bool show_icon_in,
::base::TimeTicks last_active_time_ticks_in,
const WTF::String& last_active_elapsed_text_in)
: active(std::move(active_in)),
alert_states(std::move(alert_states_in)),
index(std::move(index_in)),
tab_id(std::move(tab_id_in)),
group_id(std::move(group_id_in)),
pinned(std::move(pinned_in)),
title(std::move(title_in)),
url(std::move(url_in)),
favicon_url(std::move(favicon_url_in)),
is_default_favicon(std::move(is_default_favicon_in)),
show_icon(std::move(show_icon_in)),
last_active_time_ticks(std::move(last_active_time_ticks_in)),
last_active_elapsed_text(std::move(last_active_elapsed_text_in)) {}
Tab::~Tab() = default;
void Tab::WriteIntoTrace(
perfetto::TracedValue traced_context) const {
[[maybe_unused]] auto dict = std::move(traced_context).WriteDictionary();
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"active"), this->active,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type bool>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"alert_states"), this->alert_states,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type const WTF::Vector<::tabs::mojom::blink::TabAlertState>&>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"index"), this->index,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type int32_t>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"tab_id"), this->tab_id,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type int32_t>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"group_id"), this->group_id,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type const absl::optional<::base::Token>&>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"pinned"), this->pinned,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type bool>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"title"), this->title,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type const WTF::String&>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"url"), this->url,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type const ::blink::KURL&>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"favicon_url"), this->favicon_url,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type const absl::optional<::blink::KURL>&>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"is_default_favicon"), this->is_default_favicon,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type bool>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"show_icon"), this->show_icon,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type bool>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"last_active_time_ticks"), this->last_active_time_ticks,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type ::base::TimeTicks>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"last_active_elapsed_text"), this->last_active_elapsed_text,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type const WTF::String&>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
}
bool Tab::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) {
return Data_::Validate(data, validation_context);
}
RecentlyClosedTab::RecentlyClosedTab()
: tab_id(),
group_id(),
title(),
url(),
last_active_time(),
last_active_elapsed_text() {}
RecentlyClosedTab::RecentlyClosedTab(
int32_t tab_id_in,
const absl::optional<::base::Token>& group_id_in,
const WTF::String& title_in,
const ::blink::KURL& url_in,
::base::Time last_active_time_in,
const WTF::String& last_active_elapsed_text_in)
: tab_id(std::move(tab_id_in)),
group_id(std::move(group_id_in)),
title(std::move(title_in)),
url(std::move(url_in)),
last_active_time(std::move(last_active_time_in)),
last_active_elapsed_text(std::move(last_active_elapsed_text_in)) {}
RecentlyClosedTab::~RecentlyClosedTab() = default;
void RecentlyClosedTab::WriteIntoTrace(
perfetto::TracedValue traced_context) const {
[[maybe_unused]] auto dict = std::move(traced_context).WriteDictionary();
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"tab_id"), this->tab_id,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type int32_t>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"group_id"), this->group_id,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type const absl::optional<::base::Token>&>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"title"), this->title,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type const WTF::String&>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"url"), this->url,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type const ::blink::KURL&>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"last_active_time"), this->last_active_time,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type ::base::Time>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"last_active_elapsed_text"), this->last_active_elapsed_text,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type const WTF::String&>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
}
bool RecentlyClosedTab::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) {
return Data_::Validate(data, validation_context);
}
TabGroup::TabGroup()
: id(),
color(),
title() {}
TabGroup::TabGroup(
const ::base::Token& id_in,
::tab_groups::mojom::blink::Color color_in,
const WTF::String& title_in)
: id(std::move(id_in)),
color(std::move(color_in)),
title(std::move(title_in)) {}
TabGroup::~TabGroup() = default;
void TabGroup::WriteIntoTrace(
perfetto::TracedValue traced_context) const {
[[maybe_unused]] auto dict = std::move(traced_context).WriteDictionary();
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"id"), this->id,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type const ::base::Token&>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"color"), this->color,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type ::tab_groups::mojom::blink::Color>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"title"), this->title,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type const WTF::String&>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
}
bool TabGroup::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) {
return Data_::Validate(data, validation_context);
}
RecentlyClosedTabGroup::RecentlyClosedTabGroup()
: session_id(),
id(),
color(),
title(),
tab_count(),
last_active_time(),
last_active_elapsed_text() {}
RecentlyClosedTabGroup::RecentlyClosedTabGroup(
int32_t session_id_in,
const ::base::Token& id_in,
::tab_groups::mojom::blink::Color color_in,
const WTF::String& title_in,
uint32_t tab_count_in,
::base::Time last_active_time_in,
const WTF::String& last_active_elapsed_text_in)
: session_id(std::move(session_id_in)),
id(std::move(id_in)),
color(std::move(color_in)),
title(std::move(title_in)),
tab_count(std::move(tab_count_in)),
last_active_time(std::move(last_active_time_in)),
last_active_elapsed_text(std::move(last_active_elapsed_text_in)) {}
RecentlyClosedTabGroup::~RecentlyClosedTabGroup() = default;
void RecentlyClosedTabGroup::WriteIntoTrace(
perfetto::TracedValue traced_context) const {
[[maybe_unused]] auto dict = std::move(traced_context).WriteDictionary();
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"session_id"), this->session_id,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type int32_t>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"id"), this->id,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type const ::base::Token&>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"color"), this->color,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type ::tab_groups::mojom::blink::Color>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"title"), this->title,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type const WTF::String&>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"tab_count"), this->tab_count,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type uint32_t>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"last_active_time"), this->last_active_time,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type ::base::Time>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"last_active_elapsed_text"), this->last_active_elapsed_text,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type const WTF::String&>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
}
bool RecentlyClosedTabGroup::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) {
return Data_::Validate(data, validation_context);
}
SwitchToTabInfo::SwitchToTabInfo()
: tab_id() {}
SwitchToTabInfo::SwitchToTabInfo(
int32_t tab_id_in)
: tab_id(std::move(tab_id_in)) {}
SwitchToTabInfo::~SwitchToTabInfo() = default;
size_t SwitchToTabInfo::Hash(size_t seed) const {
seed = mojo::internal::WTFHash(seed, this->tab_id);
return seed;
}
void SwitchToTabInfo::WriteIntoTrace(
perfetto::TracedValue traced_context) const {
[[maybe_unused]] auto dict = std::move(traced_context).WriteDictionary();
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"tab_id"), this->tab_id,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type int32_t>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
}
bool SwitchToTabInfo::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) {
return Data_::Validate(data, validation_context);
}
TabUpdateInfo::TabUpdateInfo()
: in_active_window(),
tab() {}
TabUpdateInfo::TabUpdateInfo(
bool in_active_window_in,
TabPtr tab_in)
: in_active_window(std::move(in_active_window_in)),
tab(std::move(tab_in)) {}
TabUpdateInfo::~TabUpdateInfo() = default;
void TabUpdateInfo::WriteIntoTrace(
perfetto::TracedValue traced_context) const {
[[maybe_unused]] auto dict = std::move(traced_context).WriteDictionary();
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"in_active_window"), this->in_active_window,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type bool>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"tab"), this->tab,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type TabPtr>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
}
bool TabUpdateInfo::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) {
return Data_::Validate(data, validation_context);
}
TabsRemovedInfo::TabsRemovedInfo()
: tab_ids(),
recently_closed_tabs() {}
TabsRemovedInfo::TabsRemovedInfo(
WTF::Vector<int32_t> tab_ids_in,
WTF::Vector<RecentlyClosedTabPtr> recently_closed_tabs_in)
: tab_ids(std::move(tab_ids_in)),
recently_closed_tabs(std::move(recently_closed_tabs_in)) {}
TabsRemovedInfo::~TabsRemovedInfo() = default;
void TabsRemovedInfo::WriteIntoTrace(
perfetto::TracedValue traced_context) const {
[[maybe_unused]] auto dict = std::move(traced_context).WriteDictionary();
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"tab_ids"), this->tab_ids,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type const WTF::Vector<int32_t>&>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem(
"recently_closed_tabs"), this->recently_closed_tabs,
#if BUILDFLAG(MOJO_TRACE_ENABLED)
"<value of type WTF::Vector<RecentlyClosedTabPtr>>"
#else
"<value>"
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
);
}
bool TabsRemovedInfo::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) {
return Data_::Validate(data, validation_context);
}
const char PageHandlerFactory::Name_[] = "tab_search.mojom.PageHandlerFactory";
std::pair<uint32_t, const void*> PageHandlerFactory::MessageToMethodInfo_(mojo::Message& message) {
switch (message.name()) {
case internal::kPageHandlerFactory_CreatePageHandler_Name: {
constexpr uint32_t value = base::MD5Hash32Constexpr(
"(Impl)tab_search::mojom::PageHandlerFactory::CreatePageHandler");
#if BUILDFLAG(IS_FUCHSIA)
return std::make_pair(value, nullptr);
#else
return std::make_pair(value, reinterpret_cast<const void*>(&PageHandlerFactory::CreatePageHandler_Sym::IPCSymbol));
#endif // BUILDFLAG(IS_FUCHSIA)
}
}
return std::make_pair(0, nullptr);
}
const char* PageHandlerFactory::MessageToMethodName_(mojo::Message& message) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
bool is_response = message.has_flag(mojo::Message::kFlagIsResponse);
if (!is_response) {
switch (message.name()) {
case internal::kPageHandlerFactory_CreatePageHandler_Name:
return "Receive tab_search::mojom::PageHandlerFactory::CreatePageHandler";
}
} else {
switch (message.name()) {
case internal::kPageHandlerFactory_CreatePageHandler_Name:
return "Receive reply tab_search::mojom::PageHandlerFactory::CreatePageHandler";
}
}
return "Receive unknown mojo message";
#else
bool is_response = message.has_flag(mojo::Message::kFlagIsResponse);
if (is_response) {
return "Receive mojo reply";
} else {
return "Receive mojo message";
}
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
}
#if !BUILDFLAG(IS_FUCHSIA)
void PageHandlerFactory::CreatePageHandler_Sym::IPCSymbol() {
// This method's address is used for indetifiying the mojo method name after
// symblozation. So each IPCSymbol should have a unique address.
NO_CODE_FOLDING();
}
# endif // !BUILDFLAG(IS_FUCHSIA)
PageHandlerFactoryProxy::PageHandlerFactoryProxy(mojo::MessageReceiverWithResponder* receiver)
: receiver_(receiver) {
}
void PageHandlerFactoryProxy::CreatePageHandler(
::mojo::PendingRemote<Page> in_page, ::mojo::PendingReceiver<PageHandler> in_handler) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
TRACE_EVENT1(
"mojom", "Send tab_search::mojom::PageHandlerFactory::CreatePageHandler", "input_parameters",
[&](perfetto::TracedValue context){
auto dict = std::move(context).WriteDictionary();
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem("page"), in_page,
"<value of type ::mojo::PendingRemote<Page>>");
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem("handler"), in_handler,
"<value of type ::mojo::PendingReceiver<PageHandler>>");
});
#endif
const bool kExpectsResponse = false;
const bool kIsSync = false;
const bool kAllowInterrupt = true;
const uint32_t kFlags =
((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
((kIsSync) ? mojo::Message::kFlagIsSync : 0) |
((kAllowInterrupt) ? 0 : mojo::Message::kFlagNoInterrupt);
mojo::Message message(
internal::kPageHandlerFactory_CreatePageHandler_Name, kFlags, 0, 0, nullptr);
mojo::internal::MessageFragment<
::tab_search::mojom::internal::PageHandlerFactory_CreatePageHandler_Params_Data> params(
message);
params.Allocate();
mojo::internal::Serialize<mojo::InterfacePtrDataView<::tab_search::mojom::PageInterfaceBase>>(
in_page, &params->page, &params.message());
MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
!mojo::internal::IsHandleOrInterfaceValid(params->page),
mojo::internal::VALIDATION_ERROR_UNEXPECTED_INVALID_HANDLE,
"invalid page in PageHandlerFactory.CreatePageHandler request");
mojo::internal::Serialize<mojo::InterfaceRequestDataView<::tab_search::mojom::PageHandlerInterfaceBase>>(
in_handler, &params->handler, &params.message());
MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
!mojo::internal::IsHandleOrInterfaceValid(params->handler),
mojo::internal::VALIDATION_ERROR_UNEXPECTED_INVALID_HANDLE,
"invalid handler in PageHandlerFactory.CreatePageHandler request");
#if defined(ENABLE_IPC_FUZZER)
message.set_interface_name(PageHandlerFactory::Name_);
message.set_method_name("CreatePageHandler");
#endif
// This return value may be ignored as false implies the Connector has
// encountered an error, which will be visible through other means.
::mojo::internal::SendMessage(*receiver_, message);
}
// static
bool PageHandlerFactoryStubDispatch::Accept(
PageHandlerFactory* impl,
mojo::Message* message) {
switch (message->header()->name) {
case internal::kPageHandlerFactory_CreatePageHandler_Name: {
DCHECK(message->is_serialized());
internal::PageHandlerFactory_CreatePageHandler_Params_Data* params =
reinterpret_cast<internal::PageHandlerFactory_CreatePageHandler_Params_Data*>(
message->mutable_payload());
bool success = true;
::mojo::PendingRemote<Page> p_page{};
::mojo::PendingReceiver<PageHandler> p_handler{};
PageHandlerFactory_CreatePageHandler_ParamsDataView input_data_view(params, message);
if (success) {
p_page =
input_data_view.TakePage<decltype(p_page)>();
}
if (success) {
p_handler =
input_data_view.TakeHandler<decltype(p_handler)>();
}
if (!success) {
ReportValidationErrorForMessage(
message,
mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
PageHandlerFactory::Name_, 0, false);
return false;
}
// A null |impl| means no implementation was bound.
DCHECK(impl);
impl->CreatePageHandler(
std::move(p_page),
std::move(p_handler));
return true;
}
}
return false;
}
// static
bool PageHandlerFactoryStubDispatch::AcceptWithResponder(
PageHandlerFactory* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) {
[[maybe_unused]] const bool message_is_sync =
message->has_flag(mojo::Message::kFlagIsSync);
[[maybe_unused]] const uint64_t request_id = message->request_id();
switch (message->header()->name) {
case internal::kPageHandlerFactory_CreatePageHandler_Name: {
break;
}
}
return false;
}
static const std::pair<uint32_t, mojo::internal::GenericValidationInfo> kPageHandlerFactoryValidationInfo[] = {
{internal::kPageHandlerFactory_CreatePageHandler_Name,
{&internal::PageHandlerFactory_CreatePageHandler_Params_Data::Validate,
nullptr /* no response */}},
};
bool PageHandlerFactoryRequestValidator::Accept(mojo::Message* message) {
const char* name = ::tab_search::mojom::blink::PageHandlerFactory::Name_;
return mojo::internal::ValidateRequestGeneric(message, name, kPageHandlerFactoryValidationInfo);
}
const char PageHandler::Name_[] = "tab_search.mojom.PageHandler";
std::pair<uint32_t, const void*> PageHandler::MessageToMethodInfo_(mojo::Message& message) {
switch (message.name()) {
case internal::kPageHandler_CloseTab_Name: {
constexpr uint32_t value = base::MD5Hash32Constexpr(
"(Impl)tab_search::mojom::PageHandler::CloseTab");
#if BUILDFLAG(IS_FUCHSIA)
return std::make_pair(value, nullptr);
#else
return std::make_pair(value, reinterpret_cast<const void*>(&PageHandler::CloseTab_Sym::IPCSymbol));
#endif // BUILDFLAG(IS_FUCHSIA)
}
case internal::kPageHandler_GetProfileData_Name: {
constexpr uint32_t value = base::MD5Hash32Constexpr(
"(Impl)tab_search::mojom::PageHandler::GetProfileData");
#if BUILDFLAG(IS_FUCHSIA)
return std::make_pair(value, nullptr);
#else
return std::make_pair(value, reinterpret_cast<const void*>(&PageHandler::GetProfileData_Sym::IPCSymbol));
#endif // BUILDFLAG(IS_FUCHSIA)
}
case internal::kPageHandler_SwitchToTab_Name: {
constexpr uint32_t value = base::MD5Hash32Constexpr(
"(Impl)tab_search::mojom::PageHandler::SwitchToTab");
#if BUILDFLAG(IS_FUCHSIA)
return std::make_pair(value, nullptr);
#else
return std::make_pair(value, reinterpret_cast<const void*>(&PageHandler::SwitchToTab_Sym::IPCSymbol));
#endif // BUILDFLAG(IS_FUCHSIA)
}
case internal::kPageHandler_OpenRecentlyClosedEntry_Name: {
constexpr uint32_t value = base::MD5Hash32Constexpr(
"(Impl)tab_search::mojom::PageHandler::OpenRecentlyClosedEntry");
#if BUILDFLAG(IS_FUCHSIA)
return std::make_pair(value, nullptr);
#else
return std::make_pair(value, reinterpret_cast<const void*>(&PageHandler::OpenRecentlyClosedEntry_Sym::IPCSymbol));
#endif // BUILDFLAG(IS_FUCHSIA)
}
case internal::kPageHandler_SaveRecentlyClosedExpandedPref_Name: {
constexpr uint32_t value = base::MD5Hash32Constexpr(
"(Impl)tab_search::mojom::PageHandler::SaveRecentlyClosedExpandedPref");
#if BUILDFLAG(IS_FUCHSIA)
return std::make_pair(value, nullptr);
#else
return std::make_pair(value, reinterpret_cast<const void*>(&PageHandler::SaveRecentlyClosedExpandedPref_Sym::IPCSymbol));
#endif // BUILDFLAG(IS_FUCHSIA)
}
case internal::kPageHandler_ShowUI_Name: {
constexpr uint32_t value = base::MD5Hash32Constexpr(
"(Impl)tab_search::mojom::PageHandler::ShowUI");
#if BUILDFLAG(IS_FUCHSIA)
return std::make_pair(value, nullptr);
#else
return std::make_pair(value, reinterpret_cast<const void*>(&PageHandler::ShowUI_Sym::IPCSymbol));
#endif // BUILDFLAG(IS_FUCHSIA)
}
}
return std::make_pair(0, nullptr);
}
const char* PageHandler::MessageToMethodName_(mojo::Message& message) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
bool is_response = message.has_flag(mojo::Message::kFlagIsResponse);
if (!is_response) {
switch (message.name()) {
case internal::kPageHandler_CloseTab_Name:
return "Receive tab_search::mojom::PageHandler::CloseTab";
case internal::kPageHandler_GetProfileData_Name:
return "Receive tab_search::mojom::PageHandler::GetProfileData";
case internal::kPageHandler_SwitchToTab_Name:
return "Receive tab_search::mojom::PageHandler::SwitchToTab";
case internal::kPageHandler_OpenRecentlyClosedEntry_Name:
return "Receive tab_search::mojom::PageHandler::OpenRecentlyClosedEntry";
case internal::kPageHandler_SaveRecentlyClosedExpandedPref_Name:
return "Receive tab_search::mojom::PageHandler::SaveRecentlyClosedExpandedPref";
case internal::kPageHandler_ShowUI_Name:
return "Receive tab_search::mojom::PageHandler::ShowUI";
}
} else {
switch (message.name()) {
case internal::kPageHandler_CloseTab_Name:
return "Receive reply tab_search::mojom::PageHandler::CloseTab";
case internal::kPageHandler_GetProfileData_Name:
return "Receive reply tab_search::mojom::PageHandler::GetProfileData";
case internal::kPageHandler_SwitchToTab_Name:
return "Receive reply tab_search::mojom::PageHandler::SwitchToTab";
case internal::kPageHandler_OpenRecentlyClosedEntry_Name:
return "Receive reply tab_search::mojom::PageHandler::OpenRecentlyClosedEntry";
case internal::kPageHandler_SaveRecentlyClosedExpandedPref_Name:
return "Receive reply tab_search::mojom::PageHandler::SaveRecentlyClosedExpandedPref";
case internal::kPageHandler_ShowUI_Name:
return "Receive reply tab_search::mojom::PageHandler::ShowUI";
}
}
return "Receive unknown mojo message";
#else
bool is_response = message.has_flag(mojo::Message::kFlagIsResponse);
if (is_response) {
return "Receive mojo reply";
} else {
return "Receive mojo message";
}
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
}
#if !BUILDFLAG(IS_FUCHSIA)
void PageHandler::CloseTab_Sym::IPCSymbol() {
// This method's address is used for indetifiying the mojo method name after
// symblozation. So each IPCSymbol should have a unique address.
NO_CODE_FOLDING();
}
void PageHandler::GetProfileData_Sym::IPCSymbol() {
// This method's address is used for indetifiying the mojo method name after
// symblozation. So each IPCSymbol should have a unique address.
NO_CODE_FOLDING();
}
void PageHandler::SwitchToTab_Sym::IPCSymbol() {
// This method's address is used for indetifiying the mojo method name after
// symblozation. So each IPCSymbol should have a unique address.
NO_CODE_FOLDING();
}
void PageHandler::OpenRecentlyClosedEntry_Sym::IPCSymbol() {
// This method's address is used for indetifiying the mojo method name after
// symblozation. So each IPCSymbol should have a unique address.
NO_CODE_FOLDING();
}
void PageHandler::SaveRecentlyClosedExpandedPref_Sym::IPCSymbol() {
// This method's address is used for indetifiying the mojo method name after
// symblozation. So each IPCSymbol should have a unique address.
NO_CODE_FOLDING();
}
void PageHandler::ShowUI_Sym::IPCSymbol() {
// This method's address is used for indetifiying the mojo method name after
// symblozation. So each IPCSymbol should have a unique address.
NO_CODE_FOLDING();
}
# endif // !BUILDFLAG(IS_FUCHSIA)
class PageHandler_GetProfileData_ForwardToCallback
: public mojo::MessageReceiver {
public:
PageHandler_GetProfileData_ForwardToCallback(
PageHandler::GetProfileDataCallback callback
) : callback_(std::move(callback)) {
}
PageHandler_GetProfileData_ForwardToCallback(const PageHandler_GetProfileData_ForwardToCallback&) = delete;
PageHandler_GetProfileData_ForwardToCallback& operator=(const PageHandler_GetProfileData_ForwardToCallback&) = delete;
bool Accept(mojo::Message* message) override;
private:
PageHandler::GetProfileDataCallback callback_;
};
PageHandlerProxy::PageHandlerProxy(mojo::MessageReceiverWithResponder* receiver)
: receiver_(receiver) {
}
void PageHandlerProxy::CloseTab(
int32_t in_tab_id) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
TRACE_EVENT1(
"mojom", "Send tab_search::mojom::PageHandler::CloseTab", "input_parameters",
[&](perfetto::TracedValue context){
auto dict = std::move(context).WriteDictionary();
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem("tab_id"), in_tab_id,
"<value of type int32_t>");
});
#endif
const bool kExpectsResponse = false;
const bool kIsSync = false;
const bool kAllowInterrupt = true;
const uint32_t kFlags =
((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
((kIsSync) ? mojo::Message::kFlagIsSync : 0) |
((kAllowInterrupt) ? 0 : mojo::Message::kFlagNoInterrupt);
mojo::Message message(
internal::kPageHandler_CloseTab_Name, kFlags, 0, 0, nullptr);
mojo::internal::MessageFragment<
::tab_search::mojom::internal::PageHandler_CloseTab_Params_Data> params(
message);
params.Allocate();
params->tab_id = in_tab_id;
#if defined(ENABLE_IPC_FUZZER)
message.set_interface_name(PageHandler::Name_);
message.set_method_name("CloseTab");
#endif
// This return value may be ignored as false implies the Connector has
// encountered an error, which will be visible through other means.
::mojo::internal::SendMessage(*receiver_, message);
}
void PageHandlerProxy::GetProfileData(
GetProfileDataCallback callback) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
TRACE_EVENT0("mojom", "Send tab_search::mojom::PageHandler::GetProfileData");
#endif
const bool kExpectsResponse = true;
const bool kIsSync = false;
const bool kAllowInterrupt = true;
const uint32_t kFlags =
((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
((kIsSync) ? mojo::Message::kFlagIsSync : 0) |
((kAllowInterrupt) ? 0 : mojo::Message::kFlagNoInterrupt);
mojo::Message message(
internal::kPageHandler_GetProfileData_Name, kFlags, 0, 0, nullptr);
mojo::internal::MessageFragment<
::tab_search::mojom::internal::PageHandler_GetProfileData_Params_Data> params(
message);
params.Allocate();
#if defined(ENABLE_IPC_FUZZER)
message.set_interface_name(PageHandler::Name_);
message.set_method_name("GetProfileData");
#endif
std::unique_ptr<mojo::MessageReceiver> responder(
new PageHandler_GetProfileData_ForwardToCallback(
std::move(callback)));
::mojo::internal::SendMessage(*receiver_, message, std::move(responder));
}
void PageHandlerProxy::SwitchToTab(
SwitchToTabInfoPtr in_switch_to_tab_info) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
TRACE_EVENT1(
"mojom", "Send tab_search::mojom::PageHandler::SwitchToTab", "input_parameters",
[&](perfetto::TracedValue context){
auto dict = std::move(context).WriteDictionary();
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem("switch_to_tab_info"), in_switch_to_tab_info,
"<value of type SwitchToTabInfoPtr>");
});
#endif
const bool kExpectsResponse = false;
const bool kIsSync = false;
const bool kAllowInterrupt = true;
const uint32_t kFlags =
((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
((kIsSync) ? mojo::Message::kFlagIsSync : 0) |
((kAllowInterrupt) ? 0 : mojo::Message::kFlagNoInterrupt);
mojo::Message message(
internal::kPageHandler_SwitchToTab_Name, kFlags, 0, 0, nullptr);
mojo::internal::MessageFragment<
::tab_search::mojom::internal::PageHandler_SwitchToTab_Params_Data> params(
message);
params.Allocate();
mojo::internal::MessageFragment<
typename decltype(params->switch_to_tab_info)::BaseType> switch_to_tab_info_fragment(
params.message());
mojo::internal::Serialize<::tab_search::mojom::SwitchToTabInfoDataView>(
in_switch_to_tab_info, switch_to_tab_info_fragment);
params->switch_to_tab_info.Set(
switch_to_tab_info_fragment.is_null() ? nullptr : switch_to_tab_info_fragment.data());
MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
params->switch_to_tab_info.is_null(),
mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
"null switch_to_tab_info in PageHandler.SwitchToTab request");
#if defined(ENABLE_IPC_FUZZER)
message.set_interface_name(PageHandler::Name_);
message.set_method_name("SwitchToTab");
#endif
// This return value may be ignored as false implies the Connector has
// encountered an error, which will be visible through other means.
::mojo::internal::SendMessage(*receiver_, message);
}
void PageHandlerProxy::OpenRecentlyClosedEntry(
int32_t in_session_id) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
TRACE_EVENT1(
"mojom", "Send tab_search::mojom::PageHandler::OpenRecentlyClosedEntry", "input_parameters",
[&](perfetto::TracedValue context){
auto dict = std::move(context).WriteDictionary();
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem("session_id"), in_session_id,
"<value of type int32_t>");
});
#endif
const bool kExpectsResponse = false;
const bool kIsSync = false;
const bool kAllowInterrupt = true;
const uint32_t kFlags =
((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
((kIsSync) ? mojo::Message::kFlagIsSync : 0) |
((kAllowInterrupt) ? 0 : mojo::Message::kFlagNoInterrupt);
mojo::Message message(
internal::kPageHandler_OpenRecentlyClosedEntry_Name, kFlags, 0, 0, nullptr);
mojo::internal::MessageFragment<
::tab_search::mojom::internal::PageHandler_OpenRecentlyClosedEntry_Params_Data> params(
message);
params.Allocate();
params->session_id = in_session_id;
#if defined(ENABLE_IPC_FUZZER)
message.set_interface_name(PageHandler::Name_);
message.set_method_name("OpenRecentlyClosedEntry");
#endif
// This return value may be ignored as false implies the Connector has
// encountered an error, which will be visible through other means.
::mojo::internal::SendMessage(*receiver_, message);
}
void PageHandlerProxy::SaveRecentlyClosedExpandedPref(
bool in_expanded) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
TRACE_EVENT1(
"mojom", "Send tab_search::mojom::PageHandler::SaveRecentlyClosedExpandedPref", "input_parameters",
[&](perfetto::TracedValue context){
auto dict = std::move(context).WriteDictionary();
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem("expanded"), in_expanded,
"<value of type bool>");
});
#endif
const bool kExpectsResponse = false;
const bool kIsSync = false;
const bool kAllowInterrupt = true;
const uint32_t kFlags =
((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
((kIsSync) ? mojo::Message::kFlagIsSync : 0) |
((kAllowInterrupt) ? 0 : mojo::Message::kFlagNoInterrupt);
mojo::Message message(
internal::kPageHandler_SaveRecentlyClosedExpandedPref_Name, kFlags, 0, 0, nullptr);
mojo::internal::MessageFragment<
::tab_search::mojom::internal::PageHandler_SaveRecentlyClosedExpandedPref_Params_Data> params(
message);
params.Allocate();
params->expanded = in_expanded;
#if defined(ENABLE_IPC_FUZZER)
message.set_interface_name(PageHandler::Name_);
message.set_method_name("SaveRecentlyClosedExpandedPref");
#endif
// This return value may be ignored as false implies the Connector has
// encountered an error, which will be visible through other means.
::mojo::internal::SendMessage(*receiver_, message);
}
void PageHandlerProxy::ShowUI(
) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
TRACE_EVENT0("mojom", "Send tab_search::mojom::PageHandler::ShowUI");
#endif
const bool kExpectsResponse = false;
const bool kIsSync = false;
const bool kAllowInterrupt = true;
const uint32_t kFlags =
((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
((kIsSync) ? mojo::Message::kFlagIsSync : 0) |
((kAllowInterrupt) ? 0 : mojo::Message::kFlagNoInterrupt);
mojo::Message message(
internal::kPageHandler_ShowUI_Name, kFlags, 0, 0, nullptr);
mojo::internal::MessageFragment<
::tab_search::mojom::internal::PageHandler_ShowUI_Params_Data> params(
message);
params.Allocate();
#if defined(ENABLE_IPC_FUZZER)
message.set_interface_name(PageHandler::Name_);
message.set_method_name("ShowUI");
#endif
// This return value may be ignored as false implies the Connector has
// encountered an error, which will be visible through other means.
::mojo::internal::SendMessage(*receiver_, message);
}
class PageHandler_GetProfileData_ProxyToResponder : public ::mojo::internal::ProxyToResponder {
public:
static PageHandler::GetProfileDataCallback CreateCallback(
::mojo::Message& message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) {
std::unique_ptr<PageHandler_GetProfileData_ProxyToResponder> proxy(
new PageHandler_GetProfileData_ProxyToResponder(
message, std::move(responder)));
return base::BindOnce(&PageHandler_GetProfileData_ProxyToResponder::Run,
std::move(proxy));
}
~PageHandler_GetProfileData_ProxyToResponder() {
#if DCHECK_IS_ON()
if (responder_) {
// If we're being destroyed without being run, we want to ensure the
// binding endpoint has been closed. This checks for that asynchronously.
// We pass a bound generated callback to handle the response so that any
// resulting DCHECK stack will have useful interface type information.
responder_->IsConnectedAsync(base::BindOnce(&OnIsConnectedComplete));
}
#endif
}
private:
PageHandler_GetProfileData_ProxyToResponder(
::mojo::Message& message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder)
: ::mojo::internal::ProxyToResponder(message, std::move(responder)) {
}
#if DCHECK_IS_ON()
static void OnIsConnectedComplete(bool connected) {
DCHECK(!connected)
<< "PageHandler::GetProfileDataCallback was destroyed without "
<< "first either being run or its corresponding binding being closed. "
<< "It is an error to drop response callbacks which still correspond "
<< "to an open interface pipe.";
}
#endif
void Run(
ProfileDataPtr in_profile_data);
};
bool PageHandler_GetProfileData_ForwardToCallback::Accept(
mojo::Message* message) {
DCHECK(message->is_serialized());
internal::PageHandler_GetProfileData_ResponseParams_Data* params =
reinterpret_cast<
internal::PageHandler_GetProfileData_ResponseParams_Data*>(
message->mutable_payload());
bool success = true;
ProfileDataPtr p_profile_data{};
PageHandler_GetProfileData_ResponseParamsDataView input_data_view(params, message);
if (success && !input_data_view.ReadProfileData(&p_profile_data))
success = false;
if (!success) {
ReportValidationErrorForMessage(
message,
mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
PageHandler::Name_, 1, true);
return false;
}
if (!callback_.is_null())
std::move(callback_).Run(
std::move(p_profile_data));
return true;
}
void PageHandler_GetProfileData_ProxyToResponder::Run(
ProfileDataPtr in_profile_data) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
TRACE_EVENT1(
"mojom", "Send reply tab_search::mojom::PageHandler::GetProfileData", "async_response_parameters",
[&](perfetto::TracedValue context){
auto dict = std::move(context).WriteDictionary();
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem("profile_data"), in_profile_data,
"<value of type ProfileDataPtr>");
});
#endif
const uint32_t kFlags = mojo::Message::kFlagIsResponse |
((is_sync_) ? mojo::Message::kFlagIsSync : 0) |
((true) ? 0 : mojo::Message::kFlagNoInterrupt);
mojo::Message message(
internal::kPageHandler_GetProfileData_Name, kFlags, 0, 0, nullptr);
mojo::internal::MessageFragment<
::tab_search::mojom::internal::PageHandler_GetProfileData_ResponseParams_Data> params(
message);
params.Allocate();
mojo::internal::MessageFragment<
typename decltype(params->profile_data)::BaseType> profile_data_fragment(
params.message());
mojo::internal::Serialize<::tab_search::mojom::ProfileDataDataView>(
in_profile_data, profile_data_fragment);
params->profile_data.Set(
profile_data_fragment.is_null() ? nullptr : profile_data_fragment.data());
MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
params->profile_data.is_null(),
mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
"null profile_data in ");
#if defined(ENABLE_IPC_FUZZER)
message.set_interface_name(PageHandler::Name_);
message.set_method_name("GetProfileData");
#endif
message.set_request_id(request_id_);
message.set_trace_nonce(trace_nonce_);
::mojo::internal::SendMessage(*responder_, message);
// SendMessage fails silently if the responder connection is closed,
// or if the message is malformed.
//
// TODO(darin): If Accept() returns false due to a malformed message, that
// may be good reason to close the connection. However, we don't have a
// way to do that from here. We should add a way.
responder_ = nullptr;
}
// static
bool PageHandlerStubDispatch::Accept(
PageHandler* impl,
mojo::Message* message) {
switch (message->header()->name) {
case internal::kPageHandler_CloseTab_Name: {
DCHECK(message->is_serialized());
internal::PageHandler_CloseTab_Params_Data* params =
reinterpret_cast<internal::PageHandler_CloseTab_Params_Data*>(
message->mutable_payload());
bool success = true;
int32_t p_tab_id{};
PageHandler_CloseTab_ParamsDataView input_data_view(params, message);
if (success)
p_tab_id = input_data_view.tab_id();
if (!success) {
ReportValidationErrorForMessage(
message,
mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
PageHandler::Name_, 0, false);
return false;
}
// A null |impl| means no implementation was bound.
DCHECK(impl);
impl->CloseTab(
std::move(p_tab_id));
return true;
}
case internal::kPageHandler_GetProfileData_Name: {
break;
}
case internal::kPageHandler_SwitchToTab_Name: {
DCHECK(message->is_serialized());
internal::PageHandler_SwitchToTab_Params_Data* params =
reinterpret_cast<internal::PageHandler_SwitchToTab_Params_Data*>(
message->mutable_payload());
bool success = true;
SwitchToTabInfoPtr p_switch_to_tab_info{};
PageHandler_SwitchToTab_ParamsDataView input_data_view(params, message);
if (success && !input_data_view.ReadSwitchToTabInfo(&p_switch_to_tab_info))
success = false;
if (!success) {
ReportValidationErrorForMessage(
message,
mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
PageHandler::Name_, 2, false);
return false;
}
// A null |impl| means no implementation was bound.
DCHECK(impl);
impl->SwitchToTab(
std::move(p_switch_to_tab_info));
return true;
}
case internal::kPageHandler_OpenRecentlyClosedEntry_Name: {
DCHECK(message->is_serialized());
internal::PageHandler_OpenRecentlyClosedEntry_Params_Data* params =
reinterpret_cast<internal::PageHandler_OpenRecentlyClosedEntry_Params_Data*>(
message->mutable_payload());
bool success = true;
int32_t p_session_id{};
PageHandler_OpenRecentlyClosedEntry_ParamsDataView input_data_view(params, message);
if (success)
p_session_id = input_data_view.session_id();
if (!success) {
ReportValidationErrorForMessage(
message,
mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
PageHandler::Name_, 3, false);
return false;
}
// A null |impl| means no implementation was bound.
DCHECK(impl);
impl->OpenRecentlyClosedEntry(
std::move(p_session_id));
return true;
}
case internal::kPageHandler_SaveRecentlyClosedExpandedPref_Name: {
DCHECK(message->is_serialized());
internal::PageHandler_SaveRecentlyClosedExpandedPref_Params_Data* params =
reinterpret_cast<internal::PageHandler_SaveRecentlyClosedExpandedPref_Params_Data*>(
message->mutable_payload());
bool success = true;
bool p_expanded{};
PageHandler_SaveRecentlyClosedExpandedPref_ParamsDataView input_data_view(params, message);
if (success)
p_expanded = input_data_view.expanded();
if (!success) {
ReportValidationErrorForMessage(
message,
mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
PageHandler::Name_, 4, false);
return false;
}
// A null |impl| means no implementation was bound.
DCHECK(impl);
impl->SaveRecentlyClosedExpandedPref(
std::move(p_expanded));
return true;
}
case internal::kPageHandler_ShowUI_Name: {
DCHECK(message->is_serialized());
internal::PageHandler_ShowUI_Params_Data* params =
reinterpret_cast<internal::PageHandler_ShowUI_Params_Data*>(
message->mutable_payload());
bool success = true;
PageHandler_ShowUI_ParamsDataView input_data_view(params, message);
if (!success) {
ReportValidationErrorForMessage(
message,
mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
PageHandler::Name_, 5, false);
return false;
}
// A null |impl| means no implementation was bound.
DCHECK(impl);
impl->ShowUI();
return true;
}
}
return false;
}
// static
bool PageHandlerStubDispatch::AcceptWithResponder(
PageHandler* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) {
[[maybe_unused]] const bool message_is_sync =
message->has_flag(mojo::Message::kFlagIsSync);
[[maybe_unused]] const uint64_t request_id = message->request_id();
switch (message->header()->name) {
case internal::kPageHandler_CloseTab_Name: {
break;
}
case internal::kPageHandler_GetProfileData_Name: {
internal::PageHandler_GetProfileData_Params_Data* params =
reinterpret_cast<
internal::PageHandler_GetProfileData_Params_Data*>(
message->mutable_payload());
bool success = true;
PageHandler_GetProfileData_ParamsDataView input_data_view(params, message);
if (!success) {
ReportValidationErrorForMessage(
message,
mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
PageHandler::Name_, 1, false);
return false;
}
PageHandler::GetProfileDataCallback callback =
PageHandler_GetProfileData_ProxyToResponder::CreateCallback(
*message, std::move(responder));
// A null |impl| means no implementation was bound.
DCHECK(impl);
impl->GetProfileData(std::move(callback));
return true;
}
case internal::kPageHandler_SwitchToTab_Name: {
break;
}
case internal::kPageHandler_OpenRecentlyClosedEntry_Name: {
break;
}
case internal::kPageHandler_SaveRecentlyClosedExpandedPref_Name: {
break;
}
case internal::kPageHandler_ShowUI_Name: {
break;
}
}
return false;
}
static const std::pair<uint32_t, mojo::internal::GenericValidationInfo> kPageHandlerValidationInfo[] = {
{internal::kPageHandler_CloseTab_Name,
{&internal::PageHandler_CloseTab_Params_Data::Validate,
nullptr /* no response */}},
{internal::kPageHandler_GetProfileData_Name,
{&internal::PageHandler_GetProfileData_Params_Data::Validate,
&internal::PageHandler_GetProfileData_ResponseParams_Data::Validate}},
{internal::kPageHandler_SwitchToTab_Name,
{&internal::PageHandler_SwitchToTab_Params_Data::Validate,
nullptr /* no response */}},
{internal::kPageHandler_OpenRecentlyClosedEntry_Name,
{&internal::PageHandler_OpenRecentlyClosedEntry_Params_Data::Validate,
nullptr /* no response */}},
{internal::kPageHandler_SaveRecentlyClosedExpandedPref_Name,
{&internal::PageHandler_SaveRecentlyClosedExpandedPref_Params_Data::Validate,
nullptr /* no response */}},
{internal::kPageHandler_ShowUI_Name,
{&internal::PageHandler_ShowUI_Params_Data::Validate,
nullptr /* no response */}},
};
bool PageHandlerRequestValidator::Accept(mojo::Message* message) {
const char* name = ::tab_search::mojom::blink::PageHandler::Name_;
return mojo::internal::ValidateRequestGeneric(message, name, kPageHandlerValidationInfo);
}
bool PageHandlerResponseValidator::Accept(mojo::Message* message) {
const char* name = ::tab_search::mojom::blink::PageHandler::Name_;
return mojo::internal::ValidateResponseGeneric(message, name, kPageHandlerValidationInfo);
}
const char Page::Name_[] = "tab_search.mojom.Page";
std::pair<uint32_t, const void*> Page::MessageToMethodInfo_(mojo::Message& message) {
switch (message.name()) {
case internal::kPage_TabsChanged_Name: {
constexpr uint32_t value = base::MD5Hash32Constexpr(
"(Impl)tab_search::mojom::Page::TabsChanged");
#if BUILDFLAG(IS_FUCHSIA)
return std::make_pair(value, nullptr);
#else
return std::make_pair(value, reinterpret_cast<const void*>(&Page::TabsChanged_Sym::IPCSymbol));
#endif // BUILDFLAG(IS_FUCHSIA)
}
case internal::kPage_TabUpdated_Name: {
constexpr uint32_t value = base::MD5Hash32Constexpr(
"(Impl)tab_search::mojom::Page::TabUpdated");
#if BUILDFLAG(IS_FUCHSIA)
return std::make_pair(value, nullptr);
#else
return std::make_pair(value, reinterpret_cast<const void*>(&Page::TabUpdated_Sym::IPCSymbol));
#endif // BUILDFLAG(IS_FUCHSIA)
}
case internal::kPage_TabsRemoved_Name: {
constexpr uint32_t value = base::MD5Hash32Constexpr(
"(Impl)tab_search::mojom::Page::TabsRemoved");
#if BUILDFLAG(IS_FUCHSIA)
return std::make_pair(value, nullptr);
#else
return std::make_pair(value, reinterpret_cast<const void*>(&Page::TabsRemoved_Sym::IPCSymbol));
#endif // BUILDFLAG(IS_FUCHSIA)
}
}
return std::make_pair(0, nullptr);
}
const char* Page::MessageToMethodName_(mojo::Message& message) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
bool is_response = message.has_flag(mojo::Message::kFlagIsResponse);
if (!is_response) {
switch (message.name()) {
case internal::kPage_TabsChanged_Name:
return "Receive tab_search::mojom::Page::TabsChanged";
case internal::kPage_TabUpdated_Name:
return "Receive tab_search::mojom::Page::TabUpdated";
case internal::kPage_TabsRemoved_Name:
return "Receive tab_search::mojom::Page::TabsRemoved";
}
} else {
switch (message.name()) {
case internal::kPage_TabsChanged_Name:
return "Receive reply tab_search::mojom::Page::TabsChanged";
case internal::kPage_TabUpdated_Name:
return "Receive reply tab_search::mojom::Page::TabUpdated";
case internal::kPage_TabsRemoved_Name:
return "Receive reply tab_search::mojom::Page::TabsRemoved";
}
}
return "Receive unknown mojo message";
#else
bool is_response = message.has_flag(mojo::Message::kFlagIsResponse);
if (is_response) {
return "Receive mojo reply";
} else {
return "Receive mojo message";
}
#endif // BUILDFLAG(MOJO_TRACE_ENABLED)
}
#if !BUILDFLAG(IS_FUCHSIA)
void Page::TabsChanged_Sym::IPCSymbol() {
// This method's address is used for indetifiying the mojo method name after
// symblozation. So each IPCSymbol should have a unique address.
NO_CODE_FOLDING();
}
void Page::TabUpdated_Sym::IPCSymbol() {
// This method's address is used for indetifiying the mojo method name after
// symblozation. So each IPCSymbol should have a unique address.
NO_CODE_FOLDING();
}
void Page::TabsRemoved_Sym::IPCSymbol() {
// This method's address is used for indetifiying the mojo method name after
// symblozation. So each IPCSymbol should have a unique address.
NO_CODE_FOLDING();
}
# endif // !BUILDFLAG(IS_FUCHSIA)
PageProxy::PageProxy(mojo::MessageReceiverWithResponder* receiver)
: receiver_(receiver) {
}
void PageProxy::TabsChanged(
ProfileDataPtr in_profile_tabs) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
TRACE_EVENT1(
"mojom", "Send tab_search::mojom::Page::TabsChanged", "input_parameters",
[&](perfetto::TracedValue context){
auto dict = std::move(context).WriteDictionary();
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem("profile_tabs"), in_profile_tabs,
"<value of type ProfileDataPtr>");
});
#endif
const bool kExpectsResponse = false;
const bool kIsSync = false;
const bool kAllowInterrupt = true;
const uint32_t kFlags =
((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
((kIsSync) ? mojo::Message::kFlagIsSync : 0) |
((kAllowInterrupt) ? 0 : mojo::Message::kFlagNoInterrupt);
mojo::Message message(
internal::kPage_TabsChanged_Name, kFlags, 0, 0, nullptr);
mojo::internal::MessageFragment<
::tab_search::mojom::internal::Page_TabsChanged_Params_Data> params(
message);
params.Allocate();
mojo::internal::MessageFragment<
typename decltype(params->profile_tabs)::BaseType> profile_tabs_fragment(
params.message());
mojo::internal::Serialize<::tab_search::mojom::ProfileDataDataView>(
in_profile_tabs, profile_tabs_fragment);
params->profile_tabs.Set(
profile_tabs_fragment.is_null() ? nullptr : profile_tabs_fragment.data());
MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
params->profile_tabs.is_null(),
mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
"null profile_tabs in Page.TabsChanged request");
#if defined(ENABLE_IPC_FUZZER)
message.set_interface_name(Page::Name_);
message.set_method_name("TabsChanged");
#endif
// This return value may be ignored as false implies the Connector has
// encountered an error, which will be visible through other means.
::mojo::internal::SendMessage(*receiver_, message);
}
void PageProxy::TabUpdated(
TabUpdateInfoPtr in_tabUpdateInfo) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
TRACE_EVENT1(
"mojom", "Send tab_search::mojom::Page::TabUpdated", "input_parameters",
[&](perfetto::TracedValue context){
auto dict = std::move(context).WriteDictionary();
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem("tabUpdateInfo"), in_tabUpdateInfo,
"<value of type TabUpdateInfoPtr>");
});
#endif
const bool kExpectsResponse = false;
const bool kIsSync = false;
const bool kAllowInterrupt = true;
const uint32_t kFlags =
((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
((kIsSync) ? mojo::Message::kFlagIsSync : 0) |
((kAllowInterrupt) ? 0 : mojo::Message::kFlagNoInterrupt);
mojo::Message message(
internal::kPage_TabUpdated_Name, kFlags, 0, 0, nullptr);
mojo::internal::MessageFragment<
::tab_search::mojom::internal::Page_TabUpdated_Params_Data> params(
message);
params.Allocate();
mojo::internal::MessageFragment<
typename decltype(params->tabUpdateInfo)::BaseType> tabUpdateInfo_fragment(
params.message());
mojo::internal::Serialize<::tab_search::mojom::TabUpdateInfoDataView>(
in_tabUpdateInfo, tabUpdateInfo_fragment);
params->tabUpdateInfo.Set(
tabUpdateInfo_fragment.is_null() ? nullptr : tabUpdateInfo_fragment.data());
MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
params->tabUpdateInfo.is_null(),
mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
"null tabUpdateInfo in Page.TabUpdated request");
#if defined(ENABLE_IPC_FUZZER)
message.set_interface_name(Page::Name_);
message.set_method_name("TabUpdated");
#endif
// This return value may be ignored as false implies the Connector has
// encountered an error, which will be visible through other means.
::mojo::internal::SendMessage(*receiver_, message);
}
void PageProxy::TabsRemoved(
TabsRemovedInfoPtr in_tabsRemovedInfo) {
#if BUILDFLAG(MOJO_TRACE_ENABLED)
TRACE_EVENT1(
"mojom", "Send tab_search::mojom::Page::TabsRemoved", "input_parameters",
[&](perfetto::TracedValue context){
auto dict = std::move(context).WriteDictionary();
perfetto::WriteIntoTracedValueWithFallback(
dict.AddItem("tabsRemovedInfo"), in_tabsRemovedInfo,
"<value of type TabsRemovedInfoPtr>");
});
#endif
const bool kExpectsResponse = false;
const bool kIsSync = false;
const bool kAllowInterrupt = true;
const uint32_t kFlags =
((kExpectsResponse) ? mojo::Message::kFlagExpectsResponse : 0) |
((kIsSync) ? mojo::Message::kFlagIsSync : 0) |
((kAllowInterrupt) ? 0 : mojo::Message::kFlagNoInterrupt);
mojo::Message message(
internal::kPage_TabsRemoved_Name, kFlags, 0, 0, nullptr);
mojo::internal::MessageFragment<
::tab_search::mojom::internal::Page_TabsRemoved_Params_Data> params(
message);
params.Allocate();
mojo::internal::MessageFragment<
typename decltype(params->tabsRemovedInfo)::BaseType> tabsRemovedInfo_fragment(
params.message());
mojo::internal::Serialize<::tab_search::mojom::TabsRemovedInfoDataView>(
in_tabsRemovedInfo, tabsRemovedInfo_fragment);
params->tabsRemovedInfo.Set(
tabsRemovedInfo_fragment.is_null() ? nullptr : tabsRemovedInfo_fragment.data());
MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
params->tabsRemovedInfo.is_null(),
mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
"null tabsRemovedInfo in Page.TabsRemoved request");
#if defined(ENABLE_IPC_FUZZER)
message.set_interface_name(Page::Name_);
message.set_method_name("TabsRemoved");
#endif
// This return value may be ignored as false implies the Connector has
// encountered an error, which will be visible through other means.
::mojo::internal::SendMessage(*receiver_, message);
}
// static
bool PageStubDispatch::Accept(
Page* impl,
mojo::Message* message) {
switch (message->header()->name) {
case internal::kPage_TabsChanged_Name: {
DCHECK(message->is_serialized());
internal::Page_TabsChanged_Params_Data* params =
reinterpret_cast<internal::Page_TabsChanged_Params_Data*>(
message->mutable_payload());
bool success = true;
ProfileDataPtr p_profile_tabs{};
Page_TabsChanged_ParamsDataView input_data_view(params, message);
if (success && !input_data_view.ReadProfileTabs(&p_profile_tabs))
success = false;
if (!success) {
ReportValidationErrorForMessage(
message,
mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
Page::Name_, 0, false);
return false;
}
// A null |impl| means no implementation was bound.
DCHECK(impl);
impl->TabsChanged(
std::move(p_profile_tabs));
return true;
}
case internal::kPage_TabUpdated_Name: {
DCHECK(message->is_serialized());
internal::Page_TabUpdated_Params_Data* params =
reinterpret_cast<internal::Page_TabUpdated_Params_Data*>(
message->mutable_payload());
bool success = true;
TabUpdateInfoPtr p_tabUpdateInfo{};
Page_TabUpdated_ParamsDataView input_data_view(params, message);
if (success && !input_data_view.ReadTabUpdateInfo(&p_tabUpdateInfo))
success = false;
if (!success) {
ReportValidationErrorForMessage(
message,
mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
Page::Name_, 1, false);
return false;
}
// A null |impl| means no implementation was bound.
DCHECK(impl);
impl->TabUpdated(
std::move(p_tabUpdateInfo));
return true;
}
case internal::kPage_TabsRemoved_Name: {
DCHECK(message->is_serialized());
internal::Page_TabsRemoved_Params_Data* params =
reinterpret_cast<internal::Page_TabsRemoved_Params_Data*>(
message->mutable_payload());
bool success = true;
TabsRemovedInfoPtr p_tabsRemovedInfo{};
Page_TabsRemoved_ParamsDataView input_data_view(params, message);
if (success && !input_data_view.ReadTabsRemovedInfo(&p_tabsRemovedInfo))
success = false;
if (!success) {
ReportValidationErrorForMessage(
message,
mojo::internal::VALIDATION_ERROR_DESERIALIZATION_FAILED,
Page::Name_, 2, false);
return false;
}
// A null |impl| means no implementation was bound.
DCHECK(impl);
impl->TabsRemoved(
std::move(p_tabsRemovedInfo));
return true;
}
}
return false;
}
// static
bool PageStubDispatch::AcceptWithResponder(
Page* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) {
[[maybe_unused]] const bool message_is_sync =
message->has_flag(mojo::Message::kFlagIsSync);
[[maybe_unused]] const uint64_t request_id = message->request_id();
switch (message->header()->name) {
case internal::kPage_TabsChanged_Name: {
break;
}
case internal::kPage_TabUpdated_Name: {
break;
}
case internal::kPage_TabsRemoved_Name: {
break;
}
}
return false;
}
static const std::pair<uint32_t, mojo::internal::GenericValidationInfo> kPageValidationInfo[] = {
{internal::kPage_TabsChanged_Name,
{&internal::Page_TabsChanged_Params_Data::Validate,
nullptr /* no response */}},
{internal::kPage_TabUpdated_Name,
{&internal::Page_TabUpdated_Params_Data::Validate,
nullptr /* no response */}},
{internal::kPage_TabsRemoved_Name,
{&internal::Page_TabsRemoved_Params_Data::Validate,
nullptr /* no response */}},
};
bool PageRequestValidator::Accept(mojo::Message* message) {
const char* name = ::tab_search::mojom::blink::Page::Name_;
return mojo::internal::ValidateRequestGeneric(message, name, kPageValidationInfo);
}
} // namespace blink
} // namespace mojom
} // namespace tab_search
namespace mojo {
// static
bool StructTraits<::tab_search::mojom::blink::ProfileData::DataView, ::tab_search::mojom::blink::ProfileDataPtr>::Read(
::tab_search::mojom::blink::ProfileData::DataView input,
::tab_search::mojom::blink::ProfileDataPtr* output) {
bool success = true;
::tab_search::mojom::blink::ProfileDataPtr result(::tab_search::mojom::blink::ProfileData::New());
if (success && !input.ReadWindows(&result->windows))
success = false;
if (success && !input.ReadTabGroups(&result->tab_groups))
success = false;
if (success && !input.ReadRecentlyClosedTabs(&result->recently_closed_tabs))
success = false;
if (success && !input.ReadRecentlyClosedTabGroups(&result->recently_closed_tab_groups))
success = false;
if (success)
result->recently_closed_section_expanded = input.recently_closed_section_expanded();
*output = std::move(result);
return success;
}
// static
bool StructTraits<::tab_search::mojom::blink::Window::DataView, ::tab_search::mojom::blink::WindowPtr>::Read(
::tab_search::mojom::blink::Window::DataView input,
::tab_search::mojom::blink::WindowPtr* output) {
bool success = true;
::tab_search::mojom::blink::WindowPtr result(::tab_search::mojom::blink::Window::New());
if (success)
result->active = input.active();
if (success)
result->height = input.height();
if (success && !input.ReadTabs(&result->tabs))
success = false;
*output = std::move(result);
return success;
}
// static
bool StructTraits<::tab_search::mojom::blink::Tab::DataView, ::tab_search::mojom::blink::TabPtr>::Read(
::tab_search::mojom::blink::Tab::DataView input,
::tab_search::mojom::blink::TabPtr* output) {
bool success = true;
::tab_search::mojom::blink::TabPtr result(::tab_search::mojom::blink::Tab::New());
if (success)
result->active = input.active();
if (success && !input.ReadAlertStates(&result->alert_states))
success = false;
if (success)
result->index = input.index();
if (success)
result->tab_id = input.tab_id();
if (success && !input.ReadGroupId(&result->group_id))
success = false;
if (success)
result->pinned = input.pinned();
if (success && !input.ReadTitle(&result->title))
success = false;
if (success && !input.ReadUrl(&result->url))
success = false;
if (success && !input.ReadFaviconUrl(&result->favicon_url))
success = false;
if (success)
result->is_default_favicon = input.is_default_favicon();
if (success)
result->show_icon = input.show_icon();
if (success && !input.ReadLastActiveTimeTicks(&result->last_active_time_ticks))
success = false;
if (success && !input.ReadLastActiveElapsedText(&result->last_active_elapsed_text))
success = false;
*output = std::move(result);
return success;
}
// static
bool StructTraits<::tab_search::mojom::blink::RecentlyClosedTab::DataView, ::tab_search::mojom::blink::RecentlyClosedTabPtr>::Read(
::tab_search::mojom::blink::RecentlyClosedTab::DataView input,
::tab_search::mojom::blink::RecentlyClosedTabPtr* output) {
bool success = true;
::tab_search::mojom::blink::RecentlyClosedTabPtr result(::tab_search::mojom::blink::RecentlyClosedTab::New());
if (success)
result->tab_id = input.tab_id();
if (success && !input.ReadGroupId(&result->group_id))
success = false;
if (success && !input.ReadTitle(&result->title))
success = false;
if (success && !input.ReadUrl(&result->url))
success = false;
if (success && !input.ReadLastActiveTime(&result->last_active_time))
success = false;
if (success && !input.ReadLastActiveElapsedText(&result->last_active_elapsed_text))
success = false;
*output = std::move(result);
return success;
}
// static
bool StructTraits<::tab_search::mojom::blink::TabGroup::DataView, ::tab_search::mojom::blink::TabGroupPtr>::Read(
::tab_search::mojom::blink::TabGroup::DataView input,
::tab_search::mojom::blink::TabGroupPtr* output) {
bool success = true;
::tab_search::mojom::blink::TabGroupPtr result(::tab_search::mojom::blink::TabGroup::New());
if (success && !input.ReadId(&result->id))
success = false;
if (success && !input.ReadColor(&result->color))
success = false;
if (success && !input.ReadTitle(&result->title))
success = false;
*output = std::move(result);
return success;
}
// static
bool StructTraits<::tab_search::mojom::blink::RecentlyClosedTabGroup::DataView, ::tab_search::mojom::blink::RecentlyClosedTabGroupPtr>::Read(
::tab_search::mojom::blink::RecentlyClosedTabGroup::DataView input,
::tab_search::mojom::blink::RecentlyClosedTabGroupPtr* output) {
bool success = true;
::tab_search::mojom::blink::RecentlyClosedTabGroupPtr result(::tab_search::mojom::blink::RecentlyClosedTabGroup::New());
if (success)
result->session_id = input.session_id();
if (success && !input.ReadId(&result->id))
success = false;
if (success && !input.ReadColor(&result->color))
success = false;
if (success && !input.ReadTitle(&result->title))
success = false;
if (success)
result->tab_count = input.tab_count();
if (success && !input.ReadLastActiveTime(&result->last_active_time))
success = false;
if (success && !input.ReadLastActiveElapsedText(&result->last_active_elapsed_text))
success = false;
*output = std::move(result);
return success;
}
// static
bool StructTraits<::tab_search::mojom::blink::SwitchToTabInfo::DataView, ::tab_search::mojom::blink::SwitchToTabInfoPtr>::Read(
::tab_search::mojom::blink::SwitchToTabInfo::DataView input,
::tab_search::mojom::blink::SwitchToTabInfoPtr* output) {
bool success = true;
::tab_search::mojom::blink::SwitchToTabInfoPtr result(::tab_search::mojom::blink::SwitchToTabInfo::New());
if (success)
result->tab_id = input.tab_id();
*output = std::move(result);
return success;
}
// static
bool StructTraits<::tab_search::mojom::blink::TabUpdateInfo::DataView, ::tab_search::mojom::blink::TabUpdateInfoPtr>::Read(
::tab_search::mojom::blink::TabUpdateInfo::DataView input,
::tab_search::mojom::blink::TabUpdateInfoPtr* output) {
bool success = true;
::tab_search::mojom::blink::TabUpdateInfoPtr result(::tab_search::mojom::blink::TabUpdateInfo::New());
if (success)
result->in_active_window = input.in_active_window();
if (success && !input.ReadTab(&result->tab))
success = false;
*output = std::move(result);
return success;
}
// static
bool StructTraits<::tab_search::mojom::blink::TabsRemovedInfo::DataView, ::tab_search::mojom::blink::TabsRemovedInfoPtr>::Read(
::tab_search::mojom::blink::TabsRemovedInfo::DataView input,
::tab_search::mojom::blink::TabsRemovedInfoPtr* output) {
bool success = true;
::tab_search::mojom::blink::TabsRemovedInfoPtr result(::tab_search::mojom::blink::TabsRemovedInfo::New());
if (success && !input.ReadTabIds(&result->tab_ids))
success = false;
if (success && !input.ReadRecentlyClosedTabs(&result->recently_closed_tabs))
success = false;
*output = std::move(result);
return success;
}
} // namespace mojo
// Symbols declared in the -test-utils.h header are defined here instead of a
// separate .cc file to save compile time.
namespace tab_search {
namespace mojom {
namespace blink {
void PageHandlerFactoryInterceptorForTesting::CreatePageHandler(::mojo::PendingRemote<Page> page, ::mojo::PendingReceiver<PageHandler> handler) {
GetForwardingInterface()->CreatePageHandler(std::move(page), std::move(handler));
}
PageHandlerFactoryAsyncWaiter::PageHandlerFactoryAsyncWaiter(
PageHandlerFactory* proxy) : proxy_(proxy) {}
PageHandlerFactoryAsyncWaiter::~PageHandlerFactoryAsyncWaiter() = default;
void PageHandlerInterceptorForTesting::CloseTab(int32_t tab_id) {
GetForwardingInterface()->CloseTab(std::move(tab_id));
}
void PageHandlerInterceptorForTesting::GetProfileData(GetProfileDataCallback callback) {
GetForwardingInterface()->GetProfileData(std::move(callback));
}
void PageHandlerInterceptorForTesting::SwitchToTab(SwitchToTabInfoPtr switch_to_tab_info) {
GetForwardingInterface()->SwitchToTab(std::move(switch_to_tab_info));
}
void PageHandlerInterceptorForTesting::OpenRecentlyClosedEntry(int32_t session_id) {
GetForwardingInterface()->OpenRecentlyClosedEntry(std::move(session_id));
}
void PageHandlerInterceptorForTesting::SaveRecentlyClosedExpandedPref(bool expanded) {
GetForwardingInterface()->SaveRecentlyClosedExpandedPref(std::move(expanded));
}
void PageHandlerInterceptorForTesting::ShowUI() {
GetForwardingInterface()->ShowUI();
}
PageHandlerAsyncWaiter::PageHandlerAsyncWaiter(
PageHandler* proxy) : proxy_(proxy) {}
PageHandlerAsyncWaiter::~PageHandlerAsyncWaiter() = default;
void PageHandlerAsyncWaiter::GetProfileData(
ProfileDataPtr* out_profile_data) {
base::RunLoop loop;
proxy_->GetProfileData(
base::BindOnce(
[](base::RunLoop* loop,
ProfileDataPtr* out_profile_data
,
ProfileDataPtr profile_data) {*out_profile_data = std::move(profile_data);
loop->Quit();
},
&loop,
out_profile_data));
loop.Run();
}
void PageInterceptorForTesting::TabsChanged(ProfileDataPtr profile_tabs) {
GetForwardingInterface()->TabsChanged(std::move(profile_tabs));
}
void PageInterceptorForTesting::TabUpdated(TabUpdateInfoPtr tabUpdateInfo) {
GetForwardingInterface()->TabUpdated(std::move(tabUpdateInfo));
}
void PageInterceptorForTesting::TabsRemoved(TabsRemovedInfoPtr tabsRemovedInfo) {
GetForwardingInterface()->TabsRemoved(std::move(tabsRemovedInfo));
}
PageAsyncWaiter::PageAsyncWaiter(
Page* proxy) : proxy_(proxy) {}
PageAsyncWaiter::~PageAsyncWaiter() = default;
} // namespace blink
} // namespace mojom
} // namespace tab_search
#if defined(__clang__)
#pragma clang diagnostic pop
#endif