1 /* |
1 /* |
2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (C) 2006 Nokia, Inc. All rights reserved. |
3 * All rights reserved. |
3 * |
4 * This component and the accompanying materials are made available |
4 * Redistribution and use in source and binary forms, with or without |
5 * under the terms of the License "Eclipse Public License v1.0" |
5 * modification, are permitted provided that the following conditions |
6 * which accompanies this distribution, and is available |
6 * are met: |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * |
8 * |
8 * 1. Redistributions of source code must retain the above copyright |
9 * Initial Contributors: |
9 * notice, this list of conditions and the following disclaimer. |
10 * Nokia Corporation - initial contribution. |
10 * 2. Redistributions in binary form must reproduce the above copyright |
11 * |
11 * notice, this list of conditions and the following disclaimer in the |
12 * Contributors: |
12 * documentation and/or other materials provided with the distribution. |
13 * |
13 * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of |
14 * Description: |
14 * its contributors may be used to endorse or promote products derived |
15 * |
15 * from this software without specific prior written permission. |
16 */ |
16 * |
17 |
17 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY |
|
18 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
|
19 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
|
20 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY |
|
21 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
|
22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
|
23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
|
24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
|
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
|
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
27 */ |
18 |
28 |
19 #include "config.h" |
29 #include "config.h" |
20 #include <../bidi.h> // work around for multiple bidi.h files |
30 #include <../bidi.h> // work around for multiple bidi.h files |
21 #include "StaticObjectsContainer.h" |
31 #include "StaticObjectsContainer.h" |
22 #include "Brctl.h" |
32 #include "Brctl.h" |
32 #include "WebSurface.h" |
42 #include "WebSurface.h" |
33 #include "WebCursor.h" |
43 #include "WebCursor.h" |
34 #include "PluginHandler.h" |
44 #include "PluginHandler.h" |
35 #include "WebCannedImages.h" |
45 #include "WebCannedImages.h" |
36 #include "OOMHandler.h" |
46 #include "OOMHandler.h" |
|
47 #include "OOMStopper.h" |
37 #include "SharedTimer.h" |
48 #include "SharedTimer.h" |
38 #include "TextEncoding.h" |
49 #include "TextEncoding.h" |
39 #include "TextEncodingRegistry.h" |
50 #include "TextEncodingRegistry.h" |
40 #include "CSSStyleSelector.h" |
51 #include "CSSStyleSelector.h" |
41 #include "RenderStyle.h" |
52 #include "RenderStyle.h" |
54 #include "StyleElement.h" |
65 #include "StyleElement.h" |
55 #include "bidi.h" |
66 #include "bidi.h" |
56 #include "RenderBox.h" |
67 #include "RenderBox.h" |
57 #include "FontCache.h" |
68 #include "FontCache.h" |
58 #include "MIMETypeRegistry.h" |
69 #include "MIMETypeRegistry.h" |
59 #include "ImageSymbian.h" |
|
60 #include "ResourceHandleManagerSymbian.h" |
70 #include "ResourceHandleManagerSymbian.h" |
61 #include "TextBreakIteratorSymbian.h" |
71 #include "TextBreakIteratorSymbian.h" |
|
72 #include "ImageSymbian.h" |
62 #include "HTMLElementFactory.h" |
73 #include "HTMLElementFactory.h" |
63 #include <eikenv.h> |
74 #include <eikenv.h> |
64 |
75 |
65 #include "WidgetEngineBridge.h" |
76 #include "WidgetEngineBridge.h" |
66 #if defined(BRDO_LIW_FF) |
77 #if defined(BRDO_LIW_FF) |
86 ,m_cannedimg(NULL) |
97 ,m_cannedimg(NULL) |
87 ,m_pluginhandler(NULL) |
98 ,m_pluginhandler(NULL) |
88 ,m_refcount(0) |
99 ,m_refcount(0) |
89 ,m_capabilities(0) |
100 ,m_capabilities(0) |
90 ,m_oomHandler(0) |
101 ,m_oomHandler(0) |
|
102 ,m_oomStopper(0) |
91 ,m_fullScreenMode(false) |
103 ,m_fullScreenMode(false) |
92 ,m_pluginFullscreen(false) |
104 ,m_pluginFullscreen(false) |
93 ,m_symbianTheme(NULL) |
105 ,m_symbianTheme(NULL) |
94 { |
106 { |
95 // Check the device resolution |
107 // Check the device resolution |
108 else { |
120 else { |
109 m_screenRes = EHighScreenResolution; |
121 m_screenRes = EHighScreenResolution; |
110 } |
122 } |
111 } |
123 } |
112 m_oomHandler = new OOMHandler(); |
124 m_oomHandler = new OOMHandler(); |
|
125 m_oomStopper = new OOMStopper(); |
113 initSharedTimer(); |
126 initSharedTimer(); |
114 } |
127 } |
115 |
128 |
116 StaticObjectsContainer::~StaticObjectsContainer() |
129 StaticObjectsContainer::~StaticObjectsContainer() |
117 { |
130 { |
118 // Run KJS collector to cleanup any remaining references |
131 // Run KJS collector to cleanup any remaining references |
119 // This must be run before Cache::deleteStaticCache to properly free resources |
132 // This must be run before Cache::deleteStaticCache to properly free resources |
120 KJS::Collector::collect(); |
133 KJS::Collector::collect(); |
121 delete m_oomHandler; |
134 delete m_oomHandler; |
|
135 delete m_oomStopper; |
122 FontCache::deleteFontDataCache(); |
136 FontCache::deleteFontDataCache(); |
123 delete m_fontCache; |
137 delete m_fontCache; |
124 delete m_formFillController; |
138 delete m_formFillController; |
125 delete m_pictograph; |
139 delete m_pictograph; |
126 delete m_resourceLoaderDelegate; |
140 delete m_resourceLoaderDelegate; |
131 delete m_cursor; |
145 delete m_cursor; |
132 delete m_pluginhandler; |
146 delete m_pluginhandler; |
133 delete m_symbianTheme; |
147 delete m_symbianTheme; |
134 gInstance = NULL; |
148 gInstance = NULL; |
135 deletePageStaticData(); |
149 deletePageStaticData(); |
|
150 |
136 CSSStyleSelector::deleteDefaultStyle(); |
151 CSSStyleSelector::deleteDefaultStyle(); |
137 deleteTextEncodings(); |
|
138 deleteEncodingMaps(); |
|
139 RenderStyle::deleteDefaultRenderStyle(); |
|
140 Cache::deleteStaticCache(); |
152 Cache::deleteStaticCache(); |
141 TextCodecSymbian::deleteStatAvailCharsets(); |
153 TextCodecSymbian::deleteStatAvailCharsets(); |
142 QualifiedName::cleanup(); |
154 |
143 XMLNames::remove(); |
|
144 cleanupChangedDocuments(); |
155 cleanupChangedDocuments(); |
145 mappedAttributeCleaner(); |
156 mappedAttributeCleaner(); |
146 cleanupMidpoints(); |
157 cleanupMidpoints(); |
147 cleanOverridSizeMap(); |
158 cleanOverridSizeMap(); |
148 cleanupFontDataCache(); |
159 cleanupFontDataCache(); |
150 cleanupHandleManager(); |
161 cleanupHandleManager(); |
151 cleanupFuncMap(); |
162 cleanupFuncMap(); |
152 cleanupIconFileName(); |
163 cleanupIconFileName(); |
153 cleanupIterators(); |
164 cleanupIterators(); |
154 |
165 |
155 #ifndef __WINSCW__ |
166 XMLTokenizer::cleanupXMLStringParser(); |
156 WebCore::MediaFeatureNames::remove(); |
|
157 WebCore::EventNames::remove(); |
|
158 #endif // __WINSCW__ |
|
159 |
|
160 // HTMLNames::remove() will destroy the AtomicString table |
|
161 // All other atomic string destruction must be done before this call |
|
162 // |
|
163 HTMLNames::remove(); |
|
164 XMLTokenizer::cleanupXMLStringParser(); |
|
165 shutdownSharedTimer(); |
167 shutdownSharedTimer(); |
166 m_widgetLibrary.Close(); |
168 m_widgetLibrary.Close(); |
167 #if defined(BRDO_LIW_FF) |
169 #if defined(BRDO_LIW_FF) |
168 m_deviceLibrary.Close(); |
170 m_deviceLibrary.Close(); |
169 #endif |
171 #endif |