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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 1001153002: Store the callstack of the IPC sender of ViewMsg_New (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 | « content/common/view_messages.h ('k') | content/renderer/render_view_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index aae437eccf675b949c1f14058e2f1c680f971eff..4300b01ed4bc9730f39e820b3c49e561329b0543 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -675,7 +675,23 @@ RenderFrameImpl::RenderFrameImpl(RenderViewImpl* render_view, int routing_id)
weak_factory_(this) {
std::pair<RoutingIDFrameMap::iterator, bool> result =
g_routing_id_frame_map.Get().insert(std::make_pair(routing_id_, this));
- CHECK(result.second) << "Inserting a duplicate item.";
+ if (!result.second) {
+ // TODO(lfg): Temporary. We're about to force a crash, so save the debug
+ // info on the stack so we can recover it from the crash dumps.
+ RenderFrameImpl* duplicate = result.first->second;
+ const std::vector<unsigned long>& debug_info = render_view->debug_info();
+ const std::vector<unsigned long>& duplicate_debug_info =
+ duplicate->render_view()->debug_info();
+ unsigned long duplicate_stack_debug_info[128];
+ unsigned long stack_debug_info[128];
+ const int size = debug_info.size() > 128 ? 128 : debug_info.size();
+ const int duplicate_size =
+ duplicate_debug_info.size() > 128 ? 128 : duplicate_debug_info.size();
+ memcpy(&stack_debug_info, &debug_info[0], size * sizeof(unsigned long));
nasko 2015/03/16 18:38:26 memcpy from the memory of a stl container sounds s
+ memcpy(&duplicate_stack_debug_info, &duplicate_debug_info[0],
+ duplicate_size * sizeof(unsigned long));
+ CHECK(result.second) << "Inserting a duplicate item.";
+ }
RenderThread::Get()->AddRoute(routing_id_, this);
« no previous file with comments | « content/common/view_messages.h ('k') | content/renderer/render_view_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698