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

Unified Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 2611943003: Early return in ::SetTooltipText in case GetView returns null (Closed)
Patch Set: Created 3 years, 11 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/browser/renderer_host/render_widget_host_impl.cc
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 8860791b51b005f240538873bcf57ad775c73536..297a07498c0cbef3fdcff5d83d375456c462047c 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -1759,6 +1759,9 @@ void RenderWidgetHostImpl::OnClose() {
void RenderWidgetHostImpl::OnSetTooltipText(
const base::string16& tooltip_text,
WebTextDirection text_direction_hint) {
+ if (!GetView())
+ return;
+
// First, add directionality marks around tooltip text if necessary.
// A naive solution would be to simply always wrap the text. However, on
// windows, Unicode directional embedding characters can't be displayed on
@@ -1784,8 +1787,7 @@ void RenderWidgetHostImpl::OnSetTooltipText(
base::i18n::WrapStringWithRTLFormatting(&wrapped_tooltip_text);
}
}
- if (GetView())
- view_->SetTooltipText(wrapped_tooltip_text);
+ view_->SetTooltipText(wrapped_tooltip_text);
}
void RenderWidgetHostImpl::OnUpdateScreenRectsAck() {
« 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