1e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch/*
2e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch *           (C) 1999 Antti Koivisto (koivisto@kde.org)
4e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch *           (C) 2001 Dirk Mueller (mueller@kde.org)
5e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch *           (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All rights reserved.
7e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
8e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
9e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch * Copyright (C) 2011 Google Inc. All rights reserved.
10e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch *
11e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch * This library is free software; you can redistribute it and/or
12e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch * modify it under the terms of the GNU Library General Public
13e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch * License as published by the Free Software Foundation; either
14e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch * version 2 of the License, or (at your option) any later version.
15e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch *
16e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch * This library is distributed in the hope that it will be useful,
17e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch * but WITHOUT ANY WARRANTY; without even the implied warranty of
18e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch * Library General Public License for more details.
20e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch *
21e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch * You should have received a copy of the GNU Library General Public License
22e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch * along with this library; see the file COPYING.LIB.  If not, write to
23e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch * Boston, MA 02110-1301, USA.
25e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch *
26e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch */
27e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch
28e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch#ifndef StyleSheetCollection_h
29e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch#define StyleSheetCollection_h
30e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch
31f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liu#include "platform/heap/Handle.h"
32e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch#include "wtf/FastAllocBase.h"
33e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch#include "wtf/RefPtr.h"
34e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch#include "wtf/Vector.h"
35e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch
36c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles)namespace blink {
37e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch
38e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdochclass CSSStyleSheet;
39e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdochclass StyleSheet;
40e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch
4143e7502580f146aa5b3db8267ba6dbb5c733a489Torne (Richard Coles)class StyleSheetCollection : public NoBaseWillBeGarbageCollectedFinalized<StyleSheetCollection> {
4243e7502580f146aa5b3db8267ba6dbb5c733a489Torne (Richard Coles)    WTF_MAKE_NONCOPYABLE(StyleSheetCollection);
4343e7502580f146aa5b3db8267ba6dbb5c733a489Torne (Richard Coles)    WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
44e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdochpublic:
4509380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    friend class ActiveDocumentStyleSheetCollector;
4609380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    friend class ImportedDocumentStyleSheetCollector;
4709380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)
4809380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    StyleSheetCollection();
4943e7502580f146aa5b3db8267ba6dbb5c733a489Torne (Richard Coles)    virtual ~StyleSheetCollection();
50e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch
51d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet> >& activeAuthorStyleSheets() { return m_activeAuthorStyleSheets; }
52d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    WillBeHeapVector<RefPtrWillBeMember<StyleSheet> >& styleSheetsForStyleSheetList() { return m_styleSheetsForStyleSheetList; }
53d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    const WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet> >& activeAuthorStyleSheets() const { return m_activeAuthorStyleSheets; }
54d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    const WillBeHeapVector<RefPtrWillBeMember<StyleSheet> >& styleSheetsForStyleSheetList() const { return m_styleSheetsForStyleSheetList; }
55e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch
5609380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    void swap(StyleSheetCollection&);
57d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    void swapSheetsForSheetList(WillBeHeapVector<RefPtrWillBeMember<StyleSheet> >&);
5843e7502580f146aa5b3db8267ba6dbb5c733a489Torne (Richard Coles)    void appendActiveStyleSheets(const WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet> >&);
5951b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)    void appendActiveStyleSheet(CSSStyleSheet*);
6051b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)    void appendSheetForList(StyleSheet*);
6151b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)
6243e7502580f146aa5b3db8267ba6dbb5c733a489Torne (Richard Coles)    virtual void trace(Visitor*);
6343e7502580f146aa5b3db8267ba6dbb5c733a489Torne (Richard Coles)
6451b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)protected:
6543e7502580f146aa5b3db8267ba6dbb5c733a489Torne (Richard Coles)    WillBeHeapVector<RefPtrWillBeMember<StyleSheet> > m_styleSheetsForStyleSheetList;
6643e7502580f146aa5b3db8267ba6dbb5c733a489Torne (Richard Coles)    WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet> > m_activeAuthorStyleSheets;
6751b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)};
6851b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)
69e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch}
70e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch
71e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch#endif
72e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch
73