summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordpapad@chromium.org <dpapad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-11 20:47:22 +0000
committerdpapad@chromium.org <dpapad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-11 20:47:22 +0000
commit37cbcfeb1c02033b2785c7aeb321f99ad9f65821 (patch)
treee83848800dc5cd5477e3480dbff3166ead14750f
parent3b6ea292868e9677ac4261235e7a8c82e1e177d8 (diff)
downloadchromium_src-37cbcfeb1c02033b2785c7aeb321f99ad9f65821.zip
chromium_src-37cbcfeb1c02033b2785c7aeb321f99ad9f65821.tar.gz
chromium_src-37cbcfeb1c02033b2785c7aeb321f99ad9f65821.tar.bz2
Coverity PASS_BY_VALUE bug fixes
BUG=CIDs 8731,9102,15473,6809 TEST=NONE Review URL: http://codereview.chromium.org/6670025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77854 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/automation/automation_provider.h2
-rw-r--r--chrome/browser/automation/automation_provider_gtk.cc11
-rw-r--r--chrome/browser/automation/automation_provider_mac.mm11
-rw-r--r--chrome/browser/automation/automation_provider_win.cc11
-rw-r--r--chrome/browser/ui/gtk/gtk_theme_provider.cc5
-rw-r--r--chrome/browser/ui/gtk/gtk_theme_provider.h3
-rw-r--r--ui/base/x/x11_util.cc2
-rw-r--r--ui/base/x/x11_util_internal.h2
-rw-r--r--ui/gfx/skbitmap_operations.cc2
-rw-r--r--ui/gfx/skbitmap_operations.h2
10 files changed, 28 insertions, 23 deletions
diff --git a/chrome/browser/automation/automation_provider.h b/chrome/browser/automation/automation_provider.h
index 53b9428..f381fb5 100644
--- a/chrome/browser/automation/automation_provider.h
+++ b/chrome/browser/automation/automation_provider.h
@@ -224,7 +224,7 @@ class AutomationProvider
// IPC Message callbacks.
void WindowSimulateDrag(int handle,
- std::vector<gfx::Point> drag_path,
+ const std::vector<gfx::Point>& drag_path,
int flags,
bool press_escape_en_route,
IPC::Message* reply_message);
diff --git a/chrome/browser/automation/automation_provider_gtk.cc b/chrome/browser/automation/automation_provider_gtk.cc
index fcc8733..11b6d31 100644
--- a/chrome/browser/automation/automation_provider_gtk.cc
+++ b/chrome/browser/automation/automation_provider_gtk.cc
@@ -103,11 +103,12 @@ class MouseMoveTask : public Task {
DISALLOW_COPY_AND_ASSIGN(MouseMoveTask);
};
-void AutomationProvider::WindowSimulateDrag(int handle,
- std::vector<gfx::Point> drag_path,
- int flags,
- bool press_escape_en_route,
- IPC::Message* reply_message) {
+void AutomationProvider::WindowSimulateDrag(
+ int handle,
+ const std::vector<gfx::Point>& drag_path,
+ int flags,
+ bool press_escape_en_route,
+ IPC::Message* reply_message) {
// TODO(estade): don't ignore |flags| or |escape_en_route|.
gfx::NativeWindow window =
browser_tracker_->GetResource(handle)->window()->GetNativeHandle();
diff --git a/chrome/browser/automation/automation_provider_mac.mm b/chrome/browser/automation/automation_provider_mac.mm
index d08b85e..703e0b3 100644
--- a/chrome/browser/automation/automation_provider_mac.mm
+++ b/chrome/browser/automation/automation_provider_mac.mm
@@ -23,11 +23,12 @@ void AutomationProvider::PrintAsync(int tab_handle) {
NOTIMPLEMENTED();
}
-void AutomationProvider::WindowSimulateDrag(int handle,
- std::vector<gfx::Point> drag_path,
- int flags,
- bool press_escape_en_route,
- IPC::Message* reply_message) {
+void AutomationProvider::WindowSimulateDrag(
+ int handle,
+ const std::vector<gfx::Point>& drag_path,
+ int flags,
+ bool press_escape_en_route,
+ IPC::Message* reply_message) {
NOTIMPLEMENTED();
AutomationMsg_WindowDrag::WriteReplyParams(reply_message, false);
Send(reply_message);
diff --git a/chrome/browser/automation/automation_provider_win.cc b/chrome/browser/automation/automation_provider_win.cc
index 5ce9121..8797af8 100644
--- a/chrome/browser/automation/automation_provider_win.cc
+++ b/chrome/browser/automation/automation_provider_win.cc
@@ -147,11 +147,12 @@ class WindowDragResponseTask : public Task {
DISALLOW_COPY_AND_ASSIGN(WindowDragResponseTask);
};
-void AutomationProvider::WindowSimulateDrag(int handle,
- std::vector<gfx::Point> drag_path,
- int flags,
- bool press_escape_en_route,
- IPC::Message* reply_message) {
+void AutomationProvider::WindowSimulateDrag(
+ int handle,
+ const std::vector<gfx::Point>& drag_path,
+ int flags,
+ bool press_escape_en_route,
+ IPC::Message* reply_message) {
if (browser_tracker_->ContainsHandle(handle) && (drag_path.size() > 1)) {
gfx::NativeWindow window =
browser_tracker_->GetResource(handle)->window()->GetNativeHandle();
diff --git a/chrome/browser/ui/gtk/gtk_theme_provider.cc b/chrome/browser/ui/gtk/gtk_theme_provider.cc
index 921bdeb..119cc84 100644
--- a/chrome/browser/ui/gtk/gtk_theme_provider.cc
+++ b/chrome/browser/ui/gtk/gtk_theme_provider.cc
@@ -1018,8 +1018,9 @@ SkBitmap* GtkThemeProvider::GenerateTabImage(int base_id) const {
bg_tint, 0, 0, bg_tint.width(), bg_tint.height()));
}
-SkBitmap* GtkThemeProvider::GenerateTintedIcon(int base_id,
- color_utils::HSL tint) const {
+SkBitmap* GtkThemeProvider::GenerateTintedIcon(
+ int base_id,
+ const color_utils::HSL& tint) const {
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
scoped_ptr<SkBitmap> button(new SkBitmap(*rb.GetBitmapNamed(base_id)));
return new SkBitmap(SkBitmapOperations::CreateHSLShiftedBitmap(
diff --git a/chrome/browser/ui/gtk/gtk_theme_provider.h b/chrome/browser/ui/gtk/gtk_theme_provider.h
index d3051aa..cdaed61 100644
--- a/chrome/browser/ui/gtk/gtk_theme_provider.h
+++ b/chrome/browser/ui/gtk/gtk_theme_provider.h
@@ -214,7 +214,8 @@ class GtkThemeProvider : public BrowserThemeProvider,
SkBitmap* GenerateTabImage(int base_id) const;
// Tints an icon based on tint.
- SkBitmap* GenerateTintedIcon(int base_id, color_utils::HSL tint) const;
+ SkBitmap* GenerateTintedIcon(int base_id,
+ const color_utils::HSL& tint) const;
// Returns the tint for buttons that contrasts with the normal window
// background color.
diff --git a/ui/base/x/x11_util.cc b/ui/base/x/x11_util.cc
index 6234069..f7c9c26 100644
--- a/ui/base/x/x11_util.cc
+++ b/ui/base/x/x11_util.cc
@@ -828,7 +828,7 @@ void SetX11ErrorHandlers(XErrorHandler error_handler,
}
void LogErrorEventDescription(Display* dpy,
- XErrorEvent error_event) {
+ const XErrorEvent& error_event) {
char error_str[256];
char request_str[256];
diff --git a/ui/base/x/x11_util_internal.h b/ui/base/x/x11_util_internal.h
index 87b75ef8..31bbab2 100644
--- a/ui/base/x/x11_util_internal.h
+++ b/ui/base/x/x11_util_internal.h
@@ -44,7 +44,7 @@ namespace ui {
// X11 Error handler because it queries the server to decode the
// error message, which may trigger other errors. A suitable workaround
// is to post a task in the error handler to call this function.
- void LogErrorEventDescription(Display* dpy, XErrorEvent error_event);
+ void LogErrorEventDescription(Display* dpy, const XErrorEvent& error_event);
} // namespace ui
diff --git a/ui/gfx/skbitmap_operations.cc b/ui/gfx/skbitmap_operations.cc
index d3b4d8c..7cd7122 100644
--- a/ui/gfx/skbitmap_operations.cc
+++ b/ui/gfx/skbitmap_operations.cc
@@ -507,7 +507,7 @@ const LineProcessor kLineProcessors[kNumHOps][kNumSOps][kNumLOps] = {
// static
SkBitmap SkBitmapOperations::CreateHSLShiftedBitmap(
const SkBitmap& bitmap,
- color_utils::HSL hsl_shift) {
+ const color_utils::HSL& hsl_shift) {
// Default to NOPs.
HSLShift::OperationOnH H_op = HSLShift::kOpHNone;
HSLShift::OperationOnS S_op = HSLShift::kOpSNone;
diff --git a/ui/gfx/skbitmap_operations.h b/ui/gfx/skbitmap_operations.h
index cde09cb..dce8e3c 100644
--- a/ui/gfx/skbitmap_operations.h
+++ b/ui/gfx/skbitmap_operations.h
@@ -62,7 +62,7 @@ class SkBitmapOperations {
// 0.5 = leave unchanged.
// 1 = full lightness (make all pixels white).
static SkBitmap CreateHSLShiftedBitmap(const SkBitmap& bitmap,
- color_utils::HSL hsl_shift);
+ const color_utils::HSL& hsl_shift);
// Create a bitmap that is cropped from another bitmap. This is special
// because it tiles the original bitmap, so your coordinates can extend