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

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

Issue 2815313002: Reland of Move ScriptState::GetExecutionContext (Part 5) (Closed)
Patch Set: 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 714b52af7ccc8a12ca182551aa80f366e14e1123..003a72fff037b37f55609b2a7406c6555bb7fc17 100644
--- a/third_party/WebKit/Source/modules/budget/BudgetService.cpp
+++ b/third_party/WebKit/Source/modules/budget/BudgetService.cpp
@@ -9,6 +9,7 @@
#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"
@@ -60,7 +61,7 @@
DCHECK(service_);
String error_message;
- if (!script_state->GetExecutionContext()->IsSecureContext(error_message))
+ if (!ExecutionContext::From(script_state)->IsSecureContext(error_message))
return ScriptPromise::RejectWithDOMException(
script_state, DOMException::Create(kSecurityError, error_message));
@@ -86,7 +87,7 @@
DCHECK(service_);
String error_message;
- if (!script_state->GetExecutionContext()->IsSecureContext(error_message))
+ if (!ExecutionContext::From(script_state)->IsSecureContext(error_message))
return ScriptPromise::RejectWithDOMException(
script_state, DOMException::Create(kSecurityError, error_message));
@@ -95,7 +96,7 @@
// Get the budget from the browser BudgetService.
RefPtr<SecurityOrigin> origin(
- script_state->GetExecutionContext()->GetSecurityOrigin());
+ ExecutionContext::From(script_state)->GetSecurityOrigin());
service_->GetBudget(
origin, ConvertToBaseCallback(WTF::Bind(&BudgetService::GotBudget,
WrapPersistent(this),
@@ -132,7 +133,7 @@
DCHECK_NE(type, mojom::blink::BudgetOperationType::INVALID_OPERATION);
String error_message;
- if (!script_state->GetExecutionContext()->IsSecureContext(error_message))
+ if (!ExecutionContext::From(script_state)->IsSecureContext(error_message))
return ScriptPromise::RejectWithDOMException(
script_state, DOMException::Create(kSecurityError, error_message));
@@ -141,7 +142,7 @@
// Call to the BudgetService to place the reservation.
RefPtr<SecurityOrigin> origin(
- script_state->GetExecutionContext()->GetSecurityOrigin());
+ ExecutionContext::From(script_state)->GetSecurityOrigin());
service_->Reserve(origin, type,
ConvertToBaseCallback(WTF::Bind(
&BudgetService::GotReservation, WrapPersistent(this),

Powered by Google App Engine
This is Rietveld 408576698