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

Unified Diff: Source/core/html/canvas/WebGLRenderingContextBase.cpp

Issue 928233002: IDL: Don't lose nullable flag when "preprocessing" type (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix compilation Created 5 years, 10 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: Source/core/html/canvas/WebGLRenderingContextBase.cpp
diff --git a/Source/core/html/canvas/WebGLRenderingContextBase.cpp b/Source/core/html/canvas/WebGLRenderingContextBase.cpp
index 46909bd6b222a9c227fd47110fb23eff5dbb762c..b6427550f94d9d405c7927f5c87cbd3b588e23c8 100644
--- a/Source/core/html/canvas/WebGLRenderingContextBase.cpp
+++ b/Source/core/html/canvas/WebGLRenderingContextBase.cpp
@@ -2252,25 +2252,25 @@ bool WebGLRenderingContextBase::extensionSupportedAndAllowed(const ExtensionTrac
}
-PassRefPtrWillBeRawPtr<WebGLExtension> WebGLRenderingContextBase::getExtension(const String& name)
+ScriptValue WebGLRenderingContextBase::getExtension(ScriptState* scriptState, const String& name)
{
- if (isContextLost())
- return nullptr;
+ RefPtrWillBeRawPtr<WebGLExtension> extension;
- for (size_t i = 0; i < m_extensions.size(); ++i) {
- ExtensionTracker* tracker = m_extensions[i].get();
- if (tracker->matchesNameWithPrefixes(name)) {
- if (!extensionSupportedAndAllowed(tracker))
- return nullptr;
-
- RefPtrWillBeRawPtr<WebGLExtension> extension = tracker->getExtension(this);
- if (extension)
- m_extensionEnabled[extension->name()] = true;
- return extension.release();
+ if (!isContextLost()) {
+ for (size_t i = 0; i < m_extensions.size(); ++i) {
+ ExtensionTracker* tracker = m_extensions[i].get();
+ if (tracker->matchesNameWithPrefixes(name)) {
+ if (extensionSupportedAndAllowed(tracker)) {
+ extension = tracker->getExtension(this);
+ if (extension)
+ m_extensionEnabled[extension->name()] = true;
+ }
+ break;
+ }
}
}
- return nullptr;
+ return ScriptValue(scriptState, toV8(extension, scriptState->context()->Global(), scriptState->isolate()));
}
ScriptValue WebGLRenderingContextBase::getFramebufferAttachmentParameter(ScriptState* scriptState, GLenum target, GLenum attachment, GLenum pname)

Powered by Google App Engine
This is Rietveld 408576698