U4-9462 - cleanup units of work, code, fixmes

This commit is contained in:
Stephan
2017-02-17 09:54:50 +01:00
parent 552909fde2
commit 08c8b84a10
52 changed files with 1283 additions and 1481 deletions

View File

@@ -12,16 +12,16 @@ namespace Umbraco.Web.Profiling
{
/// <summary>
/// A profiler used for web based activity based on the MiniProfiler framework
/// </summary>
/// </summary>
internal class WebProfiler : IProfiler
{
private const string BootRequestItemKey = "Umbraco.Web.Profiling.WebProfiler__isBootRequest";
private WebProfilerProvider _provider;
private readonly WebProfilerProvider _provider;
private int _first;
/// <summary>
/// Constructor
/// </summary>
/// </summary>
internal WebProfiler()
{
// create our own provider, which can provide a profiler even during boot
@@ -78,7 +78,7 @@ namespace Umbraco.Web.Profiling
{
// if this is the boot request, or if we should profile this request, stop
// (the boot request is always profiled, no matter what)
var isBootRequest = ((HttpApplication)sender).Context.Items[BootRequestItemKey] != null; // fixme perfs
var isBootRequest = ((HttpApplication)sender).Context.Items[BootRequestItemKey] != null;
if (isBootRequest)
_provider.EndBootRequest();
if (isBootRequest || ShouldProfile(sender))
@@ -87,11 +87,11 @@ namespace Umbraco.Web.Profiling
private bool ShouldProfile(object sender)
{
if (GlobalSettings.DebugMode == false)
if (GlobalSettings.DebugMode == false)
return false;
//will not run in medium trust
if (SystemUtilities.GetCurrentTrustLevel() < AspNetHostingPermissionLevel.High)
if (SystemUtilities.GetCurrentTrustLevel() < AspNetHostingPermissionLevel.High)
return false;
var request = TryGetRequest(sender);
@@ -109,7 +109,7 @@ namespace Umbraco.Web.Profiling
}
/// <summary>
/// Render the UI to display the profiler
/// Render the UI to display the profiler
/// </summary>
/// <returns></returns>
/// <remarks>
@@ -137,7 +137,7 @@ namespace Umbraco.Web.Profiling
/// Start the profiler
/// </summary>
public void Start()
{
{
MiniProfiler.Start();
}
@@ -145,7 +145,7 @@ namespace Umbraco.Web.Profiling
/// Start the profiler
/// </summary>
/// <remarks>
/// set discardResults to false when you want to abandon all profiling, this is useful for
/// set discardResults to false when you want to abandon all profiling, this is useful for
/// when someone is not authenticated or you want to clear the results based on some other mechanism.
/// </remarks>
public void Stop(bool discardResults = false)