protected override void OnBeforeChildProcessLaunch(CefCommandLine commandLine)
 {
     Debug.WriteLine(DBGPREFIX + "OnBeforeChildProcessLaunch");
     var handler = OnBeforeChildProcessLaunchEvent;
     if (handler != null)
     {
         Debug.WriteLine(DBGPREFIX + "OnBeforeChildProcessLaunch Delegate");
         var e = new OnBeforeChildProcessLaunchEventArgs(commandLine);
         handler(this, e);
     }
 }
 protected override void OnBeforeCommandLineProcessing(string processType, CefCommandLine commandLine)
 {
     // only happens if configuration is bad
     if (arguments != null)
     {
         foreach (String argument in arguments)
         {
             commandLine.AppendSwitch(argument);
         }
     }
 }
 /// <summary>
 /// Returns a writable copy of this object.
 /// </summary>
 public CefCommandLine Copy()
 {
     return(CefCommandLine.FromNative(cef_command_line_t.copy(_self)));
 }
 /// <summary>
 /// Create a new CefCommandLine instance.
 /// </summary>
 public static CefCommandLine Create()
 {
     return(CefCommandLine.FromNative(cef_command_line_t.create()));
 }
 /// <summary>
 /// Called before a child process is launched. Will be called on the browser
 /// process UI thread when launching a render process and on the browser
 /// process IO thread when launching a GPU or plugin process. Provides an
 /// opportunity to modify the child process command line. Do not keep a
 /// reference to |command_line| outside of this method.
 /// </summary>
 protected virtual void OnBeforeChildProcessLaunch(CefCommandLine commandLine)
 {
 }
 protected override void OnBeforeCommandLineProcessing(string processType, CefCommandLine commandLine)
 {
     ;
 }
Beispiel #7
0
 /// <summary>
 /// Provides an opportunity to view and/or modify command-line arguments before
 /// processing by CEF and Chromium. The |process_type| value will be empty for
 /// the browser process. Do not keep a reference to the CefCommandLine object
 /// passed to this method. The CefSettings.command_line_args_disabled value
 /// can be used to start with an empty command-line object. Any values
 /// specified in CefSettings that equate to command-line arguments will be set
 /// before this method is called. Be cautious when using this method to modify
 /// command-line arguments for non-browser processes as this may result in
 /// undefined behavior including crashes.
 /// </summary>
 protected virtual void OnBeforeCommandLineProcessing(string processType, CefCommandLine commandLine)
 {
 }
Beispiel #8
0
        /// <summary>
        /// Launches the process specified via |command_line|. Returns true upon
        /// success. Must be called on the browser process TID_PROCESS_LAUNCHER thread.
        ///
        /// Unix-specific notes:
        /// - All file descriptors open in the parent process will be closed in the
        ///   child process except for stdin, stdout, and stderr.
        /// - If the first argument on the command line does not contain a slash,
        ///   PATH will be searched. (See man execvp.)
        /// </summary>
        public static bool LaunchProcess(CefCommandLine commandLine)
        {
            if (commandLine == null) throw new ArgumentNullException("commandLine");

            return libcef.launch_process(commandLine.ToNative()) != 0;
        }
 internal OnBeforeChildProcessLaunchEventArgs(CefCommandLine _commandLine)
 {
     commandLine = _commandLine;
 }
Beispiel #10
0
 /// <summary>
 /// Provides an opportunity to view and/or modify command-line arguments before
 /// processing by CEF and Chromium. The |process_type| value will be empty for
 /// the browser process. Do not keep a reference to the CefCommandLine object
 /// passed to this method. The CefSettings.command_line_args_disabled value
 /// can be used to start with an empty command-line object. Any values
 /// specified in CefSettings that equate to command-line arguments will be set
 /// before this method is called. Be cautious when using this method to modify
 /// command-line arguments for non-browser processes as this may result in
 /// undefined behavior including crashes.
 /// </summary>
 protected virtual void OnBeforeCommandLineProcessing(string processType, CefCommandLine commandLine)
 {
 }
 protected override void OnBeforeCommandLineProcessing(string processType, CefCommandLine commandLine)
 {
     commandLine.AppendSwitch("disable-gpu", "1");
     commandLine.AppendSwitch("off-screen-rendering-enabled", "1");
 }
 /// <summary>
 /// Called before a child process is launched. Will be called on the browser
 /// process UI thread when launching a render process and on the browser
 /// process IO thread when launching a GPU or plugin process. Provides an
 /// opportunity to modify the child process command line. Do not keep a
 /// reference to |command_line| outside of this method.
 /// </summary>
 protected virtual void OnBeforeChildProcessLaunch(CefCommandLine commandLine)
 {
 }
        protected override void OnBeforeCommandLineProcessing(string processType, CefCommandLine commandLine)
        {
            // only happens if configuration is bad
            if (arguments != null)
            {
                foreach (String argument in arguments)
                {
                    string normalizedArgument = argument;
                    if (argument.StartsWith("--"))
                    {
                        if (argument.Length > 2)
                        {
                            normalizedArgument = argument.Substring(2);
                        }
                        else
                        {
                            Console.WriteLine(
                                "BrowserApp::OnBeforeCommandLineProcessing bad argument {0}",
                                argument);
                            continue;
                        }
                    }

                    int argSplitIndex = normalizedArgument.IndexOf('=');
                    if (argSplitIndex >= 0)
                    {
                        string name = normalizedArgument.Substring(0, argSplitIndex);
                        string value = normalizedArgument.Substring(argSplitIndex + 1);

                        if (value.StartsWith("\"") && value.EndsWith("\""))
                        {
                            value = value.Substring(1, value.Length - 2);
                        }

                        commandLine.AppendSwitch(name, value);
                    }
                    else
                    {
                        commandLine.AppendSwitch(normalizedArgument);
                    }
                }
            }

            // If these were not manually specified then
            // try to add pepflashplayer.dll
            if (!commandLine.HasSwitch("ppapi-out-of-process") &&
                !commandLine.HasSwitch("register-pepper-plugins"))
            {
                string flashPluginPath = Path.Combine(
                    CLRBrowserSourcePlugin.AssemblyDirectory,
                    "CLRBrowserSourcePlugin", "pepflashplayer.dll");

                if (File.Exists(flashPluginPath))
                {
                    commandLine.AppendSwitch("ppapi-out-of-process");

                    string flashPluginValue = flashPluginPath +
                        ";application/x-shockwave-flash";

                    commandLine.AppendSwitch("register-pepper-plugins",
                        flashPluginValue);
                }
            }
        }