gfx/angle/src/compiler/RemoveTree.cpp

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

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.

     1 //
     2 // Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
     3 // Use of this source code is governed by a BSD-style license that can be
     4 // found in the LICENSE file.
     5 //
     7 #include "compiler/intermediate.h"
     8 #include "compiler/RemoveTree.h"
    10 //
    11 // Code to recursively delete the intermediate tree.
    12 //
    14 class RemoveTree : public TIntermTraverser
    15 {
    16 public:
    17 	RemoveTree() : TIntermTraverser(false, false, true)
    18 	{
    19 	}
    21 protected:
    22 	void visitSymbol(TIntermSymbol*);
    23 	void visitConstantUnion(TIntermConstantUnion*);
    24 	bool visitBinary(Visit visit, TIntermBinary*);
    25 	bool visitUnary(Visit visit, TIntermUnary*);
    26 	bool visitSelection(Visit visit, TIntermSelection*);
    27 	bool visitAggregate(Visit visit, TIntermAggregate*);
    28 };
    30 void RemoveTree::visitSymbol(TIntermSymbol* node)
    31 {
    32 	delete node;
    33 }
    35 bool RemoveTree::visitBinary(Visit visit, TIntermBinary* node)
    36 {
    37 	delete node;
    39 	return true;
    40 }
    42 bool RemoveTree::visitUnary(Visit visit, TIntermUnary* node)
    43 {
    44     delete node;
    46 	return true;
    47 }
    49 bool RemoveTree::visitAggregate(Visit visit, TIntermAggregate* node)
    50 {
    51 	delete node;
    53 	return true;
    54 }
    56 bool RemoveTree::visitSelection(Visit visit, TIntermSelection* node)
    57 {
    58 	delete node;
    60 	return true;
    61 }
    63 void RemoveTree::visitConstantUnion(TIntermConstantUnion* node)
    64 {
    65 	delete node;
    66 }
    68 //
    69 // Entry point.
    70 //
    71 void RemoveAllTreeNodes(TIntermNode* root)
    72 {
    73     RemoveTree it;
    75     root->traverse(&it);
    76 }

mercurial