Chromium Code Reviews| Index: content/public/test/mock_render_process_host.cc |
| diff --git a/content/public/test/mock_render_process_host.cc b/content/public/test/mock_render_process_host.cc |
| index a2b058ad890d794dcd426dacaaa28b883157d13f..884ad306bc0847097fc93bc879d5fcd423ed6847 100644 |
| --- a/content/public/test/mock_render_process_host.cc |
| +++ b/content/public/test/mock_render_process_host.cc |
| @@ -144,8 +144,9 @@ bool MockRenderProcessHost::Send(IPC::Message* msg) { |
| TransportDIB* MockRenderProcessHost::MapTransportDIB(TransportDIB::Id dib_id) { |
| #if defined(OS_WIN) |
| HANDLE duped; |
|
sky
2014/03/05 17:36:50
Can you instead explicitly set to duped to NULL he
zhaoqin
2014/03/05 19:09:42
I think it is better to set on failure instead of
|
| - DuplicateHandle(GetCurrentProcess(), dib_id.handle, GetCurrentProcess(), |
| - &duped, 0, TRUE, DUPLICATE_SAME_ACCESS); |
| + if (!DuplicateHandle(GetCurrentProcess(), dib_id.handle, GetCurrentProcess(), |
| + &duped, 0, TRUE, DUPLICATE_SAME_ACCESS)) |
| + duped = NULL; |
|
Will Harris
2014/03/05 17:40:35
should this be INVALID_HANDLE_VALUE?
jschuh
2014/03/05 17:52:03
No. INVALID_HANDLE_VALUE can bite you because it a
|
| return TransportDIB::Map(duped); |
| #elif defined(TOOLKIT_GTK) |
| return TransportDIB::Map(dib_id.shmkey); |