~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to src/3rdparty/webkit/WebCore/plugins/win/PluginPackageWin.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2009-11-02 18:30:08 UTC
  • mfrom: (1.2.2 upstream)
  • mto: (15.2.5 experimental)
  • mto: This revision was merged to the branch mainline in revision 88.
  • Revision ID: james.westby@ubuntu.com-20091102183008-b6a4gcs128mvfb3m
Tags: upstream-4.6.0~beta1
ImportĀ upstreamĀ versionĀ 4.6.0~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
3
3
 * Copyright (C) 2008 Collabora, Ltd.  All rights reserved.
 
4
 * Copyright (C) 2009 Torch Mobile, Inc.  All rights reserved.
4
5
 *
5
6
 * Redistribution and use in source and binary forms, with or without
6
7
 * modification, are permitted provided that the following conditions
68
69
 
69
70
bool PluginPackage::isPluginBlacklisted()
70
71
{
 
72
    if (name() == "Citrix ICA Client") {
 
73
        // The Citrix ICA Client plug-in requires a Mozilla-based browser; see <rdar://6418681>.
 
74
        return true;
 
75
    }
 
76
 
71
77
    if (name() == "Silverlight Plug-In") {
72
78
        // workaround for <rdar://5557379> Crash in Silverlight when opening microsoft.com.
73
79
        // the latest 1.0 version of Silverlight does not reproduce this crash, so allow it
76
82
 
77
83
        if (compareFileVersion(slPluginMinRequired) < 0)
78
84
            return true;
79
 
    } else if (fileName() == "npmozax.dll")
 
85
    } else if (fileName() == "npmozax.dll") {
80
86
        // Bug 15217: Mozilla ActiveX control complains about missing xpcom_core.dll
81
87
        return true;
 
88
    } else if (name() == "Yahoo Application State Plugin") {
 
89
        // https://bugs.webkit.org/show_bug.cgi?id=26860
 
90
        // Bug in Yahoo Application State plug-in earlier than 1.0.0.6 leads to heap corruption. 
 
91
        static const PlatformModuleVersion yahooAppStatePluginMinRequired(0x00000006, 0x00010000);
 
92
        if (compareFileVersion(yahooAppStatePluginMinRequired) < 0)
 
93
            return true;
 
94
    }
82
95
 
83
96
    return false;
84
97
}
114
127
        m_quirks.add(PluginQuirkHasModalMessageLoop);
115
128
    }
116
129
 
