pepper_flash.patch 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493
  1. From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
  2. From: deepak1556 <[email protected]>
  3. Date: Thu, 20 Sep 2018 17:48:09 -0700
  4. Subject: pepper_flash.patch
  5. Allows building chrome pepper flash integration for Electron.
  6. diff --git a/chrome/browser/renderer_host/pepper/chrome_browser_pepper_host_factory.h b/chrome/browser/renderer_host/pepper/chrome_browser_pepper_host_factory.h
  7. index 735da93c3cabb8c6139971295740ba14a30d1b69..533f53fbc42397608e3762e370cc935c045ce3f1 100644
  8. --- a/chrome/browser/renderer_host/pepper/chrome_browser_pepper_host_factory.h
  9. +++ b/chrome/browser/renderer_host/pepper/chrome_browser_pepper_host_factory.h
  10. @@ -5,6 +5,7 @@
  11. #ifndef CHROME_BROWSER_RENDERER_HOST_PEPPER_CHROME_BROWSER_PEPPER_HOST_FACTORY_H_
  12. #define CHROME_BROWSER_RENDERER_HOST_PEPPER_CHROME_BROWSER_PEPPER_HOST_FACTORY_H_
  13. +#include "base/component_export.h"
  14. #include "base/macros.h"
  15. #include "ppapi/host/host_factory.h"
  16. @@ -12,7 +13,8 @@ namespace content {
  17. class BrowserPpapiHost;
  18. } // namespace content
  19. -class ChromeBrowserPepperHostFactory : public ppapi::host::HostFactory {
  20. +class COMPONENT_EXPORT(PEPPER_FLASH) ChromeBrowserPepperHostFactory
  21. + : public ppapi::host::HostFactory {
  22. public:
  23. // Non-owning pointer to the filter must outlive this class.
  24. explicit ChromeBrowserPepperHostFactory(content::BrowserPpapiHost* host);
  25. diff --git a/chrome/browser/renderer_host/pepper/pepper_broker_message_filter.cc b/chrome/browser/renderer_host/pepper/pepper_broker_message_filter.cc
  26. index 37245c48cacbc5db164c61e4499f34ee83e0fce7..0fef12892e965e319e45f5dd1a9c5c9fc606aa9a 100644
  27. --- a/chrome/browser/renderer_host/pepper/pepper_broker_message_filter.cc
  28. +++ b/chrome/browser/renderer_host/pepper/pepper_broker_message_filter.cc
  29. @@ -7,10 +7,12 @@
  30. #include <string>
  31. #include "base/task/post_task.h"
  32. +#if 0
  33. #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
  34. #include "chrome/browser/profiles/profile.h"
  35. #include "components/content_settings/core/browser/host_content_settings_map.h"
  36. #include "components/content_settings/core/common/content_settings.h"
  37. +#endif
  38. #include "content/public/browser/browser_ppapi_host.h"
  39. #include "content/public/browser/browser_task_traits.h"
  40. #include "content/public/browser/browser_thread.h"
  41. @@ -59,6 +61,7 @@ int32_t PepperBrokerMessageFilter::OnIsAllowed(
  42. RenderProcessHost::FromID(render_process_id_);
  43. if (!render_process_host)
  44. return PP_ERROR_FAILED;
  45. +#if 0
  46. Profile* profile =
  47. Profile::FromBrowserContext(render_process_host->GetBrowserContext());
  48. HostContentSettingsMap* content_settings =
  49. @@ -70,5 +73,6 @@ int32_t PepperBrokerMessageFilter::OnIsAllowed(
  50. std::string());
  51. if (setting == CONTENT_SETTING_ALLOW)
  52. return PP_OK;
  53. - return PP_ERROR_FAILED;
  54. +#endif
  55. + return PP_OK;
  56. }
  57. diff --git a/chrome/browser/renderer_host/pepper/pepper_flash_browser_host.cc b/chrome/browser/renderer_host/pepper/pepper_flash_browser_host.cc
  58. index 91c1562d9894e57fd5c3abfde157127144b31a91..8f4caca848d649db9bd26a4ce37509b29865f3c1 100644
  59. --- a/chrome/browser/renderer_host/pepper/pepper_flash_browser_host.cc
  60. +++ b/chrome/browser/renderer_host/pepper/pepper_flash_browser_host.cc
  61. @@ -8,9 +8,11 @@
  62. #include "base/task/post_task.h"
  63. #include "base/time/time.h"
  64. #include "build/build_config.h"
  65. +#if 0
  66. #include "chrome/browser/content_settings/cookie_settings_factory.h"
  67. #include "chrome/browser/profiles/profile.h"
  68. #include "components/content_settings/core/browser/cookie_settings.h"
  69. +#endif
  70. #include "content/public/browser/browser_context.h"
  71. #include "content/public/browser/browser_ppapi_host.h"
  72. #include "content/public/browser/browser_task_traits.h"
  73. @@ -42,6 +44,7 @@ using content::RenderProcessHost;
  74. namespace {
  75. +#if 0
  76. // Get the CookieSettings on the UI thread for the given render process ID.
  77. scoped_refptr<content_settings::CookieSettings> GetCookieSettings(
  78. int render_process_id) {
  79. @@ -55,6 +58,7 @@ scoped_refptr<content_settings::CookieSettings> GetCookieSettings(
  80. }
  81. return NULL;
  82. }
  83. +#endif
  84. void PepperBindConnectorRequest(
  85. service_manager::mojom::ConnectorRequest connector_request) {
  86. @@ -70,7 +74,9 @@ PepperFlashBrowserHost::PepperFlashBrowserHost(BrowserPpapiHost* host,
  87. PP_Instance instance,
  88. PP_Resource resource)
  89. : ResourceHost(host->GetPpapiHost(), instance, resource),
  90. +#if 0
  91. host_(host),
  92. +#endif
  93. delay_timer_(FROM_HERE,
  94. base::TimeDelta::FromSeconds(45),
  95. this,
  96. @@ -123,6 +129,7 @@ int32_t PepperFlashBrowserHost::OnGetLocalTimeZoneOffset(
  97. int32_t PepperFlashBrowserHost::OnGetLocalDataRestrictions(
  98. ppapi::host::HostMessageContext* context) {
  99. +#if 0
  100. // Getting the Flash LSO settings requires using the CookieSettings which
  101. // belong to the profile which lives on the UI thread. We lazily initialize
  102. // |cookie_settings_| by grabbing the reference from the UI thread and then
  103. @@ -143,9 +150,11 @@ int32_t PepperFlashBrowserHost::OnGetLocalDataRestrictions(
  104. context->MakeReplyMessageContext(), document_url,
  105. plugin_url));
  106. }
  107. - return PP_OK_COMPLETIONPENDING;
  108. +#endif
  109. + return PP_FLASHLSORESTRICTIONS_IN_MEMORY;
  110. }
  111. +#if 0
  112. void PepperFlashBrowserHost::GetLocalDataRestrictions(
  113. ppapi::host::ReplyMessageContext reply_context,
  114. const GURL& document_url,
  115. @@ -174,6 +183,7 @@ void PepperFlashBrowserHost::GetLocalDataRestrictions(
  116. PpapiPluginMsg_Flash_GetLocalDataRestrictionsReply(
  117. static_cast<int32_t>(restrictions)));
  118. }
  119. +#endif
  120. device::mojom::WakeLock* PepperFlashBrowserHost::GetWakeLock() {
  121. // Here is a lazy binding, and will not reconnect after connection error.
  122. diff --git a/chrome/browser/renderer_host/pepper/pepper_flash_browser_host.h b/chrome/browser/renderer_host/pepper/pepper_flash_browser_host.h
  123. index 6b13bae8def62d9a26d68ac8396b4bf6f7439c1a..d92b5a5855c0cebf94922a31f686e15e3a6cd833 100644
  124. --- a/chrome/browser/renderer_host/pepper/pepper_flash_browser_host.h
  125. +++ b/chrome/browser/renderer_host/pepper/pepper_flash_browser_host.h
  126. @@ -24,9 +24,11 @@ namespace content {
  127. class BrowserPpapiHost;
  128. }
  129. +#if 0
  130. namespace content_settings {
  131. class CookieSettings;
  132. }
  133. +#endif
  134. class GURL;
  135. @@ -50,15 +52,19 @@ class PepperFlashBrowserHost : public ppapi::host::ResourceHost {
  136. const base::Time& t);
  137. int32_t OnGetLocalDataRestrictions(ppapi::host::HostMessageContext* context);
  138. +#if 0
  139. void GetLocalDataRestrictions(
  140. ppapi::host::ReplyMessageContext reply_context,
  141. const GURL& document_url,
  142. const GURL& plugin_url,
  143. scoped_refptr<content_settings::CookieSettings> cookie_settings);
  144. +#endif
  145. device::mojom::WakeLock* GetWakeLock();
  146. +#if 0
  147. content::BrowserPpapiHost* host_;
  148. +#endif
  149. int render_process_id_;
  150. // Requests a wake lock to prevent going to sleep, and a timer to cancel it
  151. @@ -66,8 +72,10 @@ class PepperFlashBrowserHost : public ppapi::host::ResourceHost {
  152. mojo::Remote<device::mojom::WakeLock> wake_lock_;
  153. base::DelayTimer delay_timer_;
  154. +#if 0
  155. // For fetching the Flash LSO settings.
  156. scoped_refptr<content_settings::CookieSettings> cookie_settings_;
  157. +#endif
  158. base::WeakPtrFactory<PepperFlashBrowserHost> weak_factory_{this};
  159. DISALLOW_COPY_AND_ASSIGN(PepperFlashBrowserHost);
  160. diff --git a/chrome/browser/renderer_host/pepper/pepper_flash_drm_host.cc b/chrome/browser/renderer_host/pepper/pepper_flash_drm_host.cc
  161. index 2e51425cb66f25f240ad7f4a052bcf6eb76f2062..240fa299b1160ebb2f9b20c7361405c9b84d5d2f 100644
  162. --- a/chrome/browser/renderer_host/pepper/pepper_flash_drm_host.cc
  163. +++ b/chrome/browser/renderer_host/pepper/pepper_flash_drm_host.cc
  164. @@ -20,6 +20,7 @@
  165. #include "content/public/browser/child_process_security_policy.h"
  166. #include "content/public/browser/render_frame_host.h"
  167. #include "content/public/common/pepper_plugin_info.h"
  168. +#include "net/base/network_interfaces.h"
  169. #include "ppapi/c/pp_errors.h"
  170. #include "ppapi/host/dispatch_host_message.h"
  171. #include "ppapi/host/host_message_context.h"
  172. @@ -127,7 +128,9 @@ PepperFlashDRMHost::PepperFlashDRMHost(BrowserPpapiHost* host,
  173. content::ChildProcessSecurityPolicy::GetInstance()->GrantReadFile(
  174. render_process_id, voucher_file);
  175. +#if 0
  176. fetcher_ = new DeviceIDFetcher(render_process_id);
  177. +#endif
  178. monitor_finder_ = new MonitorFinder(render_process_id, render_frame_id);
  179. monitor_finder_->GetMonitor();
  180. }
  181. @@ -150,12 +153,18 @@ int32_t PepperFlashDRMHost::OnResourceMessageReceived(
  182. int32_t PepperFlashDRMHost::OnHostMsgGetDeviceID(
  183. ppapi::host::HostMessageContext* context) {
  184. +#if 0
  185. if (!fetcher_->Start(base::Bind(&PepperFlashDRMHost::GotDeviceID,
  186. weak_factory_.GetWeakPtr(),
  187. context->MakeReplyMessageContext()))) {
  188. return PP_ERROR_INPROGRESS;
  189. }
  190. - return PP_OK_COMPLETIONPENDING;
  191. +#endif
  192. + static std::string id;
  193. + if (id.empty())
  194. + id = net::GetHostName();
  195. + context->reply_msg = PpapiPluginMsg_FlashDRM_GetDeviceIDReply(id);
  196. + return PP_OK;
  197. }
  198. int32_t PepperFlashDRMHost::OnHostMsgGetHmonitor(
  199. @@ -184,6 +193,7 @@ int32_t PepperFlashDRMHost::OnHostMsgMonitorIsExternal(
  200. return PP_OK;
  201. }
  202. +#if 0
  203. void PepperFlashDRMHost::GotDeviceID(
  204. ppapi::host::ReplyMessageContext reply_context,
  205. const std::string& id,
  206. @@ -196,3 +206,4 @@ void PepperFlashDRMHost::GotDeviceID(
  207. host()->SendReply(reply_context,
  208. PpapiPluginMsg_FlashDRM_GetDeviceIDReply(id));
  209. }
  210. +#endif
  211. diff --git a/chrome/browser/renderer_host/pepper/pepper_flash_drm_host.h b/chrome/browser/renderer_host/pepper/pepper_flash_drm_host.h
  212. index b9d2ce7f7f6837ee7b304daac82d21a3147c6faf..4d4b023d62d12b4d119acbfdee64f4157494ccb3 100644
  213. --- a/chrome/browser/renderer_host/pepper/pepper_flash_drm_host.h
  214. +++ b/chrome/browser/renderer_host/pepper/pepper_flash_drm_host.h
  215. @@ -11,7 +11,9 @@
  216. #include "base/macros.h"
  217. #include "base/memory/weak_ptr.h"
  218. +#if 0
  219. #include "chrome/browser/renderer_host/pepper/device_id_fetcher.h"
  220. +#endif
  221. #include "ppapi/host/host_message_context.h"
  222. #include "ppapi/host/resource_host.h"
  223. @@ -49,7 +51,9 @@ class PepperFlashDRMHost : public ppapi::host::ResourceHost {
  224. const std::string& id,
  225. int32_t result);
  226. +#if 0
  227. scoped_refptr<DeviceIDFetcher> fetcher_;
  228. +#endif
  229. scoped_refptr<MonitorFinder> monitor_finder_;
  230. base::WeakPtrFactory<PepperFlashDRMHost> weak_factory_{this};
  231. diff --git a/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.cc b/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.cc
  232. index 00db4e2fa2ac89d89ecd31174e192dcb17f3e912..df5a53c162059270ad673fffebbd432f6df0d212 100644
  233. --- a/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.cc
  234. +++ b/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.cc
  235. @@ -8,17 +8,21 @@
  236. #include "base/stl_util.h"
  237. #include "base/task/post_task.h"
  238. +#if 0
  239. #include "chrome/browser/browser_process.h"
  240. #include "chrome/browser/profiles/profile.h"
  241. #include "chrome/browser/profiles/profile_manager.h"
  242. #include "chrome/common/chrome_switches.h"
  243. #include "chrome/common/pepper_permission_util.h"
  244. +#endif
  245. #include "content/public/browser/browser_ppapi_host.h"
  246. #include "content/public/browser/browser_task_traits.h"
  247. #include "content/public/browser/browser_thread.h"
  248. #include "content/public/browser/child_process_security_policy.h"
  249. #include "content/public/browser/render_view_host.h"
  250. +#if 0
  251. #include "extensions/buildflags/buildflags.h"
  252. +#endif
  253. #include "ppapi/c/pp_errors.h"
  254. #include "ppapi/host/dispatch_host_message.h"
  255. #include "ppapi/host/host_message_context.h"
  256. @@ -27,12 +31,11 @@
  257. #include "ppapi/shared_impl/file_system_util.h"
  258. #include "storage/browser/fileapi/isolated_context.h"
  259. -#if BUILDFLAG(ENABLE_EXTENSIONS)
  260. +#if 0
  261. #include "extensions/browser/extension_registry.h"
  262. #include "extensions/common/constants.h"
  263. #include "extensions/common/extension.h"
  264. #include "extensions/common/extension_set.h"
  265. -#endif
  266. namespace {
  267. @@ -42,6 +45,7 @@ const char* kPredefinedAllowedCrxFsOrigins[] = {
  268. };
  269. } // namespace
  270. +#endif
  271. // static
  272. PepperIsolatedFileSystemMessageFilter*
  273. @@ -69,8 +73,10 @@ PepperIsolatedFileSystemMessageFilter::PepperIsolatedFileSystemMessageFilter(
  274. profile_directory_(profile_directory),
  275. document_url_(document_url),
  276. ppapi_host_(ppapi_host) {
  277. +#if 0
  278. for (size_t i = 0; i < base::size(kPredefinedAllowedCrxFsOrigins); ++i)
  279. allowed_crxfs_origins_.insert(kPredefinedAllowedCrxFsOrigins[i]);
  280. +#endif
  281. }
  282. PepperIsolatedFileSystemMessageFilter::
  283. @@ -95,6 +101,7 @@ int32_t PepperIsolatedFileSystemMessageFilter::OnResourceMessageReceived(
  284. return PP_ERROR_FAILED;
  285. }
  286. +#if 0
  287. Profile* PepperIsolatedFileSystemMessageFilter::GetProfile() {
  288. DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
  289. ProfileManager* profile_manager = g_browser_process->profile_manager();
  290. @@ -121,6 +128,7 @@ PepperIsolatedFileSystemMessageFilter::CreateCrxFileSystem(Profile* profile) {
  291. return storage::IsolatedContext::ScopedFSHandle();
  292. #endif
  293. }
  294. +#endif
  295. int32_t PepperIsolatedFileSystemMessageFilter::OnOpenFileSystem(
  296. ppapi::host::HostMessageContext* context,
  297. @@ -129,7 +137,7 @@ int32_t PepperIsolatedFileSystemMessageFilter::OnOpenFileSystem(
  298. case PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_INVALID:
  299. break;
  300. case PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_CRX:
  301. - return OpenCrxFileSystem(context);
  302. + return PP_ERROR_NOTSUPPORTED;
  303. case PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_PLUGINPRIVATE:
  304. return OpenPluginPrivateFileSystem(context);
  305. }
  306. @@ -139,6 +147,7 @@ int32_t PepperIsolatedFileSystemMessageFilter::OnOpenFileSystem(
  307. return PP_ERROR_FAILED;
  308. }
  309. +#if 0
  310. int32_t PepperIsolatedFileSystemMessageFilter::OpenCrxFileSystem(
  311. ppapi::host::HostMessageContext* context) {
  312. #if BUILDFLAG(ENABLE_EXTENSIONS)
  313. @@ -179,6 +188,7 @@ int32_t PepperIsolatedFileSystemMessageFilter::OpenCrxFileSystem(
  314. return PP_ERROR_NOTSUPPORTED;
  315. #endif
  316. }
  317. +#endif
  318. int32_t PepperIsolatedFileSystemMessageFilter::OpenPluginPrivateFileSystem(
  319. ppapi::host::HostMessageContext* context) {
  320. diff --git a/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.h b/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.h
  321. index 1d5ff1f6aa14812f2a6552f601900b03f3e3c8e7..5b6d0297c874146c21af37b983b2d8ee387b31ce 100644
  322. --- a/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.h
  323. +++ b/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.h
  324. @@ -20,7 +20,9 @@
  325. #include "storage/browser/fileapi/isolated_context.h"
  326. #include "url/gurl.h"
  327. +#if 0
  328. class Profile;
  329. +#endif
  330. namespace content {
  331. class BrowserPpapiHost;
  332. @@ -54,6 +56,7 @@ class PepperIsolatedFileSystemMessageFilter
  333. ~PepperIsolatedFileSystemMessageFilter() override;
  334. +#if 0
  335. Profile* GetProfile();
  336. // Returns filesystem id of isolated filesystem if valid, or empty string
  337. @@ -61,10 +64,13 @@ class PepperIsolatedFileSystemMessageFilter
  338. // allows access on that thread.
  339. storage::IsolatedContext::ScopedFSHandle CreateCrxFileSystem(
  340. Profile* profile);
  341. +#endif
  342. int32_t OnOpenFileSystem(ppapi::host::HostMessageContext* context,
  343. PP_IsolatedFileSystemType_Private type);
  344. +#if 0
  345. int32_t OpenCrxFileSystem(ppapi::host::HostMessageContext* context);
  346. +#endif
  347. int32_t OpenPluginPrivateFileSystem(ppapi::host::HostMessageContext* context);
  348. const int render_process_id_;
  349. @@ -75,8 +81,10 @@ class PepperIsolatedFileSystemMessageFilter
  350. // Not owned by this object.
  351. ppapi::host::PpapiHost* ppapi_host_;
  352. +#if 0
  353. // Set of origins that can use CrxFs private APIs from NaCl.
  354. std::set<std::string> allowed_crxfs_origins_;
  355. +#endif
  356. DISALLOW_COPY_AND_ASSIGN(PepperIsolatedFileSystemMessageFilter);
  357. };
  358. diff --git a/chrome/renderer/pepper/chrome_renderer_pepper_host_factory.cc b/chrome/renderer/pepper/chrome_renderer_pepper_host_factory.cc
  359. index d63e90b6c5079ab3237c4bad3d5e63ce2f99c657..c98a7bd07ddd9527fc67b05b24463ed4b05ec316 100644
  360. --- a/chrome/renderer/pepper/chrome_renderer_pepper_host_factory.cc
  361. +++ b/chrome/renderer/pepper/chrome_renderer_pepper_host_factory.cc
  362. @@ -10,8 +10,10 @@
  363. #include "chrome/renderer/pepper/pepper_flash_fullscreen_host.h"
  364. #include "chrome/renderer/pepper/pepper_flash_menu_host.h"
  365. #include "chrome/renderer/pepper/pepper_flash_renderer_host.h"
  366. +#if 0
  367. #include "chrome/renderer/pepper/pepper_uma_host.h"
  368. #include "components/pdf/renderer/pepper_pdf_host.h"
  369. +#endif
  370. #include "content/public/renderer/renderer_ppapi_host.h"
  371. #include "ppapi/host/ppapi_host.h"
  372. #include "ppapi/host/resource_host.h"
  373. @@ -86,6 +88,7 @@ ChromeRendererPepperHostFactory::CreateResourceHost(
  374. }
  375. }
  376. +#if 0
  377. if (host_->GetPpapiHost()->permissions().HasPermission(
  378. ppapi::PERMISSION_PDF)) {
  379. switch (message.type()) {
  380. @@ -104,6 +107,7 @@ ChromeRendererPepperHostFactory::CreateResourceHost(
  381. return std::make_unique<PepperUMAHost>(host_, instance, resource);
  382. }
  383. }
  384. +#endif
  385. return nullptr;
  386. }
  387. diff --git a/chrome/renderer/pepper/pepper_flash_renderer_host.cc b/chrome/renderer/pepper/pepper_flash_renderer_host.cc
  388. index fc3ef9c9888d84c993fe7682afef0a188da12894..fb5782894ed8aa9fd7ccff09cff8d7f5520af8dd 100644
  389. --- a/chrome/renderer/pepper/pepper_flash_renderer_host.cc
  390. +++ b/chrome/renderer/pepper/pepper_flash_renderer_host.cc
  391. @@ -13,7 +13,9 @@
  392. #include "base/no_destructor.h"
  393. #include "base/stl_util.h"
  394. #include "base/strings/string_util.h"
  395. +#if 0
  396. #include "components/pdf/renderer/pepper_pdf_host.h"
  397. +#endif
  398. #include "content/public/renderer/pepper_plugin_instance.h"
  399. #include "content/public/renderer/render_thread.h"
  400. #include "content/public/renderer/renderer_ppapi_host.h"
  401. @@ -133,9 +135,11 @@ bool IsSimpleHeader(const std::string& lower_case_header_name,
  402. }
  403. void RecordFlashNavigateUsage(FlashNavigateUsage usage) {
  404. +#if 0
  405. DCHECK_NE(FLASH_NAVIGATE_USAGE_ENUM_COUNT, usage);
  406. UMA_HISTOGRAM_ENUMERATION(
  407. "Plugin.FlashNavigateUsage", usage, FLASH_NAVIGATE_USAGE_ENUM_COUNT);
  408. +#endif
  409. }
  410. } // namespace
  411. @@ -374,6 +378,8 @@ int32_t PepperFlashRendererHost::OnIsRectTopmost(
  412. int32_t PepperFlashRendererHost::OnInvokePrinting(
  413. ppapi::host::HostMessageContext* host_context) {
  414. +#if 0
  415. pdf::PepperPDFHost::InvokePrintingForInstance(pp_instance());
  416. - return PP_OK;
  417. +#endif
  418. + return PP_ERROR_FAILED;
  419. }
  420. diff --git a/chrome/renderer/pepper/pepper_helper.h b/chrome/renderer/pepper/pepper_helper.h
  421. index e021c964da3d467530775164a67d5cadaf6dc741..e035f0fb9e2baa6a9148b43765b09c52bc45599b 100644
  422. --- a/chrome/renderer/pepper/pepper_helper.h
  423. +++ b/chrome/renderer/pepper/pepper_helper.h
  424. @@ -6,12 +6,14 @@
  425. #define CHROME_RENDERER_PEPPER_PEPPER_HELPER_H_
  426. #include "base/compiler_specific.h"
  427. +#include "base/component_export.h"
  428. #include "base/macros.h"
  429. #include "content/public/renderer/render_frame_observer.h"
  430. // This class listens for Pepper creation events from the RenderFrame and
  431. // attaches the parts required for Chrome-specific plugin support.
  432. -class PepperHelper : public content::RenderFrameObserver {
  433. +class COMPONENT_EXPORT(PEPPER_FLASH) PepperHelper
  434. + : public content::RenderFrameObserver {
  435. public:
  436. explicit PepperHelper(content::RenderFrame* render_frame);
  437. ~PepperHelper() override;