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

Side by Side Diff: content/browser/tab_contents/navigation_controller.cc

Issue 8776017: Get additional crash data to narrow down renderer kills. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/tab_contents/navigation_controller.h" 5 #include "content/browser/tab_contents/navigation_controller.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/string_number_conversions.h" // Temporary 9 #include "base/string_number_conversions.h" // Temporary
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 // back/forward entries (not likely since we'll usually tell it to navigate 668 // back/forward entries (not likely since we'll usually tell it to navigate
669 // to such entries). It could also mean that the renderer is smoking crack. 669 // to such entries). It could also mean that the renderer is smoking crack.
670 NOTREACHED(); 670 NOTREACHED();
671 671
672 // Because the unknown entry has committed, we risk showing the wrong URL in 672 // Because the unknown entry has committed, we risk showing the wrong URL in
673 // release builds. Instead, we'll kill the renderer process to be safe. 673 // release builds. Instead, we'll kill the renderer process to be safe.
674 LOG(ERROR) << "terminating renderer for bad navigation: " << params.url; 674 LOG(ERROR) << "terminating renderer for bad navigation: " << params.url;
675 UserMetrics::RecordAction(UserMetricsAction("BadMessageTerminate_NC")); 675 UserMetrics::RecordAction(UserMetricsAction("BadMessageTerminate_NC"));
676 676
677 // Temporary code so we can get more information. Format: 677 // Temporary code so we can get more information. Format:
678 // http://url/foo.html#page1#max3#frame1#ids:2,x,3 678 // http://url/foo.html#page1#max3#frame1#ids:2_Nx,1_1x,3_2
679 std::string temp = params.url.spec();; 679 std::string temp = params.url.spec();
680 temp.append("#page"); 680 temp.append("#page");
681 temp.append(base::IntToString(params.page_id)); 681 temp.append(base::IntToString(params.page_id));
682 temp.append("#max"); 682 temp.append("#max");
683 temp.append(base::IntToString(tab_contents_->GetMaxPageID())); 683 temp.append(base::IntToString(tab_contents_->GetMaxPageID()));
684 temp.append("#frame"); 684 temp.append("#frame");
685 temp.append(base::IntToString(params.frame_id)); 685 temp.append(base::IntToString(params.frame_id));
686 temp.append("#ids"); 686 temp.append("#ids");
687 for (int i = 0; i < static_cast<int>(entries_.size()); ++i) { 687 for (int i = 0; i < static_cast<int>(entries_.size()); ++i) {
688 // Append all same-process page_ids (with placeholders for out of process) 688 // Append entry metadata (e.g., 3_7x):
689 if (entries_[i]->site_instance() == tab_contents_->GetSiteInstance()) 689 // 3: page_id
690 temp.append(base::IntToString(entries_[i]->page_id())); 690 // 7: SiteInstance ID, or N for null
691 // x: appended if not from the current SiteInstance
692 temp.append(base::IntToString(entries_[i]->page_id()));
693 temp.append("_");
694 if (entries_[i]->site_instance())
695 temp.append(base::IntToString(entries_[i]->site_instance()->id()));
691 else 696 else
697 temp.append("N");
698 if (entries_[i]->site_instance() != tab_contents_->GetSiteInstance())
692 temp.append("x"); 699 temp.append("x");
693 temp.append(","); 700 temp.append(",");
694 } 701 }
695 GURL url(temp); 702 GURL url(temp);
696 tab_contents_->render_view_host()->Send(new ViewMsg_TempCrashWithData(url)); 703 tab_contents_->render_view_host()->Send(new ViewMsg_TempCrashWithData(url));
697 return content::NAVIGATION_TYPE_NAV_IGNORE; 704 return content::NAVIGATION_TYPE_NAV_IGNORE;
698 705
699 706
700 if (tab_contents_->GetSiteInstance()->HasProcess()) 707 if (tab_contents_->GetSiteInstance()->HasProcess())
701 tab_contents_->GetSiteInstance()->GetProcess()->ReceivedBadMessage(); 708 tab_contents_->GetSiteInstance()->GetProcess()->ReceivedBadMessage();
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
1255 for (int i = 0; i < max_index; i++) { 1262 for (int i = 0; i < max_index; i++) {
1256 // When cloning a tab, copy all entries except interstitial pages 1263 // When cloning a tab, copy all entries except interstitial pages
1257 if (source.entries_[i].get()->page_type() != 1264 if (source.entries_[i].get()->page_type() !=
1258 content::PAGE_TYPE_INTERSTITIAL) { 1265 content::PAGE_TYPE_INTERSTITIAL) {
1259 entries_.insert(entries_.begin() + insert_index++, 1266 entries_.insert(entries_.begin() + insert_index++,
1260 linked_ptr<NavigationEntry>( 1267 linked_ptr<NavigationEntry>(
1261 new NavigationEntry(*source.entries_[i]))); 1268 new NavigationEntry(*source.entries_[i])));
1262 } 1269 }
1263 } 1270 }
1264 } 1271 }
OLDNEW
« no previous file with comments | « no previous file | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698