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

Unified Diff: chrome/browser/extensions/webstore_inline_installer.cc

Issue 2669563003: Fix rare crash in WebstoreInlineInstaller::CheckInlineInstallPermitted. (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: chrome/browser/extensions/webstore_inline_installer.cc
diff --git a/chrome/browser/extensions/webstore_inline_installer.cc b/chrome/browser/extensions/webstore_inline_installer.cc
index 9e992bcb64fc1bedc00a3d598de8f3acc041de6b..816022adf34ec9e1e55691eaf1aaef1c9b521733 100644
--- a/chrome/browser/extensions/webstore_inline_installer.cc
+++ b/chrome/browser/extensions/webstore_inline_installer.cc
@@ -30,6 +30,7 @@ const char kInitiatedFromPopupError[] =
"Inline installs can not be initiated from pop-up windows.";
const char kInitiatedFromFullscreenError[] =
"Inline installs can not be initiated from fullscreen.";
+const char kInternalError[] = "Unable to complete installation.";
WebstoreInlineInstaller::WebstoreInlineInstaller(
content::WebContents* web_contents,
@@ -136,7 +137,10 @@ bool WebstoreInlineInstaller::CheckInlineInstallPermitted(
const base::DictionaryValue& webstore_data,
std::string* error) const {
Browser* browser = chrome::FindBrowserWithWebContents(web_contents());
- DCHECK(browser);
+ if (!browser) {
Devlin 2017/01/31 20:18:47 Hmm... interesting. Do you know when this might h
robertshield 2017/02/01 14:21:32 Yes, I believe in this case, web_contents() is not
Devlin 2017/02/06 16:28:41 Hmm, okay. What about merging this logic with Che
robertshield 2017/02/10 15:25:23 That does seem better. Made it so. Apologies for t
+ *error = kInternalError;
+ return false;
+ }
if (browser->is_type_popup()) {
*error = kInitiatedFromPopupError;
return false;
« 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