Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2409)

Unified Diff: content/public/test/mock_render_process_host.cc

Issue 181013016: fixed issue 349227: Uninit error due to DuplicateHandle failure - add check on DuplicateHandle and … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698