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

Side by Side Diff: Source/core/html/canvas/WebGLRenderingContextBase.cpp

Issue 377113003: Make WebGLRenderingContext.getSupportedExtensions() return type nullable (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@idl-nullable-method-return-type
Patch Set: Created 6 years, 5 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 2582 matching lines...) Expand 10 before | Expand all | Expand 10 after
2593 2593
2594 String WebGLRenderingContextBase::getShaderSource(WebGLShader* shader) 2594 String WebGLRenderingContextBase::getShaderSource(WebGLShader* shader)
2595 { 2595 {
2596 if (isContextLost()) 2596 if (isContextLost())
2597 return String(); 2597 return String();
2598 if (!validateWebGLObject("getShaderSource", shader)) 2598 if (!validateWebGLObject("getShaderSource", shader))
2599 return ""; 2599 return "";
2600 return ensureNotNull(shader->source()); 2600 return ensureNotNull(shader->source());
2601 } 2601 }
2602 2602
2603 Vector<String> WebGLRenderingContextBase::getSupportedExtensions() 2603 Nullable<Vector<String> > WebGLRenderingContextBase::getSupportedExtensions()
2604 { 2604 {
2605 if (isContextLost())
2606 return Nullable<Vector<String> >();
2607
2605 Vector<String> result; 2608 Vector<String> result;
2606 if (isContextLost())
2607 return result;
2608 2609
2609 for (size_t i = 0; i < m_extensions.size(); ++i) { 2610 for (size_t i = 0; i < m_extensions.size(); ++i) {
2610 ExtensionTracker* tracker = m_extensions[i]; 2611 ExtensionTracker* tracker = m_extensions[i];
2611 if (extensionSupportedAndAllowed(tracker)) { 2612 if (extensionSupportedAndAllowed(tracker)) {
2612 const char* const* prefixes = tracker->prefixes(); 2613 const char* const* prefixes = tracker->prefixes();
2613 for (; *prefixes; ++prefixes) { 2614 for (; *prefixes; ++prefixes) {
2614 String prefixedName = String(*prefixes) + tracker->extensionName (); 2615 String prefixedName = String(*prefixes) + tracker->extensionName ();
2615 result.append(prefixedName); 2616 result.append(prefixedName);
2616 } 2617 }
2617 } 2618 }
(...skipping 3076 matching lines...) Expand 10 before | Expand all | Expand 10 after
5694 if (m_textureUnits[i].m_texture2DBinding 5695 if (m_textureUnits[i].m_texture2DBinding
5695 || m_textureUnits[i].m_textureCubeMapBinding) { 5696 || m_textureUnits[i].m_textureCubeMapBinding) {
5696 m_onePlusMaxNonDefaultTextureUnit = i + 1; 5697 m_onePlusMaxNonDefaultTextureUnit = i + 1;
5697 return; 5698 return;
5698 } 5699 }
5699 } 5700 }
5700 m_onePlusMaxNonDefaultTextureUnit = 0; 5701 m_onePlusMaxNonDefaultTextureUnit = 0;
5701 } 5702 }
5702 5703
5703 } // namespace WebCore 5704 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/html/canvas/WebGLRenderingContextBase.h ('k') | Source/core/html/canvas/WebGLRenderingContextBase.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698