chore: use consistent parameter names (#29361)

This commit is contained in:
David Sanders 2021-05-31 18:46:25 -07:00 committed by GitHub
parent d18dbdd72b
commit ba26580f23
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 38 additions and 40 deletions

View file

@ -125,7 +125,7 @@ class App : public ElectronBrowserClient::Delegate,
base::OnceClosure SelectClientCertificate( base::OnceClosure SelectClientCertificate(
content::WebContents* web_contents, content::WebContents* web_contents,
net::SSLCertRequestInfo* cert_request_info, net::SSLCertRequestInfo* cert_request_info,
net::ClientCertIdentityList client_certs, net::ClientCertIdentityList identities,
std::unique_ptr<content::ClientCertificateDelegate> delegate) override; std::unique_ptr<content::ClientCertificateDelegate> delegate) override;
bool CanCreateWindow(content::RenderFrameHost* opener, bool CanCreateWindow(content::RenderFrameHost* opener,
const GURL& opener_url, const GURL& opener_url,

View file

@ -35,7 +35,7 @@ class AutoUpdater : public gin::Wrappable<AutoUpdater>,
~AutoUpdater() override; ~AutoUpdater() override;
// Delegate implementations. // Delegate implementations.
void OnError(const std::string& error) override; void OnError(const std::string& message) override;
void OnError(const std::string& message, void OnError(const std::string& message,
const int code, const int code,
const std::string& domain) override; const std::string& domain) override;

View file

@ -73,17 +73,15 @@ const void* kElectronApiDownloadItemKey = &kElectronApiDownloadItemKey;
gin::WrapperInfo DownloadItem::kWrapperInfo = {gin::kEmbedderNativeGin}; gin::WrapperInfo DownloadItem::kWrapperInfo = {gin::kEmbedderNativeGin};
// static // static
DownloadItem* DownloadItem::FromDownloadItem( DownloadItem* DownloadItem::FromDownloadItem(download::DownloadItem* item) {
download::DownloadItem* download_item) {
// ^- say that 7 times fast in a row // ^- say that 7 times fast in a row
auto* data = static_cast<UserDataLink*>( auto* data = static_cast<UserDataLink*>(
download_item->GetUserData(kElectronApiDownloadItemKey)); item->GetUserData(kElectronApiDownloadItemKey));
return data ? data->download_item.get() : nullptr; return data ? data->download_item.get() : nullptr;
} }
DownloadItem::DownloadItem(v8::Isolate* isolate, DownloadItem::DownloadItem(v8::Isolate* isolate, download::DownloadItem* item)
download::DownloadItem* download_item) : download_item_(item), isolate_(isolate) {
: download_item_(download_item), isolate_(isolate) {
download_item_->AddObserver(this); download_item_->AddObserver(this);
download_item_->SetUserData( download_item_->SetUserData(
kElectronApiDownloadItemKey, kElectronApiDownloadItemKey,
@ -118,7 +116,7 @@ void DownloadItem::OnDownloadUpdated(download::DownloadItem* item) {
} }
} }
void DownloadItem::OnDownloadDestroyed(download::DownloadItem* download_item) { void DownloadItem::OnDownloadDestroyed(download::DownloadItem* /*item*/) {
download_item_ = nullptr; download_item_ = nullptr;
Unpin(); Unpin();
} }

View file

@ -29,7 +29,7 @@ class DownloadItem : public gin::Wrappable<DownloadItem>,
static gin::Handle<DownloadItem> FromOrCreate(v8::Isolate* isolate, static gin::Handle<DownloadItem> FromOrCreate(v8::Isolate* isolate,
download::DownloadItem* item); download::DownloadItem* item);
static DownloadItem* FromDownloadItem(download::DownloadItem*); static DownloadItem* FromDownloadItem(download::DownloadItem* item);
// gin::Wrappable // gin::Wrappable
static gin::WrapperInfo kWrapperInfo; static gin::WrapperInfo kWrapperInfo;
@ -43,14 +43,14 @@ class DownloadItem : public gin::Wrappable<DownloadItem>,
file_dialog::DialogSettings GetSaveDialogOptions() const; file_dialog::DialogSettings GetSaveDialogOptions() const;
private: private:
DownloadItem(v8::Isolate* isolate, download::DownloadItem* download_item); DownloadItem(v8::Isolate* isolate, download::DownloadItem* item);
~DownloadItem() override; ~DownloadItem() override;
bool CheckAlive() const; bool CheckAlive() const;
// download::DownloadItem::Observer // download::DownloadItem::Observer
void OnDownloadUpdated(download::DownloadItem* download) override; void OnDownloadUpdated(download::DownloadItem* item) override;
void OnDownloadDestroyed(download::DownloadItem* download) override; void OnDownloadDestroyed(download::DownloadItem* item) override;
// JS API // JS API
void Pause(); void Pause();

View file

@ -85,7 +85,7 @@ class Notification : public gin::Wrappable<Notification>,
void SetHasReply(bool new_has_reply); void SetHasReply(bool new_has_reply);
void SetUrgency(const std::u16string& new_urgency); void SetUrgency(const std::u16string& new_urgency);
void SetTimeoutType(const std::u16string& new_timeout_type); void SetTimeoutType(const std::u16string& new_timeout_type);
void SetReplyPlaceholder(const std::u16string& new_reply_placeholder); void SetReplyPlaceholder(const std::u16string& new_placeholder);
void SetSound(const std::u16string& sound); void SetSound(const std::u16string& sound);
void SetActions(const std::vector<electron::NotificationAction>& actions); void SetActions(const std::vector<electron::NotificationAction>& actions);
void SetCloseButtonText(const std::u16string& text); void SetCloseButtonText(const std::u16string& text);

View file

@ -97,7 +97,7 @@ class SimpleURLLoaderWrapper
int64_t sent_bytes) override {} int64_t sent_bytes) override {}
void Clone( void Clone(
mojo::PendingReceiver<network::mojom::URLLoaderNetworkServiceObserver> mojo::PendingReceiver<network::mojom::URLLoaderNetworkServiceObserver>
listener) override; observer) override;
// SimpleURLLoader callbacks // SimpleURLLoader callbacks
void OnResponseStarted(const GURL& final_url, void OnResponseStarted(const GURL& final_url,

View file

@ -24,9 +24,9 @@ namespace auto_updater {
class Delegate { class Delegate {
public: public:
// An error happened. // An error happened.
virtual void OnError(const std::string& error) {} virtual void OnError(const std::string& message) {}
virtual void OnError(const std::string& error, virtual void OnError(const std::string& message,
const int code, const int code,
const std::string& domain) {} const std::string& domain) {}

View file

@ -45,7 +45,7 @@ class ElectronMessagingDelegate : public MessagingDelegate {
void QueryIncognitoConnectability( void QueryIncognitoConnectability(
content::BrowserContext* context, content::BrowserContext* context,
const Extension* extension, const Extension* extension,
content::WebContents* web_contents, content::WebContents* source_contents,
const GURL& url, const GURL& url,
base::OnceCallback<void(bool)> callback) override; base::OnceCallback<void(bool)> callback) override;

View file

@ -71,11 +71,11 @@ class FileSelectHelper : public content::WebContentsObserver,
// of the package. // of the package.
void ProcessSelectedFilesMac(const std::vector<ui::SelectedFileInfo>& files); void ProcessSelectedFilesMac(const std::vector<ui::SelectedFileInfo>& files);
// Saves the paths of |zipped_files| for later deletion. Passes |files| to the // Saves the paths of |temporary_files| for later deletion. Passes |files| to
// render view host. // the render view host.
void ProcessSelectedFilesMacOnUIThread( void ProcessSelectedFilesMacOnUIThread(
const std::vector<ui::SelectedFileInfo>& files, const std::vector<ui::SelectedFileInfo>& files,
const std::vector<base::FilePath>& zipped_files); const std::vector<base::FilePath>& temporary_files);
// Zips the package at |path| into a temporary destination. Returns the // Zips the package at |path| into a temporary destination. Returns the
// temporary destination, if the zip was successful. Otherwise returns an // temporary destination, if the zip was successful. Otherwise returns an

View file

@ -97,7 +97,7 @@ class NativeWindow : public base::SupportsUserData,
virtual bool IsNormal(); virtual bool IsNormal();
virtual gfx::Rect GetNormalBounds() = 0; virtual gfx::Rect GetNormalBounds() = 0;
virtual void SetSizeConstraints( virtual void SetSizeConstraints(
const extensions::SizeConstraints& size_constraints); const extensions::SizeConstraints& window_constraints);
virtual extensions::SizeConstraints GetSizeConstraints() const; virtual extensions::SizeConstraints GetSizeConstraints() const;
virtual void SetContentSizeConstraints( virtual void SetContentSizeConstraints(
const extensions::SizeConstraints& size_constraints); const extensions::SizeConstraints& size_constraints);

View file

@ -77,7 +77,7 @@ class NativeWindowMac : public NativeWindow,
bool IsClosable() override; bool IsClosable() override;
void SetAlwaysOnTop(ui::ZOrderLevel z_order, void SetAlwaysOnTop(ui::ZOrderLevel z_order,
const std::string& level, const std::string& level,
int relativeLevel) override; int relative_level) override;
ui::ZOrderLevel GetZOrderLevel() override; ui::ZOrderLevel GetZOrderLevel() override;
void Center() override; void Center() override;
void Invalidate() override; void Invalidate() override;

View file

@ -16,7 +16,7 @@ class CocoaNotification;
class NotificationPresenterMac : public NotificationPresenter { class NotificationPresenterMac : public NotificationPresenter {
public: public:
CocoaNotification* GetNotification(NSUserNotification* notif); CocoaNotification* GetNotification(NSUserNotification* ns_notification);
NotificationPresenterMac(); NotificationPresenterMac();
~NotificationPresenterMac() override; ~NotificationPresenterMac() override;

View file

@ -113,7 +113,7 @@ class OffScreenRenderWidgetHostView : public content::RenderWidgetHostViewBase,
// content::RenderWidgetHostViewBase: // content::RenderWidgetHostViewBase:
void ResetFallbackToFirstNavigationSurface() override; void ResetFallbackToFirstNavigationSurface() override;
void InitAsPopup(content::RenderWidgetHostView* rwhv, void InitAsPopup(content::RenderWidgetHostView* parent_host_view,
const gfx::Rect& rect) override; const gfx::Rect& rect) override;
void UpdateCursor(const content::WebCursor&) override; void UpdateCursor(const content::WebCursor&) override;
void SetIsLoading(bool is_loading) override; void SetIsLoading(bool is_loading) override;
@ -127,7 +127,7 @@ class OffScreenRenderWidgetHostView : public content::RenderWidgetHostViewBase,
const gfx::Rect& src_rect, const gfx::Rect& src_rect,
const gfx::Size& output_size, const gfx::Size& output_size,
base::OnceCallback<void(const SkBitmap&)> callback) override; base::OnceCallback<void(const SkBitmap&)> callback) override;
void GetScreenInfo(blink::ScreenInfo* results) override; void GetScreenInfo(blink::ScreenInfo* screen_info) override;
void TransformPointToRootSurface(gfx::PointF* point) override; void TransformPointToRootSurface(gfx::PointF* point) override;
gfx::Rect GetBoundsInRootWindow(void) override; gfx::Rect GetBoundsInRootWindow(void) override;
base::Optional<content::DisplayFeature> GetDisplayFeature() override; base::Optional<content::DisplayFeature> GetDisplayFeature() override;

View file

@ -47,10 +47,10 @@ using StringVector = base::CommandLine::StringVector;
// Relaunches the application using the helper application associated with the // Relaunches the application using the helper application associated with the
// currently running instance of Chrome in the parent browser process as the // currently running instance of Chrome in the parent browser process as the
// executable for the relauncher process. |args| is an argv-style vector of // executable for the relauncher process. |argv| is an argv-style vector of
// command line arguments of the form normally passed to execv. args[0] is // command line arguments of the form normally passed to execv. argv[0] is
// also the path to the relaunched process. Because the relauncher process // also the path to the relaunched process. Because the relauncher process
// will ultimately launch the relaunched process via Launch Services, args[0] // will ultimately launch the relaunched process via Launch Services, argv[0]
// may be either a pathname to an executable file or a pathname to an .app // may be either a pathname to an executable file or a pathname to an .app
// bundle directory. The caller should exit soon after RelaunchApp returns // bundle directory. The caller should exit soon after RelaunchApp returns
// successfully. Returns true on success, although some failures can occur // successfully. Returns true on success, although some failures can occur
@ -60,7 +60,7 @@ bool RelaunchApp(const StringVector& argv);
// Identical to RelaunchApp, but uses |helper| as the path to the relauncher // Identical to RelaunchApp, but uses |helper| as the path to the relauncher
// process, and allows additional arguments to be supplied to the relauncher // process, and allows additional arguments to be supplied to the relauncher
// process in relauncher_args. Unlike args[0], |helper| must be a pathname to // process in relauncher_args. Unlike argv[0], |helper| must be a pathname to
// an executable file. The helper path given must be from the same version of // an executable file. The helper path given must be from the same version of
// Chrome as the running parent browser process, as there are no guarantees // Chrome as the running parent browser process, as there are no guarantees
// that the parent and relauncher processes from different versions will be // that the parent and relauncher processes from different versions will be
@ -69,7 +69,7 @@ bool RelaunchApp(const StringVector& argv);
// location's helper. // location's helper.
bool RelaunchAppWithHelper(const base::FilePath& helper, bool RelaunchAppWithHelper(const base::FilePath& helper,
const StringVector& relauncher_args, const StringVector& relauncher_args,
const StringVector& args); const StringVector& argv);
// The entry point from ChromeMain into the relauncher process. // The entry point from ChromeMain into the relauncher process.
int RelauncherMain(const content::MainFunctionParams& main_parameters); int RelauncherMain(const content::MainFunctionParams& main_parameters);

View file

@ -20,7 +20,7 @@ typedef struct {
typedef std::map<ui::Accelerator, MenuItem> AcceleratorTable; typedef std::map<ui::Accelerator, MenuItem> AcceleratorTable;
// Parse a string as an accelerator. // Parse a string as an accelerator.
bool StringToAccelerator(const std::string& description, bool StringToAccelerator(const std::string& shortcut,
ui::Accelerator* accelerator); ui::Accelerator* accelerator);
// Generate a table that contains menu model's accelerators and command ids. // Generate a table that contains menu model's accelerators and command ids.

View file

@ -32,7 +32,7 @@ class WebDialogHelper {
const blink::mojom::FileChooserParams& params); const blink::mojom::FileChooserParams& params);
void EnumerateDirectory(content::WebContents* web_contents, void EnumerateDirectory(content::WebContents* web_contents,
scoped_refptr<content::FileSelectListener> listener, scoped_refptr<content::FileSelectListener> listener,
const base::FilePath& path); const base::FilePath& dir);
private: private:
NativeWindow* window_; NativeWindow* window_;

View file

@ -237,7 +237,7 @@ bool Archive::Stat(const base::FilePath& path, Stats* stats) {
} }
bool Archive::Readdir(const base::FilePath& path, bool Archive::Readdir(const base::FilePath& path,
std::vector<base::FilePath>* list) { std::vector<base::FilePath>* files) {
if (!header_) if (!header_)
return false; return false;
@ -245,13 +245,13 @@ bool Archive::Readdir(const base::FilePath& path,
if (!GetNodeFromPath(path.AsUTF8Unsafe(), header_.get(), &node)) if (!GetNodeFromPath(path.AsUTF8Unsafe(), header_.get(), &node))
return false; return false;
const base::DictionaryValue* files; const base::DictionaryValue* files_node;
if (!GetFilesNode(header_.get(), node, &files)) if (!GetFilesNode(header_.get(), node, &files_node))
return false; return false;
base::DictionaryValue::Iterator iter(*files); base::DictionaryValue::Iterator iter(*files_node);
while (!iter.IsAtEnd()) { while (!iter.IsAtEnd()) {
list->push_back(base::FilePath::FromUTF8Unsafe(iter.key())); files->push_back(base::FilePath::FromUTF8Unsafe(iter.key()));
iter.Advance(); iter.Advance();
} }
return true; return true;

View file

@ -76,7 +76,7 @@ class SpellCheckClient : public blink::WebSpellCheckPanelHostClient,
// Output variable contraction_words will contain individual // Output variable contraction_words will contain individual
// words in the contraction. // words in the contraction.
bool IsContraction(const SpellCheckScope& scope, bool IsContraction(const SpellCheckScope& scope,
const std::u16string& word, const std::u16string& contraction,
std::vector<std::u16string>* contraction_words); std::vector<std::u16string>* contraction_words);
// Callback for the JS API which returns the list of misspelled words. // Callback for the JS API which returns the list of misspelled words.

View file

@ -64,7 +64,7 @@ class RendererClientBase : public content::ContentRendererClient
#if BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER) #if BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER)
// service_manager::LocalInterfaceProvider implementation. // service_manager::LocalInterfaceProvider implementation.
void GetInterface(const std::string& name, void GetInterface(const std::string& name,
mojo::ScopedMessagePipeHandle request_handle) override; mojo::ScopedMessagePipeHandle interface_pipe) override;
#endif #endif
virtual void DidCreateScriptContext(v8::Handle<v8::Context> context, virtual void DidCreateScriptContext(v8::Handle<v8::Context> context,