Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use consistent parameter names #29361

Merged
merged 1 commit into from Jun 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion shell/browser/api/electron_api_app.h
Expand Up @@ -126,7 +126,7 @@ class App : public ElectronBrowserClient::Delegate,
base::OnceClosure SelectClientCertificate(
content::WebContents* web_contents,
net::SSLCertRequestInfo* cert_request_info,
net::ClientCertIdentityList client_certs,
net::ClientCertIdentityList identities,
std::unique_ptr<content::ClientCertificateDelegate> delegate) override;
bool CanCreateWindow(content::RenderFrameHost* opener,
const GURL& opener_url,
Expand Down
2 changes: 1 addition & 1 deletion shell/browser/api/electron_api_auto_updater.h
Expand Up @@ -35,7 +35,7 @@ class AutoUpdater : public gin::Wrappable<AutoUpdater>,
~AutoUpdater() override;

// Delegate implementations.
void OnError(const std::string& error) override;
void OnError(const std::string& message) override;
void OnError(const std::string& message,
const int code,
const std::string& domain) override;
Expand Down
12 changes: 5 additions & 7 deletions shell/browser/api/electron_api_download_item.cc
Expand Up @@ -74,17 +74,15 @@ const void* kElectronApiDownloadItemKey = &kElectronApiDownloadItemKey;
gin::WrapperInfo DownloadItem::kWrapperInfo = {gin::kEmbedderNativeGin};

// static
DownloadItem* DownloadItem::FromDownloadItem(
download::DownloadItem* download_item) {
DownloadItem* DownloadItem::FromDownloadItem(download::DownloadItem* item) {
// ^- say that 7 times fast in a row
auto* data = static_cast<UserDataLink*>(
download_item->GetUserData(kElectronApiDownloadItemKey));
item->GetUserData(kElectronApiDownloadItemKey));
return data ? data->download_item.get() : nullptr;
}

DownloadItem::DownloadItem(v8::Isolate* isolate,
download::DownloadItem* download_item)
: download_item_(download_item), isolate_(isolate) {
DownloadItem::DownloadItem(v8::Isolate* isolate, download::DownloadItem* item)
: download_item_(item), isolate_(isolate) {
download_item_->AddObserver(this);
download_item_->SetUserData(
kElectronApiDownloadItemKey,
Expand Down Expand Up @@ -119,7 +117,7 @@ void DownloadItem::OnDownloadUpdated(download::DownloadItem* item) {
}
}

void DownloadItem::OnDownloadDestroyed(download::DownloadItem* download_item) {
void DownloadItem::OnDownloadDestroyed(download::DownloadItem* /*item*/) {
download_item_ = nullptr;
Unpin();
}
Expand Down
8 changes: 4 additions & 4 deletions shell/browser/api/electron_api_download_item.h
Expand Up @@ -30,7 +30,7 @@ class DownloadItem : public gin::Wrappable<DownloadItem>,
static gin::Handle<DownloadItem> FromOrCreate(v8::Isolate* isolate,
download::DownloadItem* item);

static DownloadItem* FromDownloadItem(download::DownloadItem*);
static DownloadItem* FromDownloadItem(download::DownloadItem* item);

// gin::Wrappable
static gin::WrapperInfo kWrapperInfo;
Expand All @@ -44,14 +44,14 @@ class DownloadItem : public gin::Wrappable<DownloadItem>,
file_dialog::DialogSettings GetSaveDialogOptions() const;

private:
DownloadItem(v8::Isolate* isolate, download::DownloadItem* download_item);
DownloadItem(v8::Isolate* isolate, download::DownloadItem* item);
~DownloadItem() override;

bool CheckAlive() const;

// download::DownloadItem::Observer
void OnDownloadUpdated(download::DownloadItem* download) override;
void OnDownloadDestroyed(download::DownloadItem* download) override;
void OnDownloadUpdated(download::DownloadItem* item) override;
void OnDownloadDestroyed(download::DownloadItem* item) override;

// JS API
void Pause();
Expand Down
2 changes: 1 addition & 1 deletion shell/browser/api/electron_api_notification.h
Expand Up @@ -86,7 +86,7 @@ class Notification : public gin::Wrappable<Notification>,
void SetHasReply(bool new_has_reply);
void SetUrgency(const std::u16string& new_urgency);
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 SetActions(const std::vector<electron::NotificationAction>& actions);
void SetCloseButtonText(const std::u16string& text);
Expand Down
2 changes: 1 addition & 1 deletion shell/browser/api/electron_api_url_loader.h
Expand Up @@ -97,7 +97,7 @@ class SimpleURLLoaderWrapper
int64_t sent_bytes) override {}
void Clone(
mojo::PendingReceiver<network::mojom::URLLoaderNetworkServiceObserver>
listener) override;
observer) override;

// SimpleURLLoader callbacks
void OnResponseStarted(const GURL& final_url,
Expand Down
4 changes: 2 additions & 2 deletions shell/browser/auto_updater.h
Expand Up @@ -24,9 +24,9 @@ namespace auto_updater {
class Delegate {
public:
// 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 std::string& domain) {}

Expand Down
2 changes: 1 addition & 1 deletion shell/browser/extensions/electron_messaging_delegate.h
Expand Up @@ -45,7 +45,7 @@ class ElectronMessagingDelegate : public MessagingDelegate {
void QueryIncognitoConnectability(
content::BrowserContext* context,
const Extension* extension,
content::WebContents* web_contents,
content::WebContents* source_contents,
const GURL& url,
base::OnceCallback<void(bool)> callback) override;

Expand Down
6 changes: 3 additions & 3 deletions shell/browser/file_select_helper.h
Expand Up @@ -74,11 +74,11 @@ class FileSelectHelper : public content::WebContentsObserver,
// of the package.
void ProcessSelectedFilesMac(const std::vector<ui::SelectedFileInfo>& files);

// Saves the paths of |zipped_files| for later deletion. Passes |files| to the
// render view host.
// Saves the paths of |temporary_files| for later deletion. Passes |files| to
// the render view host.
void ProcessSelectedFilesMacOnUIThread(
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
// temporary destination, if the zip was successful. Otherwise returns an
Expand Down
2 changes: 1 addition & 1 deletion shell/browser/native_window.h
Expand Up @@ -99,7 +99,7 @@ class NativeWindow : public base::SupportsUserData,
virtual bool IsNormal();
virtual gfx::Rect GetNormalBounds() = 0;
virtual void SetSizeConstraints(
const extensions::SizeConstraints& size_constraints);
const extensions::SizeConstraints& window_constraints);
virtual extensions::SizeConstraints GetSizeConstraints() const;
virtual void SetContentSizeConstraints(
const extensions::SizeConstraints& size_constraints);
Expand Down
2 changes: 1 addition & 1 deletion shell/browser/native_window_mac.h
Expand Up @@ -78,7 +78,7 @@ class NativeWindowMac : public NativeWindow,
bool IsClosable() override;
void SetAlwaysOnTop(ui::ZOrderLevel z_order,
const std::string& level,
int relativeLevel) override;
int relative_level) override;
ui::ZOrderLevel GetZOrderLevel() override;
void Center() override;
void Invalidate() override;
Expand Down
Expand Up @@ -16,7 +16,7 @@ class CocoaNotification;

class NotificationPresenterMac : public NotificationPresenter {
public:
CocoaNotification* GetNotification(NSUserNotification* notif);
CocoaNotification* GetNotification(NSUserNotification* ns_notification);

NotificationPresenterMac();
~NotificationPresenterMac() override;
Expand Down
4 changes: 2 additions & 2 deletions shell/browser/osr/osr_render_widget_host_view.h
Expand Up @@ -113,7 +113,7 @@ class OffScreenRenderWidgetHostView : public content::RenderWidgetHostViewBase,
// content::RenderWidgetHostViewBase:

void ResetFallbackToFirstNavigationSurface() override;
void InitAsPopup(content::RenderWidgetHostView* rwhv,
void InitAsPopup(content::RenderWidgetHostView* parent_host_view,
const gfx::Rect& rect) override;
void UpdateCursor(const content::WebCursor&) override;
void SetIsLoading(bool is_loading) override;
Expand All @@ -127,7 +127,7 @@ class OffScreenRenderWidgetHostView : public content::RenderWidgetHostViewBase,
const gfx::Rect& src_rect,
const gfx::Size& output_size,
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;
gfx::Rect GetBoundsInRootWindow(void) override;
base::Optional<content::DisplayFeature> GetDisplayFeature() override;
Expand Down
10 changes: 5 additions & 5 deletions shell/browser/relauncher.h
Expand Up @@ -50,10 +50,10 @@ using StringVector = base::CommandLine::StringVector;

// Relaunches the application using the helper application associated with 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
// command line arguments of the form normally passed to execv. args[0] is
// executable for the relauncher process. |argv| is an argv-style vector of
// command line arguments of the form normally passed to execv. argv[0] is
// 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
// bundle directory. The caller should exit soon after RelaunchApp returns
// successfully. Returns true on success, although some failures can occur
Expand All @@ -63,7 +63,7 @@ bool RelaunchApp(const StringVector& argv);

// Identical to RelaunchApp, but uses |helper| as the path 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
// Chrome as the running parent browser process, as there are no guarantees
// that the parent and relauncher processes from different versions will be
Expand All @@ -72,7 +72,7 @@ bool RelaunchApp(const StringVector& argv);
// location's helper.
bool RelaunchAppWithHelper(const base::FilePath& helper,
const StringVector& relauncher_args,
const StringVector& args);
const StringVector& argv);

// The entry point from ChromeMain into the relauncher process.
int RelauncherMain(const content::MainFunctionParams& main_parameters);
Expand Down
2 changes: 1 addition & 1 deletion shell/browser/ui/accelerator_util.h
Expand Up @@ -20,7 +20,7 @@ typedef struct {
typedef std::map<ui::Accelerator, MenuItem> AcceleratorTable;

// Parse a string as an accelerator.
bool StringToAccelerator(const std::string& description,
bool StringToAccelerator(const std::string& shortcut,
ui::Accelerator* accelerator);

// Generate a table that contains memu model's accelerators and command ids.
Expand Down
2 changes: 1 addition & 1 deletion shell/browser/web_dialog_helper.h
Expand Up @@ -35,7 +35,7 @@ class WebDialogHelper {
const blink::mojom::FileChooserParams& params);
void EnumerateDirectory(content::WebContents* web_contents,
scoped_refptr<content::FileSelectListener> listener,
const base::FilePath& path);
const base::FilePath& dir);

private:
NativeWindow* window_;
Expand Down
10 changes: 5 additions & 5 deletions shell/common/asar/archive.cc
Expand Up @@ -237,21 +237,21 @@ bool Archive::Stat(const base::FilePath& path, Stats* stats) {
}

bool Archive::Readdir(const base::FilePath& path,
std::vector<base::FilePath>* list) {
std::vector<base::FilePath>* files) {
if (!header_)
return false;

const base::DictionaryValue* node;
if (!GetNodeFromPath(path.AsUTF8Unsafe(), header_.get(), &node))
return false;

const base::DictionaryValue* files;
if (!GetFilesNode(header_.get(), node, &files))
const base::DictionaryValue* files_node;
if (!GetFilesNode(header_.get(), node, &files_node))
return false;

base::DictionaryValue::Iterator iter(*files);
base::DictionaryValue::Iterator iter(*files_node);
while (!iter.IsAtEnd()) {
list->push_back(base::FilePath::FromUTF8Unsafe(iter.key()));
files->push_back(base::FilePath::FromUTF8Unsafe(iter.key()));
iter.Advance();
}
return true;
Expand Down
2 changes: 1 addition & 1 deletion shell/renderer/api/electron_api_spell_check_client.h
Expand Up @@ -76,7 +76,7 @@ class SpellCheckClient : public blink::WebSpellCheckPanelHostClient,
// Output variable contraction_words will contain individual
// words in the contraction.
bool IsContraction(const SpellCheckScope& scope,
const std::u16string& word,
const std::u16string& contraction,
std::vector<std::u16string>* contraction_words);

// Callback for the JS API which returns the list of misspelled words.
Expand Down
2 changes: 1 addition & 1 deletion shell/renderer/renderer_client_base.h
Expand Up @@ -65,7 +65,7 @@ class RendererClientBase : public content::ContentRendererClient
#if BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER)
// service_manager::LocalInterfaceProvider implementation.
void GetInterface(const std::string& name,
mojo::ScopedMessagePipeHandle request_handle) override;
mojo::ScopedMessagePipeHandle interface_pipe) override;
#endif

virtual void DidCreateScriptContext(v8::Handle<v8::Context> context,
Expand Down