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

Unified Diff: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.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/webgl/WebGLRenderingContextBase.cpp
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
index 1d5125ee59c317f28a82106e7af4bd3e1f00826c..f0449e4394878d25f29f793afc6610ad4f3f55f6 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
@@ -34,6 +34,7 @@
#include "bindings/modules/v8/WebGLAny.h"
#include "core/dom/DOMArrayBuffer.h"
#include "core/dom/DOMTypedArray.h"
+#include "core/dom/ExecutionContext.h"
#include "core/dom/FlexibleArrayBufferView.h"
#include "core/dom/TaskRunnerHelper.h"
#include "core/frame/ImageBitmap.h"
@@ -647,7 +648,7 @@
DCHECK(!canvas || IsMainThread());
auto execution_context = canvas ? canvas->GetDocument().GetExecutionContext()
- : script_state->GetExecutionContext();
+ : ExecutionContext::From(script_state);
Platform::ContextAttributes context_attributes = ToPlatformContextAttributes(
attributes, web_gl_version,
SupportOwnOffscreenSurface(execution_context));
@@ -655,7 +656,7 @@
Platform::GraphicsInfo gl_info;
std::unique_ptr<WebGraphicsContext3DProvider> context_provider;
const auto& url = canvas ? canvas->GetDocument().TopDocument().Url()
- : script_state->GetExecutionContext()->Url();
+ : ExecutionContext::From(script_state)->Url();
if (IsMainThread()) {
context_provider = WTF::WrapUnique(
Platform::Current()->CreateOffscreenGraphicsContext3DProvider(
@@ -736,7 +737,7 @@
ScriptState* script_state) {
UseCounter::Feature feature =
UseCounter::kOffscreenCanvasTransferToImageBitmapWebGL;
- UseCounter::Count(script_state->GetExecutionContext(), feature);
+ UseCounter::Count(ExecutionContext::From(script_state), feature);
if (!GetDrawingBuffer())
return nullptr;
return ImageBitmap::Create(GetDrawingBuffer()->TransferToStaticBitmapImage());
@@ -746,7 +747,7 @@
ScriptState* script_state,
ExceptionState& exception_state) {
UseCounter::Feature feature = UseCounter::kOffscreenCanvasCommitWebGL;
- UseCounter::Count(script_state->GetExecutionContext(), feature);
+ UseCounter::Count(ExecutionContext::From(script_state), feature);
if (!offscreenCanvas()) {
exception_state.ThrowDOMException(kInvalidStateError,
"Commit() was called on a rendering "

Powered by Google App Engine
This is Rietveld 408576698