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

Unified Diff: extensions/browser/api/bluetooth/bluetooth_private_api.cc

Issue 2017113002: [Extensions] DCHECK that ExtensionFunctions respond (and only once) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
Index: extensions/browser/api/bluetooth/bluetooth_private_api.cc
diff --git a/extensions/browser/api/bluetooth/bluetooth_private_api.cc b/extensions/browser/api/bluetooth/bluetooth_private_api.cc
index f4f176ab43b56500175babe9f88f062b3cd3a519..c6296d9d384c78e8b4bde10fda4d94c2c321a7f4 100644
--- a/extensions/browser/api/bluetooth/bluetooth_private_api.cc
+++ b/extensions/browser/api/bluetooth/bluetooth_private_api.cc
@@ -178,6 +178,8 @@ bool BluetoothPrivateSetAdapterStateFunction::DoWork(
CreatePropertyErrorCallback(kDiscoverableProperty));
}
+ parsed_ = true;
+
if (pending_properties_.empty())
SendResponse(true);
return true;
@@ -205,7 +207,7 @@ void BluetoothPrivateSetAdapterStateFunction::OnAdapterPropertySet(
DCHECK(failed_properties_.find(property) == failed_properties_.end());
pending_properties_.erase(property);
- if (pending_properties_.empty()) {
+ if (pending_properties_.empty() && parsed_) {
if (failed_properties_.empty())
SendResponse(true);
else
@@ -217,10 +219,9 @@ void BluetoothPrivateSetAdapterStateFunction::OnAdapterPropertyError(
const std::string& property) {
DCHECK(pending_properties_.find(property) != pending_properties_.end());
DCHECK(failed_properties_.find(property) == failed_properties_.end());
-
pending_properties_.erase(property);
failed_properties_.insert(property);
- if (pending_properties_.empty())
+ if (pending_properties_.empty() && parsed_)
SendError();
}

Powered by Google App Engine
This is Rietveld 408576698