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

Unified Diff: mojo/services/html_viewer/html_document.cc

Issue 790793007: Mojo HTML viewer crash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 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: mojo/services/html_viewer/html_document.cc
diff --git a/mojo/services/html_viewer/html_document.cc b/mojo/services/html_viewer/html_document.cc
index 1892ce85461ce2c9bc52f261abc8c185da8909d2..7688442f7e912faeb438ccaabb6de8dc98fd2b15 100644
--- a/mojo/services/html_viewer/html_document.cc
+++ b/mojo/services/html_viewer/html_document.cc
@@ -243,9 +243,11 @@ blink::WebNavigationPolicy HTMLDocument::decidePolicyForNavigation(
if (CanNavigateLocally(frame, request))
return default_policy;
- navigator_host_->RequestNavigate(
- WebNavigationPolicyToNavigationTarget(default_policy),
- mojo::URLRequest::From(request).Pass());
+ if (navigator_host_.get()) {
+ navigator_host_->RequestNavigate(
+ WebNavigationPolicyToNavigationTarget(default_policy),
+ mojo::URLRequest::From(request).Pass());
+ }
return blink::WebNavigationPolicyIgnore;
}
@@ -261,7 +263,8 @@ void HTMLDocument::didNavigateWithinPage(
blink::WebLocalFrame* frame,
const blink::WebHistoryItem& history_item,
blink::WebHistoryCommitType commit_type) {
- navigator_host_->DidNavigateLocally(history_item.urlString().utf8());
+ if (navigator_host_.get())
+ navigator_host_->DidNavigateLocally(history_item.urlString().utf8());
}
blink::WebEncryptedMediaClient* HTMLDocument::encryptedMediaClient() {
« 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