Index: third_party/WebKit/Source/modules/indexeddb/IDBFactory.cpp |
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBFactory.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBFactory.cpp |
index 622c99c70f9b95a57266613a44e9c1b8f540a3a7..84057d45310b159cafe732267ee4b5028745f885 100644 |
--- a/third_party/WebKit/Source/modules/indexeddb/IDBFactory.cpp |
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBFactory.cpp |
@@ -28,11 +28,13 @@ |
#include "modules/indexeddb/IDBFactory.h" |
+#include <memory> |
#include "bindings/core/v8/ExceptionState.h" |
#include "bindings/modules/v8/V8BindingForModules.h" |
#include "core/dom/DOMException.h" |
#include "core/dom/Document.h" |
#include "core/dom/ExceptionCode.h" |
+#include "core/dom/ExecutionContext.h" |
#include "modules/indexeddb/IDBDatabase.h" |
#include "modules/indexeddb/IDBDatabaseCallbacks.h" |
#include "modules/indexeddb/IDBKey.h" |
@@ -44,7 +46,6 @@ |
#include "public/platform/WebSecurityOrigin.h" |
#include "public/platform/modules/indexeddb/WebIDBDatabaseCallbacks.h" |
#include "public/platform/modules/indexeddb/WebIDBFactory.h" |
-#include <memory> |
namespace blink { |
@@ -65,9 +66,9 @@ |
IDBRequest* IDBFactory::getDatabaseNames(ScriptState* script_state, |
ExceptionState& exception_state) { |
IDB_TRACE("IDBFactory::getDatabaseNames"); |
- if (!IsContextValid(script_state->GetExecutionContext())) |
- return nullptr; |
- if (!script_state->GetExecutionContext() |
+ if (!IsContextValid(ExecutionContext::From(script_state))) |
+ return nullptr; |
+ if (!ExecutionContext::From(script_state) |
->GetSecurityOrigin() |
->CanAccessDatabase()) { |
exception_state.ThrowSecurityError( |
@@ -78,8 +79,8 @@ |
IDBRequest* request = |
IDBRequest::Create(script_state, IDBAny::CreateNull(), nullptr); |
- if (!IndexedDBClient::From(script_state->GetExecutionContext()) |
- ->AllowIndexedDB(script_state->GetExecutionContext(), |
+ if (!IndexedDBClient::From(ExecutionContext::From(script_state)) |
+ ->AllowIndexedDB(ExecutionContext::From(script_state), |
"Database Listing")) { |
request->OnError( |
DOMException::Create(kUnknownError, kPermissionDeniedErrorMessage)); |
@@ -89,7 +90,7 @@ |
Platform::Current()->IdbFactory()->GetDatabaseNames( |
request->CreateWebCallbacks().release(), |
WebSecurityOrigin( |
- script_state->GetExecutionContext()->GetSecurityOrigin())); |
+ ExecutionContext::From(script_state)->GetSecurityOrigin())); |
return request; |
} |
@@ -111,9 +112,9 @@ |
ExceptionState& exception_state) { |
IDBDatabase::RecordApiCallsHistogram(kIDBOpenCall); |
DCHECK(version >= 1 || version == IDBDatabaseMetadata::kNoVersion); |
- if (!IsContextValid(script_state->GetExecutionContext())) |
- return nullptr; |
- if (!script_state->GetExecutionContext() |
+ if (!IsContextValid(ExecutionContext::From(script_state))) |
+ return nullptr; |
+ if (!ExecutionContext::From(script_state) |
->GetSecurityOrigin() |
->CanAccessDatabase()) { |
exception_state.ThrowSecurityError( |
@@ -126,8 +127,8 @@ |
IDBOpenDBRequest* request = IDBOpenDBRequest::Create( |
script_state, database_callbacks, transaction_id, version); |
- if (!IndexedDBClient::From(script_state->GetExecutionContext()) |
- ->AllowIndexedDB(script_state->GetExecutionContext(), name)) { |
+ if (!IndexedDBClient::From(ExecutionContext::From(script_state)) |
+ ->AllowIndexedDB(ExecutionContext::From(script_state), name)) { |
request->OnError( |
DOMException::Create(kUnknownError, kPermissionDeniedErrorMessage)); |
return request; |
@@ -137,7 +138,7 @@ |
name, version, transaction_id, request->CreateWebCallbacks().release(), |
database_callbacks->CreateWebCallbacks().release(), |
WebSecurityOrigin( |
- script_state->GetExecutionContext()->GetSecurityOrigin())); |
+ ExecutionContext::From(script_state)->GetSecurityOrigin())); |
return request; |
} |
@@ -171,9 +172,9 @@ |
bool force_close) { |
IDB_TRACE("IDBFactory::deleteDatabase"); |
IDBDatabase::RecordApiCallsHistogram(kIDBDeleteDatabaseCall); |
- if (!IsContextValid(script_state->GetExecutionContext())) |
- return nullptr; |
- if (!script_state->GetExecutionContext() |
+ if (!IsContextValid(ExecutionContext::From(script_state))) |
+ return nullptr; |
+ if (!ExecutionContext::From(script_state) |
->GetSecurityOrigin() |
->CanAccessDatabase()) { |
exception_state.ThrowSecurityError( |
@@ -184,8 +185,8 @@ |
IDBOpenDBRequest* request = IDBOpenDBRequest::Create( |
script_state, nullptr, 0, IDBDatabaseMetadata::kDefaultVersion); |
- if (!IndexedDBClient::From(script_state->GetExecutionContext()) |
- ->AllowIndexedDB(script_state->GetExecutionContext(), name)) { |
+ if (!IndexedDBClient::From(ExecutionContext::From(script_state)) |
+ ->AllowIndexedDB(ExecutionContext::From(script_state), name)) { |
request->OnError( |
DOMException::Create(kUnknownError, kPermissionDeniedErrorMessage)); |
return request; |
@@ -194,7 +195,7 @@ |
Platform::Current()->IdbFactory()->DeleteDatabase( |
name, request->CreateWebCallbacks().release(), |
WebSecurityOrigin( |
- script_state->GetExecutionContext()->GetSecurityOrigin()), |
+ ExecutionContext::From(script_state)->GetSecurityOrigin()), |
force_close); |
return request; |
} |