33 #include "WebCursor.h" |
33 #include "WebCursor.h" |
34 #include "PluginHandler.h" |
34 #include "PluginHandler.h" |
35 #include "WebCannedImages.h" |
35 #include "WebCannedImages.h" |
36 #include "OOMHandler.h" |
36 #include "OOMHandler.h" |
37 #include "SharedTimer.h" |
37 #include "SharedTimer.h" |
|
38 #include "TextEncodingRegistry.h" |
|
39 #include "CSSStyleSelector.h" |
|
40 #include "RenderStyle.h" |
|
41 #include "Page.h" |
|
42 #include "Cache.h" |
|
43 #include "StreamingTextCodecSymbian.h" |
|
44 #include "HTMLNames.h" |
|
45 #include "XMLNames.h" |
|
46 #include "FontCache.h" |
|
47 #include "RenderThemeSymbian.h" |
|
48 #include "qualifiedname.h" |
|
49 #include "XMLTokenizer.h" |
38 #include <eikenv.h> |
50 #include <eikenv.h> |
|
51 |
|
52 #include "WidgetEngineBridge.h" |
|
53 #if defined(BRDO_LIW_FF) |
|
54 #include "DeviceBridge.h" |
|
55 #endif |
39 |
56 |
40 const TInt KLowResolutionDpi = 130; |
57 const TInt KLowResolutionDpi = 130; |
41 const TInt KMediumResolutionDpi = 200; |
58 const TInt KMediumResolutionDpi = 200; |
42 |
59 |
43 namespace WebCore { |
60 namespace WebCore { |
58 ,m_refcount(0) |
75 ,m_refcount(0) |
59 ,m_capabilities(0) |
76 ,m_capabilities(0) |
60 ,m_oomHandler(0) |
77 ,m_oomHandler(0) |
61 ,m_fullScreenMode(false) |
78 ,m_fullScreenMode(false) |
62 ,m_pluginFullscreen(false) |
79 ,m_pluginFullscreen(false) |
|
80 ,m_symbianTheme(NULL) |
63 { |
81 { |
64 // Check the device resolution |
82 // Check the device resolution |
65 CEikonEnv* eikEnv = CEikonEnv::Static(); |
83 CEikonEnv* eikEnv = CEikonEnv::Static(); |
66 if( eikEnv ) { |
84 if( eikEnv ) { |
67 CWsScreenDevice& screenDev = *eikEnv->ScreenDevice(); |
85 CWsScreenDevice& screenDev = *eikEnv->ScreenDevice(); |
81 m_oomHandler = new OOMHandler(); |
99 m_oomHandler = new OOMHandler(); |
82 } |
100 } |
83 |
101 |
84 StaticObjectsContainer::~StaticObjectsContainer() |
102 StaticObjectsContainer::~StaticObjectsContainer() |
85 { |
103 { |
|
104 // Run KJS collector to cleanup any remaining references |
|
105 // This must be run before Cache::deleteStaticCache to properly free resources |
|
106 KJS::Collector::collect(); |
86 delete m_oomHandler; |
107 delete m_oomHandler; |
|
108 FontCache::deleteFontDataCache(); |
87 delete m_fontCache; |
109 delete m_fontCache; |
88 delete m_formFillController; |
110 delete m_formFillController; |
89 delete m_pictograph; |
111 delete m_pictograph; |
90 delete m_resourceLoaderDelegate; |
112 delete m_resourceLoaderDelegate; |
91 delete m_stream; |
113 delete m_stream; |
92 delete m_icondatabase; |
114 delete m_icondatabase; |
93 delete m_rendertarget; |
115 delete m_rendertarget; |
94 delete m_cannedimg; |
116 delete m_cannedimg; |
95 delete m_cursor; |
117 delete m_cursor; |
96 delete m_pluginhandler; |
118 delete m_pluginhandler; |
|
119 delete m_symbianTheme; |
97 gInstance = NULL; |
120 gInstance = NULL; |
|
121 deletePageStaticData(); |
|
122 CSSStyleSelector::deleteDefaultStyle(); |
|
123 deleteEncodingMaps(); |
|
124 RenderStyle::deleteDefaultRenderStyle(); |
|
125 Cache::deleteStaticCache(); |
|
126 TextCodecSymbian::deleteStatAvailCharsets(); |
|
127 QualifiedName::cleanup(); |
|
128 XMLNames::remove(); |
|
129 // HTMLNames::remove() will destroy the AtomicString table |
|
130 // All other atomic string destruction must be done before this call |
|
131 // |
|
132 HTMLNames::remove(); |
|
133 XMLTokenizer::cleanupXMLStringParser(); |
98 shutdownSharedTimer(); |
134 shutdownSharedTimer(); |
|
135 m_widgetLibrary.Close(); |
|
136 #if defined(BRDO_LIW_FF) |
|
137 m_deviceLibrary.Close(); |
|
138 #endif |
|
139 CloseSTDLIB(); |
99 } |
140 } |
100 |
141 |
101 StaticObjectsContainer* StaticObjectsContainer::instance() |
142 StaticObjectsContainer* StaticObjectsContainer::instance() |
102 { |
143 { |
103 if( !gInstance ) |
144 if( !gInstance ) |
194 //tot:fixme |
235 //tot:fixme |
195 TBool enablePlugin = ETrue; |
236 TBool enablePlugin = ETrue; |
196 m_pluginhandler = PluginHandler::NewL(enablePlugin); |
237 m_pluginhandler = PluginHandler::NewL(enablePlugin); |
197 } |
238 } |
198 return m_pluginhandler; |
239 return m_pluginhandler; |
|
240 } |
|
241 |
|
242 #if defined(BRDO_LIW_FF) |
|
243 MDeviceBridge* StaticObjectsContainer::getDeviceBridgeL() |
|
244 { |
|
245 MDeviceBridge* device(NULL); |
|
246 |
|
247 if( !m_deviceLibrary.Handle() ) { |
|
248 _LIT( KDeviceDLLName, "jsdevice.dll" ); |
|
249 User::LeaveIfError( m_deviceLibrary.Load(KDeviceDLLName) ); |
|
250 } |
|
251 |
|
252 TLibraryFunction device_entry = m_deviceLibrary.Lookup(1); |
|
253 if (device_entry) { |
|
254 device = (MDeviceBridge*) device_entry(); |
|
255 } |
|
256 return device; |
|
257 } |
|
258 #endif |
|
259 |
|
260 MWidgetEngineBridge* StaticObjectsContainer::getWidgetEngineBridgeL() |
|
261 { |
|
262 MWidgetEngineBridge* widget(NULL); |
|
263 |
|
264 if( !m_widgetLibrary.Handle() ) { |
|
265 _LIT( KBrowserWidgetEngineName, "widgetengine.dll" ); |
|
266 User::LeaveIfError( m_widgetLibrary.Load(KBrowserWidgetEngineName) ); |
|
267 } |
|
268 |
|
269 TLibraryFunction entry = m_widgetLibrary.Lookup(1); |
|
270 if (entry) { |
|
271 widget = (MWidgetEngineBridge*) entry(); |
|
272 } |
|
273 return widget; |
199 } |
274 } |
200 |
275 |
201 CBrCtl* StaticObjectsContainer::brctl() const |
276 CBrCtl* StaticObjectsContainer::brctl() const |
202 { |
277 { |
203 if (m_activeBrCtls.size() > 0) |
278 if (m_activeBrCtls.size() > 0) |