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

Unified Diff: chrome/browser/ui/omnibox/omnibox_edit_model.cc

Issue 12250014: Omnibox: Possibly Fix Rare OpenMatch Crash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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: chrome/browser/ui/omnibox/omnibox_edit_model.cc
diff --git a/chrome/browser/ui/omnibox/omnibox_edit_model.cc b/chrome/browser/ui/omnibox/omnibox_edit_model.cc
index 5de37c2ee5205b95956ad55e2e7ae72b74bcd30a..2552d8acd88ff7f863604645ec8cdcdb48c167d3 100644
--- a/chrome/browser/ui/omnibox/omnibox_edit_model.cc
+++ b/chrome/browser/ui/omnibox/omnibox_edit_model.cc
@@ -573,6 +573,7 @@ void OmniboxEditModel::OpenMatch(const AutocompleteMatch& match,
// open).
if (popup_->IsOpen()) {
const base::TimeTicks& now(base::TimeTicks::Now());
+ const content::WebContents* web_contents = controller_->GetWebContents();
// TODO(sreeram): Handle is_temporary_text_set_by_instant_ correctly.
AutocompleteLog log(
autocomplete_controller_->input().text(),
@@ -580,7 +581,8 @@ void OmniboxEditModel::OpenMatch(const AutocompleteMatch& match,
autocomplete_controller_->input().type(),
popup_->selected_line(),
-1, // don't yet know tab ID; set later if appropriate
- ClassifyPage(controller_->GetWebContents()->GetURL()),
+ web_contents ? ClassifyPage(web_contents->GetURL()) :
+ metrics::OmniboxEventProto_PageClassification_OTHER,
now - time_user_first_modified_omnibox_,
string16::npos, // completed_length; possibly set later
now - autocomplete_controller_->last_time_default_match_changed(),
« 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