mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Make CEF compliant with Google/Chromium style (issue #473).
- Add a new check_style tool based on Google's cpplint that can be used to verify compliance of pending changes and specific files/directories. - Update existing CEF source code to be compliant with the style requirements. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@463 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -28,21 +28,20 @@
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
#ifndef _CEF_MAC_H
|
||||
#define _CEF_MAC_H
|
||||
#ifndef CEF_INCLUDE_INTERNAL_CEF_MAC_H_
|
||||
#define CEF_INCLUDE_INTERNAL_CEF_MAC_H_
|
||||
#pragma once
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#include <pthread.h>
|
||||
#include "cef_types_mac.h"
|
||||
#include "cef_types_wrappers.h"
|
||||
#include "include/internal/cef_types_mac.h"
|
||||
#include "include/internal/cef_types_wrappers.h"
|
||||
|
||||
// Atomic increment and decrement.
|
||||
inline long CefAtomicIncrement(long volatile *pDest)
|
||||
{
|
||||
inline long CefAtomicIncrement(long volatile *pDest) { // NOLINT(runtime/int)
|
||||
return __sync_add_and_fetch(pDest, 1);
|
||||
}
|
||||
inline long CefAtomicDecrement(long volatile *pDest)
|
||||
{
|
||||
inline long CefAtomicDecrement(long volatile *pDest) { // NOLINT(runtime/int)
|
||||
return __sync_sub_and_fetch(pDest, 1);
|
||||
}
|
||||
|
||||
@@ -51,26 +50,21 @@ inline long CefAtomicDecrement(long volatile *pDest)
|
||||
#define CefCursorHandle cef_cursor_handle_t
|
||||
|
||||
// Critical section wrapper.
|
||||
class CefCriticalSection
|
||||
{
|
||||
public:
|
||||
CefCriticalSection()
|
||||
{
|
||||
class CefCriticalSection {
|
||||
public:
|
||||
CefCriticalSection() {
|
||||
pthread_mutexattr_init(&attr_);
|
||||
pthread_mutexattr_settype(&attr_, PTHREAD_MUTEX_RECURSIVE);
|
||||
pthread_mutex_init(&lock_, &attr_);
|
||||
}
|
||||
virtual ~CefCriticalSection()
|
||||
{
|
||||
virtual ~CefCriticalSection() {
|
||||
pthread_mutex_destroy(&lock_);
|
||||
pthread_mutexattr_destroy(&attr_);
|
||||
}
|
||||
void Lock()
|
||||
{
|
||||
void Lock() {
|
||||
pthread_mutex_lock(&lock_);
|
||||
}
|
||||
void Unlock()
|
||||
{
|
||||
void Unlock() {
|
||||
pthread_mutex_unlock(&lock_);
|
||||
}
|
||||
|
||||
@@ -83,13 +77,12 @@ struct CefWindowInfoTraits {
|
||||
|
||||
static inline void init(struct_type* s) {}
|
||||
|
||||
static inline void clear(struct_type* s)
|
||||
{
|
||||
static inline void clear(struct_type* s) {
|
||||
cef_string_clear(&s->m_windowName);
|
||||
}
|
||||
|
||||
static inline void set(const struct_type* src, struct_type* target, bool copy)
|
||||
{
|
||||
static inline void set(const struct_type* src, struct_type* target,
|
||||
bool copy) {
|
||||
target->m_View = src->m_View;
|
||||
target->m_ParentView = src->m_ParentView;
|
||||
cef_string_set(src->m_windowName.str, src->m_windowName.length,
|
||||
@@ -103,18 +96,16 @@ struct CefWindowInfoTraits {
|
||||
};
|
||||
|
||||
// Class representing window information.
|
||||
class CefWindowInfo : public CefStructBase<CefWindowInfoTraits>
|
||||
{
|
||||
public:
|
||||
class CefWindowInfo : public CefStructBase<CefWindowInfoTraits> {
|
||||
public:
|
||||
typedef CefStructBase<CefWindowInfoTraits> parent;
|
||||
|
||||
CefWindowInfo() : parent() {}
|
||||
CefWindowInfo(const cef_window_info_t& r) : parent(r) {}
|
||||
CefWindowInfo(const CefWindowInfo& r) : parent(r) {}
|
||||
|
||||
explicit CefWindowInfo(const cef_window_info_t& r) : parent(r) {}
|
||||
explicit CefWindowInfo(const CefWindowInfo& r) : parent(r) {}
|
||||
|
||||
void SetAsChild(CefWindowHandle ParentView, int x, int y, int width,
|
||||
int height)
|
||||
{
|
||||
int height) {
|
||||
m_ParentView = ParentView;
|
||||
m_x = x;
|
||||
m_y = y;
|
||||
@@ -130,8 +121,8 @@ struct CefPrintInfoTraits {
|
||||
static inline void init(struct_type* s) {}
|
||||
static inline void clear(struct_type* s) {}
|
||||
|
||||
static inline void set(const struct_type* src, struct_type* target, bool copy)
|
||||
{
|
||||
static inline void set(const struct_type* src, struct_type* target,
|
||||
bool copy) {
|
||||
target->m_Scale = src->m_Scale;
|
||||
}
|
||||
};
|
||||
@@ -139,6 +130,6 @@ struct CefPrintInfoTraits {
|
||||
// Class representing print context information.
|
||||
typedef CefStructBase<CefPrintInfoTraits> CefPrintInfo;
|
||||
|
||||
#endif // OS_MACOSX
|
||||
#endif // OS_MACOSX
|
||||
|
||||
#endif // _CEF_MAC_H
|
||||
#endif // CEF_INCLUDE_INTERNAL_CEF_MAC_H_
|
||||
|
Reference in New Issue
Block a user