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

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

Issue 296053004: Removed privledged and debug webgl extension handling. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
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 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 531
532 GLuint m_onePlusMaxEnabledAttribIndex; 532 GLuint m_onePlusMaxEnabledAttribIndex;
533 unsigned long m_onePlusMaxNonDefaultTextureUnit; 533 unsigned long m_onePlusMaxNonDefaultTextureUnit;
534 534
535 OwnPtr<Extensions3DUtil> m_extensionsUtil; 535 OwnPtr<Extensions3DUtil> m_extensionsUtil;
536 536
537 enum ExtensionFlags { 537 enum ExtensionFlags {
538 ApprovedExtension = 0x00, 538 ApprovedExtension = 0x00,
539 // Extension that is behind the draft extensions runtime flag: 539 // Extension that is behind the draft extensions runtime flag:
540 DraftExtension = 0x01, 540 DraftExtension = 0x01,
541 PrivilegedExtension = 0x02,
542 // Extension that is still in draft state, but has been selectively enab led by default under a prefix. Do not use 541 // Extension that is still in draft state, but has been selectively enab led by default under a prefix. Do not use
543 // this for enabling new draft extensions; use the DraftExtension flag i nstead, and do not use vendor prefixes: 542 // this for enabling new draft extensions; use the DraftExtension flag i nstead, and do not use vendor prefixes:
544 EnabledDraftExtension = 0x04, 543 EnabledDraftExtension = 0x04,
545 WebGLDebugRendererInfoExtension = 0x08,
546 }; 544 };
547 545
548 class ExtensionTracker { 546 class ExtensionTracker {
549 public: 547 public:
550 ExtensionTracker(ExtensionFlags flags, const char* const* prefixes) 548 ExtensionTracker(ExtensionFlags flags, const char* const* prefixes)
551 : m_privileged(flags & PrivilegedExtension) 549 : m_draft(flags & DraftExtension)
552 , m_draft(flags & DraftExtension)
553 , m_webglDebugRendererInfo(flags & WebGLDebugRendererInfoExtension)
554 , m_prefixes(prefixes) 550 , m_prefixes(prefixes)
555 { 551 {
556 } 552 }
557 553
558 virtual ~ExtensionTracker() 554 virtual ~ExtensionTracker()
559 { 555 {
560 } 556 }
561 557
562 bool privileged() const
563 {
564 return m_privileged;
565 }
566
567 bool draft() const 558 bool draft() const
568 { 559 {
569 return m_draft; 560 return m_draft;
570 } 561 }
571 562
572 bool webglDebugRendererInfo() const
573 {
574 return m_webglDebugRendererInfo;
575 }
576
577 const char* const* prefixes() const; 563 const char* const* prefixes() const;
578 bool matchesNameWithPrefixes(const String&) const; 564 bool matchesNameWithPrefixes(const String&) const;
579 565
580 virtual PassRefPtr<WebGLExtension> getExtension(WebGLRenderingContextBas e*) = 0; 566 virtual PassRefPtr<WebGLExtension> getExtension(WebGLRenderingContextBas e*) = 0;
581 virtual bool supported(WebGLRenderingContextBase*) const = 0; 567 virtual bool supported(WebGLRenderingContextBase*) const = 0;
582 virtual const char* extensionName() const = 0; 568 virtual const char* extensionName() const = 0;
583 virtual void loseExtension() = 0; 569 virtual void loseExtension() = 0;
584 570
585 private: 571 private:
586 bool m_privileged;
587 bool m_draft; 572 bool m_draft;
588 bool m_webglDebugRendererInfo;
589 const char* const* m_prefixes; 573 const char* const* m_prefixes;
590 }; 574 };
591 575
592 template <typename T> 576 template <typename T>
593 class TypedExtensionTracker FINAL : public ExtensionTracker { 577 class TypedExtensionTracker FINAL : public ExtensionTracker {
594 public: 578 public:
595 TypedExtensionTracker(RefPtr<T>& extensionField, ExtensionFlags flags, c onst char* const* prefixes) 579 TypedExtensionTracker(RefPtr<T>& extensionField, ExtensionFlags flags, c onst char* const* prefixes)
596 : ExtensionTracker(flags, prefixes) 580 : ExtensionTracker(flags, prefixes)
597 , m_extensionField(extensionField) 581 , m_extensionField(extensionField)
598 , m_extension(nullptr) 582 , m_extension(nullptr)
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
859 843
860 // Helper function for bind* (bindBuffer, bindTexture, etc) and useProgram. 844 // Helper function for bind* (bindBuffer, bindTexture, etc) and useProgram.
861 // If the object has already been deleted, set deleted to true upon return. 845 // If the object has already been deleted, set deleted to true upon return.
862 // Return false if caller should return without further processing. 846 // Return false if caller should return without further processing.
863 bool checkObjectToBeBound(const char* functionName, WebGLObject*, bool& dele ted); 847 bool checkObjectToBeBound(const char* functionName, WebGLObject*, bool& dele ted);
864 848
865 void dispatchContextLostEvent(Timer<WebGLRenderingContextBase>*); 849 void dispatchContextLostEvent(Timer<WebGLRenderingContextBase>*);
866 // Helper for restoration after context lost. 850 // Helper for restoration after context lost.
867 void maybeRestoreContext(Timer<WebGLRenderingContextBase>*); 851 void maybeRestoreContext(Timer<WebGLRenderingContextBase>*);
868 852
869 // Determine if we are running privileged code in the browser, for example,
870 // a Safari or Chrome extension.
871 bool allowPrivilegedExtensions() const;
872
873 // Determine if WEBGL_debug_renderer_info extension is enabled. For the
874 // moment it can be enabled either through a chromium finch experiment
875 // or for privileged code in the browser.
876 bool allowWebGLDebugRendererInfo() const;
877
878 enum ConsoleDisplayPreference { 853 enum ConsoleDisplayPreference {
879 DisplayInConsole, 854 DisplayInConsole,
880 DontDisplayInConsole 855 DontDisplayInConsole
881 }; 856 };
882 857
883 // Wrapper for WebGraphicsContext3D::synthesizeGLError that sends a message 858 // Wrapper for WebGraphicsContext3D::synthesizeGLError that sends a message
884 // to the JavaScript console. 859 // to the JavaScript console.
885 void synthesizeGLError(GLenum, const char* functionName, const char* descrip tion, ConsoleDisplayPreference = DisplayInConsole); 860 void synthesizeGLError(GLenum, const char* functionName, const char* descrip tion, ConsoleDisplayPreference = DisplayInConsole);
886 void emitGLWarning(const char* function, const char* reason); 861 void emitGLWarning(const char* function, const char* reason);
887 862
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
926 // If the vector is empty, return the maximum allowed active context number. 901 // If the vector is empty, return the maximum allowed active context number.
927 static size_t oldestContextIndex(); 902 static size_t oldestContextIndex();
928 static IntSize oldestContextSize(); 903 static IntSize oldestContextSize();
929 }; 904 };
930 905
931 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co ntext->is3d(), context.is3d()); 906 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co ntext->is3d(), context.is3d());
932 907
933 } // namespace WebCore 908 } // namespace WebCore
934 909
935 #endif // WebGLRenderingContextBase_h 910 #endif // WebGLRenderingContextBase_h
OLDNEW
« no previous file with comments | « Source/core/html/canvas/WebGLRenderingContext.cpp ('k') | Source/core/html/canvas/WebGLRenderingContextBase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698