summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-06 02:16:08 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-06 02:16:08 +0000
commita76411fc3f8e18ce0332c66d9b411776cb1ade49 (patch)
tree2ea7cb1ea18259b6866e72b8e3cf034bebe6ff81 /ppapi
parent736e56a578416be375a9b88f5ed0e88d325b50e6 (diff)
downloadchromium_src-a76411fc3f8e18ce0332c66d9b411776cb1ade49.zip
chromium_src-a76411fc3f8e18ce0332c66d9b411776cb1ade49.tar.gz
chromium_src-a76411fc3f8e18ce0332c66d9b411776cb1ade49.tar.bz2
Coverity: Fix several pass-by-values.
CID_COUNT=6 CID=103346,103347,103348,103349,103354,103355 TEST=none BUG=none R=groby Review URL: https://chromiumcodereview.appspot.com/9595004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@125071 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/proxy/ppb_video_capture_proxy.cc10
-rw-r--r--ppapi/shared_impl/ppb_video_capture_shared.cc4
-rw-r--r--ppapi/shared_impl/ppb_video_capture_shared.h16
-rw-r--r--ppapi/thunk/ppb_video_capture_api.h4
4 files changed, 18 insertions, 16 deletions
diff --git a/ppapi/proxy/ppb_video_capture_proxy.cc b/ppapi/proxy/ppb_video_capture_proxy.cc
index 8477d53..6a51299 100644
--- a/ppapi/proxy/ppb_video_capture_proxy.cc
+++ b/ppapi/proxy/ppb_video_capture_proxy.cc
@@ -164,12 +164,12 @@ class VideoCapture : public PPB_VideoCapture_Shared {
// PPB_VideoCapture_Shared implementation.
virtual int32_t InternalEnumerateDevices(
PP_Resource* devices,
- PP_CompletionCallback callback) OVERRIDE;
+ const PP_CompletionCallback& callback) OVERRIDE;
virtual int32_t InternalOpen(
const std::string& device_id,
const PP_VideoCaptureDeviceInfo_Dev& requested_info,
uint32_t buffer_count,
- PP_CompletionCallback callback) OVERRIDE;
+ const PP_CompletionCallback& callback) OVERRIDE;
virtual int32_t InternalStartCapture() OVERRIDE;
virtual int32_t InternalReuseBuffer(uint32_t buffer) OVERRIDE;
virtual int32_t InternalStopCapture() OVERRIDE;
@@ -213,8 +213,8 @@ bool VideoCapture::OnStatus(PP_VideoCaptureStatus_Dev status) {
return false;
}
-int32_t VideoCapture::InternalEnumerateDevices(PP_Resource* devices,
- PP_CompletionCallback callback) {
+int32_t VideoCapture::InternalEnumerateDevices(
+ PP_Resource* devices, const PP_CompletionCallback& callback) {
devices_ = devices;
enumerate_devices_callback_ = new TrackedCallback(this, callback);
GetDispatcher()->Send(new PpapiHostMsg_PPBVideoCapture_EnumerateDevices(
@@ -226,7 +226,7 @@ int32_t VideoCapture::InternalOpen(
const std::string& device_id,
const PP_VideoCaptureDeviceInfo_Dev& requested_info,
uint32_t buffer_count,
- PP_CompletionCallback callback) {
+ const PP_CompletionCallback& callback) {
// Disallow blocking call. The base class doesn't check this.
if (!callback.func)
return PP_ERROR_BLOCKS_MAIN_THREAD;
diff --git a/ppapi/shared_impl/ppb_video_capture_shared.cc b/ppapi/shared_impl/ppb_video_capture_shared.cc
index a084d5e..08f6bb2 100644
--- a/ppapi/shared_impl/ppb_video_capture_shared.cc
+++ b/ppapi/shared_impl/ppb_video_capture_shared.cc
@@ -37,7 +37,7 @@ thunk::PPB_VideoCapture_API* PPB_VideoCapture_Shared::AsPPB_VideoCapture_API() {
int32_t PPB_VideoCapture_Shared::EnumerateDevices(
PP_Resource* devices,
- PP_CompletionCallback callback) {
+ const PP_CompletionCallback& callback) {
if (!callback.func)
return PP_ERROR_BLOCKS_MAIN_THREAD;
if (TrackedCallback::IsPending(enumerate_devices_callback_))
@@ -50,7 +50,7 @@ int32_t PPB_VideoCapture_Shared::Open(
const std::string& device_id,
const PP_VideoCaptureDeviceInfo_Dev& requested_info,
uint32_t buffer_count,
- PP_CompletionCallback callback) {
+ const PP_CompletionCallback& callback) {
if (open_state_ != BEFORE_OPEN)
return PP_ERROR_FAILED;
diff --git a/ppapi/shared_impl/ppb_video_capture_shared.h b/ppapi/shared_impl/ppb_video_capture_shared.h
index 5c1d96c..b5c3385 100644
--- a/ppapi/shared_impl/ppb_video_capture_shared.h
+++ b/ppapi/shared_impl/ppb_video_capture_shared.h
@@ -23,16 +23,17 @@ class PPAPI_SHARED_EXPORT PPB_VideoCapture_Shared
explicit PPB_VideoCapture_Shared(const HostResource& host_resource);
virtual ~PPB_VideoCapture_Shared();
- // Resource overrides.
+ // Resource implementation.
virtual thunk::PPB_VideoCapture_API* AsPPB_VideoCapture_API() OVERRIDE;
// PPB_VideoCapture_API implementation.
- virtual int32_t EnumerateDevices(PP_Resource* devices,
- PP_CompletionCallback callback) OVERRIDE;
+ virtual int32_t EnumerateDevices(
+ PP_Resource* devices,
+ const PP_CompletionCallback& callback) OVERRIDE;
virtual int32_t Open(const std::string& device_id,
const PP_VideoCaptureDeviceInfo_Dev& requested_info,
uint32_t buffer_count,
- PP_CompletionCallback callback) OVERRIDE;
+ const PP_CompletionCallback& callback) OVERRIDE;
virtual int32_t StartCapture() OVERRIDE;
virtual int32_t ReuseBuffer(uint32_t buffer) OVERRIDE;
virtual int32_t StopCapture() OVERRIDE;
@@ -55,13 +56,14 @@ class PPAPI_SHARED_EXPORT PPB_VideoCapture_Shared
// Subclasses should implement these methods to do impl- and proxy-specific
// work.
- virtual int32_t InternalEnumerateDevices(PP_Resource* devices,
- PP_CompletionCallback callback) = 0;
+ virtual int32_t InternalEnumerateDevices(
+ PP_Resource* devices,
+ const PP_CompletionCallback& callback) = 0;
virtual int32_t InternalOpen(
const std::string& device_id,
const PP_VideoCaptureDeviceInfo_Dev& requested_info,
uint32_t buffer_count,
- PP_CompletionCallback callback) = 0;
+ const PP_CompletionCallback& callback) = 0;
virtual int32_t InternalStartCapture() = 0;
virtual int32_t InternalReuseBuffer(uint32_t buffer) = 0;
virtual int32_t InternalStopCapture() = 0;
diff --git a/ppapi/thunk/ppb_video_capture_api.h b/ppapi/thunk/ppb_video_capture_api.h
index d60df0f..a792ff3 100644
--- a/ppapi/thunk/ppb_video_capture_api.h
+++ b/ppapi/thunk/ppb_video_capture_api.h
@@ -21,11 +21,11 @@ class PPB_VideoCapture_API {
virtual ~PPB_VideoCapture_API() {}
virtual int32_t EnumerateDevices(PP_Resource* devices,
- PP_CompletionCallback callback) = 0;
+ const PP_CompletionCallback& callback) = 0;
virtual int32_t Open(const std::string& device_id,
const PP_VideoCaptureDeviceInfo_Dev& requested_info,
uint32_t buffer_count,
- PP_CompletionCallback callback) = 0;
+ const PP_CompletionCallback& callback) = 0;
virtual int32_t StartCapture() = 0;
virtual int32_t ReuseBuffer(uint32_t buffer) = 0;
virtual int32_t StopCapture() = 0;