Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added CefSharp.Core #280

Closed
wants to merge 14 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 15 additions & 9 deletions CefSharp.BrowserSubprocess/CefSharp.BrowserSubprocess.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>..\CefSharp.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand All @@ -79,21 +85,21 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="JavascriptProxy.cs" />
<Compile Include="JavascriptServiceHost.cs" />
<Compile Include="Kernel32.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SubprocessCefApp.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CefSharp\CefSharp.vcxproj">
<Project>{7B495581-2271-4F41-9476-ACB86E8C864F}</Project>
<Name>CefSharp</Name>
</ProjectReference>
<None Include="app.config" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<ProjectReference Include="..\CefSharp.Core\CefSharp.Core.vcxproj">
<Project>{7b495581-2271-4f41-9476-acb86e8c864f}</Project>
<Name>CefSharp.Core</Name>
</ProjectReference>
<ProjectReference Include="..\CefSharp\CefSharp.csproj">
<Project>{a55848cc-10e7-40cb-addb-04740b16dd43}</Project>
<Name>CefSharp</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Expand Down
26 changes: 0 additions & 26 deletions CefSharp.BrowserSubprocess/JavascriptProxy.cs

This file was deleted.

46 changes: 13 additions & 33 deletions CefSharp.BrowserSubprocess/Program.cs
Original file line number Diff line number Diff line change
@@ -1,52 +1,32 @@
using CefSharp.Wrappers;
using System;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;

using CefSharp;
using CefSharp.Internals;

namespace CefSharp.BrowserSubprocess
{
public class Program
{
static int Main(string[] args)
{
LogCommandLine(args);

var subprocessCefApp = SubprocessCefApp.Instance;
subprocessCefApp.ParentProcessId = FindParentProcessId(args);
Kernel32.OutputDebugString("BrowserSubprocess starting up with command line: " + String.Join("\n", args));

//MessageBox.Show("Please attach debugger now", null, MessageBoxButtons.OK, MessageBoxIcon.Information);
var result = ExecuteCefRenderProcess();
Kernel32.OutputDebugString("BrowserSubprocess shutting down.");
return result;
}

private static void LogCommandLine(string[] args)
{
Kernel32.OutputDebugString("BrowserSubprocess starting up with command line: " + String.Join("\n", args));
}
int result = 0;

private static int? FindParentProcessId(IEnumerable<string> args)
{
// Format being parsed:
// --channel=3828.2.1260352072\1102986608
// We only really care about the PID (3828) part.
var channelPrefix = "--channel=";
var channelArgument = args.SingleOrDefault(arg => arg.StartsWith(channelPrefix));
if (channelArgument == null) return null;
using (var subprocess = new CefSubprocessBase())
{
var wrapper = new CefAppWrapper(subprocess);

var parentProcessId = channelArgument
.Substring(channelPrefix.Length)
.Split('.')
.First();
return int.Parse(parentProcessId);
}
result = wrapper.Run(args);
}

private static int ExecuteCefRenderProcess()
{
var hInstance = Process.GetCurrentProcess().Handle;
var subprocessCefApp = SubprocessCefApp.Instance;
return GlobalMethods.CefExecuteProcess(hInstance, subprocessCefApp);
Kernel32.OutputDebugString("BrowserSubprocess shutting down.");
return result;
}
}
}
18 changes: 10 additions & 8 deletions CefSharp.BrowserSubprocess/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
using System.Reflection;
using CefSharp;
using System;
using System.Reflection;
using System.Runtime.InteropServices;

[assembly: AssemblyTitle("CefSharp.BrowserSubprocess")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("The CefSharp Project")]
[assembly: AssemblyProduct("CefSharp.BrowserSubprocess")]
[assembly: AssemblyCopyright("Copyright © The CefSharp Authors 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

[assembly: ComVisible(false)]

[assembly: AssemblyVersion("3.29.0.0")]
[assembly: AssemblyFileVersion("3.29.0.0")]
[assembly: AssemblyCompany(AssemblyInfo.AssemblyCompany)]
[assembly: AssemblyProduct(AssemblyInfo.AssemblyProduct)]
[assembly: AssemblyCopyright(AssemblyInfo.AssemblyCopyright)]
[assembly: ComVisible(AssemblyInfo.ComVisible)]
[assembly: AssemblyVersion(AssemblyInfo.AssemblyVersion)]
[assembly: AssemblyFileVersion(AssemblyInfo.AssemblyFileVersion)]
[assembly: CLSCompliant(AssemblyInfo.ClsCompliant)]
50 changes: 0 additions & 50 deletions CefSharp.BrowserSubprocess/SubprocessCefApp.cs

This file was deleted.

28 changes: 28 additions & 0 deletions CefSharp.Core/AssemblyInfo.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#include "Stdafx.h"

using namespace System;
using namespace System::Reflection;
using namespace System::Runtime::CompilerServices;
using namespace System::Runtime::InteropServices;
using namespace System::Security::Permissions;
using namespace CefSharp;

[assembly:AssemblyTitle("CefSharp.Core")];
[assembly:AssemblyCompany(AssemblyInfo::AssemblyCompany)];
[assembly:AssemblyProduct(AssemblyInfo::AssemblyProduct)];
[assembly:AssemblyCopyright(AssemblyInfo::AssemblyCopyright)]

[assembly:AssemblyVersion(AssemblyInfo::AssemblyVersion)];
[assembly:ComVisible(AssemblyInfo::ComVisible)];
[assembly:CLSCompliant(AssemblyInfo::ClsCompliant)];
[assembly:SecurityPermission(SecurityAction::RequestMinimum, UnmanagedCode = true)];

[assembly:AssemblyDescription("")]
[assembly:AssemblyConfiguration("")]
[assembly:AssemblyTrademark("")]
[assembly:AssemblyCulture("")]

[assembly:InternalsVisibleTo(AssemblyInfo::CefSharpBrowserSubprocessProject)];
[assembly:InternalsVisibleTo(AssemblyInfo::CefSharpWpfProject)];
[assembly:InternalsVisibleTo(AssemblyInfo::CefSharpWinFormsProject)];
[assembly:InternalsVisibleTo(AssemblyInfo::CefSharpTestProject)];
File renamed without changes.