security/sandbox/chromium-shim/sandbox/win/sandboxLogging.h
author Boris Chiou <boris.chiou@gmail.com>
Wed, 25 May 2016 17:10:53 +0800
changeset 371285 f3290344ee2948b63d3ea7b9f20e3d6e4a3c6671
parent 367782 a416c55e664816080084ad68453a5c212f1d00a0
child 489668 cbb8fdf1daf98a15f7d57f6b08d273bdf96aa1a0
child 694109 98e2b4ee9775a2a2b5cc1bb8a390bfe901814f38
permissions -rw-r--r--
Bug 1244590 - Part 6: Refactor the calculation of StyleAnimationValue. We want to reuse the StyleAnimationValues of properties of each keyframe when applying spacing and building animation property segments, so refactor this part. MozReview-Commit-ID: 8G56C3BU3FR

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * Set of helper methods to implement logging for Windows sandbox.
 */

#ifndef security_sandbox_sandboxLogging_h__
#define security_sandbox_sandboxLogging_h__

#include "loggingTypes.h"

namespace sandbox {
class TargetPolicy;
}

namespace mozilla {
namespace sandboxing {

// This is used to pass a LogCallback to the sandboxing code, as the logging
// requires code to which we cannot link directly.
void ProvideLogFunction(LogFunction aLogFunction);

// Log a "BLOCKED" msg to the browser console and, if DEBUG build, stderr.
// If the logging of a stack trace is enabled then the default aFramesToSkip
// will start from our caller's caller, which should normally be the function
// that triggered the interception.
void LogBlocked(const char* aFunctionName, const char* aContext = nullptr,
                uint32_t aFramesToSkip = 2);

// Convenience functions to convert to char*.
void LogBlocked(const char* aFunctionName, const wchar_t* aContext);
void LogBlocked(const char* aFunctionName, const wchar_t* aContext,
                uint16_t aLengthInBytes);

// Log a "ALLOWED" msg to the browser console and, if DEBUG build, stderr.
void LogAllowed(const char* aFunctionName, const char* aContext = nullptr);

// Convenience functions to convert to char*.
void LogAllowed(const char* aFunctionName, const wchar_t* aContext);
void LogAllowed(const char* aFunctionName, const wchar_t* aContext,
                uint16_t aLengthInBytes);


} // sandboxing
} // mozilla

#endif // security_sandbox_sandboxLogging_h__