117
 
    if (name() == "VLC Multimedia Plugin") {
 
130
    if (name() == "VLC Multimedia Plugin" || name() == "VLC Multimedia Plug-in") {
118
131
        // VLC hangs on NPP_Destroy if we call NPP_SetWindow with a null window handle
119
132
        m_quirks.add(PluginQuirkDontSetNullWindowHandleOnDestroy);
120
133
 
232
245
        m_loadCount++;
233
246
        return true;
234
247
    } else {
 
248
#if PLATFORM(WINCE)
 
249
        m_module = ::LoadLibraryW(m_path.charactersWithNullTermination());
 
250
#else
235
251
        WCHAR currentPath[MAX_PATH];
236
252
 
237
253
        if (!::GetCurrentDirectoryW(MAX_PATH, currentPath))
243
259
            return false;
244
260
 
245
261
        // Load the library
246
 
        m_module = ::LoadLibraryW(m_path.charactersWithNullTermination());
 
262
        m_module = ::LoadLibraryExW(m_path.charactersWithNullTermination(), 0, LOAD_WITH_ALTERED_SEARCH_PATH);
247
263
 
248
264
        if (!::SetCurrentDirectoryW(currentPath)) {
249
265
            if (m_module)
250
266
                ::FreeLibrary(m_module);
251
267
            return false;
252
268
        }
 
269
#endif
253
270
    }
254
271
 
255
272
    if (!m_module)
261
278
    NP_InitializeFuncPtr NP_Initialize = 0;
262
279
    NPError npErr;
263
280
 
 
281
#if PLATFORM(WINCE)
 
282
    NP_Initialize = (NP_InitializeFuncPtr)GetProcAddress(m_module, L"NP_Initialize");
 
283
    NP_GetEntryPoints = (NP_GetEntryPointsFuncPtr)GetProcAddress(m_module, L"NP_GetEntryPoints");
 
284
    m_NPP_Shutdown = (NPP_ShutdownProcPtr)GetProcAddress(m_module, L"NP_Shutdown");
 
285
#else
264
286
    NP_Initialize = (NP_InitializeFuncPtr)GetProcAddress(m_module, "NP_Initialize");
265
287
    NP_GetEntryPoints = (NP_GetEntryPointsFuncPtr)GetProcAddress(m_module, "NP_GetEntryPoints");
266
288
    m_NPP_Shutdown = (NPP_ShutdownProcPtr)GetProcAddress(m_module, "NP_Shutdown");
 
289
#endif
267
290
 
268
291
    if (!NP_Initialize || !NP_GetEntryPoints || !m_NPP_Shutdown)
269
292
        goto abort;
270
 
  
 
293
 
271
294
    memset(&m_pluginFuncs, 0, sizeof(m_pluginFuncs));
272
295
    m_pluginFuncs.size = sizeof(m_pluginFuncs);
273
296
 
276
299
    if (npErr != NPERR_NO_ERROR)
277
300
        goto abort;
278
301
 
279
 
    memset(&m_browserFuncs, 0, sizeof(m_browserFuncs));
280
 
    m_browserFuncs.size = sizeof (m_browserFuncs);
281
 
    m_browserFuncs.version = NP_VERSION_MINOR;
282
 
 
283
 
    m_browserFuncs.geturl = NPN_GetURL;
284
 
    m_browserFuncs.posturl = NPN_PostURL;
285
 
    m_browserFuncs.requestread = NPN_RequestRead;
286
 
    m_browserFuncs.newstream = NPN_NewStream;
287
 
    m_browserFuncs.write = NPN_Write;
288
 
    m_browserFuncs.destroystream = NPN_DestroyStream;
289
 
    m_browserFuncs.status = NPN_Status;
290
 
    m_browserFuncs.uagent = NPN_UserAgent;
291
 
    m_browserFuncs.memalloc = NPN_MemAlloc;
292
 
    m_browserFuncs.memfree = NPN_MemFree;
293
 
    m_browserFuncs.memflush = NPN_MemFlush;
294
 
    m_browserFuncs.reloadplugins = NPN_ReloadPlugins;
295
 
    m_browserFuncs.geturlnotify = NPN_GetURLNotify;
296
 
    m_browserFuncs.posturlnotify = NPN_PostURLNotify;
297
 
    m_browserFuncs.getvalue = NPN_GetValue;
298
 
    m_browserFuncs.setvalue = NPN_SetValue;
299
 
    m_browserFuncs.invalidaterect = NPN_InvalidateRect;
300
 
    m_browserFuncs.invalidateregion = NPN_InvalidateRegion;
301
 
    m_browserFuncs.forceredraw = NPN_ForceRedraw;
302
 
    m_browserFuncs.getJavaEnv = NPN_GetJavaEnv;
303
 
    m_browserFuncs.getJavaPeer = NPN_GetJavaPeer;
304
 
    m_browserFuncs.pushpopupsenabledstate = NPN_PushPopupsEnabledState;
305
 
    m_browserFuncs.poppopupsenabledstate = NPN_PopPopupsEnabledState;
306
 
    m_browserFuncs.pluginthreadasynccall = NPN_PluginThreadAsyncCall;
307
 
 
308
 
    m_browserFuncs.releasevariantvalue = _NPN_ReleaseVariantValue;
309
 
    m_browserFuncs.getstringidentifier = _NPN_GetStringIdentifier;
310
 
    m_browserFuncs.getstringidentifiers = _NPN_GetStringIdentifiers;
311
 
    m_browserFuncs.getintidentifier = _NPN_GetIntIdentifier;
312
 
    m_browserFuncs.identifierisstring = _NPN_IdentifierIsString;
313
 
    m_browserFuncs.utf8fromidentifier = _NPN_UTF8FromIdentifier;
314
 
    m_browserFuncs.intfromidentifier = _NPN_IntFromIdentifier;
315
 
    m_browserFuncs.createobject = _NPN_CreateObject;
316
 
    m_browserFuncs.retainobject = _NPN_RetainObject;
317
 
    m_browserFuncs.releaseobject = _NPN_ReleaseObject;
318
 
    m_browserFuncs.invoke = _NPN_Invoke;
319
 
    m_browserFuncs.invokeDefault = _NPN_InvokeDefault;
320
 
    m_browserFuncs.evaluate = _NPN_Evaluate;
321
 
    m_browserFuncs.getproperty = _NPN_GetProperty;
322
 
    m_browserFuncs.setproperty = _NPN_SetProperty;
323
 
    m_browserFuncs.removeproperty = _NPN_RemoveProperty;
324
 
    m_browserFuncs.hasproperty = _NPN_HasProperty;
325
 
    m_browserFuncs.hasmethod = _NPN_HasMethod;
326
 
    m_browserFuncs.setexception = _NPN_SetException;
327
 
    m_browserFuncs.enumerate = _NPN_Enumerate;
328
 
    m_browserFuncs.construct = _NPN_Construct;
 
302
    initializeBrowserFuncs();
329
303
 
330
304
    npErr = NP_Initialize(&m_browserFuncs);
331
305
    LOG_NPERROR(npErr);