From 1e8da899a372c40eab6743fbff5ce846736d8927 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Mon, 21 Feb 2022 01:27:45 -0800 Subject: [PATCH] chore: fix typos (#32985) --- lib/browser/api/net.ts | 2 +- shell/browser/api/electron_api_power_monitor_win.cc | 2 +- shell/browser/api/electron_api_url_loader.cc | 2 +- shell/browser/auto_updater_mac.mm | 2 +- shell/browser/browser_mac.mm | 4 ++-- shell/browser/native_window_mac.mm | 8 ++++---- shell/browser/native_window_views_win.cc | 2 +- shell/browser/ui/message_box_win.cc | 2 +- .../ui/win/electron_desktop_window_tree_host_win.cc | 2 +- shell/common/gin_helper/function_template.h | 2 +- shell/common/platform_util_linux.cc | 2 +- shell/renderer/electron_render_frame_observer.cc | 4 ++-- shell/renderer/electron_renderer_client.cc | 4 ++-- spec-main/index.js | 2 +- 14 files changed, 20 insertions(+), 20 deletions(-) diff --git a/lib/browser/api/net.ts b/lib/browser/api/net.ts index 454505ede04f2..80351c0cdbaae 100644 --- a/lib/browser/api/net.ts +++ b/lib/browser/api/net.ts @@ -198,7 +198,7 @@ class ChunkedBodyStream extends Writable { this._downstream = pipe; if (this._pendingChunk) { const doneWriting = (maybeError: Error | void) => { - // If the underlying request has been aborted, we honeslty don't care about the error + // If the underlying request has been aborted, we honestly don't care about the error // all work should cease as soon as we abort anyway, this error is probably a // "mojo pipe disconnected" error (code=9) if (this._clientRequest._aborted) return; diff --git a/shell/browser/api/electron_api_power_monitor_win.cc b/shell/browser/api/electron_api_power_monitor_win.cc index bf1468cd97038..90f2cf97dfe26 100644 --- a/shell/browser/api/electron_api_power_monitor_win.cc +++ b/shell/browser/api/electron_api_power_monitor_win.cc @@ -42,7 +42,7 @@ void PowerMonitor::InitPlatformSpecificMonitors() { // Tel windows we want to be notified with session events WTSRegisterSessionNotification(window_, NOTIFY_FOR_THIS_SESSION); - // For Windows 8 and later, a new "connected standy" mode has been added and + // For Windows 8 and later, a new "connected standby" mode has been added and // we must explicitly register for its notifications. auto RegisterSuspendResumeNotification = reinterpret_cast( diff --git a/shell/browser/api/electron_api_url_loader.cc b/shell/browser/api/electron_api_url_loader.cc index 212a2b6c16f8e..97baf11d65624 100644 --- a/shell/browser/api/electron_api_url_loader.cc +++ b/shell/browser/api/electron_api_url_loader.cc @@ -490,7 +490,7 @@ gin::Handle SimpleURLLoaderWrapper::Create( int options = 0; if (!credentials_specified && !use_session_cookies) { // This is the default case, as well as the case when credentials is not - // specified and useSessionCoookies is false. credentials_mode will be + // specified and useSessionCookies is false. credentials_mode will be // kInclude, but cookies will be blocked. request->credentials_mode = network::mojom::CredentialsMode::kInclude; options |= network::mojom::kURLLoadOptionBlockAllCookies; diff --git a/shell/browser/auto_updater_mac.mm b/shell/browser/auto_updater_mac.mm index 3dbf49e2da8a9..c9e4542ffdfba 100644 --- a/shell/browser/auto_updater_mac.mm +++ b/shell/browser/auto_updater_mac.mm @@ -24,7 +24,7 @@ namespace { -// The gloal SQRLUpdater object. +// The global SQRLUpdater object. SQRLUpdater* g_updater = nil; } // namespace diff --git a/shell/browser/browser_mac.mm b/shell/browser/browser_mac.mm index 357c6723e44ff..cdd3ba7711b4b 100644 --- a/shell/browser/browser_mac.mm +++ b/shell/browser/browser_mac.mm @@ -394,10 +394,10 @@ void RemoveFromLoginItems() { void Browser::DockHide() { // Transforming application state from UIElement to Foreground is an - // asyncronous operation, and unfortunately there is currently no way to know + // asynchronous operation, and unfortunately there is currently no way to know // when it is finished. // So if we call DockHide => DockShow => DockHide => DockShow in a very short - // time, we would triger a bug of macOS that, there would be multiple dock + // time, we would trigger a bug of macOS that, there would be multiple dock // icons of the app left in system. // To work around this, we make sure DockHide does nothing if it is called // immediately after DockShow. After some experiments, 1 second seems to be diff --git a/shell/browser/native_window_mac.mm b/shell/browser/native_window_mac.mm index bf78f78a2631a..3220741ec356c 100644 --- a/shell/browser/native_window_mac.mm +++ b/shell/browser/native_window_mac.mm @@ -51,7 +51,7 @@ // This view would inform Chromium to resize the hosted views::View. // -// The overrided methods should behave the same with BridgedContentView. +// The overridden methods should behave the same with BridgedContentView. @interface ElectronAdaptedContentView : NSView { @private views::NativeWidgetMacNSWindowHost* bridge_host_; @@ -373,7 +373,7 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) { if (traffic_light_position_) { [buttons_proxy_ setMargin:*traffic_light_position_]; } else if (title_bar_style_ == TitleBarStyle::kHiddenInset) { - // For macOS >= 11, while this value does not match offical macOS apps + // For macOS >= 11, while this value does not match official macOS apps // like Safari or Notes, it matches titleBarStyle's old implementation // before Electron <= 12. [buttons_proxy_ setMargin:gfx::Point(12, 11)]; @@ -381,7 +381,7 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) { if (title_bar_style_ == TitleBarStyle::kCustomButtonsOnHover) { [buttons_proxy_ setShowOnHover:YES]; } else { - // customButtonsOnHover does not show buttons initialiy. + // customButtonsOnHover does not show buttons initially. InternalSetWindowButtonVisibility(true); } } @@ -562,7 +562,7 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) { } } - // Deattach the window from the parent before. + // Detach the window from the parent before. if (parent()) InternalSetParentWindow(parent(), false); diff --git a/shell/browser/native_window_views_win.cc b/shell/browser/native_window_views_win.cc index 0b4706f1cc198..ab336f2e29866 100644 --- a/shell/browser/native_window_views_win.cc +++ b/shell/browser/native_window_views_win.cc @@ -473,7 +473,7 @@ LRESULT CALLBACK NativeWindowViews::SubclassProc(HWND hwnd, // windows can occur due to rapidly entering and leaving forwarding mode. // By consuming and ignoring the message, we're essentially telling // Chromium that we have not left the window despite somebody else getting - // the messages. As to why this is catched for the legacy window and not + // the messages. As to why this is caught for the legacy window and not // the actual browser window is simply that the legacy window somehow // makes use of these events; posting to the main window didn't work. if (window->forwarding_mouse_messages_) { diff --git a/shell/browser/ui/message_box_win.cc b/shell/browser/ui/message_box_win.cc index 724228e010189..ab494bd6d59ab 100644 --- a/shell/browser/ui/message_box_win.cc +++ b/shell/browser/ui/message_box_win.cc @@ -48,7 +48,7 @@ std::map>& GetDialogsMap() { return *dialogs; } -// Speical HWND used by the dialogs map. +// Special HWND used by the dialogs map. // // - ID is used but window has not been created yet. const HWND kHwndReserve = reinterpret_cast(-1); diff --git a/shell/browser/ui/win/electron_desktop_window_tree_host_win.cc b/shell/browser/ui/win/electron_desktop_window_tree_host_win.cc index 16e71fac12b39..3600e273ea73b 100644 --- a/shell/browser/ui/win/electron_desktop_window_tree_host_win.cc +++ b/shell/browser/ui/win/electron_desktop_window_tree_host_win.cc @@ -87,7 +87,7 @@ bool ElectronDesktopWindowTreeHostWin::GetClientAreaInsets( // Indenting the client area can fix this behavior. if (IsMaximized() && !native_window_view_->has_frame()) { // The insets would be eventually passed to WM_NCCALCSIZE, which takes - // the metrics under the DPI of _main_ monitor instead of current moniotr. + // the metrics under the DPI of _main_ monitor instead of current monitor. // // Please make sure you tested maximized frameless window under multiple // monitors with different DPIs before changing this code. diff --git a/shell/common/gin_helper/function_template.h b/shell/common/gin_helper/function_template.h index 025c917fbc34f..b5d8293213066 100644 --- a/shell/common/gin_helper/function_template.h +++ b/shell/common/gin_helper/function_template.h @@ -208,7 +208,7 @@ class Invoker, ArgTypes...> // GCC thinks that create_flags is going unused, even though the // expansion above clearly makes use of it. Per jyasskin@, casting // to void is the commonly accepted way to convince the compiler - // that you're actually using a parameter/varible. + // that you're actually using a parameter/variable. (void)create_flags; } diff --git a/shell/common/platform_util_linux.cc b/shell/common/platform_util_linux.cc index 0d86d7cf1c28a..9d58f8fc959f4 100644 --- a/shell/common/platform_util_linux.cc +++ b/shell/common/platform_util_linux.cc @@ -119,7 +119,7 @@ class ShowItemHelper { bool owned = false; if (!reader.PopBool(&owned)) { - LOG(ERROR) << "Failed to read " << kMethodNameHasOwner << " resposne"; + LOG(ERROR) << "Failed to read " << kMethodNameHasOwner << " response"; } else if (owned) { is_running = true; } diff --git a/shell/renderer/electron_render_frame_observer.cc b/shell/renderer/electron_render_frame_observer.cc index ba1a122868c64..4c763315f3539 100644 --- a/shell/renderer/electron_render_frame_observer.cc +++ b/shell/renderer/electron_render_frame_observer.cc @@ -82,7 +82,7 @@ void ElectronRenderFrameObserver::DidInstallConditionalFeatures( v8::Handle context, int world_id) { // When a child window is created with window.open, its WebPreferences will - // be copied from its parent, and Chromium will intialize JS context in it + // be copied from its parent, and Chromium will initialize JS context in it // immediately. // Normally the WebPreferences is overriden in browser before navigation, // but this behavior bypasses the browser side navigation and the child @@ -92,7 +92,7 @@ void ElectronRenderFrameObserver::DidInstallConditionalFeatures( // while "nodeIntegration=no" is passed. // We work around this issue by delaying the child window's initialization of // Node.js if this is the initial empty document, and only do it when the - // acutal page has started to load. + // actual page has started to load. auto* web_frame = static_cast(render_frame_->GetWebFrame()); if (web_frame->Opener() && web_frame->IsOnInitialEmptyDocument()) { diff --git a/shell/renderer/electron_renderer_client.cc b/shell/renderer/electron_renderer_client.cc index c507bdcffccbb..f24c8073935fe 100644 --- a/shell/renderer/electron_renderer_client.cc +++ b/shell/renderer/electron_renderer_client.cc @@ -50,7 +50,7 @@ void ElectronRendererClient::RenderFrameCreated( void ElectronRendererClient::RunScriptsAtDocumentStart( content::RenderFrame* render_frame) { RendererClientBase::RunScriptsAtDocumentStart(render_frame); - // Inform the document start pharse. + // Inform the document start phase. v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); node::Environment* env = GetEnvironment(render_frame); if (env) @@ -61,7 +61,7 @@ void ElectronRendererClient::RunScriptsAtDocumentStart( void ElectronRendererClient::RunScriptsAtDocumentEnd( content::RenderFrame* render_frame) { RendererClientBase::RunScriptsAtDocumentEnd(render_frame); - // Inform the document end pharse. + // Inform the document end phase. v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); node::Environment* env = GetEnvironment(render_frame); if (env) diff --git a/spec-main/index.js b/spec-main/index.js index 6579025ee7579..db24801e9d286 100644 --- a/spec-main/index.js +++ b/spec-main/index.js @@ -27,7 +27,7 @@ const { app, protocol } = require('electron'); v8.setFlagsFromString('--expose_gc'); app.commandLine.appendSwitch('js-flags', '--expose_gc'); -// Prevent the spec runner quiting when the first window closes +// Prevent the spec runner quitting when the first window closes app.on('window-all-closed', () => null); // Use fake device for Media Stream to replace actual camera and microphone.