cloudtrends / chromiumembedded

Automatically exported from code.google.com/p/chromiumembedded
1 stars 1 forks source link

Don't include NPAPI headers in cef_nplugin.h #89

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The cef_nplugin.h header file contains the following include directives:

#include "third_party/npapi/bindings/npapi.h"
#include "third_party/npapi/bindings/nphostapi.h"

As far as I can tell, this is done to get the following three typedefs:

typedef NPError (API_CALL * NP_InitializeFunc)(NPNetscapeFuncs* pFuncs);
typedef NPError (API_CALL * NP_GetEntryPointsFunc)(NPPluginFuncs* pFuncs);
typedef NPError (API_CALL * NP_ShutdownFunc)(void);

It would be better to include those typedefs directly in cef_nplugin.h and 
forego including the external header files.  I think including external 
WebKit/Chromium headers in a public CEF header somewhat breaks the 
encapsulation that CEF is striving to achieve (and which is one of its best 
features :-).

Original issue reported on code.google.com by emerick on 9 Jun 2010 at 3:48

GoogleCodeExporter commented 9 years ago
You should only include cef_nplugin.h if you're creating a NPAPI plugin, in 
which case you will need more than just these three typedefs. For binary 
releases of CEF the necessary NPAPI header files are gathered into a single 
include\npapi directory and the include paths from the CEF headers are modified 
accordingly.

From the include\npapi\NPAPI-README.txt file:

The files in this directory have been copied from various locations in the
Chromium source tree. They have been modified only to the extent necessary
to work in the CEF Binary Distribution directory structure. Below is a
listing of the original file locations.

File                Original Location
-----------------------------------------------
basictypes.h        base/
build_config.h      build/
npapi.h             third_party/npapi/bindings
npapi_extensions.h  third_party/npapi/bindings
nphostapi.h         third_party/npapi/bindings
npruntime.h         third_party/npapi/bindings
port.h              base/

Original comment by magreenb...@gmail.com on 9 Jun 2010 at 7:03

GoogleCodeExporter commented 9 years ago
Ah right, now I can see that you need more than those three typedefs.  That's 
convenient that they're packaged up in the binary distribution.  Would it make 
sense to include them even for source distributions?  Although they're included 
in the Chromium source base, I think being able to reference them "outside" of 
that context is helpful.  Something to think about maybe...  :-)

Original comment by emerick on 10 Jun 2010 at 1:56