Index: content/ppapi_plugin/ppapi_thread.cc |
diff --git a/content/ppapi_plugin/ppapi_thread.cc b/content/ppapi_plugin/ppapi_thread.cc |
index 85b2c6cb1995e66e9669e38a5b6e769f717a3f9c..1a2781258e0a0da88861463c8adc1a9292e1dc7f 100644 |
--- a/content/ppapi_plugin/ppapi_thread.cc |
+++ b/content/ppapi_plugin/ppapi_thread.cc |
@@ -29,6 +29,7 @@ |
#include "content/child/browser_font_resource_trusted.h" |
#include "content/child/child_process.h" |
#include "content/common/child_process_messages.h" |
+#include "content/common/media/cdm_host_files.h" |
#include "content/ppapi_plugin/broker_process_dispatcher.h" |
#include "content/ppapi_plugin/plugin_process_dispatcher.h" |
#include "content/ppapi_plugin/ppapi_blink_platform_impl.h" |
@@ -354,6 +355,17 @@ void PpapiThread::OnLoadPlugin(const base::FilePath& path, |
} |
} |
+ std::unique_ptr<CdmHostFiles> cdm_host_files; |
xhwang
2016/12/16 01:23:03
Use a local instance such that if we return early
|
+// Open CDM host files before the process is sandboxed. |
+#if defined(OS_WIN) || defined(OS_MACOSX) |
+ if (!is_broker_ && IsCdm(path)) |
+ cdm_host_files = OpenCdmHostFiles(path); |
Greg K
2016/12/16 22:10:41
Am I missing something? Where is this defined?
xhwang
2016/12/16 22:30:15
oops, this is some old code that I didn't update.
Greg K
2016/12/16 22:34:41
Thanks, I'll take a look now.
xhwang
2017/01/18 06:03:59
Done.
|
+#elif defined(OS_LINUX) |
+ cdm_host_files = CdmHostFiles::TakeGlobalInstance(); |
+ if (is_broker_ || !IsCdm(path)) |
+ cdm_host_files.reset(); // Close all opened files. |
+#endif |
+ |
#if defined(OS_WIN) |
// If code subsequently tries to exit using abort(), force a crash (since |
// otherwise these would be silent terminations and fly under the radar). |
@@ -440,6 +452,11 @@ void PpapiThread::OnLoadPlugin(const base::FilePath& path, |
ReportLoadResult(path, INIT_FAILED); |
return; |
} |
+ // Now the process is sandboxed. Verify CDM host. |
+ if (cdm_host_files) { |
+ DCHECK(IsCdm(path)); |
+ cdm_host_files->VerifyFiles(library.get(), path); |
xhwang
2016/12/16 01:08:27
tinskip / hmchen: This will be called right after
Haoming Chen
2017/01/04 22:23:39
Acknowledged.
Haoming Chen
2017/01/04 22:23:39
The interface name on the design doc (https://docs
xhwang
2017/01/12 20:15:02
Nobody would be able to understand what VMP is. So
|
+ } |
} |
// Initialization succeeded, so keep the plugin DLL loaded. |