2011-05-20 16:42:25 +02:00
|
|
|
// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights
|
|
|
|
// reserved. Use of this source code is governed by a BSD-style license that
|
|
|
|
// can be found in the LICENSE file.
|
2010-10-16 21:10:11 +02:00
|
|
|
|
2010-10-28 22:38:27 +02:00
|
|
|
#ifndef _CEFCLIENT_UTIL_H
|
|
|
|
#define _CEFCLIENT_UTIL_H
|
2010-10-16 21:10:11 +02:00
|
|
|
|
2011-01-29 02:42:59 +01:00
|
|
|
#include "include/cef.h"
|
|
|
|
|
2011-05-20 16:42:25 +02:00
|
|
|
#if defined(OS_WIN)
|
2010-10-16 21:10:11 +02:00
|
|
|
|
|
|
|
#include <windows.h>
|
|
|
|
|
2011-05-20 16:42:25 +02:00
|
|
|
#ifndef NDEBUG
|
2010-10-16 21:10:11 +02:00
|
|
|
#define ASSERT(condition) if(!(condition)) { DebugBreak(); }
|
|
|
|
#else
|
|
|
|
#define ASSERT(condition) ((void)0)
|
|
|
|
#endif
|
|
|
|
|
2011-05-20 16:42:25 +02:00
|
|
|
#else // !OS_WIN
|
2010-11-15 16:39:56 +01:00
|
|
|
|
|
|
|
#include <assert.h>
|
|
|
|
|
2011-05-20 16:42:25 +02:00
|
|
|
#ifndef NDEBUG
|
2010-11-15 16:39:56 +01:00
|
|
|
#define ASSERT(condition) if(!(condition)) { assert(false); }
|
|
|
|
#else
|
|
|
|
#define ASSERT(condition) ((void)0)
|
|
|
|
#endif
|
|
|
|
|
2011-05-20 16:42:25 +02:00
|
|
|
#endif // !OS_WIN
|
2010-10-16 21:10:11 +02:00
|
|
|
|
2011-01-29 02:42:59 +01:00
|
|
|
#define REQUIRE_UI_THREAD() ASSERT(CefCurrentlyOn(TID_UI));
|
|
|
|
#define REQUIRE_IO_THREAD() ASSERT(CefCurrentlyOn(TID_IO));
|
|
|
|
#define REQUIRE_FILE_THREAD() ASSERT(CefCurrentlyOn(TID_FILE));
|
|
|
|
|
2010-10-28 22:38:27 +02:00
|
|
|
#endif // _CEFCLIENT_UTIL_H
|