Commit 0269536e authored by Dave Tapuska's avatar Dave Tapuska Committed by Commit Bot

Fix shadowed variables in the content layer.

Shadowed variables can make code harder to read. Don't support them
in the content layer.

BUG=794619

This CL was uploaded by git cl split.

R=raymes@chromium.org

Change-Id: Ic204074056ad3a3a7060c520c34a0a6728340d3b
Reviewed-on: https://chromium-review.googlesource.com/923347Reviewed-by: default avatarRaymes Khoury <raymes@chromium.org>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537569}
parent 537ea336
......@@ -222,9 +222,9 @@ ContentRendererPepperHostFactory::CreateResourceHost(
return std::make_unique<PepperFileChooserHost>(host_, instance,
resource);
case PpapiHostMsg_VideoCapture_Create::ID: {
std::unique_ptr<PepperVideoCaptureHost> host(
std::unique_ptr<PepperVideoCaptureHost> video_host(
new PepperVideoCaptureHost(host_, instance, resource));
return host->Init() ? std::move(host) : nullptr;
return video_host->Init() ? std::move(video_host) : nullptr;
}
}
}
......@@ -235,9 +235,9 @@ ContentRendererPepperHostFactory::CreateResourceHost(
if (!GetPermissions().HasPermission(ppapi::PERMISSION_PRIVATE) &&
!CanUseCameraDeviceAPI(host_, instance))
return nullptr;
std::unique_ptr<PepperCameraDeviceHost> host(
std::unique_ptr<PepperCameraDeviceHost> camera_host(
new PepperCameraDeviceHost(host_, instance, resource));
return host->Init() ? std::move(host) : nullptr;
return camera_host->Init() ? std::move(camera_host) : nullptr;
}
return nullptr;
......
......@@ -361,7 +361,7 @@ void PepperGraphics2DHost::Paint(blink::WebCanvas* canvas,
// show white (typically less jarring) rather than black or uninitialized.
// We don't do this for non-full-frame plugins since we specifically want
// the page background to show through.
cc::PaintCanvasAutoRestore auto_restore(canvas, true);
cc::PaintCanvasAutoRestore full_page_auto_restore(canvas, true);
SkRect image_data_rect =
gfx::RectToSkRect(gfx::Rect(plugin_rect.origin(), image_size));
canvas->clipRect(image_data_rect, SkClipOp::kDifference);
......
......@@ -218,10 +218,10 @@ void PepperVideoCaptureHost::AllocBuffers(const gfx::Size& resolution,
// Add the serialized shared memory handle to params. FileDescriptor is
// treated in special case.
{
EnterResourceNoLock<PPB_Buffer_API> enter(res, true);
DCHECK(enter.succeeded());
EnterResourceNoLock<PPB_Buffer_API> enter2(res, true);
DCHECK(enter2.succeeded());
base::SharedMemory* shm;
int32_t result = enter.object()->GetSharedMemory(&shm);
int32_t result = enter2.object()->GetSharedMemory(&shm);
DCHECK(result == PP_OK);
params.AppendHandle(ppapi::proxy::SerializedHandle(
dispatcher->ShareSharedMemoryHandleWithRemote(shm->handle()), size));
......
......@@ -159,10 +159,10 @@ void EnumerateProperties(PP_Var var,
return;
ScopedPPVarArray identifier_vars(identifiers->Length());
for (uint32_t i = 0; i < identifiers->Length(); ++i) {
ScopedPPVar var = try_catch.FromV8(identifiers->Get(i));
ScopedPPVar identifier = try_catch.FromV8(identifiers->Get(i));
if (try_catch.HasException())
return;
identifier_vars.Set(i, var);
identifier_vars.Set(i, identifier);
}
size_t size = identifier_vars.size();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment