Home | History | Annotate | Download | only in common
      1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #ifndef CONTENT_PUBLIC_COMMON_PEPPER_PLUGIN_INFO_H_
      6 #define CONTENT_PUBLIC_COMMON_PEPPER_PLUGIN_INFO_H_
      7 
      8 #include <string>
      9 #include <vector>
     10 
     11 #include "base/files/file_path.h"
     12 #include "content/common/content_export.h"
     13 #include "content/public/common/webplugininfo.h"
     14 #include "ppapi/c/pp_module.h"
     15 #include "ppapi/c/ppb.h"
     16 
     17 namespace content {
     18 
     19 struct CONTENT_EXPORT PepperPluginInfo {
     20   typedef const void* (*GetInterfaceFunc)(const char*);
     21   typedef int (*PPP_InitializeModuleFunc)(PP_Module, PPB_GetInterface);
     22   typedef void (*PPP_ShutdownModuleFunc)();
     23 
     24   struct EntryPoints {
     25     // This structure is POD, with the constructor initializing to NULL.
     26     CONTENT_EXPORT EntryPoints();
     27 
     28     GetInterfaceFunc get_interface;
     29     PPP_InitializeModuleFunc initialize_module;
     30     PPP_ShutdownModuleFunc shutdown_module;  // Optional, may be NULL.
     31   };
     32 
     33   PepperPluginInfo();
     34   ~PepperPluginInfo();
     35 
     36   WebPluginInfo ToWebPluginInfo() const;
     37 
     38   // Indicates internal plugins for which there's not actually a library.
     39   // These plugins are implemented in the Chrome binary using a separate set
     40   // of entry points (see internal_entry_points below).
     41   // Defaults to false.
     42   bool is_internal;
     43 
     44   // True when this plugin should be run out of process. Defaults to false.
     45   bool is_out_of_process;
     46 
     47   // True when an out-of-process plugin should also be run within sandbox.
     48   // Defaults to true.
     49   bool is_sandboxed;
     50 
     51   base::FilePath path;  // Internal plugins have "internal-[name]" as path.
     52   std::string name;
     53   std::string description;
     54   std::string version;
     55   std::vector<WebPluginMimeType> mime_types;
     56 
     57   // When is_internal is set, this contains the function pointers to the
     58   // entry points for the internal plugins.
     59   EntryPoints internal_entry_points;
     60 
     61   // Permission bits from ppapi::Permission.
     62   uint32 permissions;
     63 };
     64 
     65 }  // namespace content
     66 
     67 #endif  // CONTENT_PUBLIC_COMMON_PEPPER_PLUGIN_INFO_H_
     68