refactor: move impl classes into unnamed namespaces (#42390)
* refactor: move ReplyChannel into an anonymous namespace * refactor: move ChunkedDataPipeReadableStream into an anonymous namespace * refactor: move linux helpers into an anonymous namespace * refactor: move linux helpers into an anonymous namespace
This commit is contained in:
parent
c4abaec56a
commit
f2481ed44f
4 changed files with 17 additions and 4 deletions
|
@ -1893,6 +1893,8 @@ void WebContents::OnFirstNonEmptyLayout(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
// This object wraps the InvokeCallback so that if it gets GC'd by V8, we can
|
// This object wraps the InvokeCallback so that if it gets GC'd by V8, we can
|
||||||
// still call the callback and send an error. Not doing so causes a Mojo DCHECK,
|
// still call the callback and send an error. Not doing so causes a Mojo DCHECK,
|
||||||
// since Mojo requires callbacks to be called before they are destroyed.
|
// since Mojo requires callbacks to be called before they are destroyed.
|
||||||
|
@ -1949,6 +1951,8 @@ class ReplyChannel : public gin::Wrappable<ReplyChannel> {
|
||||||
|
|
||||||
gin::WrapperInfo ReplyChannel::kWrapperInfo = {gin::kEmbedderNativeGin};
|
gin::WrapperInfo ReplyChannel::kWrapperInfo = {gin::kEmbedderNativeGin};
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
gin::Handle<gin_helper::internal::Event> WebContents::MakeEventWithSender(
|
gin::Handle<gin_helper::internal::Event> WebContents::MakeEventWithSender(
|
||||||
v8::Isolate* isolate,
|
v8::Isolate* isolate,
|
||||||
content::RenderFrameHost* frame,
|
content::RenderFrameHost* frame,
|
||||||
|
|
|
@ -25,6 +25,8 @@
|
||||||
|
|
||||||
namespace electron {
|
namespace electron {
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
const char kXdgSettings[] = "xdg-settings";
|
const char kXdgSettings[] = "xdg-settings";
|
||||||
const char kXdgSettingsDefaultSchemeHandler[] = "default-url-scheme-handler";
|
const char kXdgSettingsDefaultSchemeHandler[] = "default-url-scheme-handler";
|
||||||
|
|
||||||
|
@ -84,6 +86,8 @@ bool SetDefaultWebClient(const std::string& protocol) {
|
||||||
return ran_ok && exit_code == EXIT_SUCCESS;
|
return ran_ok && exit_code == EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
void Browser::AddRecentDocument(const base::FilePath& path) {}
|
void Browser::AddRecentDocument(const base::FilePath& path) {}
|
||||||
|
|
||||||
void Browser::ClearRecentDocuments() {}
|
void Browser::ClearRecentDocuments() {}
|
||||||
|
|
|
@ -18,6 +18,10 @@
|
||||||
#include "shell/common/thread_restrictions.h"
|
#include "shell/common/thread_restrictions.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
namespace electron {
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
constexpr std::string_view kElectronOzonePlatformHint{
|
constexpr std::string_view kElectronOzonePlatformHint{
|
||||||
"ELECTRON_OZONE_PLATFORM_HINT"};
|
"ELECTRON_OZONE_PLATFORM_HINT"};
|
||||||
|
|
||||||
|
@ -55,10 +59,6 @@ bool HasWaylandDisplay(base::Environment* env) {
|
||||||
constexpr char kPlatformX11[] = "x11";
|
constexpr char kPlatformX11[] = "x11";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace electron {
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
// Evaluates the environment and returns the effective platform name for the
|
// Evaluates the environment and returns the effective platform name for the
|
||||||
// given |ozone_platform_hint|.
|
// given |ozone_platform_hint|.
|
||||||
// For the "auto" value, returns "wayland" if the XDG session type is "wayland",
|
// For the "auto" value, returns "wayland" if the XDG session type is "wayland",
|
||||||
|
|
|
@ -250,6 +250,8 @@ bool Converter<net::HttpRequestHeaders>::FromV8(v8::Isolate* isolate,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
class ChunkedDataPipeReadableStream
|
class ChunkedDataPipeReadableStream
|
||||||
: public gin::Wrappable<ChunkedDataPipeReadableStream> {
|
: public gin::Wrappable<ChunkedDataPipeReadableStream> {
|
||||||
public:
|
public:
|
||||||
|
@ -489,9 +491,12 @@ class ChunkedDataPipeReadableStream
|
||||||
v8::Global<v8::ArrayBufferView> buf_;
|
v8::Global<v8::ArrayBufferView> buf_;
|
||||||
gin_helper::Promise<int> promise_;
|
gin_helper::Promise<int> promise_;
|
||||||
};
|
};
|
||||||
|
|
||||||
gin::WrapperInfo ChunkedDataPipeReadableStream::kWrapperInfo = {
|
gin::WrapperInfo ChunkedDataPipeReadableStream::kWrapperInfo = {
|
||||||
gin::kEmbedderNativeGin};
|
gin::kEmbedderNativeGin};
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
// static
|
// static
|
||||||
v8::Local<v8::Value> Converter<network::ResourceRequestBody>::ToV8(
|
v8::Local<v8::Value> Converter<network::ResourceRequestBody>::ToV8(
|
||||||
v8::Isolate* isolate,
|
v8::Isolate* isolate,
|
||||||
|
|
Loading…
Reference in a new issue