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

Unified Diff: third_party/WebKit/Source/modules/budget/BudgetService.cpp

Issue 2570463003: DCHECK in BudgetService getCost and reserve if an invalid type is supplied. (Closed)
Patch Set: Created 4 years 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: third_party/WebKit/Source/modules/budget/BudgetService.cpp
diff --git a/third_party/WebKit/Source/modules/budget/BudgetService.cpp b/third_party/WebKit/Source/modules/budget/BudgetService.cpp
index afd12a2d84c8dd630330755a589e226a619cf4bb..11571ee59b95ac066d2936306288b8a7a146e679 100644
--- a/third_party/WebKit/Source/modules/budget/BudgetService.cpp
+++ b/third_party/WebKit/Source/modules/budget/BudgetService.cpp
@@ -65,10 +65,7 @@ ScriptPromise BudgetService::getCost(ScriptState* scriptState,
scriptState, DOMException::create(SecurityError, errorMessage));
mojom::blink::BudgetOperationType type = stringToOperationType(operation);
- if (type == mojom::blink::BudgetOperationType::INVALID_OPERATION)
- return ScriptPromise::rejectWithDOMException(
- scriptState, DOMException::create(NotSupportedError,
- "Invalid operation type specified"));
+ DCHECK(type != mojom::blink::BudgetOperationType::INVALID_OPERATION);
Peter Beverloo 2016/12/12 14:22:00 Please check whether the following works instead:
harkness 2016/12/12 15:00:43 I didn't realize the macro was flexible enough to
ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState);
ScriptPromise promise = resolver->promise();
@@ -129,10 +126,7 @@ ScriptPromise BudgetService::reserve(ScriptState* scriptState,
DCHECK(m_service);
mojom::blink::BudgetOperationType type = stringToOperationType(operation);
- if (type == mojom::blink::BudgetOperationType::INVALID_OPERATION)
- return ScriptPromise::rejectWithDOMException(
- scriptState, DOMException::create(NotSupportedError,
- "Invalid operation type specified"));
+ DCHECK(type != mojom::blink::BudgetOperationType::INVALID_OPERATION);
String errorMessage;
if (!scriptState->getExecutionContext()->isSecureContext(errorMessage))
« 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