From ee5fd34ee66933e6686ca7e354409821a018bc28 Mon Sep 17 00:00:00 2001 From: amaitland Date: Mon, 13 Feb 2017 15:54:07 +1000 Subject: [PATCH] Comment out Cef example - none of the CefSharp examples have the relevant directory present. Update xml comments on Cef.RegisterWidevineCdm Add braces to if check - even single line if statements have braces for consistency --- CefSharp.Core/Cef.h | 41 ++++++++++++++++---------------- CefSharp.Example/CefExample.cs | 2 +- CefSharp/IRegisterCdmCallback.cs | 1 + 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/CefSharp.Core/Cef.h b/CefSharp.Core/Cef.h index 166827eb81..a8be3cb748 100644 --- a/CefSharp.Core/Cef.h +++ b/CefSharp.Core/Cef.h @@ -515,9 +515,8 @@ namespace CefSharp } /// - /// /// Crash reporting is configured using an INI-style config file named - /// "crash_reporter.cfg". This file must be placed next to + /// crash_reporter.cfg. This file must be placed next to /// the main application executable. File contents are as follows: /// /// # Comments start with a hash character and must be on their own line. @@ -615,23 +614,21 @@ namespace CefSharp /// The client application is responsible for downloading an appropriate /// platform-specific CDM binary distribution from Google, extracting the /// contents, and building the required directory structure on the local machine. - /// The IBrowserHost::StartDownload method class can be used + /// The method class can be used /// to implement this functionality in CefSharp. Contact Google via /// https://www.widevine.com/contact.html for details on CDM download. /// /// - /// |path| is a directory that must contain the following files: + /// path is a directory that must contain the following files: /// 1. manifest.json file from the CDM binary distribution (see below). /// 2. widevinecdm file from the CDM binary distribution (e.g. - /// widevinecdm.dll on Windows, libwidevinecdm.dylib on OS X, - /// libwidevinecdm.so on Linux). + /// widevinecdm.dll on Windows). /// 3. widevidecdmadapter file from the CEF binary distribution (e.g. - /// widevinecdmadapter.dll on Windows, widevinecdmadapter.plugin on OS X, - /// libwidevinecdmadapter.so on Linux). + /// widevinecdmadapter.dll on Windows). /// /// If any of these files are missing or if the manifest file has incorrect - /// contents the registration will fail and |callback| will receive an |ErrorCode| - /// value of CdmRegistrationErrorCode.IncorrectContents. + /// contents the registration will fail and callback will receive an ErrorCode + /// value of . /// /// The manifest.json file must contain the following keys: /// A. "os": Supported OS (e.g. "mac", "win" or "linux"). @@ -644,22 +641,22 @@ namespace CefSharp /// /// A through E are used to verify compatibility with the current Chromium /// version. If the CDM is not compatible the registration will fail and - /// |callback| will receive an |ErrorCode| value of - /// CdmRegistrationErrorCode.Incompatible. - /// - /// |callback| will be executed asynchronously once registration is complete. + /// callback will receive an ErrorCode value of . /// - /// On Linux this function must be called before CefInitialize() and the - /// registration cannot be changed during runtime. If registration is not - /// supported at the time that RegisterWidevineCdm() is called then |callback| - /// will receive an |ErrorCode| value of CdmRegistrationErrorCode.NotSupported. + /// If registration is not supported at the time that Cef.RegisterWidevineCdm() is called then callback + /// will receive an ErrorCode value of . /// + /// is a directory that contains the Widevine CDM files + /// optional callback - + /// will be executed asynchronously once registration is complete static void RegisterWidevineCdm(String^ path, [Optional] IRegisterCdmCallback^ callback) { - CefRegisterCdmCallbackAdapter* adapter = nullptr; + CefRefPtr adapter = NULL; if (callback != nullptr) + { adapter = new CefRegisterCdmCallbackAdapter(callback); + } CefRegisterWidevineCdm(StringUtils::ToNative(path), adapter); } @@ -667,11 +664,13 @@ namespace CefSharp /// /// Register the Widevine CDM plugin. /// - /// See RegisterWidevineCdm(String, IRegisterCdmCallback) for more details. + /// See for more details. /// + /// is a directory that contains the Widevine CDM files + /// Returns a Task that can be awaited to receive the response. static Task^ RegisterWidevineCdmAsync(String^ path) { - RegisterCdmCallback^ callback = gcnew RegisterCdmCallback(); + auto callback = gcnew RegisterCdmCallback(); RegisterWidevineCdm(path, callback); diff --git a/CefSharp.Example/CefExample.cs b/CefSharp.Example/CefExample.cs index be5edfc224..2b68653ae6 100644 --- a/CefSharp.Example/CefExample.cs +++ b/CefSharp.Example/CefExample.cs @@ -44,7 +44,7 @@ public static void Init(bool osr, bool multiThreadedMessageLoop, IBrowserProcess // Widevine CDM registration - pass in directory where Widevine CDM binaries and manifest.json are located. // For more information on support for DRM content with Widevine see: https://github.com/cefsharp/CefSharp/issues/1934 - Cef.RegisterWidevineCdm(@".\WidevineCdm"); + //Cef.RegisterWidevineCdm(@".\WidevineCdm"); //Chromium Command Line args //http://peter.sh/experiments/chromium-command-line-switches/ diff --git a/CefSharp/IRegisterCdmCallback.cs b/CefSharp/IRegisterCdmCallback.cs index 80aaf14aca..9e9595d45f 100644 --- a/CefSharp/IRegisterCdmCallback.cs +++ b/CefSharp/IRegisterCdmCallback.cs @@ -3,6 +3,7 @@ // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. using System; + namespace CefSharp { ///