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

Unified Diff: chrome/browser/devtools/devtools_ui_bindings.cc

Issue 1028493003: [DevTools] Fix DCHECK in DevToolsUIBindings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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/devtools/devtools_ui_bindings.cc
diff --git a/chrome/browser/devtools/devtools_ui_bindings.cc b/chrome/browser/devtools/devtools_ui_bindings.cc
index 22c35310be9273c52de6ec3d6a46f2f1f7203a7f..68ddd0138f3ce7cc68216ed832e6f3a1805d2d4c 100644
--- a/chrome/browser/devtools/devtools_ui_bindings.cc
+++ b/chrome/browser/devtools/devtools_ui_bindings.cc
@@ -413,7 +413,6 @@ DevToolsUIBindings::DevToolsUIBindings(content::WebContents* web_contents)
devices_updates_enabled_(false),
frontend_loaded_(false),
weak_factory_(this) {
- DCHECK(android_bridge_);
g_instances.Get().push_back(this);
frontend_contents_observer_.reset(new FrontendWebContentsObserver(this));
web_contents_->GetMutableRendererPrefs()->can_accept_load_drops = false;
@@ -784,6 +783,10 @@ void DevToolsUIBindings::RecordActionUMA(const std::string& name, int action) {
void DevToolsUIBindings::SendJsonRequest(const DispatchCallback& callback,
const std::string& browser_id,
const std::string& url) {
+ if (!android_bridge_) {
+ callback.Run(nullptr);
+ return;
+ }
android_bridge_->SendJsonRequest(browser_id, url,
base::Bind(&DevToolsUIBindings::JsonReceived,
weak_factory_.GetWeakPtr(),
« 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