Sat, 03 Jan 2015 20:18:00 +0100
Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.
michael@0 | 1 | // |
michael@0 | 2 | // Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved. |
michael@0 | 3 | // Use of this source code is governed by a BSD-style license that can be |
michael@0 | 4 | // found in the LICENSE file. |
michael@0 | 5 | // |
michael@0 | 6 | |
michael@0 | 7 | // Program.h: Defines the gl::Program class. Implements GL program objects |
michael@0 | 8 | // and related functionality. [OpenGL ES 2.0.24] section 2.10.3 page 28. |
michael@0 | 9 | |
michael@0 | 10 | #ifndef LIBGLESV2_PROGRAM_H_ |
michael@0 | 11 | #define LIBGLESV2_PROGRAM_H_ |
michael@0 | 12 | |
michael@0 | 13 | #include <string> |
michael@0 | 14 | #include <set> |
michael@0 | 15 | |
michael@0 | 16 | #include "common/angleutils.h" |
michael@0 | 17 | #include "common/RefCountObject.h" |
michael@0 | 18 | #include "libGLESv2/Constants.h" |
michael@0 | 19 | |
michael@0 | 20 | namespace rx |
michael@0 | 21 | { |
michael@0 | 22 | class Renderer; |
michael@0 | 23 | } |
michael@0 | 24 | |
michael@0 | 25 | namespace gl |
michael@0 | 26 | { |
michael@0 | 27 | class ResourceManager; |
michael@0 | 28 | class FragmentShader; |
michael@0 | 29 | class VertexShader; |
michael@0 | 30 | class ProgramBinary; |
michael@0 | 31 | class Shader; |
michael@0 | 32 | |
michael@0 | 33 | extern const char * const g_fakepath; |
michael@0 | 34 | |
michael@0 | 35 | class AttributeBindings |
michael@0 | 36 | { |
michael@0 | 37 | public: |
michael@0 | 38 | AttributeBindings(); |
michael@0 | 39 | ~AttributeBindings(); |
michael@0 | 40 | |
michael@0 | 41 | void bindAttributeLocation(GLuint index, const char *name); |
michael@0 | 42 | int getAttributeBinding(const std::string &name) const; |
michael@0 | 43 | |
michael@0 | 44 | private: |
michael@0 | 45 | std::set<std::string> mAttributeBinding[MAX_VERTEX_ATTRIBS]; |
michael@0 | 46 | }; |
michael@0 | 47 | |
michael@0 | 48 | class InfoLog |
michael@0 | 49 | { |
michael@0 | 50 | public: |
michael@0 | 51 | InfoLog(); |
michael@0 | 52 | ~InfoLog(); |
michael@0 | 53 | |
michael@0 | 54 | int getLength() const; |
michael@0 | 55 | void getLog(GLsizei bufSize, GLsizei *length, char *infoLog); |
michael@0 | 56 | |
michael@0 | 57 | void appendSanitized(const char *message); |
michael@0 | 58 | void append(const char *info, ...); |
michael@0 | 59 | void reset(); |
michael@0 | 60 | private: |
michael@0 | 61 | DISALLOW_COPY_AND_ASSIGN(InfoLog); |
michael@0 | 62 | char *mInfoLog; |
michael@0 | 63 | }; |
michael@0 | 64 | |
michael@0 | 65 | class Program |
michael@0 | 66 | { |
michael@0 | 67 | public: |
michael@0 | 68 | Program(rx::Renderer *renderer, ResourceManager *manager, GLuint handle); |
michael@0 | 69 | |
michael@0 | 70 | ~Program(); |
michael@0 | 71 | |
michael@0 | 72 | bool attachShader(Shader *shader); |
michael@0 | 73 | bool detachShader(Shader *shader); |
michael@0 | 74 | int getAttachedShadersCount() const; |
michael@0 | 75 | |
michael@0 | 76 | void bindAttributeLocation(GLuint index, const char *name); |
michael@0 | 77 | |
michael@0 | 78 | bool link(); |
michael@0 | 79 | bool isLinked(); |
michael@0 | 80 | bool setProgramBinary(const void *binary, GLsizei length); |
michael@0 | 81 | ProgramBinary *getProgramBinary(); |
michael@0 | 82 | |
michael@0 | 83 | int getInfoLogLength() const; |
michael@0 | 84 | void getInfoLog(GLsizei bufSize, GLsizei *length, char *infoLog); |
michael@0 | 85 | void getAttachedShaders(GLsizei maxCount, GLsizei *count, GLuint *shaders); |
michael@0 | 86 | |
michael@0 | 87 | void getActiveAttribute(GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); |
michael@0 | 88 | GLint getActiveAttributeCount(); |
michael@0 | 89 | GLint getActiveAttributeMaxLength(); |
michael@0 | 90 | |
michael@0 | 91 | void getActiveUniform(GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); |
michael@0 | 92 | GLint getActiveUniformCount(); |
michael@0 | 93 | GLint getActiveUniformMaxLength(); |
michael@0 | 94 | |
michael@0 | 95 | void addRef(); |
michael@0 | 96 | void release(); |
michael@0 | 97 | unsigned int getRefCount() const; |
michael@0 | 98 | void flagForDeletion(); |
michael@0 | 99 | bool isFlaggedForDeletion() const; |
michael@0 | 100 | |
michael@0 | 101 | void validate(); |
michael@0 | 102 | bool isValidated() const; |
michael@0 | 103 | |
michael@0 | 104 | GLint getProgramBinaryLength() const; |
michael@0 | 105 | |
michael@0 | 106 | private: |
michael@0 | 107 | DISALLOW_COPY_AND_ASSIGN(Program); |
michael@0 | 108 | |
michael@0 | 109 | void unlink(bool destroy = false); |
michael@0 | 110 | |
michael@0 | 111 | FragmentShader *mFragmentShader; |
michael@0 | 112 | VertexShader *mVertexShader; |
michael@0 | 113 | |
michael@0 | 114 | AttributeBindings mAttributeBindings; |
michael@0 | 115 | |
michael@0 | 116 | BindingPointer<ProgramBinary> mProgramBinary; |
michael@0 | 117 | bool mLinked; |
michael@0 | 118 | bool mDeleteStatus; // Flag to indicate that the program can be deleted when no longer in use |
michael@0 | 119 | |
michael@0 | 120 | unsigned int mRefCount; |
michael@0 | 121 | |
michael@0 | 122 | ResourceManager *mResourceManager; |
michael@0 | 123 | rx::Renderer *mRenderer; |
michael@0 | 124 | const GLuint mHandle; |
michael@0 | 125 | |
michael@0 | 126 | InfoLog mInfoLog; |
michael@0 | 127 | }; |
michael@0 | 128 | } |
michael@0 | 129 | |
michael@0 | 130 | #endif // LIBGLESV2_PROGRAM_H_ |