Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Issue 19625: Add support for dynamically loading internal plugins (Closed)

Created:
11 years, 11 months ago by Marshall Greenblatt
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Add support for dynamically registering and loading plugins built as part of the application. For instance, consider a medical viewing application where the complete user interface is an embedded browser window. An internal plugin is embedded in the browser window for viewing medical scan images. The plugin depends on the medical viewing application (cannot function independently), and so we compile both the viewing application and the plugin into a single executable. Example C++ usage: PluginVersionInfo info; info.path = L"medical_viewing_plugin"; info.product_name = L"Medical Viewing Plugin"; info.file_description = L"Medical viewing application plugin"; info.file_version = L"1, 0, 0, 1"; info.mime_types = L"application/x-medical-viewing-plugin"; info.file_extensions = L"*"; info.np_getentrypoints = my_np_getentrypoints; info.np_initialize = my_np_initialize; info.np_shutdown = my_np_shutdown; // Register the plugin information NPAPI::PluginLib::RegisterInternalPlugin(info); // Load the plugin so that it's available to the client NPAPI::PluginList::Singleton()->LoadPlugin(info.path); Example HTML usage: <embed type="application/x-medical-viewing-plugin" width=600 height=600>

Patch Set 1 #

Total comments: 4

Patch Set 2 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+96 lines, -68 lines) Patch
M webkit/glue/plugins/plugin_lib.h View 1 2 chunks +12 lines, -7 lines 0 comments Download
M webkit/glue/plugins/plugin_lib_win.cc View 1 3 chunks +80 lines, -58 lines 0 comments Download
M webkit/glue/plugins/plugin_list.h View 1 2 chunks +4 lines, -3 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
Marshall Greenblatt
Please review this patch related to the chromium-dev thread @ http://groups.google.com/group/chromium-dev/browse_thread/thread/e72a2dcd5df1123f jam: primary reviewer avi: ...
11 years, 11 months ago (2009-01-28 17:22:55 UTC) #1
Dean McNamee
http://codereview.chromium.org/19625/diff/1/3 File webkit/glue/plugins/plugin_lib_win.cc (right): http://codereview.chromium.org/19625/diff/1/3#newcode92 Line 92: static std::vector<WebPluginInfoInternal> g_dynamic_internal_plugins; We have a rule against ...
11 years, 11 months ago (2009-01-28 17:34:55 UTC) #2
Marshall Greenblatt
That was my first thought as well, but we don't currently have a singleton for ...
11 years, 11 months ago (2009-01-28 17:40:55 UTC) #3
Dean McNamee
You can just use LazyInstance (see PluginList for an example). It's a bit awkward (my ...
11 years, 11 months ago (2009-01-28 17:42:18 UTC) #4
jam
http://codereview.chromium.org/19625/diff/1/4 File webkit/glue/plugins/plugin_lib.h (right): http://codereview.chromium.org/19625/diff/1/4#newcode58 Line 58: static void RegisterWebPluginInfo(const WebPluginInfo& info, you're really registering ...
11 years, 11 months ago (2009-01-28 18:06:28 UTC) #5
Marshall Greenblatt
PluginVersionInfo uses wchar_t* instead of std::wstring, which makes it unclear as to who is responsible ...
11 years, 11 months ago (2009-01-28 18:27:33 UTC) #6
jam
On 2009/01/28 18:27:33, Marshall Greenblatt wrote: > PluginVersionInfo uses wchar_t* instead of std::wstring, which makes ...
11 years, 11 months ago (2009-01-28 18:32:50 UTC) #7
Marshall Greenblatt
> We actually made it wchar_t* on purpose to avoid global static objects (since > ...
11 years, 11 months ago (2009-01-28 18:41:25 UTC) #8
Marshall Greenblatt
Please review the updated patch. 1. Use LazyInstance for the dynamic vector of PluginVersionInfo in ...
11 years, 11 months ago (2009-01-28 19:28:05 UTC) #9
jam
On 2009/01/28 19:28:05, Marshall Greenblatt wrote: > Please review the updated patch. > > 1. ...
11 years, 11 months ago (2009-01-28 19:34:22 UTC) #10
Marshall Greenblatt
On 2009/01/28 19:34:22, John Abd-El-Malek wrote: > > The code still has std::strings getting constructed. ...
11 years, 11 months ago (2009-01-28 19:55:06 UTC) #11
Marshall Greenblatt
11 years, 11 months ago (2009-01-28 20:07:12 UTC) #12
On Wed, Jan 28, 2009 at 2:28 PM, John Abd-El-Malek <jam@chromium.org> wrote:

    On Wed, Jan 28, 2009 at 10:41 AM,  <magreenblatt@gmail.com> wrote:
    >
    >> We actually made it wchar_t* on purpose to avoid global static objects
    >
    > (since
    >>
    >> otherwise the internal plugins would create static std::strings).  I
    >
    > think here
    >>
    >> you can add a comment that the passed in strings should be valid for
    >
    > the
    >>
    >> duration of PluginList..
    >
    > If we are eliminating g_internal_plugins and using the new
    > RegisterInternalPlugin() method to register the plugins currently
    > included in g_internal_plugins, then we will be eliminating the global
    > creation of the static std::wstring instances as well.  Therefore, we
    > could go back to using std::wstring in PluginVersionInfo.  Does that
    > make sense?

    not really, because we'll still have const PluginVersion Info = { blah
    } in the code, which will cause static std::strings to be created...

    I think it might just be quicker for me to send you a changelist with
    this stuff instead of trying to get you to code up what's in my head.
    Let me send it to you and we can see if it's sufficient.
    >
    > http://codereview.chromium.org/19625
    >

Go ahead and do your implementation.  My personal interest is more with the
functionality than the particular approach :-).

Powered by Google App Engine
This is Rietveld 408576698