From b194030a34db7aecbda3e656663f02d4a1f91181 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Tue, 13 Oct 2020 10:25:21 -0700 Subject: [PATCH] chore: cleanup some typos in comments (#25770) --- lib/browser/guest-view-manager.ts | 2 +- lib/browser/init.ts | 2 +- lib/browser/navigation-controller.ts | 4 ++-- lib/renderer/api/remote.ts | 2 +- lib/renderer/web-view/web-view-attributes.ts | 2 +- lib/renderer/window-setup.ts | 4 ++-- shell/app/electron_main_delegate.cc | 4 ++-- shell/browser/api/electron_api_browser_window.cc | 2 +- shell/browser/api/electron_api_menu.h | 2 +- shell/browser/api/electron_api_web_contents.cc | 2 +- shell/browser/browser.h | 2 +- shell/browser/common_web_contents_delegate.h | 2 +- shell/browser/electron_browser_client.cc | 2 +- shell/browser/electron_browser_main_parts.cc | 2 +- shell/browser/media/media_capture_devices_dispatcher.h | 2 +- shell/browser/microtasks_runner.cc | 2 +- shell/browser/native_window_views.cc | 2 +- shell/browser/net/electron_url_loader_factory.cc | 4 ++-- shell/browser/net/node_stream_loader.cc | 2 +- shell/browser/net/proxying_url_loader_factory.h | 6 +++--- shell/browser/net/proxying_websocket.cc | 2 +- shell/browser/net/proxying_websocket.h | 2 +- shell/browser/ui/devtools_manager_delegate.cc | 2 +- shell/browser/ui/message_box_win.cc | 2 +- shell/browser/ui/views/menu_delegate.cc | 2 +- shell/browser/ui/win/taskbar_host.cc | 2 +- shell/browser/web_contents_preferences.cc | 2 +- shell/browser/web_contents_zoom_controller.cc | 2 +- shell/common/gin_converters/native_window_converter.h | 2 +- shell/common/gin_converters/net_converter.cc | 4 ++-- shell/renderer/renderer_client_base.h | 2 +- 31 files changed, 38 insertions(+), 38 deletions(-) diff --git a/lib/browser/guest-view-manager.ts b/lib/browser/guest-view-manager.ts index fd8ac76d70..125608e447 100644 --- a/lib/browser/guest-view-manager.ts +++ b/lib/browser/guest-view-manager.ts @@ -247,7 +247,7 @@ const watchEmbedder = function (embedder: Electron.WebContents) { } watchedEmbedders.add(embedder); - // Forward embedder window visiblity change events to guest + // Forward embedder window visibility change events to guest const onVisibilityChange = function (visibilityState: VisibilityState) { for (const guestInstanceId of Object.keys(guestInstances)) { const guestInstance = guestInstances[guestInstanceId]; diff --git a/lib/browser/init.ts b/lib/browser/init.ts index d04e0f480a..7f1f4e4435 100644 --- a/lib/browser/init.ts +++ b/lib/browser/init.ts @@ -121,7 +121,7 @@ if (packageJson.desktopName != null) { app.setDesktopName(`${app.name}.desktop`); } -// Set v8 flags, delibrately lazy load so that apps that do not use this +// Set v8 flags, deliberately lazy load so that apps that do not use this // feature do not pay the price if (packageJson.v8Flags != null) { require('v8').setFlagsFromString(packageJson.v8Flags); diff --git a/lib/browser/navigation-controller.ts b/lib/browser/navigation-controller.ts index eeaa1e2867..ffd6024fd3 100644 --- a/lib/browser/navigation-controller.ts +++ b/lib/browser/navigation-controller.ts @@ -20,10 +20,10 @@ ipcMainInternal.on('ELECTRON_NAVIGATION_CONTROLLER_LENGTH', function (event) { }); // JavaScript implementation of Chromium's NavigationController. -// Instead of relying on Chromium for history control, we compeletely do history +// Instead of relying on Chromium for history control, we completely do history // control on user land, and only rely on WebContents.loadURL for navigation. // This helps us avoid Chromium's various optimizations so we can ensure renderer -// process is restarted everytime. +// process is restarted every time. export class NavigationController extends EventEmitter { currentIndex: number = -1; inPageIndex: number = -1; diff --git a/lib/renderer/api/remote.ts b/lib/renderer/api/remote.ts index 257e0bec8f..8737e20368 100644 --- a/lib/renderer/api/remote.ts +++ b/lib/renderer/api/remote.ts @@ -134,7 +134,7 @@ function wrapArgs (args: any[], visited = new Set()): any { // Populate object's members from descriptors. // The |ref| will be kept referenced by |members|. -// This matches |getObjectMemebers| in rpc-server. +// This matches |getObjectMembers| in rpc-server. function setObjectMembers (ref: any, object: any, metaId: number, members: ObjectMember[]) { if (!Array.isArray(members)) return; diff --git a/lib/renderer/web-view/web-view-attributes.ts b/lib/renderer/web-view/web-view-attributes.ts index 4ce18e9a9d..e768004710 100644 --- a/lib/renderer/web-view/web-view-attributes.ts +++ b/lib/renderer/web-view/web-view-attributes.ts @@ -122,7 +122,7 @@ class SrcAttribute extends WebViewAttribute { super.setValueIgnoreMutation(value); // takeRecords() is needed to clear queued up src mutations. Without it, it - // is possible for this change to get picked up asyncronously by src's + // is possible for this change to get picked up asynchronously by src's // mutation observer |observer|, and then get handled even though we do not // want to handle this mutation. this.observer.takeRecords(); diff --git a/lib/renderer/window-setup.ts b/lib/renderer/window-setup.ts index 08ff6bb924..eae050e201 100644 --- a/lib/renderer/window-setup.ts +++ b/lib/renderer/window-setup.ts @@ -79,7 +79,7 @@ class LocationProxy { const guestURL = this.getGuestURL(); if (guestURL) { // TypeScript doesn't want us to assign to read-only variables. - // It's right, that's bad, but we're doing it anway. + // It's right, that's bad, but we're doing it anyway. (guestURL as any)[propertyKey] = newVal; return this._invokeWebContentsMethod('loadURL', guestURL.toString()); @@ -127,7 +127,7 @@ class LocationProxy { private getGuestURL (): URL | null { const maybeURL = this._invokeWebContentsMethodSync('getURL') as string; - // When there's no previous frame the url will be blank, so accountfor that here + // When there's no previous frame the url will be blank, so account for that here // to prevent url parsing errors on an empty string. const urlString = maybeURL !== '' ? maybeURL : 'about:blank'; try { diff --git a/shell/app/electron_main_delegate.cc b/shell/app/electron_main_delegate.cc index ca9161d87a..0913baad74 100644 --- a/shell/app/electron_main_delegate.cc +++ b/shell/app/electron_main_delegate.cc @@ -222,8 +222,8 @@ bool ElectronMainDelegate::BasicStartupComplete(int* exit_code) { // Logging with pid and timestamp. logging::SetLogItems(true, false, true, false); - // Enable convient stack printing. This is enabled by default in non-official - // builds. + // Enable convenient stack printing. This is enabled by default in + // non-official builds. if (env->HasVar("ELECTRON_ENABLE_STACK_DUMPING")) base::debug::EnableInProcessStackDumping(); diff --git a/shell/browser/api/electron_api_browser_window.cc b/shell/browser/api/electron_api_browser_window.cc index d2402ad507..2f8d3833c9 100644 --- a/shell/browser/api/electron_api_browser_window.cc +++ b/shell/browser/api/electron_api_browser_window.cc @@ -248,7 +248,7 @@ void BrowserWindow::OnCloseButtonClicked(bool* prevent_default) { // Assume the window is not responding if it doesn't cancel the close and is // not closed in 5s, in this way we can quickly show the unresponsive - // dialog when the window is busy executing some script withouth waiting for + // dialog when the window is busy executing some script without waiting for // the unresponsive timeout. if (window_unresponsive_closure_.IsCancelled()) ScheduleUnresponsiveEvent(5000); diff --git a/shell/browser/api/electron_api_menu.h b/shell/browser/api/electron_api_menu.h index c8aa805a48..480a7b34c2 100644 --- a/shell/browser/api/electron_api_menu.h +++ b/shell/browser/api/electron_api_menu.h @@ -126,7 +126,7 @@ struct Converter { static bool FromV8(v8::Isolate* isolate, v8::Local val, electron::ElectronMenuModel** out) { - // null would be tranfered to NULL. + // null would be transferred to NULL. if (val->IsNull()) { *out = nullptr; return true; diff --git a/shell/browser/api/electron_api_web_contents.cc b/shell/browser/api/electron_api_web_contents.cc index db52d9b3a4..a3cb00fb80 100644 --- a/shell/browser/api/electron_api_web_contents.cc +++ b/shell/browser/api/electron_api_web_contents.cc @@ -1100,7 +1100,7 @@ void WebContents::PluginCrashed(const base::FilePath& plugin_path, auto* plugin_service = content::PluginService::GetInstance(); plugin_service->GetPluginInfoByPath(plugin_path, &info); Emit("plugin-crashed", info.name, info.version); -#endif // BUILDFLAG(ENABLE_PLUIGNS) +#endif // BUILDFLAG(ENABLE_PLUGINS) } void WebContents::MediaStartedPlaying(const MediaPlayerInfo& video_type, diff --git a/shell/browser/browser.h b/shell/browser/browser.h index a8490049ea..cef44105b0 100644 --- a/shell/browser/browser.h +++ b/shell/browser/browser.h @@ -195,7 +195,7 @@ class Browser : public WindowListObserver { void UserActivityWasContinued(const std::string& type, base::DictionaryValue user_info); - // Gives an oportunity to update the Handoff payload. + // Gives an opportunity to update the Handoff payload. bool UpdateUserActivityState(const std::string& type, base::DictionaryValue user_info); diff --git a/shell/browser/common_web_contents_delegate.h b/shell/browser/common_web_contents_delegate.h index 86c398dc82..350b39238c 100644 --- a/shell/browser/common_web_contents_delegate.h +++ b/shell/browser/common_web_contents_delegate.h @@ -39,7 +39,7 @@ class CommonWebContentsDelegate : public content::WebContentsDelegate, CommonWebContentsDelegate(); ~CommonWebContentsDelegate() override; - // Creates a InspectableWebContents object and takes onwership of + // Creates a InspectableWebContents object and takes ownership of // |web_contents|. void InitWithWebContents(content::WebContents* web_contents, ElectronBrowserContext* browser_context, diff --git a/shell/browser/electron_browser_client.cc b/shell/browser/electron_browser_client.cc index 890f551a35..506cb43fb1 100644 --- a/shell/browser/electron_browser_client.cc +++ b/shell/browser/electron_browser_client.cc @@ -403,7 +403,7 @@ bool ElectronBrowserClient::ShouldForceNewSiteInstance( const GURL& url, bool has_response_started) const { if (url.SchemeIs(url::kJavaScriptScheme)) - // "javacript:" scheme should always use same SiteInstance + // "javascript:" scheme should always use same SiteInstance return false; if (url.SchemeIs(extensions::kExtensionScheme)) return false; diff --git a/shell/browser/electron_browser_main_parts.cc b/shell/browser/electron_browser_main_parts.cc index 21fca47262..d801465be4 100644 --- a/shell/browser/electron_browser_main_parts.cc +++ b/shell/browser/electron_browser_main_parts.cc @@ -357,7 +357,7 @@ void ElectronBrowserMainParts::ToolkitInitialized() { // issue to keep updated: // https://bugs.chromium.org/p/chromium/issues/detail?id=998903 UpdateDarkThemeSetting(); - // Update the naitve theme when GTK theme changes. The GetNativeTheme + // Update the native theme when GTK theme changes. The GetNativeTheme // here returns a NativeThemeGtk, which monitors GTK settings. dark_theme_observer_.reset(new DarkThemeObserver); linux_ui->GetNativeTheme(nullptr)->AddObserver(dark_theme_observer_.get()); diff --git a/shell/browser/media/media_capture_devices_dispatcher.h b/shell/browser/media/media_capture_devices_dispatcher.h index 80410c1469..8f0d827c5a 100644 --- a/shell/browser/media/media_capture_devices_dispatcher.h +++ b/shell/browser/media/media_capture_devices_dispatcher.h @@ -47,7 +47,7 @@ class MediaCaptureDevicesDispatcher : public content::MediaObserver { // Unittests that do not require actual device enumeration should call this // API on the singleton. It is safe to call this multiple times on the - // signleton. + // singleton. void DisableDeviceEnumerationForTesting(); // Overridden from content::MediaObserver: diff --git a/shell/browser/microtasks_runner.cc b/shell/browser/microtasks_runner.cc index f1a0d115b3..0bb9baacc5 100644 --- a/shell/browser/microtasks_runner.cc +++ b/shell/browser/microtasks_runner.cc @@ -21,7 +21,7 @@ void MicrotasksRunner::DidProcessTask(const base::PendingTask& pending_task) { v8::Isolate::Scope scope(isolate_); // In the browser process we follow Node.js microtask policy of kExplicit // and let the MicrotaskRunner which is a task observer for chromium UI thread - // scheduler run the micotask checkpoint. This worked fine because Node.js + // scheduler run the microtask checkpoint. This worked fine because Node.js // also runs microtasks through its task queue, but after // https://github.com/electron/electron/issues/20013 Node.js now performs its // own microtask checkpoint and it may happen is some situations that there is diff --git a/shell/browser/native_window_views.cc b/shell/browser/native_window_views.cc index 9751bee799..31fa04d56f 100644 --- a/shell/browser/native_window_views.cc +++ b/shell/browser/native_window_views.cc @@ -156,7 +156,7 @@ NativeWindowViews::NativeWindowViews(const gin_helper::Dictionary& options, if (enable_larger_than_screen()) // We need to set a default maximum window size here otherwise Windows // will not allow us to resize the window larger than scree. - // Setting directly to INT_MAX somehow doesn't work, so we just devide + // Setting directly to INT_MAX somehow doesn't work, so we just divide // by 10, which should still be large enough. SetContentSizeConstraints(extensions::SizeConstraints( gfx::Size(), gfx::Size(INT_MAX / 10, INT_MAX / 10))); diff --git a/shell/browser/net/electron_url_loader_factory.cc b/shell/browser/net/electron_url_loader_factory.cc index 6b12315fdf..47cbae3887 100644 --- a/shell/browser/net/electron_url_loader_factory.cc +++ b/shell/browser/net/electron_url_loader_factory.cc @@ -279,10 +279,10 @@ void ElectronURLLoaderFactory::StartLoading( client_remote->OnReceiveRedirect(redirect_info, std::move(head)); - // Unound client, so it an be passed to sub-methods + // Unbound client, so it an be passed to sub-methods client = client_remote.Unbind(); // When the redirection comes from an intercepted scheme (which has - // |proxy_factory| passed), we askes the proxy factory to create a loader + // |proxy_factory| passed), we ask the proxy factory to create a loader // for new URL, otherwise we call |StartLoadingHttp|, which creates // loader with default factory. // diff --git a/shell/browser/net/node_stream_loader.cc b/shell/browser/net/node_stream_loader.cc index 613e75824d..5800485438 100644 --- a/shell/browser/net/node_stream_loader.cc +++ b/shell/browser/net/node_stream_loader.cc @@ -128,7 +128,7 @@ void NodeStreamLoader::ReadMore() { // Hold the buffer until the write is done. buffer_.Reset(isolate_, buffer); - // Write buffer to mojo pipe asyncronously. + // Write buffer to mojo pipe asynchronously. is_reading_ = false; is_writing_ = true; producer_->Write(std::make_unique( diff --git a/shell/browser/net/proxying_url_loader_factory.h b/shell/browser/net/proxying_url_loader_factory.h index 79b7426a7a..95e393a910 100644 --- a/shell/browser/net/proxying_url_loader_factory.h +++ b/shell/browser/net/proxying_url_loader_factory.h @@ -227,9 +227,9 @@ class ProxyingURLLoaderFactory // This is passed from api::Protocol. // - // The Protocol instance lives through the lifetime of BrowserContenxt, - // which is guarenteed to cover the lifetime of URLLoaderFactory, so the - // reference is guarenteed to be valid. + // The Protocol instance lives through the lifetime of BrowserContext, + // which is guaranteed to cover the lifetime of URLLoaderFactory, so the + // reference is guaranteed to be valid. // // In this way we can avoid using code from api namespace in this file. const HandlersMap& intercepted_handlers_; diff --git a/shell/browser/net/proxying_websocket.cc b/shell/browser/net/proxying_websocket.cc index 1f8b2a64b4..f0c4048c19 100644 --- a/shell/browser/net/proxying_websocket.cc +++ b/shell/browser/net/proxying_websocket.cc @@ -438,7 +438,7 @@ void ProxyingWebSocket::OnError(int error_code) { void ProxyingWebSocket::OnMojoConnectionErrorWithCustomReason( uint32_t custom_reason, const std::string& description) { - // Here we want to nofiy the custom reason to the client, which is why + // Here we want to notify the custom reason to the client, which is why // we reset |forwarding_handshake_client_| manually. forwarding_handshake_client_.ResetWithReason(custom_reason, description); OnError(net::ERR_FAILED); diff --git a/shell/browser/net/proxying_websocket.h b/shell/browser/net/proxying_websocket.h index 3ed9ea8f87..ba5d69bbb2 100644 --- a/shell/browser/net/proxying_websocket.h +++ b/shell/browser/net/proxying_websocket.h @@ -39,7 +39,7 @@ class ProxyingWebSocket : public network::mojom::WebSocketHandshakeClient, // AuthRequiredResponse indicates how an OnAuthRequired call is handled. enum class AuthRequiredResponse { - // No credenitals were provided. + // No credentials were provided. AUTH_REQUIRED_RESPONSE_NO_ACTION, // AuthCredentials is filled in with a username and password, which should // be used in a response to the provided auth challenge. diff --git a/shell/browser/ui/devtools_manager_delegate.cc b/shell/browser/ui/devtools_manager_delegate.cc index 269df1193e..bacff6f662 100644 --- a/shell/browser/ui/devtools_manager_delegate.cc +++ b/shell/browser/ui/devtools_manager_delegate.cc @@ -115,7 +115,7 @@ void DevToolsManagerDelegate::HandleCommand( // protocol UberDispatcher and generating proper protocol handlers. // Since we only have one method and it is supposed to close Electron, // we don't need to add this complexity. Should we decide to support - // metohds like Browser.setWindowBounds, we'll need to do it though. + // methods like Browser.setWindowBounds, we'll need to do it though. base::PostTask(FROM_HERE, {content::BrowserThread::UI}, base::BindOnce([]() { Browser::Get()->Quit(); })); return; diff --git a/shell/browser/ui/message_box_win.cc b/shell/browser/ui/message_box_win.cc index 975f092381..643ab8e01d 100644 --- a/shell/browser/ui/message_box_win.cc +++ b/shell/browser/ui/message_box_win.cc @@ -136,7 +136,7 @@ DialogResult ShowTaskDialogUTF16(NativeWindow* parent, } } - // If "detail" is empty then don't make message hilighted. + // If "detail" is empty then don't make message highlighted. if (detail.empty()) { config.pszContent = message.c_str(); } else { diff --git a/shell/browser/ui/views/menu_delegate.cc b/shell/browser/ui/views/menu_delegate.cc index 3623914dad..9e5b4be174 100644 --- a/shell/browser/ui/views/menu_delegate.cc +++ b/shell/browser/ui/views/menu_delegate.cc @@ -129,7 +129,7 @@ views::MenuItemView* MenuDelegate::GetSiblingMenu( bool switch_in_progress = !!button_to_open_; // Always update target to open. button_to_open_ = button; - // Switching menu asyncnously to avoid crash. + // Switching menu asynchronously to avoid crash. if (!switch_in_progress) { base::PostTask(FROM_HERE, {content::BrowserThread::UI}, base::BindOnce(&views::MenuRunner::Cancel, diff --git a/shell/browser/ui/win/taskbar_host.cc b/shell/browser/ui/win/taskbar_host.cc index 717937b585..5e05e57d11 100644 --- a/shell/browser/ui/win/taskbar_host.cc +++ b/shell/browser/ui/win/taskbar_host.cc @@ -67,7 +67,7 @@ bool TaskbarHost::SetThumbarButtons(HWND window, callback_map_.clear(); // The number of buttons in thumbar can not be changed once it is created, - // so we have to claim kMaxButtonsCount buttons initialy in case users add + // so we have to claim kMaxButtonsCount buttons initially in case users add // more buttons later. base::win::ScopedHICON icons[kMaxButtonsCount] = {}; THUMBBUTTON thumb_buttons[kMaxButtonsCount] = {}; diff --git a/shell/browser/web_contents_preferences.cc b/shell/browser/web_contents_preferences.cc index eb61f46caf..91a4369a37 100644 --- a/shell/browser/web_contents_preferences.cc +++ b/shell/browser/web_contents_preferences.cc @@ -145,7 +145,7 @@ WebContentsPreferences::WebContentsPreferences( SetDefaultBoolIfUndefined(options::kEnableWebSQL, true); bool webSecurity = true; SetDefaultBoolIfUndefined(options::kWebSecurity, webSecurity); - // If webSecurity was explicity set to false, let's inherit that into + // If webSecurity was explicitly set to false, let's inherit that into // insecureContent if (web_preferences.Get(options::kWebSecurity, &webSecurity) && !webSecurity) { diff --git a/shell/browser/web_contents_zoom_controller.cc b/shell/browser/web_contents_zoom_controller.cc index e0864def71..a68ea63f97 100644 --- a/shell/browser/web_contents_zoom_controller.cc +++ b/shell/browser/web_contents_zoom_controller.cc @@ -263,7 +263,7 @@ void WebContentsZoomController::SetZoomFactorOnNavigationIfNeeded( // When kZoomFactor is available, it takes precedence over // pref store values but if the host has zoom factor set explicitly - // then it takes precendence. + // then it takes precedence. // pref store < kZoomFactor < setZoomLevel std::string host = net::GetHostOrSpecFromURL(url); std::string scheme = url.scheme(); diff --git a/shell/common/gin_converters/native_window_converter.h b/shell/common/gin_converters/native_window_converter.h index d2ad9e0c44..d06440c7fa 100644 --- a/shell/common/gin_converters/native_window_converter.h +++ b/shell/common/gin_converters/native_window_converter.h @@ -15,7 +15,7 @@ struct Converter { static bool FromV8(v8::Isolate* isolate, v8::Local val, electron::NativeWindow** out) { - // null would be tranfered to NULL. + // null would be transferred to NULL. if (val->IsNull()) { *out = NULL; return true; diff --git a/shell/common/gin_converters/net_converter.cc b/shell/common/gin_converters/net_converter.cc index 3ad01623ab..6aba1beee9 100644 --- a/shell/common/gin_converters/net_converter.cc +++ b/shell/common/gin_converters/net_converter.cc @@ -273,8 +273,8 @@ v8::Local Converter::ToV8( case network::mojom::DataElementType::kDataPipe: { upload_data.Set("type", "blob"); // TODO(zcbenz): After the NetworkService refactor, the old blobUUID API - // becomes unecessarily complex, we should deprecate the getBlobData API - // and return the DataPipeHolder wrapper directly. + // becomes unnecessarily complex, we should deprecate the getBlobData + // API and return the DataPipeHolder wrapper directly. auto holder = electron::api::DataPipeHolder::Create(isolate, element); upload_data.Set("blobUUID", holder->id()); // The lifetime of data pipe is bound to the uploadData object. diff --git a/shell/renderer/renderer_client_base.h b/shell/renderer/renderer_client_base.h index 128199bbe0..ab3e286368 100644 --- a/shell/renderer/renderer_client_base.h +++ b/shell/renderer/renderer_client_base.h @@ -133,7 +133,7 @@ class RendererClientBase : public content::ContentRendererClient #endif bool isolated_world_; std::string renderer_client_id_; - // An increasing ID used for indentifying an V8 context in this process. + // An increasing ID used for identifying an V8 context in this process. int64_t next_context_id_ = 0; #if BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER)