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

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

Issue 2821443002: Revert of Move ScriptState::GetExecutionContext (Part 5) (Closed)
Patch Set: Revert Created 3 years, 8 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: 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 003a72fff037b37f55609b2a7406c6555bb7fc17..714b52af7ccc8a12ca182551aa80f366e14e1123 100644
--- a/third_party/WebKit/Source/modules/budget/BudgetService.cpp
+++ b/third_party/WebKit/Source/modules/budget/BudgetService.cpp
@@ -9,7 +9,6 @@
#include "bindings/core/v8/ScriptState.h"
#include "core/dom/DOMException.h"
#include "core/dom/ExceptionCode.h"
-#include "core/dom/ExecutionContext.h"
#include "modules/budget/BudgetState.h"
#include "public/platform/InterfaceProvider.h"
#include "public/platform/Platform.h"
@@ -61,7 +60,7 @@ ScriptPromise BudgetService::getCost(ScriptState* script_state,
DCHECK(service_);
String error_message;
- if (!ExecutionContext::From(script_state)->IsSecureContext(error_message))
+ if (!script_state->GetExecutionContext()->IsSecureContext(error_message))
return ScriptPromise::RejectWithDOMException(
script_state, DOMException::Create(kSecurityError, error_message));
@@ -87,7 +86,7 @@ ScriptPromise BudgetService::getBudget(ScriptState* script_state) {
DCHECK(service_);
String error_message;
- if (!ExecutionContext::From(script_state)->IsSecureContext(error_message))
+ if (!script_state->GetExecutionContext()->IsSecureContext(error_message))
return ScriptPromise::RejectWithDOMException(
script_state, DOMException::Create(kSecurityError, error_message));
@@ -96,7 +95,7 @@ ScriptPromise BudgetService::getBudget(ScriptState* script_state) {
// Get the budget from the browser BudgetService.
RefPtr<SecurityOrigin> origin(
- ExecutionContext::From(script_state)->GetSecurityOrigin());
+ script_state->GetExecutionContext()->GetSecurityOrigin());
service_->GetBudget(
origin, ConvertToBaseCallback(WTF::Bind(&BudgetService::GotBudget,
WrapPersistent(this),
@@ -133,7 +132,7 @@ ScriptPromise BudgetService::reserve(ScriptState* script_state,
DCHECK_NE(type, mojom::blink::BudgetOperationType::INVALID_OPERATION);
String error_message;
- if (!ExecutionContext::From(script_state)->IsSecureContext(error_message))
+ if (!script_state->GetExecutionContext()->IsSecureContext(error_message))
return ScriptPromise::RejectWithDOMException(
script_state, DOMException::Create(kSecurityError, error_message));
@@ -142,7 +141,7 @@ ScriptPromise BudgetService::reserve(ScriptState* script_state,
// Call to the BudgetService to place the reservation.
RefPtr<SecurityOrigin> origin(
- ExecutionContext::From(script_state)->GetSecurityOrigin());
+ script_state->GetExecutionContext()->GetSecurityOrigin());
service_->Reserve(origin, type,
ConvertToBaseCallback(WTF::Bind(
&BudgetService::GotReservation, WrapPersistent(this),

Powered by Google App Engine
This is Rietveld 408576698