Avoid unnecessary copy of parameters.

This commit is contained in:
Haojian Wu 2017-03-29 21:29:52 +02:00
parent 99293dd57f
commit 5f724e57bc
8 changed files with 8 additions and 8 deletions

View file

@ -233,7 +233,7 @@ class ResolveProxyHelper {
public:
ResolveProxyHelper(AtomBrowserContext* browser_context,
const GURL& url,
Session::ResolveProxyCallback callback)
const Session::ResolveProxyCallback& callback)
: callback_(callback),
original_thread_(base::ThreadTaskRunnerHandle::Get()) {
scoped_refptr<net::URLRequestContextGetter> context_getter =

View file

@ -240,7 +240,7 @@ content::ServiceWorkerContext* GetServiceWorkerContext(
}
// Called when CapturePage is done.
void OnCapturePageDone(base::Callback<void(const gfx::Image&)> callback,
void OnCapturePageDone(const base::Callback<void(const gfx::Image&)>& callback,
const SkBitmap& bitmap,
content::ReadbackResponse response) {
callback.Run(gfx::Image::CreateFrom1xBitmap(bitmap));

View file

@ -102,7 +102,7 @@ class Browser : public WindowListObserver {
std::vector<base::string16> args;
};
void SetLoginItemSettings(LoginItemSettings settings);
LoginItemSettings GetLoginItemSettings(LoginItemSettings options);
LoginItemSettings GetLoginItemSettings(const LoginItemSettings& options);
#if defined(OS_MACOSX)
// Hide the application.

View file

@ -64,7 +64,7 @@ void Browser::SetLoginItemSettings(LoginItemSettings settings) {
}
Browser::LoginItemSettings Browser::GetLoginItemSettings(
LoginItemSettings options) {
const LoginItemSettings& options) {
return LoginItemSettings();
}

View file

@ -152,7 +152,7 @@ bool Browser::ContinueUserActivity(const std::string& type,
}
Browser::LoginItemSettings Browser::GetLoginItemSettings(
LoginItemSettings options) {
const LoginItemSettings& options) {
LoginItemSettings settings;
settings.open_at_login = base::mac::CheckLoginItemStatus(
&settings.open_as_hidden);

View file

@ -287,7 +287,7 @@ void Browser::SetLoginItemSettings(LoginItemSettings settings) {
}
Browser::LoginItemSettings Browser::GetLoginItemSettings(
LoginItemSettings options) {
const LoginItemSettings& options) {
LoginItemSettings settings;
base::string16 keyPath = L"Software\\Microsoft\\Windows\\CurrentVersion\\Run";
base::win::RegKey key(HKEY_CURRENT_USER, keyPath.c_str(), KEY_ALL_ACCESS);

View file

@ -236,7 +236,7 @@ void AtomSandboxedRendererClient::WillReleaseScriptContext(
void AtomSandboxedRendererClient::InvokeIpcCallback(
v8::Handle<v8::Context> context,
std::string callback_name,
const std::string& callback_name,
std::vector<v8::Handle<v8::Value>> args) {
auto isolate = context->GetIsolate();
auto binding_key = mate::ConvertToV8(isolate, kIpcKey)->ToString();

View file

@ -22,7 +22,7 @@ class AtomSandboxedRendererClient : public content::ContentRendererClient {
void WillReleaseScriptContext(
v8::Handle<v8::Context> context, content::RenderFrame* render_frame);
void InvokeIpcCallback(v8::Handle<v8::Context> context,
std::string callback_name,
const std::string& callback_name,
std::vector<v8::Handle<v8::Value>> args);
// content::ContentRendererClient:
void RenderFrameCreated(content::RenderFrame*) override;