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

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: Change != to DCHECK_NE 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..fda4afeb808c3e7fec53a2feb04ebe383390f57d 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_NE(type, mojom::blink::BudgetOperationType::INVALID_OPERATION);
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_NE(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